Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 18 Oct 2007 23:00:02 +0000 (16:00 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 18 Oct 2007 23:00:02 +0000 (16:00 -0700)
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (37 commits)
  ide: set drive->autotune in ide_pci_setup_ports()
  triflex: always tune PIO
  opti621: always tune PIO
  cy82c693: always tune PIO
  cs5520: always tune PIO
  alim15x3: always tune PIO
  ide: add IDE_HFLAG_LEGACY_IRQS host flag
  ide: add IDE_HFLAG_SERIALIZE host flag
  ide: add IDE_HFLAG_ERROR_STOPS_FIFO host flag
  piix: add DECLARE_ICH_DEV() macro
  pdc202xx_old: add DECLARE_PDC2026X_DEV() macro
  pdc202xx_new: add DECLARE_PDCNEW_DEV() macro
  aec62xx: no need to disable UDMA in ->init_hwif method for ATP850UF
  ide: remove .init_setup from ide_pci_device_t
  serverworks: remove ->init_setup
  scc_pata: remove ->init_setup
  pdc202xx_old: remove ->init_setup
  pdc202xx_new: remove ->init_setup
  hpt366: remove ->init_setup
  cmd64x: remove ->init_setup
  ...

550 files changed:
Documentation/IPMI.txt
Documentation/atomic_ops.txt
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
Documentation/memory-barriers.txt
Documentation/parport-lowlevel.txt
Documentation/power/basic-pm-debugging.txt
Documentation/power/freezing-of-tasks.txt
Documentation/power/interface.txt
Documentation/sound/oss/es1371 [deleted file]
MAINTAINERS
arch/arm/common/sharpsl_pm.c
arch/arm/mach-at91/pm.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-pnx4008/pm.c
arch/arm/mach-pxa/pm.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-sa1100/pm.c
arch/arm/nwfpe/fpopcode.h
arch/arm/plat-s3c24xx/pm.c
arch/blackfin/mach-common/pm.c
arch/ia64/kernel/time.c
arch/ia64/sn/kernel/xpnet.c
arch/mips/Kconfig
arch/mips/au1000/Kconfig
arch/mips/jazz/irq.c
arch/mips/jazz/setup.c
arch/mips/jmr3927/rbhma3100/setup.c
arch/mips/kernel/Makefile
arch/mips/kernel/cevt-r4k.c [new file with mode: 0644]
arch/mips/kernel/head.S
arch/mips/kernel/time.c
arch/mips/kernel/traps.c
arch/mips/pmc-sierra/Kconfig
arch/mips/sgi-ip27/ip27-irq.c
arch/mips/sgi-ip27/ip27-timer.c
arch/mips/sgi-ip32/ip32-setup.c
arch/mips/vr41xx/Kconfig
arch/powerpc/configs/pmac32_defconfig
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/time.c
arch/powerpc/platforms/52xx/lite5200_pm.c
arch/powerpc/platforms/52xx/mpc52xx_pm.c
arch/sh/boards/hp6xx/pm.c
arch/sparc/kernel/of_device.c
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/pci_common.c
arch/sparc64/lib/atomic.S
arch/sparc64/lib/bitops.S
arch/um/drivers/slip_kern.c
arch/um/drivers/slirp_kern.c
arch/x86/ia32/ia32_binfmt.c
arch/x86/kernel/acpi/wakeup_32.S
arch/x86/kernel/acpi/wakeup_64.S
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mcheck/therm_throt.c
arch/x86/kernel/mce_64.c
arch/x86/kernel/msr.c
arch/x86/kernel/suspend_64.c
arch/x86/kernel/suspend_asm_64.S
arch/x86/kernel/vsyscall_64.c
arch/x86_64/Kconfig
drivers/Kconfig
drivers/Makefile
drivers/acpi/sleep/main.c
drivers/ata/Kconfig
drivers/ata/Makefile
drivers/ata/libata-sff.c
drivers/ata/pata_acpi.c
drivers/ata/pata_bf54x.c
drivers/ata/pdc_adma.c
drivers/ata/sata_fsl.c [new file with mode: 0644]
drivers/ata/sata_mv.c
drivers/ata/sata_sil24.c
drivers/base/dmapool.c
drivers/base/power/trace.c
drivers/base/topology.c
drivers/block/xsysace.c
drivers/cdrom/cdrom.c
drivers/char/Kconfig
drivers/char/apm-emulation.c
drivers/char/cyclades.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/ipmi/ipmi_watchdog.c
drivers/char/isicom.c
drivers/char/moxa.c
drivers/char/mxser.c
drivers/char/mxser_new.c
drivers/char/pty.c
drivers/char/random.c
drivers/char/rocket.c
drivers/char/rocket_int.h
drivers/char/tty_ioctl.c
drivers/char/vt.c
drivers/char/watchdog/Kconfig [deleted file]
drivers/char/watchdog/Makefile [deleted file]
drivers/char/watchdog/acquirewdt.c [deleted file]
drivers/char/watchdog/advantechwdt.c [deleted file]
drivers/char/watchdog/alim1535_wdt.c [deleted file]
drivers/char/watchdog/alim7101_wdt.c [deleted file]
drivers/char/watchdog/at32ap700x_wdt.c [deleted file]
drivers/char/watchdog/at91rm9200_wdt.c [deleted file]
drivers/char/watchdog/bfin_wdt.c [deleted file]
drivers/char/watchdog/booke_wdt.c [deleted file]
drivers/char/watchdog/cpu5wdt.c [deleted file]
drivers/char/watchdog/davinci_wdt.c [deleted file]
drivers/char/watchdog/ep93xx_wdt.c [deleted file]
drivers/char/watchdog/eurotechwdt.c [deleted file]
drivers/char/watchdog/i6300esb.c [deleted file]
drivers/char/watchdog/iTCO_vendor_support.c [deleted file]
drivers/char/watchdog/iTCO_wdt.c [deleted file]
drivers/char/watchdog/ib700wdt.c [deleted file]
drivers/char/watchdog/ibmasr.c [deleted file]
drivers/char/watchdog/indydog.c [deleted file]
drivers/char/watchdog/iop_wdt.c [deleted file]
drivers/char/watchdog/ixp2000_wdt.c [deleted file]
drivers/char/watchdog/ixp4xx_wdt.c [deleted file]
drivers/char/watchdog/ks8695_wdt.c [deleted file]
drivers/char/watchdog/machzwd.c [deleted file]
drivers/char/watchdog/mixcomwd.c [deleted file]
drivers/char/watchdog/mpc5200_wdt.c [deleted file]
drivers/char/watchdog/mpc83xx_wdt.c [deleted file]
drivers/char/watchdog/mpc8xx_wdt.c [deleted file]
drivers/char/watchdog/mpcore_wdt.c [deleted file]
drivers/char/watchdog/mtx-1_wdt.c [deleted file]
drivers/char/watchdog/mv64x60_wdt.c [deleted file]
drivers/char/watchdog/omap_wdt.c [deleted file]
drivers/char/watchdog/omap_wdt.h [deleted file]
drivers/char/watchdog/pc87413_wdt.c [deleted file]
drivers/char/watchdog/pcwd.c [deleted file]
drivers/char/watchdog/pcwd_pci.c [deleted file]
drivers/char/watchdog/pcwd_usb.c [deleted file]
drivers/char/watchdog/pnx4008_wdt.c [deleted file]
drivers/char/watchdog/rm9k_wdt.c [deleted file]
drivers/char/watchdog/s3c2410_wdt.c [deleted file]
drivers/char/watchdog/sa1100_wdt.c [deleted file]
drivers/char/watchdog/sbc60xxwdt.c [deleted file]
drivers/char/watchdog/sbc8360.c [deleted file]
drivers/char/watchdog/sbc_epx_c3.c [deleted file]
drivers/char/watchdog/sc1200wdt.c [deleted file]
drivers/char/watchdog/sc520_wdt.c [deleted file]
drivers/char/watchdog/scx200_wdt.c [deleted file]
drivers/char/watchdog/shwdt.c [deleted file]
drivers/char/watchdog/smsc37b787_wdt.c [deleted file]
drivers/char/watchdog/softdog.c [deleted file]
drivers/char/watchdog/w83627hf_wdt.c [deleted file]
drivers/char/watchdog/w83697hf_wdt.c [deleted file]
drivers/char/watchdog/w83877f_wdt.c [deleted file]
drivers/char/watchdog/w83977f_wdt.c [deleted file]
drivers/char/watchdog/wafer5823wdt.c [deleted file]
drivers/char/watchdog/wd501p.h [deleted file]
drivers/char/watchdog/wdrtas.c [deleted file]
drivers/char/watchdog/wdt.c [deleted file]
drivers/char/watchdog/wdt285.c [deleted file]
drivers/char/watchdog/wdt977.c [deleted file]
drivers/char/watchdog/wdt_pci.c [deleted file]
drivers/dma/ioat.c
drivers/dma/ioat_dca.c
drivers/dma/ioat_dma.c
drivers/dma/ioatdma.h
drivers/hwmon/adm1026.c
drivers/hwmon/lm63.c
drivers/hwmon/vt1211.c
drivers/hwmon/w83791d.c
drivers/hwmon/w83792d.c
drivers/i2c/busses/i2c-pmcmsp.c
drivers/i2c/busses/i2c-pnx.c
drivers/i2c/chips/menelaus.c
drivers/infiniband/hw/ehca/ehca_main.c
drivers/input/gameport/gameport.c
drivers/input/serio/serio.c
drivers/input/touchscreen/ucb1400_ts.c
drivers/isdn/gigaset/common.c
drivers/isdn/hardware/avm/b1.c
drivers/isdn/hardware/avm/c4.c
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/video/v4l1-compat.c
drivers/mtd/nand/s3c2410.c
drivers/net/ax88796.c
drivers/net/bnx2.c
drivers/net/bnx2_fw2.h
drivers/net/ehea/ehea_main.c
drivers/net/myri10ge/myri10ge.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/sky2.c
drivers/net/usb/mcs7830.c
drivers/net/xen-netfront.c
drivers/of/platform.c
drivers/parport/daisy.c
drivers/parport/procfs.c
drivers/power/ds2760_battery.c
drivers/ps3/ps3stor_lib.c
drivers/rtc/rtc-sysfs.c
drivers/sbus/char/vfc.h
drivers/sbus/char/vfc_dev.c
drivers/scsi/ipr.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/serial/serial_core.c
drivers/spi/spi_bfin5xx.c
drivers/spi/spi_imx.c
drivers/ssb/Kconfig
drivers/ssb/driver_mipscore.c
drivers/usb/class/cdc-acm.c
drivers/usb/core/endpoint.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/host/ohci-s3c2410.c
drivers/usb/misc/adutux.c
drivers/usb/misc/iowarrior.c
drivers/usb/misc/phidgetmotorcontrol.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/ipw.c
drivers/usb/serial/mos7720.c
drivers/usb/serial/oti6858.c
drivers/usb/serial/sierra.c
drivers/usb/storage/usb.c
drivers/video/au1100fb.c
drivers/video/console/newport_con.c
drivers/video/gxt4500.c
drivers/video/logo/logo.c
drivers/video/modedb.c
drivers/video/omap/blizzard.c
drivers/video/omap/dispc.c
drivers/video/omap/hwa742.c
drivers/video/omap/rfbi.c
drivers/w1/masters/ds1wm.c
drivers/watchdog/Kconfig [new file with mode: 0644]
drivers/watchdog/Makefile [new file with mode: 0644]
drivers/watchdog/acquirewdt.c [new file with mode: 0644]
drivers/watchdog/advantechwdt.c [new file with mode: 0644]
drivers/watchdog/alim1535_wdt.c [new file with mode: 0644]
drivers/watchdog/alim7101_wdt.c [new file with mode: 0644]
drivers/watchdog/at32ap700x_wdt.c [new file with mode: 0644]
drivers/watchdog/at91rm9200_wdt.c [new file with mode: 0644]
drivers/watchdog/bfin_wdt.c [new file with mode: 0644]
drivers/watchdog/booke_wdt.c [new file with mode: 0644]
drivers/watchdog/cpu5wdt.c [new file with mode: 0644]
drivers/watchdog/davinci_wdt.c [new file with mode: 0644]
drivers/watchdog/ep93xx_wdt.c [new file with mode: 0644]
drivers/watchdog/eurotechwdt.c [new file with mode: 0644]
drivers/watchdog/i6300esb.c [new file with mode: 0644]
drivers/watchdog/iTCO_vendor_support.c [new file with mode: 0644]
drivers/watchdog/iTCO_wdt.c [new file with mode: 0644]
drivers/watchdog/ib700wdt.c [new file with mode: 0644]
drivers/watchdog/ibmasr.c [new file with mode: 0644]
drivers/watchdog/indydog.c [new file with mode: 0644]
drivers/watchdog/iop_wdt.c [new file with mode: 0644]
drivers/watchdog/ixp2000_wdt.c [new file with mode: 0644]
drivers/watchdog/ixp4xx_wdt.c [new file with mode: 0644]
drivers/watchdog/ks8695_wdt.c [new file with mode: 0644]
drivers/watchdog/machzwd.c [new file with mode: 0644]
drivers/watchdog/mixcomwd.c [new file with mode: 0644]
drivers/watchdog/mpc5200_wdt.c [new file with mode: 0644]
drivers/watchdog/mpc83xx_wdt.c [new file with mode: 0644]
drivers/watchdog/mpc8xx_wdt.c [new file with mode: 0644]
drivers/watchdog/mpcore_wdt.c [new file with mode: 0644]
drivers/watchdog/mtx-1_wdt.c [new file with mode: 0644]
drivers/watchdog/mv64x60_wdt.c [new file with mode: 0644]
drivers/watchdog/omap_wdt.c [new file with mode: 0644]
drivers/watchdog/omap_wdt.h [new file with mode: 0644]
drivers/watchdog/pc87413_wdt.c [new file with mode: 0644]
drivers/watchdog/pcwd.c [new file with mode: 0644]
drivers/watchdog/pcwd_pci.c [new file with mode: 0644]
drivers/watchdog/pcwd_usb.c [new file with mode: 0644]
drivers/watchdog/pnx4008_wdt.c [new file with mode: 0644]
drivers/watchdog/rm9k_wdt.c [new file with mode: 0644]
drivers/watchdog/s3c2410_wdt.c [new file with mode: 0644]
drivers/watchdog/sa1100_wdt.c [new file with mode: 0644]
drivers/watchdog/sbc60xxwdt.c [new file with mode: 0644]
drivers/watchdog/sbc8360.c [new file with mode: 0644]
drivers/watchdog/sbc_epx_c3.c [new file with mode: 0644]
drivers/watchdog/sc1200wdt.c [new file with mode: 0644]
drivers/watchdog/sc520_wdt.c [new file with mode: 0644]
drivers/watchdog/scx200_wdt.c [new file with mode: 0644]
drivers/watchdog/shwdt.c [new file with mode: 0644]
drivers/watchdog/smsc37b787_wdt.c [new file with mode: 0644]
drivers/watchdog/softdog.c [new file with mode: 0644]
drivers/watchdog/w83627hf_wdt.c [new file with mode: 0644]
drivers/watchdog/w83697hf_wdt.c [new file with mode: 0644]
drivers/watchdog/w83877f_wdt.c [new file with mode: 0644]
drivers/watchdog/w83977f_wdt.c [new file with mode: 0644]
drivers/watchdog/wafer5823wdt.c [new file with mode: 0644]
drivers/watchdog/wd501p.h [new file with mode: 0644]
drivers/watchdog/wdrtas.c [new file with mode: 0644]
drivers/watchdog/wdt.c [new file with mode: 0644]
drivers/watchdog/wdt285.c [new file with mode: 0644]
drivers/watchdog/wdt977.c [new file with mode: 0644]
drivers/watchdog/wdt_pci.c [new file with mode: 0644]
drivers/xen/xenbus/xenbus_probe.c
fs/Kconfig
fs/aio.c
fs/attr.c
fs/autofs/waitq.c
fs/autofs4/waitq.c
fs/cifs/inode.c
fs/compat_ioctl.c
fs/cramfs/inode.c
fs/ecryptfs/inode.c
fs/eventpoll.c
fs/ext3/fsync.c
fs/ext3/inode.c
fs/ext3/resize.c
fs/ext3/super.c
fs/ext4/balloc.c
fs/ext4/dir.c
fs/ext4/extents.c
fs/ext4/fsync.c
fs/ext4/group.h [new file with mode: 0644]
fs/ext4/ialloc.c
fs/ext4/inode.c
fs/ext4/namei.c
fs/ext4/resize.c
fs/ext4/super.c
fs/ext4/xattr.c
fs/fuse/dir.c
fs/fuse/file.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/jbd/commit.c
fs/jbd/journal.c
fs/jbd/transaction.c
fs/jbd2/commit.c
fs/jbd2/journal.c
fs/jbd2/recovery.c
fs/jbd2/revoke.c
fs/jbd2/transaction.c
fs/namei.c
fs/nfs/inode.c
fs/nfsd/vfs.c
fs/nls/nls_base.c
fs/reiserfs/inode.c
include/asm-alpha/bitops.h
include/asm-arm/arch-pxa/pm.h
include/asm-arm/bitops.h
include/asm-avr32/bitops.h
include/asm-blackfin/bitops.h
include/asm-blackfin/processor.h
include/asm-cris/bitops.h
include/asm-frv/bitops.h
include/asm-generic/bitops.h
include/asm-generic/bitops/lock.h [new file with mode: 0644]
include/asm-h8300/bitops.h
include/asm-ia64/bitops.h
include/asm-m32r/bitops.h
include/asm-m68k/bitops.h
include/asm-m68knommu/bitops.h
include/asm-mips/bitops.h
include/asm-mips/mach-ip27/kernel-entry-init.h
include/asm-mips/time.h
include/asm-parisc/bitops.h
include/asm-powerpc/bitops.h
include/asm-powerpc/mpc52xx.h
include/asm-powerpc/paca.h
include/asm-ppc/time.h
include/asm-s390/bitops.h
include/asm-sh/bitops.h
include/asm-sh64/bitops.h
include/asm-sparc/bitops.h
include/asm-sparc/ioctls.h
include/asm-sparc/of_platform.h
include/asm-sparc/termbits.h
include/asm-sparc/termios.h
include/asm-sparc64/backoff.h [new file with mode: 0644]
include/asm-sparc64/bitops.h
include/asm-sparc64/ioctls.h
include/asm-sparc64/of_platform.h
include/asm-sparc64/termbits.h
include/asm-sparc64/termios.h
include/asm-v850/bitops.h
include/asm-x86/bitops_32.h
include/asm-x86/bitops_64.h
include/asm-x86/suspend_64.h
include/asm-xtensa/bitops.h
include/linux/aio.h
include/linux/bit_spinlock.h
include/linux/capability.h
include/linux/clocksource.h
include/linux/compiler-gcc.h
include/linux/compiler.h
include/linux/console.h
include/linux/cpu.h
include/linux/cyclades.h
include/linux/dma-mapping.h
include/linux/ext3_fs.h
include/linux/ext4_fs.h
include/linux/ext4_fs_extents.h
include/linux/ext4_fs_i.h
include/linux/ext4_fs_sb.h
include/linux/ext4_jbd2.h
include/linux/filter.h
include/linux/freezer.h
include/linux/fs.h
include/linux/fuse.h
include/linux/hrtimer.h
include/linux/ipmi.h
include/linux/ipmi_smi.h
include/linux/jbd.h
include/linux/jbd2.h
include/linux/kernel_stat.h
include/linux/libata.h
include/linux/netdevice.h
include/linux/netfilter/xt_sctp.h
include/linux/of_platform.h
include/linux/parport.h
include/linux/pm.h
include/linux/poison.h
include/linux/sched.h
include/linux/security.h
include/linux/suspend.h
include/linux/sysctl.h
include/linux/taskstats.h
include/net/inet_frag.h
include/net/ipv6.h
include/net/sock.h
include/net/xfrm.h
init/do_mounts_rd.c
ipc/mqueue.c
kernel/Makefile
kernel/acct.c
kernel/audit.c
kernel/auditfilter.c
kernel/auditsc.c
kernel/capability.c
kernel/compat.c
kernel/cpu.c
kernel/cpuset.c
kernel/delayacct.c
kernel/dma.c
kernel/exec_domain.c
kernel/fork.c
kernel/futex.c
kernel/hrtimer.c
kernel/itimer.c
kernel/kexec.c
kernel/module.c
kernel/panic.c
kernel/params.c
kernel/posix-timers.c
kernel/power/Kconfig
kernel/power/disk.c
kernel/power/main.c
kernel/power/power.h
kernel/power/process.c
kernel/power/snapshot.c
kernel/power/swsusp.c
kernel/power/user.c
kernel/printk.c
kernel/relay.c
kernel/sched.c
kernel/sched_debug.c
kernel/sched_stats.h
kernel/signal.c
kernel/sys.c
kernel/sysctl.c
kernel/sysctl_check.c [new file with mode: 0644]
kernel/time.c
kernel/timer.c
kernel/tsacct.c
lib/crc32.c
lib/libcrc32c.c
mm/filemap.c
mm/hugetlb.c
mm/mremap.c
mm/slab.c
mm/vmscan.c
net/atm/br2684.c
net/core/filter.c
net/core/neighbour.c
net/core/pktgen.c
net/core/sock.c
net/dccp/input.c
net/dccp/sysctl.c
net/ieee80211/ieee80211_crypt_tkip.c
net/ipv4/inet_fragment.c
net/ipv4/ip_fragment.c
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_input.c
net/ipv4/xfrm4_input.c
net/ipv4/xfrm4_mode_beet.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv4/xfrm4_output.c
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_state.c
net/ipv4/xfrm4_tunnel.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/ah6.c
net/ipv6/esp6.c
net/ipv6/ip6_flowlabel.c
net/ipv6/ipcomp6.c
net/ipv6/ndisc.c
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/reassembly.c
net/ipv6/route.c
net/ipv6/xfrm6_input.c
net/ipv6/xfrm6_mode_beet.c
net/ipv6/xfrm6_mode_ro.c
net/ipv6/xfrm6_mode_tunnel.c
net/ipv6/xfrm6_output.c
net/ipv6/xfrm6_policy.c
net/ipv6/xfrm6_state.c
net/ipv6/xfrm6_tunnel.c
net/irda/ircomm/ircomm_tty_attach.c
net/irda/irsysctl.c
net/mac80211/ieee80211_ioctl.c
net/mac80211/ieee80211_sta.c
net/netfilter/nf_conntrack_proto_generic.c
net/netfilter/nf_conntrack_proto_sctp.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_udp.c
net/netfilter/xt_sctp.c
net/sched/sch_generic.c
net/sunrpc/sysctl.c
net/xfrm/xfrm_input.c
net/xfrm/xfrm_output.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c
scripts/checkpatch.pl
security/commoncap.c
security/dummy.c
security/selinux/xfrm.c
sound/arm/aaci.c
sound/oss/Makefile
sound/oss/dmasound/Makefile
sound/oss/dmasound/awacs_defs.h [deleted file]
sound/oss/dmasound/dac3550a.c [deleted file]
sound/oss/dmasound/dmasound.h
sound/oss/dmasound/dmasound_awacs.c [deleted file]
sound/oss/dmasound/dmasound_core.c
sound/oss/dmasound/tas3001c.c [deleted file]
sound/oss/dmasound/tas3001c.h [deleted file]
sound/oss/dmasound/tas3001c_tables.c [deleted file]
sound/oss/dmasound/tas3004.c [deleted file]
sound/oss/dmasound/tas3004.h [deleted file]
sound/oss/dmasound/tas3004_tables.c [deleted file]
sound/oss/dmasound/tas_common.c [deleted file]
sound/oss/dmasound/tas_common.h [deleted file]
sound/oss/dmasound/tas_eq_prefs.h [deleted file]
sound/oss/dmasound/tas_ioctl.h [deleted file]
sound/oss/dmasound/trans_16.c [deleted file]
sound/oss/es1371.c [deleted file]

index 24dc3fcf15948e8a9ed93043cf46c0e81f929c36..bc38283379f01d107ec710d96c0863109b68622e 100644 (file)
@@ -441,17 +441,20 @@ ACPI, and if none of those then a KCS device at the spec-specified
 0xca2.  If you want to turn this off, set the "trydefaults" option to
 false.
 
-If you have high-res timers compiled into the kernel, the driver will
-use them to provide much better performance.  Note that if you do not
-have high-res timers enabled in the kernel and you don't have
-interrupts enabled, the driver will run VERY slowly.  Don't blame me,
+If your IPMI interface does not support interrupts and is a KCS or
+SMIC interface, the IPMI driver will start a kernel thread for the
+interface to help speed things up.  This is a low-priority kernel
+thread that constantly polls the IPMI driver while an IPMI operation
+is in progress.  The force_kipmid module parameter will all the user to
+force this thread on or off.  If you force it off and don't have
+interrupts, the driver will run VERY slowly.  Don't blame me,
 these interfaces suck.
 
 The driver supports a hot add and remove of interfaces.  This way,
 interfaces can be added or removed after the kernel is up and running.
-This is done using /sys/modules/ipmi_si/hotmod, which is a write-only
-parameter.  You write a string to this interface.  The string has the
-format:
+This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a
+write-only parameter.  You write a string to this interface.  The string
+has the format:
    <op1>[:op2[:op3...]]
 The "op"s are:
    add|remove,kcs|bt|smic,mem|i/o,<address>[,<opt1>[,<opt2>[,...]]]
@@ -581,9 +584,11 @@ The watchdog will panic and start a 120 second reset timeout if it
 gets a pre-action.  During a panic or a reboot, the watchdog will
 start a 120 timer if it is running to make sure the reboot occurs.
 
-Note that if you use the NMI preaction for the watchdog, you MUST
-NOT use nmi watchdog mode 1.  If you use the NMI watchdog, you
-must use mode 2.
+Note that if you use the NMI preaction for the watchdog, you MUST NOT
+use the nmi watchdog.  There is no reasonable way to tell if an NMI
+comes from the IPMI controller, so it must assume that if it gets an
+otherwise unhandled NMI, it must be from IPMI and it will panic
+immediately.
 
 Once you open the watchdog timer, you must write a 'V' character to the
 device to close it, or the timer will not stop.  This is a new semantic
index d46306fea230cda4a21ee19da45337ab39898918..f20c10c2858fc7c60f3003a77c905bf108dfddd7 100644 (file)
@@ -418,6 +418,20 @@ brothers:
         */
         smp_mb__after_clear_bit();
 
+There are two special bitops with lock barrier semantics (acquire/release,
+same as spinlocks). These operate in the same way as their non-_lock/unlock
+postfixed variants, except that they are to provide acquire/release semantics,
+respectively. This means they can be used for bit_spin_trylock and
+bit_spin_unlock type operations without specifying any more barriers.
+
+       int test_and_set_bit_lock(unsigned long nr, unsigned long *addr);
+       void clear_bit_unlock(unsigned long nr, unsigned long *addr);
+       void __clear_bit_unlock(unsigned long nr, unsigned long *addr);
+
+The __clear_bit_unlock version is non-atomic, however it still implements
+unlock barrier semantics. This can be useful if the lock itself is protecting
+the other bits in the word.
+
 Finally, there are non-atomic versions of the bitmask operations
 provided.  They are used in contexts where some other higher-level SMP
 locking scheme is being used to protect the bitmask, and thus less
index 280ec06573e659314a4ddcb4e0b17511e8208ea6..6b0f963f5379eb252045f553617cd11c51fc80ac 100644 (file)
@@ -82,6 +82,41 @@ Who: Dominik Brodowski <linux@brodo.de>
 
 ---------------------------
 
+What:  sys_sysctl
+When:  September 2010
+Option: CONFIG_SYSCTL_SYSCALL
+Why:   The same information is available in a more convenient from
+       /proc/sys, and none of the sysctl variables appear to be
+       important performance wise.
+
+       Binary sysctls are a long standing source of subtle kernel
+       bugs and security issues.
+
+       When I looked several months ago all I could find after
+       searching several distributions were 5 user space programs and
+       glibc (which falls back to /proc/sys) using this syscall.
+
+       The man page for sysctl(2) documents it as unusable for user
+       space programs.
+
+       sysctl(2) is not generally ABI compatible to a 32bit user
+       space application on a 64bit and a 32bit kernel.
+
+       For the last several months the policy has been no new binary
+       sysctls and no one has put forward an argument to use them.
+
+       Binary sysctls issues seem to keep happening appearing so
+       properly deprecating them (with a warning to user space) and a
+       2 year grace warning period will mean eventually we can kill
+       them and end the pain.
+
+       In the mean time individual binary sysctls can be dealt with
+       in a piecewise fashion.
+
+Who:   Eric Biederman <ebiederm@xmission.com>
+
+---------------------------
+
 What:  a.out interpreter support for ELF executables
 When:  2.6.25
 Files: fs/binfmt_elf.c
@@ -184,13 +219,6 @@ Who:       Jean Delvare <khali@linux-fr.org>,
 
 ---------------------------
 
-What:  drivers depending on OBSOLETE_OSS
-When:  options in 2.6.22, code in 2.6.24
-Why:   OSS drivers with ALSA replacements
-Who:   Adrian Bunk <bunk@stusta.de>
-
----------------------------
-
 What:  ACPI procfs interface
 When:  July 2008
 Why:   ACPI sysfs conversion should be finished by January 2008.
index 98cf90f2631d736021478528fab34281a79b5659..189df0bcab99bfa1dfdeff83c1fd8d67a7fe83d3 100644 (file)
@@ -479,6 +479,16 @@ and is between 256 and 4096 characters. It is defined in the file
                        UART at the specified I/O port or MMIO address.
                        The options are the same as for ttyS, above.
 
+       no_console_suspend
+                       [HW] Never suspend the console
+                       Disable suspending of consoles during suspend and
+                       hibernate operations.  Once disabled, debugging
+                       messages can reach various consoles while the rest
+                       of the system is being put to sleep (ie, while
+                       debugging driver suspend/resume hooks).  This may
+                       not work reliably with all consoles, but is known
+                       to work with serial and VGA consoles.
+
        cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
                        Format:
                        <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
index 650657c5473340dcd8f5ffe5f097c6776a754441..4e17beba237902908b33d38b764c285fec433724 100644 (file)
@@ -1479,7 +1479,8 @@ kernel.
 
 Any atomic operation that modifies some state in memory and returns information
 about the state (old or new) implies an SMP-conditional general memory barrier
-(smp_mb()) on each side of the actual operation.  These include:
+(smp_mb()) on each side of the actual operation (with the exception of
+explicit lock operations, described later).  These include:
 
        xchg();
        cmpxchg();
@@ -1536,10 +1537,19 @@ If they're used for constructing a lock of some description, then they probably
 do need memory barriers as a lock primitive generally has to do things in a
 specific order.
 
-
 Basically, each usage case has to be carefully considered as to whether memory
 barriers are needed or not.
 
+The following operations are special locking primitives:
+
+       test_and_set_bit_lock();
+       clear_bit_unlock();
+       __clear_bit_unlock();
+
+These implement LOCK-class and UNLOCK-class operations. These should be used in
+preference to other operations when implementing locking primitives, because
+their implementations can be optimised on many architectures.
+
 [!] Note that special memory barrier primitives are available for these
 situations because on some CPUs the atomic instructions used imply full memory
 barriers, and so barrier instructions are superfluous in conjunction with them,
index 8f2302415eff90b0df7aa655f132f9567ff9ccd7..265fcdcb8e5f3cdc4a0826697be57ae7ebda3c54 100644 (file)
@@ -25,7 +25,6 @@ Global functions:
   parport_open
   parport_close
   parport_device_id
-  parport_device_num
   parport_device_coords
   parport_find_class
   parport_find_device
@@ -735,7 +734,7 @@ NULL is returned.
 
 SEE ALSO
 
-parport_register_device, parport_device_num
+parport_register_device
 \f
 parport_close - unregister device for particular device number
 -------------
@@ -787,29 +786,7 @@ Many devices have ill-formed IEEE 1284 Device IDs.
 
 SEE ALSO
 
-parport_find_class, parport_find_device, parport_device_num
-\f
-parport_device_num - convert device coordinates to device number
-------------------
-
-SYNOPSIS
-
-#include <linux/parport.h>
-
-int parport_device_num (int parport, int mux, int daisy);
-
-DESCRIPTION
-
-Convert between device coordinates (port, multiplexor, daisy chain
-address) and device number (zero-based).
-
-RETURN VALUE
-
-Device number, or -1 if no device at given coordinates.
-
-SEE ALSO
-
-parport_device_coords, parport_open, parport_device_id
+parport_find_class, parport_find_device
 \f
 parport_device_coords - convert device number to device coordinates
 ------------------
@@ -833,7 +810,7 @@ Zero on success, in which case the coordinates are (*parport, *mux,
 
 SEE ALSO
 
-parport_device_num, parport_open, parport_device_id
+parport_open, parport_device_id
 \f
 parport_find_class - find a device by its class
 ------------------
index 1a85e2b964dca0e34f4411cfef0098f6606c46b5..57aef2f6e0de6ad30673d8ce34a5430dc59ec5ab 100644 (file)
@@ -78,8 +78,8 @@ c) Advanced debugging
 In case the STD does not work on your system even in the minimal configuration
 and compiling more drivers as modules is not practical or some modules cannot
 be unloaded, you can use one of the more advanced debugging techniques to find
-the problem.  First, if there is a serial port in your box, you can set the
-CONFIG_DISABLE_CONSOLE_SUSPEND kernel configuration option and try to log kernel
+the problem.  First, if there is a serial port in your box, you can boot the
+kernel with the 'no_console_suspend' parameter and try to log kernel
 messages using the serial console.  This may provide you with some information
 about the reasons of the suspend (resume) failure.  Alternatively, it may be
 possible to use a FireWire port for debugging with firescope
index 04dc1cf9d2155a3488d2fe557d7f82b76a06ecc8..38b57248fd61f5755528837145052c5c998c17b7 100644 (file)
@@ -19,12 +19,13 @@ we only consider hibernation, but the description also applies to suspend).
 Namely, as the first step of the hibernation procedure the function
 freeze_processes() (defined in kernel/power/process.c) is called.  It executes
 try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and
-sends a fake signal to each of them.  A task that receives such a signal and has
-TIF_FREEZE set, should react to it by calling the refrigerator() function
-(defined in kernel/power/process.c), which sets the task's PF_FROZEN flag,
-changes its state to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is
-cleared for it.  Then, we say that the task is 'frozen' and therefore the set of
-functions handling this mechanism is called 'the freezer' (these functions are
+either wakes them up, if they are kernel threads, or sends fake signals to them,
+if they are user space processes.  A task that has TIF_FREEZE set, should react
+to it by calling the function called refrigerator() (defined in
+kernel/power/process.c), which sets the task's PF_FROZEN flag, changes its state
+to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it.
+Then, we say that the task is 'frozen' and therefore the set of functions
+handling this mechanism is referred to as 'the freezer' (these functions are
 defined in kernel/power/process.c and include/linux/freezer.h).  User space
 processes are generally frozen before kernel threads.
 
@@ -35,21 +36,27 @@ task enter refrigerator() if the flag is set.
 
 For user space processes try_to_freeze() is called automatically from the
 signal-handling code, but the freezable kernel threads need to call it
-explicitly in suitable places.  The code to do this may look like the following:
+explicitly in suitable places or use the wait_event_freezable() or
+wait_event_freezable_timeout() macros (defined in include/linux/freezer.h)
+that combine interruptible sleep with checking if TIF_FREEZE is set and calling
+try_to_freeze().  The main loop of a freezable kernel thread may look like the
+following one:
 
+       set_freezable();
        do {
                hub_events();
-               wait_event_interruptible(khubd_wait,
-                                       !list_empty(&hub_event_list));
-               try_to_freeze();
-       } while (!signal_pending(current));
+               wait_event_freezable(khubd_wait,
+                               !list_empty(&hub_event_list) ||
+                               kthread_should_stop());
+       } while (!kthread_should_stop() || !list_empty(&hub_event_list));
 
 (from drivers/usb/core/hub.c::hub_thread()).
 
 If a freezable kernel thread fails to call try_to_freeze() after the freezer has
 set TIF_FREEZE for it, the freezing of tasks will fail and the entire
 hibernation operation will be cancelled.  For this reason, freezable kernel
-threads must call try_to_freeze() somewhere.
+threads must call try_to_freeze() somewhere or use one of the
+wait_event_freezable() and wait_event_freezable_timeout() macros.
 
 After the system memory state has been restored from a hibernation image and
 devices have been reinitialized, the function thaw_processes() is called in
@@ -81,7 +88,16 @@ hibernation image has been created and before the system is finally powered off.
 The majority of these are user space processes, but if any of the kernel threads
 may cause something like this to happen, they have to be freezable.
 
-2. The second reason is to prevent user space processes and some kernel threads
+2. Next, to create the hibernation image we need to free a sufficient amount of
+memory (approximately 50% of available RAM) and we need to do that before
+devices are deactivated, because we generally need them for swapping out.  Then,
+after the memory for the image has been freed, we don't want tasks to allocate
+additional memory and we prevent them from doing that by freezing them earlier.
+[Of course, this also means that device drivers should not allocate substantial
+amounts of memory from their .suspend() callbacks before hibernation, but this
+is e separate issue.]
+
+3. The third reason is to prevent user space processes and some kernel threads
 from interfering with the suspending and resuming of devices.  A user space
 process running on a second CPU while we are suspending devices may, for
 example, be troublesome and without the freezing of tasks we would need some
@@ -111,7 +127,7 @@ frozen before the driver's .suspend() callback is executed and it will be
 thawed after the driver's .resume() callback has run, so it won't be accessing
 the device while it's suspended.
 
-3. Another reason for freezing tasks is to prevent user space processes from
+4. Another reason for freezing tasks is to prevent user space processes from
 realizing that hibernation (or suspend) operation takes place.  Ideally, user
 space processes should not notice that such a system-wide operation has occurred
 and should continue running without any problems after the restore (or resume
index fd5192a8fa8abebd12fe86aefd99404978d88f34..e67211fe0ee2f432044efe62e8909702f0b46fc9 100644 (file)
@@ -20,7 +20,7 @@ states.
 /sys/power/disk controls the operating mode of the suspend-to-disk
 mechanism. Suspend-to-disk can be handled in several ways. We have a
 few options for putting the system to sleep - using the platform driver
-(e.g. ACPI or other pm_ops), powering off the system or rebooting the
+(e.g. ACPI or other suspend_ops), powering off the system or rebooting the
 system (for testing).
 
 Additionally, /sys/power/disk can be used to turn on one of the two testing
diff --git a/Documentation/sound/oss/es1371 b/Documentation/sound/oss/es1371
deleted file mode 100644 (file)
index c315126..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/proc/sound, /dev/sndstat
--------------------------
-
-/proc/sound and /dev/sndstat is not supported by the
-driver. To find out whether the driver succeeded loading,
-check the kernel log (dmesg).
-
-
-ALaw/uLaw sample formats
-------------------------
-
-This driver does not support the ALaw/uLaw sample formats.
-ALaw is the default mode when opening a sound device
-using OSS/Free. The reason for the lack of support is
-that the hardware does not support these formats, and adding
-conversion routines to the kernel would lead to very ugly
-code in the presence of the mmap interface to the driver.
-And since xquake uses mmap, mmap is considered important :-)
-and no sane application uses ALaw/uLaw these days anyway.
-In short, playing a Sun .au file as follows:
-
-cat my_file.au > /dev/dsp
-
-does not work. Instead, you may use the play script from
-Chris Bagwell's sox-12.14 package (available from the URL
-below) to play many different audio file formats.
-The script automatically determines the audio format
-and does do audio conversions if necessary.
-http://home.sprynet.com/sprynet/cbagwell/projects.html
-
-
-Blocking vs. nonblocking IO
----------------------------
-
-Unlike OSS/Free this driver honours the O_NONBLOCK file flag
-not only during open, but also during read and write.
-This is an effort to make the sound driver interface more
-regular. Timidity has problems with this; a patch
-is available from http://www.ife.ee.ethz.ch/~sailer/linux/pciaudio.html.
-(Timidity patched will also run on OSS/Free).
-
-
-MIDI UART
----------
-
-The driver supports a simple MIDI UART interface, with
-no ioctl's supported.
-
-
-MIDI synthesizer
-----------------
-
-This soundcard does not have any hardware MIDI synthesizer;
-MIDI synthesis has to be done in software. To allow this
-the driver/soundcard supports two PCM (/dev/dsp) interfaces.
-
-There is a freely available software package that allows
-MIDI file playback on this soundcard called Timidity.
-See http://www.cgs.fi/~tt/timidity/.
-
-
-
-Thomas Sailer
-t.sailer@alumni.ethz.ch
index 10deabeb3929f674e462da6f6a5667fd08784e17..2534dc4aa95a58cfe8b6d617f1ec424ac74a7d5f 100644 (file)
@@ -2234,7 +2234,7 @@ S:        Supported
 KEXEC
 P:     Eric Biederman
 M:     ebiederm@xmission.com
-W:     http://www.xmission.com/~ebiederm/files/kexec/
+W:     http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
 L:     linux-kernel@vger.kernel.org
 L:     kexec@lists.infradead.org
 S:     Maintained
@@ -2940,13 +2940,6 @@ L:       linux-kernel@vger.kernel.org
 L:     linux-pci@atrey.karlin.mff.cuni.cz
 S:     Supported
 
-PCI SOUND DRIVERS (ES1370, ES1371 and SONICVIBES)
-P:     Thomas Sailer
-M:     sailer@ife.ee.ethz.ch
-L:     linux-sound@vger.kernel.org
-W:     http://www.ife.ee.ethz.ch/~sailer/linux/pciaudio.html
-S:     Maintained
-
 PCI SUBSYSTEM
 P:     Greg Kroah-Hartman
 M:     gregkh@suse.de
index 111a7fa5debee4ace5a39f1aa5c50b2ab3927683..5bba5255b119dc7ee18d72cc8efc2d8c1d2963c2 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/platform_device.h>
 #include <linux/leds.h>
 #include <linux/apm-emulation.h>
+#include <linux/suspend.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -765,9 +766,9 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info)
        info->battery_life = sharpsl_pm.battstat.mainbat_percent;
 }
 
-static struct pm_ops sharpsl_pm_ops = {
+static struct platform_suspend_ops sharpsl_pm_ops = {
        .enter          = corgi_pxa_pm_enter,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
 };
 
 static int __init sharpsl_pm_probe(struct platform_device *pdev)
@@ -799,7 +800,7 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
 
        apm_get_power_status = sharpsl_apm_get_power_status;
 
-       pm_set_ops(&sharpsl_pm_ops);
+       suspend_set_ops(&sharpsl_pm_ops);
 
        mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250));
 
@@ -808,7 +809,7 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
 
 static int sharpsl_pm_remove(struct platform_device *pdev)
 {
-       pm_set_ops(NULL);
+       suspend_set_ops(NULL);
 
        device_remove_file(&pdev->dev, &dev_attr_battery_percentage);
        device_remove_file(&pdev->dev, &dev_attr_battery_voltage);
index ddf9184d561d2c82d4efe9e5a23ea07c6e62af35..98cb61482917a921d5ddaec2bc13925999097a0b 100644 (file)
  * (at your option) any later version.
  */
 
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
-#include <linux/pm.h>
 #include <linux/interrupt.h>
 #include <linux/sysfs.h>
 #include <linux/module.h>
@@ -199,7 +198,7 @@ error:
 }
 
 
-static struct pm_ops at91_pm_ops ={
+static struct platform_suspend_ops at91_pm_ops ={
        .valid          = at91_pm_valid_state,
        .set_target     = at91_pm_set_target,
        .enter          = at91_pm_enter,
@@ -220,7 +219,7 @@ static int __init at91_pm_init(void)
        /* Disable SDRAM low-power mode.  Cannot be used with self-refresh. */
        at91_sys_write(AT91_SDRAMC_LPR, 0);
 
-       pm_set_ops(&at91_pm_ops);
+       suspend_set_ops(&at91_pm_ops);
 
        return 0;
 }
index 089b8208de0e4b25cb1b1a34a2d2b3a816ad802d..3bf01e28df334ceaaf49dc55c8d4cd59e00c09d4 100644 (file)
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
-#include <linux/pm.h>
 #include <linux/interrupt.h>
 #include <linux/sysfs.h>
 #include <linux/module.h>
@@ -600,27 +599,15 @@ static void (*saved_idle)(void) = NULL;
 
 /*
  *     omap_pm_prepare - Do preliminary suspend work.
- *     @state:         suspend state we're entering.
  *
  */
-static int omap_pm_prepare(suspend_state_t state)
+static int omap_pm_prepare(void)
 {
-       int error = 0;
-
        /* We cannot sleep in idle until we have resumed */
        saved_idle = pm_idle;
        pm_idle = NULL;
 
-       switch (state)
-       {
-       case PM_SUSPEND_STANDBY:
-       case PM_SUSPEND_MEM:
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       return error;
+       return 0;
 }
 
 
@@ -648,16 +635,14 @@ static int omap_pm_enter(suspend_state_t state)
 
 /**
  *     omap_pm_finish - Finish up suspend sequence.
- *     @state:         State we're coming out of.
  *
  *     This is called after we wake back up (or if entering the sleep state
  *     failed).
  */
 
-static int omap_pm_finish(suspend_state_t state)
+static void omap_pm_finish(void)
 {
        pm_idle = saved_idle;
-       return 0;
 }
 
 
@@ -674,11 +659,11 @@ static struct irqaction omap_wakeup_irq = {
 
 
 
-static struct pm_ops omap_pm_ops ={
+static struct platform_suspend_ops omap_pm_ops ={
        .prepare        = omap_pm_prepare,
        .enter          = omap_pm_enter,
        .finish         = omap_pm_finish,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
 };
 
 static int __init omap_pm_init(void)
@@ -735,7 +720,7 @@ static int __init omap_pm_init(void)
        else if (cpu_is_omap16xx())
                omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3);
 
-       pm_set_ops(&omap_pm_ops);
+       suspend_set_ops(&omap_pm_ops);
 
 #if defined(DEBUG) && defined(CONFIG_PROC_FS)
        omap_pm_init_proc();
index 6f4a5436d0ce858f33598f3f6fb77800614a6318..baf7d82b458b968b61b1127e646cb17150812c0c 100644 (file)
  * published by the Free Software Foundation.
  */
 
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
-#include <linux/pm.h>
 #include <linux/interrupt.h>
 #include <linux/sysfs.h>
 #include <linux/module.h>
@@ -71,28 +70,12 @@ void omap2_pm_idle(void)
        local_irq_enable();
 }
 
-static int omap2_pm_prepare(suspend_state_t state)
+static int omap2_pm_prepare(void)
 {
-       int error = 0;
-
        /* We cannot sleep in idle until we have resumed */
        saved_idle = pm_idle;
        pm_idle = NULL;
-
-       switch (state)
-       {
-       case PM_SUSPEND_STANDBY:
-       case PM_SUSPEND_MEM:
-               break;
-
-       case PM_SUSPEND_DISK:
-               return -ENOTSUPP;
-
-       default:
-               return -EINVAL;
-       }
-
-       return error;
+       return 0;
 }
 
 #define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) |    \
@@ -353,9 +336,6 @@ static int omap2_pm_enter(suspend_state_t state)
        case PM_SUSPEND_MEM:
                ret = omap2_pm_suspend();
                break;
-       case PM_SUSPEND_DISK:
-               ret = -ENOTSUPP;
-               break;
        default:
                ret = -EINVAL;
        }
@@ -363,17 +343,16 @@ static int omap2_pm_enter(suspend_state_t state)
        return ret;
 }
 
-static int omap2_pm_finish(suspend_state_t state)
+static void omap2_pm_finish(void)
 {
        pm_idle = saved_idle;
-       return 0;
 }
 
-static struct pm_ops omap_pm_ops = {
+static struct platform_suspend_ops omap_pm_ops = {
        .prepare        = omap2_pm_prepare,
        .enter          = omap2_pm_enter,
        .finish         = omap2_pm_finish,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
 };
 
 int __init omap2_pm_init(void)
@@ -397,7 +376,7 @@ int __init omap2_pm_init(void)
        omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
                                            omap24xx_cpu_suspend_sz);
 
-       pm_set_ops(&omap_pm_ops);
+       suspend_set_ops(&omap_pm_ops);
        pm_idle = omap2_pm_idle;
 
        pmdomain_init();
index 2a137f33f752698daac232049e4fcd3309d30581..40116d2543496c284af73a8fde5d94c789951cd5 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/rtc.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/delay.h>
 #include <linux/clk.h>
 
@@ -117,7 +117,7 @@ static int pnx4008_pm_valid(suspend_state_t state)
               (state == PM_SUSPEND_MEM);
 }
 
-static struct pm_ops pnx4008_pm_ops = {
+static struct platform_suspend_ops pnx4008_pm_ops = {
        .enter = pnx4008_pm_enter,
        .valid = pnx4008_pm_valid,
 };
@@ -146,7 +146,7 @@ static int __init pnx4008_pm_init(void)
                return -ENOMEM;
        }
 
-       pm_set_ops(&pnx4008_pm_ops);
+       suspend_set_ops(&pnx4008_pm_ops);
        return 0;
 }
 
index b59a81a8e7d32d35d1ad9c3b1ce4cc833bf7eb7b..a941c71c7d06cb36be51c43dfb3f456da7c344b9 100644 (file)
@@ -86,7 +86,7 @@ static int pxa_pm_valid(suspend_state_t state)
        return -EINVAL;
 }
 
-static struct pm_ops pxa_pm_ops = {
+static struct platform_suspend_ops pxa_pm_ops = {
        .valid          = pxa_pm_valid,
        .enter          = pxa_pm_enter,
 };
@@ -104,7 +104,7 @@ static int __init pxa_pm_init(void)
                return -ENOMEM;
        }
 
-       pm_set_ops(&pxa_pm_ops);
+       suspend_set_ops(&pxa_pm_ops);
        return 0;
 }
 
index 0d6a72504caa2cf67e97a0365bffd870d94404c9..dcd81f8d0833f28da844c3e468bf89ea8becfa40 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/pm.h>
+#include <linux/suspend.h>
 
 #include <asm/hardware.h>
 #include <asm/arch/irqs.h>
@@ -215,7 +215,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
 
 static struct pxa_cpu_pm_fns pxa25x_cpu_pm_fns = {
        .save_size      = SLEEP_SAVE_SIZE,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
        .save           = pxa25x_cpu_pm_save,
        .restore        = pxa25x_cpu_pm_restore,
        .enter          = pxa25x_cpu_pm_enter,
index 2d7fc39732e444a7aa981dd63f0a8de3a3aed5bd..d0f2b597db12541ae15514dcf86d8e8d479e8490 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/platform_device.h>
 
 #include <asm/hardware.h>
index 01a37d3c0727de0c631dcbcd5e9c5378433c2946..246c573e7252dc0d833f1325222809bd1782e36d 100644 (file)
@@ -122,14 +122,14 @@ unsigned long sleep_phys_sp(void *sp)
        return virt_to_phys(sp);
 }
 
-static struct pm_ops sa11x0_pm_ops = {
+static struct platform_suspend_ops sa11x0_pm_ops = {
        .enter          = sa11x0_pm_enter,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
 };
 
 static int __init sa11x0_pm_init(void)
 {
-       pm_set_ops(&sa11x0_pm_ops);
+       suspend_set_ops(&sa11x0_pm_ops);
        return 0;
 }
 
index ec78e3517fc9fccb55a560e26b389b9c9b95f4a4..0090b19bbe616203f2a94ec4987d5a596cfa1ae5 100644 (file)
@@ -369,20 +369,20 @@ TABLE 5
 #define getRoundingMode(opcode)                ((opcode & MASK_ROUNDING_MODE) >> 5)
 
 #ifdef CONFIG_FPE_NWFPE_XP
-static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex)
+static inline floatx80 __pure getExtendedConstant(const unsigned int nIndex)
 {
        extern const floatx80 floatx80Constant[];
        return floatx80Constant[nIndex];
 }
 #endif
 
-static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex)
+static inline float64 __pure getDoubleConstant(const unsigned int nIndex)
 {
        extern const float64 float64Constant[];
        return float64Constant[nIndex];
 }
 
-static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex)
+static inline float32 __pure getSingleConstant(const unsigned int nIndex)
 {
        extern const float32 float32Constant[];
        return float32Constant[nIndex];
index eab1850616d860ef5488cbc4f5c489d0f763da49..4fdb3117744fe1f543f1ee78aa3f7df9fb81b237 100644 (file)
@@ -612,9 +612,9 @@ static int s3c2410_pm_enter(suspend_state_t state)
        return 0;
 }
 
-static struct pm_ops s3c2410_pm_ops = {
+static struct platform_suspend_ops s3c2410_pm_ops = {
        .enter          = s3c2410_pm_enter,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
 };
 
 /* s3c2410_pm_init
@@ -628,6 +628,6 @@ int __init s3c2410_pm_init(void)
 {
        printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n");
 
-       pm_set_ops(&s3c2410_pm_ops);
+       suspend_set_ops(&s3c2410_pm_ops);
        return 0;
 }
index b103027222024d9218b1b983c5c7041d8a46e689..dac51fb06f22b5f2e8037f923c52c13ac693d383 100644 (file)
@@ -32,7 +32,7 @@
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/sched.h>
 #include <linux/proc_fs.h>
 #include <linux/io.h>
@@ -89,28 +89,15 @@ void bfin_pm_suspend_standby_enter(void)
 #endif                         /* CONFIG_PM_WAKEUP_GPIO_BY_SIC_IWR */
 }
 
-
 /*
- *     bfin_pm_prepare - Do preliminary suspend work.
- *     @state:         suspend state we're entering.
+ *     bfin_pm_valid - Tell the PM core that we only support the standby sleep
+ *                     state
+ *     @state:         suspend state we're checking.
  *
  */
-static int bfin_pm_prepare(suspend_state_t state)
+static int bfin_pm_valid(suspend_state_t state)
 {
-       int error = 0;
-
-       switch (state) {
-       case PM_SUSPEND_STANDBY:
-               break;
-
-       case PM_SUSPEND_MEM:
-               return -ENOTSUPP;
-
-       default:
-               return -EINVAL;
-       }
-
-       return error;
+       return (state == PM_SUSPEND_STANDBY);
 }
 
 /*
@@ -135,44 +122,14 @@ static int bfin_pm_enter(suspend_state_t state)
        return 0;
 }
 
-/*
- *     bfin_pm_finish - Finish up suspend sequence.
- *     @state:         State we're coming out of.
- *
- *     This is called after we wake back up (or if entering the sleep state
- *     failed).
- */
-static int bfin_pm_finish(suspend_state_t state)
-{
-       switch (state) {
-       case PM_SUSPEND_STANDBY:
-               break;
-
-       case PM_SUSPEND_MEM:
-               return -ENOTSUPP;
-
-       default:
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-static int bfin_pm_valid(suspend_state_t state)
-{
-       return (state == PM_SUSPEND_STANDBY);
-}
-
-struct pm_ops bfin_pm_ops = {
-       .prepare = bfin_pm_prepare,
+struct platform_suspend_ops bfin_pm_ops = {
        .enter = bfin_pm_enter,
-       .finish = bfin_pm_finish,
        .valid  = bfin_pm_valid,
 };
 
 static int __init bfin_pm_init(void)
 {
-       pm_set_ops(&bfin_pm_ops);
+       suspend_set_ops(&bfin_pm_ops);
        return 0;
 }
 
index 98cfc90cab1d4916e9664fa01cca00bb41801662..2bb84214e5f1384f2208b47f637a644aa94e747e 100644 (file)
@@ -371,6 +371,11 @@ ia64_setup_printk_clock(void)
                ia64_printk_clock = ia64_itc_printk_clock;
 }
 
+/* IA64 doesn't cache the timezone */
+void update_vsyscall_tz(void)
+{
+}
+
 void update_vsyscall(struct timespec *wall, struct clocksource *c)
 {
         unsigned long flags;
index e58fcadff2e976392c03e935e39ab0e5f97ca7cb..a5df672d83923a14479e1b94b9583354e2b14661 100644 (file)
@@ -269,8 +269,9 @@ xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg)
        skb->protocol = eth_type_trans(skb, xpnet_device);
        skb->ip_summed = CHECKSUM_UNNECESSARY;
 
-       dev_dbg(xpnet, "passing skb to network layer; \n\tskb->head=0x%p "
-               "skb->data=0x%p skb->tail=0x%p skb->end=0x%p skb->len=%d\n",
+       dev_dbg(xpnet, "passing skb to network layer\n"
+               KERN_DEBUG "\tskb->head=0x%p skb->data=0x%p skb->tail=0x%p "
+               "skb->end=0x%p skb->len=%d\n",
                (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb),
                skb_end_pointer(skb), skb->len);
 
@@ -576,10 +577,10 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                msg->tailout_ignore = end_addr - (u64)skb_tail_pointer(skb);
                msg->buf_pa = __pa(start_addr);
 
-               dev_dbg(xpnet, "sending XPC message to %d:%d\nmsg->buf_pa="
-                       "0x%lx, msg->size=%u, msg->leadin_ignore=%u, "
-                       "msg->tailout_ignore=%u\n", dest_partid,
-                       XPC_NET_CHANNEL, msg->buf_pa, msg->size,
+               dev_dbg(xpnet, "sending XPC message to %d:%d\n"
+                       KERN_DEBUG "msg->buf_pa=0x%lx, msg->size=%u, "
+                       "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n",
+                       dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size,
                        msg->leadin_ignore, msg->tailout_ignore);
 
 
index 235d4514e0a9290ead0abe2e82ba711a700fb12c..cb027580cd1d140d1a95cfb63a2e3626344af830 100644 (file)
@@ -21,6 +21,7 @@ config MACH_ALCHEMY
 
 config BASLER_EXCITE
        bool "Basler eXcite smart camera"
+       select CEVT_R4K
        select DMA_COHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -47,6 +48,7 @@ config BASLER_EXCITE_PROTOTYPE
 
 config BCM47XX
        bool "BCM47XX based boards"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -63,6 +65,7 @@ config BCM47XX
 
 config MIPS_COBALT
        bool "Cobalt Server"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select I8253
@@ -80,6 +83,7 @@ config MIPS_COBALT
 config MACH_DECSTATION
        bool "DECstations"
        select BOOT_ELF32
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select NO_IOPORT
        select IRQ_CPU
@@ -111,6 +115,7 @@ config MACH_JAZZ
        select ARC
        select ARC32
        select ARCH_MAY_HAVE_PC_FDC
+       select CEVT_R4K
        select GENERIC_ISA_DMA
        select IRQ_CPU
        select I8253
@@ -130,6 +135,7 @@ config MACH_JAZZ
 
 config LASAT
        bool "LASAT Networks platforms"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
        select HW_HAS_PCI
@@ -146,6 +152,7 @@ config LASAT
 config LEMOTE_FULONG
        bool "Lemote Fulong mini-PC"
        select ARCH_SPARSEMEM_ENABLE
+       select CEVT_R4K
        select SYS_HAS_CPU_LOONGSON2
        select DMA_NONCOHERENT
        select BOOT_ELF32
@@ -170,6 +177,7 @@ config LEMOTE_FULONG
 config MIPS_ATLAS
        bool "MIPS Atlas board"
        select BOOT_ELF32
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
        select IRQ_CPU
@@ -200,6 +208,7 @@ config MIPS_MALTA
        bool "MIPS Malta board"
        select ARCH_MAY_HAVE_PC_FDC
        select BOOT_ELF32
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select GENERIC_ISA_DMA
        select IRQ_CPU
@@ -230,6 +239,7 @@ config MIPS_MALTA
 
 config MIPS_SEAD
        bool "MIPS SEAD board"
+       select CEVT_R4K
        select IRQ_CPU
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
@@ -248,6 +258,7 @@ config MIPS_SEAD
 
 config MIPS_SIM
        bool 'MIPS simulator (MIPSsim)'
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select SYS_HAS_EARLY_PRINTK
        select IRQ_CPU
@@ -265,6 +276,7 @@ config MIPS_SIM
 
 config MARKEINS
        bool "NEC EMMA2RH Mark-eins"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -279,6 +291,7 @@ config MARKEINS
 
 config MACH_VR41XX
        bool "NEC VR4100 series based machines"
+       select CEVT_R4K
        select SYS_HAS_CPU_VR41XX
        select GENERIC_HARDIRQS_NO__DO_IRQ
 
@@ -315,6 +328,7 @@ config PMC_MSP
 
 config PMC_YOSEMITE
        bool "PMC-Sierra Yosemite eval board"
+       select CEVT_R4K
        select DMA_COHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -335,6 +349,7 @@ config PMC_YOSEMITE
 
 config QEMU
        bool "Qemu"
+       select CEVT_R4K
        select DMA_COHERENT
        select GENERIC_ISA_DMA
        select HAVE_STD_PC_SERIAL_PORT
@@ -365,6 +380,7 @@ config SGI_IP22
        select ARC
        select ARC32
        select BOOT_ELF32
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HW_HAS_EISA
        select I8253
@@ -409,6 +425,7 @@ config SGI_IP32
        select ARC
        select ARC32
        select BOOT_ELF32
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HW_HAS_PCI
        select IRQ_CPU
@@ -536,6 +553,7 @@ config SNI_RM
        select ARC32 if CPU_LITTLE_ENDIAN
        select ARCH_MAY_HAVE_PC_FDC
        select BOOT_ELF32
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select GENERIC_ISA_DMA
        select HW_HAS_EISA
@@ -577,6 +595,7 @@ config TOSHIBA_JMR3927
 
 config TOSHIBA_RBTX4927
        bool "Toshiba RBTX49[23]7 board"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
@@ -597,6 +616,7 @@ config TOSHIBA_RBTX4927
 
 config TOSHIBA_RBTX4938
        bool "Toshiba RBTX4938 board"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select HAS_TXX9_SERIAL
        select HW_HAS_PCI
@@ -616,6 +636,7 @@ config TOSHIBA_RBTX4938
 
 config WR_PPMC
        bool "Wind River PPMC board"
+       select CEVT_R4K
        select IRQ_CPU
        select BOOT_ELF32
        select DMA_NONCOHERENT
@@ -708,6 +729,9 @@ config ARCH_MAY_HAVE_PC_FDC
 config BOOT_RAW
        bool
 
+config CEVT_R4K
+       bool
+
 config CFE
        bool
 
index a23d4154da01e161a39f8798795e4397d3a5ac40..b36cec58a9a848df2e7be884d85c23c9adb71da1 100644 (file)
@@ -137,6 +137,7 @@ config SOC_AU1200
 config SOC_AU1X00
        bool
        select 64BIT_PHYS_ADDR
+       select CEVT_R4K
        select IRQ_CPU
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
index 835b056cea36c42c835cdadfdcfca47ae668611e..ae25b480723e8161366a692c0f36061852e8fbb8 100644 (file)
@@ -4,7 +4,7 @@
  * for more details.
  *
  * Copyright (C) 1992 Linus Torvalds
- * Copyright (C) 1994 - 2001, 2003 Ralf Baechle
+ * Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle
  */
 #include <linux/clockchips.h>
 #include <linux/init.h>
@@ -13,6 +13,7 @@
 #include <linux/spinlock.h>
 
 #include <asm/irq_cpu.h>
+#include <asm/i8253.h>
 #include <asm/i8259.h>
 #include <asm/io.h>
 #include <asm/jazz.h>
@@ -136,7 +137,7 @@ static struct irqaction r4030_timer_irqaction = {
        .name           = "timer",
 };
 
-void __init plat_timer_setup(struct irqaction *ignored)
+void __init plat_time_init(void)
 {
        struct irqaction *irq = &r4030_timer_irqaction;
 
@@ -152,4 +153,5 @@ void __init plat_timer_setup(struct irqaction *ignored)
        setup_irq(JAZZ_TIMER_IRQ, irq);
 
        clockevents_register_device(&r4030_clockevent);
+       setup_pit_timer();
 }
index cfc7dce78dab24b9060a432ad8465d22925ef4de..a7857973ca03fc7bd603742059858dcaf74d5bd4 100644 (file)
@@ -5,7 +5,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
+ * Copyright (C) 1996, 1997, 1998, 2001, 07 by Ralf Baechle
  * Copyright (C) 2001 MIPS Technologies, Inc.
  * Copyright (C) 2007 by Thomas Bogendoerfer
  */
@@ -25,7 +25,6 @@
 #include <linux/serial_8250.h>
 
 #include <asm/bootinfo.h>
-#include <asm/i8253.h>
 #include <asm/irq.h>
 #include <asm/jazz.h>
 #include <asm/jazzdma.h>
@@ -64,11 +63,6 @@ static struct resource jazz_io_resources[] = {
        }
 };
 
-void __init plat_time_init(void)
-{
-       setup_pit_timer();
-}
-
 void __init plat_mem_setup(void)
 {
        int i;
index 0c7aee1682cd25852053683d7209ccf1f3fb5f16..edb9e59248ecea7860dde0f16c5623a54d00e16b 100644 (file)
@@ -1,15 +1,4 @@
-/***********************************************************************
- *
- * Copyright 2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *              ahennessy@mvista.com
- *
- * Based on arch/mips/ddb5xxx/ddb5477/setup.c
- *
- *     Setup file for JMR3927.
- *
- * Copyright (C) 2000-2001 Toshiba Corporation
- *
+/*
  *  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
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  *
- ***********************************************************************
+ * Copyright 2001 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *              ahennessy@mvista.com
+ *
+ * Copyright (C) 2000-2001 Toshiba Corporation
+ * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
  */
 
+#include <linux/clockchips.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
@@ -104,27 +99,60 @@ static cycle_t jmr3927_hpt_read(void)
        return jiffies * (JMR3927_TIMER_CLK / HZ) + jmr3927_tmrptr->trr;
 }
 
-static void jmr3927_timer_ack(void)
+static void jmr3927_set_mode(enum clock_event_mode mode,
+       struct clock_event_device *evt)
+{
+       /* Nothing to do here */
+}
+
+struct clock_event_device jmr3927_clock_event_device = {
+       .name           = "MIPS",
+       .features       = CLOCK_EVT_FEAT_PERIODIC,
+       .shift          = 32,
+       .rating         = 300,
+       .cpumask        = CPU_MASK_CPU0,
+       .irq            = JMR3927_IRQ_TICK,
+       .set_mode       = jmr3927_set_mode,
+};
+
+static irqreturn_t jmr3927_timer_interrupt(int irq, void *dev_id)
 {
+       struct clock_event_device *cd = &jmr3927_clock_event_device;
+
        jmr3927_tmrptr->tisr = 0;       /* ack interrupt */
+
+       cd->event_handler(cd);
+
+       return IRQ_HANDLED;
 }
 
+static struct irqaction jmr3927_timer_irqaction = {
+       .handler        = jmr3927_timer_interrupt,
+       .flags          = IRQF_DISABLED | IRQF_PERCPU,
+       .name           = "jmr3927-timer",
+};
+
 void __init plat_time_init(void)
 {
+       struct clock_event_device *cd;
+
        clocksource_mips.read = jmr3927_hpt_read;
-       mips_timer_ack = jmr3927_timer_ack;
        mips_hpt_frequency = JMR3927_TIMER_CLK;
-}
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
        jmr3927_tmrptr->cpra = JMR3927_TIMER_CLK / HZ;
        jmr3927_tmrptr->itmr = TXx927_TMTITMR_TIIE | TXx927_TMTITMR_TZCE;
        jmr3927_tmrptr->ccdr = JMR3927_TIMER_CCD;
        jmr3927_tmrptr->tcr =
                TXx927_TMTCR_TCE | TXx927_TMTCR_CCDE | TXx927_TMTCR_TMODE_ITVL;
 
-       setup_irq(JMR3927_IRQ_TICK, irq);
+       cd = &jmr3927_clock_event_device;
+       /* Calculate the min / max delta */
+       cd->mult = div_sc((unsigned long) JMR3927_IMCLK, NSEC_PER_SEC, 32);
+       cd->max_delta_ns        = clockevent_delta2ns(0x7fffffff, cd);
+       cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
+       clockevents_register_device(cd);
+
+       setup_irq(JMR3927_IRQ_TICK, &jmr3927_timer_irqaction);
 }
 
 #define DO_WRITE_THROUGH
index 95a356ef39106d2e0b5693f805bdbf2ca193d5e4..a3afa39faae5aa655ffc5066df80d77d19368b85 100644 (file)
@@ -8,6 +8,8 @@ obj-y           += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
                   ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
                   time.o topology.o traps.o unaligned.o
 
+obj-$(CONFIG_CEVT_R4K)         += cevt-r4k.o
+
 binfmt_irix-objs       := irixelf.o irixinv.o irixioctl.o irixsig.o    \
                           irix5sys.o sysirix.o
 
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
new file mode 100644 (file)
index 0000000..08b84d4
--- /dev/null
@@ -0,0 +1,272 @@
+/*
+ * 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.
+ *
+ * Copyright (C) 2007 MIPS Technologies, Inc.
+ * Copyright (C) 2007 Ralf Baechle <ralf@linux-mips.org>
+ */
+#include <linux/clockchips.h>
+#include <linux/interrupt.h>
+#include <linux/percpu.h>
+
+#include <asm/time.h>
+
+static int mips_next_event(unsigned long delta,
+                           struct clock_event_device *evt)
+{
+       unsigned int cnt;
+       int res;
+
+#ifdef CONFIG_MIPS_MT_SMTC
+       {
+       unsigned long flags, vpflags;
+       local_irq_save(flags);
+       vpflags = dvpe();
+#endif
+       cnt = read_c0_count();
+       cnt += delta;
+       write_c0_compare(cnt);
+       res = ((long)(read_c0_count() - cnt ) > 0) ? -ETIME : 0;
+#ifdef CONFIG_MIPS_MT_SMTC
+       evpe(vpflags);
+       local_irq_restore(flags);
+       }
+#endif
+       return res;
+}
+
+static void mips_set_mode(enum clock_event_mode mode,
+                          struct clock_event_device *evt)
+{
+       /* Nothing to do ...  */
+}
+
+static DEFINE_PER_CPU(struct clock_event_device, mips_clockevent_device);
+static int cp0_timer_irq_installed;
+
+/*
+ * Timer ack for an R4k-compatible timer of a known frequency.
+ */
+static void c0_timer_ack(void)
+{
+       write_c0_compare(read_c0_compare());
+}
+
+/*
+ * Possibly handle a performance counter interrupt.
+ * Return true if the timer interrupt should not be checked
+ */
+static inline int handle_perf_irq(int r2)
+{
+       /*
+        * The performance counter overflow interrupt may be shared with the
+        * timer interrupt (cp0_perfcount_irq < 0). If it is and a
+        * performance counter has overflowed (perf_irq() == IRQ_HANDLED)
+        * and we can't reliably determine if a counter interrupt has also
+        * happened (!r2) then don't check for a timer interrupt.
+        */
+       return (cp0_perfcount_irq < 0) &&
+               perf_irq() == IRQ_HANDLED &&
+               !r2;
+}
+
+static irqreturn_t c0_compare_interrupt(int irq, void *dev_id)
+{
+       const int r2 = cpu_has_mips_r2;
+       struct clock_event_device *cd;
+       int cpu = smp_processor_id();
+
+       /*
+        * Suckage alert:
+        * Before R2 of the architecture there was no way to see if a
+        * performance counter interrupt was pending, so we have to run
+        * the performance counter interrupt handler anyway.
+        */
+       if (handle_perf_irq(r2))
+               goto out;
+
+       /*
+        * The same applies to performance counter interrupts.  But with the
+        * above we now know that the reason we got here must be a timer
+        * interrupt.  Being the paranoiacs we are we check anyway.
+        */
+       if (!r2 || (read_c0_cause() & (1 << 30))) {
+               c0_timer_ack();
+#ifdef CONFIG_MIPS_MT_SMTC
+               if (cpu_data[cpu].vpe_id)
+                       goto out;
+               cpu = 0;
+#endif
+               cd = &per_cpu(mips_clockevent_device, cpu);
+               cd->event_handler(cd);
+       }
+
+out:
+       return IRQ_HANDLED;
+}
+
+static struct irqaction c0_compare_irqaction = {
+       .handler = c0_compare_interrupt,
+#ifdef CONFIG_MIPS_MT_SMTC
+       .flags = IRQF_DISABLED,
+#else
+       .flags = IRQF_DISABLED | IRQF_PERCPU,
+#endif
+       .name = "timer",
+};
+
+#ifdef CONFIG_MIPS_MT_SMTC
+DEFINE_PER_CPU(struct clock_event_device, smtc_dummy_clockevent_device);
+
+static void smtc_set_mode(enum clock_event_mode mode,
+                          struct clock_event_device *evt)
+{
+}
+
+static void mips_broadcast(cpumask_t mask)
+{
+       unsigned int cpu;
+
+       for_each_cpu_mask(cpu, mask)
+               smtc_send_ipi(cpu, SMTC_CLOCK_TICK, 0);
+}
+
+static void setup_smtc_dummy_clockevent_device(void)
+{
+       //uint64_t mips_freq = mips_hpt_^frequency;
+       unsigned int cpu = smp_processor_id();
+       struct clock_event_device *cd;
+
+       cd = &per_cpu(smtc_dummy_clockevent_device, cpu);
+
+       cd->name                = "SMTC";
+       cd->features            = CLOCK_EVT_FEAT_DUMMY;
+
+       /* Calculate the min / max delta */
+       cd->mult        = 0; //div_sc((unsigned long) mips_freq, NSEC_PER_SEC, 32);
+       cd->shift               = 0; //32;
+       cd->max_delta_ns        = 0; //clockevent_delta2ns(0x7fffffff, cd);
+       cd->min_delta_ns        = 0; //clockevent_delta2ns(0x30, cd);
+
+       cd->rating              = 200;
+       cd->irq                 = 17; //-1;
+//     if (cpu)
+//             cd->cpumask     = CPU_MASK_ALL; // cpumask_of_cpu(cpu);
+//     else
+               cd->cpumask     = cpumask_of_cpu(cpu);
+
+       cd->set_mode            = smtc_set_mode;
+
+       cd->broadcast           = mips_broadcast;
+
+       clockevents_register_device(cd);
+}
+#endif
+
+static void mips_event_handler(struct clock_event_device *dev)
+{
+}
+
+/*
+ * FIXME: This doesn't hold for the relocated E9000 compare interrupt.
+ */
+static int c0_compare_int_pending(void)
+{
+       return (read_c0_cause() >> cp0_compare_irq) & 0x100;
+}
+
+static int c0_compare_int_usable(void)
+{
+       const unsigned int delta = 0x300000;
+       unsigned int cnt;
+
+       /*
+        * IP7 already pending?  Try to clear it by acking the timer.
+        */
+       if (c0_compare_int_pending()) {
+               write_c0_compare(read_c0_compare());
+               irq_disable_hazard();
+               if (c0_compare_int_pending())
+                       return 0;
+       }
+
+       cnt = read_c0_count();
+       cnt += delta;
+       write_c0_compare(cnt);
+
+       while ((long)(read_c0_count() - cnt) <= 0)
+               ;       /* Wait for expiry  */
+
+       if (!c0_compare_int_pending())
+               return 0;
+
+       write_c0_compare(read_c0_compare());
+       irq_disable_hazard();
+       if (c0_compare_int_pending())
+               return 0;
+
+       /*
+        * Feels like a real count / compare timer.
+        */
+       return 1;
+}
+
+void __cpuinit mips_clockevent_init(void)
+{
+       uint64_t mips_freq = mips_hpt_frequency;
+       unsigned int cpu = smp_processor_id();
+       struct clock_event_device *cd;
+       unsigned int irq = MIPS_CPU_IRQ_BASE + 7;
+
+       if (!cpu_has_counter)
+               return;
+
+#ifdef CONFIG_MIPS_MT_SMTC
+       setup_smtc_dummy_clockevent_device();
+
+       /*
+        * On SMTC we only register VPE0's compare interrupt as clockevent
+        * device.
+        */
+       if (cpu)
+               return;
+#endif
+
+       if (!c0_compare_int_usable())
+               return;
+
+       cd = &per_cpu(mips_clockevent_device, cpu);
+
+       cd->name                = "MIPS";
+       cd->features            = CLOCK_EVT_FEAT_ONESHOT;
+
+       /* Calculate the min / max delta */
+       cd->mult        = div_sc((unsigned long) mips_freq, NSEC_PER_SEC, 32);
+       cd->shift               = 32;
+       cd->max_delta_ns        = clockevent_delta2ns(0x7fffffff, cd);
+       cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
+
+       cd->rating              = 300;
+       cd->irq                 = irq;
+#ifdef CONFIG_MIPS_MT_SMTC
+       cd->cpumask             = CPU_MASK_ALL;
+#else
+       cd->cpumask             = cpumask_of_cpu(cpu);
+#endif
+       cd->set_next_event      = mips_next_event;
+       cd->set_mode            = mips_set_mode;
+       cd->event_handler       = mips_event_handler;
+
+       clockevents_register_device(cd);
+
+       if (!cp0_timer_irq_installed) {
+#ifdef CONFIG_MIPS_MT_SMTC
+#define CPUCTR_IMASKBIT (0x100 << cp0_compare_irq)
+               setup_irq_smtc(irq, &c0_compare_irqaction, CPUCTR_IMASKBIT);
+#else
+               setup_irq(irq, &c0_compare_irqaction);
+#endif /* CONFIG_MIPS_MT_SMTC */
+               cp0_timer_irq_installed = 1;
+       }
+}
index bf164a562acbe185864a4ed1cc503e1d56546771..2367687310630c40a68b11423a21dab45cc6b2a9 100644 (file)
 
 #include <kernel-entry-init.h>
 
-       .macro  ARC64_TWIDDLE_PC
-#if defined(CONFIG_ARC64) || defined(CONFIG_MAPPED_KERNEL)
-       /* We get launched at a XKPHYS address but the kernel is linked to
-          run at a KSEG0 address, so jump there.  */
-       PTR_LA  t0, \@f
-       jr      t0
-\@:
-#endif
-       .endm
-
        /*
         * inputs are the text nasid in t1, data nasid in t2.
         */
@@ -157,7 +147,11 @@ NESTED(kernel_entry, 16, sp)                       # kernel entry point
 
        setup_c0_status_pri
 
-       ARC64_TWIDDLE_PC
+       /* We might not get launched at the address the kernel is linked to,
+          so we jump there.  */
+       PTR_LA  t0, 0f
+       jr      t0
+0:
 
 #ifdef CONFIG_MIPS_MT_SMTC
        /*
index e4b5e647b14211ec5a904091924c24570b99889e..ea7cfe766a8ed8286bdfa4c52572982c89fc5909 100644 (file)
@@ -72,14 +72,6 @@ int update_persistent_clock(struct timespec now)
        return rtc_mips_set_mmss(now.tv_sec);
 }
 
-/* how many counter cycles in a jiffy */
-static unsigned long cycles_per_jiffy __read_mostly;
-
-/*
- * Null timer ack for systems not needing one (e.g. i8254).
- */
-static void null_timer_ack(void) { /* nothing */ }
-
 /*
  * Null high precision timer functions for systems lacking one.
  */
@@ -88,14 +80,6 @@ static cycle_t null_hpt_read(void)
        return 0;
 }
 
-/*
- * Timer ack for an R4k-compatible timer of a known frequency.
- */
-static void c0_timer_ack(void)
-{
-       write_c0_compare(read_c0_compare());
-}
-
 /*
  * High precision timer functions for a R4k-compatible timer.
  */
@@ -105,7 +89,6 @@ static cycle_t c0_hpt_read(void)
 }
 
 int (*mips_timer_state)(void);
-void (*mips_timer_ack)(void);
 
 /*
  * local_timer_interrupt() does profiling and process accounting
@@ -134,35 +117,6 @@ int (*perf_irq)(void) = null_perf_irq;
 
 EXPORT_SYMBOL(perf_irq);
 
-/*
- * Timer interrupt
- */
-int cp0_compare_irq;
-
-/*
- * Performance counter IRQ or -1 if shared with timer
- */
-int cp0_perfcount_irq;
-EXPORT_SYMBOL_GPL(cp0_perfcount_irq);
-
-/*
- * Possibly handle a performance counter interrupt.
- * Return true if the timer interrupt should not be checked
- */
-static inline int handle_perf_irq(int r2)
-{
-       /*
-        * The performance counter overflow interrupt may be shared with the
-        * timer interrupt (cp0_perfcount_irq < 0). If it is and a
-        * performance counter has overflowed (perf_irq() == IRQ_HANDLED)
-        * and we can't reliably determine if a counter interrupt has also
-        * happened (!r2) then don't check for a timer interrupt.
-        */
-       return (cp0_perfcount_irq < 0) &&
-               perf_irq() == IRQ_HANDLED &&
-               !r2;
-}
-
 /*
  * time_init() - it does the following things.
  *
@@ -228,84 +182,6 @@ struct clocksource clocksource_mips = {
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static int mips_next_event(unsigned long delta,
-                           struct clock_event_device *evt)
-{
-       unsigned int cnt;
-       int res;
-
-#ifdef CONFIG_MIPS_MT_SMTC
-       {
-       unsigned long flags, vpflags;
-       local_irq_save(flags);
-       vpflags = dvpe();
-#endif
-       cnt = read_c0_count();
-       cnt += delta;
-       write_c0_compare(cnt);
-       res = ((long)(read_c0_count() - cnt ) > 0) ? -ETIME : 0;
-#ifdef CONFIG_MIPS_MT_SMTC
-       evpe(vpflags);
-       local_irq_restore(flags);
-       }
-#endif
-       return res;
-}
-
-static void mips_set_mode(enum clock_event_mode mode,
-                          struct clock_event_device *evt)
-{
-       /* Nothing to do ...  */
-}
-
-static DEFINE_PER_CPU(struct clock_event_device, mips_clockevent_device);
-static int cp0_timer_irq_installed;
-
-static irqreturn_t timer_interrupt(int irq, void *dev_id)
-{
-       const int r2 = cpu_has_mips_r2;
-       struct clock_event_device *cd;
-       int cpu = smp_processor_id();
-
-       /*
-        * Suckage alert:
-        * Before R2 of the architecture there was no way to see if a
-        * performance counter interrupt was pending, so we have to run
-        * the performance counter interrupt handler anyway.
-        */
-       if (handle_perf_irq(r2))
-               goto out;
-
-       /*
-        * The same applies to performance counter interrupts.  But with the
-        * above we now know that the reason we got here must be a timer
-        * interrupt.  Being the paranoiacs we are we check anyway.
-        */
-       if (!r2 || (read_c0_cause() & (1 << 30))) {
-               c0_timer_ack();
-#ifdef CONFIG_MIPS_MT_SMTC
-               if (cpu_data[cpu].vpe_id)
-                       goto out;
-               cpu = 0;
-#endif
-               cd = &per_cpu(mips_clockevent_device, cpu);
-               cd->event_handler(cd);
-       }
-
-out:
-       return IRQ_HANDLED;
-}
-
-static struct irqaction timer_irqaction = {
-       .handler = timer_interrupt,
-#ifdef CONFIG_MIPS_MT_SMTC
-       .flags = IRQF_DISABLED,
-#else
-       .flags = IRQF_DISABLED | IRQF_PERCPU,
-#endif
-       .name = "timer",
-};
-
 static void __init init_mips_clocksource(void)
 {
        u64 temp;
@@ -345,8 +221,6 @@ static void smtc_set_mode(enum clock_event_mode mode,
 {
 }
 
-int dummycnt[NR_CPUS];
-
 static void mips_broadcast(cpumask_t mask)
 {
        unsigned int cpu;
@@ -387,113 +261,6 @@ static void setup_smtc_dummy_clockevent_device(void)
 }
 #endif
 
-static void mips_event_handler(struct clock_event_device *dev)
-{
-}
-
-/*
- * FIXME: This doesn't hold for the relocated E9000 compare interrupt.
- */
-static int c0_compare_int_pending(void)
-{
-       return (read_c0_cause() >> cp0_compare_irq) & 0x100;
-}
-
-static int c0_compare_int_usable(void)
-{
-       const unsigned int delta = 0x300000;
-       unsigned int cnt;
-
-       /*
-        * IP7 already pending?  Try to clear it by acking the timer.
-        */
-       if (c0_compare_int_pending()) {
-               write_c0_compare(read_c0_compare());
-               irq_disable_hazard();
-               if (c0_compare_int_pending())
-                       return 0;
-       }
-
-       cnt = read_c0_count();
-       cnt += delta;
-       write_c0_compare(cnt);
-
-       while ((long)(read_c0_count() - cnt) <= 0)
-               ;       /* Wait for expiry  */
-
-       if (!c0_compare_int_pending())
-               return 0;
-
-       write_c0_compare(read_c0_compare());
-       irq_disable_hazard();
-       if (c0_compare_int_pending())
-               return 0;
-
-       /*
-        * Feels like a real count / compare timer.
-        */
-       return 1;
-}
-
-void __cpuinit mips_clockevent_init(void)
-{
-       uint64_t mips_freq = mips_hpt_frequency;
-       unsigned int cpu = smp_processor_id();
-       struct clock_event_device *cd;
-       unsigned int irq = MIPS_CPU_IRQ_BASE + 7;
-
-       if (!cpu_has_counter)
-               return;
-
-#ifdef CONFIG_MIPS_MT_SMTC
-       setup_smtc_dummy_clockevent_device();
-
-       /*
-        * On SMTC we only register VPE0's compare interrupt as clockevent
-        * device.
-        */
-       if (cpu)
-               return;
-#endif
-
-       if (!c0_compare_int_usable())
-               return;
-
-       cd = &per_cpu(mips_clockevent_device, cpu);
-
-       cd->name                = "MIPS";
-       cd->features            = CLOCK_EVT_FEAT_ONESHOT;
-
-       /* Calculate the min / max delta */
-       cd->mult        = div_sc((unsigned long) mips_freq, NSEC_PER_SEC, 32);
-       cd->shift               = 32;
-       cd->max_delta_ns        = clockevent_delta2ns(0x7fffffff, cd);
-       cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
-
-       cd->rating              = 300;
-       cd->irq                 = irq;
-#ifdef CONFIG_MIPS_MT_SMTC
-       cd->cpumask             = CPU_MASK_ALL;
-#else
-       cd->cpumask             = cpumask_of_cpu(cpu);
-#endif
-       cd->set_next_event      = mips_next_event;
-       cd->set_mode            = mips_set_mode;
-       cd->event_handler       = mips_event_handler;
-
-       clockevents_register_device(cd);
-
-       if (!cp0_timer_irq_installed) {
-#ifdef CONFIG_MIPS_MT_SMTC
-#define CPUCTR_IMASKBIT (0x100 << cp0_compare_irq)
-               setup_irq_smtc(irq, &timer_irqaction, CPUCTR_IMASKBIT);
-#else
-               setup_irq(irq, &timer_irqaction);
-#endif /* CONFIG_MIPS_MT_SMTC */
-               cp0_timer_irq_installed = 1;
-       }
-}
-
 void __init time_init(void)
 {
        plat_time_init();
@@ -512,14 +279,6 @@ void __init time_init(void)
                if (!clocksource_mips.read) {
                        /* No external high precision timer -- use R4k.  */
                        clocksource_mips.read = c0_hpt_read;
-
-                       if (!mips_timer_state) {
-                               /* No external timer interrupt -- use R4k.  */
-                               mips_timer_ack = c0_timer_ack;
-                               /* Calculate cache parameters.  */
-                               cycles_per_jiffy =
-                                       (mips_hpt_frequency + HZ / 2) / HZ;
-                       }
                }
                if (!mips_hpt_frequency)
                        mips_hpt_frequency = calibrate_hpt();
@@ -528,29 +287,8 @@ void __init time_init(void)
                printk("Using %u.%03u MHz high precision timer.\n",
                       ((mips_hpt_frequency + 500) / 1000) / 1000,
                       ((mips_hpt_frequency + 500) / 1000) % 1000);
-
-#ifdef CONFIG_IRQ_CPU
-               setup_irq(MIPS_CPU_IRQ_BASE + 7, &timer_irqaction);
-#endif
        }
 
-       if (!mips_timer_ack)
-               /* No timer interrupt ack (e.g. i8254).  */
-               mips_timer_ack = null_timer_ack;
-
-       /*
-        * Call board specific timer interrupt setup.
-        *
-        * this pointer must be setup in machine setup routine.
-        *
-        * Even if a machine chooses to use a low-level timer interrupt,
-        * it still needs to setup the timer_irqaction.
-        * In that case, it might be better to set timer_irqaction.handler
-        * to be NULL function so that we are sure the high-level code
-        * is not invoked accidentally.
-        */
-       plat_timer_setup(&timer_irqaction);
-
        init_mips_clocksource();
        mips_clockevent_init();
 }
index bbf01b81a4ffbd8272b35966d92a8cce8a5ba8f1..7b78d137259fdca7a14ea2789b4e034a026a58fb 100644 (file)
@@ -1336,6 +1336,17 @@ extern void cpu_cache_init(void);
 extern void tlb_init(void);
 extern void flush_tlb_handlers(void);
 
+/*
+ * Timer interrupt
+ */
+int cp0_compare_irq;
+
+/*
+ * Performance counter IRQ or -1 if shared with timer
+ */
+int cp0_perfcount_irq;
+EXPORT_SYMBOL_GPL(cp0_perfcount_irq);
+
 void __init per_cpu_trap_init(void)
 {
        unsigned int cpu = smp_processor_id();
index abbd0bbfabd7ba9e93452727eb5a4f397244d625..6b293ce0935f020552490de88a0165f9cbb253f1 100644 (file)
@@ -4,11 +4,13 @@ choice
 
 config PMC_MSP4200_EVAL
        bool "PMC-Sierra MSP4200 Eval Board"
+       select CEVT_R4K
        select IRQ_MSP_SLP
        select HW_HAS_PCI
 
 config PMC_MSP4200_GW
        bool "PMC-Sierra MSP4200 VoIP Gateway"
+       select CEVT_R4K
        select IRQ_MSP_SLP
        select HW_HAS_PCI
 
index 856649cf9f1ec6ab2e8bf6602c8e6554cf79782a..1bb692a3b31948d2a9abb4a13e7f5049ae38886a 100644 (file)
@@ -374,14 +374,13 @@ int __devinit request_bridge_irq(struct bridge_controller *bc)
        return irq;
 }
 
-extern void ip27_rt_timer_interrupt(void);
-
 asmlinkage void plat_irq_dispatch(void)
 {
        unsigned long pending = read_c0_cause() & read_c0_status();
+       extern unsigned int rt_timer_irq;
 
        if (pending & CAUSEF_IP4)
-               ip27_rt_timer_interrupt();
+               do_IRQ(rt_timer_irq);
        else if (pending & CAUSEF_IP2)  /* PI_INT_PEND_0 or CC_PEND_{A|B} */
                ip27_do_irq_mask0();
        else if (pending & CAUSEF_IP3)  /* PI_INT_PEND_1 */
index b7b3479b6bce2deca63503654f473fe2d3b33924..d467bf4f6c3f109be78d5857c007baa55ff57531 100644 (file)
@@ -3,6 +3,7 @@
  * Copytight (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #include <linux/bcd.h>
+#include <linux/clockchips.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <asm/sn/sn0/ip27.h>
 #include <asm/sn/sn0/hub.h>
 
-/*
- * This is a hack; we really need to figure these values out dynamically
- *
- * Since 800 ns works very well with various HUB frequencies, such as
- * 360, 380, 390 and 400 MHZ, we use 800 ns rtc cycle time.
- *
- * Ralf: which clock rate is used to feed the counter?
- */
-#define NSEC_PER_CYCLE         800
-#define CYCLES_PER_SEC         (NSEC_PER_SEC/NSEC_PER_CYCLE)
-#define CYCLES_PER_JIFFY       (CYCLES_PER_SEC/HZ)
-
 #define TICK_SIZE (tick_nsec / 1000)
 
-static unsigned long ct_cur[NR_CPUS];  /* What counter should be at next timer irq */
-
 #if 0
 static int set_rtc_mmss(unsigned long nowtime)
 {
@@ -86,36 +73,6 @@ static int set_rtc_mmss(unsigned long nowtime)
 }
 #endif
 
-static unsigned int rt_timer_irq;
-
-void ip27_rt_timer_interrupt(void)
-{
-       int cpu = smp_processor_id();
-       int cpuA = cputoslice(cpu) == 0;
-       unsigned int irq = rt_timer_irq;
-
-       irq_enter();
-       write_seqlock(&xtime_lock);
-
-again:
-       LOCAL_HUB_S(cpuA ? PI_RT_PEND_A : PI_RT_PEND_B, 0);     /* Ack  */
-       ct_cur[cpu] += CYCLES_PER_JIFFY;
-       LOCAL_HUB_S(cpuA ? PI_RT_COMPARE_A : PI_RT_COMPARE_B, ct_cur[cpu]);
-
-       if (LOCAL_HUB_L(PI_RT_COUNT) >= ct_cur[cpu])
-               goto again;
-
-       kstat_this_cpu.irqs[irq]++;             /* kstat only for bootcpu? */
-
-       if (cpu == 0)
-               do_timer(1);
-
-       update_process_times(user_mode(get_irq_regs()));
-
-       write_sequnlock(&xtime_lock);
-       irq_exit();
-}
-
 /* Includes for ioc3_init().  */
 #include <asm/sn/types.h>
 #include <asm/sn/sn0/addrs.h>
@@ -154,6 +111,46 @@ unsigned long read_persistent_clock(void)
         return mktime(year, month, date, hour, min, sec);
 }
 
+static int rt_set_next_event(unsigned long delta,
+               struct clock_event_device *evt)
+{
+       unsigned int cpu = smp_processor_id();
+       int slice = cputoslice(cpu) == 0;
+       unsigned long cnt;
+
+       cnt = LOCAL_HUB_L(PI_RT_COUNT);
+       cnt += delta;
+       LOCAL_HUB_S(slice ? PI_RT_COMPARE_A : PI_RT_COMPARE_B, cnt);
+
+       return LOCAL_HUB_L(PI_RT_COUNT) >= cnt ? -ETIME : 0;
+}
+
+static void rt_set_mode(enum clock_event_mode mode,
+               struct clock_event_device *evt)
+{
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               /* The only mode supported */
+               break;
+
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_SHUTDOWN:
+       case CLOCK_EVT_MODE_ONESHOT:
+       case CLOCK_EVT_MODE_RESUME:
+               /* Nothing to do  */
+               break;
+       }
+}
+
+struct clock_event_device rt_clock_event_device = {
+       .name           = "HUB-RT",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+
+       .rating         = 300,
+       .set_next_event = rt_set_next_event,
+       .set_mode       = rt_set_mode,
+};
+
 static void enable_rt_irq(unsigned int irq)
 {
 }
@@ -171,6 +168,20 @@ static struct irq_chip rt_irq_type = {
        .eoi            = enable_rt_irq,
 };
 
+unsigned int rt_timer_irq;
+
+static irqreturn_t ip27_rt_timer_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *cd = &rt_clock_event_device;
+       unsigned int cpu = smp_processor_id();
+       int slice = cputoslice(cpu) == 0;
+
+       LOCAL_HUB_S(slice ? PI_RT_PEND_A : PI_RT_PEND_B, 0);    /* Ack  */
+       cd->event_handler(cd);
+
+       return IRQ_HANDLED;
+}
+
 static struct irqaction rt_irqaction = {
        .handler        = (irq_handler_t) ip27_rt_timer_interrupt,
        .flags          = IRQF_DISABLED,
@@ -178,26 +189,43 @@ static struct irqaction rt_irqaction = {
        .name           = "timer"
 };
 
-void __init plat_timer_setup(struct irqaction *irq)
+/*
+ * This is a hack; we really need to figure these values out dynamically
+ *
+ * Since 800 ns works very well with various HUB frequencies, such as
+ * 360, 380, 390 and 400 MHZ, we use 800 ns rtc cycle time.
+ *
+ * Ralf: which clock rate is used to feed the counter?
+ */
+#define NSEC_PER_CYCLE         800
+#define CYCLES_PER_SEC         (NSEC_PER_SEC / NSEC_PER_CYCLE)
+
+static void __init ip27_rt_clock_event_init(void)
 {
-       int irqno  = allocate_irqno();
+       struct clock_event_device *cd = &rt_clock_event_device;
+       unsigned int cpu = smp_processor_id();
+       int irq = allocate_irqno();
 
-       if (irqno < 0)
+       if (irq < 0)
                panic("Can't allocate interrupt number for timer interrupt");
 
-       set_irq_chip_and_handler(irqno, &rt_irq_type, handle_percpu_irq);
+       rt_timer_irq = irq;
 
-       /* over-write the handler, we use our own way */
-       irq->handler = no_action;
+       cd->irq                 = irq,
+       cd->cpumask             = cpumask_of_cpu(cpu),
 
-       /* setup irqaction */
-       irq_desc[irqno].status |= IRQ_PER_CPU;
-
-       rt_timer_irq = irqno;
        /*
-        * Only needed to get /proc/interrupt to display timer irq stats
+        * Calculate the min / max delta
         */
-       setup_irq(irqno, &rt_irqaction);
+       cd->mult                =
+               div_sc((unsigned long) CYCLES_PER_SEC, NSEC_PER_SEC, 32);
+       cd->shift               = 32;
+       cd->max_delta_ns        = clockevent_delta2ns(0x7fffffff, cd);
+       cd->min_delta_ns        = clockevent_delta2ns(0x300, cd);
+       clockevents_register_device(cd);
+
+       set_irq_chip_and_handler(irq, &rt_irq_type, handle_percpu_irq);
+       setup_irq(irq, &rt_irqaction);
 }
 
 static cycle_t hub_rt_read(void)
@@ -206,7 +234,7 @@ static cycle_t hub_rt_read(void)
 }
 
 struct clocksource ht_rt_clocksource = {
-       .name   = "HUB",
+       .name   = "HUB-RT",
        .rating = 200,
        .read   = hub_rt_read,
        .mask   = CLOCKSOURCE_MASK(52),
@@ -214,11 +242,17 @@ struct clocksource ht_rt_clocksource = {
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-void __init plat_time_init(void)
+static void __init ip27_rt_clocksource_init(void)
 {
        clocksource_register(&ht_rt_clocksource);
 }
 
+void __init plat_time_init(void)
+{
+       ip27_rt_clock_event_init();
+       ip27_rt_clocksource_init();
+}
+
 void __init cpu_time_init(void)
 {
        lboard_t *board;
@@ -248,17 +282,12 @@ void __init hub_rtc_init(cnodeid_t cnode)
         * node and timeouts will not happen there.
         */
        if (get_compact_nodeid() == cnode) {
-               int cpu = smp_processor_id();
                LOCAL_HUB_S(PI_RT_EN_A, 1);
                LOCAL_HUB_S(PI_RT_EN_B, 1);
                LOCAL_HUB_S(PI_PROF_EN_A, 0);
                LOCAL_HUB_S(PI_PROF_EN_B, 0);
-               ct_cur[cpu] = CYCLES_PER_JIFFY;
-               LOCAL_HUB_S(PI_RT_COMPARE_A, ct_cur[cpu]);
                LOCAL_HUB_S(PI_RT_COUNT, 0);
                LOCAL_HUB_S(PI_RT_PEND_A, 0);
-               LOCAL_HUB_S(PI_RT_COMPARE_B, ct_cur[cpu]);
-               LOCAL_HUB_S(PI_RT_COUNT, 0);
                LOCAL_HUB_S(PI_RT_PEND_B, 0);
        }
 }
index fc75bfcb0c0e64ea41656f03a53b80d59f74a714..1024bf40bd9e79f1c63dd79f7be8289371e89caf 100644 (file)
@@ -80,12 +80,6 @@ void __init plat_time_init(void)
        printk("%d MHz CPU detected\n", mips_hpt_frequency * 2 / 1000000);
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-       irq->handler = no_action;
-       setup_irq(MIPS_CPU_IRQ_BASE + 7, irq);
-}
-
 void __init plat_mem_setup(void)
 {
        board_be_init = ip32_be_init;
index 8f4d3e74c2307017dfa1e44dcd90a4b595aafe4a..eeb089f20c0db183902a47faa22c217aee4765ee 100644 (file)
@@ -5,6 +5,7 @@ choice
 
 config CASIO_E55
        bool "CASIO CASSIOPEIA E-10/15/55/65"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select ISA
@@ -13,6 +14,7 @@ config CASIO_E55
 
 config IBM_WORKPAD
        bool "IBM WorkPad z50"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select ISA
@@ -21,6 +23,7 @@ config IBM_WORKPAD
 
 config NEC_CMBVR4133
        bool "NEC CMB-VR4133"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
@@ -29,6 +32,7 @@ config NEC_CMBVR4133
 
 config TANBAC_TB022X
        bool "TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
@@ -43,6 +47,7 @@ config TANBAC_TB022X
 
 config VICTOR_MPC30X
        bool "Victor MP-C303/304"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
@@ -52,6 +57,7 @@ config VICTOR_MPC30X
 
 config ZAO_CAPCELLA
        bool "ZAO Networks Capcella"
+       select CEVT_R4K
        select DMA_NONCOHERENT
        select IRQ_CPU
        select HW_HAS_PCI
index 95b823b60c97ec9cd038f4bb45ffea8afdd6ec7a..8e5988c4a1646042d8516303828524b8b3ad45dc 100644 (file)
@@ -209,7 +209,6 @@ CONFIG_PM=y
 # CONFIG_PM_LEGACY is not set
 CONFIG_PM_DEBUG=y
 # CONFIG_PM_VERBOSE is not set
-# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
 CONFIG_PM_SLEEP=y
 CONFIG_SUSPEND=y
 CONFIG_HIBERNATION=y
index 0ae5d57b93681fdea060bce6c6a78dc8bcd61569..2c8e756d19a39846db6f9c986dcce7ebbd099c39 100644 (file)
@@ -141,6 +141,7 @@ int main(void)
        DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr));
        DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
        DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
+       DEFINE(PACA_STARTSPURR, offsetof(struct paca_struct, startspurr));
        DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
        DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
        DEFINE(PACA_SLBSHADOWPTR, offsetof(struct paca_struct, slb_shadow_ptr));
index 863a5d6d9b1890626f5eceac08bc45304e6c13ce..9eb3284deac4e5d4e9942b5e643ab59fede4af85 100644 (file)
@@ -211,24 +211,45 @@ static u64 read_purr(void)
        return mftb();
 }
 
+/*
+ * Read the SPURR on systems that have it, otherwise the purr
+ */
+static u64 read_spurr(u64 purr)
+{
+       if (cpu_has_feature(CPU_FTR_SPURR))
+               return mfspr(SPRN_SPURR);
+       return purr;
+}
+
 /*
  * Account time for a transition between system, hard irq
  * or soft irq state.
  */
 void account_system_vtime(struct task_struct *tsk)
 {
-       u64 now, delta;
+       u64 now, nowscaled, delta, deltascaled;
        unsigned long flags;
 
        local_irq_save(flags);
        now = read_purr();
        delta = now - get_paca()->startpurr;
        get_paca()->startpurr = now;
+       nowscaled = read_spurr(now);
+       deltascaled = nowscaled - get_paca()->startspurr;
+       get_paca()->startspurr = nowscaled;
        if (!in_interrupt()) {
+               /* deltascaled includes both user and system time.
+                * Hence scale it based on the purr ratio to estimate
+                * the system time */
+               deltascaled = deltascaled * get_paca()->system_time /
+                       (get_paca()->system_time + get_paca()->user_time);
                delta += get_paca()->system_time;
                get_paca()->system_time = 0;
        }
        account_system_time(tsk, 0, delta);
+       get_paca()->purrdelta = delta;
+       account_system_time_scaled(tsk, deltascaled);
+       get_paca()->spurrdelta = deltascaled;
        local_irq_restore(flags);
 }
 
@@ -240,11 +261,17 @@ void account_system_vtime(struct task_struct *tsk)
  */
 void account_process_vtime(struct task_struct *tsk)
 {
-       cputime_t utime;
+       cputime_t utime, utimescaled;
 
        utime = get_paca()->user_time;
        get_paca()->user_time = 0;
        account_user_time(tsk, utime);
+
+       /* Estimate the scaled utime by scaling the real utime based
+        * on the last spurr to purr ratio */
+       utimescaled = utime * get_paca()->spurrdelta / get_paca()->purrdelta;
+       get_paca()->spurrdelta = get_paca()->purrdelta = 0;
+       account_user_time_scaled(tsk, utimescaled);
 }
 
 static void account_process_time(struct pt_regs *regs)
@@ -266,6 +293,7 @@ struct cpu_purr_data {
        int     initialized;                    /* thread is running */
        u64     tb;                     /* last TB value read */
        u64     purr;                   /* last PURR value read */
+       u64     spurr;                  /* last SPURR value read */
 };
 
 /*
index f26afcd41757ad1bb96f81ec78b9995d7ccc7db6..ffa14aff5248f7d18193c9fa20ba247533bb454c 100644 (file)
@@ -1,5 +1,5 @@
 #include <linux/init.h>
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <asm/io.h>
 #include <asm/time.h>
 #include <asm/mpc52xx.h>
@@ -18,6 +18,8 @@ static void __iomem *sram;
 static const int sram_size = 0x4000;   /* 16 kBytes */
 static void __iomem *mbar;
 
+static suspend_state_t lite5200_pm_target_state;
+
 static int lite5200_pm_valid(suspend_state_t state)
 {
        switch (state) {
@@ -29,13 +31,22 @@ static int lite5200_pm_valid(suspend_state_t state)
        }
 }
 
-static int lite5200_pm_prepare(suspend_state_t state)
+static int lite5200_pm_set_target(suspend_state_t state)
+{
+       if (lite5200_pm_valid(state)) {
+               lite5200_pm_target_state = state;
+               return 0;
+       }
+       return -EINVAL;
+}
+
+static int lite5200_pm_prepare(void)
 {
        /* deep sleep? let mpc52xx code handle that */
-       if (state == PM_SUSPEND_STANDBY)
-               return mpc52xx_pm_prepare(state);
+       if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
+               return mpc52xx_pm_prepare();
 
-       if (state != PM_SUSPEND_MEM)
+       if (lite5200_pm_target_state != PM_SUSPEND_MEM)
                return -EINVAL;
 
        /* map registers */
@@ -190,17 +201,16 @@ static int lite5200_pm_enter(suspend_state_t state)
        return 0;
 }
 
-static int lite5200_pm_finish(suspend_state_t state)
+static void lite5200_pm_finish(void)
 {
        /* deep sleep? let mpc52xx code handle that */
-       if (state == PM_SUSPEND_STANDBY) {
-               return mpc52xx_pm_finish(state);
-       }
-       return 0;
+       if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
+               mpc52xx_pm_finish();
 }
 
-static struct pm_ops lite5200_pm_ops = {
+static struct platform_suspend_ops lite5200_pm_ops = {
        .valid          = lite5200_pm_valid,
+       .set_target     = lite5200_pm_set_target,
        .prepare        = lite5200_pm_prepare,
        .enter          = lite5200_pm_enter,
        .finish         = lite5200_pm_finish,
@@ -208,6 +218,6 @@ static struct pm_ops lite5200_pm_ops = {
 
 int __init lite5200_pm_init(void)
 {
-       pm_set_ops(&lite5200_pm_ops);
+       suspend_set_ops(&lite5200_pm_ops);
        return 0;
 }
index ee2e7639c63e85c6d890251a2240450d048c03a1..7ffa7babf25416a8f43a98b7595a468391c75472 100644 (file)
@@ -1,5 +1,5 @@
 #include <linux/init.h>
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/io.h>
 #include <asm/time.h>
 #include <asm/cacheflush.h>
@@ -57,11 +57,8 @@ int mpc52xx_set_wakeup_gpio(u8 pin, u8 level)
        return 0;
 }
 
-int mpc52xx_pm_prepare(suspend_state_t state)
+int mpc52xx_pm_prepare(void)
 {
-       if (state != PM_SUSPEND_STANDBY)
-               return -EINVAL;
-
        /* map the whole register space */
        mbar = mpc52xx_find_and_map("mpc5200");
        if (!mbar) {
@@ -166,18 +163,16 @@ int mpc52xx_pm_enter(suspend_state_t state)
        return 0;
 }
 
-int mpc52xx_pm_finish(suspend_state_t state)
+void mpc52xx_pm_finish(void)
 {
        /* call board resume code */
        if (mpc52xx_suspend.board_resume_finish)
                mpc52xx_suspend.board_resume_finish(mbar);
 
        iounmap(mbar);
-
-       return 0;
 }
 
-static struct pm_ops mpc52xx_pm_ops = {
+static struct platform_suspend_ops mpc52xx_pm_ops = {
        .valid          = mpc52xx_pm_valid,
        .prepare        = mpc52xx_pm_prepare,
        .enter          = mpc52xx_pm_enter,
@@ -186,6 +181,6 @@ static struct pm_ops mpc52xx_pm_ops = {
 
 int __init mpc52xx_pm_init(void)
 {
-       pm_set_ops(&mpc52xx_pm_ops);
+       suspend_set_ops(&mpc52xx_pm_ops);
        return 0;
 }
index 8143d1b948e7e2b4d33820abba8d5984866c8eaf..d22f6eac9ccabb1816e76e10a0a0263e0c00b69c 100644 (file)
@@ -67,14 +67,14 @@ static int hp6x0_pm_enter(suspend_state_t state)
        return 0;
 }
 
-static struct pm_ops hp6x0_pm_ops = {
+static struct platform_suspend_ops hp6x0_pm_ops = {
        .enter          = hp6x0_pm_enter,
-       .valid          = pm_valid_only_mem,
+       .valid          = suspend_valid_only_mem,
 };
 
 static int __init hp6x0_pm_init(void)
 {
-       pm_set_ops(&hp6x0_pm_ops);
+       suspend_set_ops(&hp6x0_pm_ops);
        return 0;
 }
 
index fb2caef79cec407f0e36497567902c88c88b2418..3ea000d15e3a29b8d7273e7aad0e53667356e5df 100644 (file)
@@ -585,24 +585,6 @@ static int __init of_debug(char *str)
 
 __setup("of_debug=", of_debug);
 
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-       /* initialize common driver fields */
-       if (!drv->driver.name)
-               drv->driver.name = drv->name;
-       if (!drv->driver.owner)
-               drv->driver.owner = drv->owner;
-       drv->driver.bus = bus;
-
-       /* register with core */
-       return driver_register(&drv->driver);
-}
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-       driver_unregister(&drv->driver);
-}
-
 struct of_device* of_platform_device_create(struct device_node *np,
                                            const char *bus_id,
                                            struct device *parent,
@@ -628,6 +610,4 @@ struct of_device* of_platform_device_create(struct device_node *np,
        return dev;
 }
 
-EXPORT_SYMBOL(of_register_driver);
-EXPORT_SYMBOL(of_unregister_driver);
 EXPORT_SYMBOL(of_platform_device_create);
index f3922e5a89f6c52330b5d6b1cf9ed23353bafba5..2c3bea22815997db8855966d15c1f8bd26d61f84 100644 (file)
@@ -877,7 +877,7 @@ void __cpuinit sun4v_register_mondo_queues(int this_cpu)
 static void __init alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask)
 {
        unsigned long size = PAGE_ALIGN(qmask + 1);
-       void *p = __alloc_bootmem_low(size, size, 0);
+       void *p = __alloc_bootmem(size, size, 0);
        if (!p) {
                prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
                prom_halt();
@@ -889,7 +889,7 @@ static void __init alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask)
 static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask)
 {
        unsigned long size = PAGE_ALIGN(qmask + 1);
-       void *p = __alloc_bootmem_low(size, size, 0);
+       void *p = __alloc_bootmem(size, size, 0);
 
        if (!p) {
                prom_printf("SUN4V: Error, cannot allocate kbuf page.\n");
@@ -906,7 +906,7 @@ static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb)
 
        BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64));
 
-       page = alloc_bootmem_low_pages(PAGE_SIZE);
+       page = alloc_bootmem_pages(PAGE_SIZE);
        if (!page) {
                prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n");
                prom_halt();
@@ -953,7 +953,7 @@ void __init init_IRQ(void)
        kill_prom_timer();
 
        size = sizeof(struct ino_bucket) * NUM_IVECS;
-       ivector_table = alloc_bootmem_low(size);
+       ivector_table = alloc_bootmem(size);
        if (!ivector_table) {
                prom_printf("Fatal error, cannot allocate ivector_table\n");
                prom_halt();
index 42d779866fba394135bf7063d5b6a04e29fe1c7b..fc5c0cc793b8f3a403307c9366b3be0a4fdc84da 100644 (file)
@@ -869,26 +869,6 @@ static int __init of_debug(char *str)
 
 __setup("of_debug=", of_debug);
 
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-       /* initialize common driver fields */
-       if (!drv->driver.name)
-               drv->driver.name = drv->name;
-       if (!drv->driver.owner)
-               drv->driver.owner = drv->owner;
-       drv->driver.bus = bus;
-
-       /* register with core */
-       return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(of_register_driver);
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-       driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(of_unregister_driver);
-
 struct of_device* of_platform_device_create(struct device_node *np,
                                            const char *bus_id,
                                            struct device *parent,
index c76bfbb7da085cd5538391713c13e9b86f9ed148..923e0bcc3bfdb0e65cdb6b957324957aa886040a 100644 (file)
@@ -396,6 +396,13 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
 
        saw_mem = saw_io = 0;
        pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i);
+       if (!pbm_ranges) {
+               prom_printf("PCI: Fatal error, missing PBM ranges property "
+                           " for %s\n",
+                           pbm->name);
+               prom_halt();
+       }
+
        num_pbm_ranges = i / sizeof(*pbm_ranges);
 
        for (i = 0; i < num_pbm_ranges; i++) {
index 9633750167d06b3e9f4d285e105656d01a8ce32f..70ac4186f62b7afc4af36eeb5472d6db868688d8 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: atomic.S,v 1.4 2001/11/18 00:12:56 davem Exp $
- * atomic.S: These things are too big to do inline.
+/* atomic.S: These things are too big to do inline.
  *
- * Copyright (C) 1999 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net)
  */
 
 #include <asm/asi.h>
+#include <asm/backoff.h>
 
        .text
 
        .globl  atomic_add
        .type   atomic_add,#function
 atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
 1:     lduw    [%o1], %g1
        add     %g1, %o0, %g7
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %icc, 1b
+       bne,pn  %icc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_add, .-atomic_add
 
        .globl  atomic_sub
        .type   atomic_sub,#function
 atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
 1:     lduw    [%o1], %g1
        sub     %g1, %o0, %g7
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %icc, 1b
+       bne,pn  %icc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_sub, .-atomic_sub
 
        /* On SMP we need to use memory barriers to ensure
@@ -60,89 +64,101 @@ atomic_sub: /* %o0 = decrement, %o1 = atomic_ptr */
        .globl  atomic_add_ret
        .type   atomic_add_ret,#function
 atomic_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
        ATOMIC_PRE_BARRIER
 1:     lduw    [%o1], %g1
        add     %g1, %o0, %g7
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %icc, 1b
+       bne,pn  %icc, 2f
         add    %g7, %o0, %g7
        sra     %g7, 0, %o0
        ATOMIC_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_add_ret, .-atomic_add_ret
 
        .globl  atomic_sub_ret
        .type   atomic_sub_ret,#function
 atomic_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
        ATOMIC_PRE_BARRIER
 1:     lduw    [%o1], %g1
        sub     %g1, %o0, %g7
        cas     [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %icc, 1b
+       bne,pn  %icc, 2f
         sub    %g7, %o0, %g7
        sra     %g7, 0, %o0
        ATOMIC_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic_sub_ret, .-atomic_sub_ret
 
        .globl  atomic64_add
        .type   atomic64_add,#function
 atomic64_add: /* %o0 = increment, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
 1:     ldx     [%o1], %g1
        add     %g1, %o0, %g7
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_add, .-atomic64_add
 
        .globl  atomic64_sub
        .type   atomic64_sub,#function
 atomic64_sub: /* %o0 = decrement, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
 1:     ldx     [%o1], %g1
        sub     %g1, %o0, %g7
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_sub, .-atomic64_sub
 
        .globl  atomic64_add_ret
        .type   atomic64_add_ret,#function
 atomic64_add_ret: /* %o0 = increment, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
        ATOMIC_PRE_BARRIER
 1:     ldx     [%o1], %g1
        add     %g1, %o0, %g7
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         add    %g7, %o0, %g7
        mov     %g7, %o0
        ATOMIC_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_add_ret, .-atomic64_add_ret
 
        .globl  atomic64_sub_ret
        .type   atomic64_sub_ret,#function
 atomic64_sub_ret: /* %o0 = decrement, %o1 = atomic_ptr */
+       BACKOFF_SETUP(%o2)
        ATOMIC_PRE_BARRIER
 1:     ldx     [%o1], %g1
        sub     %g1, %o0, %g7
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         sub    %g7, %o0, %g7
        mov     %g7, %o0
        ATOMIC_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o2, %o3, 1b)
        .size   atomic64_sub_ret, .-atomic64_sub_ret
index 892431a821311f639e9a18aec4a70c702bd4c726..6b015a6eefb50017e7d22b2d1edc0637408a1fef 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: bitops.S,v 1.3 2001/11/18 00:12:56 davem Exp $
- * bitops.S: Sparc64 atomic bit operations.
+/* bitops.S: Sparc64 atomic bit operations.
  *
- * Copyright (C) 2000 David S. Miller (davem@redhat.com)
+ * Copyright (C) 2000, 2007 David S. Miller (davem@davemloft.net)
  */
 
 #include <asm/asi.h>
+#include <asm/backoff.h>
 
        .text
 
@@ -29,6 +29,7 @@
        .globl  test_and_set_bit
        .type   test_and_set_bit,#function
 test_and_set_bit:      /* %o0=nr, %o1=addr */
+       BACKOFF_SETUP(%o3)
        BITOP_PRE_BARRIER
        srlx    %o0, 6, %g1
        mov     1, %o2
@@ -40,18 +41,20 @@ test_and_set_bit:   /* %o0=nr, %o1=addr */
        or      %g7, %o2, %g1
        casx    [%o1], %g7, %g1
        cmp     %g7, %g1
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         and    %g7, %o2, %g2
        clr     %o0
        movrne  %g2, 1, %o0
        BITOP_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o3, %o4, 1b)
        .size   test_and_set_bit, .-test_and_set_bit
 
        .globl  test_and_clear_bit
        .type   test_and_clear_bit,#function
 test_and_clear_bit:    /* %o0=nr, %o1=addr */
+       BACKOFF_SETUP(%o3)
        BITOP_PRE_BARRIER
        srlx    %o0, 6, %g1
        mov     1, %o2
@@ -63,18 +66,20 @@ test_and_clear_bit: /* %o0=nr, %o1=addr */
        andn    %g7, %o2, %g1
        casx    [%o1], %g7, %g1
        cmp     %g7, %g1
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         and    %g7, %o2, %g2
        clr     %o0
        movrne  %g2, 1, %o0
        BITOP_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o3, %o4, 1b)
        .size   test_and_clear_bit, .-test_and_clear_bit
 
        .globl  test_and_change_bit
        .type   test_and_change_bit,#function
 test_and_change_bit:   /* %o0=nr, %o1=addr */
+       BACKOFF_SETUP(%o3)
        BITOP_PRE_BARRIER
        srlx    %o0, 6, %g1
        mov     1, %o2
@@ -86,18 +91,20 @@ test_and_change_bit:        /* %o0=nr, %o1=addr */
        xor     %g7, %o2, %g1
        casx    [%o1], %g7, %g1
        cmp     %g7, %g1
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         and    %g7, %o2, %g2
        clr     %o0
        movrne  %g2, 1, %o0
        BITOP_POST_BARRIER
        retl
         nop
+2:     BACKOFF_SPIN(%o3, %o4, 1b)
        .size   test_and_change_bit, .-test_and_change_bit
 
        .globl  set_bit
        .type   set_bit,#function
 set_bit:               /* %o0=nr, %o1=addr */
+       BACKOFF_SETUP(%o3)
        srlx    %o0, 6, %g1
        mov     1, %o2
        sllx    %g1, 3, %g3
@@ -108,15 +115,17 @@ set_bit:          /* %o0=nr, %o1=addr */
        or      %g7, %o2, %g1
        casx    [%o1], %g7, %g1
        cmp     %g7, %g1
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o3, %o4, 1b)
        .size   set_bit, .-set_bit
 
        .globl  clear_bit
        .type   clear_bit,#function
 clear_bit:             /* %o0=nr, %o1=addr */
+       BACKOFF_SETUP(%o3)
        srlx    %o0, 6, %g1
        mov     1, %o2
        sllx    %g1, 3, %g3
@@ -127,15 +136,17 @@ clear_bit:                /* %o0=nr, %o1=addr */
        andn    %g7, %o2, %g1
        casx    [%o1], %g7, %g1
        cmp     %g7, %g1
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o3, %o4, 1b)
        .size   clear_bit, .-clear_bit
 
        .globl  change_bit
        .type   change_bit,#function
 change_bit:            /* %o0=nr, %o1=addr */
+       BACKOFF_SETUP(%o3)
        srlx    %o0, 6, %g1
        mov     1, %o2
        sllx    %g1, 3, %g3
@@ -146,8 +157,9 @@ change_bit:         /* %o0=nr, %o1=addr */
        xor     %g7, %o2, %g1
        casx    [%o1], %g7, %g1
        cmp     %g7, %g1
-       bne,pn  %xcc, 1b
+       bne,pn  %xcc, 2f
         nop
        retl
         nop
+2:     BACKOFF_SPIN(%o3, %o4, 1b)
        .size   change_bit, .-change_bit
index ae67e7158e718c495657b51b3b1c933ab61cf0e9..6b4a0f9e38deeb3d4852639ec4c3d83684e5612f 100644 (file)
@@ -31,10 +31,8 @@ void slip_init(struct net_device *dev, void *data)
        slip_proto_init(&spri->slip);
 
        dev->init = NULL;
-       dev->header_cache_update = NULL;
-       dev->hard_header_cache = NULL;
-       dev->hard_header = NULL;
        dev->hard_header_len = 0;
+       dev->header_ops = NULL;
        dev->addr_len = 0;
        dev->type = ARPHRD_SLIP;
        dev->tx_queue_len = 256;
index 240ee650865df79927d0557c81197e7be7283a31..d987af277db9d8f1cc943aa72ab46201e57cbb58 100644 (file)
@@ -34,9 +34,7 @@ void slirp_init(struct net_device *dev, void *data)
 
        dev->init = NULL;
        dev->hard_header_len = 0;
-       dev->header_cache_update = NULL;
-       dev->hard_header_cache = NULL;
-       dev->hard_header = NULL;
+       dev->header_ops = NULL;
        dev->addr_len = 0;
        dev->type = ARPHRD_SLIP;
        dev->tx_queue_len = 256;
index 118b9f9ff499c251ca94bbc6e47d45233eba2c08..5027650eb273158ea70b6b9a3a8ccd04eddf085c 100644 (file)
@@ -289,7 +289,6 @@ static void elf32_init(struct pt_regs *regs)
 
 static ctl_table abi_table2[] = {
        {
-               .ctl_name       = 99,
                .procname       = "vsyscall32",
                .data           = &sysctl_vsyscall32,
                .maxlen         = sizeof(int),
index f22ba8534d26ee19488753eacd2e1057ab841a33..a97313b1270ec3c5f2771744c9bc024f1d6154df 100644 (file)
@@ -11,7 +11,7 @@
 #
 # If physical address of wakeup_code is 0x12345, BIOS should call us with
 # cs = 0x1234, eip = 0x05
-# 
+#
 
 #define BEEP \
        inb     $97, %al;       \
@@ -52,7 +52,6 @@ wakeup_code:
        BEEP
 1:
        mov     $(wakeup_stack - wakeup_code), %sp              # Private stack is needed for ASUS board
-       movw    $0x0e00 + 'S', %fs:(0x12)
 
        pushl   $0                                              # Kill any dangerous flags
        popfl
@@ -90,9 +89,6 @@ wakeup_code:
        # make sure %cr4 is set correctly (features, etc)
        movl    real_save_cr4 - wakeup_code, %eax
        movl    %eax, %cr4
-       movw    $0xb800, %ax
-       movw    %ax,%fs
-       movw    $0x0e00 + 'i', %fs:(0x12)
        
        # need a gdt -- use lgdtl to force 32-bit operands, in case
        # the GDT is located past 16 megabytes.
@@ -102,8 +98,6 @@ wakeup_code:
        movl    %eax, %cr0
        jmp 1f
 1:
-       movw    $0x0e00 + 'n', %fs:(0x14)
-
        movl    real_magic - wakeup_code, %eax
        cmpl    $0x12345678, %eax
        jne     bogus_real_magic
@@ -122,13 +116,11 @@ real_save_cr4:    .long 0
 real_magic:    .long 0
 video_mode:    .long 0
 realmode_flags:        .long 0
-beep_flags:    .long 0
 real_efer_save_restore:        .long 0
 real_save_efer_edx:    .long 0
 real_save_efer_eax:    .long 0
 
 bogus_real_magic:
-       movw    $0x0e00 + 'B', %fs:(0x12)
        jmp bogus_real_magic
 
 /* This code uses an extended set of video mode numbers. These include:
@@ -194,7 +186,6 @@ wakeup_pmode_return:
        movw    %ax, %es
        movw    %ax, %fs
        movw    %ax, %gs
-       movw    $0x0e00 + 'u', 0xb8016
 
        # reload the gdt, as we need the full 32 bit address
        lgdt    saved_gdt
@@ -218,7 +209,6 @@ wakeup_pmode_return:
        jmp     *%eax
 
 bogus_magic:
-       movw    $0x0e00 + 'B', 0xb8018
        jmp     bogus_magic
 
 
index 8b4357e1efe0b97dc37b24e5d4cc66321ecfc0cb..55608ec2ed721dff6e0cd9c705e628763bfea039 100644 (file)
@@ -41,7 +41,6 @@ wakeup_code:
 
 # Running in *copy* of this code, somewhere in low 1MB.
 
-       movb    $0xa1, %al      ;  outb %al, $0x80
        cli
        cld
        # setup data segment
@@ -65,11 +64,6 @@ wakeup_code:
        cmpl    $0x12345678, %eax
        jne     bogus_real_magic
 
-       call    verify_cpu                      # Verify the cpu supports long
-                                               # mode
-       testl   %eax, %eax
-       jnz     no_longmode
-
        testl   $1, realmode_flags - wakeup_code
        jz      1f
        lcall   $0xc000,$3
@@ -84,12 +78,6 @@ wakeup_code:
        call    mode_set
 1:
 
-       movw    $0xb800, %ax
-       movw    %ax,%fs
-       movw    $0x0e00 + 'L', %fs:(0x10)
-
-       movb    $0xa2, %al      ;  outb %al, $0x80
-       
        mov     %ds, %ax                        # Find 32bit wakeup_code addr
        movzx   %ax, %esi                       # (Convert %ds:gdt to a liner ptr)
        shll    $4, %esi
@@ -117,14 +105,10 @@ wakeup_32_vector:
        .code32
 wakeup_32:
 # Running in this code, but at low address; paging is not yet turned on.
-       movb    $0xa5, %al      ;  outb %al, $0x80
 
        movl    $__KERNEL_DS, %eax
        movl    %eax, %ds
 
-       movw    $0x0e00 + 'i', %ds:(0xb8012)
-       movb    $0xa8, %al      ;  outb %al, $0x80;
-
        /*
         * Prepare for entering 64bits mode
         */
@@ -200,16 +184,11 @@ wakeup_long64:
         */
        lgdt    cpu_gdt_descr
 
-       movw    $0x0e00 + 'n', %ds:(0xb8014)
-       movb    $0xa9, %al      ;  outb %al, $0x80
-
        movq    saved_magic, %rax
        movq    $0x123456789abcdef0, %rdx
        cmpq    %rdx, %rax
        jne     bogus_64_magic
 
-       movw    $0x0e00 + 'u', %ds:(0xb8016)
-       
        nop
        nop
        movw    $__KERNEL_DS, %ax
@@ -220,13 +199,11 @@ wakeup_long64:
        movw    %ax, %gs
        movq    saved_rsp, %rsp
 
-       movw    $0x0e00 + 'x', %ds:(0xb8018)
        movq    saved_rbx, %rbx
        movq    saved_rdi, %rdi
        movq    saved_rsi, %rsi
        movq    saved_rbp, %rbp
 
-       movw    $0x0e00 + '!', %ds:(0xb801a)
        movq    saved_rip, %rax
        jmp     *%rax
 
@@ -256,21 +233,12 @@ realmode_flags:   .quad 0
 
 .code16
 bogus_real_magic:
-       movb    $0xba,%al       ;  outb %al,$0x80
        jmp bogus_real_magic
 
 .code64
 bogus_64_magic:
-       movb    $0xb3,%al       ;  outb %al,$0x80
        jmp bogus_64_magic
 
-.code16
-no_longmode:
-       movb    $0xbc,%al       ;  outb %al,$0x80
-       jmp no_longmode
-
-#include "../verify_cpu_64.S"
-       
 /* This code uses an extended set of video mode numbers. These include:
  * Aliases for standard modes
  *     NORMAL_VGA (-1)
index 1826395ebeeb48235e2a51382ce9e426073d769d..297a24116949152324e3cb8edd8f91e2a2a310ba 100644 (file)
@@ -499,6 +499,11 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) {
 
 static void free_cache_attributes(unsigned int cpu)
 {
+       int i;
+
+       for (i = 0; i < num_cache_leaves; i++)
+               cache_remove_shared_cpu_map(cpu, i);
+
        kfree(cpuid4_info[cpu]);
        cpuid4_info[cpu] = NULL;
 }
@@ -506,8 +511,8 @@ static void free_cache_attributes(unsigned int cpu)
 static int __cpuinit detect_cache_attributes(unsigned int cpu)
 {
        struct _cpuid4_info     *this_leaf;
-       unsigned long           j;
-       int                     retval;
+       unsigned long           j;
+       int                     retval;
        cpumask_t               oldmask;
 
        if (num_cache_leaves == 0)
@@ -524,19 +529,26 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
                goto out;
 
        /* Do cpuid and store the results */
-       retval = 0;
        for (j = 0; j < num_cache_leaves; j++) {
                this_leaf = CPUID4_INFO_IDX(cpu, j);
                retval = cpuid4_cache_lookup(j, this_leaf);
-               if (unlikely(retval < 0))
+               if (unlikely(retval < 0)) {
+                       int i;
+
+                       for (i = 0; i < j; i++)
+                               cache_remove_shared_cpu_map(cpu, i);
                        break;
+               }
                cache_shared_cpu_map_setup(cpu, j);
        }
        set_cpus_allowed(current, oldmask);
 
 out:
-       if (retval)
-               free_cache_attributes(cpu);
+       if (retval) {
+               kfree(cpuid4_info[cpu]);
+               cpuid4_info[cpu] = NULL;
+       }
+
        return retval;
 }
 
@@ -669,7 +681,7 @@ static struct kobj_type ktype_percpu_entry = {
        .sysfs_ops      = &sysfs_ops,
 };
 
-static void cpuid4_cache_sysfs_exit(unsigned int cpu)
+static void __cpuinit cpuid4_cache_sysfs_exit(unsigned int cpu)
 {
        kfree(cache_kobject[cpu]);
        kfree(index_kobject[cpu]);
@@ -680,13 +692,14 @@ static void cpuid4_cache_sysfs_exit(unsigned int cpu)
 
 static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu)
 {
+       int err;
 
        if (num_cache_leaves == 0)
                return -ENOENT;
 
-       detect_cache_attributes(cpu);
-       if (cpuid4_info[cpu] == NULL)
-               return -ENOENT;
+       err = detect_cache_attributes(cpu);
+       if (err)
+               return err;
 
        /* Allocate all required memory */
        cache_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL);
@@ -705,13 +718,15 @@ err_out:
        return -ENOMEM;
 }
 
+static cpumask_t cache_dev_map = CPU_MASK_NONE;
+
 /* Add/Remove cache interface for CPU device */
 static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
 {
        unsigned int cpu = sys_dev->id;
        unsigned long i, j;
        struct _index_kobject *this_object;
-       int retval = 0;
+       int retval;
 
        retval = cpuid4_cache_sysfs_init(cpu);
        if (unlikely(retval < 0))
@@ -721,6 +736,10 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
        kobject_set_name(cache_kobject[cpu], "%s", "cache");
        cache_kobject[cpu]->ktype = &ktype_percpu_entry;
        retval = kobject_register(cache_kobject[cpu]);
+       if (retval < 0) {
+               cpuid4_cache_sysfs_exit(cpu);
+               return retval;
+       }
 
        for (i = 0; i < num_cache_leaves; i++) {
                this_object = INDEX_KOBJECT_PTR(cpu,i);
@@ -740,6 +759,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
                        break;
                }
        }
+       if (!retval)
+               cpu_set(cpu, cache_dev_map);
+
        return retval;
 }
 
@@ -750,13 +772,14 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
 
        if (cpuid4_info[cpu] == NULL)
                return;
-       for (i = 0; i < num_cache_leaves; i++) {
-               cache_remove_shared_cpu_map(cpu, i);
+       if (!cpu_isset(cpu, cache_dev_map))
+               return;
+       cpu_clear(cpu, cache_dev_map);
+
+       for (i = 0; i < num_cache_leaves; i++)
                kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
-       }
        kobject_unregister(cache_kobject[cpu]);
        cpuid4_cache_sysfs_exit(cpu);
-       return;
 }
 
 static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,
@@ -781,7 +804,7 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,
 
 static struct notifier_block __cpuinitdata cacheinfo_cpu_notifier =
 {
-    .notifier_call = cacheinfo_cpu_callback,
+       .notifier_call = cacheinfo_cpu_callback,
 };
 
 static int __cpuinit cache_sysfs_init(void)
@@ -791,14 +814,15 @@ static int __cpuinit cache_sysfs_init(void)
        if (num_cache_leaves == 0)
                return 0;
 
-       register_hotcpu_notifier(&cacheinfo_cpu_notifier);
-
        for_each_online_cpu(i) {
-               struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i);
+               int err;
+               struct sys_device *sys_dev = get_cpu_sysdev(i);
 
-               cache_add_dev(sys_dev);
+               err = cache_add_dev(sys_dev);
+               if (err)
+                       return err;
        }
-
+       register_hotcpu_notifier(&cacheinfo_cpu_notifier);
        return 0;
 }
 
index 494d320d909b4959ec2a7c95fb411c02ec547e1b..24885be5c48ca5004a899506ad8fda31edf8a7a3 100644 (file)
@@ -131,17 +131,19 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb,
 {
        unsigned int cpu = (unsigned long)hcpu;
        struct sys_device *sys_dev;
-       int err;
+       int err = 0;
 
        sys_dev = get_cpu_sysdev(cpu);
        switch (action) {
-       case CPU_ONLINE:
-       case CPU_ONLINE_FROZEN:
+       case CPU_UP_PREPARE:
+       case CPU_UP_PREPARE_FROZEN:
                mutex_lock(&therm_cpu_lock);
                err = thermal_throttle_add_dev(sys_dev);
                mutex_unlock(&therm_cpu_lock);
                WARN_ON(err);
                break;
+       case CPU_UP_CANCELED:
+       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
                mutex_lock(&therm_cpu_lock);
@@ -149,7 +151,7 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb,
                mutex_unlock(&therm_cpu_lock);
                break;
        }
-       return NOTIFY_OK;
+       return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
 static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata =
index 8ca8f8648969354b12a37af8f7f135c6728e31a9..66e6b797b2cb69a5819ab61155e0ab853d830338 100644 (file)
@@ -802,16 +802,29 @@ static __cpuinit int mce_create_device(unsigned int cpu)
        if (!mce_available(&cpu_data[cpu]))
                return -EIO;
 
+       memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
        per_cpu(device_mce,cpu).id = cpu;
        per_cpu(device_mce,cpu).cls = &mce_sysclass;
 
        err = sysdev_register(&per_cpu(device_mce,cpu));
+       if (err)
+               return err;
+
+       for (i = 0; mce_attributes[i]; i++) {
+               err = sysdev_create_file(&per_cpu(device_mce,cpu),
+                                        mce_attributes[i]);
+               if (err)
+                       goto error;
+       }
 
-       if (!err) {
-               for (i = 0; mce_attributes[i]; i++)
-                       sysdev_create_file(&per_cpu(device_mce,cpu),
-                               mce_attributes[i]);
+       return 0;
+error:
+       while (i--) {
+               sysdev_remove_file(&per_cpu(device_mce,cpu),
+                                  mce_attributes[i]);
        }
+       sysdev_unregister(&per_cpu(device_mce,cpu));
+
        return err;
 }
 
@@ -823,7 +836,6 @@ static void mce_remove_device(unsigned int cpu)
                sysdev_remove_file(&per_cpu(device_mce,cpu),
                        mce_attributes[i]);
        sysdev_unregister(&per_cpu(device_mce,cpu));
-       memset(&per_cpu(device_mce, cpu).kobj, 0, sizeof(struct kobject));
 }
 
 /* Get notified when a cpu comes on/off. Be hotplug friendly. */
@@ -831,18 +843,21 @@ static int
 mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
+       int err = 0;
 
        switch (action) {
-       case CPU_ONLINE:
-       case CPU_ONLINE_FROZEN:
-               mce_create_device(cpu);
+       case CPU_UP_PREPARE:
+       case CPU_UP_PREPARE_FROZEN:
+               err = mce_create_device(cpu);
                break;
+       case CPU_UP_CANCELED:
+       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
                mce_remove_device(cpu);
                break;
        }
-       return NOTIFY_OK;
+       return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
 static struct notifier_block mce_cpu_notifier = {
@@ -857,9 +872,13 @@ static __init int mce_init_device(void)
        if (!mce_available(&boot_cpu_data))
                return -EIO;
        err = sysdev_class_register(&mce_sysclass);
+       if (err)
+               return err;
 
        for_each_online_cpu(i) {
-               mce_create_device(i);
+               err = mce_create_device(i);
+               if (err)
+                       return err;
        }
 
        register_hotcpu_notifier(&mce_cpu_notifier);
index df85c9c13601e4205fae3192538757babbe223ae..e18e516cf5491bf875d5fbe6a3ef42fc10e39fef 100644 (file)
@@ -133,37 +133,42 @@ static const struct file_operations msr_fops = {
        .open = msr_open,
 };
 
-static int __cpuinit msr_device_create(int i)
+static int __cpuinit msr_device_create(int cpu)
 {
-       int err = 0;
        struct device *dev;
 
-       dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), "msr%d",i);
-       if (IS_ERR(dev))
-               err = PTR_ERR(dev);
-       return err;
+       dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu),
+                           "msr%d", cpu);
+       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+}
+
+static void msr_device_destroy(int cpu)
+{
+       device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
 }
 
 static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
                                unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
+       int err = 0;
 
        switch (action) {
-       case CPU_ONLINE:
-       case CPU_ONLINE_FROZEN:
-               msr_device_create(cpu);
+       case CPU_UP_PREPARE:
+       case CPU_UP_PREPARE_FROZEN:
+               err = msr_device_create(cpu);
                break;
+       case CPU_UP_CANCELED:
+       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
-               device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
+               msr_device_destroy(cpu);
                break;
        }
-       return NOTIFY_OK;
+       return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata msr_class_cpu_notifier =
-{
+static struct notifier_block __cpuinitdata msr_class_cpu_notifier = {
        .notifier_call = msr_class_cpu_callback,
 };
 
@@ -196,7 +201,7 @@ static int __init msr_init(void)
 out_class:
        i = 0;
        for_each_online_cpu(i)
-               device_destroy(msr_class, MKDEV(MSR_MAJOR, i));
+               msr_device_destroy(i);
        class_destroy(msr_class);
 out_chrdev:
        unregister_chrdev(MSR_MAJOR, "cpu/msr");
@@ -208,7 +213,7 @@ static void __exit msr_exit(void)
 {
        int cpu = 0;
        for_each_online_cpu(cpu)
-               device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
+               msr_device_destroy(cpu);
        class_destroy(msr_class);
        unregister_chrdev(MSR_MAJOR, "cpu/msr");
        unregister_hotcpu_notifier(&msr_class_cpu_notifier);
index 573c0a6e0ac636e29a1da03ae608094200f499f5..f8fafe527ff1cbf76e8fa513839f21650b0e1615 100644 (file)
@@ -150,8 +150,22 @@ void fix_processor_context(void)
 /* Defined in arch/x86_64/kernel/suspend_asm.S */
 extern int restore_image(void);
 
+/*
+ * Address to jump to in the last phase of restore in order to get to the image
+ * kernel's text (this value is passed in the image header).
+ */
+unsigned long restore_jump_address;
+
+/*
+ * Value of the cr3 register from before the hibernation (this value is passed
+ * in the image header).
+ */
+unsigned long restore_cr3;
+
 pgd_t *temp_level4_pgt;
 
+void *relocated_restore_code;
+
 static int res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long end)
 {
        long i, j;
@@ -175,7 +189,7 @@ static int res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long en
 
                        if (paddr >= end)
                                break;
-                       pe = _PAGE_NX | _PAGE_PSE | _KERNPG_TABLE | paddr;
+                       pe = __PAGE_KERNEL_LARGE_EXEC | paddr;
                        pe &= __supported_pte_mask;
                        set_pmd(pmd, __pmd(pe));
                }
@@ -183,25 +197,42 @@ static int res_phys_pud_init(pud_t *pud, unsigned long address, unsigned long en
        return 0;
 }
 
+static int res_kernel_text_pud_init(pud_t *pud, unsigned long start)
+{
+       pmd_t *pmd;
+       unsigned long paddr;
+
+       pmd = (pmd_t *)get_safe_page(GFP_ATOMIC);
+       if (!pmd)
+               return -ENOMEM;
+       set_pud(pud + pud_index(start), __pud(__pa(pmd) | _KERNPG_TABLE));
+       for (paddr = 0; paddr < KERNEL_TEXT_SIZE; pmd++, paddr += PMD_SIZE) {
+               unsigned long pe;
+
+               pe = __PAGE_KERNEL_LARGE_EXEC | _PAGE_GLOBAL | paddr;
+               pe &= __supported_pte_mask;
+               set_pmd(pmd, __pmd(pe));
+       }
+
+       return 0;
+}
+
 static int set_up_temporary_mappings(void)
 {
        unsigned long start, end, next;
+       pud_t *pud;
        int error;
 
        temp_level4_pgt = (pgd_t *)get_safe_page(GFP_ATOMIC);
        if (!temp_level4_pgt)
                return -ENOMEM;
 
-       /* It is safe to reuse the original kernel mapping */
-       set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map),
-               init_level4_pgt[pgd_index(__START_KERNEL_map)]);
-
        /* Set up the direct mapping from scratch */
        start = (unsigned long)pfn_to_kaddr(0);
        end = (unsigned long)pfn_to_kaddr(end_pfn);
 
        for (; start < end; start = next) {
-               pud_t *pud = (pud_t *)get_safe_page(GFP_ATOMIC);
+               pud = (pud_t *)get_safe_page(GFP_ATOMIC);
                if (!pud)
                        return -ENOMEM;
                next = start + PGDIR_SIZE;
@@ -212,7 +243,17 @@ static int set_up_temporary_mappings(void)
                set_pgd(temp_level4_pgt + pgd_index(start),
                        mk_kernel_pgd(__pa(pud)));
        }
-       return 0;
+
+       /* Set up the kernel text mapping from scratch */
+       pud = (pud_t *)get_safe_page(GFP_ATOMIC);
+       if (!pud)
+               return -ENOMEM;
+       error = res_kernel_text_pud_init(pud, __START_KERNEL_map);
+       if (!error)
+               set_pgd(temp_level4_pgt + pgd_index(__START_KERNEL_map),
+                       __pgd(__pa(pud) | _PAGE_TABLE));
+
+       return error;
 }
 
 int swsusp_arch_resume(void)
@@ -222,6 +263,13 @@ int swsusp_arch_resume(void)
        /* We have got enough memory and from now on we cannot recover */
        if ((error = set_up_temporary_mappings()))
                return error;
+
+       relocated_restore_code = (void *)get_safe_page(GFP_ATOMIC);
+       if (!relocated_restore_code)
+               return -ENOMEM;
+       memcpy(relocated_restore_code, &core_restore_code,
+              &restore_registers - &core_restore_code);
+
        restore_image();
        return 0;
 }
@@ -236,4 +284,43 @@ int pfn_is_nosave(unsigned long pfn)
        unsigned long nosave_end_pfn = PAGE_ALIGN(__pa_symbol(&__nosave_end)) >> PAGE_SHIFT;
        return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
 }
+
+struct restore_data_record {
+       unsigned long jump_address;
+       unsigned long cr3;
+       unsigned long magic;
+};
+
+#define RESTORE_MAGIC  0x0123456789ABCDEFUL
+
+/**
+ *     arch_hibernation_header_save - populate the architecture specific part
+ *             of a hibernation image header
+ *     @addr: address to save the data at
+ */
+int arch_hibernation_header_save(void *addr, unsigned int max_size)
+{
+       struct restore_data_record *rdr = addr;
+
+       if (max_size < sizeof(struct restore_data_record))
+               return -EOVERFLOW;
+       rdr->jump_address = restore_jump_address;
+       rdr->cr3 = restore_cr3;
+       rdr->magic = RESTORE_MAGIC;
+       return 0;
+}
+
+/**
+ *     arch_hibernation_header_restore - read the architecture specific data
+ *             from the hibernation image header
+ *     @addr: address to read the data from
+ */
+int arch_hibernation_header_restore(void *addr)
+{
+       struct restore_data_record *rdr = addr;
+
+       restore_jump_address = rdr->jump_address;
+       restore_cr3 = rdr->cr3;
+       return (rdr->magic == RESTORE_MAGIC) ? 0 : -EINVAL;
+}
 #endif /* CONFIG_HIBERNATION */
index 16d183f67bc1e66e790f6160ae54a436554b9041..48344b666d2c2e60f56d3393d82ecc48e0b9388f 100644 (file)
@@ -2,8 +2,8 @@
  *
  * Distribute under GPLv2.
  *
- * swsusp_arch_resume may not use any stack, nor any variable that is
- * not "NoSave" during copying pages:
+ * swsusp_arch_resume must not use any stack or any nonlocal variables while
+ * copying pages:
  *
  * Its rewriting one kernel image with another. What is stack in "old"
  * image could very well be data page in "new" image, and overwriting
@@ -36,6 +36,13 @@ ENTRY(swsusp_arch_suspend)
        movq %r15, saved_context_r15(%rip)
        pushfq ; popq saved_context_eflags(%rip)
 
+       /* save the address of restore_registers */
+       movq    $restore_registers, %rax
+       movq    %rax, restore_jump_address(%rip)
+       /* save cr3 */
+       movq    %cr3, %rax
+       movq    %rax, restore_cr3(%rip)
+
        call swsusp_save
        ret
 
@@ -54,7 +61,17 @@ ENTRY(restore_image)
        movq    %rcx, %cr3;
        movq    %rax, %cr4;  # turn PGE back on
 
+       /* prepare to jump to the image kernel */
+       movq    restore_jump_address(%rip), %rax
+       movq    restore_cr3(%rip), %rbx
+
+       /* prepare to copy image data to their original locations */
        movq    restore_pblist(%rip), %rdx
+       movq    relocated_restore_code(%rip), %rcx
+       jmpq    *%rcx
+
+       /* code below has been relocated to a safe page */
+ENTRY(core_restore_code)
 loop:
        testq   %rdx, %rdx
        jz      done
@@ -62,7 +79,7 @@ loop:
        /* get addresses from the pbe and copy the page */
        movq    pbe_address(%rdx), %rsi
        movq    pbe_orig_address(%rdx), %rdi
-       movq    $512, %rcx
+       movq    $(PAGE_SIZE >> 3), %rcx
        rep
        movsq
 
@@ -70,10 +87,22 @@ loop:
        movq    pbe_next(%rdx), %rdx
        jmp     loop
 done:
+       /* jump to the restore_registers address from the image header */
+       jmpq    *%rax
+       /*
+        * NOTE: This assumes that the boot kernel's text mapping covers the
+        * image kernel's page containing restore_registers and the address of
+        * this page is the same as in the image kernel's text mapping (it
+        * should always be true, because the text mapping is linear, starting
+        * from 0, and is supposed to cover the entire kernel text for every
+        * kernel).
+        *
+        * code below belongs to the image kernel
+        */
+
+ENTRY(restore_registers)
        /* go back to the original page tables */
-       movq    $(init_level4_pgt - __START_KERNEL_map), %rax
-       addq    phys_base(%rip), %rax
-       movq    %rax, %cr3
+       movq    %rbx, %cr3
 
        /* Flush TLB, including "global" things (vmalloc) */
        movq    mmu_cr4_features(%rip), %rax
@@ -84,12 +113,9 @@ done:
        movq    %rcx, %cr3
        movq    %rax, %cr4;  # turn PGE back on
 
-       movl    $24, %eax
-       movl    %eax, %ds
-
        movq saved_context_esp(%rip), %rsp
        movq saved_context_ebp(%rip), %rbp
-       /* Don't restore %rax, it must be 0 anyway */
+       /* restore GPRs (we don't restore %rax, it must be 0 anyway) */
        movq saved_context_ebx(%rip), %rbx
        movq saved_context_ecx(%rip), %rcx
        movq saved_context_edx(%rip), %rdx
@@ -107,4 +133,7 @@ done:
 
        xorq    %rax, %rax
 
+       /* tell the hibernation core that we've just restored the memory */
+       movq    %rax, in_suspend(%rip)
+
        ret
index 8a67e282cb5e69837a9fbba529428de8f78201e0..585541ca1a7e3410be012acfdabb5d3404f7849c 100644 (file)
@@ -64,6 +64,16 @@ struct vsyscall_gtod_data __vsyscall_gtod_data __section_vsyscall_gtod_data =
        .sysctl_enabled = 1,
 };
 
+void update_vsyscall_tz(void)
+{
+       unsigned long flags;
+
+       write_seqlock_irqsave(&vsyscall_gtod_data.lock, flags);
+       /* sys_tz has changed */
+       vsyscall_gtod_data.sys_tz = sys_tz;
+       write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
+}
+
 void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
 {
        unsigned long flags;
@@ -77,7 +87,6 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
        vsyscall_gtod_data.clock.shift = clock->shift;
        vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec;
        vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec;
-       vsyscall_gtod_data.sys_tz = sys_tz;
        vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic;
        write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
 }
@@ -163,7 +172,7 @@ time_t __vsyscall(1) vtime(time_t *t)
        if (unlikely(!__vsyscall_gtod_data.sysctl_enabled))
                return time_syscall(t);
 
-       vgettimeofday(&tv, 0);
+       vgettimeofday(&tv, NULL);
        result = tv.tv_sec;
        if (t)
                *t = result;
@@ -257,18 +266,10 @@ out:
        return ret;
 }
 
-static int vsyscall_sysctl_nostrat(ctl_table *t, int __user *name, int nlen,
-                               void __user *oldval, size_t __user *oldlenp,
-                               void __user *newval, size_t newlen)
-{
-       return -ENOSYS;
-}
-
 static ctl_table kernel_table2[] = {
-       { .ctl_name = 99, .procname = "vsyscall64",
+       { .procname = "vsyscall64",
          .data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
          .mode = 0644,
-         .strategy = vsyscall_sysctl_nostrat,
          .proc_handler = vsyscall_sysctl_change },
        {}
 };
index 43fafe9e9c080db10bc0e5b0e7f52291b35e718a..78cb68f2ebbd7653c3b9d9395369fff7904e5761 100644 (file)
@@ -716,6 +716,11 @@ menu "Power management options"
 
 source kernel/power/Kconfig
 
+config ARCH_HIBERNATION_HEADER
+       bool
+       depends on HIBERNATION
+       default y
+
 source "drivers/acpi/Kconfig"
 
 source "arch/x86/kernel/cpufreq/Kconfig"
index 4fb134d50da731e96ce25aef47c3f3b8c21f45f1..34f40ea0ba60a3a4d886e7aad341d59789d4d11a 100644 (file)
@@ -58,6 +58,8 @@ source "drivers/power/Kconfig"
 
 source "drivers/hwmon/Kconfig"
 
+source "drivers/watchdog/Kconfig"
+
 source "drivers/ssb/Kconfig"
 
 source "drivers/mfd/Kconfig"
index 174c27eb443032f06ad3b8a61c7410bd6f0d4566..d2dc01cc73e7cd98c511003e66274c2299650e76 100644 (file)
@@ -66,7 +66,7 @@ obj-y                         += i2c/
 obj-$(CONFIG_W1)               += w1/
 obj-$(CONFIG_POWER_SUPPLY)     += power/
 obj-$(CONFIG_HWMON)            += hwmon/
-obj-$(CONFIG_WATCHDOG)         += char/watchdog/
+obj-$(CONFIG_WATCHDOG)         += watchdog/
 obj-$(CONFIG_PHONE)            += telephony/
 obj-$(CONFIG_MD)               += md/
 obj-$(CONFIG_BT)               += bluetooth/
index 5055acf2163c6d4e55fec3f68871c90ec6c41c1d..048295ec370786aae9b04b900402103e29c72df8 100644 (file)
@@ -50,7 +50,7 @@ int acpi_sleep_prepare(u32 acpi_state)
 }
 
 #ifdef CONFIG_SUSPEND
-static struct pm_ops acpi_pm_ops;
+static struct platform_suspend_ops acpi_pm_ops;
 
 extern void do_suspend_lowlevel(void);
 
@@ -85,13 +85,12 @@ static int acpi_pm_set_target(suspend_state_t pm_state)
 
 /**
  *     acpi_pm_prepare - Do preliminary suspend work.
- *     @pm_state: ignored
  *
  *     If necessary, set the firmware waking vector and do arch-specific
  *     nastiness to get the wakeup code to the waking vector.
  */
 
-static int acpi_pm_prepare(suspend_state_t pm_state)
+static int acpi_pm_prepare(void)
 {
        int error = acpi_sleep_prepare(acpi_target_sleep_state);
 
@@ -160,13 +159,12 @@ static int acpi_pm_enter(suspend_state_t pm_state)
 
 /**
  *     acpi_pm_finish - Finish up suspend sequence.
- *     @pm_state: ignored
  *
  *     This is called after we wake back up (or if entering the sleep state
  *     failed). 
  */
 
-static int acpi_pm_finish(suspend_state_t pm_state)
+static void acpi_pm_finish(void)
 {
        u32 acpi_state = acpi_target_sleep_state;
 
@@ -184,7 +182,6 @@ static int acpi_pm_finish(suspend_state_t pm_state)
                init_8259A(0);
        }
 #endif
-       return 0;
 }
 
 static int acpi_pm_state_valid(suspend_state_t pm_state)
@@ -203,7 +200,7 @@ static int acpi_pm_state_valid(suspend_state_t pm_state)
        }
 }
 
-static struct pm_ops acpi_pm_ops = {
+static struct platform_suspend_ops acpi_pm_ops = {
        .valid = acpi_pm_state_valid,
        .set_target = acpi_pm_set_target,
        .prepare = acpi_pm_prepare,
@@ -233,6 +230,12 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
 #endif /* CONFIG_SUSPEND */
 
 #ifdef CONFIG_HIBERNATION
+static int acpi_hibernation_start(void)
+{
+       acpi_target_sleep_state = ACPI_STATE_S4;
+       return 0;
+}
+
 static int acpi_hibernation_prepare(void)
 {
        return acpi_sleep_prepare(ACPI_STATE_S4);
@@ -254,6 +257,15 @@ static int acpi_hibernation_enter(void)
        return ACPI_SUCCESS(status) ? 0 : -EFAULT;
 }
 
+static void acpi_hibernation_leave(void)
+{
+       /*
+        * If ACPI is not enabled by the BIOS and the boot kernel, we need to
+        * enable it here.
+        */
+       acpi_enable();
+}
+
 static void acpi_hibernation_finish(void)
 {
        acpi_leave_sleep_state(ACPI_STATE_S4);
@@ -261,6 +273,8 @@ static void acpi_hibernation_finish(void)
 
        /* reset firmware waking vector */
        acpi_set_firmware_waking_vector((acpi_physical_address) 0);
+
+       acpi_target_sleep_state = ACPI_STATE_S0;
 }
 
 static int acpi_hibernation_pre_restore(void)
@@ -277,10 +291,13 @@ static void acpi_hibernation_restore_cleanup(void)
        acpi_hw_enable_all_runtime_gpes();
 }
 
-static struct hibernation_ops acpi_hibernation_ops = {
+static struct platform_hibernation_ops acpi_hibernation_ops = {
+       .start = acpi_hibernation_start,
+       .pre_snapshot = acpi_hibernation_prepare,
+       .finish = acpi_hibernation_finish,
        .prepare = acpi_hibernation_prepare,
        .enter = acpi_hibernation_enter,
-       .finish = acpi_hibernation_finish,
+       .leave = acpi_hibernation_leave,
        .pre_restore = acpi_hibernation_pre_restore,
        .restore_cleanup = acpi_hibernation_restore_cleanup,
 };
@@ -417,7 +434,7 @@ int __init acpi_sleep_init(void)
                }
        }
 
-       pm_set_ops(&acpi_pm_ops);
+       suspend_set_ops(&acpi_pm_ops);
 #endif
 
 #ifdef CONFIG_HIBERNATION
index 33f5eb038773afa73b893c4d0f91825a24bf2f37..ba63619ae5df20623ec530cc6eb7188da0b0c1df 100644 (file)
@@ -182,6 +182,15 @@ config PATA_ACPI
          firmware in the BIOS. This driver can sometimes handle
          otherwise unsupported hardware.
 
+config SATA_FSL
+       tristate "Freescale 3.0Gbps SATA support"
+       depends on PPC_MPC837x
+       help
+         This option enables support for Freescale 3.0Gbps SATA controller.
+         It can be found on MPC837x and MPC8315.
+
+         If unsure, say N.
+
 config PATA_ALI
        tristate "ALi PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
@@ -641,11 +650,4 @@ config PATA_BF54X
 
          If unsure, say N.
 
-config PATA_BF54X_DMA
-       bool "DMA mode"
-       depends on PATA_BF54X
-       default y
-       help
-         Enable DMA mode for Blackfin ATAPI controller.
-
 endif # ATA
index 6bdc307649e67fc66e12feb505017c29b5886395..b13feb2c5dae02cf934e1447b743a396749113fe 100644 (file)
@@ -17,6 +17,7 @@ obj-$(CONFIG_SATA_ULI)                += sata_uli.o
 obj-$(CONFIG_SATA_MV)          += sata_mv.o
 obj-$(CONFIG_SATA_INIC162X)    += sata_inic162x.o
 obj-$(CONFIG_PDC_ADMA)         += pdc_adma.o
+obj-$(CONFIG_SATA_FSL)         += sata_fsl.o
 
 obj-$(CONFIG_PATA_ALI)         += pata_ali.o
 obj-$(CONFIG_PATA_AMD)         += pata_amd.o
index 026439e05afe5e9a1a75ebaf246123c7fdc6c18b..f9e4cd5279423c678343aca53d2078937df6fe7f 100644 (file)
@@ -156,7 +156,7 @@ void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
 {
        struct ata_ioports *ioaddr = &ap->ioaddr;
 
-       tf->command = ata_check_status(ap);
+       tf->command = ata_chk_status(ap);
        tf->feature = ioread8(ioaddr->error_addr);
        tf->nsect = ioread8(ioaddr->nsect_addr);
        tf->lbal = ioread8(ioaddr->lbal_addr);
@@ -882,7 +882,7 @@ unsigned long ata_pci_default_filter(struct ata_device *adev, unsigned long xfer
        /* Filter out DMA modes if the device has been configured by
           the BIOS as PIO only */
 
-       if (adev->link->ap->ioaddr.bmdma_addr == 0)
+       if (adev->link->ap->ioaddr.bmdma_addr == NULL)
                xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
        return xfer_mask;
 }
index 5d3920f6fd690f0c3a145865026dfadfc6bc790d..0f6f7bcc3defa8e39bdb235bcdd7b18e086b4614 100644 (file)
@@ -370,8 +370,10 @@ static struct pci_driver pacpi_pci_driver = {
        .id_table               = pacpi_pci_tbl,
        .probe                  = pacpi_init_one,
        .remove                 = ata_pci_remove_one,
+#ifdef CONFIG_PM
        .suspend                = ata_pci_device_suspend,
        .resume                 = ata_pci_device_resume,
+#endif
 };
 
 static int __init pacpi_init(void)
index 747549e4563a0feaad6493965deed41032c6a82d..b5e38426b815ec4ed64854d467ee0548f1a90c8b 100644 (file)
@@ -1092,14 +1092,15 @@ static unsigned int bfin_bus_softreset(struct ata_port *ap,
  *     Note: Original code is ata_std_softreset().
  */
 
-static int bfin_std_softreset(struct ata_port *ap, unsigned int *classes,
+static int bfin_std_softreset(struct ata_link *link, unsigned int *classes,
                unsigned long deadline)
 {
+       struct ata_port *ap = link->ap;
        unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
        unsigned int devmask = 0, err_mask;
        u8 err;
 
-       if (ata_port_offline(ap)) {
+       if (ata_link_offline(link)) {
                classes[0] = ATA_DEV_NONE;
                goto out;
        }
@@ -1122,9 +1123,11 @@ static int bfin_std_softreset(struct ata_port *ap, unsigned int *classes,
        }
 
        /* determine by signature whether we have ATA or ATAPI devices */
-       classes[0] = ata_dev_try_classify(ap, 0, &err);
+       classes[0] = ata_dev_try_classify(&ap->link.device[0],
+                               devmask & (1 << 0), &err);
        if (slave_possible && err != 0x81)
-               classes[1] = ata_dev_try_classify(ap, 1, &err);
+               classes[1] = ata_dev_try_classify(&ap->link.device[1],
+                                       devmask & (1 << 1), &err);
 
  out:
        return 0;
@@ -1167,7 +1170,7 @@ static unsigned char bfin_bmdma_status(struct ata_port *ap)
 static void bfin_data_xfer(struct ata_device *adev, unsigned char *buf,
                           unsigned int buflen, int write_data)
 {
-       struct ata_port *ap = adev->ap;
+       struct ata_port *ap = adev->link->ap;
        unsigned int words = buflen >> 1;
        unsigned short *buf16 = (u16 *) buf;
        void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr;
@@ -1206,7 +1209,10 @@ static void bfin_irq_clear(struct ata_port *ap)
        void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr;
 
        pr_debug("in atapi irq clear\n");
-       ATAPI_SET_INT_STATUS(base, 0x1FF);
+
+       ATAPI_SET_INT_STATUS(base, ATAPI_GET_INT_STATUS(base)|ATAPI_DEV_INT
+               | MULTI_DONE_INT | UDMAIN_DONE_INT | UDMAOUT_DONE_INT
+               | MULTI_TERM_INT | UDMAIN_TERM_INT | UDMAOUT_TERM_INT);
 }
 
 /**
@@ -1233,33 +1239,6 @@ static unsigned char bfin_irq_on(struct ata_port *ap)
        return tmp;
 }
 
-/**
- *     bfin_irq_ack - Acknowledge a device interrupt.
- *     @ap: Port on which interrupts are enabled.
- *
- *     Note: Original code is ata_irq_ack().
- */
-
-static unsigned char bfin_irq_ack(struct ata_port *ap, unsigned int chk_drq)
-{
-       void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr;
-       unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
-       unsigned char status;
-
-       pr_debug("in atapi irq ack\n");
-       status = ata_busy_wait(ap, bits, 1000);
-       if (status & bits)
-               if (ata_msg_err(ap))
-                       dev_err(ap->dev, "abnormal status 0x%X\n", status);
-
-       /* get controller status; clear intr, err bits */
-       ATAPI_SET_INT_STATUS(base, ATAPI_GET_INT_STATUS(base)|ATAPI_DEV_INT
-               | MULTI_DONE_INT | UDMAIN_DONE_INT | UDMAOUT_DONE_INT
-               | MULTI_TERM_INT | UDMAIN_TERM_INT | UDMAOUT_TERM_INT);
-
-       return bfin_bmdma_status(ap);
-}
-
 /**
  *     bfin_bmdma_freeze - Freeze DMA controller port
  *     @ap: port to freeze
@@ -1308,8 +1287,9 @@ void bfin_bmdma_thaw(struct ata_port *ap)
  *     Note: Original code is ata_std_postreset().
  */
 
-static void bfin_std_postreset(struct ata_port *ap, unsigned int *classes)
+static void bfin_std_postreset(struct ata_link *link, unsigned int *classes)
 {
+       struct ata_port *ap = link->ap;
        void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr;
 
        /* re-enable interrupts */
@@ -1395,7 +1375,6 @@ static struct scsi_host_template bfin_sht = {
 };
 
 static const struct ata_port_operations bfin_pata_ops = {
-       .port_disable           = ata_port_disable,
        .set_piomode            = bfin_set_piomode,
        .set_dmamode            = bfin_set_dmamode,
 
@@ -1423,7 +1402,6 @@ static const struct ata_port_operations bfin_pata_ops = {
        .irq_handler            = ata_interrupt,
        .irq_clear              = bfin_irq_clear,
        .irq_on                 = bfin_irq_on,
-       .irq_ack                = bfin_irq_ack,
 
        .port_start             = bfin_port_start,
        .port_stop              = bfin_port_stop,
@@ -1437,11 +1415,7 @@ static struct ata_port_info bfin_port_info[] = {
                                | ATA_FLAG_NO_LEGACY,
                .pio_mask       = 0x1f, /* pio0-4 */
                .mwdma_mask     = 0,
-#ifdef CONFIG_PATA_BF54X_DMA
-               .udma_mask      = ATA_UDMA5,
-#else
                .udma_mask      = 0,
-#endif
                .port_ops       = &bfin_pata_ops,
        },
 };
@@ -1607,9 +1581,25 @@ static struct platform_driver bfin_atapi_driver = {
        },
 };
 
+#define ATAPI_MODE_SIZE                10
+static char bfin_atapi_mode[ATAPI_MODE_SIZE];
+
 static int __init bfin_atapi_init(void)
 {
        pr_info("register bfin atapi driver\n");
+
+       switch(bfin_atapi_mode[0]) {
+       case 'p':
+       case 'P':
+               break;
+       case 'm':
+       case 'M':
+               bfin_port_info[0].mwdma_mask = ATA_MWDMA2;
+               break;
+       default:
+               bfin_port_info[0].udma_mask = ATA_UDMA5;
+       };
+
        return platform_driver_register(&bfin_atapi_driver);
 }
 
@@ -1620,6 +1610,13 @@ static void __exit bfin_atapi_exit(void)
 
 module_init(bfin_atapi_init);
 module_exit(bfin_atapi_exit);
+/*
+ * ATAPI mode:
+ * pio/PIO
+ * udma/UDMA (default)
+ * mwdma/MWDMA
+ */
+module_param_string(bfin_atapi_mode, bfin_atapi_mode, ATAPI_MODE_SIZE, 0);
 
 MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
 MODULE_DESCRIPTION("PATA driver for blackfin 54x ATAPI controller");
index 8d1b03d5bcb1e65d63c5b67121791e8fe1eee77a..199f7e150eb37822f556753f7b7902580926aa3b 100644 (file)
@@ -318,7 +318,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
        struct scatterlist *sg;
        struct ata_port *ap = qc->ap;
        struct adma_port_priv *pp = ap->private_data;
-       u8  *buf = pp->pkt;
+       u8  *buf = pp->pkt, *last_buf = NULL;
        int i = (2 + buf[3]) * 8;
        u8 pFLAGS = pORD | ((qc->tf.flags & ATA_TFLAG_WRITE) ? pDIRO : 0);
 
@@ -334,8 +334,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
                *(__le32 *)(buf + i) = cpu_to_le32(len);
                i += 4;
 
-               if (ata_sg_is_last(sg, qc))
-                       pFLAGS |= pEND;
+               last_buf = &buf[i];
                buf[i++] = pFLAGS;
                buf[i++] = qc->dev->dma_mode & 0xf;
                buf[i++] = 0;   /* pPKLW */
@@ -348,6 +347,10 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
                VPRINTK("PRD[%u] = (0x%lX, 0x%X)\n", i/4,
                                        (unsigned long)addr, len);
        }
+
+       if (likely(last_buf))
+               *last_buf |= pEND;
+
        return i;
 }
 
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
new file mode 100644 (file)
index 0000000..b4c37b9
--- /dev/null
@@ -0,0 +1,1490 @@
+/*
+ * drivers/ata/sata_fsl.c
+ *
+ * Freescale 3.0Gbps SATA device driver
+ *
+ * Author: Ashish Kalra <ashish.kalra@freescale.com>
+ * Li Yang <leoli@freescale.com>
+ *
+ * Copyright (c) 2006-2007 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_cmnd.h>
+#include <linux/libata.h>
+#include <asm/io.h>
+#include <linux/of_platform.h>
+
+/* Controller information */
+enum {
+       SATA_FSL_QUEUE_DEPTH    = 16,
+       SATA_FSL_MAX_PRD        = 63,
+       SATA_FSL_MAX_PRD_USABLE = SATA_FSL_MAX_PRD - 1,
+       SATA_FSL_MAX_PRD_DIRECT = 16,   /* Direct PRDT entries */
+
+       SATA_FSL_HOST_FLAGS     = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+                               ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+                               ATA_FLAG_NCQ  | ATA_FLAG_SKIP_D2H_BSY),
+
+       SATA_FSL_MAX_CMDS       = SATA_FSL_QUEUE_DEPTH,
+       SATA_FSL_CMD_HDR_SIZE   = 16,   /* 4 DWORDS */
+       SATA_FSL_CMD_SLOT_SIZE  = (SATA_FSL_MAX_CMDS * SATA_FSL_CMD_HDR_SIZE),
+
+       /*
+        * SATA-FSL host controller supports a max. of (15+1) direct PRDEs, and
+        * chained indirect PRDEs upto a max count of 63.
+        * We are allocating an array of 63 PRDEs contigiously, but PRDE#15 will
+        * be setup as an indirect descriptor, pointing to it's next
+        * (contigious) PRDE. Though chained indirect PRDE arrays are
+        * supported,it will be more efficient to use a direct PRDT and
+        * a single chain/link to indirect PRDE array/PRDT.
+        */
+
+       SATA_FSL_CMD_DESC_CFIS_SZ       = 32,
+       SATA_FSL_CMD_DESC_SFIS_SZ       = 32,
+       SATA_FSL_CMD_DESC_ACMD_SZ       = 16,
+       SATA_FSL_CMD_DESC_RSRVD         = 16,
+
+       SATA_FSL_CMD_DESC_SIZE  = (SATA_FSL_CMD_DESC_CFIS_SZ +
+                                SATA_FSL_CMD_DESC_SFIS_SZ +
+                                SATA_FSL_CMD_DESC_ACMD_SZ +
+                                SATA_FSL_CMD_DESC_RSRVD +
+                                SATA_FSL_MAX_PRD * 16),
+
+       SATA_FSL_CMD_DESC_OFFSET_TO_PRDT        =
+                               (SATA_FSL_CMD_DESC_CFIS_SZ +
+                                SATA_FSL_CMD_DESC_SFIS_SZ +
+                                SATA_FSL_CMD_DESC_ACMD_SZ +
+                                SATA_FSL_CMD_DESC_RSRVD),
+
+       SATA_FSL_CMD_DESC_AR_SZ = (SATA_FSL_CMD_DESC_SIZE * SATA_FSL_MAX_CMDS),
+       SATA_FSL_PORT_PRIV_DMA_SZ = (SATA_FSL_CMD_SLOT_SIZE +
+                                       SATA_FSL_CMD_DESC_AR_SZ),
+
+       /*
+        * MPC8315 has two SATA controllers, SATA1 & SATA2
+        * (one port per controller)
+        * MPC837x has 2/4 controllers, one port per controller
+        */
+
+       SATA_FSL_MAX_PORTS      = 1,
+
+       SATA_FSL_IRQ_FLAG       = IRQF_SHARED,
+};
+
+/*
+* Host Controller command register set - per port
+*/
+enum {
+       CQ = 0,
+       CA = 8,
+       CC = 0x10,
+       CE = 0x18,
+       DE = 0x20,
+       CHBA = 0x24,
+       HSTATUS = 0x28,
+       HCONTROL = 0x2C,
+       CQPMP = 0x30,
+       SIGNATURE = 0x34,
+       ICC = 0x38,
+
+       /*
+        * Host Status Register (HStatus) bitdefs
+        */
+       ONLINE = (1 << 31),
+       GOING_OFFLINE = (1 << 30),
+       BIST_ERR = (1 << 29),
+
+       FATAL_ERR_HC_MASTER_ERR = (1 << 18),
+       FATAL_ERR_PARITY_ERR_TX = (1 << 17),
+       FATAL_ERR_PARITY_ERR_RX = (1 << 16),
+       FATAL_ERR_DATA_UNDERRUN = (1 << 13),
+       FATAL_ERR_DATA_OVERRUN = (1 << 12),
+       FATAL_ERR_CRC_ERR_TX = (1 << 11),
+       FATAL_ERR_CRC_ERR_RX = (1 << 10),
+       FATAL_ERR_FIFO_OVRFL_TX = (1 << 9),
+       FATAL_ERR_FIFO_OVRFL_RX = (1 << 8),
+
+       FATAL_ERROR_DECODE = FATAL_ERR_HC_MASTER_ERR |
+           FATAL_ERR_PARITY_ERR_TX |
+           FATAL_ERR_PARITY_ERR_RX |
+           FATAL_ERR_DATA_UNDERRUN |
+           FATAL_ERR_DATA_OVERRUN |
+           FATAL_ERR_CRC_ERR_TX |
+           FATAL_ERR_CRC_ERR_RX |
+           FATAL_ERR_FIFO_OVRFL_TX | FATAL_ERR_FIFO_OVRFL_RX,
+
+       INT_ON_FATAL_ERR = (1 << 5),
+       INT_ON_PHYRDY_CHG = (1 << 4),
+
+       INT_ON_SIGNATURE_UPDATE = (1 << 3),
+       INT_ON_SNOTIFY_UPDATE = (1 << 2),
+       INT_ON_SINGL_DEVICE_ERR = (1 << 1),
+       INT_ON_CMD_COMPLETE = 1,
+
+       INT_ON_ERROR = INT_ON_FATAL_ERR |
+           INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR,
+
+       /*
+        * Host Control Register (HControl) bitdefs
+        */
+       HCONTROL_ONLINE_PHY_RST = (1 << 31),
+       HCONTROL_FORCE_OFFLINE = (1 << 30),
+       HCONTROL_PARITY_PROT_MOD = (1 << 14),
+       HCONTROL_DPATH_PARITY = (1 << 12),
+       HCONTROL_SNOOP_ENABLE = (1 << 10),
+       HCONTROL_PMP_ATTACHED = (1 << 9),
+       HCONTROL_COPYOUT_STATFIS = (1 << 8),
+       IE_ON_FATAL_ERR = (1 << 5),
+       IE_ON_PHYRDY_CHG = (1 << 4),
+       IE_ON_SIGNATURE_UPDATE = (1 << 3),
+       IE_ON_SNOTIFY_UPDATE = (1 << 2),
+       IE_ON_SINGL_DEVICE_ERR = (1 << 1),
+       IE_ON_CMD_COMPLETE = 1,
+
+       DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG |
+           IE_ON_SIGNATURE_UPDATE |
+           IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE,
+
+       EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31),
+       DATA_SNOOP_ENABLE = (1 << 22),
+};
+
+/*
+ * SATA Superset Registers
+ */
+enum {
+       SSTATUS = 0,
+       SERROR = 4,
+       SCONTROL = 8,
+       SNOTIFY = 0xC,
+};
+
+/*
+ * Control Status Register Set
+ */
+enum {
+       TRANSCFG = 0,
+       TRANSSTATUS = 4,
+       LINKCFG = 8,
+       LINKCFG1 = 0xC,
+       LINKCFG2 = 0x10,
+       LINKSTATUS = 0x14,
+       LINKSTATUS1 = 0x18,
+       PHYCTRLCFG = 0x1C,
+       COMMANDSTAT = 0x20,
+};
+
+/* PHY (link-layer) configuration control */
+enum {
+       PHY_BIST_ENABLE = 0x01,
+};
+
+/*
+ * Command Header Table entry, i.e, command slot
+ * 4 Dwords per command slot, command header size ==  64 Dwords.
+ */
+struct cmdhdr_tbl_entry {
+       u32 cda;
+       u32 prde_fis_len;
+       u32 ttl;
+       u32 desc_info;
+};
+
+/*
+ * Description information bitdefs
+ */
+enum {
+       VENDOR_SPECIFIC_BIST = (1 << 10),
+       CMD_DESC_SNOOP_ENABLE = (1 << 9),
+       FPDMA_QUEUED_CMD = (1 << 8),
+       SRST_CMD = (1 << 7),
+       BIST = (1 << 6),
+       ATAPI_CMD = (1 << 5),
+};
+
+/*
+ * Command Descriptor
+ */
+struct command_desc {
+       u8 cfis[8 * 4];
+       u8 sfis[8 * 4];
+       u8 acmd[4 * 4];
+       u8 fill[4 * 4];
+       u32 prdt[SATA_FSL_MAX_PRD_DIRECT * 4];
+       u32 prdt_indirect[(SATA_FSL_MAX_PRD - SATA_FSL_MAX_PRD_DIRECT) * 4];
+};
+
+/*
+ * Physical region table descriptor(PRD)
+ */
+
+struct prde {
+       u32 dba;
+       u8 fill[2 * 4];
+       u32 ddc_and_ext;
+};
+
+/*
+ * ata_port private data
+ * This is our per-port instance data.
+ */
+struct sata_fsl_port_priv {
+       struct cmdhdr_tbl_entry *cmdslot;
+       dma_addr_t cmdslot_paddr;
+       struct command_desc *cmdentry;
+       dma_addr_t cmdentry_paddr;
+
+       /*
+        * SATA FSL controller has a Status FIS which should contain the
+        * received D2H FIS & taskfile registers. This SFIS is present in
+        * the command descriptor, and to have a ready reference to it,
+        * we are caching it here, quite similar to what is done in H/W on
+        * AHCI compliant devices by copying taskfile fields to a 32-bit
+        * register.
+        */
+
+       struct ata_taskfile tf;
+};
+
+/*
+ * ata_port->host_set private data
+ */
+struct sata_fsl_host_priv {
+       void __iomem *hcr_base;
+       void __iomem *ssr_base;
+       void __iomem *csr_base;
+};
+
+static inline unsigned int sata_fsl_tag(unsigned int tag,
+                                       void __iomem * hcr_base)
+{
+       /* We let libATA core do actual (queue) tag allocation */
+
+       /* all non NCQ/queued commands should have tag#0 */
+       if (ata_tag_internal(tag)) {
+               DPRINTK("mapping internal cmds to tag#0\n");
+               return 0;
+       }
+
+       if (unlikely(tag >= SATA_FSL_QUEUE_DEPTH)) {
+               DPRINTK("tag %d invalid : out of range\n", tag);
+               return 0;
+       }
+
+       if (unlikely((ioread32(hcr_base + CQ)) & (1 << tag))) {
+               DPRINTK("tag %d invalid : in use!!\n", tag);
+               return 0;
+       }
+
+       return tag;
+}
+
+static void sata_fsl_setup_cmd_hdr_entry(struct sata_fsl_port_priv *pp,
+                                        unsigned int tag, u32 desc_info,
+                                        u32 data_xfer_len, u8 num_prde,
+                                        u8 fis_len)
+{
+       dma_addr_t cmd_descriptor_address;
+
+       cmd_descriptor_address = pp->cmdentry_paddr +
+           tag * SATA_FSL_CMD_DESC_SIZE;
+
+       /* NOTE: both data_xfer_len & fis_len are Dword counts */
+
+       pp->cmdslot[tag].cda = cpu_to_le32(cmd_descriptor_address);
+       pp->cmdslot[tag].prde_fis_len =
+           cpu_to_le32((num_prde << 16) | (fis_len << 2));
+       pp->cmdslot[tag].ttl = cpu_to_le32(data_xfer_len & ~0x03);
+       pp->cmdslot[tag].desc_info = cpu_to_le32((desc_info | (tag & 0x1F)));
+
+       VPRINTK("cda=0x%x, prde_fis_len=0x%x, ttl=0x%x, di=0x%x\n",
+               pp->cmdslot[tag].cda,
+               pp->cmdslot[tag].prde_fis_len,
+               pp->cmdslot[tag].ttl, pp->cmdslot[tag].desc_info);
+
+}
+
+static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
+                                    u32 * ttl, dma_addr_t cmd_desc_paddr)
+{
+       struct scatterlist *sg;
+       unsigned int num_prde = 0;
+       u32 ttl_dwords = 0;
+
+       /*
+        * NOTE : direct & indirect prdt's are contigiously allocated
+        */
+       struct prde *prd = (struct prde *)&((struct command_desc *)
+                                           cmd_desc)->prdt;
+
+       struct prde *prd_ptr_to_indirect_ext = NULL;
+       unsigned indirect_ext_segment_sz = 0;
+       dma_addr_t indirect_ext_segment_paddr;
+
+       VPRINTK("SATA FSL : cd = 0x%x, prd = 0x%x\n", cmd_desc, prd);
+
+       indirect_ext_segment_paddr = cmd_desc_paddr +
+           SATA_FSL_CMD_DESC_OFFSET_TO_PRDT + SATA_FSL_MAX_PRD_DIRECT * 16;
+
+       ata_for_each_sg(sg, qc) {
+               dma_addr_t sg_addr = sg_dma_address(sg);
+               u32 sg_len = sg_dma_len(sg);
+
+               VPRINTK("SATA FSL : fill_sg, sg_addr = 0x%x, sg_len = %d\n",
+                       sg_addr, sg_len);
+
+               /* warn if each s/g element is not dword aligned */
+               if (sg_addr & 0x03)
+                       ata_port_printk(qc->ap, KERN_ERR,
+                                       "s/g addr unaligned : 0x%x\n", sg_addr);
+               if (sg_len & 0x03)
+                       ata_port_printk(qc->ap, KERN_ERR,
+                                       "s/g len unaligned : 0x%x\n", sg_len);
+
+               if ((num_prde == (SATA_FSL_MAX_PRD_DIRECT - 1)) &&
+                   !ata_sg_is_last(sg, qc)) {
+                       VPRINTK("setting indirect prde\n");
+                       prd_ptr_to_indirect_ext = prd;
+                       prd->dba = cpu_to_le32(indirect_ext_segment_paddr);
+                       indirect_ext_segment_sz = 0;
+                       ++prd;
+                       ++num_prde;
+               }
+
+               ttl_dwords += sg_len;
+               prd->dba = cpu_to_le32(sg_addr);
+               prd->ddc_and_ext =
+                   cpu_to_le32(DATA_SNOOP_ENABLE | (sg_len & ~0x03));
+
+               VPRINTK("sg_fill, ttl=%d, dba=0x%x, ddc=0x%x\n",
+                       ttl_dwords, prd->dba, prd->ddc_and_ext);
+
+               ++num_prde;
+               ++prd;
+               if (prd_ptr_to_indirect_ext)
+                       indirect_ext_segment_sz += sg_len;
+       }
+
+       if (prd_ptr_to_indirect_ext) {
+               /* set indirect extension flag along with indirect ext. size */
+               prd_ptr_to_indirect_ext->ddc_and_ext =
+                   cpu_to_le32((EXT_INDIRECT_SEG_PRD_FLAG |
+                                DATA_SNOOP_ENABLE |
+                                (indirect_ext_segment_sz & ~0x03)));
+       }
+
+       *ttl = ttl_dwords;
+       return num_prde;
+}
+
+static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       struct sata_fsl_port_priv *pp = ap->private_data;
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       unsigned int tag = sata_fsl_tag(qc->tag, hcr_base);
+       struct command_desc *cd;
+       u32 desc_info = CMD_DESC_SNOOP_ENABLE;
+       u32 num_prde = 0;
+       u32 ttl_dwords = 0;
+       dma_addr_t cd_paddr;
+
+       cd = (struct command_desc *)pp->cmdentry + tag;
+       cd_paddr = pp->cmdentry_paddr + tag * SATA_FSL_CMD_DESC_SIZE;
+
+       ata_tf_to_fis(&qc->tf, 0, 1, (u8 *) & cd->cfis);
+
+       VPRINTK("Dumping cfis : 0x%x, 0x%x, 0x%x\n",
+               cd->cfis[0], cd->cfis[1], cd->cfis[2]);
+
+       if (qc->tf.protocol == ATA_PROT_NCQ) {
+               VPRINTK("FPDMA xfer,Sctor cnt[0:7],[8:15] = %d,%d\n",
+                       cd->cfis[3], cd->cfis[11]);
+       }
+
+       /* setup "ACMD - atapi command" in cmd. desc. if this is ATAPI cmd */
+       if (is_atapi_taskfile(&qc->tf)) {
+               desc_info |= ATAPI_CMD;
+               memset((void *)&cd->acmd, 0, 32);
+               memcpy((void *)&cd->acmd, qc->cdb, qc->dev->cdb_len);
+       }
+
+       if (qc->flags & ATA_QCFLAG_DMAMAP)
+               num_prde = sata_fsl_fill_sg(qc, (void *)cd,
+                                           &ttl_dwords, cd_paddr);
+
+       if (qc->tf.protocol == ATA_PROT_NCQ)
+               desc_info |= FPDMA_QUEUED_CMD;
+
+       sata_fsl_setup_cmd_hdr_entry(pp, tag, desc_info, ttl_dwords,
+                                    num_prde, 5);
+
+       VPRINTK("SATA FSL : xx_qc_prep, di = 0x%x, ttl = %d, num_prde = %d\n",
+               desc_info, ttl_dwords, num_prde);
+}
+
+static unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *qc)
+{
+       struct ata_port *ap = qc->ap;
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       unsigned int tag = sata_fsl_tag(qc->tag, hcr_base);
+
+       VPRINTK("xx_qc_issue called,CQ=0x%x,CA=0x%x,CE=0x%x,CC=0x%x\n",
+               ioread32(CQ + hcr_base),
+               ioread32(CA + hcr_base),
+               ioread32(CE + hcr_base), ioread32(CC + hcr_base));
+
+       /* Simply queue command to the controller/device */
+       iowrite32(1 << tag, CQ + hcr_base);
+
+       VPRINTK("xx_qc_issue called, tag=%d, CQ=0x%x, CA=0x%x\n",
+               tag, ioread32(CQ + hcr_base), ioread32(CA + hcr_base));
+
+       VPRINTK("CE=0x%x, DE=0x%x, CC=0x%x, CmdStat = 0x%x\n",
+               ioread32(CE + hcr_base),
+               ioread32(DE + hcr_base),
+               ioread32(CC + hcr_base), ioread32(COMMANDSTAT + csr_base));
+
+       return 0;
+}
+
+static int sata_fsl_scr_write(struct ata_port *ap, unsigned int sc_reg_in,
+                              u32 val)
+{
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *ssr_base = host_priv->ssr_base;
+       unsigned int sc_reg;
+
+       switch (sc_reg_in) {
+       case SCR_STATUS:
+               sc_reg = 0;
+               break;
+       case SCR_ERROR:
+               sc_reg = 1;
+               break;
+       case SCR_CONTROL:
+               sc_reg = 2;
+               break;
+       case SCR_ACTIVE:
+               sc_reg = 3;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       VPRINTK("xx_scr_write, reg_in = %d\n", sc_reg);
+
+       iowrite32(val, (void __iomem *)ssr_base + (sc_reg * 4));
+       return 0;
+}
+
+static int sata_fsl_scr_read(struct ata_port *ap, unsigned int sc_reg_in,
+                       u32 *val)
+{
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *ssr_base = host_priv->ssr_base;
+       unsigned int sc_reg;
+
+       switch (sc_reg_in) {
+       case SCR_STATUS:
+               sc_reg = 0;
+               break;
+       case SCR_ERROR:
+               sc_reg = 1;
+               break;
+       case SCR_CONTROL:
+               sc_reg = 2;
+               break;
+       case SCR_ACTIVE:
+               sc_reg = 3;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       VPRINTK("xx_scr_read, reg_in = %d\n", sc_reg);
+
+       *val = ioread32((void __iomem *)ssr_base + (sc_reg * 4));
+       return 0;
+}
+
+static void sata_fsl_freeze(struct ata_port *ap)
+{
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 temp;
+
+       VPRINTK("xx_freeze, CQ=0x%x, CA=0x%x, CE=0x%x, DE=0x%x\n",
+               ioread32(CQ + hcr_base),
+               ioread32(CA + hcr_base),
+               ioread32(CE + hcr_base), ioread32(DE + hcr_base));
+       VPRINTK("CmdStat = 0x%x\n", ioread32(csr_base + COMMANDSTAT));
+
+       /* disable interrupts on the controller/port */
+       temp = ioread32(hcr_base + HCONTROL);
+       iowrite32((temp & ~0x3F), hcr_base + HCONTROL);
+
+       VPRINTK("in xx_freeze : HControl = 0x%x, HStatus = 0x%x\n",
+               ioread32(hcr_base + HCONTROL), ioread32(hcr_base + HSTATUS));
+}
+
+static void sata_fsl_thaw(struct ata_port *ap)
+{
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 temp;
+
+       /* ack. any pending IRQs for this controller/port */
+       temp = ioread32(hcr_base + HSTATUS);
+
+       VPRINTK("xx_thaw, pending IRQs = 0x%x\n", (temp & 0x3F));
+
+       if (temp & 0x3F)
+               iowrite32((temp & 0x3F), hcr_base + HSTATUS);
+
+       /* enable interrupts on the controller/port */
+       temp = ioread32(hcr_base + HCONTROL);
+       iowrite32((temp | DEFAULT_PORT_IRQ_ENABLE_MASK), hcr_base + HCONTROL);
+
+       VPRINTK("xx_thaw : HControl = 0x%x, HStatus = 0x%x\n",
+               ioread32(hcr_base + HCONTROL), ioread32(hcr_base + HSTATUS));
+}
+
+/*
+ * NOTE : 1st D2H FIS from device does not update sfis in command descriptor.
+ */
+static inline void sata_fsl_cache_taskfile_from_d2h_fis(struct ata_queued_cmd
+                                                       *qc,
+                                                       struct ata_port *ap)
+{
+       struct sata_fsl_port_priv *pp = ap->private_data;
+       u8 fis[6 * 4];
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       unsigned int tag = sata_fsl_tag(qc->tag, hcr_base);
+       struct command_desc *cd;
+
+       cd = pp->cmdentry + tag;
+
+       memcpy(fis, &cd->sfis, 6 * 4);  /* should we use memcpy_from_io() */
+       ata_tf_from_fis(fis, &pp->tf);
+}
+
+static u8 sata_fsl_check_status(struct ata_port *ap)
+{
+       struct sata_fsl_port_priv *pp = ap->private_data;
+
+       return pp->tf.command;
+}
+
+static void sata_fsl_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
+{
+       struct sata_fsl_port_priv *pp = ap->private_data;
+
+       *tf = pp->tf;
+}
+
+static int sata_fsl_port_start(struct ata_port *ap)
+{
+       struct device *dev = ap->host->dev;
+       struct sata_fsl_port_priv *pp;
+       int retval;
+       void *mem;
+       dma_addr_t mem_dma;
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 temp;
+
+       pp = kzalloc(sizeof(*pp), GFP_KERNEL);
+       if (!pp)
+               return -ENOMEM;
+
+       /*
+        * allocate per command dma alignment pad buffer, which is used
+        * internally by libATA to ensure that all transfers ending on
+        * unaligned boundaries are padded, to align on Dword boundaries
+        */
+       retval = ata_pad_alloc(ap, dev);
+       if (retval) {
+               kfree(pp);
+               return retval;
+       }
+
+       mem = dma_alloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
+                                GFP_KERNEL);
+       if (!mem) {
+               ata_pad_free(ap, dev);
+               kfree(pp);
+               return -ENOMEM;
+       }
+       memset(mem, 0, SATA_FSL_PORT_PRIV_DMA_SZ);
+
+       pp->cmdslot = mem;
+       pp->cmdslot_paddr = mem_dma;
+
+       mem += SATA_FSL_CMD_SLOT_SIZE;
+       mem_dma += SATA_FSL_CMD_SLOT_SIZE;
+
+       pp->cmdentry = mem;
+       pp->cmdentry_paddr = mem_dma;
+
+       ap->private_data = pp;
+
+       VPRINTK("CHBA = 0x%x, cmdentry_phys = 0x%x\n",
+               pp->cmdslot_paddr, pp->cmdentry_paddr);
+
+       /* Now, update the CHBA register in host controller cmd register set */
+       iowrite32(pp->cmdslot_paddr & 0xffffffff, hcr_base + CHBA);
+
+       /*
+        * Now, we can bring the controller on-line & also initiate
+        * the COMINIT sequence, we simply return here and the boot-probing
+        * & device discovery process is re-initiated by libATA using a
+        * Softreset EH (dummy) session. Hence, boot probing and device
+        * discovey will be part of sata_fsl_softreset() callback.
+        */
+
+       temp = ioread32(hcr_base + HCONTROL);
+       iowrite32((temp | HCONTROL_ONLINE_PHY_RST), hcr_base + HCONTROL);
+
+       VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+       VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+       VPRINTK("CHBA  = 0x%x\n", ioread32(hcr_base + CHBA));
+
+       /*
+        * Workaround for 8315DS board 3gbps link-up issue,
+        * currently limit SATA port to GEN1 speed
+        */
+       sata_fsl_scr_read(ap, SCR_CONTROL, &temp);
+       temp &= ~(0xF << 4);
+       temp |= (0x1 << 4);
+       sata_fsl_scr_write(ap, SCR_CONTROL, temp);
+
+       sata_fsl_scr_read(ap, SCR_CONTROL, &temp);
+       dev_printk(KERN_WARNING, dev, "scr_control, speed limited to %x\n",
+                       temp);
+
+       return 0;
+}
+
+static void sata_fsl_port_stop(struct ata_port *ap)
+{
+       struct device *dev = ap->host->dev;
+       struct sata_fsl_port_priv *pp = ap->private_data;
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 temp;
+
+       /*
+        * Force host controller to go off-line, aborting current operations
+        */
+       temp = ioread32(hcr_base + HCONTROL);
+       temp &= ~HCONTROL_ONLINE_PHY_RST;
+       temp |= HCONTROL_FORCE_OFFLINE;
+       iowrite32(temp, hcr_base + HCONTROL);
+
+       /* Poll for controller to go offline - should happen immediately */
+       ata_wait_register(hcr_base + HSTATUS, ONLINE, ONLINE, 1, 1);
+
+       ap->private_data = NULL;
+       dma_free_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ,
+                         pp->cmdslot, pp->cmdslot_paddr);
+
+       ata_pad_free(ap, dev);
+       kfree(pp);
+}
+
+static unsigned int sata_fsl_dev_classify(struct ata_port *ap)
+{
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       struct ata_taskfile tf;
+       u32 temp;
+
+       temp = ioread32(hcr_base + SIGNATURE);
+
+       VPRINTK("raw sig = 0x%x\n", temp);
+       VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+       VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+
+       tf.lbah = (temp >> 24) & 0xff;
+       tf.lbam = (temp >> 16) & 0xff;
+       tf.lbal = (temp >> 8) & 0xff;
+       tf.nsect = temp & 0xff;
+
+       return ata_dev_classify(&tf);
+}
+
+static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
+                             unsigned long deadline)
+{
+       struct sata_fsl_port_priv *pp = ap->private_data;
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 temp;
+       struct ata_taskfile tf;
+       u8 *cfis;
+       u32 Serror;
+       int i = 0;
+       struct ata_queued_cmd qc;
+       u8 *buf;
+       dma_addr_t dma_address;
+       struct scatterlist *sg;
+       unsigned long start_jiffies;
+
+       DPRINTK("in xx_softreset\n");
+
+try_offline_again:
+       /*
+        * Force host controller to go off-line, aborting current operations
+        */
+       temp = ioread32(hcr_base + HCONTROL);
+       temp &= ~HCONTROL_ONLINE_PHY_RST;
+       iowrite32(temp, hcr_base + HCONTROL);
+
+       /* Poll for controller to go offline */
+       temp = ata_wait_register(hcr_base + HSTATUS, ONLINE, ONLINE, 1, 500);
+
+       if (temp & ONLINE) {
+               ata_port_printk(ap, KERN_ERR,
+                               "Softreset failed, not off-lined %d\n", i);
+
+               /*
+                * Try to offline controller atleast twice
+                */
+               i++;
+               if (i == 2)
+                       goto err;
+               else
+                       goto try_offline_again;
+       }
+
+       DPRINTK("softreset, controller off-lined\n");
+       VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+       VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+
+       /*
+        * PHY reset should remain asserted for atleast 1ms
+        */
+       msleep(1);
+
+       /*
+        * Now, bring the host controller online again, this can take time
+        * as PHY reset and communication establishment, 1st D2H FIS and
+        * device signature update is done, on safe side assume 500ms
+        * NOTE : Host online status may be indicated immediately!!
+        */
+
+       temp = ioread32(hcr_base + HCONTROL);
+       temp |= (HCONTROL_ONLINE_PHY_RST | HCONTROL_SNOOP_ENABLE);
+       iowrite32(temp, hcr_base + HCONTROL);
+
+       temp = ata_wait_register(hcr_base + HSTATUS, ONLINE, 0, 1, 500);
+
+       if (!(temp & ONLINE)) {
+               ata_port_printk(ap, KERN_ERR,
+                               "Softreset failed, not on-lined\n");
+               goto err;
+       }
+
+       DPRINTK("softreset, controller off-lined & on-lined\n");
+       VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+       VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+
+       /*
+        * First, wait for the PHYRDY change to occur before waiting for
+        * the signature, and also verify if SStatus indicates device
+        * presence
+        */
+
+       temp = ata_wait_register(hcr_base + HSTATUS, 0xFF, 0, 1, 500);
+       if ((!(temp & 0x10)) || ata_port_offline(ap)) {
+               ata_port_printk(ap, KERN_WARNING,
+                               "No Device OR PHYRDY change,Hstatus = 0x%x\n",
+                               ioread32(hcr_base + HSTATUS));
+               goto err;
+       }
+
+       /*
+        * Wait for the first D2H from device,i.e,signature update notification
+        */
+       start_jiffies = jiffies;
+       temp = ata_wait_register(hcr_base + HSTATUS, 0xFF, 0x10,
+                       500, jiffies_to_msecs(deadline - start_jiffies));
+
+       if ((temp & 0xFF) != 0x18) {
+               ata_port_printk(ap, KERN_WARNING, "No Signature Update\n");
+               goto err;
+       } else {
+               ata_port_printk(ap, KERN_INFO,
+                               "Signature Update detected @ %d msecs\n",
+                               jiffies_to_msecs(jiffies - start_jiffies));
+       }
+
+       /*
+        * Send a device reset (SRST) explicitly on command slot #0
+        * Check : will the command queue (reg) be cleared during offlining ??
+        * Also we will be online only if Phy commn. has been established
+        * and device presence has been detected, therefore if we have
+        * reached here, we can send a command to the target device
+        */
+
+       if (ap->sactive)
+               goto skip_srst_do_ncq_error_handling;
+
+       DPRINTK("Sending SRST/device reset\n");
+
+       ata_tf_init(ap->device, &tf);
+       cfis = (u8 *) & pp->cmdentry->cfis;
+
+       /* device reset/SRST is a control register update FIS, uses tag0 */
+       sata_fsl_setup_cmd_hdr_entry(pp, 0,
+                                    SRST_CMD | CMD_DESC_SNOOP_ENABLE, 0, 0, 5);
+
+       tf.ctl |= ATA_SRST;     /* setup SRST bit in taskfile control reg */
+       ata_tf_to_fis(&tf, 0, 0, cfis);
+
+       DPRINTK("Dumping cfis : 0x%x, 0x%x, 0x%x, 0x%x\n",
+               cfis[0], cfis[1], cfis[2], cfis[3]);
+
+       /*
+        * Queue SRST command to the controller/device, ensure that no
+        * other commands are active on the controller/device
+        */
+
+       DPRINTK("@Softreset, CQ = 0x%x, CA = 0x%x, CC = 0x%x\n",
+               ioread32(CQ + hcr_base),
+               ioread32(CA + hcr_base), ioread32(CC + hcr_base));
+
+       iowrite32(0xFFFF, CC + hcr_base);
+       iowrite32(1, CQ + hcr_base);
+
+       temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000);
+       if (temp & 0x1) {
+               ata_port_printk(ap, KERN_WARNING, "ATA_SRST issue failed\n");
+
+               DPRINTK("Softreset@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
+                       ioread32(CQ + hcr_base),
+                       ioread32(CA + hcr_base), ioread32(CC + hcr_base));
+
+               sata_fsl_scr_read(ap, SCR_ERROR, &Serror);
+
+               DPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+               DPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+               DPRINTK("Serror = 0x%x\n", Serror);
+               goto err;
+       }
+
+       msleep(1);
+
+       /*
+        * SATA device enters reset state after receving a Control register
+        * FIS with SRST bit asserted and it awaits another H2D Control reg.
+        * FIS with SRST bit cleared, then the device does internal diags &
+        * initialization, followed by indicating it's initialization status
+        * using ATA signature D2H register FIS to the host controller.
+        */
+
+       sata_fsl_setup_cmd_hdr_entry(pp, 0, CMD_DESC_SNOOP_ENABLE, 0, 0, 5);
+
+       tf.ctl &= ~ATA_SRST;    /* 2nd H2D Ctl. register FIS */
+       ata_tf_to_fis(&tf, 0, 0, cfis);
+
+       iowrite32(1, CQ + hcr_base);
+       msleep(150);            /* ?? */
+
+       /*
+        * The above command would have signalled an interrupt on command
+        * complete, which needs special handling, by clearing the Nth
+        * command bit of the CCreg
+        */
+       iowrite32(0x01, CC + hcr_base); /* We know it will be cmd#0 always */
+       goto check_device_signature;
+
+skip_srst_do_ncq_error_handling:
+
+       VPRINTK("Sending read log ext(10h) command\n");
+
+       memset(&qc, 0, sizeof(struct ata_queued_cmd));
+       ata_tf_init(ap->device, &tf);
+
+       tf.command = ATA_CMD_READ_LOG_EXT;
+       tf.lbal = ATA_LOG_SATA_NCQ;
+       tf.nsect = 1;
+       tf.hob_nsect = 0;
+       tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_LBA48 | ATA_TFLAG_DEVICE;
+       tf.protocol = ATA_PROT_PIO;
+
+       qc.tag = ATA_TAG_INTERNAL;
+       qc.scsicmd = NULL;
+       qc.ap = ap;
+       qc.dev = ap->device;
+
+       qc.tf = tf;
+       qc.flags |= ATA_QCFLAG_RESULT_TF;
+       qc.dma_dir = DMA_FROM_DEVICE;
+
+       buf = ap->sector_buf;
+       ata_sg_init_one(&qc, buf, 1 * ATA_SECT_SIZE);
+
+       /*
+        * Need to DMA-map the memory buffer associated with the command
+        */
+
+       sg = qc.__sg;
+       dma_address = dma_map_single(ap->dev, qc.buf_virt,
+                                    sg->length, DMA_FROM_DEVICE);
+
+       sg_dma_address(sg) = dma_address;
+       sg_dma_len(sg) = sg->length;
+
+       VPRINTK("EH, addr = 0x%x, len = 0x%x\n", dma_address, sg->length);
+
+       sata_fsl_qc_prep(&qc);
+       sata_fsl_qc_issue(&qc);
+
+       temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000);
+       if (temp & 0x1) {
+               VPRINTK("READ_LOG_EXT_10H issue failed\n");
+
+               VPRINTK("READ_LOG@5000,CQ=0x%x,CA=0x%x,CC=0x%x\n",
+                       ioread32(CQ + hcr_base),
+                       ioread32(CA + hcr_base), ioread32(CC + hcr_base));
+
+               sata_fsl_scr_read(ap, SCR_ERROR, &Serror);
+
+               VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+               VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+               VPRINTK("Serror = 0x%x\n", Serror);
+               goto err;
+       }
+
+       iowrite32(0x01, CC + hcr_base); /* We know it will be cmd#0 always */
+
+      check_device_signature:
+
+       DPRINTK("SATA FSL : Now checking device signature\n");
+
+       *class = ATA_DEV_NONE;
+
+       /* Verify if SStatus indicates device presence */
+       if (ata_port_online(ap)) {
+               /*
+                * if we are here, device presence has been detected,
+                * 1st D2H FIS would have been received, but sfis in
+                * command desc. is not updated, but signature register
+                * would have been updated
+                */
+
+               *class = sata_fsl_dev_classify(ap);
+
+               DPRINTK("class = %d\n", *class);
+               VPRINTK("ccreg = 0x%x\n", ioread32(hcr_base + CC));
+               VPRINTK("cereg = 0x%x\n", ioread32(hcr_base + CE));
+       }
+
+       return 0;
+
+err:
+       return -EIO;
+}
+
+static int sata_fsl_hardreset(struct ata_port *ap, unsigned int *class,
+                             unsigned long deadline)
+{
+       int retval;
+
+       retval = sata_std_hardreset(ap, class, deadline);
+
+       DPRINTK("SATA FSL : in xx_hardreset, retval = 0x%d\n", retval);
+
+       return retval;
+}
+
+static void sata_fsl_error_handler(struct ata_port *ap)
+{
+
+       DPRINTK("in xx_error_handler\n");
+
+       /* perform recovery */
+       ata_do_eh(ap, ata_std_prereset, sata_fsl_softreset, sata_fsl_hardreset,
+                 ata_std_postreset);
+}
+
+static void sata_fsl_post_internal_cmd(struct ata_queued_cmd *qc)
+{
+       if (qc->flags & ATA_QCFLAG_FAILED)
+               qc->err_mask |= AC_ERR_OTHER;
+
+       if (qc->err_mask) {
+               /* make DMA engine forget about the failed command */
+
+       }
+}
+
+static void sata_fsl_irq_clear(struct ata_port *ap)
+{
+       /* unused */
+}
+
+static void sata_fsl_error_intr(struct ata_port *ap)
+{
+       struct ata_eh_info *ehi = &ap->eh_info;
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 hstatus, dereg, cereg = 0, SError = 0;
+       unsigned int err_mask = 0, action = 0;
+       struct ata_queued_cmd *qc;
+       int freeze = 0;
+
+       hstatus = ioread32(hcr_base + HSTATUS);
+       cereg = ioread32(hcr_base + CE);
+
+       ata_ehi_clear_desc(ehi);
+
+       /*
+        * Handle & Clear SError
+        */
+
+       sata_fsl_scr_read(ap, SCR_ERROR, &SError);
+       if (unlikely(SError & 0xFFFF0000)) {
+               sata_fsl_scr_write(ap, SCR_ERROR, SError);
+               err_mask |= AC_ERR_ATA_BUS;
+       }
+
+       DPRINTK("error_intr,hStat=0x%x,CE=0x%x,DE =0x%x,SErr=0x%x\n",
+               hstatus, cereg, ioread32(hcr_base + DE), SError);
+
+       /* handle single device errors */
+       if (cereg) {
+               /*
+                * clear the command error, also clears queue to the device
+                * in error, and we can (re)issue commands to this device.
+                * When a device is in error all commands queued into the
+                * host controller and at the device are considered aborted
+                * and the queue for that device is stopped. Now, after
+                * clearing the device error, we can issue commands to the
+                * device to interrogate it to find the source of the error.
+                */
+               dereg = ioread32(hcr_base + DE);
+               iowrite32(dereg, hcr_base + DE);
+               iowrite32(cereg, hcr_base + CE);
+
+               DPRINTK("single device error, CE=0x%x, DE=0x%x\n",
+                       ioread32(hcr_base + CE), ioread32(hcr_base + DE));
+               /*
+                * We should consider this as non fatal error, and TF must
+                * be updated as done below.
+                */
+
+               err_mask |= AC_ERR_DEV;
+       }
+
+       /* handle fatal errors */
+       if (hstatus & FATAL_ERROR_DECODE) {
+               err_mask |= AC_ERR_ATA_BUS;
+               action |= ATA_EH_SOFTRESET;
+               /* how will fatal error interrupts be completed ?? */
+               freeze = 1;
+       }
+
+       /* Handle PHYRDY change notification */
+       if (hstatus & INT_ON_PHYRDY_CHG) {
+               DPRINTK("SATA FSL: PHYRDY change indication\n");
+
+               /* Setup a soft-reset EH action */
+               ata_ehi_hotplugged(ehi);
+               freeze = 1;
+       }
+
+       /* record error info */
+       qc = ata_qc_from_tag(ap, ap->active_tag);
+
+       if (qc) {
+               sata_fsl_cache_taskfile_from_d2h_fis(qc, qc->ap);
+               qc->err_mask |= err_mask;
+       } else
+               ehi->err_mask |= err_mask;
+
+       ehi->action |= action;
+       ehi->serror |= SError;
+
+       /* freeze or abort */
+       if (freeze)
+               ata_port_freeze(ap);
+       else
+               ata_port_abort(ap);
+}
+
+static void sata_fsl_qc_complete(struct ata_queued_cmd *qc)
+{
+       if (qc->flags & ATA_QCFLAG_RESULT_TF) {
+               DPRINTK("xx_qc_complete called\n");
+               sata_fsl_cache_taskfile_from_d2h_fis(qc, qc->ap);
+       }
+}
+
+static void sata_fsl_host_intr(struct ata_port *ap)
+{
+       struct sata_fsl_host_priv *host_priv = ap->host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 hstatus, qc_active = 0;
+       struct ata_queued_cmd *qc;
+       u32 SError;
+
+       hstatus = ioread32(hcr_base + HSTATUS);
+
+       sata_fsl_scr_read(ap, SCR_ERROR, &SError);
+
+       if (unlikely(SError & 0xFFFF0000)) {
+               DPRINTK("serror @host_intr : 0x%x\n", SError);
+               sata_fsl_error_intr(ap);
+
+       }
+
+       if (unlikely(hstatus & INT_ON_ERROR)) {
+               DPRINTK("error interrupt!!\n");
+               sata_fsl_error_intr(ap);
+               return;
+       }
+
+       if (ap->sactive) {      /* only true for NCQ commands */
+               int i;
+               /* Read command completed register */
+               qc_active = ioread32(hcr_base + CC);
+               /* clear CC bit, this will also complete the interrupt */
+               iowrite32(qc_active, hcr_base + CC);
+
+               DPRINTK("Status of all queues :\n");
+               DPRINTK("qc_active/CC = 0x%x, CA = 0x%x, CE=0x%x\n",
+                       qc_active, ioread32(hcr_base + CA),
+                       ioread32(hcr_base + CE));
+
+               for (i = 0; i < SATA_FSL_QUEUE_DEPTH; i++) {
+                       if (qc_active & (1 << i)) {
+                               qc = ata_qc_from_tag(ap, i);
+                               if (qc) {
+                                       sata_fsl_qc_complete(qc);
+                                       ata_qc_complete(qc);
+                               }
+                               DPRINTK
+                                   ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n",
+                                    i, ioread32(hcr_base + CC),
+                                    ioread32(hcr_base + CA));
+                       }
+               }
+               return;
+
+       } else if (ap->qc_active) {
+               iowrite32(1, hcr_base + CC);
+               qc = ata_qc_from_tag(ap, ap->active_tag);
+
+               DPRINTK("completing non-ncq cmd, tag=%d,CC=0x%x\n",
+                       ap->active_tag, ioread32(hcr_base + CC));
+
+               if (qc) {
+                       sata_fsl_qc_complete(qc);
+                       ata_qc_complete(qc);
+               }
+       } else {
+               /* Spurious Interrupt!! */
+               DPRINTK("spurious interrupt!!, CC = 0x%x\n",
+                       ioread32(hcr_base + CC));
+               return;
+       }
+}
+
+static irqreturn_t sata_fsl_interrupt(int irq, void *dev_instance)
+{
+       struct ata_host *host = dev_instance;
+       struct sata_fsl_host_priv *host_priv = host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 interrupt_enables;
+       unsigned handled = 0;
+       struct ata_port *ap;
+
+       /* ack. any pending IRQs for this controller/port */
+       interrupt_enables = ioread32(hcr_base + HSTATUS);
+       interrupt_enables &= 0x3F;
+
+       DPRINTK("interrupt status 0x%x\n", interrupt_enables);
+
+       if (!interrupt_enables)
+               return IRQ_NONE;
+
+       spin_lock(&host->lock);
+
+       /* Assuming one port per host controller */
+
+       ap = host->ports[0];
+       if (ap) {
+               sata_fsl_host_intr(ap);
+       } else {
+               dev_printk(KERN_WARNING, host->dev,
+                          "interrupt on disabled port 0\n");
+       }
+
+       iowrite32(interrupt_enables, hcr_base + HSTATUS);
+       handled = 1;
+
+       spin_unlock(&host->lock);
+
+       return IRQ_RETVAL(handled);
+}
+
+/*
+ * Multiple ports are represented by multiple SATA controllers with
+ * one port per controller
+ */
+static int sata_fsl_init_controller(struct ata_host *host)
+{
+       struct sata_fsl_host_priv *host_priv = host->private_data;
+       void __iomem *hcr_base = host_priv->hcr_base;
+       u32 temp;
+
+       /*
+        * NOTE : We cannot bring the controller online before setting
+        * the CHBA, hence main controller initialization is done as
+        * part of the port_start() callback
+        */
+
+       /* ack. any pending IRQs for this controller/port */
+       temp = ioread32(hcr_base + HSTATUS);
+       if (temp & 0x3F)
+               iowrite32((temp & 0x3F), hcr_base + HSTATUS);
+
+       /* Keep interrupts disabled on the controller */
+       temp = ioread32(hcr_base + HCONTROL);
+       iowrite32((temp & ~0x3F), hcr_base + HCONTROL);
+
+       /* Disable interrupt coalescing control(icc), for the moment */
+       DPRINTK("icc = 0x%x\n", ioread32(hcr_base + ICC));
+       iowrite32(0x01000000, hcr_base + ICC);
+
+       /* clear error registers, SError is cleared by libATA  */
+       iowrite32(0x00000FFFF, hcr_base + CE);
+       iowrite32(0x00000FFFF, hcr_base + DE);
+
+       /* initially assuming no Port multiplier, set CQPMP to 0 */
+       iowrite32(0x0, hcr_base + CQPMP);
+
+       /*
+        * host controller will be brought on-line, during xx_port_start()
+        * callback, that should also initiate the OOB, COMINIT sequence
+        */
+
+       DPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
+       DPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
+
+       return 0;
+}
+
+/*
+ * scsi mid-layer and libata interface structures
+ */
+static struct scsi_host_template sata_fsl_sht = {
+       .module = THIS_MODULE,
+       .name = "sata_fsl",
+       .ioctl = ata_scsi_ioctl,
+       .queuecommand = ata_scsi_queuecmd,
+       .change_queue_depth = ata_scsi_change_queue_depth,
+       .can_queue = SATA_FSL_QUEUE_DEPTH,
+       .this_id = ATA_SHT_THIS_ID,
+       .sg_tablesize = SATA_FSL_MAX_PRD_USABLE,
+       .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
+       .emulated = ATA_SHT_EMULATED,
+       .use_clustering = ATA_SHT_USE_CLUSTERING,
+       .proc_name = "sata_fsl",
+       .dma_boundary = ATA_DMA_BOUNDARY,
+       .slave_configure = ata_scsi_slave_config,
+       .slave_destroy = ata_scsi_slave_destroy,
+       .bios_param = ata_std_bios_param,
+#ifdef CONFIG_PM
+       .suspend = ata_scsi_device_suspend,
+       .resume = ata_scsi_device_resume,
+#endif
+};
+
+static const struct ata_port_operations sata_fsl_ops = {
+       .port_disable = ata_port_disable,
+
+       .check_status = sata_fsl_check_status,
+       .check_altstatus = sata_fsl_check_status,
+       .dev_select = ata_noop_dev_select,
+
+       .tf_read = sata_fsl_tf_read,
+
+       .qc_prep = sata_fsl_qc_prep,
+       .qc_issue = sata_fsl_qc_issue,
+       .irq_clear = sata_fsl_irq_clear,
+       .irq_on = ata_dummy_irq_on,
+       .irq_ack = ata_dummy_irq_ack,
+
+       .scr_read = sata_fsl_scr_read,
+       .scr_write = sata_fsl_scr_write,
+
+       .freeze = sata_fsl_freeze,
+       .thaw = sata_fsl_thaw,
+       .error_handler = sata_fsl_error_handler,
+       .post_internal_cmd = sata_fsl_post_internal_cmd,
+
+       .port_start = sata_fsl_port_start,
+       .port_stop = sata_fsl_port_stop,
+};
+
+static const struct ata_port_info sata_fsl_port_info[] = {
+       {
+        .flags = SATA_FSL_HOST_FLAGS,
+        .pio_mask = 0x1f,      /* pio 0-4 */
+        .udma_mask = 0x7f,     /* udma 0-6 */
+        .port_ops = &sata_fsl_ops,
+        },
+};
+
+static int sata_fsl_probe(struct of_device *ofdev,
+                       const struct of_device_id *match)
+{
+       int retval = 0;
+       void __iomem *hcr_base = NULL;
+       void __iomem *ssr_base = NULL;
+       void __iomem *csr_base = NULL;
+       struct sata_fsl_host_priv *host_priv = NULL;
+       struct resource *r;
+       int irq;
+       struct ata_host *host;
+
+       struct ata_port_info pi = sata_fsl_port_info[0];
+       const struct ata_port_info *ppi[] = { &pi, NULL };
+
+       dev_printk(KERN_INFO, &ofdev->dev,
+                  "Sata FSL Platform/CSB Driver init\n");
+
+       r = kmalloc(sizeof(struct resource), GFP_KERNEL);
+
+       hcr_base = of_iomap(ofdev->node, 0);
+       if (!hcr_base)
+               goto error_exit_with_cleanup;
+
+       ssr_base = hcr_base + 0x100;
+       csr_base = hcr_base + 0x140;
+
+       DPRINTK("@reset i/o = 0x%x\n", ioread32(csr_base + TRANSCFG));
+       DPRINTK("sizeof(cmd_desc) = %d\n", sizeof(struct command_desc));
+       DPRINTK("sizeof(#define cmd_desc) = %d\n", SATA_FSL_CMD_DESC_SIZE);
+
+       host_priv = kzalloc(sizeof(struct sata_fsl_host_priv), GFP_KERNEL);
+       if (!host_priv)
+               goto error_exit_with_cleanup;
+
+       host_priv->hcr_base = hcr_base;
+       host_priv->ssr_base = ssr_base;
+       host_priv->csr_base = csr_base;
+
+       irq = irq_of_parse_and_map(ofdev->node, 0);
+       if (irq < 0) {
+               dev_printk(KERN_ERR, &ofdev->dev, "invalid irq from platform\n");
+               goto error_exit_with_cleanup;
+       }
+
+       /* allocate host structure */
+       host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS);
+
+       /* host->iomap is not used currently */
+       host->private_data = host_priv;
+
+       /* setup port(s) */
+
+       host->ports[0]->ioaddr.cmd_addr = host_priv->hcr_base;
+       host->ports[0]->ioaddr.scr_addr = host_priv->ssr_base;
+
+       /* initialize host controller */
+       sata_fsl_init_controller(host);
+
+       /*
+        * Now, register with libATA core, this will also initiate the
+        * device discovery process, invoking our port_start() handler &
+        * error_handler() to execute a dummy Softreset EH session
+        */
+       ata_host_activate(host, irq, sata_fsl_interrupt, SATA_FSL_IRQ_FLAG,
+                         &sata_fsl_sht);
+
+       dev_set_drvdata(&ofdev->dev, host);
+
+       return 0;
+
+error_exit_with_cleanup:
+
+       if (hcr_base)
+               iounmap(hcr_base);
+       if (host_priv)
+               kfree(host_priv);
+
+       return retval;
+}
+
+static int sata_fsl_remove(struct of_device *ofdev)
+{
+       struct ata_host *host = dev_get_drvdata(&ofdev->dev);
+       struct sata_fsl_host_priv *host_priv = host->private_data;
+
+       ata_host_detach(host);
+
+       dev_set_drvdata(&ofdev->dev, NULL);
+
+       irq_dispose_mapping(host->irq);
+       iounmap(host_priv->hcr_base);
+       kfree(host_priv);
+
+       return 0;
+}
+
+static struct of_device_id fsl_sata_match[] = {
+       {
+               .compatible = "fsl,mpc8315-sata",
+       },
+       {
+               .compatible = "fsl,mpc8379-sata",
+       },
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, fsl_sata_match);
+
+static struct of_platform_driver fsl_sata_driver = {
+       .name           = "fsl-sata",
+       .match_table    = fsl_sata_match,
+       .probe          = sata_fsl_probe,
+       .remove         = sata_fsl_remove,
+};
+
+static int __init sata_fsl_init(void)
+{
+       of_register_platform_driver(&fsl_sata_driver);
+       return 0;
+}
+
+static void __exit sata_fsl_exit(void)
+{
+       of_unregister_platform_driver(&fsl_sata_driver);
+}
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Ashish Kalra, Freescale Semiconductor");
+MODULE_DESCRIPTION("Freescale 3.0Gbps SATA controller low level driver");
+MODULE_VERSION("1.10");
+
+module_init(sata_fsl_init);
+module_exit(sata_fsl_exit);
index 4df8311968e9e3f04325a7823cc53d78c21f1754..7f1b13e89cf74c5cb75cd8f67b2a19abf816d88c 100644 (file)
@@ -421,7 +421,6 @@ static void mv_error_handler(struct ata_port *ap);
 static void mv_post_int_cmd(struct ata_queued_cmd *qc);
 static void mv_eh_freeze(struct ata_port *ap);
 static void mv_eh_thaw(struct ata_port *ap);
-static int mv_slave_config(struct scsi_device *sdev);
 static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 
 static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
@@ -459,7 +458,7 @@ static struct scsi_host_template mv5_sht = {
        .use_clustering         = 1,
        .proc_name              = DRV_NAME,
        .dma_boundary           = MV_DMA_BOUNDARY,
-       .slave_configure        = mv_slave_config,
+       .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
 };
@@ -477,7 +476,7 @@ static struct scsi_host_template mv6_sht = {
        .use_clustering         = 1,
        .proc_name              = DRV_NAME,
        .dma_boundary           = MV_DMA_BOUNDARY,
-       .slave_configure        = mv_slave_config,
+       .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
 };
@@ -756,17 +755,6 @@ static void mv_irq_clear(struct ata_port *ap)
 {
 }
 
-static int mv_slave_config(struct scsi_device *sdev)
-{
-       int rc = ata_scsi_slave_config(sdev);
-       if (rc)
-               return rc;
-
-       blk_queue_max_phys_segments(sdev->request_queue, MV_MAX_SG_CT / 2);
-
-       return 0;       /* scsi layer doesn't check return value, sigh */
-}
-
 static void mv_set_edma_ptrs(void __iomem *port_mmio,
                             struct mv_host_priv *hpriv,
                             struct mv_port_priv *pp)
@@ -1138,7 +1126,7 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
 {
        struct mv_port_priv *pp = qc->ap->private_data;
        struct scatterlist *sg;
-       struct mv_sg *mv_sg;
+       struct mv_sg *mv_sg, *last_sg = NULL;
 
        mv_sg = pp->sg_tbl;
        ata_for_each_sg(sg, qc) {
@@ -1159,13 +1147,13 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
                        sg_len -= len;
                        addr += len;
 
-                       if (!sg_len && ata_sg_is_last(sg, qc))
-                               mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
-
+                       last_sg = mv_sg;
                        mv_sg++;
                }
-
        }
+
+       if (likely(last_sg))
+               last_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
 }
 
 static inline void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)
index b0619278454a17e513f374640065996bc3622ed9..26ebffc10f3e1254634d3ed9272e567ac4d33fe0 100644 (file)
@@ -796,16 +796,19 @@ static inline void sil24_fill_sg(struct ata_queued_cmd *qc,
                                 struct sil24_sge *sge)
 {
        struct scatterlist *sg;
+       struct sil24_sge *last_sge = NULL;
 
        ata_for_each_sg(sg, qc) {
                sge->addr = cpu_to_le64(sg_dma_address(sg));
                sge->cnt = cpu_to_le32(sg_dma_len(sg));
-               if (ata_sg_is_last(sg, qc))
-                       sge->flags = cpu_to_le32(SGE_TRM);
-               else
-                       sge->flags = 0;
+               sge->flags = 0;
+
+               last_sge = sge;
                sge++;
        }
+
+       if (likely(last_sge))
+               last_sge->flags = cpu_to_le32(SGE_TRM);
 }
 
 static int sil24_qc_defer(struct ata_queued_cmd *qc)
index fbae8674e491f105269c30a1f10e1c9c4b9929cc..5beddc322e6f86f0df9c43b1207f5cef8aad753a 100644 (file)
@@ -366,7 +366,7 @@ dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
        unsigned long           flags;
        int                     map, block;
 
-       if ((page = pool_find_page (pool, dma)) == 0) {
+       if ((page = pool_find_page(pool, dma)) == NULL) {
                if (pool->dev)
                        dev_err(pool->dev, "dma_pool_free %s, %p/%lx (bad dma)\n",
                                pool->name, vaddr, (unsigned long) dma);
index 2b0c601e422e13640759aa73dffa882c8c62272d..2b4b392dcbc1761339db874b4f9a02a5b49305c0 100644 (file)
@@ -114,7 +114,7 @@ static unsigned int read_magic_time(void)
        get_rtc_time(&time);
        printk("Time: %2d:%02d:%02d  Date: %02d/%02d/%02d\n",
                time.tm_hour, time.tm_min, time.tm_sec,
-               time.tm_mon, time.tm_mday, time.tm_year);
+               time.tm_mon + 1, time.tm_mday, time.tm_year % 100);
        val = time.tm_year;                             /* 100 years */
        if (val > 100)
                val -= 100;
index 8d8cdfec6529e683a194cd49547b81aa8c3680f6..e1d3ad4db2f04355631efd8120946c07313789c8 100644 (file)
@@ -94,27 +94,18 @@ static struct attribute_group topology_attr_group = {
        .name = "topology"
 };
 
-static cpumask_t topology_dev_map = CPU_MASK_NONE;
-
 /* Add/Remove cpu_topology interface for CPU device */
 static int __cpuinit topology_add_dev(unsigned int cpu)
 {
-       int rc;
        struct sys_device *sys_dev = get_cpu_sysdev(cpu);
 
-       rc = sysfs_create_group(&sys_dev->kobj, &topology_attr_group);
-       if (!rc)
-               cpu_set(cpu, topology_dev_map);
-       return rc;
+       return sysfs_create_group(&sys_dev->kobj, &topology_attr_group);
 }
 
 static void __cpuinit topology_remove_dev(unsigned int cpu)
 {
        struct sys_device *sys_dev = get_cpu_sysdev(cpu);
 
-       if (!cpu_isset(cpu, topology_dev_map))
-               return;
-       cpu_clear(cpu, topology_dev_map);
        sysfs_remove_group(&sys_dev->kobj, &topology_attr_group);
 }
 
index 9e7652dcde6cd46f1d1d19c2fa0462f8754d9536..82effce97c514601dfbc3f5d9f5e953fe98bcd5b 100644 (file)
@@ -390,8 +390,8 @@ static inline void ace_dump_mem(void *base, int len)
 static void ace_dump_regs(struct ace_device *ace)
 {
        dev_info(ace->dev, "    ctrl:  %.8x  seccnt/cmd: %.4x      ver:%.4x\n"
-                "    status:%.8x  mpu_lba:%.8x  busmode:%4x\n"
-                "    error: %.8x  cfg_lba:%.8x  fatstat:%.4x\n",
+                KERN_INFO "    status:%.8x  mpu_lba:%.8x  busmode:%4x\n"
+                KERN_INFO "    error: %.8x  cfg_lba:%.8x  fatstat:%.4x\n",
                 ace_in32(ace, ACE_CTRL),
                 ace_in(ace, ACE_SECCNTCMD),
                 ace_in(ace, ACE_VERSION),
index 79245714f0a777430d459eb2a3c09aa7746410b4..d70745c84250cb4b3f15d51adae267019a2d32c9 100644 (file)
@@ -3458,47 +3458,19 @@ static void cdrom_update_settings(void)
 static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
                                void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-       int *valp = ctl->data;
-       int val = *valp;
        int ret;
        
        ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
-       if (write && *valp != val) {
+       if (write) {
        
                /* we only care for 1 or 0. */
-               if (*valp)
-                       *valp = 1;
-               else
-                       *valp = 0;
+               autoclose        = !!cdrom_sysctl_settings.autoclose;
+               autoeject        = !!cdrom_sysctl_settings.autoeject;
+               debug            = !!cdrom_sysctl_settings.debug;
+               lockdoor         = !!cdrom_sysctl_settings.lock;
+               check_media_type = !!cdrom_sysctl_settings.check;
 
-               switch (ctl->ctl_name) {
-               case DEV_CDROM_AUTOCLOSE: {
-                       if (valp == &cdrom_sysctl_settings.autoclose)
-                               autoclose = cdrom_sysctl_settings.autoclose;
-                       break;
-                       }
-               case DEV_CDROM_AUTOEJECT: {
-                       if (valp == &cdrom_sysctl_settings.autoeject)
-                               autoeject = cdrom_sysctl_settings.autoeject;
-                       break;
-                       }
-               case DEV_CDROM_DEBUG: {
-                       if (valp == &cdrom_sysctl_settings.debug)
-                               debug = cdrom_sysctl_settings.debug;
-                       break;
-                       }
-               case DEV_CDROM_LOCK: {
-                       if (valp == &cdrom_sysctl_settings.lock)
-                               lockdoor = cdrom_sysctl_settings.lock;
-                       break;
-                       }
-               case DEV_CDROM_CHECK_MEDIA: {
-                       if (valp == &cdrom_sysctl_settings.check)
-                               check_media_type = cdrom_sysctl_settings.check;
-                       break;
-                       }
-               }
                /* update the option flags according to the changes. we
                   don't have per device options through sysctl yet,
                   but we will have and then this will disappear. */
@@ -3511,7 +3483,6 @@ static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
 /* Place files in /proc/sys/dev/cdrom */
 static ctl_table cdrom_table[] = {
        {
-               .ctl_name       = DEV_CDROM_INFO,
                .procname       = "info",
                .data           = &cdrom_sysctl_settings.info, 
                .maxlen         = CDROM_STR_SIZE,
@@ -3519,7 +3490,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_info,
        },
        {
-               .ctl_name       = DEV_CDROM_AUTOCLOSE,
                .procname       = "autoclose",
                .data           = &cdrom_sysctl_settings.autoclose,
                .maxlen         = sizeof(int),
@@ -3527,7 +3497,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_AUTOEJECT,
                .procname       = "autoeject",
                .data           = &cdrom_sysctl_settings.autoeject,
                .maxlen         = sizeof(int),
@@ -3535,7 +3504,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_DEBUG,
                .procname       = "debug",
                .data           = &cdrom_sysctl_settings.debug,
                .maxlen         = sizeof(int),
@@ -3543,7 +3511,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_LOCK,
                .procname       = "lock",
                .data           = &cdrom_sysctl_settings.lock,
                .maxlen         = sizeof(int),
@@ -3551,7 +3518,6 @@ static ctl_table cdrom_table[] = {
                .proc_handler   = &cdrom_sysctl_handler,
        },
        {
-               .ctl_name       = DEV_CDROM_CHECK_MEDIA,
                .procname       = "check_media",
                .data           = &cdrom_sysctl_settings.check,
                .maxlen         = sizeof(int),
index 204d53e506de40af3d37d42e2a1030dbdda323d0..65491103e0fbc6c50ab9efa099d017806b58b3ba 100644 (file)
@@ -36,23 +36,6 @@ config VT
          If unsure, say Y, or else you won't be able to do much with your new
          shiny Linux system :-)
 
-config VT_UNICODE
-       bool "Virtual console is Unicode by default"
-       depends on VT
-       default n
-       ---help---
-         If you say Y here, the virtual terminal will be in UTF-8 by default,
-         and the keyboard will run in unicode mode.
-
-         If you say N here, the virtual terminal will not be in UTF-8 by
-         default, and the keyboard will run in XLATE mode.
-
-         This can also be changed by passing 'default_utf8=<0|1>' on the
-         kernel command line.
-
-         Historically, the kernel has defaulted to non-UTF8 and XLATE mode.
-         If unsure, say N here.
-
 config VT_CONSOLE
        bool "Support for console on virtual terminal" if EMBEDDED
        depends on VT
@@ -649,8 +632,6 @@ config HVCS
 
 source "drivers/char/ipmi/Kconfig"
 
-source "drivers/char/watchdog/Kconfig"
-
 config DS1620
        tristate "NetWinder thermometer support"
        depends on ARCH_NETWINDER
index ec116df919d97c043b45ed89637e73624d59810f..c99e43b837f5ce50010fefb57259699884a79418 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/apm_bios.h>
 #include <linux/capability.h>
 #include <linux/sched.h>
-#include <linux/pm.h>
+#include <linux/suspend.h>
 #include <linux/apm-emulation.h>
 #include <linux/freezer.h>
 #include <linux/device.h>
index 9e0adfe27c12d56cf8d36515f0c6061a47db4a8a..d15234c5965e60ffeb4a74251462981ed604beb6 100644 (file)
 static void cy_throttle(struct tty_struct *tty);
 static void cy_send_xchar(struct tty_struct *tty, char ch);
 
-#define IS_CYC_Z(card) ((card).num_chips == -1)
+#define IS_CYC_Z(card) ((card).num_chips == (unsigned int)-1)
 
 #define Z_FPGA_CHECK(card) \
        ((readl(&((struct RUNTIME_9060 __iomem *) \
@@ -897,71 +897,6 @@ static inline int serial_paranoia_check(struct cyclades_port *info,
        return 0;
 }                              /* serial_paranoia_check */
 
-/*
- * This routine is used by the interrupt handler to schedule
- * processing in the software interrupt portion of the driver
- * (also known as the "bottom half").  This can be called any
- * number of times for any channel without harm.
- */
-static inline void cy_sched_event(struct cyclades_port *info, int event)
-{
-       info->event |= 1 << event; /* remember what kind of event and who */
-       schedule_work(&info->tqueue);
-}                              /* cy_sched_event */
-
-/*
- * This routine is used to handle the "bottom half" processing for the
- * serial driver, known also the "software interrupt" processing.
- * This processing is done at the kernel interrupt level, after the
- * cy#/_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON.  This
- * is where time-consuming activities which can not be done in the
- * interrupt driver proper are done; the interrupt driver schedules
- * them using cy_sched_event(), and they get done here.
- *
- * This is done through one level of indirection--the task queue.
- * When a hardware interrupt service routine wants service by the
- * driver's bottom half, it enqueues the appropriate tq_struct (one
- * per port) to the keventd work queue and sets a request flag
- * that the work queue be processed.
- *
- * Although this may seem unwieldy, it gives the system a way to
- * pass an argument (in this case the pointer to the cyclades_port
- * structure) to the bottom half of the driver.  Previous kernels
- * had to poll every port to see if that port needed servicing.
- */
-static void
-do_softint(struct work_struct *work)
-{
-       struct cyclades_port *info =
-               container_of(work, struct cyclades_port, tqueue);
-       struct tty_struct    *tty;
-
-       tty = info->tty;
-       if (!tty)
-               return;
-
-       if (test_and_clear_bit(Cy_EVENT_HANGUP, &info->event)) {
-               tty_hangup(info->tty);
-               wake_up_interruptible(&info->open_wait);
-                       info->flags &= ~ASYNC_NORMAL_ACTIVE;
-       }
-       if (test_and_clear_bit(Cy_EVENT_OPEN_WAKEUP, &info->event))
-               wake_up_interruptible(&info->open_wait);
-#ifdef CONFIG_CYZ_INTR
-       if (test_and_clear_bit(Cy_EVENT_Z_RX_FULL, &info->event) &&
-                       !timer_pending(&cyz_rx_full_timer[info->line]))
-               mod_timer(&cyz_rx_full_timer[info->line], jiffies + 1);
-#endif
-       if (test_and_clear_bit(Cy_EVENT_DELTA_WAKEUP, &info->event))
-               wake_up_interruptible(&info->delta_msr_wait);
-       tty_wakeup(tty);
-#ifdef Z_WAKE
-       if (test_and_clear_bit(Cy_EVENT_SHUTDOWN_WAKEUP, &info->event))
-               complete(&info->shutdown_wait);
-#endif
-} /* do_softint */
-
-
 /***********************************************************/
 /********* Start of block of Cyclom-Y specific code ********/
 
@@ -1045,382 +980,332 @@ static unsigned detect_isa_irq(void __iomem * address)
 }
 #endif                         /* CONFIG_ISA */
 
-static void cyy_intr_chip(struct cyclades_card *cinfo, int chip,
-                       void __iomem * base_addr, int status, int index)
+static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
+               void __iomem *base_addr)
 {
        struct cyclades_port *info;
        struct tty_struct *tty;
-       int char_count;
-       int j, len, mdm_change, mdm_status, outch;
-       int save_xir, channel, save_car;
-       char data;
+       int len, index = cinfo->bus_index;
+       u8 save_xir, channel, save_car, data, char_count;
 
-       if (status & CySRReceive) {     /* reception interrupt */
 #ifdef CY_DEBUG_INTERRUPTS
-               printk(KERN_DEBUG "cyy_interrupt: rcvd intr, chip %d\n", chip);
+       printk(KERN_DEBUG "cyy_interrupt: rcvd intr, chip %d\n", chip);
 #endif
-               /* determine the channel & change to that context */
-               spin_lock(&cinfo->card_lock);
-               save_xir = (u_char) readb(base_addr + (CyRIR << index));
-               channel = (u_short) (save_xir & CyIRChannel);
-               info = &cinfo->ports[channel + chip * 4];
-               save_car = readb(base_addr + (CyCAR << index));
-               cy_writeb(base_addr + (CyCAR << index), save_xir);
-
-               /* if there is nowhere to put the data, discard it */
-               if (info->tty == NULL) {
-                       j = (readb(base_addr + (CyRIVR << index)) &
-                               CyIVRMask);
-                       if (j == CyIVRRxEx) {   /* exception */
+       /* determine the channel & change to that context */
+       save_xir = readb(base_addr + (CyRIR << index));
+       channel = save_xir & CyIRChannel;
+       info = &cinfo->ports[channel + chip * 4];
+       save_car = readb(base_addr + (CyCAR << index));
+       cy_writeb(base_addr + (CyCAR << index), save_xir);
+
+       /* if there is nowhere to put the data, discard it */
+       if (info->tty == NULL) {
+               if ((readb(base_addr + (CyRIVR << index)) & CyIVRMask) ==
+                               CyIVRRxEx) {    /* exception */
+                       data = readb(base_addr + (CyRDSR << index));
+               } else {        /* normal character reception */
+                       char_count = readb(base_addr + (CyRDCR << index));
+                       while (char_count--)
                                data = readb(base_addr + (CyRDSR << index));
-                       } else {        /* normal character reception */
-                               char_count = readb(base_addr +
-                                               (CyRDCR << index));
-                               while (char_count--) {
-                                       data = readb(base_addr +
-                                               (CyRDSR << index));
-                               }
-                       }
-               } else {        /* there is an open port for this data */
-                       tty = info->tty;
-                       j = (readb(base_addr + (CyRIVR << index)) &
-                                       CyIVRMask);
-                       if (j == CyIVRRxEx) {   /* exception */
-                               data = readb(base_addr + (CyRDSR << index));
-
-                               /* For statistics only */
-                               if (data & CyBREAK)
-                                       info->icount.brk++;
-                               else if (data & CyFRAME)
-                                       info->icount.frame++;
-                               else if (data & CyPARITY)
-                                       info->icount.parity++;
-                               else if (data & CyOVERRUN)
-                                       info->icount.overrun++;
-
-                               if (data & info->ignore_status_mask) {
+               }
+               goto end;
+       }
+       /* there is an open port for this data */
+       tty = info->tty;
+       if ((readb(base_addr + (CyRIVR << index)) & CyIVRMask) ==
+                       CyIVRRxEx) {    /* exception */
+               data = readb(base_addr + (CyRDSR << index));
+
+               /* For statistics only */
+               if (data & CyBREAK)
+                       info->icount.brk++;
+               else if (data & CyFRAME)
+                       info->icount.frame++;
+               else if (data & CyPARITY)
+                       info->icount.parity++;
+               else if (data & CyOVERRUN)
+                       info->icount.overrun++;
+
+               if (data & info->ignore_status_mask) {
+                       info->icount.rx++;
+                       return;
+               }
+               if (tty_buffer_request_room(tty, 1)) {
+                       if (data & info->read_status_mask) {
+                               if (data & CyBREAK) {
+                                       tty_insert_flip_char(tty,
+                                               readb(base_addr + (CyRDSR <<
+                                                       index)), TTY_BREAK);
+                                       info->icount.rx++;
+                                       if (info->flags & ASYNC_SAK)
+                                               do_SAK(tty);
+                               } else if (data & CyFRAME) {
+                                       tty_insert_flip_char( tty,
+                                               readb(base_addr + (CyRDSR <<
+                                                       index)), TTY_FRAME);
+                                       info->icount.rx++;
+                                       info->idle_stats.frame_errs++;
+                               } else if (data & CyPARITY) {
+                                       /* Pieces of seven... */
+                                       tty_insert_flip_char(tty,
+                                               readb(base_addr + (CyRDSR <<
+                                                       index)), TTY_PARITY);
+                                       info->icount.rx++;
+                                       info->idle_stats.parity_errs++;
+                               } else if (data & CyOVERRUN) {
+                                       tty_insert_flip_char(tty, 0,
+                                                       TTY_OVERRUN);
+                                       info->icount.rx++;
+                                       /* If the flip buffer itself is
+                                          overflowing, we still lose
+                                          the next incoming character.
+                                        */
+                                       tty_insert_flip_char(tty,
+                                               readb(base_addr + (CyRDSR <<
+                                                       index)), TTY_FRAME);
                                        info->icount.rx++;
-                                       spin_unlock(&cinfo->card_lock);
-                                       return;
-                               }
-                               if (tty_buffer_request_room(tty, 1)) {
-                                       if (data & info->read_status_mask) {
-                                               if (data & CyBREAK) {
-                                                       tty_insert_flip_char(
-                                                               tty,
-                                                               readb(
-                                                               base_addr +
-                                                               (CyRDSR <<
-                                                                       index)),
-                                                               TTY_BREAK);
-                                                       info->icount.rx++;
-                                                       if (info->flags &
-                                                           ASYNC_SAK) {
-                                                               do_SAK(tty);
-                                                       }
-                                               } else if (data & CyFRAME) {
-                                                       tty_insert_flip_char(
-                                                               tty,
-                                                               readb(
-                                                               base_addr +
-                                                               (CyRDSR <<
-                                                                       index)),
-                                                               TTY_FRAME);
-                                                       info->icount.rx++;
-                                                       info->idle_stats.
-                                                               frame_errs++;
-                                               } else if (data & CyPARITY) {
-                                                       /* Pieces of seven... */
-                                                       tty_insert_flip_char(
-                                                               tty,
-                                                               readb(
-                                                               base_addr +
-                                                               (CyRDSR <<
-                                                                       index)),
-                                                               TTY_PARITY);
-                                                       info->icount.rx++;
-                                                       info->idle_stats.
-                                                               parity_errs++;
-                                               } else if (data & CyOVERRUN) {
-                                                       tty_insert_flip_char(
-                                                               tty, 0,
-                                                               TTY_OVERRUN);
-                                                       info->icount.rx++;
-                                               /* If the flip buffer itself is
-                                                  overflowing, we still lose
-                                                  the next incoming character.
-                                                */
-                                                       tty_insert_flip_char(
-                                                               tty,
-                                                               readb(
-                                                               base_addr +
-                                                               (CyRDSR <<
-                                                                       index)),
-                                                               TTY_FRAME);
-                                                       info->icount.rx++;
-                                                       info->idle_stats.
-                                                               overruns++;
-                                       /* These two conditions may imply */
-                                       /* a normal read should be done. */
-                                       /* }else if(data & CyTIMEOUT){ */
-                                       /* }else if(data & CySPECHAR){ */
-                                               } else {
-                                                       tty_insert_flip_char(
-                                                               tty, 0,
-                                                               TTY_NORMAL);
-                                                       info->icount.rx++;
-                                               }
-                                       } else {
-                                               tty_insert_flip_char(tty, 0,
-                                                               TTY_NORMAL);
-                                               info->icount.rx++;
-                                       }
-                               } else {
-                                       /* there was a software buffer
-                                          overrun and nothing could be
-                                          done about it!!! */
-                                       info->icount.buf_overrun++;
                                        info->idle_stats.overruns++;
+                               /* These two conditions may imply */
+                               /* a normal read should be done. */
+                               /* } else if(data & CyTIMEOUT) { */
+                               /* } else if(data & CySPECHAR) { */
+                               } else {
+                                       tty_insert_flip_char(tty, 0,
+                                                       TTY_NORMAL);
+                                       info->icount.rx++;
                                }
-                       } else {        /* normal character reception */
-                               /* load # chars available from the chip */
-                               char_count = readb(base_addr +
-                                               (CyRDCR << index));
+                       } else {
+                               tty_insert_flip_char(tty, 0, TTY_NORMAL);
+                               info->icount.rx++;
+                       }
+               } else {
+                       /* there was a software buffer overrun and nothing
+                        * could be done about it!!! */
+                       info->icount.buf_overrun++;
+                       info->idle_stats.overruns++;
+               }
+       } else {        /* normal character reception */
+               /* load # chars available from the chip */
+               char_count = readb(base_addr + (CyRDCR << index));
 
 #ifdef CY_ENABLE_MONITORING
-                               ++info->mon.int_count;
-                               info->mon.char_count += char_count;
-                               if (char_count > info->mon.char_max)
-                                       info->mon.char_max = char_count;
-                               info->mon.char_last = char_count;
+               ++info->mon.int_count;
+               info->mon.char_count += char_count;
+               if (char_count > info->mon.char_max)
+                       info->mon.char_max = char_count;
+               info->mon.char_last = char_count;
 #endif
-                               len = tty_buffer_request_room(tty, char_count);
-                               while (len--) {
-                                       data = readb(base_addr +
-                                                       (CyRDSR << index));
-                                       tty_insert_flip_char(tty, data,
-                                                       TTY_NORMAL);
-                                       info->idle_stats.recv_bytes++;
-                                       info->icount.rx++;
+               len = tty_buffer_request_room(tty, char_count);
+               while (len--) {
+                       data = readb(base_addr + (CyRDSR << index));
+                       tty_insert_flip_char(tty, data, TTY_NORMAL);
+                       info->idle_stats.recv_bytes++;
+                       info->icount.rx++;
 #ifdef CY_16Y_HACK
-                                       udelay(10L);
+                       udelay(10L);
 #endif
-                               }
-                               info->idle_stats.recv_idle = jiffies;
-                       }
-                       tty_schedule_flip(tty);
                }
-               /* end of service */
-               cy_writeb(base_addr + (CyRIR << index), (save_xir & 0x3f));
-               cy_writeb(base_addr + (CyCAR << index), (save_car));
-               spin_unlock(&cinfo->card_lock);
+               info->idle_stats.recv_idle = jiffies;
        }
+       tty_schedule_flip(tty);
+end:
+       /* end of service */
+       cy_writeb(base_addr + (CyRIR << index), save_xir & 0x3f);
+       cy_writeb(base_addr + (CyCAR << index), save_car);
+}
+
+static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip,
+               void __iomem *base_addr)
+{
+       struct cyclades_port *info;
+       int char_count, index = cinfo->bus_index;
+       u8 save_xir, channel, save_car, outch;
 
-       if (status & CySRTransmit) {    /* transmission interrupt */
-               /* Since we only get here when the transmit buffer
-                  is empty, we know we can always stuff a dozen
-                  characters. */
+       /* Since we only get here when the transmit buffer
+          is empty, we know we can always stuff a dozen
+          characters. */
 #ifdef CY_DEBUG_INTERRUPTS
-               printk(KERN_DEBUG "cyy_interrupt: xmit intr, chip %d\n", chip);
+       printk(KERN_DEBUG "cyy_interrupt: xmit intr, chip %d\n", chip);
 #endif
 
-               /* determine the channel & change to that context */
-               spin_lock(&cinfo->card_lock);
-               save_xir = (u_char) readb(base_addr + (CyTIR << index));
-               channel = (u_short) (save_xir & CyIRChannel);
-               save_car = readb(base_addr + (CyCAR << index));
-               cy_writeb(base_addr + (CyCAR << index), save_xir);
+       /* determine the channel & change to that context */
+       save_xir = readb(base_addr + (CyTIR << index));
+       channel = save_xir & CyIRChannel;
+       save_car = readb(base_addr + (CyCAR << index));
+       cy_writeb(base_addr + (CyCAR << index), save_xir);
 
-               /* validate the port# (as configured and open) */
-               if (channel + chip * 4 >= cinfo->nports) {
-                       cy_writeb(base_addr + (CySRER << index),
-                                 readb(base_addr + (CySRER << index)) &
-                                 ~CyTxRdy);
-                       goto txend;
-               }
-               info = &cinfo->ports[channel + chip * 4];
-               if (info->tty == NULL) {
-                       cy_writeb(base_addr + (CySRER << index),
-                                 readb(base_addr + (CySRER << index)) &
-                                 ~CyTxRdy);
-                       goto txdone;
-               }
+       /* validate the port# (as configured and open) */
+       if (channel + chip * 4 >= cinfo->nports) {
+               cy_writeb(base_addr + (CySRER << index),
+                         readb(base_addr + (CySRER << index)) & ~CyTxRdy);
+               goto end;
+       }
+       info = &cinfo->ports[channel + chip * 4];
+       if (info->tty == NULL) {
+               cy_writeb(base_addr + (CySRER << index),
+                         readb(base_addr + (CySRER << index)) & ~CyTxRdy);
+               goto end;
+       }
 
-               /* load the on-chip space for outbound data */
-               char_count = info->xmit_fifo_size;
+       /* load the on-chip space for outbound data */
+       char_count = info->xmit_fifo_size;
 
-               if (info->x_char) {     /* send special char */
-                       outch = info->x_char;
-                       cy_writeb(base_addr + (CyTDR << index), outch);
-                       char_count--;
-                       info->icount.tx++;
-                       info->x_char = 0;
-               }
+       if (info->x_char) {     /* send special char */
+               outch = info->x_char;
+               cy_writeb(base_addr + (CyTDR << index), outch);
+               char_count--;
+               info->icount.tx++;
+               info->x_char = 0;
+       }
 
-               if (info->breakon || info->breakoff) {
-                       if (info->breakon) {
-                               cy_writeb(base_addr + (CyTDR << index), 0);
-                               cy_writeb(base_addr + (CyTDR << index), 0x81);
-                               info->breakon = 0;
-                               char_count -= 2;
-                       }
-                       if (info->breakoff) {
-                               cy_writeb(base_addr + (CyTDR << index), 0);
-                               cy_writeb(base_addr + (CyTDR << index), 0x83);
-                               info->breakoff = 0;
-                               char_count -= 2;
-                       }
+       if (info->breakon || info->breakoff) {
+               if (info->breakon) {
+                       cy_writeb(base_addr + (CyTDR << index), 0);
+                       cy_writeb(base_addr + (CyTDR << index), 0x81);
+                       info->breakon = 0;
+                       char_count -= 2;
+               }
+               if (info->breakoff) {
+                       cy_writeb(base_addr + (CyTDR << index), 0);
+                       cy_writeb(base_addr + (CyTDR << index), 0x83);
+                       info->breakoff = 0;
+                       char_count -= 2;
                }
+       }
 
-               while (char_count-- > 0) {
-                       if (!info->xmit_cnt) {
-                               if (readb(base_addr + (CySRER << index)) &
-                                               CyTxMpty) {
-                                       cy_writeb(base_addr + (CySRER << index),
-                                               readb(base_addr +
-                                                       (CySRER << index)) &
+       while (char_count-- > 0) {
+               if (!info->xmit_cnt) {
+                       if (readb(base_addr + (CySRER << index)) & CyTxMpty) {
+                               cy_writeb(base_addr + (CySRER << index),
+                                       readb(base_addr + (CySRER << index)) &
                                                ~CyTxMpty);
-                               } else {
-                                       cy_writeb(base_addr + (CySRER << index),
-                                               (readb(base_addr +
-                                                       (CySRER << index)) &
+                       } else {
+                               cy_writeb(base_addr + (CySRER << index),
+                                       (readb(base_addr + (CySRER << index)) &
                                                ~CyTxRdy) | CyTxMpty);
-                               }
-                               goto txdone;
                        }
-                       if (info->xmit_buf == NULL) {
-                               cy_writeb(base_addr + (CySRER << index),
-                                       readb(base_addr + (CySRER << index)) &
+                       goto done;
+               }
+               if (info->xmit_buf == NULL) {
+                       cy_writeb(base_addr + (CySRER << index),
+                               readb(base_addr + (CySRER << index)) &
                                        ~CyTxRdy);
-                               goto txdone;
-                       }
-                       if (info->tty->stopped || info->tty->hw_stopped) {
-                               cy_writeb(base_addr + (CySRER << index),
-                                       readb(base_addr + (CySRER << index)) &
+                       goto done;
+               }
+               if (info->tty->stopped || info->tty->hw_stopped) {
+                       cy_writeb(base_addr + (CySRER << index),
+                               readb(base_addr + (CySRER << index)) &
                                        ~CyTxRdy);
-                               goto txdone;
-                       }
-                       /* Because the Embedded Transmit Commands have
-                          been enabled, we must check to see if the
-                          escape character, NULL, is being sent.  If it
-                          is, we must ensure that there is room for it
-                          to be doubled in the output stream.  Therefore
-                          we no longer advance the pointer when the
-                          character is fetched, but rather wait until
-                          after the check for a NULL output character.
-                          This is necessary because there may not be
-                          room for the two chars needed to send a NULL.)
-                        */
-                       outch = info->xmit_buf[info->xmit_tail];
-                       if (outch) {
+                       goto done;
+               }
+               /* Because the Embedded Transmit Commands have been enabled,
+                * we must check to see if the escape character, NULL, is being
+                * sent. If it is, we must ensure that there is room for it to
+                * be doubled in the output stream.  Therefore we no longer
+                * advance the pointer when the character is fetched, but
+                * rather wait until after the check for a NULL output
+                * character. This is necessary because there may not be room
+                * for the two chars needed to send a NULL.)
+                */
+               outch = info->xmit_buf[info->xmit_tail];
+               if (outch) {
+                       info->xmit_cnt--;
+                       info->xmit_tail = (info->xmit_tail + 1) &
+                                       (SERIAL_XMIT_SIZE - 1);
+                       cy_writeb(base_addr + (CyTDR << index), outch);
+                       info->icount.tx++;
+               } else {
+                       if (char_count > 1) {
                                info->xmit_cnt--;
                                info->xmit_tail = (info->xmit_tail + 1) &
-                                               (SERIAL_XMIT_SIZE - 1);
+                                       (SERIAL_XMIT_SIZE - 1);
                                cy_writeb(base_addr + (CyTDR << index), outch);
+                               cy_writeb(base_addr + (CyTDR << index), 0);
                                info->icount.tx++;
-                       } else {
-                               if (char_count > 1) {
-                                       info->xmit_cnt--;
-                                       info->xmit_tail = (info->xmit_tail + 1)&
-                                               (SERIAL_XMIT_SIZE - 1);
-                                       cy_writeb(base_addr + (CyTDR << index),
-                                               outch);
-                                       cy_writeb(base_addr + (CyTDR << index),
-                                               0);
-                                       info->icount.tx++;
-                                       char_count--;
-                               }
+                               char_count--;
                        }
                }
-
-txdone:
-               if (info->xmit_cnt < WAKEUP_CHARS) {
-                       cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
-               }
-txend:
-               /* end of service */
-               cy_writeb(base_addr + (CyTIR << index), (save_xir & 0x3f));
-               cy_writeb(base_addr + (CyCAR << index), (save_car));
-               spin_unlock(&cinfo->card_lock);
        }
 
-       if (status & CySRModem) {       /* modem interrupt */
+done:
+       tty_wakeup(info->tty);
+end:
+       /* end of service */
+       cy_writeb(base_addr + (CyTIR << index), save_xir & 0x3f);
+       cy_writeb(base_addr + (CyCAR << index), save_car);
+}
 
-               /* determine the channel & change to that context */
-               spin_lock(&cinfo->card_lock);
-               save_xir = (u_char) readb(base_addr + (CyMIR << index));
-               channel = (u_short) (save_xir & CyIRChannel);
-               info = &cinfo->ports[channel + chip * 4];
-               save_car = readb(base_addr + (CyCAR << index));
-               cy_writeb(base_addr + (CyCAR << index), save_xir);
+static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,
+               void __iomem *base_addr)
+{
+       struct cyclades_port *info;
+       int index = cinfo->bus_index;
+       u8 save_xir, channel, save_car, mdm_change, mdm_status;
 
-               mdm_change = readb(base_addr + (CyMISR << index));
-               mdm_status = readb(base_addr + (CyMSVR1 << index));
+       /* determine the channel & change to that context */
+       save_xir = readb(base_addr + (CyMIR << index));
+       channel = save_xir & CyIRChannel;
+       info = &cinfo->ports[channel + chip * 4];
+       save_car = readb(base_addr + (CyCAR << index));
+       cy_writeb(base_addr + (CyCAR << index), save_xir);
 
-               if (info->tty) {
-                       if (mdm_change & CyANY_DELTA) {
-                               /* For statistics only */
-                               if (mdm_change & CyDCD)
-                                       info->icount.dcd++;
-                               if (mdm_change & CyCTS)
-                                       info->icount.cts++;
-                               if (mdm_change & CyDSR)
-                                       info->icount.dsr++;
-                               if (mdm_change & CyRI)
-                                       info->icount.rng++;
-
-                               cy_sched_event(info, Cy_EVENT_DELTA_WAKEUP);
-                       }
+       mdm_change = readb(base_addr + (CyMISR << index));
+       mdm_status = readb(base_addr + (CyMSVR1 << index));
 
-                       if ((mdm_change & CyDCD) &&
-                                       (info->flags & ASYNC_CHECK_CD)) {
-                               if (mdm_status & CyDCD) {
-                                       cy_sched_event(info,
-                                                       Cy_EVENT_OPEN_WAKEUP);
-                               } else {
-                                       cy_sched_event(info, Cy_EVENT_HANGUP);
-                               }
-                       }
-                       if ((mdm_change & CyCTS) &&
-                                       (info->flags & ASYNC_CTS_FLOW)) {
-                               if (info->tty->hw_stopped) {
-                                       if (mdm_status & CyCTS) {
-                                               /* cy_start isn't used
-                                                  because... !!! */
-                                               info->tty->hw_stopped = 0;
-                                               cy_writeb(base_addr +
-                                                       (CySRER << index),
-                                                       readb(base_addr +
-                                                               (CySRER <<
-                                                                       index))|
-                                                       CyTxRdy);
-                                               cy_sched_event(info,
-                                                       Cy_EVENT_WRITE_WAKEUP);
-                                       }
-                               } else {
-                                       if (!(mdm_status & CyCTS)) {
-                                               /* cy_stop isn't used
-                                                  because ... !!! */
-                                               info->tty->hw_stopped = 1;
-                                               cy_writeb(base_addr +
-                                                       (CySRER << index),
-                                                       readb(base_addr +
-                                                               (CySRER <<
-                                                               index)) &
-                                                       ~CyTxRdy);
-                                       }
-                               }
+       if (!info->tty)
+               goto end;
+
+       if (mdm_change & CyANY_DELTA) {
+               /* For statistics only */
+               if (mdm_change & CyDCD)
+                       info->icount.dcd++;
+               if (mdm_change & CyCTS)
+                       info->icount.cts++;
+               if (mdm_change & CyDSR)
+                       info->icount.dsr++;
+               if (mdm_change & CyRI)
+                       info->icount.rng++;
+
+               wake_up_interruptible(&info->delta_msr_wait);
+       }
+
+       if ((mdm_change & CyDCD) && (info->flags & ASYNC_CHECK_CD)) {
+               if (!(mdm_status & CyDCD)) {
+                       tty_hangup(info->tty);
+                       info->flags &= ~ASYNC_NORMAL_ACTIVE;
+               }
+               wake_up_interruptible(&info->open_wait);
+       }
+       if ((mdm_change & CyCTS) && (info->flags & ASYNC_CTS_FLOW)) {
+               if (info->tty->hw_stopped) {
+                       if (mdm_status & CyCTS) {
+                               /* cy_start isn't used
+                                  because... !!! */
+                               info->tty->hw_stopped = 0;
+                               cy_writeb(base_addr + (CySRER << index),
+                                       readb(base_addr + (CySRER << index)) |
+                                               CyTxRdy);
+                               tty_wakeup(info->tty);
                        }
-/*                     if (mdm_change & CyDSR) {
+               } else {
+                       if (!(mdm_status & CyCTS)) {
+                               /* cy_stop isn't used
+                                  because ... !!! */
+                               info->tty->hw_stopped = 1;
+                               cy_writeb(base_addr + (CySRER << index),
+                                       readb(base_addr + (CySRER << index)) &
+                                               ~CyTxRdy);
                        }
-                       if (mdm_change & CyRI) {
-                       }*/
                }
-               /* end of service */
-               cy_writeb(base_addr + (CyMIR << index), (save_xir & 0x3f));
-               cy_writeb(base_addr + (CyCAR << index), save_car);
-               spin_unlock(&cinfo->card_lock);
        }
+/*     if (mdm_change & CyDSR) {
+       }
+       if (mdm_change & CyRI) {
+       }*/
+end:
+       /* end of service */
+       cy_writeb(base_addr + (CyMIR << index), save_xir & 0x3f);
+       cy_writeb(base_addr + (CyCAR << index), save_car);
 }
 
 /* The real interrupt service routine is called
@@ -1432,10 +1317,8 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
        int status;
        struct cyclades_card *cinfo = dev_id;
        void __iomem *base_addr, *card_base_addr;
-       int chip;
+       unsigned int chip, too_many, had_work;
        int index;
-       int too_many;
-       int had_work;
 
        if (unlikely(cinfo == NULL)) {
 #ifdef CY_DEBUG_INTERRUPTS
@@ -1470,11 +1353,16 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
                           chips to be checked in a round-robin fashion (after
                           draining each of a bunch (1000) of characters).
                         */
-                               if (1000 < too_many++) {
+                               if (1000 < too_many++)
                                        break;
-                               }
-                               cyy_intr_chip(cinfo, chip, base_addr, status,
-                                               index);
+                               spin_lock(&cinfo->card_lock);
+                               if (status & CySRReceive) /* rx intr */
+                                       cyy_chip_rx(cinfo, chip, base_addr);
+                               if (status & CySRTransmit) /* tx intr */
+                                       cyy_chip_tx(cinfo, chip, base_addr);
+                               if (status & CySRModem) /* modem intr */
+                                       cyy_chip_modem(cinfo, chip, base_addr);
+                               spin_unlock(&cinfo->card_lock);
                        }
                }
        } while (had_work);
@@ -1529,7 +1417,7 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
        struct ZFW_CTRL __iomem *zfw_ctrl;
        struct BOARD_CTRL __iomem *board_ctrl;
        __u32 __iomem *pci_doorbell;
-       int index;
+       unsigned int index;
 
        firm_id = cinfo->base_addr + ID_ADDRESS;
        if (!ISZLOADED(*cinfo)) {
@@ -1554,13 +1442,12 @@ cyz_issue_cmd(struct cyclades_card *cinfo,
        return 0;
 }                              /* cyz_issue_cmd */
 
-static void
-cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
+static void cyz_handle_rx(struct cyclades_port *info,
                struct BUF_CTRL __iomem *buf_ctrl)
 {
        struct cyclades_card *cinfo = info->card;
        struct tty_struct *tty = info->tty;
-       int char_count;
+       unsigned int char_count;
        int len;
 #ifdef BLOCKMOVE
        unsigned char *buf;
@@ -1633,9 +1520,11 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
                                char_count = rx_put - rx_get;
                        else
                                char_count = rx_put - rx_get + rx_bufsize;
-                       if (char_count >= (int)readl(&buf_ctrl->rx_threshold)) {
-                               cy_sched_event(info, Cy_EVENT_Z_RX_FULL);
-                       }
+                       if (char_count >= readl(&buf_ctrl->rx_threshold) &&
+                                       !timer_pending(&cyz_rx_full_timer[
+                                                       info->line]))
+                               mod_timer(&cyz_rx_full_timer[info->line],
+                                               jiffies + 1);
 #endif
                        info->idle_stats.recv_idle = jiffies;
                        tty_schedule_flip(tty);
@@ -1645,14 +1534,13 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
        }
 }
 
-static void
-cyz_handle_tx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
+static void cyz_handle_tx(struct cyclades_port *info,
                struct BUF_CTRL __iomem *buf_ctrl)
 {
        struct cyclades_card *cinfo = info->card;
        struct tty_struct *tty = info->tty;
-       char data;
-       int char_count;
+       u8 data;
+       unsigned int char_count;
 #ifdef BLOCKMOVE
        int small_count;
 #endif
@@ -1717,9 +1605,7 @@ cyz_handle_tx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl,
                }
 #endif
 ztxdone:
-               if (info->xmit_cnt < WAKEUP_CHARS) {
-                       cy_sched_event(info, Cy_EVENT_WRITE_WAKEUP);
-               }
+               tty_wakeup(tty);
                /* Update tx_put */
                cy_writel(&buf_ctrl->tx_put, tx_put);
        }
@@ -1781,10 +1667,11 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
                                if ((fw_ver > 241 ? ((u_long) param) :
                                                readl(&ch_ctrl->rs_status)) &
                                                C_RS_DCD) {
-                                       cy_sched_event(info,
-                                                       Cy_EVENT_OPEN_WAKEUP);
+                                       wake_up_interruptible(&info->open_wait);
                                } else {
-                                       cy_sched_event(info, Cy_EVENT_HANGUP);
+                                       tty_hangup(info->tty);
+                                       wake_up_interruptible(&info->open_wait);
+                                       info->flags &= ~ASYNC_NORMAL_ACTIVE;
                                }
                        }
                        break;
@@ -1802,7 +1689,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
                        break;
 #ifdef Z_WAKE
                case C_CM_IOCTLW:
-                       cy_sched_event(info, Cy_EVENT_SHUTDOWN_WAKEUP);
+                       complete(&info->shutdown_wait);
                        break;
 #endif
 #ifdef CONFIG_CYZ_INTR
@@ -1814,7 +1701,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
                        printk(KERN_DEBUG "cyz_interrupt: rcvd intr, card %d, "
                                        "port %ld\n", info->card, channel);
 #endif
-                       cyz_handle_rx(info, ch_ctrl, buf_ctrl);
+                       cyz_handle_rx(info, buf_ctrl);
                        break;
                case C_CM_TXBEMPTY:
                case C_CM_TXLOWWM:
@@ -1824,7 +1711,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
                        printk(KERN_DEBUG "cyz_interrupt: xmit intr, card %d, "
                                        "port %ld\n", info->card, channel);
 #endif
-                       cyz_handle_tx(info, ch_ctrl, buf_ctrl);
+                       cyz_handle_tx(info, buf_ctrl);
                        break;
 #endif                         /* CONFIG_CYZ_INTR */
                case C_CM_FATAL:
@@ -1834,7 +1721,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
                        break;
                }
                if (delta_count)
-                       cy_sched_event(info, Cy_EVENT_DELTA_WAKEUP);
+                       wake_up_interruptible(&info->delta_msr_wait);
                if (special_count)
                        tty_schedule_flip(tty);
        }
@@ -1893,10 +1780,9 @@ static void cyz_poll(unsigned long arg)
        struct FIRM_ID __iomem *firm_id;
        struct ZFW_CTRL __iomem *zfw_ctrl;
        struct BOARD_CTRL __iomem *board_ctrl;
-       struct CH_CTRL __iomem *ch_ctrl;
        struct BUF_CTRL __iomem *buf_ctrl;
        unsigned long expires = jiffies + HZ;
-       int card, port;
+       unsigned int port, card;
 
        for (card = 0; card < NR_CARDS; card++) {
                cinfo = &cy_card[card];
@@ -1923,12 +1809,11 @@ static void cyz_poll(unsigned long arg)
                for (port = 0; port < cinfo->nports; port++) {
                        info = &cinfo->ports[port];
                        tty = info->tty;
-                       ch_ctrl = &(zfw_ctrl->ch_ctrl[port]);
                        buf_ctrl = &(zfw_ctrl->buf_ctrl[port]);
 
                        if (!info->throttle)
-                               cyz_handle_rx(info, ch_ctrl, buf_ctrl);
-                       cyz_handle_tx(info, ch_ctrl, buf_ctrl);
+                               cyz_handle_rx(info, buf_ctrl);
+                       cyz_handle_tx(info, buf_ctrl);
                }
                /* poll every 'cyz_polling_cycle' period */
                expires = jiffies + cyz_polling_cycle;
@@ -2491,11 +2376,11 @@ block_til_ready(struct tty_struct *tty, struct file *filp,
 static int cy_open(struct tty_struct *tty, struct file *filp)
 {
        struct cyclades_port *info;
-       unsigned int i;
-       int retval, line;
+       unsigned int i, line;
+       int retval;
 
        line = tty->index;
-       if ((line < 0) || (NR_PORTS <= line)) {
+       if ((tty->index < 0) || (NR_PORTS <= line)) {
                return -ENODEV;
        }
        for (i = 0; i < NR_CARDS; i++)
@@ -2812,7 +2697,6 @@ static void cy_close(struct tty_struct *tty, struct file *filp)
        spin_lock_irqsave(&card->card_lock, flags);
 
        tty->closing = 0;
-       info->event = 0;
        info->tty = NULL;
        if (info->blocked_open) {
                spin_unlock_irqrestore(&card->card_lock, flags);
@@ -4444,7 +4328,6 @@ static void cy_hangup(struct tty_struct *tty)
 
        cy_flush_buffer(tty);
        shutdown(info);
-       info->event = 0;
        info->count = 0;
 #ifdef CY_DEBUG_COUNT
        printk(KERN_DEBUG "cyc:cy_hangup (%d): setting count to 0\n",
@@ -4467,9 +4350,9 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo)
 {
        struct cyclades_port *info;
        u32 uninitialized_var(mailbox);
-       unsigned int nports;
+       unsigned int nports, port;
        unsigned short chip_number;
-       int uninitialized_var(index), port;
+       int uninitialized_var(index);
 
        spin_lock_init(&cinfo->card_lock);
 
@@ -4502,7 +4385,6 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo)
                info->closing_wait = CLOSING_WAIT_DELAY;
                info->close_delay = 5 * HZ / 10;
 
-               INIT_WORK(&info->tqueue, do_softint);
                init_waitqueue_head(&info->open_wait);
                init_waitqueue_head(&info->close_wait);
                init_completion(&info->shutdown_wait);
@@ -5236,7 +5118,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,
                        }
                }
 #endif                         /* CONFIG_CYZ_INTR */
-               cy_card[card_no].num_chips = -1;
+               cy_card[card_no].num_chips = (unsigned int)-1;
        }
 
        /* set cy_card */
@@ -5480,13 +5362,13 @@ static int __init cy_init(void)
 #ifdef CONFIG_PCI
        /* look for pci boards */
        retval = pci_register_driver(&cy_pci_driver);
-       if (retval && !nboards)
-               goto err_unr;
+       if (retval && !nboards) {
+               tty_unregister_driver(cy_serial_driver);
+               goto err_frtty;
+       }
 #endif
 
        return 0;
-err_unr:
-       tty_unregister_driver(cy_serial_driver);
 err_frtty:
        put_tty_driver(cy_serial_driver);
 err:
@@ -5496,7 +5378,7 @@ err:
 static void __exit cy_cleanup_module(void)
 {
        struct cyclades_card *card;
-       int i, e1;
+       unsigned int i, e1;
 
 #ifndef CONFIG_CYZ_INTR
        del_timer_sync(&cyz_timerlist);
@@ -5524,8 +5406,7 @@ static void __exit cy_cleanup_module(void)
 #endif /* CONFIG_CYZ_INTR */
                                )
                                free_irq(card->irq, card);
-                       for (e1 = card->first_line;
-                                       e1 < card->first_line +
+                       for (e1 = card->first_line; e1 < card->first_line +
                                        card->nports; e1++)
                                tty_unregister_device(cy_serial_driver, e1);
                        kfree(card->ports);
index 8435fba73dafdcd8e847403e25dee71d2feee90c..5dc1265ce1d5b288c7049c9ecb305e72d223f618 100644 (file)
@@ -221,10 +221,8 @@ struct ipmi_smi
        void                     *send_info;
 
 #ifdef CONFIG_PROC_FS
-       /* A list of proc entries for this interface.  This does not
-          need a lock, only one thread creates it and only one thread
-          destroys it. */
-       spinlock_t             proc_entry_lock;
+       /* A list of proc entries for this interface. */
+       struct mutex           proc_entry_lock;
        struct ipmi_proc_entry *proc_entries;
 #endif
 
@@ -1891,11 +1889,11 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
                file->write_proc = write_proc;
                file->owner = owner;
 
-               spin_lock(&smi->proc_entry_lock);
+               mutex_lock(&smi->proc_entry_lock);
                /* Stick it on the list. */
                entry->next = smi->proc_entries;
                smi->proc_entries = entry;
-               spin_unlock(&smi->proc_entry_lock);
+               mutex_unlock(&smi->proc_entry_lock);
        }
 #endif /* CONFIG_PROC_FS */
 
@@ -1939,7 +1937,7 @@ static void remove_proc_entries(ipmi_smi_t smi)
 #ifdef CONFIG_PROC_FS
        struct ipmi_proc_entry *entry;
 
-       spin_lock(&smi->proc_entry_lock);
+       mutex_lock(&smi->proc_entry_lock);
        while (smi->proc_entries) {
                entry = smi->proc_entries;
                smi->proc_entries = entry->next;
@@ -1948,7 +1946,7 @@ static void remove_proc_entries(ipmi_smi_t smi)
                kfree(entry->name);
                kfree(entry);
        }
-       spin_unlock(&smi->proc_entry_lock);
+       mutex_unlock(&smi->proc_entry_lock);
        remove_proc_entry(smi->proc_dir_name, proc_ipmi_root);
 #endif /* CONFIG_PROC_FS */
 }
@@ -2614,6 +2612,14 @@ channel_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg)
        return;
 }
 
+void ipmi_poll_interface(ipmi_user_t user)
+{
+       ipmi_smi_t intf = user->intf;
+
+       if (intf->handlers->poll)
+               intf->handlers->poll(intf->send_info);
+}
+
 int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
                      void                     *send_info,
                      struct ipmi_device_id    *device_id,
@@ -2671,7 +2677,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
        }
        intf->curr_seq = 0;
 #ifdef CONFIG_PROC_FS
-       spin_lock_init(&intf->proc_entry_lock);
+       mutex_init(&intf->proc_entry_lock);
 #endif
        spin_lock_init(&intf->waiting_msgs_lock);
        INIT_LIST_HEAD(&intf->waiting_msgs);
@@ -4166,6 +4172,7 @@ EXPORT_SYMBOL(ipmi_destroy_user);
 EXPORT_SYMBOL(ipmi_get_version);
 EXPORT_SYMBOL(ipmi_request_settime);
 EXPORT_SYMBOL(ipmi_request_supply_msgs);
+EXPORT_SYMBOL(ipmi_poll_interface);
 EXPORT_SYMBOL(ipmi_register_smi);
 EXPORT_SYMBOL(ipmi_unregister_smi);
 EXPORT_SYMBOL(ipmi_register_for_cmd);
index c1222e98525dad9c19b9ac78c02255ea0f0579a3..4f560d0bb8089fa296dadeaee3a21bfb7a91b052 100644 (file)
@@ -675,7 +675,8 @@ static void handle_transaction_done(struct smi_info *smi_info)
 }
 
 /* Called on timeouts and events.  Timeouts should pass the elapsed
-   time, interrupts should pass in zero. */
+   time, interrupts should pass in zero.  Must be called with
+   si_lock held and interrupts disabled. */
 static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
                                           int time)
 {
@@ -892,13 +893,16 @@ static int ipmi_thread(void *data)
 static void poll(void *send_info)
 {
        struct smi_info *smi_info = send_info;
+       unsigned long flags;
 
        /*
         * Make sure there is some delay in the poll loop so we can
         * drive time forward and timeout things.
         */
        udelay(10);
+       spin_lock_irqsave(&smi_info->si_lock, flags);
        smi_event_handler(smi_info, 10);
+       spin_unlock_irqrestore(&smi_info->si_lock, flags);
 }
 
 static void request_events(void *send_info)
@@ -1006,6 +1010,10 @@ static int smi_start_processing(void       *send_info,
 
        new_smi->intf = intf;
 
+       /* Try to claim any interrupts. */
+       if (new_smi->irq_setup)
+               new_smi->irq_setup(new_smi);
+
        /* Set up the timer that drives the interface. */
        setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi);
        new_smi->last_timeout_jiffies = jiffies;
@@ -2372,20 +2380,9 @@ static int try_get_dev_id(struct smi_info *smi_info)
        /* Otherwise, we got some data. */
        resp_len = smi_info->handlers->get_result(smi_info->si_sm,
                                                  resp, IPMI_MAX_MSG_LENGTH);
-       if (resp_len < 14) {
-               /* That's odd, it should be longer. */
-               rv = -EINVAL;
-               goto out;
-       }
 
-       if ((resp[1] != IPMI_GET_DEVICE_ID_CMD) || (resp[2] != 0)) {
-               /* That's odd, it shouldn't be able to fail. */
-               rv = -EINVAL;
-               goto out;
-       }
-
-       /* Record info from the get device id, in case we need it. */
-       ipmi_demangle_device_id(resp+3, resp_len-3, &smi_info->device_id);
+       /* Check and record info from the get device id, in case we need it. */
+       rv = ipmi_demangle_device_id(resp, resp_len, &smi_info->device_id);
 
  out:
        kfree(resp);
@@ -2765,10 +2762,6 @@ static int try_smi_init(struct smi_info *new_smi)
        setup_oem_data_handler(new_smi);
        setup_xaction_handlers(new_smi);
 
-       /* Try to claim any interrupts. */
-       if (new_smi->irq_setup)
-               new_smi->irq_setup(new_smi);
-
        INIT_LIST_HEAD(&(new_smi->xmit_msgs));
        INIT_LIST_HEAD(&(new_smi->hp_xmit_msgs));
        new_smi->curr_msg = NULL;
index 41f78e2c158f453543ba8d315df7d0b580efa341..e686fc925168a16614cb41ed3932554f3217d3df 100644 (file)
 #include <linux/poll.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
+#include <linux/delay.h>
 #include <asm/atomic.h>
 
-#ifdef CONFIG_X86_LOCAL_APIC
-#include <asm/apic.h>
+#ifdef CONFIG_X86
+/* This is ugly, but I've determined that x86 is the only architecture
+   that can reasonably support the IPMI NMI watchdog timeout at this
+   time.  If another architecture adds this capability somehow, it
+   will have to be a somewhat different mechanism and I have no idea
+   how it will work.  So in the unlikely event that another
+   architecture supports this, we can figure out a good generic
+   mechanism for it at that time. */
+#include <asm/kdebug.h>
+#define HAVE_DIE_NMI
 #endif
 
 #define        PFX "IPMI Watchdog: "
@@ -166,8 +175,6 @@ static char expect_close;
 
 static int ifnum_to_use = -1;
 
-static DECLARE_RWSEM(register_sem);
-
 /* Parameters to ipmi_set_timeout */
 #define IPMI_SET_TIMEOUT_NO_HB                 0
 #define IPMI_SET_TIMEOUT_HB_IF_NECESSARY       1
@@ -193,11 +200,9 @@ static int set_param_int(const char *val, struct kernel_param *kp)
        if (endp == val)
                return -EINVAL;
 
-       down_read(&register_sem);
        *((int *)kp->arg) = l;
        if (watchdog_user)
                rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
-       up_read(&register_sem);
 
        return rv;
 }
@@ -226,17 +231,15 @@ static int set_param_str(const char *val, struct kernel_param *kp)
 
        s = strstrip(valcp);
 
-       down_read(&register_sem);
        rv = fn(s, NULL);
        if (rv)
-               goto out_unlock;
+               goto out;
 
        check_parms();
        if (watchdog_user)
                rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
 
- out_unlock:
-       up_read(&register_sem);
+ out:
        return rv;
 }
 
@@ -319,9 +322,12 @@ static unsigned char ipmi_version_minor;
 /* If a pretimeout occurs, this is used to allow only one panic to happen. */
 static atomic_t preop_panic_excl = ATOMIC_INIT(-1);
 
-static int ipmi_heartbeat(void);
-static void panic_halt_ipmi_heartbeat(void);
+#ifdef HAVE_DIE_NMI
+static int testing_nmi;
+static int nmi_handler_registered;
+#endif
 
+static int ipmi_heartbeat(void);
 
 /* We use a mutex to make sure that only one thing can send a set
    timeout at one time, because we only have one copy of the data.
@@ -360,6 +366,9 @@ static int i_ipmi_set_timeout(struct ipmi_smi_msg  *smi_msg,
        int                               hbnow = 0;
 
 
+       /* These can be cleared as we are setting the timeout. */
+       pretimeout_since_last_heartbeat = 0;
+
        data[0] = 0;
        WDOG_SET_TIMER_USE(data[0], WDOG_TIMER_USE_SMS_OS);
 
@@ -434,31 +443,75 @@ static int ipmi_set_timeout(int do_heartbeat)
 
        wait_for_completion(&set_timeout_wait);
 
+       mutex_unlock(&set_timeout_lock);
+
        if ((do_heartbeat == IPMI_SET_TIMEOUT_FORCE_HB)
            || ((send_heartbeat_now)
                && (do_heartbeat == IPMI_SET_TIMEOUT_HB_IF_NECESSARY)))
-       {
                rv = ipmi_heartbeat();
-       }
-       mutex_unlock(&set_timeout_lock);
 
 out:
        return rv;
 }
 
-static void dummy_smi_free(struct ipmi_smi_msg *msg)
+static atomic_t panic_done_count = ATOMIC_INIT(0);
+
+static void panic_smi_free(struct ipmi_smi_msg *msg)
 {
+       atomic_dec(&panic_done_count);
 }
-static void dummy_recv_free(struct ipmi_recv_msg *msg)
+static void panic_recv_free(struct ipmi_recv_msg *msg)
 {
+       atomic_dec(&panic_done_count);
+}
+
+static struct ipmi_smi_msg panic_halt_heartbeat_smi_msg =
+{
+       .done = panic_smi_free
+};
+static struct ipmi_recv_msg panic_halt_heartbeat_recv_msg =
+{
+       .done = panic_recv_free
+};
+
+static void panic_halt_ipmi_heartbeat(void)
+{
+       struct kernel_ipmi_msg             msg;
+       struct ipmi_system_interface_addr addr;
+       int rv;
+
+       /* Don't reset the timer if we have the timer turned off, that
+           re-enables the watchdog. */
+       if (ipmi_watchdog_state == WDOG_TIMEOUT_NONE)
+               return;
+
+       addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
+       addr.channel = IPMI_BMC_CHANNEL;
+       addr.lun = 0;
+
+       msg.netfn = 0x06;
+       msg.cmd = IPMI_WDOG_RESET_TIMER;
+       msg.data = NULL;
+       msg.data_len = 0;
+       rv = ipmi_request_supply_msgs(watchdog_user,
+                                     (struct ipmi_addr *) &addr,
+                                     0,
+                                     &msg,
+                                     NULL,
+                                     &panic_halt_heartbeat_smi_msg,
+                                     &panic_halt_heartbeat_recv_msg,
+                                     1);
+       if (!rv)
+               atomic_add(2, &panic_done_count);
 }
+
 static struct ipmi_smi_msg panic_halt_smi_msg =
 {
-       .done = dummy_smi_free
+       .done = panic_smi_free
 };
 static struct ipmi_recv_msg panic_halt_recv_msg =
 {
-       .done = dummy_recv_free
+       .done = panic_recv_free
 };
 
 /* Special call, doesn't claim any locks.  This is only to be called
@@ -470,13 +523,21 @@ static void panic_halt_ipmi_set_timeout(void)
        int send_heartbeat_now;
        int rv;
 
+       /* Wait for the messages to be free. */
+       while (atomic_read(&panic_done_count) != 0)
+               ipmi_poll_interface(watchdog_user);
        rv = i_ipmi_set_timeout(&panic_halt_smi_msg,
                                &panic_halt_recv_msg,
                                &send_heartbeat_now);
        if (!rv) {
+               atomic_add(2, &panic_done_count);
                if (send_heartbeat_now)
                        panic_halt_ipmi_heartbeat();
-       }
+       } else
+               printk(KERN_WARNING PFX
+                      "Unable to extend the watchdog timeout.");
+       while (atomic_read(&panic_done_count) != 0)
+               ipmi_poll_interface(watchdog_user);
 }
 
 /* We use a semaphore to make sure that only one thing can send a
@@ -505,24 +566,14 @@ static struct ipmi_recv_msg heartbeat_recv_msg =
        .done = heartbeat_free_recv
 };
  
-static struct ipmi_smi_msg panic_halt_heartbeat_smi_msg =
-{
-       .done = dummy_smi_free
-};
-static struct ipmi_recv_msg panic_halt_heartbeat_recv_msg =
-{
-       .done = dummy_recv_free
-};
 static int ipmi_heartbeat(void)
 {
        struct kernel_ipmi_msg            msg;
        int                               rv;
        struct ipmi_system_interface_addr addr;
 
-       if (ipmi_ignore_heartbeat) {
+       if (ipmi_ignore_heartbeat)
                return 0;
-       }
 
        if (ipmi_start_timer_on_heartbeat) {
                ipmi_start_timer_on_heartbeat = 0;
@@ -533,7 +584,6 @@ static int ipmi_heartbeat(void)
                   We don't want to set the action, though, we want to
                   leave that alone (thus it can't be combined with the
                   above operation. */
-               pretimeout_since_last_heartbeat = 0;
                return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
        }
 
@@ -586,35 +636,6 @@ static int ipmi_heartbeat(void)
        return rv;
 }
 
-static void panic_halt_ipmi_heartbeat(void)
-{
-       struct kernel_ipmi_msg             msg;
-       struct ipmi_system_interface_addr addr;
-
-
-       /* Don't reset the timer if we have the timer turned off, that
-           re-enables the watchdog. */
-       if (ipmi_watchdog_state == WDOG_TIMEOUT_NONE)
-               return;
-
-       addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
-       addr.channel = IPMI_BMC_CHANNEL;
-       addr.lun = 0;
-
-       msg.netfn = 0x06;
-       msg.cmd = IPMI_WDOG_RESET_TIMER;
-       msg.data = NULL;
-       msg.data_len = 0;
-       ipmi_request_supply_msgs(watchdog_user,
-                                (struct ipmi_addr *) &addr,
-                                0,
-                                &msg,
-                                NULL,
-                                &panic_halt_heartbeat_smi_msg,
-                                &panic_halt_heartbeat_recv_msg,
-                                1);
-}
-
 static struct watchdog_info ident =
 {
        .options        = 0,    /* WDIOF_SETTIMEOUT, */
@@ -895,7 +916,6 @@ static void ipmi_register_watchdog(int ipmi_intf)
 {
        int rv = -EBUSY;
 
-       down_write(&register_sem);
        if (watchdog_user)
                goto out;
 
@@ -921,15 +941,56 @@ static void ipmi_register_watchdog(int ipmi_intf)
                printk(KERN_CRIT PFX "Unable to register misc device\n");
        }
 
- out:
-       up_write(&register_sem);
+#ifdef HAVE_DIE_NMI
+       if (nmi_handler_registered) {
+               int old_pretimeout = pretimeout;
+               int old_timeout = timeout;
+               int old_preop_val = preop_val;
+
+               /* Set the pretimeout to go off in a second and give
+                  ourselves plenty of time to stop the timer. */
+               ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
+               preop_val = WDOG_PREOP_NONE; /* Make sure nothing happens */
+               pretimeout = 99;
+               timeout = 100;
+
+               testing_nmi = 1;
+
+               rv = ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
+               if (rv) {
+                       printk(KERN_WARNING PFX "Error starting timer to"
+                              " test NMI: 0x%x.  The NMI pretimeout will"
+                              " likely not work\n", rv);
+                       rv = 0;
+                       goto out_restore;
+               }
+
+               msleep(1500);
 
+               if (testing_nmi != 2) {
+                       printk(KERN_WARNING PFX "IPMI NMI didn't seem to"
+                              " occur.  The NMI pretimeout will"
+                              " likely not work\n");
+               }
+       out_restore:
+               testing_nmi = 0;
+               preop_val = old_preop_val;
+               pretimeout = old_pretimeout;
+               timeout = old_timeout;
+       }
+#endif
+
+ out:
        if ((start_now) && (rv == 0)) {
                /* Run from startup, so start the timer now. */
                start_now = 0; /* Disable this function after first startup. */
                ipmi_watchdog_state = action_val;
                ipmi_set_timeout(IPMI_SET_TIMEOUT_FORCE_HB);
                printk(KERN_INFO PFX "Starting now!\n");
+       } else {
+               /* Stop the timer now. */
+               ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
+               ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
        }
 }
 
@@ -937,8 +998,6 @@ static void ipmi_unregister_watchdog(int ipmi_intf)
 {
        int rv;
 
-       down_write(&register_sem);
-
        if (!watchdog_user)
                goto out;
 
@@ -963,20 +1022,44 @@ static void ipmi_unregister_watchdog(int ipmi_intf)
        watchdog_user = NULL;
 
  out:
-       up_write(&register_sem);
+       return;
 }
 
-#ifdef HAVE_NMI_HANDLER
+#ifdef HAVE_DIE_NMI
 static int
-ipmi_nmi(void *dev_id, int cpu, int handled)
+ipmi_nmi(struct notifier_block *self, unsigned long val, void *data)
 {
+       struct die_args *args = data;
+
+       if (val != DIE_NMI)
+               return NOTIFY_OK;
+
+       /* Hack, if it's a memory or I/O error, ignore it. */
+       if (args->err & 0xc0)
+               return NOTIFY_OK;
+
+       /*
+        * If we get here, it's an NMI that's not a memory or I/O
+        * error.  We can't truly tell if it's from IPMI or not
+        * without sending a message, and sending a message is almost
+        * impossible because of locking.
+        */
+
+       if (testing_nmi) {
+               testing_nmi = 2;
+               return NOTIFY_STOP;
+       }
+
         /* If we are not expecting a timeout, ignore it. */
        if (ipmi_watchdog_state == WDOG_TIMEOUT_NONE)
-               return NOTIFY_DONE;
+               return NOTIFY_OK;
+
+       if (preaction_val != WDOG_PRETIMEOUT_NMI)
+               return NOTIFY_OK;
 
        /* If no one else handled the NMI, we assume it was the IPMI
            watchdog. */
-       if ((!handled) && (preop_val == WDOG_PREOP_PANIC)) {
+       if (preop_val == WDOG_PREOP_PANIC) {
                /* On some machines, the heartbeat will give
                   an error and not work unless we re-enable
                   the timer.   So do so. */
@@ -985,18 +1068,12 @@ ipmi_nmi(void *dev_id, int cpu, int handled)
                        panic(PFX "pre-timeout");
        }
 
-       return NOTIFY_DONE;
+       return NOTIFY_STOP;
 }
 
-static struct nmi_handler ipmi_nmi_handler =
-{
-       .link     = LIST_HEAD_INIT(ipmi_nmi_handler.link),
-       .dev_name = "ipmi_watchdog",
-       .dev_id   = NULL,
-       .handler  = ipmi_nmi,
-       .priority = 0, /* Call us last. */
+static struct notifier_block ipmi_nmi_handler = {
+       .notifier_call = ipmi_nmi
 };
-int nmi_handler_registered;
 #endif
 
 static int wdog_reboot_handler(struct notifier_block *this,
@@ -1009,7 +1086,7 @@ static int wdog_reboot_handler(struct notifier_block *this,
                /* Make sure we only do this once. */
                reboot_event_handled = 1;
 
-               if (code == SYS_DOWN || code == SYS_HALT) {
+               if (code == SYS_POWER_OFF || code == SYS_HALT) {
                        /* Disable the WDT if we are shutting down. */
                        ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
                        panic_halt_ipmi_set_timeout();
@@ -1113,7 +1190,7 @@ static int preaction_op(const char *inval, char *outval)
                preaction_val = WDOG_PRETIMEOUT_NONE;
        else if (strcmp(inval, "pre_smi") == 0)
                preaction_val = WDOG_PRETIMEOUT_SMI;
-#ifdef HAVE_NMI_HANDLER
+#ifdef HAVE_DIE_NMI
        else if (strcmp(inval, "pre_nmi") == 0)
                preaction_val = WDOG_PRETIMEOUT_NMI;
 #endif
@@ -1147,7 +1224,7 @@ static int preop_op(const char *inval, char *outval)
 
 static void check_parms(void)
 {
-#ifdef HAVE_NMI_HANDLER
+#ifdef HAVE_DIE_NMI
        int do_nmi = 0;
        int rv;
 
@@ -1160,20 +1237,9 @@ static void check_parms(void)
                        preop_op("preop_none", NULL);
                        do_nmi = 0;
                }
-#ifdef CONFIG_X86_LOCAL_APIC
-               if (nmi_watchdog == NMI_IO_APIC) {
-                       printk(KERN_WARNING PFX "nmi_watchdog is set to IO APIC"
-                              " mode (value is %d), that is incompatible"
-                              " with using NMI in the IPMI watchdog."
-                              " Disabling IPMI nmi pretimeout.\n",
-                              nmi_watchdog);
-                       preaction_val = WDOG_PRETIMEOUT_NONE;
-                       do_nmi = 0;
-               }
-#endif
        }
        if (do_nmi && !nmi_handler_registered) {
-               rv = request_nmi(&ipmi_nmi_handler);
+               rv = register_die_notifier(&ipmi_nmi_handler);
                if (rv) {
                        printk(KERN_WARNING PFX
                               "Can't register nmi handler\n");
@@ -1181,7 +1247,7 @@ static void check_parms(void)
                } else
                        nmi_handler_registered = 1;
        } else if (!do_nmi && nmi_handler_registered) {
-               release_nmi(&ipmi_nmi_handler);
+               unregister_die_notifier(&ipmi_nmi_handler);
                nmi_handler_registered = 0;
        }
 #endif
@@ -1217,9 +1283,9 @@ static int __init ipmi_wdog_init(void)
 
        rv = ipmi_smi_watcher_register(&smi_watcher);
        if (rv) {
-#ifdef HAVE_NMI_HANDLER
-               if (preaction_val == WDOG_PRETIMEOUT_NMI)
-                       release_nmi(&ipmi_nmi_handler);
+#ifdef HAVE_DIE_NMI
+               if (nmi_handler_registered)
+                       unregister_die_notifier(&ipmi_nmi_handler);
 #endif
                atomic_notifier_chain_unregister(&panic_notifier_list,
                                                 &wdog_panic_notifier);
@@ -1238,9 +1304,9 @@ static void __exit ipmi_wdog_exit(void)
        ipmi_smi_watcher_unregister(&smi_watcher);
        ipmi_unregister_watchdog(watchdog_ifnum);
 
-#ifdef HAVE_NMI_HANDLER
+#ifdef HAVE_DIE_NMI
        if (nmi_handler_registered)
-               release_nmi(&ipmi_nmi_handler);
+               unregister_die_notifier(&ipmi_nmi_handler);
 #endif
 
        atomic_notifier_chain_unregister(&panic_notifier_list,
index 77a7a4a06620e239b9c72f7b6f726f2908732aa0..85d596a3c18c35b7248b4ee98fcaba65c60abcf0 100644 (file)
@@ -1529,7 +1529,7 @@ static int __devinit reset_card(struct pci_dev *pdev,
        portcount = inw(base + 0x2);
        if (!inw(base + 0xe) & 0x1 || (portcount != 0 && portcount != 4 &&
                                portcount != 8 && portcount != 16)) {
-               dev_err(&pdev->dev, "ISILoad:PCI Card%d reset failure.",
+               dev_err(&pdev->dev, "ISILoad:PCI Card%d reset failure.\n",
                        card + 1);
                retval = -EIO;
                goto end;
@@ -1622,7 +1622,9 @@ static int __devinit load_firmware(struct pci_dev *pdev,
 
                if ((status = inw(base + 0x4)) != 0) {
                        dev_warn(&pdev->dev, "Card%d rejected load header:\n"
-                               "Address:0x%x\nCount:0x%x\nStatus:0x%x\n",
+                               KERN_WARNING "Address:0x%x\n"
+                               KERN_WARNING "Count:0x%x\n"
+                               KERN_WARNING "Status:0x%x\n",
                                index + 1, frame->addr, frame->count, status);
                        goto errrelfw;
                }
@@ -1666,7 +1668,9 @@ static int __devinit load_firmware(struct pci_dev *pdev,
 
                if ((status = inw(base + 0x4)) != 0) {
                        dev_warn(&pdev->dev, "Card%d rejected verify header:\n"
-                               "Address:0x%x\nCount:0x%x\nStatus: 0x%x\n",
+                               KERN_WARNING "Address:0x%x\n"
+                               KERN_WARNING "Count:0x%x\n"
+                               KERN_WARNING "Status: 0x%x\n",
                                index + 1, frame->addr, frame->count, status);
                        goto errrelfw;
                }
index ed76f0a127fd759c1679a908681c25fcdfc15064..2fc255a21486321acc7c70fb40c40e814bf10918 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/completion.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -142,7 +143,7 @@ struct moxa_port {
        struct tty_struct *tty;
        int cflag;
        wait_queue_head_t open_wait;
-       wait_queue_head_t close_wait;
+       struct completion close_wait;
 
        struct timer_list emptyTimer;
 
@@ -166,7 +167,6 @@ struct moxa_port {
 
 #define WAKEUP_CHARS           256
 
-static int verbose = 0;
 static int ttymajor = MOXAMAJOR;
 /* Variables for insmod */
 #ifdef MODULE
@@ -184,7 +184,6 @@ module_param_array(baseaddr, int, NULL, 0);
 module_param_array(numports, int, NULL, 0);
 #endif
 module_param(ttymajor, int, 0);
-module_param(verbose, bool, 0644);
 
 /*
  * static functions:
@@ -208,13 +207,13 @@ static int moxa_tiocmget(struct tty_struct *tty, struct file *file);
 static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
                         unsigned int set, unsigned int clear);
 static void moxa_poll(unsigned long);
-static void set_tty_param(struct tty_struct *);
-static int block_till_ready(struct tty_struct *, struct file *,
+static void moxa_set_tty_param(struct tty_struct *);
+static int moxa_block_till_ready(struct tty_struct *, struct file *,
                            struct moxa_port *);
-static void setup_empty_event(struct tty_struct *);
-static void check_xmit_empty(unsigned long);
-static void shut_down(struct moxa_port *);
-static void receive_data(struct moxa_port *);
+static void moxa_setup_empty_event(struct tty_struct *);
+static void moxa_check_xmit_empty(unsigned long);
+static void moxa_shut_down(struct moxa_port *);
+static void moxa_receive_data(struct moxa_port *);
 /*
  * moxa board interface functions:
  */
@@ -283,8 +282,10 @@ static int __devinit moxa_pci_probe(struct pci_dev *pdev,
        int retval;
 
        retval = pci_enable_device(pdev);
-       if (retval)
+       if (retval) {
+               dev_err(&pdev->dev, "can't enable pci device\n");
                goto err;
+       }
 
        for (i = 0; i < MAX_BOARDS; i++)
                if (moxa_boards[i].basemem == NULL)
@@ -292,16 +293,17 @@ static int __devinit moxa_pci_probe(struct pci_dev *pdev,
 
        retval = -ENODEV;
        if (i >= MAX_BOARDS) {
-               if (verbose)
-                       printk("More than %d MOXA Intellio family boards "
+               dev_warn(&pdev->dev, "more than %u MOXA Intellio family boards "
                                "found. Board is ignored.\n", MAX_BOARDS);
                goto err;
        }
 
        board = &moxa_boards[i];
        board->basemem = pci_iomap(pdev, 2, 0x4000);
-       if (board->basemem == NULL)
+       if (board->basemem == NULL) {
+               dev_err(&pdev->dev, "can't remap io space 2\n");
                goto err;
+       }
 
        board->boardType = board_type;
        switch (board_type) {
@@ -347,7 +349,8 @@ static int __init moxa_init(void)
        int i, numBoards, retval = 0;
        struct moxa_port *ch;
 
-       printk(KERN_INFO "MOXA Intellio family driver version %s\n", MOXA_VERSION);
+       printk(KERN_INFO "MOXA Intellio family driver version %s\n",
+                       MOXA_VERSION);
        moxaDriver = alloc_tty_driver(MAX_PORTS + 1);
        if (!moxaDriver)
                return -ENOMEM;
@@ -372,13 +375,13 @@ static int __init moxa_init(void)
                ch->closing_wait = 30 * HZ;
                ch->cflag = B9600 | CS8 | CREAD | CLOCAL | HUPCL;
                init_waitqueue_head(&ch->open_wait);
-               init_waitqueue_head(&ch->close_wait);
+               init_completion(&ch->close_wait);
 
-               setup_timer(&ch->emptyTimer, check_xmit_empty,
+               setup_timer(&ch->emptyTimer, moxa_check_xmit_empty,
                                (unsigned long)ch);
        }
 
-       printk("Tty devices major number = %d\n", ttymajor);
+       pr_debug("Moxa tty devices major number = %d\n", ttymajor);
 
        if (tty_register_driver(moxaDriver)) {
                printk(KERN_ERR "Couldn't install MOXA Smartio family driver !\n");
@@ -400,11 +403,10 @@ static int __init moxa_init(void)
                                moxa_boards[numBoards].numPorts = moxa_isa_boards[i].numPorts;
                        moxa_boards[numBoards].busType = MOXA_BUS_TYPE_ISA;
                        moxa_boards[numBoards].baseAddr = moxa_isa_boards[i].baseAddr;
-                       if (verbose)
-                               printk("Board %2d: %s board(baseAddr=%lx)\n",
-                                      numBoards + 1,
-                                      moxa_brdname[moxa_boards[numBoards].boardType - 1],
-                                      moxa_boards[numBoards].baseAddr);
+                       pr_debug("Moxa board %2d: %s board(baseAddr=%lx)\n",
+                              numBoards + 1,
+                              moxa_brdname[moxa_boards[numBoards].boardType-1],
+                              moxa_boards[numBoards].baseAddr);
                        numBoards++;
                }
        }
@@ -413,14 +415,13 @@ static int __init moxa_init(void)
        for (i = 0; i < MAX_BOARDS; i++) {
                if ((type[i] == MOXA_BOARD_C218_ISA) ||
                    (type[i] == MOXA_BOARD_C320_ISA)) {
-                       if (verbose)
-                               printk("Board %2d: %s board(baseAddr=%lx)\n",
-                                      numBoards + 1,
-                                      moxa_brdname[type[i] - 1],
-                                      (unsigned long) baseaddr[i]);
+                       pr_debug("Moxa board %2d: %s board(baseAddr=%lx)\n",
+                              numBoards + 1, moxa_brdname[type[i] - 1],
+                              (unsigned long)baseaddr[i]);
                        if (numBoards >= MAX_BOARDS) {
-                               if (verbose)
-                                       printk("More than %d MOXA Intellio family boards found. Board is ignored.", MAX_BOARDS);
+                               printk(KERN_WARNING "More than %d MOXA "
+                                       "Intellio family boards found. Board "
+                                       "is ignored.\n", MAX_BOARDS);
                                continue;
                        }
                        moxa_boards[numBoards].boardType = type[i];
@@ -456,16 +457,14 @@ static void __exit moxa_exit(void)
 {
        int i;
 
-       if (verbose)
-               printk("Unloading module moxa ...\n");
-
        del_timer_sync(&moxaTimer);
 
        for (i = 0; i < MAX_PORTS; i++)
                del_timer_sync(&moxa_ports[i].emptyTimer);
 
        if (tty_unregister_driver(moxaDriver))
-               printk("Couldn't unregister MOXA Intellio family serial driver\n");
+               printk(KERN_ERR "Couldn't unregister MOXA Intellio family "
+                               "serial driver\n");
        put_tty_driver(moxaDriver);
 
 #ifdef CONFIG_PCI
@@ -475,9 +474,6 @@ static void __exit moxa_exit(void)
        for (i = 0; i < MAX_BOARDS; i++)
                if (moxa_boards[i].basemem)
                        iounmap(moxa_boards[i].basemem);
-
-       if (verbose)
-               printk("Done\n");
 }
 
 module_init(moxa_init);
@@ -504,12 +500,12 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
        ch->tty = tty;
        if (!(ch->asyncflags & ASYNC_INITIALIZED)) {
                ch->statusflags = 0;
-               set_tty_param(tty);
+               moxa_set_tty_param(tty);
                MoxaPortLineCtrl(ch->port, 1, 1);
                MoxaPortEnable(ch->port);
                ch->asyncflags |= ASYNC_INITIALIZED;
        }
-       retval = block_till_ready(tty, filp, ch);
+       retval = moxa_block_till_ready(tty, filp, ch);
 
        moxa_unthrottle(tty);
 
@@ -532,9 +528,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
                return;
        }
        if (!MoxaPortIsValid(port)) {
-#ifdef SERIAL_DEBUG_CLOSE
-               printk("Invalid portno in moxa_close\n");
-#endif
+               pr_debug("Invalid portno in moxa_close\n");
                tty->driver_data = NULL;
                return;
        }
@@ -547,13 +541,13 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
        ch = (struct moxa_port *) tty->driver_data;
 
        if ((tty->count == 1) && (ch->count != 1)) {
-               printk("moxa_close: bad serial port count; tty->count is 1, "
-                      "ch->count is %d\n", ch->count);
+               printk(KERN_WARNING "moxa_close: bad serial port count; "
+                       "tty->count is 1, ch->count is %d\n", ch->count);
                ch->count = 1;
        }
        if (--ch->count < 0) {
-               printk("moxa_close: bad serial port count, device=%s\n",
-                      tty->name);
+               printk(KERN_WARNING "moxa_close: bad serial port count, "
+                       "device=%s\n", tty->name);
                ch->count = 0;
        }
        if (ch->count) {
@@ -563,11 +557,11 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
 
        ch->cflag = tty->termios->c_cflag;
        if (ch->asyncflags & ASYNC_INITIALIZED) {
-               setup_empty_event(tty);
+               moxa_setup_empty_event(tty);
                tty_wait_until_sent(tty, 30 * HZ);      /* 30 seconds timeout */
                del_timer_sync(&moxa_ports[ch->port].emptyTimer);
        }
-       shut_down(ch);
+       moxa_shut_down(ch);
        MoxaPortFlushData(port, 2);
 
        if (tty->driver->flush_buffer)
@@ -584,7 +578,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
                wake_up_interruptible(&ch->open_wait);
        }
        ch->asyncflags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_CLOSING);
-       wake_up_interruptible(&ch->close_wait);
+       complete_all(&ch->close_wait);
 }
 
 static int moxa_write(struct tty_struct *tty,
@@ -653,7 +647,7 @@ static int moxa_chars_in_buffer(struct tty_struct *tty)
                 * in tty_ioctl.c, etc.
                 */
                if (!(ch->statusflags & EMPTYWAIT))
-                       setup_empty_event(tty);
+                       moxa_setup_empty_event(tty);
        }
        return (chars);
 }
@@ -751,7 +745,7 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
                retval = tty_check_change(tty);
                if (retval)
                        return (retval);
-               setup_empty_event(tty);
+               moxa_setup_empty_event(tty);
                tty_wait_until_sent(tty, 0);
                if (!arg)
                        MoxaPortSendBreak(ch->port, 0);
@@ -760,7 +754,7 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
                retval = tty_check_change(tty);
                if (retval)
                        return (retval);
-               setup_empty_event(tty);
+               moxa_setup_empty_event(tty);
                tty_wait_until_sent(tty, 0);
                MoxaPortSendBreak(ch->port, arg);
                return (0);
@@ -809,7 +803,7 @@ static void moxa_set_termios(struct tty_struct *tty,
 
        if (ch == NULL)
                return;
-       set_tty_param(tty);
+       moxa_set_tty_param(tty);
        if (!(old_termios->c_cflag & CLOCAL) &&
            (tty->termios->c_cflag & CLOCAL))
                wake_up_interruptible(&ch->open_wait);
@@ -845,7 +839,7 @@ static void moxa_hangup(struct tty_struct *tty)
        struct moxa_port *ch = (struct moxa_port *) tty->driver_data;
 
        moxa_flush_buffer(tty);
-       shut_down(ch);
+       moxa_shut_down(ch);
        ch->event = 0;
        ch->count = 0;
        ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE;
@@ -875,7 +869,7 @@ static void moxa_poll(unsigned long ignored)
                                continue;
                        if (!(ch->statusflags & THROTTLE) &&
                            (MoxaPortRxQueue(ch->port) > 0))
-                               receive_data(ch);
+                               moxa_receive_data(ch);
                        if ((tp = ch->tty) == 0)
                                continue;
                        if (ch->statusflags & LOWWAIT) {
@@ -909,7 +903,7 @@ static void moxa_poll(unsigned long ignored)
 
 /******************************************************************************/
 
-static void set_tty_param(struct tty_struct *tty)
+static void moxa_set_tty_param(struct tty_struct *tty)
 {
        register struct ktermios *ts;
        struct moxa_port *ch;
@@ -934,7 +928,7 @@ static void set_tty_param(struct tty_struct *tty)
        MoxaPortSetTermio(ch->port, ts, tty_get_baud_rate(tty));
 }
 
-static int block_till_ready(struct tty_struct *tty, struct file *filp,
+static int moxa_block_till_ready(struct tty_struct *tty, struct file *filp,
                            struct moxa_port *ch)
 {
        DECLARE_WAITQUEUE(wait,current);
@@ -948,7 +942,7 @@ static int block_till_ready(struct tty_struct *tty, struct file *filp,
         */
        if (tty_hung_up_p(filp) || (ch->asyncflags & ASYNC_CLOSING)) {
                if (ch->asyncflags & ASYNC_CLOSING)
-                       interruptible_sleep_on(&ch->close_wait);
+                       wait_for_completion_interruptible(&ch->close_wait);
 #ifdef SERIAL_DO_RESTART
                if (ch->asyncflags & ASYNC_HUP_NOTIFY)
                        return (-EAGAIN);
@@ -971,10 +965,8 @@ static int block_till_ready(struct tty_struct *tty, struct file *filp,
         */
        retval = 0;
        add_wait_queue(&ch->open_wait, &wait);
-#ifdef SERIAL_DEBUG_OPEN
-       printk("block_til_ready before block: ttys%d, count = %d\n",
-              ch->line, ch->count);
-#endif
+       pr_debug("block_til_ready before block: ttys%d, count = %d\n",
+               ch->port, ch->count);
        spin_lock_irqsave(&moxa_lock, flags);
        if (!tty_hung_up_p(filp))
                ch->count--;
@@ -1013,10 +1005,8 @@ static int block_till_ready(struct tty_struct *tty, struct file *filp,
                ch->count++;
        ch->blocked_open--;
        spin_unlock_irqrestore(&moxa_lock, flags);
-#ifdef SERIAL_DEBUG_OPEN
-       printk("block_til_ready after blocking: ttys%d, count = %d\n",
-              ch->line, ch->count);
-#endif
+       pr_debug("block_til_ready after blocking: ttys%d, count = %d\n",
+               ch->port, ch->count);
        if (retval)
                return (retval);
        /* FIXME: review to see if we need to use set_bit on these */
@@ -1024,7 +1014,7 @@ static int block_till_ready(struct tty_struct *tty, struct file *filp,
        return 0;
 }
 
-static void setup_empty_event(struct tty_struct *tty)
+static void moxa_setup_empty_event(struct tty_struct *tty)
 {
        struct moxa_port *ch = tty->driver_data;
        unsigned long flags;
@@ -1035,24 +1025,24 @@ static void setup_empty_event(struct tty_struct *tty)
        spin_unlock_irqrestore(&moxa_lock, flags);
 }
 
-static void check_xmit_empty(unsigned long data)
+static void moxa_check_xmit_empty(unsigned long data)
 {
        struct moxa_port *ch;
 
        ch = (struct moxa_port *) data;
-       del_timer_sync(&moxa_ports[ch->port].emptyTimer);
        if (ch->tty && (ch->statusflags & EMPTYWAIT)) {
                if (MoxaPortTxQueue(ch->port) == 0) {
                        ch->statusflags &= ~EMPTYWAIT;
                        tty_wakeup(ch->tty);
                        return;
                }
-               mod_timer(&moxa_ports[ch->port].emptyTimer, jiffies + HZ);
+               mod_timer(&moxa_ports[ch->port].emptyTimer,
+                               round_jiffies(jiffies + HZ));
        } else
                ch->statusflags &= ~EMPTYWAIT;
 }
 
-static void shut_down(struct moxa_port *ch)
+static void moxa_shut_down(struct moxa_port *ch)
 {
        struct tty_struct *tp;
 
@@ -1072,7 +1062,7 @@ static void shut_down(struct moxa_port *ch)
        ch->asyncflags &= ~ASYNC_INITIALIZED;
 }
 
-static void receive_data(struct moxa_port *ch)
+static void moxa_receive_data(struct moxa_port *ch)
 {
        struct tty_struct *tp;
        struct ktermios *ts;
@@ -1406,8 +1396,8 @@ static struct mon_str moxaLog;
 static int moxaFuncTout = HZ / 2;
 
 static void moxafunc(void __iomem *, int, ushort);
-static void wait_finish(void __iomem *);
-static void low_water_check(void __iomem *);
+static void moxa_wait_finish(void __iomem *);
+static void moxa_low_water_check(void __iomem *);
 static int moxaloadbios(int, unsigned char __user *, int);
 static int moxafindcard(int);
 static int moxaload320b(int, unsigned char __user *, int);
@@ -1473,7 +1463,7 @@ void MoxaPortFlushData(int port, int mode)
        moxafunc(ofsAddr, FC_FlushQueue, mode);
        if (mode != 1) {
                moxa_ports[port].lowChkFlag = 0;
-               low_water_check(ofsAddr);
+               moxa_low_water_check(ofsAddr);
        }
 }
 
@@ -1654,7 +1644,7 @@ int MoxaDriverPoll(void)
                                if (moxa_ports[p].lowChkFlag) {
                                        moxa_ports[p].lowChkFlag = 0;
                                        ofsAddr = moxa_ports[p].tableAddr;
-                                       low_water_check(ofsAddr);
+                                       moxa_low_water_check(ofsAddr);
                                }
                        }
                }
@@ -2081,7 +2071,7 @@ int MoxaPortSetTermio(int port, struct ktermios *termio, speed_t baud)
                writeb(termio->c_cc[VSTART], ofsAddr + FuncArg);
                writeb(termio->c_cc[VSTOP], ofsAddr + FuncArg1);
                writeb(FC_SetXonXoff, ofsAddr + FuncCode);
-               wait_finish(ofsAddr);
+               moxa_wait_finish(ofsAddr);
 
        }
        return (0);
@@ -2480,10 +2470,10 @@ static void moxafunc(void __iomem *ofsAddr, int cmd, ushort arg)
 
        writew(arg, ofsAddr + FuncArg);
        writew(cmd, ofsAddr + FuncCode);
-       wait_finish(ofsAddr);
+       moxa_wait_finish(ofsAddr);
 }
 
-static void wait_finish(void __iomem *ofsAddr)
+static void moxa_wait_finish(void __iomem *ofsAddr)
 {
        unsigned long i, j;
 
@@ -2496,7 +2486,7 @@ static void wait_finish(void __iomem *ofsAddr)
        }
 }
 
-static void low_water_check(void __iomem *ofsAddr)
+static void moxa_low_water_check(void __iomem *ofsAddr)
 {
        int len;
        ushort rptr, wptr, mask;
index 2aee3fef0416cc6d689b428371761d12504afd01..661aca0e155da9a7140605069f52637abd1faa18 100644 (file)
@@ -383,7 +383,6 @@ static int mxser_init(void);
 
 /* static void   mxser_poll(unsigned long); */
 static int mxser_get_ISA_conf(int, struct mxser_hwconf *);
-static int mxser_get_PCI_conf(int, int, int, struct mxser_hwconf *);
 static void mxser_do_softint(struct work_struct *);
 static int mxser_open(struct tty_struct *, struct file *);
 static void mxser_close(struct tty_struct *, struct file *);
@@ -422,7 +421,7 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout);
 static void mxser_startrx(struct tty_struct *tty);
 static void mxser_stoprx(struct tty_struct *tty);
 
-
+#ifdef CONFIG_PCI
 static int CheckIsMoxaMust(int io)
 {
        u8 oldmcr, hwid;
@@ -445,6 +444,7 @@ static int CheckIsMoxaMust(int io)
        }
        return MOXA_OTHER_UART;
 }
+#endif
 
 /* above is modified by Victor Yu. 08-15-2002 */
 
@@ -1938,14 +1938,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
                                inb(info->base + UART_MSR);
                                continue;
                        }
-                       /* above add by Victor Yu. 09-13-2002 */
-                       /*
-                          if (info->tty->flip.count < TTY_FLIPBUF_SIZE / 4) {
-                          info->IER |= MOXA_MUST_RECV_ISR;
-                          outb(info->IER, info->base + UART_IER);
-                          }
-                        */
-
 
                        /* mask by Victor Yu. 09-13-2002
                           if ( !info->tty ||
@@ -2599,19 +2591,8 @@ static int mxser_change_speed(struct mxser_struct *info, struct ktermios *old_te
                info->IER |= UART_IER_MSI;
                if ((info->type == PORT_16550A) || (info->IsMoxaMustChipFlag)) {
                        info->MCR |= UART_MCR_AFE;
-                       /* status = mxser_get_msr(info->base, 0, info->port); */
-/*
-       save_flags(flags);
-       cli();
-       status = inb(baseaddr + UART_MSR);
-       restore_flags(flags);
-*/
-                       /* mxser_check_modem_status(info, status); */
                } else {
-                       /* status = mxser_get_msr(info->base, 0, info->port); */
-                       /* MX_LOCK(&info->slock); */
                        status = inb(info->base + UART_MSR);
-                       /* MX_UNLOCK(&info->slock); */
                        if (info->tty->hw_stopped) {
                                if (status & UART_MSR_CTS) {
                                        info->tty->hw_stopped = 0;
index 6a563932ba191f31efbec7e1f4d088dc1ef44fb3..854dbf59eb68b036b82afab1e77dd58257a86e79 100644 (file)
@@ -2,7 +2,7 @@
  *          mxser.c  -- MOXA Smartio/Industio family multiport serial driver.
  *
  *      Copyright (C) 1999-2006  Moxa Technologies (support@moxa.com.tw).
- *     Copyright (C) 2006       Jiri Slaby <jirislaby@gmail.com>
+ *     Copyright (C) 2006-2007  Jiri Slaby <jirislaby@gmail.com>
  *
  *      This code is loosely based on the 1.8 moxa driver which is based on
  *     Linux serial driver, written by Linus Torvalds, Theodore T'so and
@@ -48,7 +48,7 @@
 
 #include "mxser_new.h"
 
-#define        MXSER_VERSION   "2.0.1"         /* 1.9.15 */
+#define        MXSER_VERSION   "2.0.2"         /* 1.10 */
 #define        MXSERMAJOR       174
 #define        MXSERCUMAJOR     175
 
 #define UART_MCR_AFE           0x20
 #define UART_LSR_SPECIAL       0x1E
 
+#define PCI_DEVICE_ID_CB108    0x1080
+#define PCI_DEVICE_ID_CB114    0x1142
+#define PCI_DEVICE_ID_CB134I   0x1341
+#define PCI_DEVICE_ID_CP138U   0x1380
+#define PCI_DEVICE_ID_POS104UL 0x1044
+
 
 #define C168_ASIC_ID    1
 #define C104_ASIC_ID    2
@@ -107,71 +113,63 @@ struct mxser_cardinfo {
 };
 
 static const struct mxser_cardinfo mxser_cards[] = {
-       { 8, "C168 series", },                  /* C168-ISA */
-       { 4, "C104 series", },                  /* C104-ISA */
-       { 4, "CI-104J series", },               /* CI104J */
-       { 8, "C168H/PCI series", },             /* C168-PCI */
-       { 4, "C104H/PCI series", },             /* C104-PCI */
-       { 4, "C102 series", MXSER_HAS2 },       /* C102-ISA */
-       { 4, "CI-132 series", MXSER_HAS2 },     /* CI132 */
-       { 4, "CI-134 series", },                /* CI134 */
-       { 2, "CP-132 series", },                /* CP132 */
-       { 4, "CP-114 series", },                /* CP114 */
-       { 4, "CT-114 series", },                /* CT114 */
-       { 2, "CP-102 series", MXSER_HIGHBAUD }, /* CP102 */
-       { 4, "CP-104U series", },               /* CP104U */
-       { 8, "CP-168U series", },               /* CP168U */
-       { 2, "CP-132U series", },               /* CP132U */
-       { 4, "CP-134U series", },               /* CP134U */
-       { 4, "CP-104JU series", },              /* CP104JU */
+/* 0*/ { 8, "C168 series", },
+       { 4, "C104 series", },
+       { 4, "CI-104J series", },
+       { 8, "C168H/PCI series", },
+       { 4, "C104H/PCI series", },
+/* 5*/ { 4, "C102 series", MXSER_HAS2 },       /* C102-ISA */
+       { 4, "CI-132 series", MXSER_HAS2 },
+       { 4, "CI-134 series", },
+       { 2, "CP-132 series", },
+       { 4, "CP-114 series", },
+/*10*/ { 4, "CT-114 series", },
+       { 2, "CP-102 series", MXSER_HIGHBAUD },
+       { 4, "CP-104U series", },
+       { 8, "CP-168U series", },
+       { 2, "CP-132U series", },
+/*15*/ { 4, "CP-134U series", },
+       { 4, "CP-104JU series", },
        { 8, "Moxa UC7000 Serial", },           /* RC7000 */
-       { 8, "CP-118U series", },               /* CP118U */
-       { 2, "CP-102UL series", },              /* CP102UL */
-       { 2, "CP-102U series", },               /* CP102U */
-       { 8, "CP-118EL series", },              /* CP118EL */
-       { 8, "CP-168EL series", },              /* CP168EL */
-       { 4, "CP-104EL series", }               /* CP104EL */
+       { 8, "CP-118U series", },
+       { 2, "CP-102UL series", },
+/*20*/ { 2, "CP-102U series", },
+       { 8, "CP-118EL series", },
+       { 8, "CP-168EL series", },
+       { 4, "CP-104EL series", },
+       { 8, "CB-108 series", },
+/*25*/ { 4, "CB-114 series", },
+       { 4, "CB-134I series", },
+       { 8, "CP-138U series", },
+       { 4, "POS-104UL series", }
 };
 
 /* driver_data correspond to the lines in the structure above
    see also ISA probe function before you change something */
 static struct pci_device_id mxser_pcibrds[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_C168),
-               .driver_data = 3 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_C104),
-               .driver_data = 4 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP132),
-               .driver_data = 8 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP114),
-               .driver_data = 9 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CT114),
-               .driver_data = 10 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP102),
-               .driver_data = 11 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP104U),
-               .driver_data = 12 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP168U),
-               .driver_data = 13 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP132U),
-               .driver_data = 14 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP134U),
-               .driver_data = 15 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP104JU),
-               .driver_data = 16 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_RC7000),
-               .driver_data = 17 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP118U),
-               .driver_data = 18 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP102UL),
-               .driver_data = 19 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP102U),
-               .driver_data = 20 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP118EL),
-               .driver_data = 21 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP168EL),
-               .driver_data = 22 },
-       { PCI_DEVICE(PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_MOXA_CP104EL),
-               .driver_data = 23 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_C168),   .driver_data = 3 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_C104),   .driver_data = 4 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132),  .driver_data = 8 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP114),  .driver_data = 9 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CT114),  .driver_data = 10 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102),  .driver_data = 11 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104U), .driver_data = 12 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP168U), .driver_data = 13 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132U), .driver_data = 14 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP134U), .driver_data = 15 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104JU),.driver_data = 16 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_RC7000), .driver_data = 17 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP118U), .driver_data = 18 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102UL),.driver_data = 19 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102U), .driver_data = 20 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP118EL),.driver_data = 21 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP168EL),.driver_data = 22 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104EL),.driver_data = 23 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CB108),       .driver_data = 24 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CB114),       .driver_data = 25 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CB134I),      .driver_data = 26 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_CP138U),      .driver_data = 27 },
+       { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_POS104UL),    .driver_data = 28 },
        { }
 };
 MODULE_DEVICE_TABLE(pci, mxser_pcibrds);
index 73de77105fea9c9a58c8ed704fab7626b2bfb2d1..706ff34728f19382be4215e25e3052bd2b1ba371 100644 (file)
@@ -318,7 +318,7 @@ int pty_limit = NR_UNIX98_PTY_DEFAULT;
 static int pty_limit_min = 0;
 static int pty_limit_max = NR_UNIX98_PTY_MAX;
 
-ctl_table pty_table[] = {
+static struct ctl_table pty_table[] = {
        {
                .ctl_name       = PTY_MAX,
                .procname       = "max",
@@ -340,6 +340,27 @@ ctl_table pty_table[] = {
        }
 };
 
+static struct ctl_table pty_kern_table[] = {
+       {
+               .ctl_name       = KERN_PTY,
+               .procname       = "pty",
+               .mode           = 0555,
+               .child          = pty_table,
+       },
+       {}
+};
+
+static struct ctl_table pty_root_table[] = {
+       {
+               .ctl_name       = CTL_KERN,
+               .procname       = "kernel",
+               .mode           = 0555,
+               .child          = pty_kern_table,
+       },
+       {}
+};
+
+
 static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file,
                            unsigned int cmd, unsigned long arg)
 {
@@ -404,6 +425,7 @@ static void __init unix98_pty_init(void)
                panic("Couldn't register Unix98 pts driver");
 
        pty_table[1].data = &ptm_driver->refcount;
+       register_sysctl_table(pty_root_table);
 }
 #else
 static inline void unix98_pty_init(void) { }
index af274e5a25ee5ec57533eff3a4e869feac831924..1756b1f7cb7252b8a596ff25767c1d9155fab5f4 100644 (file)
@@ -649,7 +649,7 @@ EXPORT_SYMBOL_GPL(add_input_randomness);
 
 void add_interrupt_randomness(int irq)
 {
-       if (irq >= NR_IRQS || irq_timer_state[irq] == 0)
+       if (irq >= NR_IRQS || irq_timer_state[irq] == NULL)
                return;
 
        DEBUG_ENT("irq event %d\n", irq);
index 56cbba7b6ec098a7cbc1e770098e348ad3e736b1..7e6a3a413bb23d801ececee502d9676fda3bd612 100644 (file)
@@ -84,6 +84,7 @@
 #include <linux/mutex.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
+#include <linux/completion.h>
 #include <linux/wait.h>
 #include <linux/pci.h>
 #include <asm/uaccess.h>
@@ -548,8 +549,8 @@ static void rp_handle_port(struct r_port *info)
 static void rp_do_poll(unsigned long dummy)
 {
        CONTROLLER_t *ctlp;
-       int ctrl, aiop, ch, line, i;
-       unsigned int xmitmask;
+       int ctrl, aiop, ch, line;
+       unsigned int xmitmask, i;
        unsigned int CtlMask;
        unsigned char AiopMask;
        Word_t bit;
@@ -650,7 +651,7 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
        info->closing_wait = 3000;
        info->close_delay = 50;
        init_waitqueue_head(&info->open_wait);
-       init_waitqueue_head(&info->close_wait);
+       init_completion(&info->close_wait);
        info->flags &= ~ROCKET_MODE_MASK;
        switch (pc104[board][line]) {
        case 422:
@@ -699,8 +700,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
        spin_lock_init(&info->slock);
        mutex_init(&info->write_mtx);
        rp_table[line] = info;
-       if (pci_dev)
-               tty_register_device(rocket_driver, line, &pci_dev->dev);
+       tty_register_device(rocket_driver, line, pci_dev ? &pci_dev->dev :
+                       NULL);
 }
 
 /*
@@ -878,7 +879,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
        if (tty_hung_up_p(filp))
                return ((info->flags & ROCKET_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
        if (info->flags & ROCKET_CLOSING) {
-               interruptible_sleep_on(&info->close_wait);
+               if (wait_for_completion_interruptible(&info->close_wait))
+                       return -ERESTARTSYS;
                return ((info->flags & ROCKET_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
        }
 
@@ -983,8 +985,10 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
                return -ENOMEM;
 
        if (info->flags & ROCKET_CLOSING) {
-               interruptible_sleep_on(&info->close_wait);
+               retval = wait_for_completion_interruptible(&info->close_wait);
                free_page(page);
+               if (retval)
+                       return retval;
                return ((info->flags & ROCKET_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
        }
 
@@ -1176,7 +1180,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
        }
        info->flags &= ~(ROCKET_INITIALIZED | ROCKET_CLOSING | ROCKET_NORMAL_ACTIVE);
        tty->closing = 0;
-       wake_up_interruptible(&info->close_wait);
+       complete_all(&info->close_wait);
        atomic_dec(&rp_num_ports_open);
 
 #ifdef ROCKET_DEBUG_OPEN
@@ -1869,8 +1873,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
        int fast_clock = 0;
        int altChanRingIndicator = 0;
        int ports_per_aiop = 8;
-       int ret;
-       unsigned int class_rev;
        WordIO_t ConfigIO = 0;
        ByteIO_t UPCIRingInd = 0;
 
@@ -1878,12 +1880,6 @@ static __init int register_PCI(int i, struct pci_dev *dev)
                return 0;
 
        rcktpt_io_addr[i] = pci_resource_start(dev, 0);
-       ret = pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-
-       if (ret) {
-               printk(KERN_INFO "  Error during register_PCI(), unable to read config dword \n");
-               return 0;
-       }
 
        rcktpt_type[i] = ROCKET_TYPE_NORMAL;
        rocketModel[i].loadrm2 = 0;
@@ -2037,8 +2033,9 @@ static __init int register_PCI(int i, struct pci_dev *dev)
                ports_per_aiop = 6;
                str = "6-port";
 
-               /*  If class_rev is 1, the rocketmodem flash must be loaded.  If it is 2 it is a "socketed" version. */
-               if ((class_rev & 0xFF) == 1) {
+               /*  If revision is 1, the rocketmodem flash must be loaded.
+                *  If it is 2 it is a "socketed" version. */
+               if (dev->revision == 1) {
                        rcktpt_type[i] = ROCKET_TYPE_MODEMII;
                        rocketModel[i].loadrm2 = 1;
                } else {
@@ -2053,7 +2050,7 @@ static __init int register_PCI(int i, struct pci_dev *dev)
                max_num_aiops = 1;
                ports_per_aiop = 4;
                str = "4-port";
-               if ((class_rev & 0xFF) == 1) {
+               if (dev->revision == 1) {
                        rcktpt_type[i] = ROCKET_TYPE_MODEMII;
                        rocketModel[i].loadrm2 = 1;
                } else {
@@ -2362,26 +2359,14 @@ static const struct tty_operations rocket_ops = {
  */
 static int __init rp_init(void)
 {
-       int retval, pci_boards_found, isa_boards_found, i;
+       int ret = -ENOMEM, pci_boards_found, isa_boards_found, i;
 
        printk(KERN_INFO "RocketPort device driver module, version %s, %s\n",
               ROCKET_VERSION, ROCKET_DATE);
 
        rocket_driver = alloc_tty_driver(MAX_RP_PORTS);
        if (!rocket_driver)
-               return -ENOMEM;
-
-       /*
-        * Initialize the array of pointers to our own internal state
-        * structures.
-        */
-       memset(rp_table, 0, sizeof (rp_table));
-       memset(xmit_flags, 0, sizeof (xmit_flags));
-
-       for (i = 0; i < MAX_RP_PORTS; i++)
-               lineNumbers[i] = 0;
-       nextLineNumber = 0;
-       memset(rocketModel, 0, sizeof (rocketModel));
+               goto err;
 
        /*
         *  If board 1 is non-zero, there is at least one ISA configured.  If controller is 
@@ -2396,8 +2381,11 @@ static int __init rp_init(void)
 
        /*  If an ISA card is configured, reserve the 4 byte IO space for the Mudbac controller */
        if (controller && (!request_region(controller, 4, "Comtrol RocketPort"))) {
-               printk(KERN_INFO "Unable to reserve IO region for first configured ISA RocketPort controller 0x%lx.  Driver exiting \n", controller);
-               return -EBUSY;
+               printk(KERN_ERR "Unable to reserve IO region for first "
+                       "configured ISA RocketPort controller 0x%lx.  "
+                       "Driver exiting\n", controller);
+               ret = -EBUSY;
+               goto err_tty;
        }
 
        /*  Store ISA variable retrieved from command line or .conf file. */
@@ -2434,15 +2422,14 @@ static int __init rp_init(void)
        rocket_driver->init_termios.c_ispeed = 9600;
        rocket_driver->init_termios.c_ospeed = 9600;
 #ifdef ROCKET_SOFT_FLOW
-       rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
+       rocket_driver->flags |= TTY_DRIVER_REAL_RAW;
 #endif
        tty_set_operations(rocket_driver, &rocket_ops);
 
-       retval = tty_register_driver(rocket_driver);
-       if (retval < 0) {
-               printk(KERN_INFO "Couldn't install tty RocketPort driver (error %d)\n", -retval);
-               put_tty_driver(rocket_driver);
-               return -1;
+       ret = tty_register_driver(rocket_driver);
+       if (ret < 0) {
+               printk(KERN_ERR "Couldn't install tty RocketPort driver\n");
+               goto err_tty;
        }
 
 #ifdef ROCKET_DEBUG_OPEN
@@ -2469,14 +2456,18 @@ static int __init rp_init(void)
        max_board = pci_boards_found + isa_boards_found;
 
        if (max_board == 0) {
-               printk(KERN_INFO "No rocketport ports found; unloading driver.\n");
-               del_timer_sync(&rocket_timer);
-               tty_unregister_driver(rocket_driver);
-               put_tty_driver(rocket_driver);
-               return -ENXIO;
+               printk(KERN_ERR "No rocketport ports found; unloading driver\n");
+               ret = -ENXIO;
+               goto err_ttyu;
        }
 
        return 0;
+err_ttyu:
+       tty_unregister_driver(rocket_driver);
+err_tty:
+       put_tty_driver(rocket_driver);
+err:
+       return ret;
 }
 
 
@@ -2491,10 +2482,14 @@ static void rp_cleanup_module(void)
        if (retval)
                printk(KERN_INFO "Error %d while trying to unregister "
                       "rocketport driver\n", -retval);
-       put_tty_driver(rocket_driver);
 
        for (i = 0; i < MAX_RP_PORTS; i++)
-               kfree(rp_table[i]);
+               if (rp_table[i]) {
+                       tty_unregister_device(rocket_driver, i);
+                       kfree(rp_table[i]);
+               }
+
+       put_tty_driver(rocket_driver);
 
        for (i = 0; i < NUM_BOARDS; i++) {
                if (rcktpt_io_addr[i] <= 0 || is_PCI[i])
index b4c53dfa7951290f48be4b5e28e685d91a0b8558..55b8f2d71a9617d3be3c3d932b34002636d52afe 100644 (file)
@@ -1163,13 +1163,8 @@ struct r_port {
        int read_status_mask;
        int cps;
 
-#ifdef DECLARE_WAITQUEUE
        wait_queue_head_t open_wait;
-       wait_queue_head_t close_wait;
-#else
-       struct wait_queue *open_wait;
-       struct wait_queue *close_wait;
-#endif
+       struct completion close_wait;
        spinlock_t slock;
        struct mutex write_mtx;
 };
index 745d552620bfc21229d286a8bc40827fd7811d3b..0def089cc1f296fa205ec836b501349c94172e44 100644 (file)
@@ -228,7 +228,8 @@ EXPORT_SYMBOL(tty_termios_input_baud_rate);
  *     and will all go away once this is done.
  */
 
-void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud)
+void tty_termios_encode_baud_rate(struct ktermios *termios,
+                                 speed_t ibaud, speed_t obaud)
 {
        int i = 0;
        int ifound = -1, ofound = -1;
@@ -263,11 +264,15 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed
         */
 
        do {
-               if (obaud - oclose >= baud_table[i] && obaud + oclose <= baud_table[i]) {
+               if (obaud - oclose <= baud_table[i] &&
+                   obaud + oclose >= baud_table[i]) {
                        termios->c_cflag |= baud_bits[i];
                        ofound = i;
                }
-               if (ibaud - iclose >= baud_table[i] && ibaud + iclose <= baud_table[i]) {
+               if (ibaud - iclose <= baud_table[i] &&
+                   ibaud + iclose >= baud_table[i]) {
+                       /* For the case input == output don't set IBAUD bits
+                          if the user didn't do so */
                        if (ofound == i && !ibinput)
                                ifound  = i;
 #ifdef IBSHIFT
index 645ad9808982526cf8f7ae4fdf682e2a433ed72e..1764c67b585f6cc5fd045877b517bef5e3492f72 100644 (file)
@@ -158,11 +158,7 @@ static void blank_screen_t(unsigned long dummy);
 static void set_palette(struct vc_data *vc);
 
 static int printable;          /* Is console ready for printing? */
-#ifdef CONFIG_VT_UNICODE
-int default_utf8 = 1;
-#else
-int default_utf8;
-#endif
+int default_utf8 = true;
 module_param(default_utf8, int, S_IRUGO | S_IWUSR);
 
 /*
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
deleted file mode 100644 (file)
index 37bddc1..0000000
+++ /dev/null
@@ -1,853 +0,0 @@
-#
-# Watchdog device configuration
-#
-
-menuconfig WATCHDOG
-       bool "Watchdog Timer Support"
-       ---help---
-         If you say Y here (and to one of the following options) and create a
-         character special file /dev/watchdog with major number 10 and minor
-         number 130 using mknod ("man mknod"), you will get a watchdog, i.e.:
-         subsequently opening the file and then failing to write to it for
-         longer than 1 minute will result in rebooting the machine. This
-         could be useful for a networked machine that needs to come back
-         on-line as fast as possible after a lock-up. There's both a watchdog
-         implementation entirely in software (which can sometimes fail to
-         reboot the machine) and a driver for hardware watchdog boards, which
-         are more robust and can also keep track of the temperature inside
-         your computer. For details, read <file:Documentation/watchdog/watchdog.txt>
-         in the kernel source.
-
-         The watchdog is usually used together with the watchdog daemon
-         which is available from
-         <ftp://ibiblio.org/pub/Linux/system/daemons/watchdog/>. This daemon can
-         also monitor NFS connections and can reboot the machine when the process
-         table is full.
-
-         If unsure, say N.
-
-if WATCHDOG
-
-config WATCHDOG_NOWAYOUT
-       bool "Disable watchdog shutdown on close"
-       help
-         The default watchdog behaviour (which you get if you say N here) is
-         to stop the timer if the process managing it closes the file
-         /dev/watchdog. It's always remotely possible that this process might
-         get killed. If you say Y here, the watchdog cannot be stopped once
-         it has been started.
-
-#
-# General Watchdog drivers
-#
-
-comment "Watchdog Device Drivers"
-
-# Architecture Independent
-
-config SOFT_WATCHDOG
-       tristate "Software watchdog"
-       help
-         A software monitoring watchdog. This will fail to reboot your system
-         from some situations that the hardware watchdog will recover
-         from. Equally it's a lot cheaper to install.
-
-         To compile this driver as a module, choose M here: the
-         module will be called softdog.
-
-# ALPHA Architecture
-
-# ARM Architecture
-
-config AT91RM9200_WATCHDOG
-       tristate "AT91RM9200 watchdog"
-       depends on ARCH_AT91RM9200
-       help
-         Watchdog timer embedded into AT91RM9200 chips. This will reboot your
-         system when the timeout is reached.
-
-config 21285_WATCHDOG
-       tristate "DC21285 watchdog"
-       depends on FOOTBRIDGE
-       help
-         The Intel Footbridge chip contains a built-in watchdog circuit. Say Y
-         here if you wish to use this. Alternatively say M to compile the
-         driver as a module, which will be called wdt285.
-
-         This driver does not work on all machines. In particular, early CATS
-         boards have hardware problems that will cause the machine to simply
-         lock up if the watchdog fires.
-
-         "If in doubt, leave it out" - say N.
-
-config 977_WATCHDOG
-       tristate "NetWinder WB83C977 watchdog"
-       depends on FOOTBRIDGE && ARCH_NETWINDER
-       help
-         Say Y here to include support for the WB977 watchdog included in
-         NetWinder machines. Alternatively say M to compile the driver as
-         a module, which will be called wdt977.
-
-         Not sure? It's safe to say N.
-
-config IXP2000_WATCHDOG
-       tristate "IXP2000 Watchdog"
-       depends on ARCH_IXP2000
-       help
-         Say Y here if to include support for the watchdog timer
-         in the Intel IXP2000(2400, 2800, 2850) network processors.
-         This driver can be built as a module by choosing M. The module
-         will be called ixp2000_wdt.
-
-         Say N if you are unsure.
-
-config IXP4XX_WATCHDOG
-       tristate "IXP4xx Watchdog"
-       depends on ARCH_IXP4XX
-       help
-         Say Y here if to include support for the watchdog timer
-         in the Intel IXP4xx network processors. This driver can
-         be built as a module by choosing M. The module will
-         be called ixp4xx_wdt.
-
-         Note: The internal IXP4xx watchdog does a soft CPU reset
-         which doesn't reset any peripherals. There are circumstances
-         where the watchdog will fail to reset the board correctly
-         (e.g., if the boot ROM is in an unreadable state).
-
-         Say N if you are unsure.
-
-config KS8695_WATCHDOG
-       tristate "KS8695 watchdog"
-       depends on ARCH_KS8695
-       help
-         Watchdog timer embedded into KS8695 processor. This will reboot your
-         system when the timeout is reached.
-
-config S3C2410_WATCHDOG
-       tristate "S3C2410 Watchdog"
-       depends on ARCH_S3C2410
-       help
-         Watchdog timer block in the Samsung S3C2410 chips. This will
-         reboot the system when the timer expires with the watchdog
-         enabled.
-
-         The driver is limited by the speed of the system's PCLK
-         signal, so with reasonably fast systems (PCLK around 50-66MHz)
-         then watchdog intervals of over approximately 20seconds are
-         unavailable.
-
-         The driver can be built as a module by choosing M, and will
-         be called s3c2410_wdt
-
-config SA1100_WATCHDOG
-       tristate "SA1100/PXA2xx watchdog"
-       depends on ARCH_SA1100 || ARCH_PXA
-       help
-         Watchdog timer embedded into SA11x0 and PXA2xx chips. This will
-         reboot your system when timeout is reached.
-
-         NOTE: once enabled, this timer cannot be disabled.
-
-         To compile this driver as a module, choose M here: the
-         module will be called sa1100_wdt.
-
-config MPCORE_WATCHDOG
-       tristate "MPcore watchdog"
-       depends on ARM_MPCORE_PLATFORM && LOCAL_TIMERS
-       help
-         Watchdog timer embedded into the MPcore system.
-
-         To compile this driver as a module, choose M here: the
-         module will be called mpcore_wdt.
-
-config EP93XX_WATCHDOG
-       tristate "EP93xx Watchdog"
-       depends on ARCH_EP93XX
-       help
-         Say Y here if to include support for the watchdog timer
-         embedded in the Cirrus Logic EP93xx family of devices.
-
-         To compile this driver as a module, choose M here: the
-         module will be called ep93xx_wdt.
-
-config OMAP_WATCHDOG
-       tristate "OMAP Watchdog"
-       depends on ARCH_OMAP16XX || ARCH_OMAP24XX
-       help
-         Support for TI OMAP1610/OMAP1710/OMAP2420 watchdog.  Say 'Y' here to
-         enable the OMAP1610/OMAP1710 watchdog timer.
-
-config PNX4008_WATCHDOG
-       tristate "PNX4008 Watchdog"
-       depends on ARCH_PNX4008
-       help
-         Say Y here if to include support for the watchdog timer
-         in the PNX4008 processor.
-         This driver can be built as a module by choosing M. The module
-         will be called pnx4008_wdt.
-
-         Say N if you are unsure.
-
-config IOP_WATCHDOG
-       tristate "IOP Watchdog"
-       depends on PLAT_IOP
-       select WATCHDOG_NOWAYOUT if (ARCH_IOP32X || ARCH_IOP33X)
-       help
-         Say Y here if to include support for the watchdog timer
-         in the Intel IOP3XX & IOP13XX I/O Processors.  This driver can
-         be built as a module by choosing M. The module will
-         be called iop_wdt.
-
-         Note: The IOP13XX watchdog does an Internal Bus Reset which will
-         affect both cores and the peripherals of the IOP.  The ATU-X
-         and/or ATUe configuration registers will remain intact, but if
-         operating as an Root Complex and/or Central Resource, the PCI-X
-         and/or PCIe busses will also be reset.  THIS IS A VERY BIG HAMMER.
-
-config DAVINCI_WATCHDOG
-       tristate "DaVinci watchdog"
-       depends on ARCH_DAVINCI
-       help
-         Say Y here if to include support for the watchdog timer
-         in the DaVinci DM644x/DM646x processors.
-         To compile this driver as a module, choose M here: the
-         module will be called davinci_wdt.
-
-         NOTE: once enabled, this timer cannot be disabled.
-         Say N if you are unsure.
-
-# ARM26 Architecture
-
-# AVR32 Architecture
-
-config AT32AP700X_WDT
-       tristate "AT32AP700x watchdog"
-       depends on CPU_AT32AP7000
-       help
-         Watchdog timer embedded into AT32AP700x devices. This will reboot
-         your system when the timeout is reached.
-
-# BLACKFIN Architecture
-
-config BFIN_WDT
-       tristate "Blackfin On-Chip Watchdog Timer"
-       depends on BLACKFIN
-       ---help---
-         If you say yes here you will get support for the Blackfin On-Chip
-         Watchdog Timer. If you have one of these processors and wish to
-         have watchdog support enabled, say Y, otherwise say N.
-
-         To compile this driver as a module, choose M here: the
-         module will be called bfin_wdt.
-
-# CRIS Architecture
-
-# FRV Architecture
-
-# H8300 Architecture
-
-# X86 (i386 + ia64 + x86_64) Architecture
-
-config ACQUIRE_WDT
-       tristate "Acquire SBC Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on Single Board
-         Computers produced by Acquire Inc (and others). This watchdog
-         simply watches your kernel to make sure it doesn't freeze, and if
-         it does, it reboots your computer after a certain amount of time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called acquirewdt.
-
-         Most people will say N.
-
-config ADVANTECH_WDT
-       tristate "Advantech SBC Watchdog Timer"
-       depends on X86
-       help
-         If you are configuring a Linux kernel for the Advantech single-board
-         computer, say `Y' here to support its built-in watchdog timer
-         feature. More information can be found at
-         <http://www.advantech.com.tw/products/>
-
-config ALIM1535_WDT
-       tristate "ALi M1535 PMU Watchdog Timer"
-       depends on X86 && PCI
-       ---help---
-         This is the driver for the hardware watchdog on the ALi M1535 PMU.
-
-         To compile this driver as a module, choose M here: the
-         module will be called alim1535_wdt.
-
-         Most people will say N.
-
-config ALIM7101_WDT
-       tristate "ALi M7101 PMU Computer Watchdog"
-       depends on X86 && PCI
-       help
-         This is the driver for the hardware watchdog on the ALi M7101 PMU
-         as used in the x86 Cobalt servers.
-
-         To compile this driver as a module, choose M here: the
-         module will be called alim7101_wdt.
-
-         Most people will say N.
-
-config SC520_WDT
-       tristate "AMD Elan SC520 processor Watchdog"
-       depends on X86
-       help
-         This is the driver for the hardware watchdog built in to the
-         AMD "Elan" SC520 microcomputer commonly used in embedded systems.
-         This watchdog simply watches your kernel to make sure it doesn't
-         freeze, and if it does, it reboots your computer after a certain
-         amount of time.
-
-         You can compile this driver directly into the kernel, or use
-         it as a module.  The module will be called sc520_wdt.
-
-config EUROTECH_WDT
-       tristate "Eurotech CPU-1220/1410 Watchdog Timer"
-       depends on X86
-       help
-         Enable support for the watchdog timer on the Eurotech CPU-1220 and
-         CPU-1410 cards.  These are PC/104 SBCs. Spec sheets and product
-         information are at <http://www.eurotech.it/>.
-
-config IB700_WDT
-       tristate "IB700 SBC Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on the IB700 Single
-         Board Computer produced by TMC Technology (www.tmc-uk.com). This watchdog
-         simply watches your kernel to make sure it doesn't freeze, and if
-         it does, it reboots your computer after a certain amount of time.
-
-         This driver is like the WDT501 driver but for slightly different hardware.
-
-         To compile this driver as a module, choose M here: the
-         module will be called ib700wdt.
-
-         Most people will say N.
-
-config IBMASR
-       tristate "IBM Automatic Server Restart"
-       depends on X86
-       help
-         This is the driver for the IBM Automatic Server Restart watchdog
-         timer built-in into some eServer xSeries machines.
-
-         To compile this driver as a module, choose M here: the
-         module will be called ibmasr.
-
-config WAFER_WDT
-       tristate "ICP Wafer 5823 Single Board Computer Watchdog"
-       depends on X86
-       help
-         This is a driver for the hardware watchdog on the ICP Wafer 5823
-         Single Board Computer (and probably other similar models).
-
-         To compile this driver as a module, choose M here: the
-         module will be called wafer5823wdt.
-
-config I6300ESB_WDT
-       tristate "Intel 6300ESB Timer/Watchdog"
-       depends on X86 && PCI
-       ---help---
-         Hardware driver for the watchdog timer built into the Intel
-         6300ESB controller hub.
-
-         To compile this driver as a module, choose M here: the
-         module will be called i6300esb.
-
-config ITCO_WDT
-       tristate "Intel TCO Timer/Watchdog"
-       depends on (X86 || IA64) && PCI
-       ---help---
-         Hardware driver for the intel TCO timer based watchdog devices.
-         These drivers are included in the Intel 82801 I/O Controller
-         Hub family (from ICH0 up to ICH8) and in the Intel 6300ESB
-         controller hub.
-
-         The TCO (Total Cost of Ownership) timer is a watchdog timer
-         that will reboot the machine after its second expiration. The
-         expiration time can be configured with the "heartbeat" parameter.
-
-         On some motherboards the driver may fail to reset the chipset's
-         NO_REBOOT flag which prevents the watchdog from rebooting the
-         machine. If this is the case you will get a kernel message like
-         "failed to reset NO_REBOOT flag, reboot disabled by hardware".
-
-         To compile this driver as a module, choose M here: the
-         module will be called iTCO_wdt.
-
-config ITCO_VENDOR_SUPPORT
-       bool "Intel TCO Timer/Watchdog Specific Vendor Support"
-       depends on ITCO_WDT
-       ---help---
-         Add vendor specific support to the intel TCO timer based watchdog
-         devices. At this moment we only have additional support for some
-         SuperMicro Inc. motherboards.
-
-config SC1200_WDT
-       tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog"
-       depends on X86
-       help
-         This is a driver for National Semiconductor PC87307/PC97307 hardware
-         watchdog cards as found on the SC1200. This watchdog is mainly used
-         for power management purposes and can be used to power down the device
-         during inactivity periods (includes interrupt activity monitoring).
-
-         To compile this driver as a module, choose M here: the
-         module will be called sc1200wdt.
-
-         Most people will say N.
-
-config SCx200_WDT
-       tristate "National Semiconductor SCx200 Watchdog"
-       depends on SCx200 && PCI
-       help
-         Enable the built-in watchdog timer support on the National
-         Semiconductor SCx200 processors.
-
-         If compiled as a module, it will be called scx200_wdt.
-
-config PC87413_WDT
-       tristate "NS PC87413 watchdog"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on the PC87413 chipset
-         This watchdog simply watches your kernel to make sure it doesn't
-         freeze, and if it does, it reboots your computer after a certain
-         amount of time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called pc87413_wdt.
-
-         Most people will say N.
-config 60XX_WDT
-       tristate "SBC-60XX Watchdog Timer"
-       depends on X86
-       help
-         This driver can be used with the watchdog timer found on some
-         single board computers, namely the 6010 PII based computer.
-         It may well work with other cards.  It reads port 0x443 to enable
-         and re-set the watchdog timer, and reads port 0x45 to disable
-         the watchdog.  If you have a card that behave in similar ways,
-         you can probably make this driver work with your card as well.
-
-         You can compile this driver directly into the kernel, or use
-         it as a module.  The module will be called sbc60xxwdt.
-
-config SBC8360_WDT
-       tristate "SBC8360 Watchdog Timer"
-       depends on X86
-       ---help---
-
-         This is the driver for the hardware watchdog on the SBC8360 Single
-         Board Computer produced by Axiomtek Co., Ltd. (www.axiomtek.com).
-
-         To compile this driver as a module, choose M here: the
-         module will be called sbc8360.ko.
-
-         Most people will say N.
-
-config CPU5_WDT
-       tristate "SMA CPU5 Watchdog"
-       depends on X86
-       ---help---
-         TBD.
-         To compile this driver as a module, choose M here: the
-         module will be called cpu5wdt.
-
-config SMSC37B787_WDT
-       tristate "Winbond SMsC37B787 Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog component on the
-         Winbond SMsC37B787 chipset as used on the NetRunner Mainboard
-         from Vision Systems and maybe others.
-
-         This watchdog simply watches your kernel to make sure it doesn't
-         freeze, and if it does, it reboots your computer after a certain
-         amount of time.
-
-         Usually a userspace daemon will notify the kernel WDT driver that
-         userspace is still alive, at regular intervals.
-
-         To compile this driver as a module, choose M here: the
-         module will be called smsc37b787_wdt.
-
-         Most people will say N.
-
-config W83627HF_WDT
-       tristate "W83627HF Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on the W83627HF chipset
-         as used in Advantech PC-9578 and Tyan S2721-533 motherboards
-         (and likely others).  This watchdog simply watches your kernel to
-         make sure it doesn't freeze, and if it does, it reboots your computer
-         after a certain amount of time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called w83627hf_wdt.
-
-         Most people will say N.
-
-config W83697HF_WDT
-       tristate "W83697HF/W83697HG Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on the W83697HF/HG
-         chipset as used in Dedibox/VIA motherboards (and likely others).
-         This watchdog simply watches your kernel to make sure it doesn't
-         freeze, and if it does, it reboots your computer after a certain
-         amount of time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called w83697hf_wdt.
-
-         Most people will say N.
-
-config W83877F_WDT
-       tristate "W83877F (EMACS) Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on the W83877F chipset
-         as used in EMACS PC-104 motherboards (and likely others).  This
-         watchdog simply watches your kernel to make sure it doesn't freeze,
-         and if it does, it reboots your computer after a certain amount of
-         time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called w83877f_wdt.
-
-         Most people will say N.
-
-config W83977F_WDT
-       tristate "W83977F (PCM-5335) Watchdog Timer"
-       depends on X86
-       ---help---
-         This is the driver for the hardware watchdog on the W83977F I/O chip
-         as used in AAEON's PCM-5335 SBC (and likely others).  This
-         watchdog simply watches your kernel to make sure it doesn't freeze,
-         and if it does, it reboots your computer after a certain amount of
-         time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called w83977f_wdt.
-
-config MACHZ_WDT
-       tristate "ZF MachZ Watchdog"
-       depends on X86
-       ---help---
-         If you are using a ZF Micro MachZ processor, say Y here, otherwise
-         N.  This is the driver for the watchdog timer built-in on that
-         processor using ZF-Logic interface.  This watchdog simply watches
-         your kernel to make sure it doesn't freeze, and if it does, it
-         reboots your computer after a certain amount of time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called machzwd.
-
-config SBC_EPX_C3_WATCHDOG
-       tristate "Winsystems SBC EPX-C3 watchdog"
-       depends on X86
-       ---help---
-         This is the driver for the built-in watchdog timer on the EPX-C3
-         Single-board computer made by Winsystems, Inc.
-
-         *Note*: This hardware watchdog is not probeable and thus there
-         is no way to know if writing to its IO address will corrupt
-         your system or have any real effect.  The only way to be sure
-         that this driver does what you want is to make sure you
-         are running it on an EPX-C3 from Winsystems with the watchdog
-         timer at IO address 0x1ee and 0x1ef.  It will write to both those
-         IO ports.  Basically, the assumption is made that if you compile
-         this driver into your kernel and/or load it as a module, that you
-         know what you are doing and that you are in fact running on an
-         EPX-C3 board!
-
-         To compile this driver as a module, choose M here: the
-         module will be called sbc_epx_c3.
-
-# M32R Architecture
-
-# M68K Architecture
-
-# M68KNOMMU Architecture
-
-# MIPS Architecture
-
-config INDYDOG
-       tristate "Indy/I2 Hardware Watchdog"
-       depends on SGI_IP22
-       help
-         Hardware driver for the Indy's/I2's watchdog. This is a
-         watchdog timer that will reboot the machine after a 60 second
-         timer expired and no process has written to /dev/watchdog during
-         that time.
-
-config WDT_MTX1
-       tristate "MTX-1 Hardware Watchdog"
-       depends on MIPS_MTX1
-       help
-         Hardware driver for the MTX-1 boards. This is a watchdog timer that
-         will reboot the machine after a 100 seconds timer expired.
-
-config WDT_RM9K_GPI
-       tristate "RM9000/GPI hardware watchdog"
-       depends on CPU_RM9000
-       help
-         Watchdog implementation using the GPI hardware found on
-         PMC-Sierra RM9xxx CPUs.
-
-         To compile this driver as a module, choose M here: the
-         module will be called rm9k_wdt.
-
-# PARISC Architecture
-
-# POWERPC Architecture
-
-config MPC5200_WDT
-       tristate "MPC5200 Watchdog Timer"
-       depends on PPC_MPC52xx
-
-config 8xx_WDT
-       tristate "MPC8xx Watchdog Timer"
-       depends on 8xx
-
-config 83xx_WDT
-       tristate "MPC83xx Watchdog Timer"
-       depends on PPC_83xx
-
-config MV64X60_WDT
-       tristate "MV64X60 (Marvell Discovery) Watchdog Timer"
-       depends on MV64X60
-
-config BOOKE_WDT
-       bool "PowerPC Book-E Watchdog Timer"
-       depends on BOOKE || 4xx
-       ---help---
-         Please see Documentation/watchdog/watchdog-api.txt for
-         more information.
-
-# PPC64 Architecture
-
-config WATCHDOG_RTAS
-       tristate "RTAS watchdog"
-       depends on PPC_RTAS
-       help
-         This driver adds watchdog support for the RTAS watchdog.
-
-         To compile this driver as a module, choose M here. The module
-         will be called wdrtas.
-
-# S390 Architecture
-
-config ZVM_WATCHDOG
-       tristate "z/VM Watchdog Timer"
-       depends on S390
-       help
-         IBM s/390 and zSeries machines running under z/VM 5.1 or later
-         provide a virtual watchdog timer to their guest that cause a
-         user define Control Program command to be executed after a
-         timeout.
-
-         To compile this driver as a module, choose M here. The module
-         will be called vmwatchdog.
-
-# SUPERH (sh + sh64) Architecture
-
-config SH_WDT
-       tristate "SuperH Watchdog"
-       depends on SUPERH && (CPU_SH3 || CPU_SH4)
-       help
-         This driver adds watchdog support for the integrated watchdog in the
-         SuperH processors. If you have one of these processors and wish
-         to have watchdog support enabled, say Y, otherwise say N.
-
-         As a side note, saying Y here will automatically boost HZ to 1000
-         so that the timer has a chance to clear the overflow counter. On
-         slower systems (such as the SH-2 and SH-3) this will likely yield
-         some performance issues. As such, the WDT should be avoided here
-         unless it is absolutely necessary.
-
-         To compile this driver as a module, choose M here: the
-         module will be called shwdt.
-
-config SH_WDT_MMAP
-       bool "Allow mmap of SH WDT"
-       default n
-       depends on SH_WDT
-       help
-         If you say Y here, user applications will be able to mmap the
-         WDT/CPG registers.
-
-# SPARC Architecture
-
-# SPARC64 Architecture
-
-config WATCHDOG_CP1XXX
-       tristate "CP1XXX Hardware Watchdog support"
-       depends on SPARC64 && PCI
-       ---help---
-         This is the driver for the hardware watchdog timers present on
-         Sun Microsystems CompactPCI models CP1400 and CP1500.
-
-         To compile this driver as a module, choose M here: the
-         module will be called cpwatchdog.
-
-         If you do not have a CompactPCI model CP1400 or CP1500, or
-         another UltraSPARC-IIi-cEngine boardset with hardware watchdog,
-         you should say N to this option.
-
-config WATCHDOG_RIO
-       tristate "RIO Hardware Watchdog support"
-       depends on SPARC64 && PCI
-       help
-         Say Y here to support the hardware watchdog capability on Sun RIO
-         machines.  The watchdog timeout period is normally one minute but
-         can be changed with a boot-time parameter.
-
-# V850 Architecture
-
-# XTENSA Architecture
-
-#
-# ISA-based Watchdog Cards
-#
-
-comment "ISA-based Watchdog Cards"
-       depends on ISA
-
-config PCWATCHDOG
-       tristate "Berkshire Products ISA-PC Watchdog"
-       depends on ISA
-       ---help---
-         This is the driver for the Berkshire Products ISA-PC Watchdog card.
-         This card simply watches your kernel to make sure it doesn't freeze,
-         and if it does, it reboots your computer after a certain amount of
-         time. This driver is like the WDT501 driver but for different
-         hardware. Please read <file:Documentation/watchdog/pcwd-watchdog.txt>. The PC
-         watchdog cards can be ordered from <http://www.berkprod.com/>.
-
-         To compile this driver as a module, choose M here: the
-         module will be called pcwd.
-
-         Most people will say N.
-
-config MIXCOMWD
-       tristate "Mixcom Watchdog"
-       depends on ISA
-       ---help---
-         This is a driver for the Mixcom hardware watchdog cards.  This
-         watchdog simply watches your kernel to make sure it doesn't freeze,
-         and if it does, it reboots your computer after a certain amount of
-         time.
-
-         To compile this driver as a module, choose M here: the
-         module will be called mixcomwd.
-
-         Most people will say N.
-
-config WDT
-       tristate "WDT Watchdog timer"
-       depends on ISA
-       ---help---
-         If you have a WDT500P or WDT501P watchdog board, say Y here,
-         otherwise N. It is not possible to probe for this board, which means
-         that you have to inform the kernel about the IO port and IRQ that
-         is needed (you can do this via the io and irq parameters)
-
-         To compile this driver as a module, choose M here: the
-         module will be called wdt.
-
-config WDT_501
-       bool "WDT501 features"
-       depends on WDT
-       help
-         Saying Y here and creating a character special file /dev/temperature
-         with major number 10 and minor number 131 ("man mknod") will give
-         you a thermometer inside your computer: reading from
-         /dev/temperature yields one byte, the temperature in degrees
-         Fahrenheit. This works only if you have a WDT501P watchdog board
-         installed.
-
-         If you want to enable the Fan Tachometer on the WDT501P, then you
-         can do this via the tachometer parameter. Only do this if you have a
-         fan tachometer actually set up.
-
-#
-# PCI-based Watchdog Cards
-#
-
-comment "PCI-based Watchdog Cards"
-       depends on PCI
-
-config PCIPCWATCHDOG
-       tristate "Berkshire Products PCI-PC Watchdog"
-       depends on PCI
-       ---help---
-         This is the driver for the Berkshire Products PCI-PC Watchdog card.
-         This card simply watches your kernel to make sure it doesn't freeze,
-         and if it does, it reboots your computer after a certain amount of
-         time. The card can also monitor the internal temperature of the PC.
-         More info is available at <http://www.berkprod.com/pci_pc_watchdog.htm>.
-
-         To compile this driver as a module, choose M here: the
-         module will be called pcwd_pci.
-
-         Most people will say N.
-
-config WDTPCI
-       tristate "PCI-WDT500/501 Watchdog timer"
-       depends on PCI
-       ---help---
-         If you have a PCI-WDT500/501 watchdog board, say Y here, otherwise N.
-
-         To compile this driver as a module, choose M here: the
-         module will be called wdt_pci.
-
-config WDT_501_PCI
-       bool "PCI-WDT501 features"
-       depends on WDTPCI
-       help
-         Saying Y here and creating a character special file /dev/temperature
-         with major number 10 and minor number 131 ("man mknod") will give
-         you a thermometer inside your computer: reading from
-         /dev/temperature yields one byte, the temperature in degrees
-         Fahrenheit. This works only if you have a PCI-WDT501 watchdog board
-         installed.
-
-         If you want to enable the Fan Tachometer on the PCI-WDT501, then you
-         can do this via the tachometer parameter. Only do this if you have a
-         fan tachometer actually set up.
-
-#
-# USB-based Watchdog Cards
-#
-
-comment "USB-based Watchdog Cards"
-       depends on USB
-
-config USBPCWATCHDOG
-       tristate "Berkshire Products USB-PC Watchdog"
-       depends on USB
-       ---help---
-         This is the driver for the Berkshire Products USB-PC Watchdog card.
-         This card simply watches your kernel to make sure it doesn't freeze,
-         and if it does, it reboots your computer after a certain amount of
-         time. The card can also monitor the internal temperature of the PC.
-         More info is available at <http://www.berkprod.com/usb_pc_watchdog.htm>.
-
-         To compile this driver as a module, choose M here: the
-         module will be called pcwd_usb.
-
-         Most people will say N.
-
-endif # WATCHDOG
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
deleted file mode 100644 (file)
index 389f8b1..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Makefile for the WatchDog device drivers.
-#
-
-# Only one watchdog can succeed. We probe the ISA/PCI/USB based
-# watchdog-cards first, then the architecture specific watchdog
-# drivers and then the architecture independant "softdog" driver.
-# This means that if your ISA/PCI/USB card isn't detected that
-# you can fall back to an architecture specific driver and if
-# that also fails then you can fall back to the software watchdog
-# to give you some cover.
-
-# ISA-based Watchdog Cards
-obj-$(CONFIG_PCWATCHDOG) += pcwd.o
-obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
-obj-$(CONFIG_WDT) += wdt.o
-
-# PCI-based Watchdog Cards
-obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o
-obj-$(CONFIG_WDTPCI) += wdt_pci.o
-
-# USB-based Watchdog Cards
-obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
-
-# ALPHA Architecture
-
-# ARM Architecture
-obj-$(CONFIG_AT91RM9200_WATCHDOG) += at91rm9200_wdt.o
-obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
-obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
-obj-$(CONFIG_977_WATCHDOG) += wdt977.o
-obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
-obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
-obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
-obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
-obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
-obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
-obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
-obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
-obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
-obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
-
-# ARM26 Architecture
-
-# AVR32 Architecture
-obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
-
-# BLACKFIN Architecture
-obj-$(CONFIG_BFIN_WDT) += bfin_wdt.o
-
-# CRIS Architecture
-
-# FRV Architecture
-
-# H8300 Architecture
-
-# X86 (i386 + ia64 + x86_64) Architecture
-obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
-obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
-obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o
-obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
-obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
-obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
-obj-$(CONFIG_IB700_WDT) += ib700wdt.o
-obj-$(CONFIG_IBMASR) += ibmasr.o
-obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
-obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o
-obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o iTCO_vendor_support.o
-obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
-obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
-obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
-obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
-obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
-obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
-obj-$(CONFIG_SMSC37B787_WDT) += smsc37b787_wdt.o
-obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o
-obj-$(CONFIG_W83697HF_WDT) += w83697hf_wdt.o
-obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
-obj-$(CONFIG_W83977F_WDT) += w83977f_wdt.o
-obj-$(CONFIG_MACHZ_WDT) += machzwd.o
-obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
-
-# M32R Architecture
-
-# M68K Architecture
-
-# M68KNOMMU Architecture
-
-# MIPS Architecture
-obj-$(CONFIG_INDYDOG) += indydog.o
-obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
-obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
-
-# PARISC Architecture
-
-# POWERPC Architecture
-obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
-obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
-obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
-obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
-obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
-
-# PPC64 Architecture
-obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o
-
-# S390 Architecture
-
-# SUPERH (sh + sh64) Architecture
-obj-$(CONFIG_SH_WDT) += shwdt.o
-
-# SPARC Architecture
-
-# SPARC64 Architecture
-
-# V850 Architecture
-
-# XTENSA Architecture
-
-# Architecture Independant
-obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
diff --git a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
deleted file mode 100644 (file)
index 85269c3..0000000
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- *     Acquire Single Board Computer Watchdog Timer driver
- *
- *      Based on wdt.c. Original copyright messages:
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
- *
- *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *          Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *          Can't add timeout - driver doesn't allow changing value
- */
-
-/*
- *     Theory of Operation:
- *             The Watch-Dog Timer is provided to ensure that standalone
- *             Systems can always recover from catastrophic conditions that
- *             caused the CPU to crash. This condition may have occured by
- *             external EMI or a software bug. When the CPU stops working
- *             correctly, hardware on the board will either perform a hardware
- *             reset (cold boot) or a non-maskable interrupt (NMI) to bring the
- *             system back to a known state.
- *
- *             The Watch-Dog Timer is controlled by two I/O Ports.
- *               443 hex       - Read  - Enable or refresh the Watch-Dog Timer
- *               043 hex       - Read  - Disable the Watch-Dog Timer
- *
- *             To enable the Watch-Dog Timer, a read from I/O port 443h must
- *             be performed. This will enable and activate the countdown timer
- *             which will eventually time out and either reset the CPU or cause
- *             an NMI depending on the setting of a jumper. To ensure that this
- *             reset condition does not occur, the Watch-Dog Timer must be
- *             periodically refreshed by reading the same I/O port 443h.
- *             The Watch-Dog Timer is disabled by reading I/O port 043h.
- *
- *             The Watch-Dog Timer Time-Out Period is set via jumpers.
- *             It can be 1, 2, 10, 20, 110 or 220 seconds.
- */
-
-/*
- *     Includes, defines, variables, module parameters, ...
- */
-
-/* Includes */
-#include <linux/module.h>              /* For module specific items */
-#include <linux/moduleparam.h>         /* For new moduleparam's */
-#include <linux/types.h>               /* For standard types (like size_t) */
-#include <linux/errno.h>               /* For the -ENODEV/... values */
-#include <linux/kernel.h>              /* For printk/panic/... */
-#include <linux/miscdevice.h>          /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
-#include <linux/watchdog.h>            /* For the watchdog specific items */
-#include <linux/fs.h>                  /* For file operations */
-#include <linux/ioport.h>              /* For io-port access */
-#include <linux/platform_device.h>     /* For platform_driver framework */
-#include <linux/init.h>                        /* For __init/__exit/... */
-
-#include <asm/uaccess.h>               /* For copy_to_user/put_user/... */
-#include <asm/io.h>                    /* For inb/outb/... */
-
-/* Module information */
-#define DRV_NAME "acquirewdt"
-#define PFX DRV_NAME ": "
-#define WATCHDOG_NAME "Acquire WDT"
-#define WATCHDOG_HEARTBEAT 0   /* There is no way to see what the correct time-out period is */
-
-/* internal variables */
-static struct platform_device *acq_platform_device;    /* the watchdog platform device */
-static unsigned long acq_is_open;
-static char expect_close;
-
-/* module parameters */
-static int wdt_stop = 0x43;    /* You must set this - there is no sane way to probe for this board. */
-module_param(wdt_stop, int, 0);
-MODULE_PARM_DESC(wdt_stop, "Acquire WDT 'stop' io port (default 0x43)");
-
-static int wdt_start = 0x443;  /* You must set this - there is no sane way to probe for this board. */
-module_param(wdt_start, int, 0);
-MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Watchdog Operations
- */
-
-static void acq_keepalive(void)
-{
-       /* Write a watchdog value */
-       inb_p(wdt_start);
-}
-
-static void acq_stop(void)
-{
-       /* Turn the card off */
-       inb_p(wdt_stop);
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if(count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-
-               /* Well, anyhow someone wrote to us, we should return that favour */
-               acq_keepalive();
-       }
-       return count;
-}
-
-static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       int options, retval = -EINVAL;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident =
-       {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = WATCHDOG_NAME,
-       };
-
-       switch(cmd)
-       {
-       case WDIOC_GETSUPPORT:
-         return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-         return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-         acq_keepalive();
-         return 0;
-
-       case WDIOC_GETTIMEOUT:
-         return put_user(WATCHDOG_HEARTBEAT, p);
-
-       case WDIOC_SETOPTIONS:
-       {
-           if (get_user(options, p))
-             return -EFAULT;
-
-           if (options & WDIOS_DISABLECARD)
-           {
-             acq_stop();
-             retval = 0;
-           }
-
-           if (options & WDIOS_ENABLECARD)
-           {
-             acq_keepalive();
-             retval = 0;
-           }
-
-           return retval;
-       }
-
-       default:
-         return -ENOTTY;
-       }
-}
-
-static int acq_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &acq_is_open))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Activate */
-       acq_keepalive();
-       return nonseekable_open(inode, file);
-}
-
-static int acq_close(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               acq_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               acq_keepalive();
-       }
-       clear_bit(0, &acq_is_open);
-       expect_close = 0;
-       return 0;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations acq_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = acq_write,
-       .ioctl          = acq_ioctl,
-       .open           = acq_open,
-       .release        = acq_close,
-};
-
-static struct miscdevice acq_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &acq_fops,
-};
-
-/*
- *     Init & exit routines
- */
-
-static int __devinit acq_probe(struct platform_device *dev)
-{
-       int ret;
-
-       if (wdt_stop != wdt_start) {
-               if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
-                       printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                               wdt_stop);
-                       ret = -EIO;
-                       goto out;
-               }
-       }
-
-       if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       wdt_start);
-               ret = -EIO;
-               goto unreg_stop;
-       }
-
-       ret = misc_register(&acq_miscdev);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto unreg_regions;
-       }
-
-       printk (KERN_INFO PFX "initialized. (nowayout=%d)\n",
-               nowayout);
-
-       return 0;
-
-unreg_regions:
-       release_region(wdt_start, 1);
-unreg_stop:
-       if (wdt_stop != wdt_start)
-               release_region(wdt_stop, 1);
-out:
-       return ret;
-}
-
-static int __devexit acq_remove(struct platform_device *dev)
-{
-       misc_deregister(&acq_miscdev);
-       release_region(wdt_start,1);
-       if(wdt_stop != wdt_start)
-               release_region(wdt_stop,1);
-
-       return 0;
-}
-
-static void acq_shutdown(struct platform_device *dev)
-{
-       /* Turn the WDT off if we have a soft shutdown */
-       acq_stop();
-}
-
-static struct platform_driver acquirewdt_driver = {
-       .probe          = acq_probe,
-       .remove         = __devexit_p(acq_remove),
-       .shutdown       = acq_shutdown,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = DRV_NAME,
-       },
-};
-
-static int __init acq_init(void)
-{
-       int err;
-
-       printk(KERN_INFO "WDT driver for Acquire single board computer initialising.\n");
-
-       err = platform_driver_register(&acquirewdt_driver);
-       if (err)
-               return err;
-
-       acq_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
-       if (IS_ERR(acq_platform_device)) {
-               err = PTR_ERR(acq_platform_device);
-               goto unreg_platform_driver;
-       }
-
-       return 0;
-
-unreg_platform_driver:
-       platform_driver_unregister(&acquirewdt_driver);
-       return err;
-}
-
-static void __exit acq_exit(void)
-{
-       platform_device_unregister(acq_platform_device);
-       platform_driver_unregister(&acquirewdt_driver);
-       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
-}
-
-module_init(acq_init);
-module_exit(acq_exit);
-
-MODULE_AUTHOR("David Woodhouse");
-MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c
deleted file mode 100644 (file)
index 8121cc2..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- *     Advantech Single Board Computer WDT driver
- *
- *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
- *
- *     Based on acquirewdt.c which is based on wdt.c.
- *     Original copyright messages:
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
- *
- *     14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *         Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *
- *     16-Oct-2002 Rob Radez <rob@osinvestor.com>
- *         Clean up ioctls, clean up init + exit, add expect close support,
- *         add wdt_start and wdt_stop as parameters.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define DRV_NAME "advantechwdt"
-#define PFX DRV_NAME ": "
-#define WATCHDOG_NAME "Advantech WDT"
-#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
-
-static struct platform_device *advwdt_platform_device; /* the watchdog platform device */
-static unsigned long advwdt_is_open;
-static char adv_expect_close;
-
-/*
- *     You must set these - there is no sane way to probe for this board.
- *
- *     To enable or restart, write the timeout value in seconds (1 to 63)
- *     to I/O port wdt_start.  To disable, read I/O port wdt_stop.
- *     Both are 0x443 for most boards (tested on a PCA-6276VE-00B1), but
- *     check your manual (at least the PCA-6159 seems to be different -
- *     the manual says wdt_stop is 0x43, not 0x443).
- *     (0x43 is also a write-only control register for the 8254 timer!)
- */
-
-static int wdt_stop = 0x443;
-module_param(wdt_stop, int, 0);
-MODULE_PARM_DESC(wdt_stop, "Advantech WDT 'stop' io port (default 0x443)");
-
-static int wdt_start = 0x443;
-module_param(wdt_start, int, 0);
-MODULE_PARM_DESC(wdt_start, "Advantech WDT 'start' io port (default 0x443)");
-
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Watchdog Operations
- */
-
-static void
-advwdt_ping(void)
-{
-       /* Write a watchdog value */
-       outb_p(timeout, wdt_start);
-}
-
-static void
-advwdt_disable(void)
-{
-       inb_p(wdt_stop);
-}
-
-static int
-advwdt_set_heartbeat(int t)
-{
-       if ((t < 1) || (t > 63))
-               return -EINVAL;
-
-       timeout = t;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static ssize_t
-advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       adv_expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       adv_expect_close = 42;
-                       }
-               }
-               advwdt_ping();
-       }
-       return count;
-}
-
-static int
-advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-         unsigned long arg)
-{
-       int new_timeout;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = WATCHDOG_NAME,
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-         if (copy_to_user(argp, &ident, sizeof(ident)))
-           return -EFAULT;
-         break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-         return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-         advwdt_ping();
-         break;
-
-       case WDIOC_SETTIMEOUT:
-         if (get_user(new_timeout, p))
-                 return -EFAULT;
-         if (advwdt_set_heartbeat(new_timeout))
-                 return -EINVAL;
-         advwdt_ping();
-         /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-         return put_user(timeout, p);
-
-       case WDIOC_SETOPTIONS:
-       {
-         int options, retval = -EINVAL;
-
-         if (get_user(options, p))
-           return -EFAULT;
-
-         if (options & WDIOS_DISABLECARD) {
-           advwdt_disable();
-           retval = 0;
-         }
-
-         if (options & WDIOS_ENABLECARD) {
-           advwdt_ping();
-           retval = 0;
-         }
-
-         return retval;
-       }
-
-       default:
-         return -ENOTTY;
-       }
-       return 0;
-}
-
-static int
-advwdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &advwdt_is_open))
-               return -EBUSY;
-       /*
-        *      Activate
-        */
-
-       advwdt_ping();
-       return nonseekable_open(inode, file);
-}
-
-static int
-advwdt_close(struct inode *inode, struct file *file)
-{
-       if (adv_expect_close == 42) {
-               advwdt_disable();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               advwdt_ping();
-       }
-       clear_bit(0, &advwdt_is_open);
-       adv_expect_close = 0;
-       return 0;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations advwdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = advwdt_write,
-       .ioctl          = advwdt_ioctl,
-       .open           = advwdt_open,
-       .release        = advwdt_close,
-};
-
-static struct miscdevice advwdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &advwdt_fops,
-};
-
-/*
- *     Init & exit routines
- */
-
-static int __devinit
-advwdt_probe(struct platform_device *dev)
-{
-       int ret;
-
-       if (wdt_stop != wdt_start) {
-               if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
-                       printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                               wdt_stop);
-                       ret = -EIO;
-                       goto out;
-               }
-       }
-
-       if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       wdt_start);
-               ret = -EIO;
-               goto unreg_stop;
-       }
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (advwdt_set_heartbeat(timeout)) {
-               advwdt_set_heartbeat(WATCHDOG_TIMEOUT);
-               printk (KERN_INFO PFX "timeout value must be 1<=x<=63, using %d\n",
-                       timeout);
-       }
-
-       ret = misc_register(&advwdt_miscdev);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto unreg_regions;
-       }
-
-       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-out:
-       return ret;
-unreg_regions:
-       release_region(wdt_start, 1);
-unreg_stop:
-       if (wdt_stop != wdt_start)
-               release_region(wdt_stop, 1);
-       goto out;
-}
-
-static int __devexit
-advwdt_remove(struct platform_device *dev)
-{
-       misc_deregister(&advwdt_miscdev);
-       release_region(wdt_start,1);
-       if(wdt_stop != wdt_start)
-               release_region(wdt_stop,1);
-
-       return 0;
-}
-
-static void
-advwdt_shutdown(struct platform_device *dev)
-{
-       /* Turn the WDT off if we have a soft shutdown */
-       advwdt_disable();
-}
-
-static struct platform_driver advwdt_driver = {
-       .probe          = advwdt_probe,
-       .remove         = __devexit_p(advwdt_remove),
-       .shutdown       = advwdt_shutdown,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = DRV_NAME,
-       },
-};
-
-static int __init
-advwdt_init(void)
-{
-       int err;
-
-       printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n");
-
-       err = platform_driver_register(&advwdt_driver);
-       if (err)
-               return err;
-
-       advwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
-       if (IS_ERR(advwdt_platform_device)) {
-               err = PTR_ERR(advwdt_platform_device);
-               goto unreg_platform_driver;
-       }
-
-       return 0;
-
-unreg_platform_driver:
-       platform_driver_unregister(&advwdt_driver);
-       return err;
-}
-
-static void __exit
-advwdt_exit(void)
-{
-       platform_device_unregister(advwdt_platform_device);
-       platform_driver_unregister(&advwdt_driver);
-       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
-}
-
-module_init(advwdt_init);
-module_exit(advwdt_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marek Michalkiewicz <marekm@linux.org.pl>");
-MODULE_DESCRIPTION("Advantech Single Board Computer WDT driver");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
deleted file mode 100644 (file)
index c404fc6..0000000
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- *     Watchdog for the 7101 PMU version found in the ALi M1535 chipsets
- *
- *     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.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/pci.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#define WATCHDOG_NAME "ALi_M1535"
-#define PFX WATCHDOG_NAME ": "
-#define WATCHDOG_TIMEOUT 60    /* 60 sec default timeout */
-
-/* internal variables */
-static unsigned long ali_is_open;
-static char ali_expect_release;
-static struct pci_dev *ali_pci;
-static u32 ali_timeout_bits;   /* stores the computed timeout */
-static spinlock_t ali_lock;    /* Guards the hardware */
-
-/* module parameters */
-static int timeout = WATCHDOG_TIMEOUT;
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     ali_start       -       start watchdog countdown
- *
- *     Starts the timer running providing the timer has a counter
- *     configuration set.
- */
-
-static void ali_start(void)
-{
-       u32 val;
-
-       spin_lock(&ali_lock);
-
-       pci_read_config_dword(ali_pci, 0xCC, &val);
-       val &= ~0x3F;   /* Mask count */
-       val |= (1<<25) | ali_timeout_bits;
-       pci_write_config_dword(ali_pci, 0xCC, val);
-
-       spin_unlock(&ali_lock);
-}
-
-/*
- *     ali_stop        -       stop the timer countdown
- *
- *     Stop the ALi watchdog countdown
- */
-
-static void ali_stop(void)
-{
-       u32 val;
-
-       spin_lock(&ali_lock);
-
-       pci_read_config_dword(ali_pci, 0xCC, &val);
-       val &= ~0x3F;   /* Mask count to zero (disabled) */
-       val &= ~(1<<25);/* and for safety mask the reset enable */
-       pci_write_config_dword(ali_pci, 0xCC, val);
-
-       spin_unlock(&ali_lock);
-}
-
-/*
- *     ali_keepalive   -       send a keepalive to the watchdog
- *
- *      Send a keepalive to the timer (actually we restart the timer).
- */
-
-static void ali_keepalive(void)
-{
-       ali_start();
-}
-
-/*
- *     ali_settimer    -       compute the timer reload value
- *     @t: time in seconds
- *
- *     Computes the timeout values needed
- */
-
-static int ali_settimer(int t)
-{
-       if(t < 0)
-               return -EINVAL;
-       else if(t < 60)
-               ali_timeout_bits = t|(1<<6);
-       else if(t < 3600)
-               ali_timeout_bits = (t/60)|(1<<7);
-       else if(t < 18000)
-               ali_timeout_bits = (t/300)|(1<<6)|(1<<7);
-       else return -EINVAL;
-
-       timeout = t;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-/*
- *     ali_write       -       writes to ALi watchdog
- *     @file: file from VFS
- *     @data: user address of data
- *     @len: length of data
- *     @ppos: pointer to the file offset
- *
- *     Handle a write to the ALi watchdog. Writing to the file pings
- *     the watchdog and resets it. Writing the magic 'V' sequence allows
- *     the next close to turn off the watchdog.
- */
-
-static ssize_t ali_write(struct file *file, const char __user *data,
-                             size_t len, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       ali_expect_release = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if(get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       ali_expect_release = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               ali_start();
-       }
-       return len;
-}
-
-/*
- *     ali_ioctl       -       handle watchdog ioctls
- *     @inode: VFS inode
- *     @file: VFS file pointer
- *     @cmd: ioctl number
- *     @arg: arguments to the ioctl
- *
- *     Handle the watchdog ioctls supported by the ALi driver. Really
- *     we want an extension to enable irq ack monitoring and the like
- */
-
-static int ali_ioctl(struct inode *inode, struct file *file,
-                         unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_KEEPALIVEPING |
-                                       WDIOF_SETTIMEOUT |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     0,
-               .identity =             "ALi M1535 WatchDog Timer",
-       };
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof (ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       ali_keepalive();
-                       return 0;
-
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if (get_user (new_options, p))
-                               return -EFAULT;
-
-                       if (new_options & WDIOS_DISABLECARD) {
-                               ali_stop();
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_ENABLECARD) {
-                               ali_start();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_timeout;
-
-                       if (get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       if (ali_settimer(new_timeout))
-                           return -EINVAL;
-
-                       ali_keepalive();
-                       /* Fall */
-               }
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout, p);
-
-               default:
-                       return -ENOTTY;
-       }
-}
-
-/*
- *     ali_open        -       handle open of ali watchdog
- *     @inode: inode from VFS
- *     @file: file from VFS
- *
- *     Open the ALi watchdog device. Ensure only one person opens it
- *     at a time. Also start the watchdog running.
- */
-
-static int ali_open(struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-       if (test_and_set_bit(0, &ali_is_open))
-               return -EBUSY;
-
-       /* Activate */
-       ali_start();
-       return nonseekable_open(inode, file);
-}
-
-/*
- *     ali_release     -       close an ALi watchdog
- *     @inode: inode from VFS
- *     @file: file from VFS
- *
- *     Close the ALi watchdog device. Actual shutdown of the timer
- *     only occurs if the magic sequence has been set.
- */
-
-static int ali_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        */
-       if (ali_expect_release == 42) {
-               ali_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               ali_keepalive();
-       }
-       clear_bit(0, &ali_is_open);
-       ali_expect_release = 0;
-       return 0;
-}
-
-/*
- *     ali_notify_sys  -       System down notifier
- *
- *     Notifier for system down
- */
-
-
-static int ali_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the WDT off */
-               ali_stop();
-       }
-
-       return NOTIFY_DONE;
-}
-
-/*
- *     Data for PCI driver interface
- *
- *     This data only exists for exporting the supported
- *     PCI ids via MODULE_DEVICE_TABLE.  We do not actually
- *     register a pci_driver, because someone else might one day
- *     want to register another driver on the same PCI id.
- */
-
-static struct pci_device_id ali_pci_tbl[] = {
-       { PCI_VENDOR_ID_AL, 0x1533, PCI_ANY_ID, PCI_ANY_ID,},
-       { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,},
-       { 0, },
-};
-MODULE_DEVICE_TABLE(pci, ali_pci_tbl);
-
-/*
- *     ali_find_watchdog       -       find a 1535 and 7101
- *
- *     Scans the PCI hardware for a 1535 series bridge and matching 7101
- *     watchdog device. This may be overtight but it is better to be safe
- */
-
-static int __init ali_find_watchdog(void)
-{
-       struct pci_dev *pdev;
-       u32 wdog;
-
-       /* Check for a 1533/1535 series bridge */
-       pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
-       if (pdev == NULL)
-               pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1533, NULL);
-       if (pdev == NULL)
-               return -ENODEV;
-       pci_dev_put(pdev);
-
-       /* Check for the a 7101 PMU */
-       pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
-       if(pdev == NULL)
-               return -ENODEV;
-
-       if(pci_enable_device(pdev)) {
-               pci_dev_put(pdev);
-               return -EIO;
-       }
-
-       ali_pci = pdev;
-
-       /*
-        *      Initialize the timer bits
-        */
-       pci_read_config_dword(pdev, 0xCC, &wdog);
-
-       wdog &= ~0x3F;          /* Timer bits */
-       wdog &= ~((1<<27)|(1<<26)|(1<<25)|(1<<24));     /* Issued events */
-       wdog &= ~((1<<16)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9));      /* No monitor bits */
-
-       pci_write_config_dword(pdev, 0xCC, wdog);
-
-       return 0;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations ali_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .write =        ali_write,
-       .ioctl =        ali_ioctl,
-       .open =         ali_open,
-       .release =      ali_release,
-};
-
-static struct miscdevice ali_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &ali_fops,
-};
-
-static struct notifier_block ali_notifier = {
-       .notifier_call =        ali_notify_sys,
-};
-
-/*
- *     watchdog_init   -       module initialiser
- *
- *     Scan for a suitable watchdog and if so initialize it. Return an error
- *     if we cannot, the error causes the module to unload
- */
-
-static int __init watchdog_init(void)
-{
-       int ret;
-
-       spin_lock_init(&ali_lock);
-
-       /* Check whether or not the hardware watchdog is there */
-       if (ali_find_watchdog() != 0) {
-               return -ENODEV;
-       }
-
-       /* Check that the timeout value is within it's range ; if not reset to the default */
-       if (timeout < 1 || timeout >= 18000) {
-               timeout = WATCHDOG_TIMEOUT;
-               printk(KERN_INFO PFX "timeout value must be 0<timeout<18000, using %d\n",
-                       timeout);
-       }
-
-       /* Calculate the watchdog's timeout */
-       ali_settimer(timeout);
-
-       ret = misc_register(&ali_miscdev);
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto out;
-       }
-
-       ret = register_reboot_notifier(&ali_notifier);
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               goto unreg_miscdev;
-       }
-
-       printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-out:
-       return ret;
-unreg_miscdev:
-       misc_deregister(&ali_miscdev);
-       goto out;
-}
-
-/*
- *     watchdog_exit   -       module de-initialiser
- *
- *     Called while unloading a successfully installed watchdog module.
- */
-
-static void __exit watchdog_exit(void)
-{
-       /* Stop the timer before we leave */
-       ali_stop();
-
-       /* Deregister */
-       unregister_reboot_notifier(&ali_notifier);
-       misc_deregister(&ali_miscdev);
-       pci_dev_put(ali_pci);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);
-
-MODULE_AUTHOR("Alan Cox");
-MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
deleted file mode 100644 (file)
index 67aed9f..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- *     ALi M7101 PMU Computer Watchdog Timer driver
- *
- *     Based on w83877f_wdt.c by Scott Jennings <linuxdrivers@oro.net>
- *     and the Cobalt kernel WDT timer driver by Tim Hockin
- *                                           <thockin@cobaltnet.com>
- *
- *     (c)2002 Steve Hill <steve@navaho.co.uk>
- *
- *  This WDT driver is different from most other Linux WDT
- *  drivers in that the driver will ping the watchdog by itself,
- *  because this particular WDT has a very short timeout (1.6
- *  seconds) and it would be insane to count on any userspace
- *  daemon always getting scheduled within that time frame.
- *
- *  Additions:
- *   Aug 23, 2004 - Added use_gpio module parameter for use on revision a1d PMUs
- *                  found on very old cobalt hardware.
- *                  -- Mike Waychison <michael.waychison@sun.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define OUR_NAME "alim7101_wdt"
-#define PFX OUR_NAME ": "
-
-#define WDT_ENABLE 0x9C
-#define WDT_DISABLE 0x8C
-
-#define ALI_7101_WDT    0x92
-#define ALI_7101_GPIO   0x7D
-#define ALI_7101_GPIO_O 0x7E
-#define ALI_WDT_ARM     0x01
-
-/*
- * We're going to use a 1 second timeout.
- * If we reset the watchdog every ~250ms we should be safe.  */
-
-#define WDT_INTERVAL (HZ/4+1)
-
-/*
- * We must not require too good response from the userspace daemon.
- * Here we require the userspace daemon to send us a heartbeat
- * char to /dev/watchdog every 30 seconds.
- */
-
-#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-static int use_gpio = 0; /* Use the pic (for a1d revision alim7101) */
-module_param(use_gpio, int, 0);
-MODULE_PARM_DESC(use_gpio, "Use the gpio watchdog.  (required by old cobalt boards)");
-
-static void wdt_timer_ping(unsigned long);
-static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
-static unsigned long next_heartbeat;
-static unsigned long wdt_is_open;
-static char wdt_expect_close;
-static struct pci_dev *alim7101_pmu;
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-                __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Whack the dog
- */
-
-static void wdt_timer_ping(unsigned long data)
-{
-       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
-        * we agree to ping the WDT
-        */
-       char    tmp;
-
-       if(time_before(jiffies, next_heartbeat))
-       {
-               /* Ping the WDT (this is actually a disarm/arm sequence) */
-               pci_read_config_byte(alim7101_pmu, 0x92, &tmp);
-               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp & ~ALI_WDT_ARM));
-               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp | ALI_WDT_ARM));
-               if (use_gpio) {
-                       pci_read_config_byte(alim7101_pmu, ALI_7101_GPIO_O, &tmp);
-                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp
-                                       | 0x20);
-                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp
-                                       & ~0x20);
-               }
-       } else {
-               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
-       }
-       /* Re-set the timer interval */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-}
-
-/*
- * Utility routines
- */
-
-static void wdt_change(int writeval)
-{
-       char    tmp;
-
-       pci_read_config_byte(alim7101_pmu, ALI_7101_WDT, &tmp);
-       if (writeval == WDT_ENABLE) {
-               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp | ALI_WDT_ARM));
-               if (use_gpio) {
-                       pci_read_config_byte(alim7101_pmu, ALI_7101_GPIO_O, &tmp);
-                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp & ~0x20);
-               }
-
-       } else {
-               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp & ~ALI_WDT_ARM));
-               if (use_gpio) {
-                       pci_read_config_byte(alim7101_pmu, ALI_7101_GPIO_O, &tmp);
-                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp | 0x20);
-               }
-       }
-}
-
-static void wdt_startup(void)
-{
-       next_heartbeat = jiffies + (timeout * HZ);
-
-       /* We must enable before we kick off the timer in case the timer
-          occurs as we ping it */
-
-       wdt_change(WDT_ENABLE);
-
-       /* Start the timer */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-
-       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
-}
-
-static void wdt_turnoff(void)
-{
-       /* Stop the timer */
-       del_timer_sync(&timer);
-       wdt_change(WDT_DISABLE);
-       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
-}
-
-static void wdt_keepalive(void)
-{
-       /* user land ping */
-       next_heartbeat = jiffies + (timeout * HZ);
-}
-
-/*
- * /dev/watchdog handling
- */
-
-static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if(count) {
-               if (!nowayout) {
-                       size_t ofs;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       wdt_expect_close = 0;
-
-                       /* now scan */
-                       for (ofs = 0; ofs != count; ofs++) {
-                               char c;
-                               if (get_user(c, buf+ofs))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       wdt_expect_close = 42;
-                       }
-               }
-               /* someone wrote to us, we should restart timer */
-               wdt_keepalive();
-       }
-       return count;
-}
-
-static int fop_open(struct inode * inode, struct file * file)
-{
-       /* Just in case we're already talking to someone... */
-       if(test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-       /* Good, fire up the show */
-       wdt_startup();
-       return nonseekable_open(inode, file);
-}
-
-static int fop_close(struct inode * inode, struct file * file)
-{
-       if(wdt_expect_close == 42)
-               wdt_turnoff();
-       else {
-               /* wim: shouldn't there be a: del_timer(&timer); */
-               printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
-       }
-       clear_bit(0, &wdt_is_open);
-       wdt_expect_close = 0;
-       return 0;
-}
-
-static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident =
-       {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "ALiM7101",
-       };
-
-       switch(cmd)
-       {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_keepalive();
-                       return 0;
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if(get_user(new_options, p))
-                               return -EFAULT;
-
-                       if(new_options & WDIOS_DISABLECARD) {
-                               wdt_turnoff();
-                               retval = 0;
-                       }
-
-                       if(new_options & WDIOS_ENABLECARD) {
-                               wdt_startup();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_timeout;
-
-                       if(get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
-                               return -EINVAL;
-
-                       timeout = new_timeout;
-                       wdt_keepalive();
-                       /* Fall through */
-               }
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout, p);
-               default:
-                       return -ENOTTY;
-       }
-}
-
-static const struct file_operations wdt_fops = {
-       .owner=         THIS_MODULE,
-       .llseek=        no_llseek,
-       .write=         fop_write,
-       .open=          fop_open,
-       .release=       fop_close,
-       .ioctl=         fop_ioctl,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor=WATCHDOG_MINOR,
-       .name="watchdog",
-       .fops=&wdt_fops,
-};
-
-/*
- *     Notifier for system down
- */
-
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code==SYS_DOWN || code==SYS_HALT)
-               wdt_turnoff();
-
-       if (code==SYS_RESTART) {
-               /*
-                * Cobalt devices have no way of rebooting themselves other than
-                * getting the watchdog to pull reset, so we restart the watchdog on
-                * reboot with no heartbeat
-                */
-               wdt_change(WDT_ENABLE);
-               printk(KERN_INFO PFX "Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n");
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier=
-{
-       .notifier_call = wdt_notify_sys,
-};
-
-static void __exit alim7101_wdt_unload(void)
-{
-       wdt_turnoff();
-       /* Deregister */
-       misc_deregister(&wdt_miscdev);
-       unregister_reboot_notifier(&wdt_notifier);
-       pci_dev_put(alim7101_pmu);
-}
-
-static int __init alim7101_wdt_init(void)
-{
-       int rc = -EBUSY;
-       struct pci_dev *ali1543_south;
-       char tmp;
-
-       printk(KERN_INFO PFX "Steve Hill <steve@navaho.co.uk>.\n");
-       alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
-               NULL);
-       if (!alim7101_pmu) {
-               printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n");
-               return -EBUSY;
-       }
-
-       /* Set the WDT in the PMU to 1 second */
-       pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, 0x02);
-
-       ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
-               NULL);
-       if (!ali1543_south) {
-               printk(KERN_INFO PFX "ALi 1543 South-Bridge not present - WDT not set\n");
-               goto err_out;
-       }
-       pci_read_config_byte(ali1543_south, 0x5e, &tmp);
-       pci_dev_put(ali1543_south);
-       if ((tmp & 0x1e) == 0x00) {
-               if (!use_gpio) {
-                       printk(KERN_INFO PFX "Detected old alim7101 revision 'a1d'.  If this is a cobalt board, set the 'use_gpio' module parameter.\n");
-                       goto err_out;
-               } 
-               nowayout = 1;
-       } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) {
-               printk(KERN_INFO PFX "ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n");
-               goto err_out;
-       }
-
-       if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
-       {
-               timeout = WATCHDOG_TIMEOUT;
-               printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
-                       timeout);
-       }
-
-       rc = misc_register(&wdt_miscdev);
-       if (rc) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       wdt_miscdev.minor, rc);
-               goto err_out;
-       }
-
-       rc = register_reboot_notifier(&wdt_notifier);
-       if (rc) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_miscdev;
-       }
-
-       if (nowayout) {
-               __module_get(THIS_MODULE);
-       }
-
-       printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-       return 0;
-
-err_out_miscdev:
-       misc_deregister(&wdt_miscdev);
-err_out:
-       pci_dev_put(alim7101_pmu);
-       return rc;
-}
-
-module_init(alim7101_wdt_init);
-module_exit(alim7101_wdt_unload);
-
-static struct pci_device_id alim7101_pci_tbl[] __devinitdata = {
-       { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533) },
-       { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
-       { }
-};
-
-MODULE_DEVICE_TABLE(pci, alim7101_pci_tbl);
-
-MODULE_AUTHOR("Steve Hill");
-MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/at32ap700x_wdt.c b/drivers/char/watchdog/at32ap700x_wdt.c
deleted file mode 100644 (file)
index 54a5161..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Watchdog driver for Atmel AT32AP700X devices
- *
- * Copyright (C) 2005-2006 Atmel Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/miscdevice.h>
-#include <linux/fs.h>
-#include <linux/platform_device.h>
-#include <linux/watchdog.h>
-#include <linux/uaccess.h>
-#include <linux/io.h>
-#include <linux/spinlock.h>
-
-#define TIMEOUT_MIN            1
-#define TIMEOUT_MAX            2
-#define TIMEOUT_DEFAULT                TIMEOUT_MAX
-
-/* module parameters */
-static int timeout =  TIMEOUT_DEFAULT;
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout,
-               "Timeout value. Limited to be 1 or 2 seconds. (default="
-               __MODULE_STRING(TIMEOUT_DEFAULT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/* Watchdog registers and write/read macro */
-#define WDT_CTRL               0x00
-#define WDT_CTRL_EN               0
-#define WDT_CTRL_PSEL             8
-#define WDT_CTRL_KEY             24
-
-#define WDT_CLR                        0x04
-
-#define WDT_BIT(name)          (1 << WDT_##name)
-#define WDT_BF(name, value)    ((value) << WDT_##name)
-
-#define wdt_readl(dev, reg)                            \
-       __raw_readl((dev)->regs + WDT_##reg)
-#define wdt_writel(dev, reg, value)                    \
-       __raw_writel((value), (dev)->regs + WDT_##reg)
-
-struct wdt_at32ap700x {
-       void __iomem            *regs;
-       spinlock_t              io_lock;
-       int                     timeout;
-       unsigned long           users;
-       struct miscdevice       miscdev;
-};
-
-static struct wdt_at32ap700x *wdt;
-static char expect_release;
-
-/*
- * Disable the watchdog.
- */
-static inline void at32_wdt_stop(void)
-{
-       unsigned long psel;
-
-       spin_lock(&wdt->io_lock);
-       psel = wdt_readl(wdt, CTRL) & WDT_BF(CTRL_PSEL, 0x0f);
-       wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0x55));
-       wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0xaa));
-       spin_unlock(&wdt->io_lock);
-}
-
-/*
- * Enable and reset the watchdog.
- */
-static inline void at32_wdt_start(void)
-{
-       /* 0xf is 2^16 divider = 2 sec, 0xe is 2^15 divider = 1 sec */
-       unsigned long psel = (wdt->timeout > 1) ? 0xf : 0xe;
-
-       spin_lock(&wdt->io_lock);
-       wdt_writel(wdt, CTRL, WDT_BIT(CTRL_EN)
-                       | WDT_BF(CTRL_PSEL, psel)
-                       | WDT_BF(CTRL_KEY, 0x55));
-       wdt_writel(wdt, CTRL, WDT_BIT(CTRL_EN)
-                       | WDT_BF(CTRL_PSEL, psel)
-                       | WDT_BF(CTRL_KEY, 0xaa));
-       spin_unlock(&wdt->io_lock);
-}
-
-/*
- * Pat the watchdog timer.
- */
-static inline void at32_wdt_pat(void)
-{
-       spin_lock(&wdt->io_lock);
-       wdt_writel(wdt, CLR, 0x42);
-       spin_unlock(&wdt->io_lock);
-}
-
-/*
- * Watchdog device is opened, and watchdog starts running.
- */
-static int at32_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(1, &wdt->users))
-               return -EBUSY;
-
-       at32_wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-/*
- * Close the watchdog device.
- */
-static int at32_wdt_close(struct inode *inode, struct file *file)
-{
-       if (expect_release == 42) {
-               at32_wdt_stop();
-       } else {
-               dev_dbg(wdt->miscdev.parent,
-                       "Unexpected close, not stopping watchdog!\n");
-               at32_wdt_pat();
-       }
-       clear_bit(1, &wdt->users);
-       expect_release = 0;
-       return 0;
-}
-
-/*
- * Change the watchdog time interval.
- */
-static int at32_wdt_settimeout(int time)
-{
-       /*
-        * All counting occurs at 1 / SLOW_CLOCK (32 kHz) and max prescaler is
-        * 2 ^ 16 allowing up to 2 seconds timeout.
-        */
-       if ((time < TIMEOUT_MIN) || (time > TIMEOUT_MAX))
-               return -EINVAL;
-
-       /*
-        * Set new watchdog time. It will be used when at32_wdt_start() is
-        * called.
-        */
-       wdt->timeout = time;
-       return 0;
-}
-
-static struct watchdog_info at32_wdt_info = {
-       .identity       = "at32ap700x watchdog",
-       .options        = WDIOF_SETTIMEOUT |
-                         WDIOF_KEEPALIVEPING |
-                         WDIOF_MAGICCLOSE,
-};
-
-/*
- * Handle commands from user-space.
- */
-static int at32_wdt_ioctl(struct inode *inode, struct file *file,
-               unsigned int cmd, unsigned long arg)
-{
-       int ret = -ENOTTY;
-       int time;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-
-       switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               at32_wdt_pat();
-               ret = 0;
-               break;
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user(argp, &at32_wdt_info,
-                               sizeof(at32_wdt_info)) ? -EFAULT : 0;
-               break;
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(time, p);
-               if (ret)
-                       break;
-               ret = at32_wdt_settimeout(time);
-               if (ret)
-                       break;
-               /* Enable new time value */
-               at32_wdt_start();
-               /* fall through */
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(wdt->timeout, p);
-               break;
-       case WDIOC_GETSTATUS: /* fall through */
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(0, p);
-               break;
-       case WDIOC_SETOPTIONS:
-               ret = get_user(time, p);
-               if (ret)
-                       break;
-               if (time & WDIOS_DISABLECARD)
-                       at32_wdt_stop();
-               if (time & WDIOS_ENABLECARD)
-                       at32_wdt_start();
-               ret = 0;
-               break;
-       }
-
-       return ret;
-}
-
-static ssize_t at32_wdt_write(struct file *file, const char __user *data,
-                               size_t len, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /*
-                        * note: just in case someone wrote the magic
-                        * character five months ago...
-                        */
-                       expect_release = 0;
-
-                       /*
-                        * scan to see whether or not we got the magic
-                        * character
-                        */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if (get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_release = 42;
-                       }
-               }
-               /* someone wrote to us, we should pat the watchdog */
-               at32_wdt_pat();
-       }
-       return len;
-}
-
-static const struct file_operations at32_wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .ioctl          = at32_wdt_ioctl,
-       .open           = at32_wdt_open,
-       .release        = at32_wdt_close,
-       .write          = at32_wdt_write,
-};
-
-static int __init at32_wdt_probe(struct platform_device *pdev)
-{
-       struct resource *regs;
-       int ret;
-
-       if (wdt) {
-               dev_dbg(&pdev->dev, "only 1 wdt instance supported.\n");
-               return -EBUSY;
-       }
-
-       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!regs) {
-               dev_dbg(&pdev->dev, "missing mmio resource\n");
-               return -ENXIO;
-       }
-
-       wdt = kzalloc(sizeof(struct wdt_at32ap700x), GFP_KERNEL);
-       if (!wdt) {
-               dev_dbg(&pdev->dev, "no memory for wdt structure\n");
-               return -ENOMEM;
-       }
-
-       wdt->regs = ioremap(regs->start, regs->end - regs->start + 1);
-       if (!wdt->regs) {
-               ret = -ENOMEM;
-               dev_dbg(&pdev->dev, "could not map I/O memory\n");
-               goto err_free;
-       }
-       spin_lock_init(&wdt->io_lock);
-       wdt->users = 0;
-       wdt->miscdev.minor = WATCHDOG_MINOR;
-       wdt->miscdev.name = "watchdog";
-       wdt->miscdev.fops = &at32_wdt_fops;
-
-       if (at32_wdt_settimeout(timeout)) {
-               at32_wdt_settimeout(TIMEOUT_DEFAULT);
-               dev_dbg(&pdev->dev,
-                       "default timeout invalid, set to %d sec.\n",
-                       TIMEOUT_DEFAULT);
-       }
-
-       ret = misc_register(&wdt->miscdev);
-       if (ret) {
-               dev_dbg(&pdev->dev, "failed to register wdt miscdev\n");
-               goto err_iounmap;
-       }
-
-       platform_set_drvdata(pdev, wdt);
-       wdt->miscdev.parent = &pdev->dev;
-       dev_info(&pdev->dev,
-               "AT32AP700X WDT at 0x%p, timeout %d sec (nowayout=%d)\n",
-               wdt->regs, wdt->timeout, nowayout);
-
-       return 0;
-
-err_iounmap:
-       iounmap(wdt->regs);
-err_free:
-       kfree(wdt);
-       wdt = NULL;
-       return ret;
-}
-
-static int __exit at32_wdt_remove(struct platform_device *pdev)
-{
-       if (wdt && platform_get_drvdata(pdev) == wdt) {
-               /* Stop the timer before we leave */
-               if (!nowayout)
-                       at32_wdt_stop();
-
-               misc_deregister(&wdt->miscdev);
-               iounmap(wdt->regs);
-               kfree(wdt);
-               wdt = NULL;
-               platform_set_drvdata(pdev, NULL);
-       }
-
-       return 0;
-}
-
-static void at32_wdt_shutdown(struct platform_device *pdev)
-{
-       at32_wdt_stop();
-}
-
-#ifdef CONFIG_PM
-static int at32_wdt_suspend(struct platform_device *pdev, pm_message_t message)
-{
-       at32_wdt_stop();
-       return 0;
-}
-
-static int at32_wdt_resume(struct platform_device *pdev)
-{
-       if (wdt->users)
-               at32_wdt_start();
-       return 0;
-}
-#else
-#define at32_wdt_suspend NULL
-#define at32_wdt_resume NULL
-#endif
-
-static struct platform_driver at32_wdt_driver = {
-       .remove         = __exit_p(at32_wdt_remove),
-       .suspend        = at32_wdt_suspend,
-       .resume         = at32_wdt_resume,
-       .driver         = {
-               .name   = "at32_wdt",
-               .owner  = THIS_MODULE,
-       },
-       .shutdown       = at32_wdt_shutdown,
-};
-
-static int __init at32_wdt_init(void)
-{
-       return platform_driver_probe(&at32_wdt_driver, at32_wdt_probe);
-}
-module_init(at32_wdt_init);
-
-static void __exit at32_wdt_exit(void)
-{
-       platform_driver_unregister(&at32_wdt_driver);
-}
-module_exit(at32_wdt_exit);
-
-MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
-MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/at91rm9200_wdt.c b/drivers/char/watchdog/at91rm9200_wdt.c
deleted file mode 100644 (file)
index 38bd373..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Watchdog driver for Atmel AT91RM9200 (Thunder)
- *
- *  Copyright (C) 2003 SAN People (Pty) Ltd
- *
- * 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.
- */
-
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-#include <asm/bitops.h>
-#include <asm/uaccess.h>
-#include <asm/arch/at91_st.h>
-
-
-#define WDT_DEFAULT_TIME       5       /* seconds */
-#define WDT_MAX_TIME           256     /* seconds */
-
-static int wdt_time = WDT_DEFAULT_TIME;
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(wdt_time, int, 0);
-MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="__MODULE_STRING(WDT_DEFAULT_TIME) ")");
-
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-#endif
-
-
-static unsigned long at91wdt_busy;
-
-/* ......................................................................... */
-
-/*
- * Disable the watchdog.
- */
-static void inline at91_wdt_stop(void)
-{
-       at91_sys_write(AT91_ST_WDMR, AT91_ST_EXTEN);
-}
-
-/*
- * Enable and reset the watchdog.
- */
-static void inline at91_wdt_start(void)
-{
-       at91_sys_write(AT91_ST_WDMR, AT91_ST_EXTEN | AT91_ST_RSTEN | (((65536 * wdt_time) >> 8) & AT91_ST_WDV));
-       at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
-}
-
-/*
- * Reload the watchdog timer.  (ie, pat the watchdog)
- */
-static void inline at91_wdt_reload(void)
-{
-       at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
-}
-
-/* ......................................................................... */
-
-/*
- * Watchdog device is opened, and watchdog starts running.
- */
-static int at91_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &at91wdt_busy))
-               return -EBUSY;
-
-       at91_wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-/*
- * Close the watchdog device.
- * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
- *  disabled.
- */
-static int at91_wdt_close(struct inode *inode, struct file *file)
-{
-       if (!nowayout)
-               at91_wdt_stop();        /* Disable the watchdog when file is closed */
-
-       clear_bit(0, &at91wdt_busy);
-       return 0;
-}
-
-/*
- * Change the watchdog time interval.
- */
-static int at91_wdt_settimeout(int new_time)
-{
-       /*
-        * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
-        *
-        * Since WDV is a 16-bit counter, the maximum period is
-        * 65536 / 0.256 = 256 seconds.
-        */
-       if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
-               return -EINVAL;
-
-       /* Set new watchdog time. It will be used when at91_wdt_start() is called. */
-       wdt_time = new_time;
-       return 0;
-}
-
-static struct watchdog_info at91_wdt_info = {
-       .identity       = "at91 watchdog",
-       .options        = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-};
-
-/*
- * Handle commands from user-space.
- */
-static int at91_wdt_ioctl(struct inode *inode, struct file *file,
-               unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_value;
-
-       switch(cmd) {
-               case WDIOC_KEEPALIVE:
-                       at91_wdt_reload();      /* pat the watchdog */
-                       return 0;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &at91_wdt_info, sizeof(at91_wdt_info)) ? -EFAULT : 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_value, p))
-                               return -EFAULT;
-
-                       if (at91_wdt_settimeout(new_value))
-                               return -EINVAL;
-
-                       /* Enable new time value */
-                       at91_wdt_start();
-
-                       /* Return current value */
-                       return put_user(wdt_time, p);
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(wdt_time, p);
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_SETOPTIONS:
-                       if (get_user(new_value, p))
-                               return -EFAULT;
-
-                       if (new_value & WDIOS_DISABLECARD)
-                               at91_wdt_stop();
-                       if (new_value & WDIOS_ENABLECARD)
-                               at91_wdt_start();
-                       return 0;
-
-               default:
-                       return -ENOTTY;
-       }
-}
-
-/*
- * Pat the watchdog whenever device is written to.
- */
-static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       at91_wdt_reload();              /* pat the watchdog */
-       return len;
-}
-
-/* ......................................................................... */
-
-static const struct file_operations at91wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .ioctl          = at91_wdt_ioctl,
-       .open           = at91_wdt_open,
-       .release        = at91_wdt_close,
-       .write          = at91_wdt_write,
-};
-
-static struct miscdevice at91wdt_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &at91wdt_fops,
-};
-
-static int __init at91wdt_probe(struct platform_device *pdev)
-{
-       int res;
-
-       if (at91wdt_miscdev.parent)
-               return -EBUSY;
-       at91wdt_miscdev.parent = &pdev->dev;
-
-       res = misc_register(&at91wdt_miscdev);
-       if (res)
-               return res;
-
-       printk("AT91 Watchdog Timer enabled (%d seconds%s)\n", wdt_time, nowayout ? ", nowayout" : "");
-       return 0;
-}
-
-static int __exit at91wdt_remove(struct platform_device *pdev)
-{
-       int res;
-
-       res = misc_deregister(&at91wdt_miscdev);
-       if (!res)
-               at91wdt_miscdev.parent = NULL;
-
-       return res;
-}
-
-static void at91wdt_shutdown(struct platform_device *pdev)
-{
-       at91_wdt_stop();
-}
-
-#ifdef CONFIG_PM
-
-static int at91wdt_suspend(struct platform_device *pdev, pm_message_t message)
-{
-       at91_wdt_stop();
-       return 0;
-}
-
-static int at91wdt_resume(struct platform_device *pdev)
-{
-       if (at91wdt_busy)
-               at91_wdt_start();
-               return 0;
-}
-
-#else
-#define at91wdt_suspend NULL
-#define at91wdt_resume NULL
-#endif
-
-static struct platform_driver at91wdt_driver = {
-       .probe          = at91wdt_probe,
-       .remove         = __exit_p(at91wdt_remove),
-       .shutdown       = at91wdt_shutdown,
-       .suspend        = at91wdt_suspend,
-       .resume         = at91wdt_resume,
-       .driver         = {
-               .name   = "at91_wdt",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init at91_wdt_init(void)
-{
-       /* Check that the heartbeat value is within range; if not reset to the default */
-       if (at91_wdt_settimeout(wdt_time)) {
-               at91_wdt_settimeout(WDT_DEFAULT_TIME);
-               pr_info("at91_wdt: wdt_time value must be 1 <= wdt_time <= 256, using %d\n", wdt_time);
-       }
-
-       return platform_driver_register(&at91wdt_driver);
-}
-
-static void __exit at91_wdt_exit(void)
-{
-       platform_driver_unregister(&at91wdt_driver);
-}
-
-module_init(at91_wdt_init);
-module_exit(at91_wdt_exit);
-
-MODULE_AUTHOR("Andrew Victor");
-MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/bfin_wdt.c b/drivers/char/watchdog/bfin_wdt.c
deleted file mode 100644 (file)
index 309d279..0000000
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * Blackfin On-Chip Watchdog Driver
- *  Supports BF53[123]/BF53[467]/BF54[2489]/BF561
- *
- * Originally based on softdog.c
- * Copyright 2006-2007 Analog Devices Inc.
- * Copyright 2006-2007 Michele d'Amico
- * Copyright 1996 Alan Cox <alan@redhat.com>
- *
- * Enter bugs at http://blackfin.uclinux.org/
- *
- * Licensed under the GPL-2 or later.
- */
-
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <asm/blackfin.h>
-#include <asm/uaccess.h>
-
-#define stamp(fmt, args...) pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args)
-#define stampit() stamp("here i am")
-
-#define WATCHDOG_NAME "bfin-wdt"
-#define PFX WATCHDOG_NAME ": "
-
-/* The BF561 has two watchdogs (one per core), but since Linux
- * only runs on core A, we'll just work with that one.
- */
-#ifdef BF561_FAMILY
-# define bfin_read_WDOG_CTL()    bfin_read_WDOGA_CTL()
-# define bfin_read_WDOG_CNT()    bfin_read_WDOGA_CNT()
-# define bfin_read_WDOG_STAT()   bfin_read_WDOGA_STAT()
-# define bfin_write_WDOG_CTL(x)  bfin_write_WDOGA_CTL(x)
-# define bfin_write_WDOG_CNT(x)  bfin_write_WDOGA_CNT(x)
-# define bfin_write_WDOG_STAT(x) bfin_write_WDOGA_STAT(x)
-#endif
-
-/* Bit in SWRST that indicates boot caused by watchdog */
-#define SWRST_RESET_WDOG 0x4000
-
-/* Bit in WDOG_CTL that indicates watchdog has expired (WDR0) */
-#define WDOG_EXPIRED 0x8000
-
-/* Masks for WDEV field in WDOG_CTL register */
-#define ICTL_RESET   0x0
-#define ICTL_NMI     0x2
-#define ICTL_GPI     0x4
-#define ICTL_NONE    0x6
-#define ICTL_MASK    0x6
-
-/* Masks for WDEN field in WDOG_CTL register */
-#define WDEN_MASK    0x0FF0
-#define WDEN_ENABLE  0x0000
-#define WDEN_DISABLE 0x0AD0
-
-/* some defaults */
-#define WATCHDOG_TIMEOUT 20
-
-static unsigned int timeout = WATCHDOG_TIMEOUT;
-static int nowayout = WATCHDOG_NOWAYOUT;
-static struct watchdog_info bfin_wdt_info;
-static unsigned long open_check;
-static char expect_close;
-static spinlock_t bfin_wdt_spinlock = SPIN_LOCK_UNLOCKED;
-
-/**
- *     bfin_wdt_keepalive - Keep the Userspace Watchdog Alive
- *
- *     The Userspace watchdog got a KeepAlive: schedule the next timeout.
- */
-static int bfin_wdt_keepalive(void)
-{
-       stampit();
-       bfin_write_WDOG_STAT(0);
-       return 0;
-}
-
-/**
- *     bfin_wdt_stop - Stop the Watchdog
- *
- *     Stops the on-chip watchdog.
- */
-static int bfin_wdt_stop(void)
-{
-       stampit();
-       bfin_write_WDOG_CTL(WDEN_DISABLE);
-       return 0;
-}
-
-/**
- *     bfin_wdt_start - Start the Watchdog
- *
- *     Starts the on-chip watchdog.  Automatically loads WDOG_CNT
- *     into WDOG_STAT for us.
- */
-static int bfin_wdt_start(void)
-{
-       stampit();
-       bfin_write_WDOG_CTL(WDEN_ENABLE | ICTL_RESET);
-       return 0;
-}
-
-/**
- *     bfin_wdt_running - Check Watchdog status
- *
- *     See if the watchdog is running.
- */
-static int bfin_wdt_running(void)
-{
-       stampit();
-       return ((bfin_read_WDOG_CTL() & WDEN_MASK) != WDEN_DISABLE);
-}
-
-/**
- *     bfin_wdt_set_timeout - Set the Userspace Watchdog timeout
- *     @t: new timeout value (in seconds)
- *
- *     Translate the specified timeout in seconds into System Clock
- *     terms which is what the on-chip Watchdog requires.
- */
-static int bfin_wdt_set_timeout(unsigned long t)
-{
-       u32 cnt;
-       unsigned long flags;
-
-       stampit();
-
-       cnt = t * get_sclk();
-       if (cnt < get_sclk()) {
-               printk(KERN_WARNING PFX "timeout value is too large\n");
-               return -EINVAL;
-       }
-
-       spin_lock_irqsave(&bfin_wdt_spinlock, flags);
-       {
-               int run = bfin_wdt_running();
-               bfin_wdt_stop();
-               bfin_write_WDOG_CNT(cnt);
-               if (run) bfin_wdt_start();
-       }
-       spin_unlock_irqrestore(&bfin_wdt_spinlock, flags);
-
-       timeout = t;
-
-       return 0;
-}
-
-/**
- *     bfin_wdt_open - Open the Device
- *     @inode: inode of device
- *     @file: file handle of device
- *
- *     Watchdog device is opened and started.
- */
-static int bfin_wdt_open(struct inode *inode, struct file *file)
-{
-       stampit();
-
-       if (test_and_set_bit(0, &open_check))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       bfin_wdt_keepalive();
-       bfin_wdt_start();
-
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     bfin_wdt_close - Close the Device
- *     @inode: inode of device
- *     @file: file handle of device
- *
- *     Watchdog device is closed and stopped.
- */
-static int bfin_wdt_release(struct inode *inode, struct file *file)
-{
-       stampit();
-
-       if (expect_close == 42) {
-               bfin_wdt_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               bfin_wdt_keepalive();
-       }
-
-       expect_close = 0;
-       clear_bit(0, &open_check);
-
-       return 0;
-}
-
-/**
- *     bfin_wdt_write - Write to Device
- *     @file: file handle of device
- *     @buf: buffer to write
- *     @count: length of buffer
- *     @ppos: offset
- *
- *     Pings the watchdog on write.
- */
-static ssize_t bfin_wdt_write(struct file *file, const char __user *data,
-                              size_t len, loff_t *ppos)
-{
-       stampit();
-
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               bfin_wdt_keepalive();
-       }
-
-       return len;
-}
-
-/**
- *     bfin_wdt_ioctl - Query Device
- *     @inode: inode of device
- *     @file: file handle of device
- *     @cmd: watchdog command
- *     @arg: argument
- *
- *     Query basic information from the device or ping it, as outlined by the
- *     watchdog API.
- */
-static int bfin_wdt_ioctl(struct inode *inode, struct file *file,
-                          unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-
-       stampit();
-
-       switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user(argp, &bfin_wdt_info, sizeof(bfin_wdt_info)))
-                               return -EFAULT;
-                       else
-                               return 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(!!(_bfin_swrst & SWRST_RESET_WDOG), p);
-
-               case WDIOC_KEEPALIVE:
-                       bfin_wdt_keepalive();
-                       return 0;
-
-               case WDIOC_SETTIMEOUT: {
-                       int new_timeout;
-
-                       if (get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       if (bfin_wdt_set_timeout(new_timeout))
-                               return -EINVAL;
-               }
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout, p);
-
-               case WDIOC_SETOPTIONS: {
-                       unsigned long flags;
-                       int options, ret = -EINVAL;
-
-                       if (get_user(options, p))
-                               return -EFAULT;
-
-                       spin_lock_irqsave(&bfin_wdt_spinlock, flags);
-
-                       if (options & WDIOS_DISABLECARD) {
-                               bfin_wdt_stop();
-                               ret = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               bfin_wdt_start();
-                               ret = 0;
-                       }
-
-                       spin_unlock_irqrestore(&bfin_wdt_spinlock, flags);
-
-                       return ret;
-               }
-       }
-}
-
-/**
- *     bfin_wdt_notify_sys - Notifier Handler
- *     @this: notifier block
- *     @code: notifier event
- *     @unused: unused
- *
- *     Handles specific events, such as turning off the watchdog during a
- *     shutdown event.
- */
-static int bfin_wdt_notify_sys(struct notifier_block *this, unsigned long code,
-                               void *unused)
-{
-       stampit();
-
-       if (code == SYS_DOWN || code == SYS_HALT)
-               bfin_wdt_stop();
-
-       return NOTIFY_DONE;
-}
-
-#ifdef CONFIG_PM
-static int state_before_suspend;
-
-/**
- *     bfin_wdt_suspend - suspend the watchdog
- *     @pdev: device being suspended
- *     @state: requested suspend state
- *
- *     Remember if the watchdog was running and stop it.
- *     TODO: is this even right?  Doesn't seem to be any
- *           standard in the watchdog world ...
- */
-static int bfin_wdt_suspend(struct platform_device *pdev, pm_message_t state)
-{
-       stampit();
-
-       state_before_suspend = bfin_wdt_running();
-       bfin_wdt_stop();
-
-       return 0;
-}
-
-/**
- *     bfin_wdt_resume - resume the watchdog
- *     @pdev: device being resumed
- *
- *     If the watchdog was running, turn it back on.
- */
-static int bfin_wdt_resume(struct platform_device *pdev)
-{
-       stampit();
-
-       if (state_before_suspend) {
-               bfin_wdt_set_timeout(timeout);
-               bfin_wdt_start();
-       }
-
-       return 0;
-}
-#else
-# define bfin_wdt_suspend NULL
-# define bfin_wdt_resume NULL
-#endif
-
-static struct platform_device bfin_wdt_device = {
-       .name          = WATCHDOG_NAME,
-       .id            = -1,
-};
-
-static struct platform_driver bfin_wdt_driver = {
-       .driver    = {
-               .name  = WATCHDOG_NAME,
-               .owner = THIS_MODULE,
-       },
-       .suspend   = bfin_wdt_suspend,
-       .resume    = bfin_wdt_resume,
-};
-
-static struct file_operations bfin_wdt_fops = {
-       .owner    = THIS_MODULE,
-       .llseek   = no_llseek,
-       .write    = bfin_wdt_write,
-       .ioctl    = bfin_wdt_ioctl,
-       .open     = bfin_wdt_open,
-       .release  = bfin_wdt_release,
-};
-
-static struct miscdevice bfin_wdt_miscdev = {
-       .minor    = WATCHDOG_MINOR,
-       .name     = "watchdog",
-       .fops     = &bfin_wdt_fops,
-};
-
-static struct watchdog_info bfin_wdt_info = {
-       .identity = "Blackfin Watchdog",
-       .options  = WDIOF_SETTIMEOUT |
-                   WDIOF_KEEPALIVEPING |
-                   WDIOF_MAGICCLOSE,
-};
-
-static struct notifier_block bfin_wdt_notifier = {
-       .notifier_call = bfin_wdt_notify_sys,
-};
-
-/**
- *     bfin_wdt_init - Initialize module
- *
- *     Registers the device and notifier handler. Actual device
- *     initialization is handled by bfin_wdt_open().
- */
-static int __init bfin_wdt_init(void)
-{
-       int ret;
-
-       stampit();
-
-       /* Check that the timeout value is within range */
-       if (bfin_wdt_set_timeout(timeout))
-               return -EINVAL;
-
-       /* Since this is an on-chip device and needs no board-specific
-        * resources, we'll handle all the platform device stuff here.
-        */
-       ret = platform_device_register(&bfin_wdt_device);
-       if (ret)
-               return ret;
-
-       ret = platform_driver_probe(&bfin_wdt_driver, NULL);
-       if (ret)
-               return ret;
-
-       ret = register_reboot_notifier(&bfin_wdt_notifier);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
-               return ret;
-       }
-
-       ret = misc_register(&bfin_wdt_miscdev);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                      WATCHDOG_MINOR, ret);
-               unregister_reboot_notifier(&bfin_wdt_notifier);
-               return ret;
-       }
-
-       printk(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n",
-              timeout, nowayout);
-
-       return 0;
-}
-
-/**
- *     bfin_wdt_exit - Deinitialize module
- *
- *     Unregisters the device and notifier handler. Actual device
- *     deinitialization is handled by bfin_wdt_close().
- */
-static void __exit bfin_wdt_exit(void)
-{
-       misc_deregister(&bfin_wdt_miscdev);
-       unregister_reboot_notifier(&bfin_wdt_notifier);
-}
-
-module_init(bfin_wdt_init);
-module_exit(bfin_wdt_exit);
-
-MODULE_AUTHOR("Michele d'Amico, Mike Frysinger <vapier@gentoo.org>");
-MODULE_DESCRIPTION("Blackfin Watchdog Device Driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-module_param(timeout, uint, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=((2^32)/SCLK), default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c
deleted file mode 100644 (file)
index d362f5b..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * drivers/char/watchdog/booke_wdt.c
- *
- * Watchdog timer for PowerPC Book-E systems
- *
- * Author: Matthew McClintock
- * Maintainer: Kumar Gala <galak@kernel.crashing.org>
- *
- * Copyright 2005 Freescale Semiconductor Inc.
- *
- * 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.
- */
-
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/notifier.h>
-#include <linux/watchdog.h>
-
-#include <asm/reg_booke.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-/* If the kernel parameter wdt=1, the watchdog will be enabled at boot.
- * Also, the wdt_period sets the watchdog timer period timeout.
- * For E500 cpus the wdt_period sets which bit changing from 0->1 will
- * trigger a watchog timeout. This watchdog timeout will occur 3 times, the
- * first time nothing will happen, the second time a watchdog exception will
- * occur, and the final time the board will reset.
- */
-
-#ifdef CONFIG_FSL_BOOKE
-#define WDT_PERIOD_DEFAULT 63  /* Ex. wdt_period=28 bus=333Mhz , reset=~40sec */
-#else
-#define WDT_PERIOD_DEFAULT 3   /* Refer to the PPC40x and PPC4xx manuals */
-#endif                         /* for timing information */
-
-u32 booke_wdt_enabled = 0;
-u32 booke_wdt_period = WDT_PERIOD_DEFAULT;
-
-#ifdef CONFIG_FSL_BOOKE
-#define WDTP(x)                ((((63-x)&0x3)<<30)|(((63-x)&0x3c)<<15))
-#else
-#define WDTP(x)                (TCR_WP(x))
-#endif
-
-/*
- * booke_wdt_ping:
- */
-static __inline__ void booke_wdt_ping(void)
-{
-       mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
-}
-
-/*
- * booke_wdt_enable:
- */
-static __inline__ void booke_wdt_enable(void)
-{
-       u32 val;
-
-       /* clear status before enabling watchdog */
-       booke_wdt_ping();
-       val = mfspr(SPRN_TCR);
-       val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
-
-       mtspr(SPRN_TCR, val);
-}
-
-/*
- * booke_wdt_write:
- */
-static ssize_t booke_wdt_write (struct file *file, const char __user *buf,
-                               size_t count, loff_t *ppos)
-{
-       booke_wdt_ping();
-       return count;
-}
-
-static struct watchdog_info ident = {
-  .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-  .firmware_version = 0,
-  .identity = "PowerPC Book-E Watchdog",
-};
-
-/*
- * booke_wdt_ioctl:
- */
-static int booke_wdt_ioctl (struct inode *inode, struct file *file,
-                           unsigned int cmd, unsigned long arg)
-{
-       u32 tmp = 0;
-       u32 __user *p = (u32 __user *)arg;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user ((struct watchdog_info __user *) arg, &ident,
-                               sizeof(struct watchdog_info)))
-                       return -EFAULT;
-       case WDIOC_GETSTATUS:
-               return put_user(ident.options, p);
-       case WDIOC_GETBOOTSTATUS:
-               /* XXX: something is clearing TSR */
-               tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
-               /* returns 1 if last reset was caused by the WDT */
-               return (tmp ? 1 : 0);
-       case WDIOC_KEEPALIVE:
-               booke_wdt_ping();
-               return 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(booke_wdt_period, p))
-                       return -EFAULT;
-               mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period));
-               return 0;
-       case WDIOC_GETTIMEOUT:
-               return put_user(booke_wdt_period, p);
-       case WDIOC_SETOPTIONS:
-               if (get_user(tmp, p))
-                       return -EINVAL;
-               if (tmp == WDIOS_ENABLECARD) {
-                       booke_wdt_ping();
-                       break;
-               } else
-                       return -EINVAL;
-               return 0;
-       default:
-               return -ENOTTY;
-       }
-
-       return 0;
-}
-/*
- * booke_wdt_open:
- */
-static int booke_wdt_open (struct inode *inode, struct file *file)
-{
-       if (booke_wdt_enabled == 0) {
-               booke_wdt_enabled = 1;
-               booke_wdt_enable();
-               printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
-                               booke_wdt_period);
-       }
-
-       return nonseekable_open(inode, file);
-}
-
-static const struct file_operations booke_wdt_fops = {
-  .owner = THIS_MODULE,
-  .llseek = no_llseek,
-  .write = booke_wdt_write,
-  .ioctl = booke_wdt_ioctl,
-  .open = booke_wdt_open,
-};
-
-static struct miscdevice booke_wdt_miscdev = {
-  .minor = WATCHDOG_MINOR,
-  .name = "watchdog",
-  .fops = &booke_wdt_fops,
-};
-
-static void __exit booke_wdt_exit(void)
-{
-       misc_deregister(&booke_wdt_miscdev);
-}
-
-/*
- * booke_wdt_init:
- */
-static int __init booke_wdt_init(void)
-{
-       int ret = 0;
-
-       printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");
-       ident.firmware_version = cur_cpu_spec->pvr_value;
-
-       ret = misc_register(&booke_wdt_miscdev);
-       if (ret) {
-               printk (KERN_CRIT "Cannot register miscdev on minor=%d (err=%d)\n",
-                               WATCHDOG_MINOR, ret);
-               return ret;
-       }
-
-       if (booke_wdt_enabled == 1) {
-               printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
-                               booke_wdt_period);
-               booke_wdt_enable();
-       }
-
-       return ret;
-}
-device_initcall(booke_wdt_init);
diff --git a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c
deleted file mode 100644 (file)
index 5941ca6..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * sma cpu5 watchdog driver
- *
- * Copyright (C) 2003 Heiko Ronsdorf <hero@ihg.uni-duisburg.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/miscdevice.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/timer.h>
-#include <linux/completion.h>
-#include <linux/jiffies.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#include <linux/watchdog.h>
-
-/* adjustable parameters */
-
-static int verbose = 0;
-static int port = 0x91;
-static int ticks = 10000;
-
-#define PFX                    "cpu5wdt: "
-
-#define CPU5WDT_EXTENT          0x0A
-
-#define CPU5WDT_STATUS_REG      0x00
-#define CPU5WDT_TIME_A_REG      0x02
-#define CPU5WDT_TIME_B_REG      0x03
-#define CPU5WDT_MODE_REG        0x04
-#define CPU5WDT_TRIGGER_REG     0x07
-#define CPU5WDT_ENABLE_REG      0x08
-#define CPU5WDT_RESET_REG       0x09
-
-#define CPU5WDT_INTERVAL       (HZ/10+1)
-
-/* some device data */
-
-static struct {
-       struct completion stop;
-       volatile int running;
-       struct timer_list timer;
-       volatile int queue;
-       int default_ticks;
-       unsigned long inuse;
-} cpu5wdt_device;
-
-/* generic helper functions */
-
-static void cpu5wdt_trigger(unsigned long unused)
-{
-       if ( verbose > 2 )
-               printk(KERN_DEBUG PFX "trigger at %i ticks\n", ticks);
-
-       if( cpu5wdt_device.running )
-               ticks--;
-
-       /* keep watchdog alive */
-       outb(1, port + CPU5WDT_TRIGGER_REG);
-
-       /* requeue?? */
-       if (cpu5wdt_device.queue && ticks)
-               mod_timer(&cpu5wdt_device.timer, jiffies + CPU5WDT_INTERVAL);
-       else {
-               /* ticks doesn't matter anyway */
-               complete(&cpu5wdt_device.stop);
-       }
-
-}
-
-static void cpu5wdt_reset(void)
-{
-       ticks = cpu5wdt_device.default_ticks;
-
-       if ( verbose )
-               printk(KERN_DEBUG PFX "reset (%i ticks)\n", (int) ticks);
-
-}
-
-static void cpu5wdt_start(void)
-{
-       if ( !cpu5wdt_device.queue ) {
-               cpu5wdt_device.queue = 1;
-               outb(0, port + CPU5WDT_TIME_A_REG);
-               outb(0, port + CPU5WDT_TIME_B_REG);
-               outb(1, port + CPU5WDT_MODE_REG);
-               outb(0, port + CPU5WDT_RESET_REG);
-               outb(0, port + CPU5WDT_ENABLE_REG);
-               mod_timer(&cpu5wdt_device.timer, jiffies + CPU5WDT_INTERVAL);
-       }
-       /* if process dies, counter is not decremented */
-       cpu5wdt_device.running++;
-}
-
-static int cpu5wdt_stop(void)
-{
-       if ( cpu5wdt_device.running )
-               cpu5wdt_device.running = 0;
-
-       ticks = cpu5wdt_device.default_ticks;
-
-       if ( verbose )
-               printk(KERN_CRIT PFX "stop not possible\n");
-
-       return -EIO;
-}
-
-/* filesystem operations */
-
-static int cpu5wdt_open(struct inode *inode, struct file *file)
-{
-       if ( test_and_set_bit(0, &cpu5wdt_device.inuse) )
-               return -EBUSY;
-
-       return nonseekable_open(inode, file);
-}
-
-static int cpu5wdt_release(struct inode *inode, struct file *file)
-{
-       clear_bit(0, &cpu5wdt_device.inuse);
-       return 0;
-}
-
-static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       unsigned int value;
-       static struct watchdog_info ident =
-       {
-               .options = WDIOF_CARDRESET,
-               .identity = "CPU5 WDT",
-       };
-
-       switch(cmd) {
-               case WDIOC_KEEPALIVE:
-                       cpu5wdt_reset();
-                       break;
-               case WDIOC_GETSTATUS:
-                       value = inb(port + CPU5WDT_STATUS_REG);
-                       value = (value >> 2) & 1;
-                       if ( copy_to_user(argp, &value, sizeof(int)) )
-                               return -EFAULT;
-                       break;
-               case WDIOC_GETBOOTSTATUS:
-                       if ( copy_to_user(argp, &value, sizeof(int)) )
-                               return -EFAULT;
-                       break;
-               case WDIOC_GETSUPPORT:
-                       if ( copy_to_user(argp, &ident, sizeof(ident)) )
-                               return -EFAULT;
-                       break;
-               case WDIOC_SETOPTIONS:
-                       if ( copy_from_user(&value, argp, sizeof(int)) )
-                               return -EFAULT;
-                       switch(value) {
-                               case WDIOS_ENABLECARD:
-                                       cpu5wdt_start();
-                                       break;
-                               case WDIOS_DISABLECARD:
-                                       return cpu5wdt_stop();
-                               default:
-                                       return -EINVAL;
-                       }
-                       break;
-               default:
-                       return -ENOTTY;
-       }
-       return 0;
-}
-
-static ssize_t cpu5wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if ( !count )
-               return -EIO;
-
-       cpu5wdt_reset();
-
-       return count;
-}
-
-static const struct file_operations cpu5wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .ioctl          = cpu5wdt_ioctl,
-       .open           = cpu5wdt_open,
-       .write          = cpu5wdt_write,
-       .release        = cpu5wdt_release,
-};
-
-static struct miscdevice cpu5wdt_misc = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &cpu5wdt_fops,
-};
-
-/* init/exit function */
-
-static int __devinit cpu5wdt_init(void)
-{
-       unsigned int val;
-       int err;
-
-       if ( verbose )
-               printk(KERN_DEBUG PFX "port=0x%x, verbose=%i\n", port, verbose);
-
-       if ( !request_region(port, CPU5WDT_EXTENT, PFX) ) {
-               printk(KERN_ERR PFX "request_region failed\n");
-               err = -EBUSY;
-               goto no_port;
-       }
-
-       if ( (err = misc_register(&cpu5wdt_misc)) < 0 ) {
-               printk(KERN_ERR PFX "misc_register failed\n");
-               goto no_misc;
-       }
-
-       /* watchdog reboot? */
-       val = inb(port + CPU5WDT_STATUS_REG);
-       val = (val >> 2) & 1;
-       if ( !val )
-               printk(KERN_INFO PFX "sorry, was my fault\n");
-
-       init_completion(&cpu5wdt_device.stop);
-       cpu5wdt_device.queue = 0;
-
-       clear_bit(0, &cpu5wdt_device.inuse);
-
-       setup_timer(&cpu5wdt_device.timer, cpu5wdt_trigger, 0);
-
-       cpu5wdt_device.default_ticks = ticks;
-
-       printk(KERN_INFO PFX "init success\n");
-
-       return 0;
-
-no_misc:
-       release_region(port, CPU5WDT_EXTENT);
-no_port:
-       return err;
-}
-
-static int __devinit cpu5wdt_init_module(void)
-{
-       return cpu5wdt_init();
-}
-
-static void __devexit cpu5wdt_exit(void)
-{
-       if ( cpu5wdt_device.queue ) {
-               cpu5wdt_device.queue = 0;
-               wait_for_completion(&cpu5wdt_device.stop);
-       }
-
-       misc_deregister(&cpu5wdt_misc);
-
-       release_region(port, CPU5WDT_EXTENT);
-
-}
-
-static void __devexit cpu5wdt_exit_module(void)
-{
-       cpu5wdt_exit();
-}
-
-/* module entry points */
-
-module_init(cpu5wdt_init_module);
-module_exit(cpu5wdt_exit_module);
-
-MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");
-MODULE_DESCRIPTION("sma cpu5 watchdog driver");
-MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-module_param(port, int, 0);
-MODULE_PARM_DESC(port, "base address of watchdog card, default is 0x91");
-
-module_param(verbose, int, 0);
-MODULE_PARM_DESC(verbose, "be verbose, default is 0 (no)");
-
-module_param(ticks, int, 0);
-MODULE_PARM_DESC(ticks, "count down ticks, default is 10000");
diff --git a/drivers/char/watchdog/davinci_wdt.c b/drivers/char/watchdog/davinci_wdt.c
deleted file mode 100644 (file)
index 19db530..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * drivers/char/watchdog/davinci_wdt.c
- *
- * Watchdog driver for DaVinci DM644x/DM646x processors
- *
- * Copyright (C) 2006 Texas Instruments.
- *
- * 2007 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/init.h>
-#include <linux/bitops.h>
-#include <linux/platform_device.h>
-#include <linux/spinlock.h>
-
-#include <asm/hardware.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#define MODULE_NAME "DAVINCI-WDT: "
-
-#define DEFAULT_HEARTBEAT 60
-#define MAX_HEARTBEAT     600  /* really the max margin is 264/27MHz*/
-
-/* Timer register set definition */
-#define PID12  (0x0)
-#define EMUMGT (0x4)
-#define TIM12  (0x10)
-#define TIM34  (0x14)
-#define PRD12  (0x18)
-#define PRD34  (0x1C)
-#define TCR    (0x20)
-#define TGCR   (0x24)
-#define WDTCR  (0x28)
-
-/* TCR bit definitions */
-#define ENAMODE12_DISABLED     (0 << 6)
-#define ENAMODE12_ONESHOT      (1 << 6)
-#define ENAMODE12_PERIODIC     (2 << 6)
-
-/* TGCR bit definitions */
-#define TIM12RS_UNRESET                (1 << 0)
-#define TIM34RS_UNRESET                (1 << 1)
-#define TIMMODE_64BIT_WDOG      (2 << 2)
-
-/* WDTCR bit definitions */
-#define WDEN                   (1 << 14)
-#define WDFLAG                 (1 << 15)
-#define WDKEY_SEQ0             (0xa5c6 << 16)
-#define WDKEY_SEQ1             (0xda7e << 16)
-
-static int heartbeat = DEFAULT_HEARTBEAT;
-
-static spinlock_t io_lock;
-static unsigned long wdt_status;
-#define WDT_IN_USE        0
-#define WDT_OK_TO_CLOSE   1
-#define WDT_REGION_INITED 2
-#define WDT_DEVICE_INITED 3
-
-static struct resource *wdt_mem;
-static void __iomem    *wdt_base;
-
-static void wdt_service(void)
-{
-       spin_lock(&io_lock);
-
-       /* put watchdog in service state */
-       davinci_writel(WDKEY_SEQ0, wdt_base + WDTCR);
-       /* put watchdog in active state */
-       davinci_writel(WDKEY_SEQ1, wdt_base + WDTCR);
-
-       spin_unlock(&io_lock);
-}
-
-static void wdt_enable(void)
-{
-       u32 tgcr;
-       u32 timer_margin;
-
-       spin_lock(&io_lock);
-
-       /* disable, internal clock source */
-       davinci_writel(0, wdt_base + TCR);
-       /* reset timer, set mode to 64-bit watchdog, and unreset */
-       davinci_writel(0, wdt_base + TGCR);
-       tgcr = TIMMODE_64BIT_WDOG | TIM12RS_UNRESET | TIM34RS_UNRESET;
-       davinci_writel(tgcr, wdt_base + TGCR);
-       /* clear counter regs */
-       davinci_writel(0, wdt_base + TIM12);
-       davinci_writel(0, wdt_base + TIM34);
-       /* set timeout period */
-       timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) & 0xffffffff);
-       davinci_writel(timer_margin, wdt_base + PRD12);
-       timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) >> 32);
-       davinci_writel(timer_margin, wdt_base + PRD34);
-       /* enable run continuously */
-       davinci_writel(ENAMODE12_PERIODIC, wdt_base + TCR);
-       /* Once the WDT is in pre-active state write to
-        * TIM12, TIM34, PRD12, PRD34, TCR, TGCR, WDTCR are
-        * write protected (except for the WDKEY field)
-        */
-       /* put watchdog in pre-active state */
-       davinci_writel(WDKEY_SEQ0 | WDEN, wdt_base + WDTCR);
-       /* put watchdog in active state */
-       davinci_writel(WDKEY_SEQ1 | WDEN, wdt_base + WDTCR);
-
-       spin_unlock(&io_lock);
-}
-
-static int davinci_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
-               return -EBUSY;
-
-       wdt_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static ssize_t
-davinci_wdt_write(struct file *file, const char *data, size_t len,
-                 loff_t *ppos)
-{
-       if (len)
-               wdt_service();
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options = WDIOF_KEEPALIVEPING,
-       .identity = "DaVinci Watchdog",
-};
-
-static int
-davinci_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                 unsigned long arg)
-{
-       int ret = -ENOTTY;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user((struct watchdog_info *)arg, &ident,
-                                  sizeof(ident)) ? -EFAULT : 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(0, (int *)arg);
-               break;
-
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(heartbeat, (int *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_service();
-               ret = 0;
-               break;
-       }
-       return ret;
-}
-
-static int davinci_wdt_release(struct inode *inode, struct file *file)
-{
-       wdt_service();
-       clear_bit(WDT_IN_USE, &wdt_status);
-
-       return 0;
-}
-
-static const struct file_operations davinci_wdt_fops = {
-       .owner = THIS_MODULE,
-       .llseek = no_llseek,
-       .write = davinci_wdt_write,
-       .ioctl = davinci_wdt_ioctl,
-       .open = davinci_wdt_open,
-       .release = davinci_wdt_release,
-};
-
-static struct miscdevice davinci_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &davinci_wdt_fops,
-};
-
-static int davinci_wdt_probe(struct platform_device *pdev)
-{
-       int ret = 0, size;
-       struct resource *res;
-
-       spin_lock_init(&io_lock);
-
-       if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
-               heartbeat = DEFAULT_HEARTBEAT;
-
-       printk(KERN_INFO MODULE_NAME
-               "DaVinci Watchdog Timer: heartbeat %d sec\n", heartbeat);
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (res == NULL) {
-               printk(KERN_INFO MODULE_NAME
-                       "failed to get memory region resource\n");
-               return -ENOENT;
-       }
-
-       size = res->end - res->start + 1;
-       wdt_mem = request_mem_region(res->start, size, pdev->name);
-
-       if (wdt_mem == NULL) {
-               printk(KERN_INFO MODULE_NAME "failed to get memory region\n");
-               return -ENOENT;
-       }
-       wdt_base = (void __iomem *)(res->start);
-
-       ret = misc_register(&davinci_wdt_miscdev);
-       if (ret < 0) {
-               printk(KERN_ERR MODULE_NAME "cannot register misc device\n");
-               release_resource(wdt_mem);
-               kfree(wdt_mem);
-       } else {
-               set_bit(WDT_DEVICE_INITED, &wdt_status);
-       }
-
-       return ret;
-}
-
-static int davinci_wdt_remove(struct platform_device *pdev)
-{
-       misc_deregister(&davinci_wdt_miscdev);
-       if (wdt_mem) {
-               release_resource(wdt_mem);
-               kfree(wdt_mem);
-               wdt_mem = NULL;
-       }
-       return 0;
-}
-
-static struct platform_driver platform_wdt_driver = {
-       .driver = {
-               .name = "watchdog",
-       },
-       .probe = davinci_wdt_probe,
-       .remove = davinci_wdt_remove,
-};
-
-static int __init davinci_wdt_init(void)
-{
-       return platform_driver_register(&platform_wdt_driver);
-}
-
-static void __exit davinci_wdt_exit(void)
-{
-       return platform_driver_unregister(&platform_wdt_driver);
-}
-
-module_init(davinci_wdt_init);
-module_exit(davinci_wdt_exit);
-
-MODULE_AUTHOR("Texas Instruments");
-MODULE_DESCRIPTION("DaVinci Watchdog Driver");
-
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat,
-                "Watchdog heartbeat period in seconds from 1 to "
-                __MODULE_STRING(MAX_HEARTBEAT) ", default "
-                __MODULE_STRING(DEFAULT_HEARTBEAT));
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/ep93xx_wdt.c b/drivers/char/watchdog/ep93xx_wdt.c
deleted file mode 100644 (file)
index 0e4787a..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Watchdog driver for Cirrus Logic EP93xx family of devices.
- *
- * Copyright (c) 2004 Ray Lehtiniemi
- * Copyright (c) 2006 Tower Technologies
- * Based on ep93xx driver, bits from alim7101_wdt.c
- *
- * Authors: Ray Lehtiniemi <rayl@mail.com>,
- *     Alessandro Zummo <a.zummo@towertech.it>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- *
- * This watchdog fires after 250msec, which is a too short interval
- * for us to rely on the user space daemon alone. So we ping the
- * wdt each ~200msec and eventually stop doing it if the user space
- * daemon dies.
- *
- * TODO:
- *
- *     - Test last reset from watchdog status
- *     - Add a few missing ioctls
- */
-
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/timer.h>
-
-#include <asm/hardware.h>
-#include <asm/uaccess.h>
-
-#define WDT_VERSION    "0.3"
-#define PFX            "ep93xx_wdt: "
-
-/* default timeout (secs) */
-#define WDT_TIMEOUT 30
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-static int timeout = WDT_TIMEOUT;
-
-static struct timer_list timer;
-static unsigned long next_heartbeat;
-static unsigned long wdt_status;
-static unsigned long boot_status;
-
-#define WDT_IN_USE             0
-#define WDT_OK_TO_CLOSE                1
-
-#define EP93XX_WDT_REG(x)      (EP93XX_WATCHDOG_BASE + (x))
-#define EP93XX_WDT_WATCHDOG    EP93XX_WDT_REG(0x00)
-#define EP93XX_WDT_WDSTATUS    EP93XX_WDT_REG(0x04)
-
-/* reset the wdt every ~200ms */
-#define WDT_INTERVAL (HZ/5)
-
-static void wdt_enable(void)
-{
-       __raw_writew(0xaaaa, EP93XX_WDT_WATCHDOG);
-}
-
-static void wdt_disable(void)
-{
-       __raw_writew(0xaa55, EP93XX_WDT_WATCHDOG);
-}
-
-static inline void wdt_ping(void)
-{
-       __raw_writew(0x5555, EP93XX_WDT_WATCHDOG);
-}
-
-static void wdt_startup(void)
-{
-       next_heartbeat = jiffies + (timeout * HZ);
-
-       wdt_enable();
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-}
-
-static void wdt_shutdown(void)
-{
-       del_timer_sync(&timer);
-       wdt_disable();
-}
-
-static void wdt_keepalive(void)
-{
-       /* user land ping */
-       next_heartbeat = jiffies + (timeout * HZ);
-}
-
-static int ep93xx_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
-               return -EBUSY;
-
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       wdt_startup();
-
-       return nonseekable_open(inode, file);
-}
-
-static ssize_t
-ep93xx_wdt_write(struct file *file, const char __user *data, size_t len,
-                loff_t *ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-
-                               if (c == 'V')
-                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                               else
-                                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                       }
-               }
-               wdt_keepalive();
-       }
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE,
-       .identity = "EP93xx Watchdog",
-};
-
-static int
-ep93xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                unsigned long arg)
-{
-       int ret = -ENOTTY;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
-                               sizeof(ident)) ? -EFAULT : 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-               ret = put_user(0, (int __user *)arg);
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(boot_status, (int __user *)arg);
-               break;
-
-       case WDIOC_GETTIMEOUT:
-               /* actually, it is 0.250 seconds.... */
-               ret = put_user(1, (int __user *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               ret = 0;
-               break;
-       }
-       return ret;
-}
-
-static int ep93xx_wdt_release(struct inode *inode, struct file *file)
-{
-       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
-               wdt_shutdown();
-       else
-               printk(KERN_CRIT PFX "Device closed unexpectedly - "
-                       "timer will not stop\n");
-
-       clear_bit(WDT_IN_USE, &wdt_status);
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       return 0;
-}
-
-static const struct file_operations ep93xx_wdt_fops = {
-       .owner          = THIS_MODULE,
-       .write          = ep93xx_wdt_write,
-       .ioctl          = ep93xx_wdt_ioctl,
-       .open           = ep93xx_wdt_open,
-       .release        = ep93xx_wdt_release,
-};
-
-static struct miscdevice ep93xx_wdt_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &ep93xx_wdt_fops,
-};
-
-static void ep93xx_timer_ping(unsigned long data)
-{
-       if (time_before(jiffies, next_heartbeat))
-               wdt_ping();
-
-       /* Re-set the timer interval */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-}
-
-static int __init ep93xx_wdt_init(void)
-{
-       int err;
-
-       err = misc_register(&ep93xx_wdt_miscdev);
-
-       boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0;
-
-       printk(KERN_INFO PFX "EP93XX watchdog, driver version "
-               WDT_VERSION "%s\n",
-               (__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08)
-               ? " (nCS1 disable detected)" : "");
-
-       if (timeout < 1 || timeout > 3600) {
-               timeout = WDT_TIMEOUT;
-               printk(KERN_INFO PFX
-                       "timeout value must be 1<=x<=3600, using %d\n",
-                       timeout);
-       }
-
-       setup_timer(&timer, ep93xx_timer_ping, 1);
-       return err;
-}
-
-static void __exit ep93xx_wdt_exit(void)
-{
-       wdt_shutdown();
-       misc_deregister(&ep93xx_wdt_miscdev);
-}
-
-module_init(ep93xx_wdt_init);
-module_exit(ep93xx_wdt_exit);
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
-
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>,"
-               "Alessandro Zummo <a.zummo@towertech.it>");
-MODULE_DESCRIPTION("EP93xx Watchdog");
-MODULE_LICENSE("GPL");
-MODULE_VERSION(WDT_VERSION);
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
deleted file mode 100644 (file)
index b14e9d1..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- *     Eurotech CPU-1220/1410/1420 on board WDT driver
- *
- *     (c) Copyright 2001 Ascensit <support@ascensit.com>
- *     (c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com>
- *     (c) Copyright 2002 Rob Radez <rob@osinvestor.com>
- *
- *     Based on wdt.c.
- *     Original copyright messages:
- *
- *      (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                              http://www.redhat.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 the Free Software Foundation; either version
- *      2 of the License, or (at your option) any later version.
- *
- *      Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *      warranty for any of this software. This material is provided
- *      "AS-IS" and at no charge.
- *
- *      (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>*
- */
-
-/* Changelog:
- *
- * 2001 - Rodolfo Giometti
- *     Initial release
- *
- * 2002/04/25 - Rob Radez
- *     clean up #includes
- *     clean up locking
- *     make __setup param unique
- *     proper options in watchdog_info
- *     add WDIOC_GETSTATUS and WDIOC_SETOPTIONS ioctls
- *     add expect_close support
- *
- * 2002.05.30 - Joel Becker <joel.becker@oracle.com>
- *     Added Matt Domsch's nowayout module option.
- */
-
-/*
- *     The eurotech CPU-1220/1410/1420's watchdog is a part
- *     of the on-board SUPER I/O device SMSC FDC 37B782.
- */
-
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-static unsigned long eurwdt_is_open;
-static int eurwdt_timeout;
-static char eur_expect_close;
-
-/*
- * You must set these - there is no sane way to probe for this board.
- * You can use eurwdt=x,y to set these now.
- */
-
-static int io = 0x3f0;
-static int irq = 10;
-static char *ev = "int";
-
-#define WDT_TIMEOUT            60                /* 1 minute */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- * Some symbolic names
- */
-
-#define WDT_CTRL_REG           0x30
-#define WDT_OUTPIN_CFG         0xe2
-#define WDT_EVENT_INT          0x00
-#define WDT_EVENT_REBOOT       0x08
-#define WDT_UNIT_SEL           0xf1
-#define WDT_UNIT_SECS          0x80
-#define WDT_TIMEOUT_VAL                0xf2
-#define WDT_TIMER_CFG          0xf3
-
-
-module_param(io, int, 0);
-MODULE_PARM_DESC(io, "Eurotech WDT io port (default=0x3f0)");
-module_param(irq, int, 0);
-MODULE_PARM_DESC(irq, "Eurotech WDT irq (default=10)");
-module_param(ev, charp, 0);
-MODULE_PARM_DESC(ev, "Eurotech WDT event type (default is `int')");
-
-
-/*
- * Programming support
- */
-
-static inline void eurwdt_write_reg(u8 index, u8 data)
-{
-       outb(index, io);
-       outb(data, io+1);
-}
-
-static inline void eurwdt_lock_chip(void)
-{
-       outb(0xaa, io);
-}
-
-static inline void eurwdt_unlock_chip(void)
-{
-       outb(0x55, io);
-       eurwdt_write_reg(0x07, 0x08);   /* set the logical device */
-}
-
-static inline void eurwdt_set_timeout(int timeout)
-{
-       eurwdt_write_reg(WDT_TIMEOUT_VAL, (u8) timeout);
-}
-
-static inline void eurwdt_disable_timer(void)
-{
-       eurwdt_set_timeout(0);
-}
-
-static void eurwdt_activate_timer(void)
-{
-       eurwdt_disable_timer();
-       eurwdt_write_reg(WDT_CTRL_REG, 0x01);   /* activate the WDT */
-       eurwdt_write_reg(WDT_OUTPIN_CFG, !strcmp("int", ev) ? WDT_EVENT_INT : WDT_EVENT_REBOOT);
-
-       /* Setting interrupt line */
-       if (irq == 2 || irq > 15 || irq < 0) {
-               printk(KERN_ERR ": invalid irq number\n");
-               irq = 0;        /* if invalid we disable interrupt */
-       }
-       if (irq == 0)
-               printk(KERN_INFO ": interrupt disabled\n");
-
-       eurwdt_write_reg(WDT_TIMER_CFG, irq<<4);
-
-       eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS);  /* we use seconds */
-       eurwdt_set_timeout(0);  /* the default timeout */
-}
-
-
-/*
- * Kernel methods.
- */
-
-static irqreturn_t eurwdt_interrupt(int irq, void *dev_id)
-{
-       printk(KERN_CRIT "timeout WDT timeout\n");
-
-#ifdef ONLY_TESTING
-       printk(KERN_CRIT "Would Reboot.\n");
-#else
-       printk(KERN_CRIT "Initiating system reboot.\n");
-       emergency_restart();
-#endif
-       return IRQ_HANDLED;
-}
-
-
-/**
- * eurwdt_ping:
- *
- * Reload counter one with the watchdog timeout.
- */
-
-static void eurwdt_ping(void)
-{
-       /* Write the watchdog default value */
-       eurwdt_set_timeout(eurwdt_timeout);
-}
-
-/**
- * eurwdt_write:
- * @file: file handle to the watchdog
- * @buf: buffer to write (unused as data does not matter here
- * @count: count of bytes
- * @ppos: pointer to the position to write. No seeks allowed
- *
- * A write to a watchdog device is defined as a keepalive signal. Any
- * write of data will do, as we we don't define content meaning.
- */
-
-static ssize_t eurwdt_write(struct file *file, const char __user *buf,
-size_t count, loff_t *ppos)
-{
-       if (count)      {
-               if (!nowayout) {
-                       size_t i;
-
-                       eur_expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if(get_user(c, buf+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       eur_expect_close = 42;
-                       }
-               }
-               eurwdt_ping();  /* the default timeout */
-       }
-
-       return count;
-}
-
-/**
- * eurwdt_ioctl:
- * @inode: inode of the device
- * @file: file handle to the device
- * @cmd: watchdog command
- * @arg: argument pointer
- *
- * The watchdog API defines a common set of functions for all watchdogs
- * according to their available features.
- */
-
-static int eurwdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options          = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity         = "WDT Eurotech CPU-1220/1410",
-       };
-
-       int time;
-       int options, retval = -EINVAL;
-
-       switch(cmd) {
-       default:
-               return -ENOTTY;
-
-       case WDIOC_GETSUPPORT:
-               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-               eurwdt_ping();
-               return 0;
-
-       case WDIOC_SETTIMEOUT:
-               if (copy_from_user(&time, p, sizeof(int)))
-                       return -EFAULT;
-
-               /* Sanity check */
-               if (time < 0 || time > 255)
-                       return -EINVAL;
-
-               eurwdt_timeout = time;
-               eurwdt_set_timeout(time);
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(eurwdt_timeout, p);
-
-       case WDIOC_SETOPTIONS:
-               if (get_user(options, p))
-                       return -EFAULT;
-               if (options & WDIOS_DISABLECARD) {
-                       eurwdt_disable_timer();
-                       retval = 0;
-               }
-               if (options & WDIOS_ENABLECARD) {
-                       eurwdt_activate_timer();
-                       eurwdt_ping();
-                       retval = 0;
-               }
-               return retval;
-       }
-}
-
-/**
- * eurwdt_open:
- * @inode: inode of device
- * @file: file handle to device
- *
- * The misc device has been opened. The watchdog device is single
- * open and on opening we load the counter.
- */
-
-static int eurwdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &eurwdt_is_open))
-               return -EBUSY;
-       eurwdt_timeout = WDT_TIMEOUT;   /* initial timeout */
-       /* Activate the WDT */
-       eurwdt_activate_timer();
-       return nonseekable_open(inode, file);
-}
-
-/**
- * eurwdt_release:
- * @inode: inode to board
- * @file: file handle to board
- *
- * The watchdog has a configurable API. There is a religious dispute
- * between people who want their watchdog to be able to shut down and
- * those who want to be sure if the watchdog manager dies the machine
- * reboots. In the former case we disable the counters, in the latter
- * case you have to open it again very soon.
- */
-
-static int eurwdt_release(struct inode *inode, struct file *file)
-{
-       if (eur_expect_close == 42) {
-               eurwdt_disable_timer();
-       } else {
-               printk(KERN_CRIT "eurwdt: Unexpected close, not stopping watchdog!\n");
-               eurwdt_ping();
-       }
-       clear_bit(0, &eurwdt_is_open);
-       eur_expect_close = 0;
-       return 0;
-}
-
-/**
- * eurwdt_notify_sys:
- * @this: our notifier block
- * @code: the event being reported
- * @unused: unused
- *
- * Our notifier is called on system shutdowns. We want to turn the card
- * off at reboot otherwise the machine will reboot again during memory
- * test or worse yet during the following fsck. This would suck, in fact
- * trust me - if it happens it does suck.
- */
-
-static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT) {
-               /* Turn the card off */
-               eurwdt_disable_timer();
-       }
-
-       return NOTIFY_DONE;
-}
-
-/*
- * Kernel Interfaces
- */
-
-
-static const struct file_operations eurwdt_fops = {
-       .owner  = THIS_MODULE,
-       .llseek = no_llseek,
-       .write  = eurwdt_write,
-       .ioctl  = eurwdt_ioctl,
-       .open   = eurwdt_open,
-       .release        = eurwdt_release,
-};
-
-static struct miscdevice eurwdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &eurwdt_fops,
-};
-
-/*
- * The WDT card needs to learn about soft shutdowns in order to
- * turn the timebomb registers off.
- */
-
-static struct notifier_block eurwdt_notifier = {
-       .notifier_call = eurwdt_notify_sys,
-};
-
-/**
- * cleanup_module:
- *
- * Unload the watchdog. You cannot do this with any file handles open.
- * If your watchdog is set to continue ticking on close and you unload
- * it, well it keeps ticking. We won't get the interrupt but the board
- * will not touch PC memory so all is fine. You just have to load a new
- * module in 60 seconds or reboot.
- */
-
-static void __exit eurwdt_exit(void)
-{
-       eurwdt_lock_chip();
-
-       misc_deregister(&eurwdt_miscdev);
-
-       unregister_reboot_notifier(&eurwdt_notifier);
-       release_region(io, 2);
-       free_irq(irq, NULL);
-}
-
-/**
- * eurwdt_init:
- *
- * Set up the WDT watchdog board. After grabbing the resources
- * we require we need also to unlock the device.
- * The open() function will actually kick the board off.
- */
-
-static int __init eurwdt_init(void)
-{
-       int ret;
-
-       ret = request_irq(irq, eurwdt_interrupt, IRQF_DISABLED, "eurwdt", NULL);
-       if(ret) {
-               printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq);
-               goto out;
-       }
-
-       if (!request_region(io, 2, "eurwdt")) {
-               printk(KERN_ERR "eurwdt: IO %X is not free.\n", io);
-               ret = -EBUSY;
-               goto outirq;
-       }
-
-       ret = register_reboot_notifier(&eurwdt_notifier);
-       if (ret) {
-               printk(KERN_ERR "eurwdt: can't register reboot notifier (err=%d)\n", ret);
-               goto outreg;
-       }
-
-       ret = misc_register(&eurwdt_miscdev);
-       if (ret) {
-               printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n",
-               WATCHDOG_MINOR);
-               goto outreboot;
-       }
-
-       eurwdt_unlock_chip();
-
-       ret = 0;
-       printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)"
-               " - timeout event: %s\n",
-               io, irq, (!strcmp("int", ev) ? "int" : "reboot"));
-
-out:
-       return ret;
-
-outreboot:
-       unregister_reboot_notifier(&eurwdt_notifier);
-
-outreg:
-       release_region(io, 2);
-
-outirq:
-       free_irq(irq, NULL);
-       goto out;
-}
-
-module_init(eurwdt_init);
-module_exit(eurwdt_exit);
-
-MODULE_AUTHOR("Rodolfo Giometti");
-MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/i6300esb.c b/drivers/char/watchdog/i6300esb.c
deleted file mode 100644 (file)
index c598250..0000000
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- *     i6300esb:       Watchdog timer driver for Intel 6300ESB chipset
- *
- *     (c) Copyright 2004 Google Inc.
- *     (c) Copyright 2005 David Härdeman <david@2gen.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *      based on i810-tco.c which is in turn based on softdog.c
- *
- *     The timer is implemented in the following I/O controller hubs:
- *     (See the intel documentation on http://developer.intel.com.)
- *     6300ESB chip : document number 300641-003
- *
- *  2004YYZZ Ross Biro
- *     Initial version 0.01
- *  2004YYZZ Ross Biro
- *     Version 0.02
- *  20050210 David Härdeman <david@2gen.com>
- *      Ported driver to kernel 2.6
- */
-
-/*
- *      Includes, defines, variables, module parameters, ...
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/ioport.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-/* Module and version information */
-#define ESB_VERSION "0.03"
-#define ESB_MODULE_NAME "i6300ESB timer"
-#define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION
-#define PFX ESB_MODULE_NAME ": "
-
-/* PCI configuration registers */
-#define ESB_CONFIG_REG  0x60            /* Config register                   */
-#define ESB_LOCK_REG    0x68            /* WDT lock register                 */
-
-/* Memory mapped registers */
-#define ESB_TIMER1_REG  BASEADDR + 0x00 /* Timer1 value after each reset     */
-#define ESB_TIMER2_REG  BASEADDR + 0x04 /* Timer2 value after each reset     */
-#define ESB_GINTSR_REG  BASEADDR + 0x08 /* General Interrupt Status Register */
-#define ESB_RELOAD_REG  BASEADDR + 0x0c /* Reload register                   */
-
-/* Lock register bits */
-#define ESB_WDT_FUNC    ( 0x01 << 2 )   /* Watchdog functionality            */
-#define ESB_WDT_ENABLE  ( 0x01 << 1 )   /* Enable WDT                        */
-#define ESB_WDT_LOCK    ( 0x01 << 0 )   /* Lock (nowayout)                   */
-
-/* Config register bits */
-#define ESB_WDT_REBOOT  ( 0x01 << 5 )   /* Enable reboot on timeout          */
-#define ESB_WDT_FREQ    ( 0x01 << 2 )   /* Decrement frequency               */
-#define ESB_WDT_INTTYPE ( 0x11 << 0 )   /* Interrupt type on timer1 timeout  */
-
-/* Reload register bits */
-#define ESB_WDT_RELOAD ( 0x01 << 8 )    /* prevent timeout                   */
-
-/* Magic constants */
-#define ESB_UNLOCK1     0x80            /* Step 1 to unlock reset registers  */
-#define ESB_UNLOCK2     0x86            /* Step 2 to unlock reset registers  */
-
-/* internal variables */
-static void __iomem *BASEADDR;
-static spinlock_t esb_lock; /* Guards the hardware */
-static unsigned long timer_alive;
-static struct pci_dev *esb_pci;
-static unsigned short triggered; /* The status of the watchdog upon boot */
-static char esb_expect_close;
-
-/* module parameters */
-#define WATCHDOG_HEARTBEAT 30   /* 30 sec default heartbeat (1<heartbeat<2*1023) */
-static int heartbeat = WATCHDOG_HEARTBEAT;  /* in seconds */
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<heartbeat<2046, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- * Some i6300ESB specific functions
- */
-
-/*
- * Prepare for reloading the timer by unlocking the proper registers.
- * This is performed by first writing 0x80 followed by 0x86 to the
- * reload register. After this the appropriate registers can be written
- * to once before they need to be unlocked again.
- */
-static inline void esb_unlock_registers(void) {
-        writeb(ESB_UNLOCK1, ESB_RELOAD_REG);
-        writeb(ESB_UNLOCK2, ESB_RELOAD_REG);
-}
-
-static void esb_timer_start(void)
-{
-       u8 val;
-
-       /* Enable or Enable + Lock? */
-       val = 0x02 | (nowayout ? 0x01 : 0x00);
-
-        pci_write_config_byte(esb_pci, ESB_LOCK_REG, val);
-}
-
-static int esb_timer_stop(void)
-{
-       u8 val;
-
-       spin_lock(&esb_lock);
-       /* First, reset timers as suggested by the docs */
-       esb_unlock_registers();
-       writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
-       /* Then disable the WDT */
-       pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x0);
-       pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val);
-       spin_unlock(&esb_lock);
-
-       /* Returns 0 if the timer was disabled, non-zero otherwise */
-       return (val & 0x01);
-}
-
-static void esb_timer_keepalive(void)
-{
-       spin_lock(&esb_lock);
-       esb_unlock_registers();
-       writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
-        /* FIXME: Do we need to flush anything here? */
-       spin_unlock(&esb_lock);
-}
-
-static int esb_timer_set_heartbeat(int time)
-{
-       u32 val;
-
-       if (time < 0x1 || time > (2 * 0x03ff))
-               return -EINVAL;
-
-       spin_lock(&esb_lock);
-
-       /* We shift by 9, so if we are passed a value of 1 sec,
-        * val will be 1 << 9 = 512, then write that to two
-        * timers => 2 * 512 = 1024 (which is decremented at 1KHz)
-        */
-       val = time << 9;
-
-       /* Write timer 1 */
-       esb_unlock_registers();
-       writel(val, ESB_TIMER1_REG);
-
-       /* Write timer 2 */
-       esb_unlock_registers();
-        writel(val, ESB_TIMER2_REG);
-
-        /* Reload */
-       esb_unlock_registers();
-       writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
-
-       /* FIXME: Do we need to flush everything out? */
-
-       /* Done */
-       heartbeat = time;
-       spin_unlock(&esb_lock);
-       return 0;
-}
-
-static int esb_timer_read (void)
-{
-               u32 count;
-
-       /* This isn't documented, and doesn't take into
-         * acount which stage is running, but it looks
-         * like a 20 bit count down, so we might as well report it.
-         */
-        pci_read_config_dword(esb_pci, 0x64, &count);
-        return (int)count;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static int esb_open (struct inode *inode, struct file *file)
-{
-        /* /dev/watchdog can only be opened once */
-        if (test_and_set_bit(0, &timer_alive))
-                return -EBUSY;
-
-        /* Reload and activate timer */
-        esb_timer_keepalive ();
-        esb_timer_start ();
-
-       return nonseekable_open(inode, file);
-}
-
-static int esb_release (struct inode *inode, struct file *file)
-{
-        /* Shut off the timer. */
-        if (esb_expect_close == 42) {
-                esb_timer_stop ();
-        } else {
-                printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-                esb_timer_keepalive ();
-        }
-        clear_bit(0, &timer_alive);
-        esb_expect_close = 0;
-        return 0;
-}
-
-static ssize_t esb_write (struct file *file, const char __user *data,
-                         size_t len, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-        if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       esb_expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if(get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       esb_expect_close = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               esb_timer_keepalive ();
-       }
-       return len;
-}
-
-static int esb_ioctl (struct inode *inode, struct file *file,
-                     unsigned int cmd, unsigned long arg)
-{
-       int new_options, retval = -EINVAL;
-       int new_heartbeat;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_SETTIMEOUT |
-                                       WDIOF_KEEPALIVEPING |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     0,
-               .identity =             ESB_MODULE_NAME,
-       };
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                                           sizeof (ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-                       return put_user (esb_timer_read(), p);
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user (triggered, p);
-
-                case WDIOC_KEEPALIVE:
-                        esb_timer_keepalive ();
-                        return 0;
-
-                case WDIOC_SETOPTIONS:
-                {
-                        if (get_user (new_options, p))
-                                return -EFAULT;
-
-                        if (new_options & WDIOS_DISABLECARD) {
-                                esb_timer_stop ();
-                                retval = 0;
-                        }
-
-                        if (new_options & WDIOS_ENABLECARD) {
-                                esb_timer_keepalive ();
-                                esb_timer_start ();
-                                retval = 0;
-                        }
-
-                        return retval;
-                }
-
-                case WDIOC_SETTIMEOUT:
-                {
-                        if (get_user(new_heartbeat, p))
-                                return -EFAULT;
-
-                        if (esb_timer_set_heartbeat(new_heartbeat))
-                            return -EINVAL;
-
-                        esb_timer_keepalive ();
-                        /* Fall */
-                }
-
-                case WDIOC_GETTIMEOUT:
-                        return put_user(heartbeat, p);
-
-                default:
-                        return -ENOTTY;
-        }
-}
-
-/*
- *      Notify system
- */
-
-static int esb_notify_sys (struct notifier_block *this, unsigned long code, void *unused)
-{
-        if (code==SYS_DOWN || code==SYS_HALT) {
-                /* Turn the WDT off */
-                esb_timer_stop ();
-        }
-
-        return NOTIFY_DONE;
-}
-
-/*
- *      Kernel Interfaces
- */
-
-static const struct file_operations esb_fops = {
-        .owner =        THIS_MODULE,
-        .llseek =       no_llseek,
-        .write =        esb_write,
-        .ioctl =        esb_ioctl,
-        .open =         esb_open,
-        .release =      esb_release,
-};
-
-static struct miscdevice esb_miscdev = {
-        .minor =        WATCHDOG_MINOR,
-        .name =         "watchdog",
-        .fops =         &esb_fops,
-};
-
-static struct notifier_block esb_notifier = {
-        .notifier_call =        esb_notify_sys,
-};
-
-/*
- * Data for PCI driver interface
- *
- * This data only exists for exporting the supported
- * PCI ids via MODULE_DEVICE_TABLE.  We do not actually
- * register a pci_driver, because someone else might one day
- * want to register another driver on the same PCI id.
- */
-static struct pci_device_id esb_pci_tbl[] = {
-        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_9), },
-        { 0, },                 /* End of list */
-};
-MODULE_DEVICE_TABLE (pci, esb_pci_tbl);
-
-/*
- *      Init & exit routines
- */
-
-static unsigned char __init esb_getdevice (void)
-{
-       u8 val1;
-       unsigned short val2;
-
-        struct pci_dev *dev = NULL;
-        /*
-         *      Find the PCI device
-         */
-
-        for_each_pci_dev(dev) {
-                if (pci_match_id(esb_pci_tbl, dev)) {
-                        esb_pci = dev;
-                        break;
-                }
-       }
-
-        if (esb_pci) {
-               if (pci_enable_device(esb_pci)) {
-                       printk (KERN_ERR PFX "failed to enable device\n");
-                       goto err_devput;
-               }
-
-               if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) {
-                       printk (KERN_ERR PFX "failed to request region\n");
-                       goto err_disable;
-               }
-
-               BASEADDR = ioremap(pci_resource_start(esb_pci, 0),
-                                  pci_resource_len(esb_pci, 0));
-               if (BASEADDR == NULL) {
-                       /* Something's wrong here, BASEADDR has to be set */
-                       printk (KERN_ERR PFX "failed to get BASEADDR\n");
-                        goto err_release;
-                }
-
-               /*
-                * The watchdog has two timers, it can be setup so that the
-                * expiry of timer1 results in an interrupt and the expiry of
-                * timer2 results in a reboot. We set it to not generate
-                * any interrupts as there is not much we can do with it
-                * right now.
-                *
-                * We also enable reboots and set the timer frequency to
-                * the PCI clock divided by 2^15 (approx 1KHz).
-                */
-               pci_write_config_word(esb_pci, ESB_CONFIG_REG, 0x0003);
-
-               /* Check that the WDT isn't already locked */
-               pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1);
-               if (val1 & ESB_WDT_LOCK)
-                       printk (KERN_WARNING PFX "nowayout already set\n");
-
-               /* Set the timer to watchdog mode and disable it for now */
-               pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00);
-
-               /* Check if the watchdog was previously triggered */
-               esb_unlock_registers();
-               val2 = readw(ESB_RELOAD_REG);
-               triggered = (val2 & (0x01 << 9) >> 9);
-
-               /* Reset trigger flag and timers */
-               esb_unlock_registers();
-               writew((0x11 << 8), ESB_RELOAD_REG);
-
-               /* Done */
-               return 1;
-
-err_release:
-               pci_release_region(esb_pci, 0);
-err_disable:
-               pci_disable_device(esb_pci);
-err_devput:
-               pci_dev_put(esb_pci);
-       }
-       return 0;
-}
-
-static int __init watchdog_init (void)
-{
-        int ret;
-
-        spin_lock_init(&esb_lock);
-
-        /* Check whether or not the hardware watchdog is there */
-        if (!esb_getdevice () || esb_pci == NULL)
-                return -ENODEV;
-
-        /* Check that the heartbeat value is within it's range ; if not reset to the default */
-        if (esb_timer_set_heartbeat (heartbeat)) {
-                esb_timer_set_heartbeat (WATCHDOG_HEARTBEAT);
-                printk(KERN_INFO PFX "heartbeat value must be 1<heartbeat<2046, using %d\n",
-                      heartbeat);
-        }
-
-        ret = register_reboot_notifier(&esb_notifier);
-        if (ret != 0) {
-                printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                        ret);
-                goto err_unmap;
-        }
-
-        ret = misc_register(&esb_miscdev);
-        if (ret != 0) {
-                printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                        WATCHDOG_MINOR, ret);
-                goto err_notifier;
-        }
-
-        esb_timer_stop ();
-
-        printk (KERN_INFO PFX "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n",
-                BASEADDR, heartbeat, nowayout);
-
-        return 0;
-
-err_notifier:
-        unregister_reboot_notifier(&esb_notifier);
-err_unmap:
-       iounmap(BASEADDR);
-/* err_release: */
-       pci_release_region(esb_pci, 0);
-/* err_disable: */
-       pci_disable_device(esb_pci);
-/* err_devput: */
-       pci_dev_put(esb_pci);
-        return ret;
-}
-
-static void __exit watchdog_cleanup (void)
-{
-       /* Stop the timer before we leave */
-       if (!nowayout)
-               esb_timer_stop ();
-
-       /* Deregister */
-       misc_deregister(&esb_miscdev);
-        unregister_reboot_notifier(&esb_notifier);
-       iounmap(BASEADDR);
-       pci_release_region(esb_pci, 0);
-       pci_disable_device(esb_pci);
-       pci_dev_put(esb_pci);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_cleanup);
-
-MODULE_AUTHOR("Ross Biro and David Härdeman");
-MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/iTCO_vendor_support.c b/drivers/char/watchdog/iTCO_vendor_support.c
deleted file mode 100644 (file)
index 4150839..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- *     intel TCO vendor specific watchdog driver support
- *
- *     (c) Copyright 2006 Wim Van Sebroeck <wim@iguana.be>.
- *
- *     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.
- *
- *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
- *     provide warranty for any of this software. This material is
- *     provided "AS-IS" and at no charge.
- */
-
-/*
- *     Includes, defines, variables, module parameters, ...
- */
-
-/* Module and version information */
-#define DRV_NAME        "iTCO_vendor_support"
-#define DRV_VERSION     "1.01"
-#define DRV_RELDATE     "11-Nov-2006"
-#define PFX            DRV_NAME ": "
-
-/* Includes */
-#include <linux/module.h>              /* For module specific items */
-#include <linux/moduleparam.h>         /* For new moduleparam's */
-#include <linux/types.h>               /* For standard types (like size_t) */
-#include <linux/errno.h>               /* For the -ENODEV/... values */
-#include <linux/kernel.h>              /* For printk/panic/... */
-#include <linux/init.h>                        /* For __init/__exit/... */
-#include <linux/ioport.h>              /* For io-port access */
-
-#include <asm/io.h>                    /* For inb/outb/... */
-
-/* iTCO defines */
-#define        SMI_EN          acpibase + 0x30 /* SMI Control and Enable Register */
-#define        TCOBASE         acpibase + 0x60 /* TCO base address             */
-#define        TCO1_STS        TCOBASE + 0x04  /* TCO1 Status Register         */
-
-/* List of vendor support modes */
-#define SUPERMICRO_OLD_BOARD   1       /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */
-#define SUPERMICRO_NEW_BOARD   2       /* SuperMicro Pentium 4 / Xeon 4 / EMT64T Era Systems */
-
-static int vendorsupport = 0;
-module_param(vendorsupport, int, 0);
-MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+");
-
-/*
- *     Vendor Specific Support
- */
-
-/*
- *     Vendor Support: 1
- *     Board: Super Micro Computer Inc. 370SSE+-OEM1/P3TSSE
- *     iTCO chipset: ICH2
- *
- *     Code contributed by: R. Seretny <lkpatches@paypc.com>
- *     Documentation obtained by R. Seretny from SuperMicro Technical Support
- *
- *     To enable Watchdog function:
- *         BIOS setup -> Power -> TCO Logic SMI Enable -> Within5Minutes
- *         This setting enables SMI to clear the watchdog expired flag.
- *         If BIOS or CPU fail which may cause SMI hang, then system will
- *         reboot. When application starts to use watchdog function,
- *         application has to take over the control from SMI.
- *
- *         For P3TSSE, J36 jumper needs to be removed to enable the Watchdog
- *         function.
- *
- *         Note: The system will reboot when Expire Flag is set TWICE.
- *         So, if the watchdog timer is 20 seconds, then the maximum hang
- *         time is about 40 seconds, and the minimum hang time is about
- *         20.6 seconds.
- */
-
-static void supermicro_old_pre_start(unsigned long acpibase)
-{
-       unsigned long val32;
-
-       val32 = inl(SMI_EN);
-       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
-       outl(val32, SMI_EN);    /* Needed to activate watchdog */
-}
-
-static void supermicro_old_pre_stop(unsigned long acpibase)
-{
-       unsigned long val32;
-
-       val32 = inl(SMI_EN);
-       val32 &= 0x00002000;    /* Turn on SMI clearing watchdog */
-       outl(val32, SMI_EN);    /* Needed to deactivate watchdog */
-}
-
-static void supermicro_old_pre_keepalive(unsigned long acpibase)
-{
-       /* Reload TCO Timer (done in iTCO_wdt_keepalive) + */
-       /* Clear "Expire Flag" (Bit 3 of TC01_STS register) */
-       outb(0x08, TCO1_STS);
-}
-
-/*
- *     Vendor Support: 2
- *     Board: Super Micro Computer Inc. P4SBx, P4DPx
- *     iTCO chipset: ICH4
- *
- *     Code contributed by: R. Seretny <lkpatches@paypc.com>
- *     Documentation obtained by R. Seretny from SuperMicro Technical Support
- *
- *     To enable Watchdog function:
- *      1. BIOS
- *       For P4SBx:
- *       BIOS setup -> Advanced -> Integrated Peripherals -> Watch Dog Feature
- *       For P4DPx:
- *       BIOS setup -> Advanced -> I/O Device Configuration -> Watch Dog
- *      This setting enables or disables Watchdog function. When enabled, the
- *      default watchdog timer is set to be 5 minutes (about 4’35”). It is
- *      enough to load and run the OS. The application (service or driver) has
- *      to take over the control once OS is running up and before watchdog
- *      expires.
- *
- *      2. JUMPER
- *       For P4SBx: JP39
- *       For P4DPx: JP37
- *       This jumper is used for safety.  Closed is enabled. This jumper
- *       prevents user enables watchdog in BIOS by accident.
- *
- *      To enable Watch Dog function, both BIOS and JUMPER must be enabled.
- *
- *     The documentation lists motherboards P4SBx and P4DPx series as of
- *     20-March-2002. However, this code works flawlessly with much newer
- *     motherboards, such as my X6DHR-8G2 (SuperServer 6014H-82).
- *
- *     The original iTCO driver as written does not actually reset the
- *     watchdog timer on these machines, as a result they reboot after five
- *     minutes.
- *
- *     NOTE: You may leave the Watchdog function disabled in the SuperMicro
- *     BIOS to avoid a "boot-race"... This driver will enable watchdog
- *     functionality even if it's disabled in the BIOS once the /dev/watchdog
- *     file is opened.
- */
-
-/* I/O Port's */
-#define SM_REGINDEX    0x2e            /* SuperMicro ICH4+ Register Index */
-#define SM_DATAIO      0x2f            /* SuperMicro ICH4+ Register Data I/O */
-
-/* Control Register's */
-#define SM_CTLPAGESW   0x07            /* SuperMicro ICH4+ Control Page Switch */
-#define SM_CTLPAGE             0x08    /* SuperMicro ICH4+ Control Page Num */
-
-#define SM_WATCHENABLE 0x30            /* Watchdog enable: Bit 0: 0=off, 1=on */
-
-#define SM_WATCHPAGE   0x87            /* Watchdog unlock control page */
-
-#define SM_ENDWATCH    0xAA            /* Watchdog lock control page */
-
-#define SM_COUNTMODE   0xf5            /* Watchdog count mode select */
-                                       /* (Bit 3: 0 = seconds, 1 = minutes */
-
-#define SM_WATCHTIMER  0xf6            /* 8-bits, Watchdog timer counter (RW) */
-
-#define SM_RESETCONTROL        0xf7            /* Watchdog reset control */
-                                       /* Bit 6: timer is reset by kbd interrupt */
-                                       /* Bit 7: timer is reset by mouse interrupt */
-
-static void supermicro_new_unlock_watchdog(void)
-{
-       outb(SM_WATCHPAGE, SM_REGINDEX);        /* Write 0x87 to port 0x2e twice */
-       outb(SM_WATCHPAGE, SM_REGINDEX);
-
-       outb(SM_CTLPAGESW, SM_REGINDEX);        /* Switch to watchdog control page */
-       outb(SM_CTLPAGE, SM_DATAIO);
-}
-
-static void supermicro_new_lock_watchdog(void)
-{
-       outb(SM_ENDWATCH, SM_REGINDEX);
-}
-
-static void supermicro_new_pre_start(unsigned int heartbeat)
-{
-       unsigned int val;
-
-       supermicro_new_unlock_watchdog();
-
-       /* Watchdog timer setting needs to be in seconds*/
-       outb(SM_COUNTMODE, SM_REGINDEX);
-       val = inb(SM_DATAIO);
-       val &= 0xF7;
-       outb(val, SM_DATAIO);
-
-       /* Write heartbeat interval to WDOG */
-       outb (SM_WATCHTIMER, SM_REGINDEX);
-       outb((heartbeat & 255), SM_DATAIO);
-
-       /* Make sure keyboard/mouse interrupts don't interfere */
-       outb(SM_RESETCONTROL, SM_REGINDEX);
-       val = inb(SM_DATAIO);
-       val &= 0x3f;
-       outb(val, SM_DATAIO);
-
-       /* enable watchdog by setting bit 0 of Watchdog Enable to 1 */
-       outb(SM_WATCHENABLE, SM_REGINDEX);
-       val = inb(SM_DATAIO);
-       val |= 0x01;
-       outb(val, SM_DATAIO);
-
-       supermicro_new_lock_watchdog();
-}
-
-static void supermicro_new_pre_stop(void)
-{
-       unsigned int val;
-
-       supermicro_new_unlock_watchdog();
-
-       /* disable watchdog by setting bit 0 of Watchdog Enable to 0 */
-       outb(SM_WATCHENABLE, SM_REGINDEX);
-       val = inb(SM_DATAIO);
-       val &= 0xFE;
-       outb(val, SM_DATAIO);
-
-       supermicro_new_lock_watchdog();
-}
-
-static void supermicro_new_pre_set_heartbeat(unsigned int heartbeat)
-{
-       supermicro_new_unlock_watchdog();
-
-       /* reset watchdog timeout to heartveat value */
-       outb(SM_WATCHTIMER, SM_REGINDEX);
-       outb((heartbeat & 255), SM_DATAIO);
-
-       supermicro_new_lock_watchdog();
-}
-
-/*
- *     Generic Support Functions
- */
-
-void iTCO_vendor_pre_start(unsigned long acpibase,
-                          unsigned int heartbeat)
-{
-       if (vendorsupport == SUPERMICRO_OLD_BOARD)
-               supermicro_old_pre_start(acpibase);
-       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
-               supermicro_new_pre_start(heartbeat);
-}
-EXPORT_SYMBOL(iTCO_vendor_pre_start);
-
-void iTCO_vendor_pre_stop(unsigned long acpibase)
-{
-       if (vendorsupport == SUPERMICRO_OLD_BOARD)
-               supermicro_old_pre_stop(acpibase);
-       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
-               supermicro_new_pre_stop();
-}
-EXPORT_SYMBOL(iTCO_vendor_pre_stop);
-
-void iTCO_vendor_pre_keepalive(unsigned long acpibase, unsigned int heartbeat)
-{
-       if (vendorsupport == SUPERMICRO_OLD_BOARD)
-               supermicro_old_pre_keepalive(acpibase);
-       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
-               supermicro_new_pre_set_heartbeat(heartbeat);
-}
-EXPORT_SYMBOL(iTCO_vendor_pre_keepalive);
-
-void iTCO_vendor_pre_set_heartbeat(unsigned int heartbeat)
-{
-       if (vendorsupport == SUPERMICRO_NEW_BOARD)
-               supermicro_new_pre_set_heartbeat(heartbeat);
-}
-EXPORT_SYMBOL(iTCO_vendor_pre_set_heartbeat);
-
-int iTCO_vendor_check_noreboot_on(void)
-{
-       switch(vendorsupport) {
-       case SUPERMICRO_OLD_BOARD:
-               return 0;
-       default:
-               return 1;
-       }
-}
-EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on);
-
-static int __init iTCO_vendor_init_module(void)
-{
-       printk (KERN_INFO PFX "vendor-support=%d\n", vendorsupport);
-       return 0;
-}
-
-static void __exit iTCO_vendor_exit_module(void)
-{
-       printk (KERN_INFO PFX "Module Unloaded\n");
-}
-
-module_init(iTCO_vendor_init_module);
-module_exit(iTCO_vendor_exit_module);
-
-MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, R. Seretny <lkpatches@paypc.com>");
-MODULE_DESCRIPTION("Intel TCO Vendor Specific WatchDog Timer Driver Support");
-MODULE_VERSION(DRV_VERSION);
-MODULE_LICENSE("GPL");
-
diff --git a/drivers/char/watchdog/iTCO_wdt.c b/drivers/char/watchdog/iTCO_wdt.c
deleted file mode 100644 (file)
index cd5a565..0000000
+++ /dev/null
@@ -1,804 +0,0 @@
-/*
- *     intel TCO Watchdog Driver (Used in i82801 and i6300ESB chipsets)
- *
- *     (c) Copyright 2006-2007 Wim Van Sebroeck <wim@iguana.be>.
- *
- *     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.
- *
- *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
- *     provide warranty for any of this software. This material is
- *     provided "AS-IS" and at no charge.
- *
- *     The TCO watchdog is implemented in the following I/O controller hubs:
- *     (See the intel documentation on http://developer.intel.com.)
- *     82801AA  (ICH)       : document number 290655-003, 290677-014,
- *     82801AB  (ICHO)      : document number 290655-003, 290677-014,
- *     82801BA  (ICH2)      : document number 290687-002, 298242-027,
- *     82801BAM (ICH2-M)    : document number 290687-002, 298242-027,
- *     82801CA  (ICH3-S)    : document number 290733-003, 290739-013,
- *     82801CAM (ICH3-M)    : document number 290716-001, 290718-007,
- *     82801DB  (ICH4)      : document number 290744-001, 290745-020,
- *     82801DBM (ICH4-M)    : document number 252337-001, 252663-005,
- *     82801E   (C-ICH)     : document number 273599-001, 273645-002,
- *     82801EB  (ICH5)      : document number 252516-001, 252517-003,
- *     82801ER  (ICH5R)     : document number 252516-001, 252517-003,
- *     82801FB  (ICH6)      : document number 301473-002, 301474-007,
- *     82801FR  (ICH6R)     : document number 301473-002, 301474-007,
- *     82801FBM (ICH6-M)    : document number 301473-002, 301474-007,
- *     82801FW  (ICH6W)     : document number 301473-001, 301474-007,
- *     82801FRW (ICH6RW)    : document number 301473-001, 301474-007,
- *     82801GB  (ICH7)      : document number 307013-002, 307014-009,
- *     82801GR  (ICH7R)     : document number 307013-002, 307014-009,
- *     82801GDH (ICH7DH)    : document number 307013-002, 307014-009,
- *     82801GBM (ICH7-M)    : document number 307013-002, 307014-009,
- *     82801GHM (ICH7-M DH) : document number 307013-002, 307014-009,
- *     82801HB  (ICH8)      : document number 313056-002, 313057-004,
- *     82801HR  (ICH8R)     : document number 313056-002, 313057-004,
- *     82801HH  (ICH8DH)    : document number 313056-002, 313057-004,
- *     82801HO  (ICH8DO)    : document number 313056-002, 313057-004,
- *     82801IB  (ICH9)      : document number 316972-001, 316973-001,
- *     82801IR  (ICH9R)     : document number 316972-001, 316973-001,
- *     82801IH  (ICH9DH)    : document number 316972-001, 316973-001,
- *     6300ESB  (6300ESB)   : document number 300641-003, 300884-010,
- *     631xESB  (631xESB)   : document number 313082-001, 313075-005,
- *     632xESB  (632xESB)   : document number 313082-001, 313075-005
- */
-
-/*
- *     Includes, defines, variables, module parameters, ...
- */
-
-/* Module and version information */
-#define DRV_NAME        "iTCO_wdt"
-#define DRV_VERSION     "1.02"
-#define DRV_RELDATE     "26-Jul-2007"
-#define PFX            DRV_NAME ": "
-
-/* Includes */
-#include <linux/module.h>              /* For module specific items */
-#include <linux/moduleparam.h>         /* For new moduleparam's */
-#include <linux/types.h>               /* For standard types (like size_t) */
-#include <linux/errno.h>               /* For the -ENODEV/... values */
-#include <linux/kernel.h>              /* For printk/panic/... */
-#include <linux/miscdevice.h>          /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
-#include <linux/watchdog.h>            /* For the watchdog specific items */
-#include <linux/init.h>                        /* For __init/__exit/... */
-#include <linux/fs.h>                  /* For file operations */
-#include <linux/platform_device.h>     /* For platform_driver framework */
-#include <linux/pci.h>                 /* For pci functions */
-#include <linux/ioport.h>              /* For io-port access */
-#include <linux/spinlock.h>            /* For spin_lock/spin_unlock/... */
-
-#include <asm/uaccess.h>               /* For copy_to_user/put_user/... */
-#include <asm/io.h>                    /* For inb/outb/... */
-
-/* TCO related info */
-enum iTCO_chipsets {
-       TCO_ICH = 0,    /* ICH */
-       TCO_ICH0,       /* ICH0 */
-       TCO_ICH2,       /* ICH2 */
-       TCO_ICH2M,      /* ICH2-M */
-       TCO_ICH3,       /* ICH3-S */
-       TCO_ICH3M,      /* ICH3-M */
-       TCO_ICH4,       /* ICH4 */
-       TCO_ICH4M,      /* ICH4-M */
-       TCO_CICH,       /* C-ICH */
-       TCO_ICH5,       /* ICH5 & ICH5R */
-       TCO_6300ESB,    /* 6300ESB */
-       TCO_ICH6,       /* ICH6 & ICH6R */
-       TCO_ICH6M,      /* ICH6-M */
-       TCO_ICH6W,      /* ICH6W & ICH6RW */
-       TCO_ICH7,       /* ICH7 & ICH7R */
-       TCO_ICH7M,      /* ICH7-M */
-       TCO_ICH7MDH,    /* ICH7-M DH */
-       TCO_ICH8,       /* ICH8 & ICH8R */
-       TCO_ICH8DH,     /* ICH8DH */
-       TCO_ICH8DO,     /* ICH8DO */
-       TCO_ICH9,       /* ICH9 */
-       TCO_ICH9R,      /* ICH9R */
-       TCO_ICH9DH,     /* ICH9DH */
-       TCO_631XESB,    /* 631xESB/632xESB */
-};
-
-static struct {
-       char *name;
-       unsigned int iTCO_version;
-} iTCO_chipset_info[] __devinitdata = {
-       {"ICH", 1},
-       {"ICH0", 1},
-       {"ICH2", 1},
-       {"ICH2-M", 1},
-       {"ICH3-S", 1},
-       {"ICH3-M", 1},
-       {"ICH4", 1},
-       {"ICH4-M", 1},
-       {"C-ICH", 1},
-       {"ICH5 or ICH5R", 1},
-       {"6300ESB", 1},
-       {"ICH6 or ICH6R", 2},
-       {"ICH6-M", 2},
-       {"ICH6W or ICH6RW", 2},
-       {"ICH7 or ICH7R", 2},
-       {"ICH7-M", 2},
-       {"ICH7-M DH", 2},
-       {"ICH8 or ICH8R", 2},
-       {"ICH8DH", 2},
-       {"ICH8DO", 2},
-       {"ICH9", 2},
-       {"ICH9R", 2},
-       {"ICH9DH", 2},
-       {"631xESB/632xESB", 2},
-       {NULL,0}
-};
-
-/*
- * This data only exists for exporting the supported PCI ids
- * via MODULE_DEVICE_TABLE.  We do not actually register a
- * pci_driver, because the I/O Controller Hub has also other
- * functions that probably will be registered by other drivers.
- */
-static struct pci_device_id iTCO_wdt_pci_tbl[] = {
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH     },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH0    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0,    PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_CICH    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH5    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1,       PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_6300ESB },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6W   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M   },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DH  },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DO  },
-       { PCI_VENDOR_ID_INTEL, 0x2918,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9    },
-       { PCI_VENDOR_ID_INTEL, 0x2916,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9R    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9DH    },
-       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2671,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2672,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2673,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2674,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2675,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2676,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2677,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2678,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x2679,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267a,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267b,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267c,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267d,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267e,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { PCI_VENDOR_ID_INTEL, 0x267f,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
-       { 0, },                 /* End of list */
-};
-MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl);
-
-/* Address definitions for the TCO */
-#define        TCOBASE         iTCO_wdt_private.ACPIBASE + 0x60        /* TCO base address                */
-#define        SMI_EN          iTCO_wdt_private.ACPIBASE + 0x30        /* SMI Control and Enable Register */
-
-#define TCO_RLD                TCOBASE + 0x00  /* TCO Timer Reload and Current Value */
-#define TCOv1_TMR      TCOBASE + 0x01  /* TCOv1 Timer Initial Value    */
-#define        TCO_DAT_IN      TCOBASE + 0x02  /* TCO Data In Register         */
-#define        TCO_DAT_OUT     TCOBASE + 0x03  /* TCO Data Out Register        */
-#define        TCO1_STS        TCOBASE + 0x04  /* TCO1 Status Register         */
-#define        TCO2_STS        TCOBASE + 0x06  /* TCO2 Status Register         */
-#define TCO1_CNT       TCOBASE + 0x08  /* TCO1 Control Register        */
-#define TCO2_CNT       TCOBASE + 0x0a  /* TCO2 Control Register        */
-#define TCOv2_TMR      TCOBASE + 0x12  /* TCOv2 Timer Initial Value    */
-
-/* internal variables */
-static unsigned long is_active;
-static char expect_release;
-static struct {                                /* this is private data for the iTCO_wdt device */
-       unsigned int iTCO_version;      /* TCO version/generation */
-       unsigned long ACPIBASE;         /* The cards ACPIBASE address (TCOBASE = ACPIBASE+0x60) */
-       unsigned long __iomem *gcs;     /* NO_REBOOT flag is Memory-Mapped GCS register bit 5 (TCO version 2) */
-       spinlock_t io_lock;             /* the lock for io operations */
-       struct pci_dev *pdev;           /* the PCI-device */
-} iTCO_wdt_private;
-
-static struct platform_device *iTCO_wdt_platform_device;       /* the watchdog platform device */
-
-/* module parameters */
-#define WATCHDOG_HEARTBEAT 30  /* 30 sec default heartbeat */
-static int heartbeat = WATCHDOG_HEARTBEAT;  /* in seconds */
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/* iTCO Vendor Specific Support hooks */
-#ifdef CONFIG_ITCO_VENDOR_SUPPORT
-extern void iTCO_vendor_pre_start(unsigned long, unsigned int);
-extern void iTCO_vendor_pre_stop(unsigned long);
-extern void iTCO_vendor_pre_keepalive(unsigned long, unsigned int);
-extern void iTCO_vendor_pre_set_heartbeat(unsigned int);
-extern int iTCO_vendor_check_noreboot_on(void);
-#else
-#define iTCO_vendor_pre_start(acpibase, heartbeat)     {}
-#define iTCO_vendor_pre_stop(acpibase)                 {}
-#define iTCO_vendor_pre_keepalive(acpibase,heartbeat)  {}
-#define iTCO_vendor_pre_set_heartbeat(heartbeat)       {}
-#define iTCO_vendor_check_noreboot_on()                        1       /* 1=check noreboot; 0=don't check */
-#endif
-
-/*
- * Some TCO specific functions
- */
-
-static inline unsigned int seconds_to_ticks(int seconds)
-{
-       /* the internal timer is stored as ticks which decrement
-        * every 0.6 seconds */
-       return (seconds * 10) / 6;
-}
-
-static void iTCO_wdt_set_NO_REBOOT_bit(void)
-{
-       u32 val32;
-
-       /* Set the NO_REBOOT bit: this disables reboots */
-       if (iTCO_wdt_private.iTCO_version == 2) {
-               val32 = readl(iTCO_wdt_private.gcs);
-               val32 |= 0x00000020;
-               writel(val32, iTCO_wdt_private.gcs);
-       } else if (iTCO_wdt_private.iTCO_version == 1) {
-               pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
-               val32 |= 0x00000002;
-               pci_write_config_dword(iTCO_wdt_private.pdev, 0xd4, val32);
-       }
-}
-
-static int iTCO_wdt_unset_NO_REBOOT_bit(void)
-{
-       int ret = 0;
-       u32 val32;
-
-       /* Unset the NO_REBOOT bit: this enables reboots */
-       if (iTCO_wdt_private.iTCO_version == 2) {
-               val32 = readl(iTCO_wdt_private.gcs);
-               val32 &= 0xffffffdf;
-               writel(val32, iTCO_wdt_private.gcs);
-
-               val32 = readl(iTCO_wdt_private.gcs);
-               if (val32 & 0x00000020)
-                       ret = -EIO;
-       } else if (iTCO_wdt_private.iTCO_version == 1) {
-               pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
-               val32 &= 0xfffffffd;
-               pci_write_config_dword(iTCO_wdt_private.pdev, 0xd4, val32);
-
-               pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
-               if (val32 & 0x00000002)
-                       ret = -EIO;
-       }
-
-       return ret; /* returns: 0 = OK, -EIO = Error */
-}
-
-static int iTCO_wdt_start(void)
-{
-       unsigned int val;
-
-       spin_lock(&iTCO_wdt_private.io_lock);
-
-       iTCO_vendor_pre_start(iTCO_wdt_private.ACPIBASE, heartbeat);
-
-       /* disable chipset's NO_REBOOT bit */
-       if (iTCO_wdt_unset_NO_REBOOT_bit()) {
-               printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
-               return -EIO;
-       }
-
-       /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */
-       val = inw(TCO1_CNT);
-       val &= 0xf7ff;
-       outw(val, TCO1_CNT);
-       val = inw(TCO1_CNT);
-       spin_unlock(&iTCO_wdt_private.io_lock);
-
-       if (val & 0x0800)
-               return -1;
-       return 0;
-}
-
-static int iTCO_wdt_stop(void)
-{
-       unsigned int val;
-
-       spin_lock(&iTCO_wdt_private.io_lock);
-
-       iTCO_vendor_pre_stop(iTCO_wdt_private.ACPIBASE);
-
-       /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */
-       val = inw(TCO1_CNT);
-       val |= 0x0800;
-       outw(val, TCO1_CNT);
-       val = inw(TCO1_CNT);
-
-       /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
-       iTCO_wdt_set_NO_REBOOT_bit();
-
-       spin_unlock(&iTCO_wdt_private.io_lock);
-
-       if ((val & 0x0800) == 0)
-               return -1;
-       return 0;
-}
-
-static int iTCO_wdt_keepalive(void)
-{
-       spin_lock(&iTCO_wdt_private.io_lock);
-
-       iTCO_vendor_pre_keepalive(iTCO_wdt_private.ACPIBASE, heartbeat);
-
-       /* Reload the timer by writing to the TCO Timer Counter register */
-       if (iTCO_wdt_private.iTCO_version == 2) {
-               outw(0x01, TCO_RLD);
-       } else if (iTCO_wdt_private.iTCO_version == 1) {
-               outb(0x01, TCO_RLD);
-       }
-
-       spin_unlock(&iTCO_wdt_private.io_lock);
-       return 0;
-}
-
-static int iTCO_wdt_set_heartbeat(int t)
-{
-       unsigned int val16;
-       unsigned char val8;
-       unsigned int tmrval;
-
-       tmrval = seconds_to_ticks(t);
-       /* from the specs: */
-       /* "Values of 0h-3h are ignored and should not be attempted" */
-       if (tmrval < 0x04)
-               return -EINVAL;
-       if (((iTCO_wdt_private.iTCO_version == 2) && (tmrval > 0x3ff)) ||
-           ((iTCO_wdt_private.iTCO_version == 1) && (tmrval > 0x03f)))
-               return -EINVAL;
-
-       iTCO_vendor_pre_set_heartbeat(tmrval);
-
-       /* Write new heartbeat to watchdog */
-       if (iTCO_wdt_private.iTCO_version == 2) {
-               spin_lock(&iTCO_wdt_private.io_lock);
-               val16 = inw(TCOv2_TMR);
-               val16 &= 0xfc00;
-               val16 |= tmrval;
-               outw(val16, TCOv2_TMR);
-               val16 = inw(TCOv2_TMR);
-               spin_unlock(&iTCO_wdt_private.io_lock);
-
-               if ((val16 & 0x3ff) != tmrval)
-                       return -EINVAL;
-       } else if (iTCO_wdt_private.iTCO_version == 1) {
-               spin_lock(&iTCO_wdt_private.io_lock);
-               val8 = inb(TCOv1_TMR);
-               val8 &= 0xc0;
-               val8 |= (tmrval & 0xff);
-               outb(val8, TCOv1_TMR);
-               val8 = inb(TCOv1_TMR);
-               spin_unlock(&iTCO_wdt_private.io_lock);
-
-               if ((val8 & 0x3f) != tmrval)
-                       return -EINVAL;
-       }
-
-       heartbeat = t;
-       return 0;
-}
-
-static int iTCO_wdt_get_timeleft (int *time_left)
-{
-       unsigned int val16;
-       unsigned char val8;
-
-       /* read the TCO Timer */
-       if (iTCO_wdt_private.iTCO_version == 2) {
-               spin_lock(&iTCO_wdt_private.io_lock);
-               val16 = inw(TCO_RLD);
-               val16 &= 0x3ff;
-               spin_unlock(&iTCO_wdt_private.io_lock);
-
-               *time_left = (val16 * 6) / 10;
-       } else if (iTCO_wdt_private.iTCO_version == 1) {
-               spin_lock(&iTCO_wdt_private.io_lock);
-               val8 = inb(TCO_RLD);
-               val8 &= 0x3f;
-               spin_unlock(&iTCO_wdt_private.io_lock);
-
-               *time_left = (val8 * 6) / 10;
-       } else
-               return -EINVAL;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static int iTCO_wdt_open (struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-       if (test_and_set_bit(0, &is_active))
-               return -EBUSY;
-
-       /*
-        *      Reload and activate timer
-        */
-       iTCO_wdt_keepalive();
-       iTCO_wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-static int iTCO_wdt_release (struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        */
-       if (expect_release == 42) {
-               iTCO_wdt_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               iTCO_wdt_keepalive();
-       }
-       clear_bit(0, &is_active);
-       expect_release = 0;
-       return 0;
-}
-
-static ssize_t iTCO_wdt_write (struct file *file, const char __user *data,
-                             size_t len, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       expect_release = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if (get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_release = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               iTCO_wdt_keepalive();
-       }
-       return len;
-}
-
-static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
-                         unsigned int cmd, unsigned long arg)
-{
-       int new_options, retval = -EINVAL;
-       int new_heartbeat;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_SETTIMEOUT |
-                                       WDIOF_KEEPALIVEPING |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     0,
-               .identity =             DRV_NAME,
-       };
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof (ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       iTCO_wdt_keepalive();
-                       return 0;
-
-               case WDIOC_SETOPTIONS:
-               {
-                       if (get_user(new_options, p))
-                               return -EFAULT;
-
-                       if (new_options & WDIOS_DISABLECARD) {
-                               iTCO_wdt_stop();
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_ENABLECARD) {
-                               iTCO_wdt_keepalive();
-                               iTCO_wdt_start();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-
-               case WDIOC_SETTIMEOUT:
-               {
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (iTCO_wdt_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       iTCO_wdt_keepalive();
-                       /* Fall */
-               }
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-
-               case WDIOC_GETTIMELEFT:
-               {
-                       int time_left;
-
-                       if (iTCO_wdt_get_timeleft(&time_left))
-                               return -EINVAL;
-
-                       return put_user(time_left, p);
-               }
-
-               default:
-                       return -ENOTTY;
-       }
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations iTCO_wdt_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .write =        iTCO_wdt_write,
-       .ioctl =        iTCO_wdt_ioctl,
-       .open =         iTCO_wdt_open,
-       .release =      iTCO_wdt_release,
-};
-
-static struct miscdevice iTCO_wdt_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &iTCO_wdt_fops,
-};
-
-/*
- *     Init & exit routines
- */
-
-static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, struct platform_device *dev)
-{
-       int ret;
-       u32 base_address;
-       unsigned long RCBA;
-       unsigned long val32;
-
-       /*
-        *      Find the ACPI/PM base I/O address which is the base
-        *      for the TCO registers (TCOBASE=ACPIBASE + 0x60)
-        *      ACPIBASE is bits [15:7] from 0x40-0x43
-        */
-       pci_read_config_dword(pdev, 0x40, &base_address);
-       base_address &= 0x0000ff80;
-       if (base_address == 0x00000000) {
-               /* Something's wrong here, ACPIBASE has to be set */
-               printk(KERN_ERR PFX "failed to get TCOBASE address\n");
-               pci_dev_put(pdev);
-               return -ENODEV;
-       }
-       iTCO_wdt_private.iTCO_version = iTCO_chipset_info[ent->driver_data].iTCO_version;
-       iTCO_wdt_private.ACPIBASE = base_address;
-       iTCO_wdt_private.pdev = pdev;
-
-       /* Get the Memory-Mapped GCS register, we need it for the NO_REBOOT flag (TCO v2) */
-       /* To get access to it you have to read RCBA from PCI Config space 0xf0
-          and use it as base. GCS = RCBA + ICH6_GCS(0x3410). */
-       if (iTCO_wdt_private.iTCO_version == 2) {
-               pci_read_config_dword(pdev, 0xf0, &base_address);
-               RCBA = base_address & 0xffffc000;
-               iTCO_wdt_private.gcs = ioremap((RCBA + 0x3410),4);
-       }
-
-       /* Check chipset's NO_REBOOT bit */
-       if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
-               printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
-               ret = -ENODEV;  /* Cannot reset NO_REBOOT bit */
-               goto out;
-       }
-
-       /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
-       iTCO_wdt_set_NO_REBOOT_bit();
-
-       /* Set the TCO_EN bit in SMI_EN register */
-       if (!request_region(SMI_EN, 4, "iTCO_wdt")) {
-               printk(KERN_ERR PFX "I/O address 0x%04lx already in use\n",
-                       SMI_EN );
-               ret = -EIO;
-               goto out;
-       }
-       val32 = inl(SMI_EN);
-       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
-       outl(val32, SMI_EN);
-       release_region(SMI_EN, 4);
-
-       /* The TCO I/O registers reside in a 32-byte range pointed to by the TCOBASE value */
-       if (!request_region (TCOBASE, 0x20, "iTCO_wdt")) {
-               printk (KERN_ERR PFX "I/O address 0x%04lx already in use\n",
-                       TCOBASE);
-               ret = -EIO;
-               goto out;
-       }
-
-       printk(KERN_INFO PFX "Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n",
-               iTCO_chipset_info[ent->driver_data].name,
-               iTCO_chipset_info[ent->driver_data].iTCO_version,
-               TCOBASE);
-
-       /* Clear out the (probably old) status */
-       outb(0, TCO1_STS);
-       outb(3, TCO2_STS);
-
-       /* Make sure the watchdog is not running */
-       iTCO_wdt_stop();
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (iTCO_wdt_set_heartbeat(heartbeat)) {
-               iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT);
-               printk(KERN_INFO PFX "heartbeat value must be 2<heartbeat<39 (TCO v1) or 613 (TCO v2), using %d\n",
-                       heartbeat);
-       }
-
-       ret = misc_register(&iTCO_wdt_miscdev);
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto unreg_region;
-       }
-
-       printk (KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
-               heartbeat, nowayout);
-
-       return 0;
-
-unreg_region:
-       release_region (TCOBASE, 0x20);
-out:
-       if (iTCO_wdt_private.iTCO_version == 2)
-               iounmap(iTCO_wdt_private.gcs);
-       pci_dev_put(iTCO_wdt_private.pdev);
-       iTCO_wdt_private.ACPIBASE = 0;
-       return ret;
-}
-
-static void iTCO_wdt_cleanup(void)
-{
-       /* Stop the timer before we leave */
-       if (!nowayout)
-               iTCO_wdt_stop();
-
-       /* Deregister */
-       misc_deregister(&iTCO_wdt_miscdev);
-       release_region(TCOBASE, 0x20);
-       if (iTCO_wdt_private.iTCO_version == 2)
-               iounmap(iTCO_wdt_private.gcs);
-       pci_dev_put(iTCO_wdt_private.pdev);
-       iTCO_wdt_private.ACPIBASE = 0;
-}
-
-static int iTCO_wdt_probe(struct platform_device *dev)
-{
-       int found = 0;
-       struct pci_dev *pdev = NULL;
-       const struct pci_device_id *ent;
-
-       spin_lock_init(&iTCO_wdt_private.io_lock);
-
-       for_each_pci_dev(pdev) {
-               ent = pci_match_id(iTCO_wdt_pci_tbl, pdev);
-               if (ent) {
-                       if (!(iTCO_wdt_init(pdev, ent, dev))) {
-                               found++;
-                               break;
-                       }
-               }
-       }
-
-       if (!found) {
-               printk(KERN_INFO PFX "No card detected\n");
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
-static int iTCO_wdt_remove(struct platform_device *dev)
-{
-       if (iTCO_wdt_private.ACPIBASE)
-               iTCO_wdt_cleanup();
-
-       return 0;
-}
-
-static void iTCO_wdt_shutdown(struct platform_device *dev)
-{
-       iTCO_wdt_stop();
-}
-
-#define iTCO_wdt_suspend NULL
-#define iTCO_wdt_resume  NULL
-
-static struct platform_driver iTCO_wdt_driver = {
-       .probe          = iTCO_wdt_probe,
-       .remove         = iTCO_wdt_remove,
-       .shutdown       = iTCO_wdt_shutdown,
-       .suspend        = iTCO_wdt_suspend,
-       .resume         = iTCO_wdt_resume,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = DRV_NAME,
-       },
-};
-
-static int __init iTCO_wdt_init_module(void)
-{
-       int err;
-
-       printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s (%s)\n",
-               DRV_VERSION, DRV_RELDATE);
-
-       err = platform_driver_register(&iTCO_wdt_driver);
-       if (err)
-               return err;
-
-       iTCO_wdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
-       if (IS_ERR(iTCO_wdt_platform_device)) {
-               err = PTR_ERR(iTCO_wdt_platform_device);
-               goto unreg_platform_driver;
-       }
-
-       return 0;
-
-unreg_platform_driver:
-       platform_driver_unregister(&iTCO_wdt_driver);
-       return err;
-}
-
-static void __exit iTCO_wdt_cleanup_module(void)
-{
-       platform_device_unregister(iTCO_wdt_platform_device);
-       platform_driver_unregister(&iTCO_wdt_driver);
-       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
-}
-
-module_init(iTCO_wdt_init_module);
-module_exit(iTCO_wdt_cleanup_module);
-
-MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>");
-MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver");
-MODULE_VERSION(DRV_VERSION);
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
deleted file mode 100644 (file)
index c3a60f5..0000000
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- *     IB700 Single Board Computer WDT driver
- *
- *     (c) Copyright 2001 Charles Howes <chowes@vsol.net>
- *
- *     Based on advantechwdt.c which is based on acquirewdt.c which
- *     is based on wdt.c.
- *
- *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
- *
- *     Based on acquirewdt.c which is based on wdt.c.
- *     Original copyright messages:
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
- *
- *     14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *          Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *          Added timeout module option to override default
- *
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-static struct platform_device *ibwdt_platform_device;
-static unsigned long ibwdt_is_open;
-static spinlock_t ibwdt_lock;
-static char expect_close;
-
-/* Module information */
-#define DRV_NAME "ib700wdt"
-#define PFX DRV_NAME ": "
-
-/*
- *
- * Watchdog Timer Configuration
- *
- * The function of the watchdog timer is to reset the system
- * automatically and is defined at I/O port 0443H.  To enable the
- * watchdog timer and allow the system to reset, write I/O port 0443H.
- * To disable the timer, write I/O port 0441H for the system to stop the
- * watchdog function.  The timer has a tolerance of 20% for its
- * intervals.
- *
- * The following describes how the timer should be programmed.
- *
- * Enabling Watchdog:
- * MOV AX,000FH (Choose the values from 0 to F)
- * MOV DX,0443H
- * OUT DX,AX
- *
- * Disabling Watchdog:
- * MOV AX,000FH (Any value is fine.)
- * MOV DX,0441H
- * OUT DX,AX
- *
- * Watchdog timer control table:
- * Level   Value  Time/sec | Level Value Time/sec
- *   1       F       0     |   9     7      16
- *   2       E       2     |   10    6      18
- *   3       D       4     |   11    5      20
- *   4       C       6     |   12    4      22
- *   5       B       8     |   13    3      24
- *   6       A       10    |   14    2      26
- *   7       9       12    |   15    1      28
- *   8       8       14    |   16    0      30
- *
- */
-
-static int wd_times[] = {
-       30,     /* 0x0 */
-       28,     /* 0x1 */
-       26,     /* 0x2 */
-       24,     /* 0x3 */
-       22,     /* 0x4 */
-       20,     /* 0x5 */
-       18,     /* 0x6 */
-       16,     /* 0x7 */
-       14,     /* 0x8 */
-       12,     /* 0x9 */
-       10,     /* 0xA */
-       8,      /* 0xB */
-       6,      /* 0xC */
-       4,      /* 0xD */
-       2,      /* 0xE */
-       0,      /* 0xF */
-};
-
-#define WDT_STOP 0x441
-#define WDT_START 0x443
-
-/* Default timeout */
-#define WD_TIMO 0              /* 30 seconds +/- 20%, from table */
-
-static int wd_margin = WD_TIMO;
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-
-/*
- *     Watchdog Operations
- */
-
-static void
-ibwdt_ping(void)
-{
-       spin_lock(&ibwdt_lock);
-
-       /* Write a watchdog value */
-       outb_p(wd_margin, WDT_START);
-
-       spin_unlock(&ibwdt_lock);
-}
-
-static void
-ibwdt_disable(void)
-{
-       spin_lock(&ibwdt_lock);
-       outb_p(0, WDT_STOP);
-       spin_unlock(&ibwdt_lock);
-}
-
-static int
-ibwdt_set_heartbeat(int t)
-{
-       int i;
-
-       if ((t < 0) || (t > 30))
-               return -EINVAL;
-
-       for (i = 0x0F; i > -1; i--)
-               if (wd_times[i] > t)
-                       break;
-       wd_margin = i;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static ssize_t
-ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               ibwdt_ping();
-       }
-       return count;
-}
-
-static int
-ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-         unsigned long arg)
-{
-       int new_margin;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "IB700 WDT",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-         if (copy_to_user(argp, &ident, sizeof(ident)))
-           return -EFAULT;
-         break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-         return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-         ibwdt_ping();
-         break;
-
-       case WDIOC_SETTIMEOUT:
-         if (get_user(new_margin, p))
-                 return -EFAULT;
-         if (ibwdt_set_heartbeat(new_margin))
-                 return -EINVAL;
-         ibwdt_ping();
-         /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-         return put_user(wd_times[wd_margin], p);
-
-       case WDIOC_SETOPTIONS:
-       {
-         int options, retval = -EINVAL;
-
-         if (get_user(options, p))
-           return -EFAULT;
-
-         if (options & WDIOS_DISABLECARD) {
-           ibwdt_disable();
-           retval = 0;
-         }
-
-         if (options & WDIOS_ENABLECARD) {
-           ibwdt_ping();
-           retval = 0;
-         }
-
-         return retval;
-       }
-
-       default:
-         return -ENOTTY;
-       }
-       return 0;
-}
-
-static int
-ibwdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &ibwdt_is_open)) {
-               return -EBUSY;
-       }
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Activate */
-       ibwdt_ping();
-       return nonseekable_open(inode, file);
-}
-
-static int
-ibwdt_close(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               ibwdt_disable();
-       } else {
-               printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
-               ibwdt_ping();
-       }
-       clear_bit(0, &ibwdt_is_open);
-       expect_close = 0;
-       return 0;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations ibwdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = ibwdt_write,
-       .ioctl          = ibwdt_ioctl,
-       .open           = ibwdt_open,
-       .release        = ibwdt_close,
-};
-
-static struct miscdevice ibwdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &ibwdt_fops,
-};
-
-/*
- *     Init & exit routines
- */
-
-static int __devinit ibwdt_probe(struct platform_device *dev)
-{
-       int res;
-
-       spin_lock_init(&ibwdt_lock);
-
-#if WDT_START != WDT_STOP
-       if (!request_region(WDT_STOP, 1, "IB700 WDT")) {
-               printk (KERN_ERR PFX "STOP method I/O %X is not available.\n", WDT_STOP);
-               res = -EIO;
-               goto out_nostopreg;
-       }
-#endif
-
-       if (!request_region(WDT_START, 1, "IB700 WDT")) {
-               printk (KERN_ERR PFX "START method I/O %X is not available.\n", WDT_START);
-               res = -EIO;
-               goto out_nostartreg;
-       }
-
-       res = misc_register(&ibwdt_miscdev);
-       if (res) {
-               printk (KERN_ERR PFX "failed to register misc device\n");
-               goto out_nomisc;
-       }
-       return 0;
-
-out_nomisc:
-       release_region(WDT_START, 1);
-out_nostartreg:
-#if WDT_START != WDT_STOP
-       release_region(WDT_STOP, 1);
-#endif
-out_nostopreg:
-       return res;
-}
-
-static int __devexit ibwdt_remove(struct platform_device *dev)
-{
-       misc_deregister(&ibwdt_miscdev);
-       release_region(WDT_START,1);
-#if WDT_START != WDT_STOP
-       release_region(WDT_STOP,1);
-#endif
-       return 0;
-}
-
-static void ibwdt_shutdown(struct platform_device *dev)
-{
-       /* Turn the WDT off if we have a soft shutdown */
-       ibwdt_disable();
-}
-
-static struct platform_driver ibwdt_driver = {
-       .probe          = ibwdt_probe,
-       .remove         = __devexit_p(ibwdt_remove),
-       .shutdown       = ibwdt_shutdown,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = DRV_NAME,
-       },
-};
-
-static int __init ibwdt_init(void)
-{
-       int err;
-
-       printk(KERN_INFO PFX "WDT driver for IB700 single board computer initialising.\n");
-
-       err = platform_driver_register(&ibwdt_driver);
-       if (err)
-               return err;
-
-       ibwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
-       if (IS_ERR(ibwdt_platform_device)) {
-               err = PTR_ERR(ibwdt_platform_device);
-               goto unreg_platform_driver;
-       }
-
-       return 0;
-
-unreg_platform_driver:
-       platform_driver_unregister(&ibwdt_driver);
-       return err;
-}
-
-static void __exit ibwdt_exit(void)
-{
-       platform_device_unregister(ibwdt_platform_device);
-       platform_driver_unregister(&ibwdt_driver);
-       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
-}
-
-module_init(ibwdt_init);
-module_exit(ibwdt_exit);
-
-MODULE_AUTHOR("Charles Howes <chowes@vsol.net>");
-MODULE_DESCRIPTION("IB700 SBC watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-/* end of ib700wdt.c */
diff --git a/drivers/char/watchdog/ibmasr.c b/drivers/char/watchdog/ibmasr.c
deleted file mode 100644 (file)
index 94155f6..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * IBM Automatic Server Restart driver.
- *
- * Copyright (c) 2005 Andrey Panin <pazke@donpac.ru>
- *
- * Based on driver written by Pete Reynolds.
- * Copyright (c) IBM Corporation, 1998-2004.
- *
- * This software may be used and distributed according to the terms
- * of the GNU Public License, incorporated herein by reference.
- */
-
-#include <linux/fs.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <linux/timer.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/dmi.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-
-enum {
-       ASMTYPE_UNKNOWN,
-       ASMTYPE_TOPAZ,
-       ASMTYPE_JASPER,
-       ASMTYPE_PEARL,
-       ASMTYPE_JUNIPER,
-       ASMTYPE_SPRUCE,
-};
-
-#define PFX "ibmasr: "
-
-#define TOPAZ_ASR_REG_OFFSET   4
-#define TOPAZ_ASR_TOGGLE       0x40
-#define TOPAZ_ASR_DISABLE      0x80
-
-/* PEARL ASR S/W REGISTER SUPERIO PORT ADDRESSES */
-#define PEARL_BASE     0xe04
-#define PEARL_WRITE    0xe06
-#define PEARL_READ     0xe07
-
-#define PEARL_ASR_DISABLE_MASK 0x80    /* bit 7: disable = 1, enable = 0 */
-#define PEARL_ASR_TOGGLE_MASK  0x40    /* bit 6: 0, then 1, then 0 */
-
-/* JASPER OFFSET FROM SIO BASE ADDR TO ASR S/W REGISTERS. */
-#define JASPER_ASR_REG_OFFSET  0x38
-
-#define JASPER_ASR_DISABLE_MASK        0x01    /* bit 0: disable = 1, enable = 0 */
-#define JASPER_ASR_TOGGLE_MASK 0x02    /* bit 1: 0, then 1, then 0 */
-
-#define JUNIPER_BASE_ADDRESS   0x54b   /* Base address of Juniper ASR */
-#define JUNIPER_ASR_DISABLE_MASK 0x01  /* bit 0: disable = 1 enable = 0 */
-#define JUNIPER_ASR_TOGGLE_MASK        0x02    /* bit 1: 0, then 1, then 0 */
-
-#define SPRUCE_BASE_ADDRESS    0x118e  /* Base address of Spruce ASR */
-#define SPRUCE_ASR_DISABLE_MASK        0x01    /* bit 1: disable = 1 enable = 0 */
-#define SPRUCE_ASR_TOGGLE_MASK 0x02    /* bit 0: 0, then 1, then 0 */
-
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-static unsigned long asr_is_open;
-static char asr_expect_close;
-
-static unsigned int asr_type, asr_base, asr_length;
-static unsigned int asr_read_addr, asr_write_addr;
-static unsigned char asr_toggle_mask, asr_disable_mask;
-
-static void asr_toggle(void)
-{
-       unsigned char reg = inb(asr_read_addr);
-
-       outb(reg & ~asr_toggle_mask, asr_write_addr);
-       reg = inb(asr_read_addr);
-
-       outb(reg | asr_toggle_mask, asr_write_addr);
-       reg = inb(asr_read_addr);
-
-       outb(reg & ~asr_toggle_mask, asr_write_addr);
-       reg = inb(asr_read_addr);
-}
-
-static void asr_enable(void)
-{
-       unsigned char reg;
-
-       if (asr_type == ASMTYPE_TOPAZ) {
-               /* asr_write_addr == asr_read_addr */
-               reg = inb(asr_read_addr);
-               outb(reg & ~(TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE),
-                    asr_read_addr);
-       } else {
-               /*
-                * First make sure the hardware timer is reset by toggling
-                * ASR hardware timer line.
-                */
-               asr_toggle();
-
-               reg = inb(asr_read_addr);
-               outb(reg & ~asr_disable_mask, asr_write_addr);
-       }
-       reg = inb(asr_read_addr);
-}
-
-static void asr_disable(void)
-{
-       unsigned char reg = inb(asr_read_addr);
-
-       if (asr_type == ASMTYPE_TOPAZ)
-               /* asr_write_addr == asr_read_addr */
-               outb(reg | TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE,
-                    asr_read_addr);
-       else {
-               outb(reg | asr_toggle_mask, asr_write_addr);
-               reg = inb(asr_read_addr);
-
-               outb(reg | asr_disable_mask, asr_write_addr);
-       }
-       reg = inb(asr_read_addr);
-}
-
-static int __init asr_get_base_address(void)
-{
-       unsigned char low, high;
-       const char *type = "";
-
-       asr_length = 1;
-
-       switch (asr_type) {
-       case ASMTYPE_TOPAZ:
-               /* SELECT SuperIO CHIP FOR QUERYING (WRITE 0x07 TO BOTH 0x2E and 0x2F) */
-               outb(0x07, 0x2e);
-               outb(0x07, 0x2f);
-
-               /* SELECT AND READ THE HIGH-NIBBLE OF THE GPIO BASE ADDRESS */
-               outb(0x60, 0x2e);
-               high = inb(0x2f);
-
-               /* SELECT AND READ THE LOW-NIBBLE OF THE GPIO BASE ADDRESS */
-               outb(0x61, 0x2e);
-               low = inb(0x2f);
-
-               asr_base = (high << 16) | low;
-               asr_read_addr = asr_write_addr =
-                       asr_base + TOPAZ_ASR_REG_OFFSET;
-               asr_length = 5;
-
-               break;
-
-       case ASMTYPE_JASPER:
-               type = "Jaspers ";
-
-               /* FIXME: need to use pci_config_lock here, but it's not exported */
-
-/*             spin_lock_irqsave(&pci_config_lock, flags);*/
-
-               /* Select the SuperIO chip in the PCI I/O port register */
-               outl(0x8000f858, 0xcf8);
-
-               /*
-                * Read the base address for the SuperIO chip.
-                * Only the lower 16 bits are valid, but the address is word
-                * aligned so the last bit must be masked off.
-                */
-               asr_base = inl(0xcfc) & 0xfffe;
-
-/*             spin_unlock_irqrestore(&pci_config_lock, flags);*/
-
-               asr_read_addr = asr_write_addr =
-                       asr_base + JASPER_ASR_REG_OFFSET;
-               asr_toggle_mask = JASPER_ASR_TOGGLE_MASK;
-               asr_disable_mask = JASPER_ASR_DISABLE_MASK;
-               asr_length = JASPER_ASR_REG_OFFSET + 1;
-
-               break;
-
-       case ASMTYPE_PEARL:
-               type = "Pearls ";
-               asr_base = PEARL_BASE;
-               asr_read_addr = PEARL_READ;
-               asr_write_addr = PEARL_WRITE;
-               asr_toggle_mask = PEARL_ASR_TOGGLE_MASK;
-               asr_disable_mask = PEARL_ASR_DISABLE_MASK;
-               asr_length = 4;
-               break;
-
-       case ASMTYPE_JUNIPER:
-               type = "Junipers ";
-               asr_base = JUNIPER_BASE_ADDRESS;
-               asr_read_addr = asr_write_addr = asr_base;
-               asr_toggle_mask = JUNIPER_ASR_TOGGLE_MASK;
-               asr_disable_mask = JUNIPER_ASR_DISABLE_MASK;
-               break;
-
-       case ASMTYPE_SPRUCE:
-               type = "Spruce's ";
-               asr_base = SPRUCE_BASE_ADDRESS;
-               asr_read_addr = asr_write_addr = asr_base;
-               asr_toggle_mask = SPRUCE_ASR_TOGGLE_MASK;
-               asr_disable_mask = SPRUCE_ASR_DISABLE_MASK;
-               break;
-       }
-
-       if (!request_region(asr_base, asr_length, "ibmasr")) {
-               printk(KERN_ERR PFX "address %#x already in use\n",
-                       asr_base);
-               return -EBUSY;
-       }
-
-       printk(KERN_INFO PFX "found %sASR @ addr %#x\n", type, asr_base);
-
-       return 0;
-}
-
-
-static ssize_t asr_write(struct file *file, const char __user *buf,
-                        size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       asr_expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       asr_expect_close = 42;
-                       }
-               }
-               asr_toggle();
-       }
-       return count;
-}
-
-static int asr_ioctl(struct inode *inode, struct file *file,
-                    unsigned int cmd, unsigned long arg)
-{
-       static const struct watchdog_info ident = {
-               .options =      WDIOF_KEEPALIVEPING | 
-                               WDIOF_MAGICCLOSE,
-               .identity =     "IBM ASR"
-       };
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int heartbeat;
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident)) ?
-                               -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       asr_toggle();
-                       return 0;
-
-               /*
-                * The hardware has a fixed timeout value, so no WDIOC_SETTIMEOUT
-                * and WDIOC_GETTIMEOUT always returns 256.
-                */
-               case WDIOC_GETTIMEOUT:
-                       heartbeat = 256;
-                       return put_user(heartbeat, p);
-
-               case WDIOC_SETOPTIONS: {
-                       int new_options, retval = -EINVAL;
-
-                       if (get_user(new_options, p))
-                               return -EFAULT;
-
-                       if (new_options & WDIOS_DISABLECARD) {
-                               asr_disable();
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_ENABLECARD) {
-                               asr_enable();
-                               asr_toggle();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-       }
-
-       return -ENOTTY;
-}
-
-static int asr_open(struct inode *inode, struct file *file)
-{
-       if(test_and_set_bit(0, &asr_is_open))
-               return -EBUSY;
-
-       asr_toggle();
-       asr_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static int asr_release(struct inode *inode, struct file *file)
-{
-       if (asr_expect_close == 42)
-               asr_disable();
-       else {
-               printk(KERN_CRIT PFX "unexpected close, not stopping watchdog!\n");
-               asr_toggle();
-       }
-       clear_bit(0, &asr_is_open);
-       asr_expect_close = 0;
-       return 0;
-}
-
-static const struct file_operations asr_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .write =        asr_write,
-       .ioctl =        asr_ioctl,
-       .open =         asr_open,
-       .release =      asr_release,
-};
-
-static struct miscdevice asr_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &asr_fops,
-};
-
-
-struct ibmasr_id {
-       const char *desc;
-       int type;
-};
-
-static struct ibmasr_id __initdata ibmasr_id_table[] = {
-       { "IBM Automatic Server Restart - eserver xSeries 220", ASMTYPE_TOPAZ },
-       { "IBM Automatic Server Restart - Machine Type 8673", ASMTYPE_PEARL },
-       { "IBM Automatic Server Restart - Machine Type 8480", ASMTYPE_JASPER },
-       { "IBM Automatic Server Restart - Machine Type 8482", ASMTYPE_JUNIPER },
-       { "IBM Automatic Server Restart - Machine Type 8648", ASMTYPE_SPRUCE },
-       { NULL }
-};
-
-static int __init ibmasr_init(void)
-{
-       struct ibmasr_id *id;
-       int rc;
-
-       for (id = ibmasr_id_table; id->desc; id++) {
-               if (dmi_find_device(DMI_DEV_TYPE_OTHER, id->desc, NULL)) {
-                       asr_type = id->type;
-                       break;
-               }
-       }
-
-       if (!asr_type)
-               return -ENODEV;
-
-       rc = asr_get_base_address();
-       if (rc)
-               return rc;
-
-       rc = misc_register(&asr_miscdev);
-       if (rc < 0) {
-               release_region(asr_base, asr_length);
-               printk(KERN_ERR PFX "failed to register misc device\n");
-               return rc;
-       }
-
-       return 0;
-}
-
-static void __exit ibmasr_exit(void)
-{
-       if (!nowayout)
-               asr_disable();
-
-       misc_deregister(&asr_miscdev);
-
-       release_region(asr_base, asr_length);
-}
-
-module_init(ibmasr_init);
-module_exit(ibmasr_exit);
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-MODULE_DESCRIPTION("IBM Automatic Server Restart driver");
-MODULE_AUTHOR("Andrey Panin");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c
deleted file mode 100644 (file)
index 788245b..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *     IndyDog 0.3     A Hardware Watchdog Device for SGI IP22
- *
- *     (c) Copyright 2002 Guido Guenther <agx@sigxcpu.org>, All Rights Reserved.
- *
- *     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.
- *
- *     based on softdog.c by Alan Cox <alan@redhat.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <asm/uaccess.h>
-#include <asm/sgi/mc.h>
-
-#define PFX "indydog: "
-static int indydog_alive;
-
-#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void indydog_start(void)
-{
-       u32 mc_ctrl0 = sgimc->cpuctrl0;
-
-       mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
-       sgimc->cpuctrl0 = mc_ctrl0;
-}
-
-static void indydog_stop(void)
-{
-       u32 mc_ctrl0 = sgimc->cpuctrl0;
-
-       mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
-       sgimc->cpuctrl0 = mc_ctrl0;
-
-       printk(KERN_INFO PFX "Stopped watchdog timer.\n");
-}
-
-static void indydog_ping(void)
-{
-       sgimc->watchdogt = 0;
-}
-
-/*
- *     Allow only one person to hold it open
- */
-static int indydog_open(struct inode *inode, struct file *file)
-{
-       if (indydog_alive)
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Activate timer */
-       indydog_start();
-       indydog_ping();
-
-       indydog_alive = 1;
-       printk(KERN_INFO "Started watchdog timer.\n");
-
-       return nonseekable_open(inode, file);
-}
-
-static int indydog_release(struct inode *inode, struct file *file)
-{
-       /* Shut off the timer.
-        * Lock it in if it's a module and we defined ...NOWAYOUT */
-       if (!nowayout)
-               indydog_stop();         /* Turn the WDT off */
-
-       indydog_alive = 0;
-
-       return 0;
-}
-
-static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       /* Refresh the timer. */
-       if (len) {
-               indydog_ping();
-       }
-       return len;
-}
-
-static int indydog_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       int options, retval = -EINVAL;
-       static struct watchdog_info ident = {
-               .options                = WDIOF_KEEPALIVEPING |
-                                         WDIOF_MAGICCLOSE,
-               .firmware_version       = 0,
-               .identity               = "Hardware Watchdog for SGI IP22",
-       };
-
-       switch (cmd) {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user((struct watchdog_info *)arg,
-                                        &ident, sizeof(ident)))
-                               return -EFAULT;
-                       return 0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0,(int *)arg);
-               case WDIOC_KEEPALIVE:
-                       indydog_ping();
-                       return 0;
-               case WDIOC_GETTIMEOUT:
-                       return put_user(WATCHDOG_TIMEOUT,(int *)arg);
-               case WDIOC_SETOPTIONS:
-               {
-                       if (get_user(options, (int *)arg))
-                               return -EFAULT;
-
-                       if (options & WDIOS_DISABLECARD) {
-                               indydog_stop();
-                               retval = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               indydog_start();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-       }
-}
-
-static int indydog_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-               indydog_stop();         /* Turn the WDT off */
-
-       return NOTIFY_DONE;
-}
-
-static const struct file_operations indydog_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = indydog_write,
-       .ioctl          = indydog_ioctl,
-       .open           = indydog_open,
-       .release        = indydog_release,
-};
-
-static struct miscdevice indydog_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &indydog_fops,
-};
-
-static struct notifier_block indydog_notifier = {
-       .notifier_call = indydog_notify_sys,
-};
-
-static char banner[] __initdata =
-       KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
-
-static int __init watchdog_init(void)
-{
-       int ret;
-
-       ret = register_reboot_notifier(&indydog_notifier);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               return ret;
-       }
-
-       ret = misc_register(&indydog_miscdev);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               unregister_reboot_notifier(&indydog_notifier);
-               return ret;
-       }
-
-       printk(banner);
-
-       return 0;
-}
-
-static void __exit watchdog_exit(void)
-{
-       misc_deregister(&indydog_miscdev);
-       unregister_reboot_notifier(&indydog_notifier);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);
-
-MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>");
-MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/iop_wdt.c b/drivers/char/watchdog/iop_wdt.c
deleted file mode 100644 (file)
index bbbd91a..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * drivers/char/watchdog/iop_wdt.c
- *
- * WDT driver for Intel I/O Processors
- * Copyright (C) 2005, Intel Corporation.
- *
- * Based on ixp4xx driver, Copyright 2004 (c) MontaVista, Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
- *     Curt E Bruns <curt.e.bruns@intel.com>
- *     Peter Milne <peter.milne@d-tacq.com>
- *     Dan Williams <dan.j.williams@intel.com>
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/uaccess.h>
-#include <asm/hardware.h>
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-static unsigned long wdt_status;
-static unsigned long boot_status;
-
-#define WDT_IN_USE             0
-#define WDT_OK_TO_CLOSE                1
-#define WDT_ENABLED            2
-
-static unsigned long iop_watchdog_timeout(void)
-{
-       return (0xffffffffUL / get_iop_tick_rate());
-}
-
-/**
- * wdt_supports_disable - determine if we are accessing a iop13xx watchdog
- * or iop3xx by whether it has a disable command
- */
-static int wdt_supports_disable(void)
-{
-       int can_disable;
-
-       if (IOP_WDTCR_EN_ARM != IOP_WDTCR_DIS_ARM)
-               can_disable = 1;
-       else
-               can_disable = 0;
-
-       return can_disable;
-}
-
-static void wdt_enable(void)
-{
-       /* Arm and enable the Timer to starting counting down from 0xFFFF.FFFF
-        * Takes approx. 10.7s to timeout
-        */
-       write_wdtcr(IOP_WDTCR_EN_ARM);
-       write_wdtcr(IOP_WDTCR_EN);
-}
-
-/* returns 0 if the timer was successfully disabled */
-static int wdt_disable(void)
-{
-       /* Stop Counting */
-       if (wdt_supports_disable()) {
-               write_wdtcr(IOP_WDTCR_DIS_ARM);
-               write_wdtcr(IOP_WDTCR_DIS);
-               clear_bit(WDT_ENABLED, &wdt_status);
-               printk(KERN_INFO "WATCHDOG: Disabled\n");
-               return 0;
-       } else
-               return 1;
-}
-
-static int iop_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
-               return -EBUSY;
-
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       wdt_enable();
-
-       set_bit(WDT_ENABLED, &wdt_status);
-
-       return nonseekable_open(inode, file);
-}
-
-static ssize_t
-iop_wdt_write(struct file *file, const char *data, size_t len,
-                 loff_t *ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                       }
-               }
-               wdt_enable();
-       }
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
-       .identity = "iop watchdog",
-};
-
-static int
-iop_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                 unsigned long arg)
-{
-       int options;
-       int ret = -ENOTTY;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user
-                   ((struct watchdog_info *)arg, &ident, sizeof ident))
-                       ret = -EFAULT;
-               else
-                       ret = 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-               ret = put_user(0, (int *)arg);
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(boot_status, (int *)arg);
-               break;
-
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(iop_watchdog_timeout(), (int *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
-
-       case WDIOC_SETOPTIONS:
-               if (get_user(options, (int *)arg))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD) {
-                       if (!nowayout) {
-                               if (wdt_disable() == 0) {
-                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                                       ret = 0;
-                               } else
-                                       ret = -ENXIO;
-                       } else
-                               ret = 0;
-               }
-
-               if (options & WDIOS_ENABLECARD) {
-                       wdt_enable();
-                       ret = 0;
-               }
-               break;
-       }
-
-       return ret;
-}
-
-static int iop_wdt_release(struct inode *inode, struct file *file)
-{
-       int state = 1;
-       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
-               if (test_bit(WDT_ENABLED, &wdt_status))
-                       state = wdt_disable();
-
-       /* if the timer is not disbaled reload and notify that we are still
-        * going down
-        */
-       if (state != 0) {
-               wdt_enable();
-               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
-                      "reset in %lu seconds\n", iop_watchdog_timeout());
-       }
-
-       clear_bit(WDT_IN_USE, &wdt_status);
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       return 0;
-}
-
-static const struct file_operations iop_wdt_fops = {
-       .owner = THIS_MODULE,
-       .llseek = no_llseek,
-       .write = iop_wdt_write,
-       .ioctl = iop_wdt_ioctl,
-       .open = iop_wdt_open,
-       .release = iop_wdt_release,
-};
-
-static struct miscdevice iop_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &iop_wdt_fops,
-};
-
-static int __init iop_wdt_init(void)
-{
-       int ret;
-
-       ret = misc_register(&iop_wdt_miscdev);
-       if (ret == 0)
-               printk("iop watchdog timer: timeout %lu sec\n",
-                      iop_watchdog_timeout());
-
-       /* check if the reset was caused by the watchdog timer */
-       boot_status = (read_rcsr() & IOP_RCSR_WDT) ? WDIOF_CARDRESET : 0;
-
-       /* Configure Watchdog Timeout to cause an Internal Bus (IB) Reset
-        * NOTE: An IB Reset will Reset both cores in the IOP342
-        */
-       write_wdtsr(IOP13XX_WDTCR_IB_RESET);
-
-       return ret;
-}
-
-static void __exit iop_wdt_exit(void)
-{
-       misc_deregister(&iop_wdt_miscdev);
-}
-
-module_init(iop_wdt_init);
-module_exit(iop_wdt_exit);
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
-
-MODULE_AUTHOR("Curt E Bruns <curt.e.bruns@intel.com>");
-MODULE_DESCRIPTION("iop watchdog timer driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
deleted file mode 100644 (file)
index dc7548d..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * drivers/char/watchdog/ixp2000_wdt.c
- *
- * Watchdog driver for Intel IXP2000 network processors
- *
- * Adapted from the IXP4xx watchdog driver by Lennert Buytenhek.
- * The original version carries these notices:
- *
- * Author: Deepak Saxena <dsaxena@plexity.net>
- *
- * Copyright 2004 (c) MontaVista, Software, Inc.
- * Based on sa1100 driver, Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/init.h>
-#include <linux/bitops.h>
-
-#include <asm/hardware.h>
-#include <asm/uaccess.h>
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-static unsigned int heartbeat = 60;    /* (secs) Default is 1 minute */
-static unsigned long wdt_status;
-
-#define        WDT_IN_USE              0
-#define        WDT_OK_TO_CLOSE         1
-
-static unsigned long wdt_tick_rate;
-
-static void
-wdt_enable(void)
-{
-       ixp2000_reg_write(IXP2000_RESET0, *(IXP2000_RESET0) | WDT_RESET_ENABLE);
-       ixp2000_reg_write(IXP2000_TWDE, WDT_ENABLE);
-       ixp2000_reg_write(IXP2000_T4_CLD, heartbeat * wdt_tick_rate);
-       ixp2000_reg_write(IXP2000_T4_CTL, TIMER_DIVIDER_256 | TIMER_ENABLE);
-}
-
-static void
-wdt_disable(void)
-{
-       ixp2000_reg_write(IXP2000_T4_CTL, 0);
-}
-
-static void
-wdt_keepalive(void)
-{
-       ixp2000_reg_write(IXP2000_T4_CLD, heartbeat * wdt_tick_rate);
-}
-
-static int
-ixp2000_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
-               return -EBUSY;
-
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       wdt_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static ssize_t
-ixp2000_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                       }
-               }
-               wdt_keepalive();
-       }
-
-       return len;
-}
-
-
-static struct watchdog_info ident = {
-       .options        = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT |
-                               WDIOF_KEEPALIVEPING,
-       .identity       = "IXP2000 Watchdog",
-};
-
-static int
-ixp2000_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                       unsigned long arg)
-{
-       int ret = -ENOTTY;
-       int time;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user((struct watchdog_info *)arg, &ident,
-                                  sizeof(ident)) ? -EFAULT : 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-               ret = put_user(0, (int *)arg);
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(0, (int *)arg);
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(time, (int *)arg);
-               if (ret)
-                       break;
-
-               if (time <= 0 || time > 60) {
-                       ret = -EINVAL;
-                       break;
-               }
-
-               heartbeat = time;
-               wdt_keepalive();
-               /* Fall through */
-
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(heartbeat, (int *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
-       }
-
-       return ret;
-}
-
-static int
-ixp2000_wdt_release(struct inode *inode, struct file *file)
-{
-       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) {
-               wdt_disable();
-       } else {
-               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
-                                       "timer will not stop\n");
-       }
-
-       clear_bit(WDT_IN_USE, &wdt_status);
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       return 0;
-}
-
-
-static const struct file_operations ixp2000_wdt_fops =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = ixp2000_wdt_write,
-       .ioctl          = ixp2000_wdt_ioctl,
-       .open           = ixp2000_wdt_open,
-       .release        = ixp2000_wdt_release,
-};
-
-static struct miscdevice ixp2000_wdt_miscdev =
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &ixp2000_wdt_fops,
-};
-
-static int __init ixp2000_wdt_init(void)
-{
-       if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) {
-               printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n");
-               return -EIO;
-       }
-
-       wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256;
-
-       return misc_register(&ixp2000_wdt_miscdev);
-}
-
-static void __exit ixp2000_wdt_exit(void)
-{
-       misc_deregister(&ixp2000_wdt_miscdev);
-}
-
-module_init(ixp2000_wdt_init);
-module_exit(ixp2000_wdt_exit);
-
-MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
-MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog");
-
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds (default 60s)");
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
deleted file mode 100644 (file)
index 5864bb8..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * drivers/char/watchdog/ixp4xx_wdt.c
- *
- * Watchdog driver for Intel IXP4xx network processors
- *
- * Author: Deepak Saxena <dsaxena@plexity.net>
- *
- * Copyright 2004 (c) MontaVista, Software, Inc.
- * Based on sa1100 driver, Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/init.h>
-#include <linux/bitops.h>
-
-#include <asm/hardware.h>
-#include <asm/uaccess.h>
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-static int heartbeat = 60;     /* (secs) Default is 1 minute */
-static unsigned long wdt_status;
-static unsigned long boot_status;
-
-#define WDT_TICK_RATE (IXP4XX_PERIPHERAL_BUS_CLOCK * 1000000UL)
-
-#define        WDT_IN_USE              0
-#define        WDT_OK_TO_CLOSE         1
-
-static void
-wdt_enable(void)
-{
-       *IXP4XX_OSWK = IXP4XX_WDT_KEY;
-       *IXP4XX_OSWE = 0;
-       *IXP4XX_OSWT = WDT_TICK_RATE * heartbeat;
-       *IXP4XX_OSWE = IXP4XX_WDT_COUNT_ENABLE | IXP4XX_WDT_RESET_ENABLE;
-       *IXP4XX_OSWK = 0;
-}
-
-static void
-wdt_disable(void)
-{
-       *IXP4XX_OSWK = IXP4XX_WDT_KEY;
-       *IXP4XX_OSWE = 0;
-       *IXP4XX_OSWK = 0;
-}
-
-static int
-ixp4xx_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
-               return -EBUSY;
-
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       wdt_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static ssize_t
-ixp4xx_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                       }
-               }
-               wdt_enable();
-       }
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options        = WDIOF_CARDRESET | WDIOF_MAGICCLOSE |
-                         WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-       .identity       = "IXP4xx Watchdog",
-};
-
-
-static int
-ixp4xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                       unsigned long arg)
-{
-       int ret = -ENOTTY;
-       int time;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user((struct watchdog_info *)arg, &ident,
-                                  sizeof(ident)) ? -EFAULT : 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-               ret = put_user(0, (int *)arg);
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(boot_status, (int *)arg);
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(time, (int *)arg);
-               if (ret)
-                       break;
-
-               if (time <= 0 || time > 60) {
-                       ret = -EINVAL;
-                       break;
-               }
-
-               heartbeat = time;
-               wdt_enable();
-               /* Fall through */
-
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(heartbeat, (int *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
-       }
-       return ret;
-}
-
-static int
-ixp4xx_wdt_release(struct inode *inode, struct file *file)
-{
-       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) {
-               wdt_disable();
-       } else {
-               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
-                                       "timer will not stop\n");
-       }
-
-       clear_bit(WDT_IN_USE, &wdt_status);
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       return 0;
-}
-
-
-static const struct file_operations ixp4xx_wdt_fops =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = ixp4xx_wdt_write,
-       .ioctl          = ixp4xx_wdt_ioctl,
-       .open           = ixp4xx_wdt_open,
-       .release        = ixp4xx_wdt_release,
-};
-
-static struct miscdevice ixp4xx_wdt_miscdev =
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &ixp4xx_wdt_fops,
-};
-
-static int __init ixp4xx_wdt_init(void)
-{
-       int ret;
-       unsigned long processor_id;
-
-       asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
-       if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
-               printk("IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected - "
-                       "watchdog disabled\n");
-
-               return -ENODEV;
-       }
-
-       ret = misc_register(&ixp4xx_wdt_miscdev);
-       if (ret == 0)
-               printk("IXP4xx Watchdog Timer: heartbeat %d sec\n", heartbeat);
-
-       boot_status = (*IXP4XX_OSST & IXP4XX_OSST_TIMER_WARM_RESET) ?
-                       WDIOF_CARDRESET : 0;
-
-       return ret;
-}
-
-static void __exit ixp4xx_wdt_exit(void)
-{
-       misc_deregister(&ixp4xx_wdt_miscdev);
-}
-
-
-module_init(ixp4xx_wdt_init);
-module_exit(ixp4xx_wdt_exit);
-
-MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
-MODULE_DESCRIPTION("IXP4xx Network Processor Watchdog");
-
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds (default 60s)");
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
diff --git a/drivers/char/watchdog/ks8695_wdt.c b/drivers/char/watchdog/ks8695_wdt.c
deleted file mode 100644 (file)
index 7150fb9..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Watchdog driver for Kendin/Micrel KS8695.
- *
- * (C) 2007 Andrew Victor
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/platform_device.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/arch/regs-timer.h>
-
-
-#define WDT_DEFAULT_TIME       5       /* seconds */
-#define WDT_MAX_TIME           171     /* seconds */
-
-static int wdt_time = WDT_DEFAULT_TIME;
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(wdt_time, int, 0);
-MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="__MODULE_STRING(WDT_DEFAULT_TIME) ")");
-
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-#endif
-
-
-static unsigned long ks8695wdt_busy;
-
-/* ......................................................................... */
-
-/*
- * Disable the watchdog.
- */
-static void inline ks8695_wdt_stop(void)
-{
-       unsigned long tmcon;
-
-       /* disable timer0 */
-       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-       __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-}
-
-/*
- * Enable and reset the watchdog.
- */
-static void inline ks8695_wdt_start(void)
-{
-       unsigned long tmcon;
-       unsigned long tval = wdt_time * CLOCK_TICK_RATE;
-
-       /* disable timer0 */
-       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-       __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-
-       /* program timer0 */
-       __raw_writel(tval | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
-
-       /* re-enable timer0 */
-       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-       __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-}
-
-/*
- * Reload the watchdog timer.  (ie, pat the watchdog)
- */
-static void inline ks8695_wdt_reload(void)
-{
-       unsigned long tmcon;
-
-       /* disable, then re-enable timer0 */
-       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
-       __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-       __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
-}
-
-/*
- * Change the watchdog time interval.
- */
-static int ks8695_wdt_settimeout(int new_time)
-{
-       /*
-        * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
-        *
-        * Since WDV is a 16-bit counter, the maximum period is
-        * 65536 / 0.256 = 256 seconds.
-        */
-       if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
-               return -EINVAL;
-
-       /* Set new watchdog time. It will be used when ks8695_wdt_start() is called. */
-       wdt_time = new_time;
-       return 0;
-}
-
-/* ......................................................................... */
-
-/*
- * Watchdog device is opened, and watchdog starts running.
- */
-static int ks8695_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &ks8695wdt_busy))
-               return -EBUSY;
-
-       ks8695_wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-/*
- * Close the watchdog device.
- * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
- *  disabled.
- */
-static int ks8695_wdt_close(struct inode *inode, struct file *file)
-{
-       if (!nowayout)
-               ks8695_wdt_stop();      /* Disable the watchdog when file is closed */
-
-       clear_bit(0, &ks8695wdt_busy);
-       return 0;
-}
-
-static struct watchdog_info ks8695_wdt_info = {
-       .identity       = "ks8695 watchdog",
-       .options        = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-};
-
-/*
- * Handle commands from user-space.
- */
-static int ks8695_wdt_ioctl(struct inode *inode, struct file *file,
-               unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_value;
-
-       switch(cmd) {
-               case WDIOC_KEEPALIVE:
-                       ks8695_wdt_reload();    /* pat the watchdog */
-                       return 0;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ks8695_wdt_info, sizeof(ks8695_wdt_info)) ? -EFAULT : 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_value, p))
-                               return -EFAULT;
-
-                       if (ks8695_wdt_settimeout(new_value))
-                               return -EINVAL;
-
-                       /* Enable new time value */
-                       ks8695_wdt_start();
-
-                       /* Return current value */
-                       return put_user(wdt_time, p);
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(wdt_time, p);
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_SETOPTIONS:
-                       if (get_user(new_value, p))
-                               return -EFAULT;
-
-                       if (new_value & WDIOS_DISABLECARD)
-                               ks8695_wdt_stop();
-                       if (new_value & WDIOS_ENABLECARD)
-                               ks8695_wdt_start();
-                       return 0;
-
-               default:
-                       return -ENOTTY;
-       }
-}
-
-/*
- * Pat the watchdog whenever device is written to.
- */
-static ssize_t ks8695_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       ks8695_wdt_reload();            /* pat the watchdog */
-       return len;
-}
-
-/* ......................................................................... */
-
-static const struct file_operations ks8695wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .ioctl          = ks8695_wdt_ioctl,
-       .open           = ks8695_wdt_open,
-       .release        = ks8695_wdt_close,
-       .write          = ks8695_wdt_write,
-};
-
-static struct miscdevice ks8695wdt_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &ks8695wdt_fops,
-};
-
-static int __init ks8695wdt_probe(struct platform_device *pdev)
-{
-       int res;
-
-       if (ks8695wdt_miscdev.parent)
-               return -EBUSY;
-       ks8695wdt_miscdev.parent = &pdev->dev;
-
-       res = misc_register(&ks8695wdt_miscdev);
-       if (res)
-               return res;
-
-       printk("KS8695 Watchdog Timer enabled (%d seconds%s)\n", wdt_time, nowayout ? ", nowayout" : "");
-       return 0;
-}
-
-static int __exit ks8695wdt_remove(struct platform_device *pdev)
-{
-       int res;
-
-       res = misc_deregister(&ks8695wdt_miscdev);
-       if (!res)
-               ks8695wdt_miscdev.parent = NULL;
-
-       return res;
-}
-
-static void ks8695wdt_shutdown(struct platform_device *pdev)
-{
-       ks8695_wdt_stop();
-}
-
-#ifdef CONFIG_PM
-
-static int ks8695wdt_suspend(struct platform_device *pdev, pm_message_t message)
-{
-       ks8695_wdt_stop();
-       return 0;
-}
-
-static int ks8695wdt_resume(struct platform_device *pdev)
-{
-       if (ks8695wdt_busy)
-               ks8695_wdt_start();
-       return 0;
-}
-
-#else
-#define ks8695wdt_suspend NULL
-#define ks8695wdt_resume       NULL
-#endif
-
-static struct platform_driver ks8695wdt_driver = {
-       .probe          = ks8695wdt_probe,
-       .remove         = __exit_p(ks8695wdt_remove),
-       .shutdown       = ks8695wdt_shutdown,
-       .suspend        = ks8695wdt_suspend,
-       .resume         = ks8695wdt_resume,
-       .driver         = {
-               .name   = "ks8695_wdt",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init ks8695_wdt_init(void)
-{
-       /* Check that the heartbeat value is within range; if not reset to the default */
-       if (ks8695_wdt_settimeout(wdt_time)) {
-               ks8695_wdt_settimeout(WDT_DEFAULT_TIME);
-               pr_info("ks8695_wdt: wdt_time value must be 1 <= wdt_time <= %i, using %d\n", wdt_time, WDT_MAX_TIME);
-       }
-
-       return platform_driver_register(&ks8695wdt_driver);
-}
-
-static void __exit ks8695_wdt_exit(void)
-{
-       platform_driver_unregister(&ks8695wdt_driver);
-}
-
-module_init(ks8695_wdt_init);
-module_exit(ks8695_wdt_exit);
-
-MODULE_AUTHOR("Andrew Victor");
-MODULE_DESCRIPTION("Watchdog driver for KS8695");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
deleted file mode 100644 (file)
index 6d35bb1..0000000
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
- *  MachZ ZF-Logic Watchdog Timer driver for Linux
- *
- *
- *  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 author does NOT admit liability nor provide warranty for
- *  any of this software. This material is provided "AS-IS" in
- *  the hope that it may be useful for others.
- *
- *  Author: Fernando Fuganti <fuganti@conectiva.com.br>
- *
- *  Based on sbc60xxwdt.c by Jakob Oestergaard
- *
- *
- *  We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the
- *  following periods:
- *      wd#1 - 2 seconds;
- *      wd#2 - 7.2 ms;
- *  After the expiration of wd#1, it can generate a NMI, SCI, SMI, or
- *  a system RESET and it starts wd#2 that unconditionaly will RESET
- *  the system when the counter reaches zero.
- *
- *  14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *      Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/jiffies.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-/* ports */
-#define ZF_IOBASE      0x218
-#define INDEX          0x218
-#define DATA_B         0x219
-#define DATA_W         0x21A
-#define DATA_D         0x21A
-
-/* indexes */                  /* size */
-#define ZFL_VERSION    0x02    /* 16   */
-#define CONTROL        0x10    /* 16   */
-#define STATUS         0x12    /* 8    */
-#define COUNTER_1      0x0C    /* 16   */
-#define COUNTER_2      0x0E    /* 8    */
-#define PULSE_LEN      0x0F    /* 8    */
-
-/* controls */
-#define ENABLE_WD1     0x0001
-#define ENABLE_WD2     0x0002
-#define RESET_WD1      0x0010
-#define RESET_WD2      0x0020
-#define GEN_SCI                0x0100
-#define GEN_NMI                0x0200
-#define GEN_SMI                0x0400
-#define GEN_RESET      0x0800
-
-
-/* utilities */
-
-#define WD1    0
-#define WD2    1
-
-#define zf_writew(port, data)  { outb(port, INDEX); outw(data, DATA_W); }
-#define zf_writeb(port, data)  { outb(port, INDEX); outb(data, DATA_B); }
-#define zf_get_ZFL_version()   zf_readw(ZFL_VERSION)
-
-
-static unsigned short zf_readw(unsigned char port)
-{
-       outb(port, INDEX);
-       return inw(DATA_W);
-}
-
-
-MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>");
-MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-#define PFX "machzwd"
-
-static struct watchdog_info zf_info = {
-       .options                = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
-       .firmware_version       = 1,
-       .identity               = "ZF-Logic watchdog",
-};
-
-
-/*
- * action refers to action taken when watchdog resets
- * 0 = GEN_RESET
- * 1 = GEN_SMI
- * 2 = GEN_NMI
- * 3 = GEN_SCI
- * defaults to GEN_RESET (0)
- */
-static int action = 0;
-module_param(action, int, 0);
-MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*)  1 = SMI  2 = NMI  3 = SCI");
-
-static void zf_ping(unsigned long data);
-
-static int zf_action = GEN_RESET;
-static unsigned long zf_is_open;
-static char zf_expect_close;
-static spinlock_t zf_lock;
-static spinlock_t zf_port_lock;
-static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
-static unsigned long next_heartbeat = 0;
-
-
-/* timeout for user land heart beat (10 seconds) */
-#define ZF_USER_TIMEO (HZ*10)
-
-/* timeout for hardware watchdog (~500ms) */
-#define ZF_HW_TIMEO (HZ/2)
-
-/* number of ticks on WD#1 (driven by a 32KHz clock, 2s) */
-#define ZF_CTIMEOUT 0xffff
-
-#ifndef ZF_DEBUG
-#      define dprintk(format, args...)
-#else
-#      define dprintk(format, args...) printk(KERN_DEBUG PFX ":%s:%d: " format, __FUNCTION__, __LINE__ , ## args)
-#endif
-
-
-static inline void zf_set_status(unsigned char new)
-{
-       zf_writeb(STATUS, new);
-}
-
-
-/* CONTROL register functions */
-
-static inline unsigned short zf_get_control(void)
-{
-       return zf_readw(CONTROL);
-}
-
-static inline void zf_set_control(unsigned short new)
-{
-       zf_writew(CONTROL, new);
-}
-
-
-/* WD#? counter functions */
-/*
- *     Just set counter value
- */
-
-static inline void zf_set_timer(unsigned short new, unsigned char n)
-{
-       switch(n){
-               case WD1:
-                       zf_writew(COUNTER_1, new);
-               case WD2:
-                       zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
-               default:
-                       return;
-       }
-}
-
-/*
- * stop hardware timer
- */
-static void zf_timer_off(void)
-{
-       unsigned int ctrl_reg = 0;
-       unsigned long flags;
-
-       /* stop internal ping */
-       del_timer_sync(&zf_timer);
-
-       spin_lock_irqsave(&zf_port_lock, flags);
-       /* stop watchdog timer */
-       ctrl_reg = zf_get_control();
-       ctrl_reg |= (ENABLE_WD1|ENABLE_WD2);    /* disable wd1 and wd2 */
-       ctrl_reg &= ~(ENABLE_WD1|ENABLE_WD2);
-       zf_set_control(ctrl_reg);
-       spin_unlock_irqrestore(&zf_port_lock, flags);
-
-       printk(KERN_INFO PFX ": Watchdog timer is now disabled\n");
-}
-
-
-/*
- * start hardware timer
- */
-static void zf_timer_on(void)
-{
-       unsigned int ctrl_reg = 0;
-       unsigned long flags;
-
-       spin_lock_irqsave(&zf_port_lock, flags);
-
-       zf_writeb(PULSE_LEN, 0xff);
-
-       zf_set_timer(ZF_CTIMEOUT, WD1);
-
-       /* user land ping */
-       next_heartbeat = jiffies + ZF_USER_TIMEO;
-
-       /* start the timer for internal ping */
-       mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
-
-       /* start watchdog timer */
-       ctrl_reg = zf_get_control();
-       ctrl_reg |= (ENABLE_WD1|zf_action);
-       zf_set_control(ctrl_reg);
-       spin_unlock_irqrestore(&zf_port_lock, flags);
-
-       printk(KERN_INFO PFX ": Watchdog timer is now enabled\n");
-}
-
-
-static void zf_ping(unsigned long data)
-{
-       unsigned int ctrl_reg = 0;
-       unsigned long flags;
-
-       zf_writeb(COUNTER_2, 0xff);
-
-       if(time_before(jiffies, next_heartbeat)){
-
-               dprintk("time_before: %ld\n", next_heartbeat - jiffies);
-
-               /*
-                * reset event is activated by transition from 0 to 1 on
-                * RESET_WD1 bit and we assume that it is already zero...
-                */
-
-               spin_lock_irqsave(&zf_port_lock, flags);
-               ctrl_reg = zf_get_control();
-               ctrl_reg |= RESET_WD1;
-               zf_set_control(ctrl_reg);
-
-               /* ...and nothing changes until here */
-               ctrl_reg &= ~(RESET_WD1);
-               zf_set_control(ctrl_reg);
-               spin_unlock_irqrestore(&zf_port_lock, flags);
-
-               mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
-       }else{
-               printk(KERN_CRIT PFX ": I will reset your machine\n");
-       }
-}
-
-static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
-                                                               loff_t *ppos)
-{
-       /* See if we got the magic character */
-       if(count){
-
-               /*
-                * no need to check for close confirmation
-                * no way to disable watchdog ;)
-                */
-               if (!nowayout) {
-                       size_t ofs;
-
-                       /*
-                        * note: just in case someone wrote the magic character
-                        * five months ago...
-                        */
-                       zf_expect_close = 0;
-
-                       /* now scan */
-                       for (ofs = 0; ofs != count; ofs++){
-                               char c;
-                               if (get_user(c, buf + ofs))
-                                       return -EFAULT;
-                               if (c == 'V'){
-                                       zf_expect_close = 42;
-                                       dprintk("zf_expect_close = 42\n");
-                               }
-                       }
-               }
-
-               /*
-                * Well, anyhow someone wrote to us,
-                * we should return that favour
-                */
-               next_heartbeat = jiffies + ZF_USER_TIMEO;
-               dprintk("user ping at %ld\n", jiffies);
-
-       }
-
-       return count;
-}
-
-static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &zf_info, sizeof(zf_info)))
-                       return -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-               zf_ping(0);
-               break;
-
-       default:
-               return -ENOTTY;
-       }
-
-       return 0;
-}
-
-static int zf_open(struct inode *inode, struct file *file)
-{
-       spin_lock(&zf_lock);
-       if(test_and_set_bit(0, &zf_is_open)) {
-               spin_unlock(&zf_lock);
-               return -EBUSY;
-       }
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       spin_unlock(&zf_lock);
-
-       zf_timer_on();
-
-       return nonseekable_open(inode, file);
-}
-
-static int zf_close(struct inode *inode, struct file *file)
-{
-       if(zf_expect_close == 42){
-               zf_timer_off();
-       } else {
-               del_timer(&zf_timer);
-               printk(KERN_ERR PFX ": device file closed unexpectedly. Will not stop the WDT!\n");
-       }
-
-       spin_lock(&zf_lock);
-       clear_bit(0, &zf_is_open);
-       spin_unlock(&zf_lock);
-
-       zf_expect_close = 0;
-
-       return 0;
-}
-
-/*
- * Notifier for system down
- */
-
-static int zf_notify_sys(struct notifier_block *this, unsigned long code,
-                                                               void *unused)
-{
-       if(code == SYS_DOWN || code == SYS_HALT){
-               zf_timer_off();
-       }
-
-       return NOTIFY_DONE;
-}
-
-
-
-
-static const struct file_operations zf_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = zf_write,
-       .ioctl          = zf_ioctl,
-       .open           = zf_open,
-       .release        = zf_close,
-};
-
-static struct miscdevice zf_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &zf_fops,
-};
-
-/*
- * The device needs to learn about soft shutdowns in order to
- * turn the timebomb registers off.
- */
-static struct notifier_block zf_notifier = {
-       .notifier_call = zf_notify_sys,
-};
-
-static void __init zf_show_action(int act)
-{
-       char *str[] = { "RESET", "SMI", "NMI", "SCI" };
-
-       printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]);
-}
-
-static int __init zf_init(void)
-{
-       int ret;
-
-       printk(KERN_INFO PFX ": MachZ ZF-Logic Watchdog driver initializing.\n");
-
-       ret = zf_get_ZFL_version();
-       if ((!ret) || (ret == 0xffff)) {
-               printk(KERN_WARNING PFX ": no ZF-Logic found\n");
-               return -ENODEV;
-       }
-
-       if((action <= 3) && (action >= 0)){
-               zf_action = zf_action>>action;
-       } else
-               action = 0;
-
-       zf_show_action(action);
-
-       spin_lock_init(&zf_lock);
-       spin_lock_init(&zf_port_lock);
-
-       if(!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")){
-               printk(KERN_ERR "cannot reserve I/O ports at %d\n",
-                                                       ZF_IOBASE);
-               ret = -EBUSY;
-               goto no_region;
-       }
-
-       ret = register_reboot_notifier(&zf_notifier);
-       if(ret){
-               printk(KERN_ERR "can't register reboot notifier (err=%d)\n",
-                                                                       ret);
-               goto no_reboot;
-       }
-
-       ret = misc_register(&zf_miscdev);
-       if (ret){
-               printk(KERN_ERR "can't misc_register on minor=%d\n",
-                                                       WATCHDOG_MINOR);
-               goto no_misc;
-       }
-
-       zf_set_status(0);
-       zf_set_control(0);
-
-       return 0;
-
-no_misc:
-       unregister_reboot_notifier(&zf_notifier);
-no_reboot:
-       release_region(ZF_IOBASE, 3);
-no_region:
-       return ret;
-}
-
-
-static void __exit zf_exit(void)
-{
-       zf_timer_off();
-
-       misc_deregister(&zf_miscdev);
-       unregister_reboot_notifier(&zf_notifier);
-       release_region(ZF_IOBASE, 3);
-}
-
-module_init(zf_init);
-module_exit(zf_exit);
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
deleted file mode 100644 (file)
index 1adf1d5..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * MixCom Watchdog: A Simple Hardware Watchdog Device
- * Based on Softdog driver by Alan Cox and PC Watchdog driver by Ken Hollis
- *
- * Author: Gergely Madarasz <gorgo@itc.hu>
- *
- * Copyright (c) 1999 ITConsult-Pro Co. <info@itc.hu>
- *
- * 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.
- *
- * Version 0.1 (99/04/15):
- *             - first version
- *
- * Version 0.2 (99/06/16):
- *             - added kernel timer watchdog ping after close
- *               since the hardware does not support watchdog shutdown
- *
- * Version 0.3 (99/06/21):
- *             - added WDIOC_GETSTATUS and WDIOC_GETSUPPORT ioctl calls
- *
- * Version 0.3.1 (99/06/22):
- *             - allow module removal while internal timer is active,
- *               print warning about probable reset
- *
- * Version 0.4 (99/11/15):
- *             - support for one more type board
- *
- * Version 0.5 (2001/12/14) Matt Domsch <Matt_Domsch@dell.com>
- *             - added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *
- * Version 0.6 (2002/04/12): Rob Radez <rob@osinvestor.com>
- *             - make mixcomwd_opened unsigned,
- *               removed lock_kernel/unlock_kernel from mixcomwd_release,
- *               modified ioctl a bit to conform to API
- *
- */
-
-#define VERSION "0.6"
-#define WATCHDOG_NAME "mixcomwd"
-#define PFX WATCHDOG_NAME ": "
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/ioport.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/jiffies.h>
-#include <linux/timer.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-/*
- * We have two types of cards that can be probed:
- * 1) The Mixcom cards: these cards can be found at addresses
- *    0x180, 0x280, 0x380 with an additional offset of 0xc10.
- *    (Or 0xd90, 0xe90, 0xf90).
- * 2) The FlashCOM cards: these cards can be set up at
- *    0x300 -> 0x378, in 0x8 jumps with an offset of 0x04.
- *    (Or 0x304 -> 0x37c in 0x8 jumps).
- *    Each card has it's own ID.
- */
-#define MIXCOM_ID 0x11
-#define FLASHCOM_ID 0x18
-static struct {
-       int ioport;
-       int id;
-} mixcomwd_io_info[] __devinitdata = {
-       /* The Mixcom cards */
-       {0x0d90, MIXCOM_ID},
-       {0x0e90, MIXCOM_ID},
-       {0x0f90, MIXCOM_ID},
-       /* The FlashCOM cards */
-       {0x0304, FLASHCOM_ID},
-       {0x030c, FLASHCOM_ID},
-       {0x0314, FLASHCOM_ID},
-       {0x031c, FLASHCOM_ID},
-       {0x0324, FLASHCOM_ID},
-       {0x032c, FLASHCOM_ID},
-       {0x0334, FLASHCOM_ID},
-       {0x033c, FLASHCOM_ID},
-       {0x0344, FLASHCOM_ID},
-       {0x034c, FLASHCOM_ID},
-       {0x0354, FLASHCOM_ID},
-       {0x035c, FLASHCOM_ID},
-       {0x0364, FLASHCOM_ID},
-       {0x036c, FLASHCOM_ID},
-       {0x0374, FLASHCOM_ID},
-       {0x037c, FLASHCOM_ID},
-       /* The end of the list */
-       {0x0000, 0},
-};
-
-static void mixcomwd_timerfun(unsigned long d);
-
-static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
-
-static int watchdog_port;
-static int mixcomwd_timer_alive;
-static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0);
-static char expect_close;
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void mixcomwd_ping(void)
-{
-       outb_p(55,watchdog_port);
-       return;
-}
-
-static void mixcomwd_timerfun(unsigned long d)
-{
-       mixcomwd_ping();
-
-       mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
-}
-
-/*
- *     Allow only one person to hold it open
- */
-
-static int mixcomwd_open(struct inode *inode, struct file *file)
-{
-       if(test_and_set_bit(0,&mixcomwd_opened)) {
-               return -EBUSY;
-       }
-       mixcomwd_ping();
-
-       if (nowayout) {
-               /*
-                * fops_get() code via open() has already done
-                * a try_module_get() so it is safe to do the
-                * __module_get().
-                */
-               __module_get(THIS_MODULE);
-       } else {
-               if(mixcomwd_timer_alive) {
-                       del_timer(&mixcomwd_timer);
-                       mixcomwd_timer_alive=0;
-               }
-       }
-       return nonseekable_open(inode, file);
-}
-
-static int mixcomwd_release(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               if(mixcomwd_timer_alive) {
-                       printk(KERN_ERR PFX "release called while internal timer alive");
-                       return -EBUSY;
-               }
-               mixcomwd_timer_alive=1;
-               mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
-       } else {
-               printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
-       }
-
-       clear_bit(0,&mixcomwd_opened);
-       expect_close=0;
-       return 0;
-}
-
-
-static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
-{
-       if(len)
-       {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               mixcomwd_ping();
-       }
-       return len;
-}
-
-static int mixcomwd_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int status;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "MixCOM watchdog",
-       };
-
-       switch(cmd)
-       {
-               case WDIOC_GETSTATUS:
-                       status=mixcomwd_opened;
-                       if (!nowayout) {
-                               status|=mixcomwd_timer_alive;
-                       }
-                       if (copy_to_user(p, &status, sizeof(int))) {
-                               return -EFAULT;
-                       }
-                       break;
-               case WDIOC_GETBOOTSTATUS:
-                       if (copy_to_user(p, &status, sizeof(int))) {
-                               return -EFAULT;
-                       }
-                       break;
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user(argp, &ident, sizeof(ident))) {
-                               return -EFAULT;
-                       }
-                       break;
-               case WDIOC_KEEPALIVE:
-                       mixcomwd_ping();
-                       break;
-               default:
-                       return -ENOTTY;
-       }
-       return 0;
-}
-
-static const struct file_operations mixcomwd_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = mixcomwd_write,
-       .ioctl          = mixcomwd_ioctl,
-       .open           = mixcomwd_open,
-       .release        = mixcomwd_release,
-};
-
-static struct miscdevice mixcomwd_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &mixcomwd_fops,
-};
-
-static int __init checkcard(int port, int card_id)
-{
-       int id;
-
-       if (!request_region(port, 1, "MixCOM watchdog")) {
-               return 0;
-       }
-
-       id=inb_p(port);
-       if (card_id==MIXCOM_ID)
-               id &= 0x3f;
-
-       if (id!=card_id) {
-               release_region(port, 1);
-               return 0;
-       }
-       return 1;
-}
-
-static int __init mixcomwd_init(void)
-{
-       int i;
-       int ret;
-       int found=0;
-
-       for (i = 0; !found && mixcomwd_io_info[i].ioport != 0; i++) {
-               if (checkcard(mixcomwd_io_info[i].ioport,
-                             mixcomwd_io_info[i].id)) {
-                       found = 1;
-                       watchdog_port = mixcomwd_io_info[i].ioport;
-               }
-       }
-
-       if (!found) {
-               printk(KERN_ERR PFX "No card detected, or port not available.\n");
-               return -ENODEV;
-       }
-
-       ret = misc_register(&mixcomwd_miscdev);
-       if (ret)
-       {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto error_misc_register_watchdog;
-       }
-
-       printk(KERN_INFO "MixCOM watchdog driver v%s, watchdog port at 0x%3x\n",
-               VERSION, watchdog_port);
-
-       return 0;
-
-error_misc_register_watchdog:
-       release_region(watchdog_port, 1);
-       watchdog_port = 0x0000;
-       return ret;
-}
-
-static void __exit mixcomwd_exit(void)
-{
-       if (!nowayout) {
-               if(mixcomwd_timer_alive) {
-                       printk(KERN_WARNING PFX "I quit now, hardware will"
-                              " probably reboot!\n");
-                       del_timer_sync(&mixcomwd_timer);
-                       mixcomwd_timer_alive=0;
-               }
-       }
-       misc_deregister(&mixcomwd_miscdev);
-       release_region(watchdog_port,1);
-}
-
-module_init(mixcomwd_init);
-module_exit(mixcomwd_exit);
-
-MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>");
-MODULE_DESCRIPTION("MixCom Watchdog driver");
-MODULE_VERSION(VERSION);
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/mpc5200_wdt.c b/drivers/char/watchdog/mpc5200_wdt.c
deleted file mode 100644 (file)
index 9cfb975..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/io.h>
-#include <linux/spinlock.h>
-#include <asm/of_platform.h>
-#include <asm/uaccess.h>
-#include <asm/mpc52xx.h>
-
-
-#define GPT_MODE_WDT           (1<<15)
-#define GPT_MODE_CE            (1<<12)
-#define GPT_MODE_MS_TIMER      (0x4)
-
-
-struct mpc5200_wdt {
-       unsigned count; /* timer ticks before watchdog kicks in */
-       long ipb_freq;
-       struct miscdevice miscdev;
-       struct resource mem;
-       struct mpc52xx_gpt __iomem *regs;
-       spinlock_t io_lock;
-};
-
-/* is_active stores wether or not the /dev/watchdog device is opened */
-static unsigned long is_active;
-
-/* misc devices don't provide a way, to get back to 'dev' or 'miscdev' from
- * file operations, which sucks. But there can be max 1 watchdog anyway, so...
- */
-static struct mpc5200_wdt *wdt_global;
-
-
-/* helper to calculate timeout in timer counts */
-static void mpc5200_wdt_set_timeout(struct mpc5200_wdt *wdt, int timeout)
-{
-       /* use biggest prescaler of 64k */
-       wdt->count = (wdt->ipb_freq + 0xffff) / 0x10000 * timeout;
-
-       if (wdt->count > 0xffff)
-               wdt->count = 0xffff;
-}
-/* return timeout in seconds (calculated from timer count) */
-static int mpc5200_wdt_get_timeout(struct mpc5200_wdt *wdt)
-{
-       return wdt->count * 0x10000 / wdt->ipb_freq;
-}
-
-
-/* watchdog operations */
-static int mpc5200_wdt_start(struct mpc5200_wdt *wdt)
-{
-       spin_lock(&wdt->io_lock);
-       /* disable */
-       out_be32(&wdt->regs->mode, 0);
-       /* set timeout, with maximum prescaler */
-       out_be32(&wdt->regs->count, 0x0 | wdt->count);
-       /* enable watchdog */
-       out_be32(&wdt->regs->mode, GPT_MODE_CE | GPT_MODE_WDT | GPT_MODE_MS_TIMER);
-       spin_unlock(&wdt->io_lock);
-
-       return 0;
-}
-static int mpc5200_wdt_ping(struct mpc5200_wdt *wdt)
-{
-       spin_lock(&wdt->io_lock);
-       /* writing A5 to OCPW resets the watchdog */
-       out_be32(&wdt->regs->mode, 0xA5000000 | (0xffffff & in_be32(&wdt->regs->mode)));
-       spin_unlock(&wdt->io_lock);
-       return 0;
-}
-static int mpc5200_wdt_stop(struct mpc5200_wdt *wdt)
-{
-       spin_lock(&wdt->io_lock);
-       /* disable */
-       out_be32(&wdt->regs->mode, 0);
-       spin_unlock(&wdt->io_lock);
-       return 0;
-}
-
-
-/* file operations */
-static ssize_t mpc5200_wdt_write(struct file *file, const char __user *data,
-               size_t len, loff_t *ppos)
-{
-       struct mpc5200_wdt *wdt = file->private_data;
-       mpc5200_wdt_ping(wdt);
-       return 0;
-}
-static struct watchdog_info mpc5200_wdt_info = {
-       .options        = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-       .identity       = "mpc5200 watchdog on GPT0",
-};
-static int mpc5200_wdt_ioctl(struct inode *inode, struct file *file,
-               unsigned int cmd, unsigned long arg)
-{
-       struct mpc5200_wdt *wdt = file->private_data;
-       int __user *data = (int __user *)arg;
-       int timeout;
-       int ret = 0;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user(data, &mpc5200_wdt_info,
-                       sizeof(mpc5200_wdt_info));
-               if (ret)
-                       ret = -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(0, data);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               mpc5200_wdt_ping(wdt);
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(timeout, data);
-               if (ret)
-                       break;
-               mpc5200_wdt_set_timeout(wdt, timeout);
-               mpc5200_wdt_start(wdt);
-               /* fall through and return the timeout */
-
-       case WDIOC_GETTIMEOUT:
-               timeout = mpc5200_wdt_get_timeout(wdt);
-               ret = put_user(timeout, data);
-               break;
-
-       default:
-               ret = -ENOTTY;
-       }
-       return ret;
-}
-static int mpc5200_wdt_open(struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-       if (test_and_set_bit(0, &is_active))
-               return -EBUSY;
-
-       /* Set and activate the watchdog */
-       mpc5200_wdt_set_timeout(wdt_global, 30);
-       mpc5200_wdt_start(wdt_global);
-       file->private_data = wdt_global;
-       return nonseekable_open(inode, file);
-}
-static int mpc5200_wdt_release(struct inode *inode, struct file *file)
-{
-#if WATCHDOG_NOWAYOUT == 0
-       struct mpc5200_wdt *wdt = file->private_data;
-       mpc5200_wdt_stop(wdt);
-       wdt->count = 0;         /* == disabled */
-#endif
-       clear_bit(0, &is_active);
-       return 0;
-}
-
-static struct file_operations mpc5200_wdt_fops = {
-       .owner  = THIS_MODULE,
-       .write  = mpc5200_wdt_write,
-       .ioctl  = mpc5200_wdt_ioctl,
-       .open   = mpc5200_wdt_open,
-       .release = mpc5200_wdt_release,
-};
-
-/* module operations */
-static int mpc5200_wdt_probe(struct of_device *op, const struct of_device_id *match)
-{
-       struct mpc5200_wdt *wdt;
-       int err;
-       const void *has_wdt;
-       int size;
-
-       has_wdt = of_get_property(op->node, "has-wdt", NULL);
-       if (!has_wdt)
-               return -ENODEV;
-
-       wdt = kzalloc(sizeof(*wdt), GFP_KERNEL);
-       if (!wdt)
-               return -ENOMEM;
-
-       wdt->ipb_freq = mpc52xx_find_ipb_freq(op->node);
-
-       err = of_address_to_resource(op->node, 0, &wdt->mem);
-       if (err)
-               goto out_free;
-       size = wdt->mem.end - wdt->mem.start + 1;
-       if (!request_mem_region(wdt->mem.start, size, "mpc5200_wdt")) {
-               err = -ENODEV;
-               goto out_free;
-       }
-       wdt->regs = ioremap(wdt->mem.start, size);
-       if (!wdt->regs) {
-               err = -ENODEV;
-               goto out_release;
-       }
-
-       dev_set_drvdata(&op->dev, wdt);
-       spin_lock_init(&wdt->io_lock);
-
-       wdt->miscdev = (struct miscdevice) {
-               .minor  = WATCHDOG_MINOR,
-               .name   = "watchdog",
-               .fops   = &mpc5200_wdt_fops,
-               .parent = &op->dev,
-       };
-       wdt_global = wdt;
-       err = misc_register(&wdt->miscdev);
-       if (!err)
-               return 0;
-
-       iounmap(wdt->regs);
- out_release:
-       release_mem_region(wdt->mem.start, size);
- out_free:
-       kfree(wdt);
-       return err;
-}
-
-static int mpc5200_wdt_remove(struct of_device *op)
-{
-       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
-
-       mpc5200_wdt_stop(wdt);
-       misc_deregister(&wdt->miscdev);
-       iounmap(wdt->regs);
-       release_mem_region(wdt->mem.start, wdt->mem.end - wdt->mem.start + 1);
-       kfree(wdt);
-
-       return 0;
-}
-static int mpc5200_wdt_suspend(struct of_device *op, pm_message_t state)
-{
-       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
-       mpc5200_wdt_stop(wdt);
-       return 0;
-}
-static int mpc5200_wdt_resume(struct of_device *op)
-{
-       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
-       if (wdt->count)
-               mpc5200_wdt_start(wdt);
-       return 0;
-}
-static int mpc5200_wdt_shutdown(struct of_device *op)
-{
-       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
-       mpc5200_wdt_stop(wdt);
-       return 0;
-}
-
-static struct of_device_id mpc5200_wdt_match[] = {
-       { .compatible = "mpc5200-gpt", },
-       {},
-};
-static struct of_platform_driver mpc5200_wdt_driver = {
-       .owner          = THIS_MODULE,
-       .name           = "mpc5200-gpt-wdt",
-       .match_table    = mpc5200_wdt_match,
-       .probe          = mpc5200_wdt_probe,
-       .remove         = mpc5200_wdt_remove,
-       .suspend        = mpc5200_wdt_suspend,
-       .resume         = mpc5200_wdt_resume,
-       .shutdown       = mpc5200_wdt_shutdown,
-};
-
-
-static int __init mpc5200_wdt_init(void)
-{
-       return of_register_platform_driver(&mpc5200_wdt_driver);
-}
-
-static void __exit mpc5200_wdt_exit(void)
-{
-       of_unregister_platform_driver(&mpc5200_wdt_driver);
-}
-
-module_init(mpc5200_wdt_init);
-module_exit(mpc5200_wdt_exit);
-
-MODULE_AUTHOR("Domen Puncer <domen.puncer@telargo.com>");
-MODULE_LICENSE("Dual BSD/GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/mpc83xx_wdt.c b/drivers/char/watchdog/mpc83xx_wdt.c
deleted file mode 100644 (file)
index a0bf95f..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * mpc83xx_wdt.c - MPC83xx watchdog userspace interface
- *
- * Authors: Dave Updegraff <dave@cray.org>
- *         Kumar Gala <galak@kernel.crashing.org>
- *             Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
- *                             ..and from sc520_wdt
- *
- * Note: it appears that you can only actually ENABLE or DISABLE the thing
- * once after POR. Once enabled, you cannot disable, and vice versa.
- *
- * 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.
- */
-
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/watchdog.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-struct mpc83xx_wdt {
-       __be32 res0;
-       __be32 swcrr; /* System watchdog control register */
-#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
-#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
-#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/
-#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
-       __be32 swcnr; /* System watchdog count register */
-       u8 res1[2];
-       __be16 swsrr; /* System watchdog service register */
-       u8 res2[0xF0];
-};
-
-static struct mpc83xx_wdt __iomem *wd_base;
-
-static u16 timeout = 0xffff;
-module_param(timeout, ushort, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
-
-static int reset = 1;
-module_param(reset, bool, 0);
-MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
-
-/*
- * We always prescale, but if someone really doesn't want to they can set this
- * to 0
- */
-static int prescale = 1;
-static unsigned int timeout_sec;
-
-static unsigned long wdt_is_open;
-static spinlock_t wdt_spinlock;
-
-static void mpc83xx_wdt_keepalive(void)
-{
-       /* Ping the WDT */
-       spin_lock(&wdt_spinlock);
-       out_be16(&wd_base->swsrr, 0x556c);
-       out_be16(&wd_base->swsrr, 0xaa39);
-       spin_unlock(&wdt_spinlock);
-}
-
-static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf,
-                                size_t count, loff_t *ppos)
-{
-       if (count)
-               mpc83xx_wdt_keepalive();
-       return count;
-}
-
-static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
-{
-       u32 tmp = SWCRR_SWEN;
-       if (test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-
-       /* Once we start the watchdog we can't stop it */
-       __module_get(THIS_MODULE);
-
-       /* Good, fire up the show */
-       if (prescale)
-               tmp |= SWCRR_SWPR;
-       if (reset)
-               tmp |= SWCRR_SWRI;
-
-       tmp |= timeout << 16;
-
-       out_be32(&wd_base->swcrr, tmp);
-
-       return nonseekable_open(inode, file);
-}
-
-static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
-{
-       printk(KERN_CRIT "Unexpected close, not stopping watchdog!\n");
-       mpc83xx_wdt_keepalive();
-       clear_bit(0, &wdt_is_open);
-       return 0;
-}
-
-static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
-                               unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING,
-               .firmware_version = 1,
-               .identity = "MPC83xx",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               mpc83xx_wdt_keepalive();
-               return 0;
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout_sec, p);
-       default:
-               return -ENOTTY;
-       }
-}
-
-static const struct file_operations mpc83xx_wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = mpc83xx_wdt_write,
-       .ioctl          = mpc83xx_wdt_ioctl,
-       .open           = mpc83xx_wdt_open,
-       .release        = mpc83xx_wdt_release,
-};
-
-static struct miscdevice mpc83xx_wdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &mpc83xx_wdt_fops,
-};
-
-static int __devinit mpc83xx_wdt_probe(struct platform_device *dev)
-{
-       struct resource *r;
-       int ret;
-       unsigned int *freq = dev->dev.platform_data;
-
-       /* get a pointer to the register memory */
-       r = platform_get_resource(dev, IORESOURCE_MEM, 0);
-
-       if (!r) {
-               ret = -ENODEV;
-               goto err_out;
-       }
-
-       wd_base = ioremap(r->start, sizeof (struct mpc83xx_wdt));
-
-       if (wd_base == NULL) {
-               ret = -ENOMEM;
-               goto err_out;
-       }
-
-       ret = misc_register(&mpc83xx_wdt_miscdev);
-       if (ret) {
-               printk(KERN_ERR "cannot register miscdev on minor=%d "
-                               "(err=%d)\n",
-                               WATCHDOG_MINOR, ret);
-               goto err_unmap;
-       }
-
-       /* Calculate the timeout in seconds */
-       if (prescale)
-               timeout_sec = (timeout * 0x10000) / (*freq);
-       else
-               timeout_sec = timeout / (*freq);
-
-       printk(KERN_INFO "WDT driver for MPC83xx initialized. "
-               "mode:%s timeout=%d (%d seconds)\n",
-               reset ? "reset":"interrupt", timeout, timeout_sec);
-
-       spin_lock_init(&wdt_spinlock);
-
-       return 0;
-
-err_unmap:
-       iounmap(wd_base);
-err_out:
-       return ret;
-}
-
-static int __devexit mpc83xx_wdt_remove(struct platform_device *dev)
-{
-       misc_deregister(&mpc83xx_wdt_miscdev);
-       iounmap(wd_base);
-
-       return 0;
-}
-
-static struct platform_driver mpc83xx_wdt_driver = {
-       .probe          = mpc83xx_wdt_probe,
-       .remove         = __devexit_p(mpc83xx_wdt_remove),
-       .driver         = {
-               .name   = "mpc83xx_wdt",
-       },
-};
-
-static int __init mpc83xx_wdt_init(void)
-{
-       return platform_driver_register(&mpc83xx_wdt_driver);
-}
-
-static void __exit mpc83xx_wdt_exit(void)
-{
-       platform_driver_unregister(&mpc83xx_wdt_driver);
-}
-
-module_init(mpc83xx_wdt_init);
-module_exit(mpc83xx_wdt_exit);
-
-MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
-MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/mpc8xx_wdt.c b/drivers/char/watchdog/mpc8xx_wdt.c
deleted file mode 100644 (file)
index 85b5734..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * mpc8xx_wdt.c - MPC8xx watchdog userspace interface
- *
- * Author: Florian Schirmer <jolt@tuxbox.org>
- *
- * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/watchdog.h>
-#include <asm/8xx_immap.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <syslib/m8xx_wdt.h>
-
-static unsigned long wdt_opened;
-static int wdt_status;
-
-static void mpc8xx_wdt_handler_disable(void)
-{
-       volatile uint __iomem *piscr;
-       piscr = (uint *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;
-
-       if (!m8xx_has_internal_rtc)
-               m8xx_wdt_stop_timer();
-       else
-               out_be32(piscr, in_be32(piscr) & ~(PISCR_PIE | PISCR_PTE));
-
-       printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n");
-}
-
-static void mpc8xx_wdt_handler_enable(void)
-{
-       volatile uint __iomem *piscr;
-       piscr = (uint *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;
-
-       if (!m8xx_has_internal_rtc)
-               m8xx_wdt_install_timer();
-       else
-               out_be32(piscr, in_be32(piscr) | PISCR_PIE | PISCR_PTE);
-
-       printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n");
-}
-
-static int mpc8xx_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &wdt_opened))
-               return -EBUSY;
-
-       m8xx_wdt_reset();
-       mpc8xx_wdt_handler_disable();
-
-       return nonseekable_open(inode, file);
-}
-
-static int mpc8xx_wdt_release(struct inode *inode, struct file *file)
-{
-       m8xx_wdt_reset();
-
-#if !defined(CONFIG_WATCHDOG_NOWAYOUT)
-       mpc8xx_wdt_handler_enable();
-#endif
-
-       clear_bit(0, &wdt_opened);
-
-       return 0;
-}
-
-static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len,
-                               loff_t * ppos)
-{
-       if (len)
-               m8xx_wdt_reset();
-
-       return len;
-}
-
-static int mpc8xx_wdt_ioctl(struct inode *inode, struct file *file,
-                           unsigned int cmd, unsigned long arg)
-{
-       int timeout;
-       static struct watchdog_info info = {
-               .options = WDIOF_KEEPALIVEPING,
-               .firmware_version = 0,
-               .identity = "MPC8xx watchdog",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user((void *)arg, &info, sizeof(info)))
-                       return -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               if (put_user(wdt_status, (int *)arg))
-                       return -EFAULT;
-               wdt_status &= ~WDIOF_KEEPALIVEPING;
-               break;
-
-       case WDIOC_GETTEMP:
-               return -EOPNOTSUPP;
-
-       case WDIOC_SETOPTIONS:
-               return -EOPNOTSUPP;
-
-       case WDIOC_KEEPALIVE:
-               m8xx_wdt_reset();
-               wdt_status |= WDIOF_KEEPALIVEPING;
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               return -EOPNOTSUPP;
-
-       case WDIOC_GETTIMEOUT:
-               timeout = m8xx_wdt_get_timeout();
-               if (put_user(timeout, (int *)arg))
-                       return -EFAULT;
-               break;
-
-       default:
-               return -ENOTTY;
-       }
-
-       return 0;
-}
-
-static const struct file_operations mpc8xx_wdt_fops = {
-       .owner = THIS_MODULE,
-       .llseek = no_llseek,
-       .write = mpc8xx_wdt_write,
-       .ioctl = mpc8xx_wdt_ioctl,
-       .open = mpc8xx_wdt_open,
-       .release = mpc8xx_wdt_release,
-};
-
-static struct miscdevice mpc8xx_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &mpc8xx_wdt_fops,
-};
-
-static int __init mpc8xx_wdt_init(void)
-{
-       return misc_register(&mpc8xx_wdt_miscdev);
-}
-
-static void __exit mpc8xx_wdt_exit(void)
-{
-       misc_deregister(&mpc8xx_wdt_miscdev);
-
-       m8xx_wdt_reset();
-       mpc8xx_wdt_handler_enable();
-}
-
-module_init(mpc8xx_wdt_init);
-module_exit(mpc8xx_wdt_exit);
-
-MODULE_AUTHOR("Florian Schirmer <jolt@tuxbox.org>");
-MODULE_DESCRIPTION("MPC8xx watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c
deleted file mode 100644 (file)
index 0d2b277..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- *     Watchdog driver for the mpcore watchdog timer
- *
- *     (c) Copyright 2004 ARM Limited
- *
- *     Based on the SoftDog driver:
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
- *
- */
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-
-#include <asm/hardware/arm_twd.h>
-#include <asm/uaccess.h>
-
-struct mpcore_wdt {
-       unsigned long   timer_alive;
-       struct device   *dev;
-       void __iomem    *base;
-       int             irq;
-       unsigned int    perturb;
-       char            expect_close;
-};
-
-static struct platform_device *mpcore_wdt_dev;
-
-extern unsigned int mpcore_timer_rate;
-
-#define TIMER_MARGIN   60
-static int mpcore_margin = TIMER_MARGIN;
-module_param(mpcore_margin, int, 0);
-MODULE_PARM_DESC(mpcore_margin, "MPcore timer margin in seconds. (0<mpcore_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-#define ONLY_TESTING   0
-static int mpcore_noboot = ONLY_TESTING;
-module_param(mpcore_noboot, int, 0);
-MODULE_PARM_DESC(mpcore_noboot, "MPcore watchdog action, set to 1 to ignore reboots, 0 to reboot (default=" __MODULE_STRING(ONLY_TESTING) ")");
-
-/*
- *     This is the interrupt handler.  Note that we only use this
- *     in testing mode, so don't actually do a reboot here.
- */
-static irqreturn_t mpcore_wdt_fire(int irq, void *arg)
-{
-       struct mpcore_wdt *wdt = arg;
-
-       /* Check it really was our interrupt */
-       if (readl(wdt->base + TWD_WDOG_INTSTAT)) {
-               dev_printk(KERN_CRIT, wdt->dev, "Triggered - Reboot ignored.\n");
-
-               /* Clear the interrupt on the watchdog */
-               writel(1, wdt->base + TWD_WDOG_INTSTAT);
-
-               return IRQ_HANDLED;
-       }
-
-       return IRQ_NONE;
-}
-
-/*
- *     mpcore_wdt_keepalive - reload the timer
- *
- *     Note that the spec says a DIFFERENT value must be written to the reload
- *     register each time.  The "perturb" variable deals with this by adding 1
- *     to the count every other time the function is called.
- */
-static void mpcore_wdt_keepalive(struct mpcore_wdt *wdt)
-{
-       unsigned int count;
-
-       /* Assume prescale is set to 256 */
-       count = (mpcore_timer_rate / 256) * mpcore_margin;
-
-       /* Reload the counter */
-       writel(count + wdt->perturb, wdt->base + TWD_WDOG_LOAD);
-
-       wdt->perturb = wdt->perturb ? 0 : 1;
-}
-
-static void mpcore_wdt_stop(struct mpcore_wdt *wdt)
-{
-       writel(0x12345678, wdt->base + TWD_WDOG_DISABLE);
-       writel(0x87654321, wdt->base + TWD_WDOG_DISABLE);
-       writel(0x0, wdt->base + TWD_WDOG_CONTROL);
-}
-
-static void mpcore_wdt_start(struct mpcore_wdt *wdt)
-{
-       dev_printk(KERN_INFO, wdt->dev, "enabling watchdog.\n");
-
-       /* This loads the count register but does NOT start the count yet */
-       mpcore_wdt_keepalive(wdt);
-
-       if (mpcore_noboot) {
-               /* Enable watchdog - prescale=256, watchdog mode=0, enable=1 */
-               writel(0x0000FF01, wdt->base + TWD_WDOG_CONTROL);
-       } else {
-               /* Enable watchdog - prescale=256, watchdog mode=1, enable=1 */
-               writel(0x0000FF09, wdt->base + TWD_WDOG_CONTROL);
-       }
-}
-
-static int mpcore_wdt_set_heartbeat(int t)
-{
-       if (t < 0x0001 || t > 0xFFFF)
-               return -EINVAL;
-
-       mpcore_margin = t;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-static int mpcore_wdt_open(struct inode *inode, struct file *file)
-{
-       struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_dev);
-
-       if (test_and_set_bit(0, &wdt->timer_alive))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       file->private_data = wdt;
-
-       /*
-        *      Activate timer
-        */
-       mpcore_wdt_start(wdt);
-
-       return nonseekable_open(inode, file);
-}
-
-static int mpcore_wdt_release(struct inode *inode, struct file *file)
-{
-       struct mpcore_wdt *wdt = file->private_data;
-
-       /*
-        *      Shut off the timer.
-        *      Lock it in if it's a module and we set nowayout
-        */
-       if (wdt->expect_close == 42) {
-               mpcore_wdt_stop(wdt);
-       } else {
-               dev_printk(KERN_CRIT, wdt->dev, "unexpected close, not stopping watchdog!\n");
-               mpcore_wdt_keepalive(wdt);
-       }
-       clear_bit(0, &wdt->timer_alive);
-       wdt->expect_close = 0;
-       return 0;
-}
-
-static ssize_t mpcore_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       struct mpcore_wdt *wdt = file->private_data;
-
-       /*
-        *      Refresh the timer.
-        */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       wdt->expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       wdt->expect_close = 42;
-                       }
-               }
-               mpcore_wdt_keepalive(wdt);
-       }
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options                = WDIOF_SETTIMEOUT |
-                                 WDIOF_KEEPALIVEPING |
-                                 WDIOF_MAGICCLOSE,
-       .identity               = "MPcore Watchdog",
-};
-
-static int mpcore_wdt_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, unsigned long arg)
-{
-       struct mpcore_wdt *wdt = file->private_data;
-       int ret;
-       union {
-               struct watchdog_info ident;
-               int i;
-       } uarg;
-
-       if (_IOC_DIR(cmd) && _IOC_SIZE(cmd) > sizeof(uarg))
-               return -ENOTTY;
-
-       if (_IOC_DIR(cmd) & _IOC_WRITE) {
-               ret = copy_from_user(&uarg, (void __user *)arg, _IOC_SIZE(cmd));
-               if (ret)
-                       return -EFAULT;
-       }
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               uarg.ident = ident;
-               ret = 0;
-               break;
-
-       case WDIOC_SETOPTIONS:
-               ret = -EINVAL;
-               if (uarg.i & WDIOS_DISABLECARD) {
-                       mpcore_wdt_stop(wdt);
-                       ret = 0;
-               }
-               if (uarg.i & WDIOS_ENABLECARD) {
-                       mpcore_wdt_start(wdt);
-                       ret = 0;
-               }
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               uarg.i = 0;
-               ret = 0;
-               break;
-
-       case WDIOC_KEEPALIVE:
-               mpcore_wdt_keepalive(wdt);
-               ret = 0;
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = mpcore_wdt_set_heartbeat(uarg.i);
-               if (ret)
-                       break;
-
-               mpcore_wdt_keepalive(wdt);
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               uarg.i = mpcore_margin;
-               ret = 0;
-               break;
-
-       default:
-               return -ENOTTY;
-       }
-
-       if (ret == 0 && _IOC_DIR(cmd) & _IOC_READ) {
-               ret = copy_to_user((void __user *)arg, &uarg, _IOC_SIZE(cmd));
-               if (ret)
-                       ret = -EFAULT;
-       }
-       return ret;
-}
-
-/*
- *     System shutdown handler.  Turn off the watchdog if we're
- *     restarting or halting the system.
- */
-static void mpcore_wdt_shutdown(struct platform_device *dev)
-{
-       struct mpcore_wdt *wdt = platform_get_drvdata(dev);
-
-       if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT)
-               mpcore_wdt_stop(wdt);
-}
-
-/*
- *     Kernel Interfaces
- */
-static const struct file_operations mpcore_wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = mpcore_wdt_write,
-       .ioctl          = mpcore_wdt_ioctl,
-       .open           = mpcore_wdt_open,
-       .release        = mpcore_wdt_release,
-};
-
-static struct miscdevice mpcore_wdt_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &mpcore_wdt_fops,
-};
-
-static int __devinit mpcore_wdt_probe(struct platform_device *dev)
-{
-       struct mpcore_wdt *wdt;
-       struct resource *res;
-       int ret;
-
-       /* We only accept one device, and it must have an id of -1 */
-       if (dev->id != -1)
-               return -ENODEV;
-
-       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       if (!res) {
-               ret = -ENODEV;
-               goto err_out;
-       }
-
-       wdt = kzalloc(sizeof(struct mpcore_wdt), GFP_KERNEL);
-       if (!wdt) {
-               ret = -ENOMEM;
-               goto err_out;
-       }
-
-       wdt->dev = &dev->dev;
-       wdt->irq = platform_get_irq(dev, 0);
-       if (wdt->irq < 0) {
-               ret = -ENXIO;
-               goto err_free;
-       }
-       wdt->base = ioremap(res->start, res->end - res->start + 1);
-       if (!wdt->base) {
-               ret = -ENOMEM;
-               goto err_free;
-       }
-
-       mpcore_wdt_miscdev.parent = &dev->dev;
-       ret = misc_register(&mpcore_wdt_miscdev);
-       if (ret) {
-               dev_printk(KERN_ERR, _dev, "cannot register miscdev on minor=%d (err=%d)\n",
-                          WATCHDOG_MINOR, ret);
-               goto err_misc;
-       }
-
-       ret = request_irq(wdt->irq, mpcore_wdt_fire, IRQF_DISABLED, "mpcore_wdt", wdt);
-       if (ret) {
-               dev_printk(KERN_ERR, _dev, "cannot register IRQ%d for watchdog\n", wdt->irq);
-               goto err_irq;
-       }
-
-       mpcore_wdt_stop(wdt);
-       platform_set_drvdata(&dev->dev, wdt);
-       mpcore_wdt_dev = dev;
-
-       return 0;
-
- err_irq:
-       misc_deregister(&mpcore_wdt_miscdev);
- err_misc:
-       iounmap(wdt->base);
- err_free:
-       kfree(wdt);
- err_out:
-       return ret;
-}
-
-static int __devexit mpcore_wdt_remove(struct platform_device *dev)
-{
-       struct mpcore_wdt *wdt = platform_get_drvdata(dev);
-
-       platform_set_drvdata(dev, NULL);
-
-       misc_deregister(&mpcore_wdt_miscdev);
-
-       mpcore_wdt_dev = NULL;
-
-       free_irq(wdt->irq, wdt);
-       iounmap(wdt->base);
-       kfree(wdt);
-       return 0;
-}
-
-static struct platform_driver mpcore_wdt_driver = {
-       .probe          = mpcore_wdt_probe,
-       .remove         = __devexit_p(mpcore_wdt_remove),
-       .shutdown       = mpcore_wdt_shutdown,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = "mpcore_wdt",
-       },
-};
-
-static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n";
-
-static int __init mpcore_wdt_init(void)
-{
-       /*
-        * Check that the margin value is within it's range;
-        * if not reset to the default
-        */
-       if (mpcore_wdt_set_heartbeat(mpcore_margin)) {
-               mpcore_wdt_set_heartbeat(TIMER_MARGIN);
-               printk(KERN_INFO "mpcore_margin value must be 0<mpcore_margin<65536, using %d\n",
-                       TIMER_MARGIN);
-       }
-
-       printk(banner, mpcore_noboot, mpcore_margin, nowayout);
-
-       return platform_driver_register(&mpcore_wdt_driver);
-}
-
-static void __exit mpcore_wdt_exit(void)
-{
-       platform_driver_unregister(&mpcore_wdt_driver);
-}
-
-module_init(mpcore_wdt_init);
-module_exit(mpcore_wdt_exit);
-
-MODULE_AUTHOR("ARM Limited");
-MODULE_DESCRIPTION("MPcore Watchdog Device Driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/mtx-1_wdt.c b/drivers/char/watchdog/mtx-1_wdt.c
deleted file mode 100644 (file)
index dcfd401..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- *      Driver for the MTX-1 Watchdog.
- *
- *      (C) Copyright 2005 4G Systems <info@4g-systems.biz>, All Rights Reserved.
- *                              http://www.4g-systems.biz
- *
- *     (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
- *
- *      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.
- *
- *      Neither Michael Stickel nor 4G Systems admit liability nor provide
- *      warranty for any of this software. This material is provided
- *      "AS-IS" and at no charge.
- *
- *      (c) Copyright 2005    4G Systems <info@4g-systems.biz>
- *
- *      Release 0.01.
- *      Author: Michael Stickel  michael.stickel@4g-systems.biz
- *
- *      Release 0.02.
- *     Author: Florian Fainelli florian@openwrt.org
- *             use the Linux watchdog/timer APIs
- *
- *      The Watchdog is configured to reset the MTX-1
- *      if it is not triggered for 100 seconds.
- *      It should not be triggered more often than 1.6 seconds.
- *
- *      A timer triggers the watchdog every 5 seconds, until
- *      it is opened for the first time. After the first open
- *      it MUST be triggered every 2..95 seconds.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/miscdevice.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/timer.h>
-#include <linux/completion.h>
-#include <linux/jiffies.h>
-#include <linux/watchdog.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#include <asm/mach-au1x00/au1000.h>
-
-#define MTX1_WDT_INTERVAL      (5 * HZ)
-
-static int ticks = 100 * HZ;
-
-static struct {
-       struct completion stop;
-       volatile int running;
-       struct timer_list timer;
-       volatile int queue;
-       int default_ticks;
-       unsigned long inuse;
-} mtx1_wdt_device;
-
-static void mtx1_wdt_trigger(unsigned long unused)
-{
-       u32 tmp;
-
-       if (mtx1_wdt_device.running)
-               ticks--;
-       /*
-        * toggle GPIO2_15
-        */
-       tmp = au_readl(GPIO2_DIR);
-       tmp = (tmp & ~(1<<15)) | ((~tmp) & (1<<15));
-       au_writel (tmp, GPIO2_DIR);
-
-       if (mtx1_wdt_device.queue && ticks)
-               mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
-       else {
-               complete(&mtx1_wdt_device.stop);
-       }
-}
-
-static void mtx1_wdt_reset(void)
-{
-       ticks = mtx1_wdt_device.default_ticks;
-}
-
-
-static void mtx1_wdt_start(void)
-{
-       if (!mtx1_wdt_device.queue) {
-               mtx1_wdt_device.queue = 1;
-               au_writel (au_readl(GPIO2_DIR) | (u32)(1<<15), GPIO2_DIR);
-               mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
-       }
-       mtx1_wdt_device.running++;
-}
-
-static int mtx1_wdt_stop(void)
-{
-       if (mtx1_wdt_device.queue) {
-               mtx1_wdt_device.queue = 0;
-               au_writel (au_readl(GPIO2_DIR) & ~((u32)(1<<15)), GPIO2_DIR);
-       }
-
-       ticks = mtx1_wdt_device.default_ticks;
-
-       return 0;
-}
-
-/* Filesystem functions */
-
-static int mtx1_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &mtx1_wdt_device.inuse))
-               return -EBUSY;
-
-       return nonseekable_open(inode, file);
-}
-
-
-static int mtx1_wdt_release(struct inode *inode, struct file *file)
-{
-       clear_bit(0, &mtx1_wdt_device.inuse);
-       return 0;
-}
-
-static int mtx1_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       unsigned int value;
-       static struct watchdog_info ident =
-       {
-               .options = WDIOF_CARDRESET,
-               .identity = "MTX-1 WDT",
-       };
-
-       switch(cmd) {
-               case WDIOC_KEEPALIVE:
-                       mtx1_wdt_reset();
-                       break;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       if ( copy_to_user(argp, &value, sizeof(int)) )
-                               return -EFAULT;
-                       break;
-               case WDIOC_GETSUPPORT:
-                       if ( copy_to_user(argp, &ident, sizeof(ident)) )
-                               return -EFAULT;
-                       break;
-               case WDIOC_SETOPTIONS:
-                       if ( copy_from_user(&value, argp, sizeof(int)) )
-                               return -EFAULT;
-                       switch(value) {
-                               case WDIOS_ENABLECARD:
-                                       mtx1_wdt_start();
-                                       break;
-                               case WDIOS_DISABLECARD:
-                                       return mtx1_wdt_stop();
-                               default:
-                                       return -EINVAL;
-                       }
-                       break;
-               default:
-                       return -ENOTTY;
-       }
-       return 0;
-}
-
-
-static ssize_t mtx1_wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
-       if (!count)
-               return -EIO;
-
-       mtx1_wdt_reset();
-       return count;
-}
-
-static struct file_operations mtx1_wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .ioctl          = mtx1_wdt_ioctl,
-       .open           = mtx1_wdt_open,
-       .write          = mtx1_wdt_write,
-       .release        = mtx1_wdt_release
-};
-
-
-static struct miscdevice mtx1_wdt_misc = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &mtx1_wdt_fops
-};
-
-
-static int __init mtx1_wdt_init(void)
-{
-       int ret;
-
-       if ((ret = misc_register(&mtx1_wdt_misc)) < 0) {
-               printk(KERN_ERR " mtx-1_wdt : failed to register\n");
-               return ret;
-       }
-
-       init_completion(&mtx1_wdt_device.stop);
-       mtx1_wdt_device.queue = 0;
-
-       clear_bit(0, &mtx1_wdt_device.inuse);
-
-       setup_timer(&mtx1_wdt_device.timer, mtx1_wdt_trigger, 0L);
-
-       mtx1_wdt_device.default_ticks = ticks;
-
-       mtx1_wdt_start();
-
-       printk(KERN_INFO "MTX-1 Watchdog driver\n");
-
-       return 0;
-}
-
-static void __exit mtx1_wdt_exit(void)
-{
-       if (mtx1_wdt_device.queue) {
-               mtx1_wdt_device.queue = 0;
-               wait_for_completion(&mtx1_wdt_device.stop);
-       }
-       misc_deregister(&mtx1_wdt_misc);
-}
-
-module_init(mtx1_wdt_init);
-module_exit(mtx1_wdt_exit);
-
-MODULE_AUTHOR("Michael Stickel, Florian Fainelli");
-MODULE_DESCRIPTION("Driver for the MTX-1 watchdog");
-MODULE_LICENSE("GPL");
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
deleted file mode 100644 (file)
index 0365c31..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * mv64x60_wdt.c - MV64X60 (Marvell Discovery) watchdog userspace interface
- *
- * Author: James Chapman <jchapman@katalix.com>
- *
- * Platform-specific setup code should configure the dog to generate
- * interrupt or reset as required.  This code only enables/disables
- * and services the watchdog.
- *
- * Derived from mpc8xx_wdt.c, with the following copyright.
- * 
- * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/watchdog.h>
-#include <linux/platform_device.h>
-
-#include <linux/mv643xx.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#define MV64x60_WDT_WDC_OFFSET 0
-
-/*
- * The watchdog configuration register contains a pair of 2-bit fields,
- *   1.  a reload field, bits 27-26, which triggers a reload of
- *       the countdown register, and
- *   2.  an enable field, bits 25-24, which toggles between
- *       enabling and disabling the watchdog timer.
- * Bit 31 is a read-only field which indicates whether the
- * watchdog timer is currently enabled.
- *
- * The low 24 bits contain the timer reload value.
- */
-#define MV64x60_WDC_ENABLE_SHIFT       24
-#define MV64x60_WDC_SERVICE_SHIFT      26
-#define MV64x60_WDC_ENABLED_SHIFT      31
-
-#define MV64x60_WDC_ENABLED_TRUE       1
-#define MV64x60_WDC_ENABLED_FALSE      0
-
-/* Flags bits */
-#define MV64x60_WDOG_FLAG_OPENED       0
-
-static unsigned long wdt_flags;
-static int wdt_status;
-static void __iomem *mv64x60_wdt_regs;
-static int mv64x60_wdt_timeout;
-static int mv64x60_wdt_count;
-static unsigned int bus_clk;
-static char expect_close;
-static DEFINE_SPINLOCK(mv64x60_wdt_spinlock);
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift)
-{
-       u32 data;
-       u32 enabled;
-       int ret = 0;
-
-       spin_lock(&mv64x60_wdt_spinlock);
-       data = readl(mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
-       enabled = (data >> MV64x60_WDC_ENABLED_SHIFT) & 1;
-
-       /* only toggle the requested field if enabled state matches predicate */
-       if ((enabled ^ enabled_predicate) == 0) {
-               /* We write a 1, then a 2 -- to the appropriate field */
-               data = (1 << field_shift) | mv64x60_wdt_count;
-               writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
-
-               data = (2 << field_shift) | mv64x60_wdt_count;
-               writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
-               ret = 1;
-       }
-       spin_unlock(&mv64x60_wdt_spinlock);
-
-       return ret;
-}
-
-static void mv64x60_wdt_service(void)
-{
-       mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE,
-                              MV64x60_WDC_SERVICE_SHIFT);
-}
-
-static void mv64x60_wdt_handler_enable(void)
-{
-       if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE,
-                                  MV64x60_WDC_ENABLE_SHIFT)) {
-               mv64x60_wdt_service();
-               printk(KERN_NOTICE "mv64x60_wdt: watchdog activated\n");
-       }
-}
-
-static void mv64x60_wdt_handler_disable(void)
-{
-       if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE,
-                                  MV64x60_WDC_ENABLE_SHIFT))
-               printk(KERN_NOTICE "mv64x60_wdt: watchdog deactivated\n");
-}
-
-static void mv64x60_wdt_set_timeout(unsigned int timeout)
-{
-       /* maximum bus cycle count is 0xFFFFFFFF */
-       if (timeout > 0xFFFFFFFF / bus_clk)
-               timeout = 0xFFFFFFFF / bus_clk;
-
-       mv64x60_wdt_count = timeout * bus_clk >> 8;
-       mv64x60_wdt_timeout = timeout;
-}
-
-static int mv64x60_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       mv64x60_wdt_handler_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static int mv64x60_wdt_release(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42)
-               mv64x60_wdt_handler_disable();
-       else {
-               printk(KERN_CRIT
-                      "mv64x60_wdt: unexpected close, not stopping timer!\n");
-               mv64x60_wdt_service();
-       }
-       expect_close = 0;
-
-       clear_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags);
-
-       return 0;
-}
-
-static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data,
-                                size_t len, loff_t * ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if(get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               mv64x60_wdt_service();
-       }
-
-       return len;
-}
-
-static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, unsigned long arg)
-{
-       int timeout;
-       int options;
-       void __user *argp = (void __user *)arg;
-       static struct watchdog_info info = {
-               .options =      WDIOF_SETTIMEOUT        |
-                               WDIOF_MAGICCLOSE        |
-                               WDIOF_KEEPALIVEPING,
-               .firmware_version = 0,
-               .identity = "MV64x60 watchdog",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &info, sizeof(info)))
-                       return -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               if (put_user(wdt_status, (int __user *)argp))
-                       return -EFAULT;
-               wdt_status &= ~WDIOF_KEEPALIVEPING;
-               break;
-
-       case WDIOC_GETTEMP:
-               return -EOPNOTSUPP;
-
-       case WDIOC_SETOPTIONS:
-               if (get_user(options, (int __user *)argp))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD)
-                       mv64x60_wdt_handler_disable();
-
-               if (options & WDIOS_ENABLECARD)
-                       mv64x60_wdt_handler_enable();
-               break;
-
-       case WDIOC_KEEPALIVE:
-               mv64x60_wdt_service();
-               wdt_status |= WDIOF_KEEPALIVEPING;
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(timeout, (int __user *)argp))
-                       return -EFAULT;
-               mv64x60_wdt_set_timeout(timeout);
-               /* Fall through */
-
-       case WDIOC_GETTIMEOUT:
-               if (put_user(mv64x60_wdt_timeout, (int __user *)argp))
-                       return -EFAULT;
-               break;
-
-       default:
-               return -ENOTTY;
-       }
-
-       return 0;
-}
-
-static const struct file_operations mv64x60_wdt_fops = {
-       .owner = THIS_MODULE,
-       .llseek = no_llseek,
-       .write = mv64x60_wdt_write,
-       .ioctl = mv64x60_wdt_ioctl,
-       .open = mv64x60_wdt_open,
-       .release = mv64x60_wdt_release,
-};
-
-static struct miscdevice mv64x60_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &mv64x60_wdt_fops,
-};
-
-static int __devinit mv64x60_wdt_probe(struct platform_device *dev)
-{
-       struct mv64x60_wdt_pdata *pdata = dev->dev.platform_data;
-       struct resource *r;
-       int timeout = 10;
-
-       bus_clk = 133;                  /* in MHz */
-       if (pdata) {
-               timeout = pdata->timeout;
-               bus_clk = pdata->bus_clk;
-       }
-
-       /* Since bus_clk is truncated MHz, actual frequency could be
-        * up to 1MHz higher.  Round up, since it's better to time out
-        * too late than too soon.
-        */
-       bus_clk++;
-       bus_clk *= 1000000;             /* convert to Hz */
-
-       r = platform_get_resource(dev, IORESOURCE_MEM, 0);
-       if (!r)
-               return -ENODEV;
-
-       mv64x60_wdt_regs = ioremap(r->start, r->end - r->start + 1);
-       if (mv64x60_wdt_regs == NULL)
-               return -ENOMEM;
-
-       mv64x60_wdt_set_timeout(timeout);
-
-       mv64x60_wdt_handler_disable();  /* in case timer was already running */
-
-       return misc_register(&mv64x60_wdt_miscdev);
-}
-
-static int __devexit mv64x60_wdt_remove(struct platform_device *dev)
-{
-       misc_deregister(&mv64x60_wdt_miscdev);
-
-       mv64x60_wdt_handler_disable();
-
-       iounmap(mv64x60_wdt_regs);
-
-       return 0;
-}
-
-static struct platform_driver mv64x60_wdt_driver = {
-       .probe = mv64x60_wdt_probe,
-       .remove = __devexit_p(mv64x60_wdt_remove),
-       .driver = {
-               .owner = THIS_MODULE,
-               .name = MV64x60_WDT_NAME,
-       },
-};
-
-static int __init mv64x60_wdt_init(void)
-{
-       printk(KERN_INFO "MV64x60 watchdog driver\n");
-
-       return platform_driver_register(&mv64x60_wdt_driver);
-}
-
-static void __exit mv64x60_wdt_exit(void)
-{
-       platform_driver_unregister(&mv64x60_wdt_driver);
-}
-
-module_init(mv64x60_wdt_init);
-module_exit(mv64x60_wdt_exit);
-
-MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
-MODULE_DESCRIPTION("MV64x60 watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/omap_wdt.c b/drivers/char/watchdog/omap_wdt.c
deleted file mode 100644 (file)
index 719b066..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * linux/drivers/char/watchdog/omap_wdt.c
- *
- * Watchdog driver for the TI OMAP 16xx & 24xx 32KHz (non-secure) watchdog
- *
- * Author: MontaVista Software, Inc.
- *      <gdavis@mvista.com> or <source@mvista.com>
- *
- * 2003 (c) MontaVista Software, Inc. This file is licensed under the
- * terms of the GNU General Public License version 2. This program is
- * licensed "as is" without any warranty of any kind, whether express
- * or implied.
- *
- * History:
- *
- * 20030527: George G. Davis <gdavis@mvista.com>
- *     Initially based on linux-2.4.19-rmk7-pxa1/drivers/char/sa1100_wdt.c
- *     (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
- *     Based on SoftDog driver by Alan Cox <alan@redhat.com>
- *
- * Copyright (c) 2004 Texas Instruments.
- *     1. Modified to support OMAP1610 32-KHz watchdog timer
- *     2. Ported to 2.6 kernel
- *
- * Copyright (c) 2005 David Brownell
- *     Use the driver model and standard identifiers; handle bigger timeouts.
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/err.h>
-#include <linux/platform_device.h>
-#include <linux/moduleparam.h>
-#include <linux/clk.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/hardware.h>
-#include <asm/bitops.h>
-
-#include <asm/arch/prcm.h>
-
-#include "omap_wdt.h"
-
-static unsigned timer_margin;
-module_param(timer_margin, uint, 0);
-MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
-
-static int omap_wdt_users;
-static struct clk *armwdt_ck = NULL;
-static struct clk *mpu_wdt_ick = NULL;
-static struct clk *mpu_wdt_fck = NULL;
-
-static unsigned int wdt_trgr_pattern = 0x1234;
-
-static void omap_wdt_ping(void)
-{
-       /* wait for posted write to complete */
-       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x08)
-               cpu_relax();
-       wdt_trgr_pattern = ~wdt_trgr_pattern;
-       omap_writel(wdt_trgr_pattern, (OMAP_WATCHDOG_TGR));
-       /* wait for posted write to complete */
-       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x08)
-               cpu_relax();
-       /* reloaded WCRR from WLDR */
-}
-
-static void omap_wdt_enable(void)
-{
-       /* Sequence to enable the watchdog */
-       omap_writel(0xBBBB, OMAP_WATCHDOG_SPR);
-       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x10)
-               cpu_relax();
-       omap_writel(0x4444, OMAP_WATCHDOG_SPR);
-       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x10)
-               cpu_relax();
-}
-
-static void omap_wdt_disable(void)
-{
-       /* sequence required to disable watchdog */
-       omap_writel(0xAAAA, OMAP_WATCHDOG_SPR); /* TIMER_MODE */
-       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x10)
-               cpu_relax();
-       omap_writel(0x5555, OMAP_WATCHDOG_SPR); /* TIMER_MODE */
-       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x10)
-               cpu_relax();
-}
-
-static void omap_wdt_adjust_timeout(unsigned new_timeout)
-{
-       if (new_timeout < TIMER_MARGIN_MIN)
-               new_timeout = TIMER_MARGIN_DEFAULT;
-       if (new_timeout > TIMER_MARGIN_MAX)
-               new_timeout = TIMER_MARGIN_MAX;
-       timer_margin = new_timeout;
-}
-
-static void omap_wdt_set_timeout(void)
-{
-       u32 pre_margin = GET_WLDR_VAL(timer_margin);
-
-       /* just count up at 32 KHz */
-       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x04)
-               cpu_relax();
-       omap_writel(pre_margin, OMAP_WATCHDOG_LDR);
-       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x04)
-               cpu_relax();
-}
-
-/*
- *     Allow only one task to hold it open
- */
-
-static int omap_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(1, (unsigned long *)&omap_wdt_users))
-               return -EBUSY;
-
-       if (cpu_is_omap16xx())
-               clk_enable(armwdt_ck);  /* Enable the clock */
-
-       if (cpu_is_omap24xx()) {
-               clk_enable(mpu_wdt_ick);    /* Enable the interface clock */
-               clk_enable(mpu_wdt_fck);    /* Enable the functional clock */
-       }
-
-       /* initialize prescaler */
-       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x01)
-               cpu_relax();
-       omap_writel((1 << 5) | (PTV << 2), OMAP_WATCHDOG_CNTRL);
-       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x01)
-               cpu_relax();
-
-       omap_wdt_set_timeout();
-       omap_wdt_enable();
-       return nonseekable_open(inode, file);
-}
-
-static int omap_wdt_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer unless NOWAYOUT is defined.
-        */
-#ifndef CONFIG_WATCHDOG_NOWAYOUT
-       omap_wdt_disable();
-
-       if (cpu_is_omap16xx()) {
-               clk_disable(armwdt_ck); /* Disable the clock */
-               clk_put(armwdt_ck);
-               armwdt_ck = NULL;
-       }
-
-       if (cpu_is_omap24xx()) {
-               clk_disable(mpu_wdt_ick);       /* Disable the clock */
-               clk_disable(mpu_wdt_fck);       /* Disable the clock */
-               clk_put(mpu_wdt_ick);
-               clk_put(mpu_wdt_fck);
-               mpu_wdt_ick = NULL;
-               mpu_wdt_fck = NULL;
-       }
-#else
-       printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n");
-#endif
-       omap_wdt_users = 0;
-       return 0;
-}
-
-static ssize_t
-omap_wdt_write(struct file *file, const char __user *data,
-               size_t len, loff_t *ppos)
-{
-       /* Refresh LOAD_TIME. */
-       if (len)
-               omap_wdt_ping();
-       return len;
-}
-
-static int
-omap_wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       int new_margin;
-       static struct watchdog_info ident = {
-               .identity = "OMAP Watchdog",
-               .options = WDIOF_SETTIMEOUT,
-               .firmware_version = 0,
-       };
-
-       switch (cmd) {
-       default:
-               return -ENOTTY;
-       case WDIOC_GETSUPPORT:
-               return copy_to_user((struct watchdog_info __user *)arg, &ident,
-                               sizeof(ident));
-       case WDIOC_GETSTATUS:
-               return put_user(0, (int __user *)arg);
-       case WDIOC_GETBOOTSTATUS:
-               if (cpu_is_omap16xx())
-                       return put_user(omap_readw(ARM_SYSST),
-                                       (int __user *)arg);
-               if (cpu_is_omap24xx())
-                       return put_user(omap_prcm_get_reset_sources(),
-                                       (int __user *)arg);
-       case WDIOC_KEEPALIVE:
-               omap_wdt_ping();
-               return 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_margin, (int __user *)arg))
-                       return -EFAULT;
-               omap_wdt_adjust_timeout(new_margin);
-
-               omap_wdt_disable();
-               omap_wdt_set_timeout();
-               omap_wdt_enable();
-
-               omap_wdt_ping();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timer_margin, (int __user *)arg);
-       }
-}
-
-static const struct file_operations omap_wdt_fops = {
-       .owner = THIS_MODULE,
-       .write = omap_wdt_write,
-       .ioctl = omap_wdt_ioctl,
-       .open = omap_wdt_open,
-       .release = omap_wdt_release,
-};
-
-static struct miscdevice omap_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &omap_wdt_fops
-};
-
-static int __init omap_wdt_probe(struct platform_device *pdev)
-{
-       struct resource *res, *mem;
-       int ret;
-
-       /* reserve static register mappings */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -ENOENT;
-
-       mem = request_mem_region(res->start, res->end - res->start + 1,
-                                pdev->name);
-       if (mem == NULL)
-               return -EBUSY;
-
-       platform_set_drvdata(pdev, mem);
-
-       omap_wdt_users = 0;
-
-       if (cpu_is_omap16xx()) {
-               armwdt_ck = clk_get(&pdev->dev, "armwdt_ck");
-               if (IS_ERR(armwdt_ck)) {
-                       ret = PTR_ERR(armwdt_ck);
-                       armwdt_ck = NULL;
-                       goto fail;
-               }
-       }
-
-       if (cpu_is_omap24xx()) {
-               mpu_wdt_ick = clk_get(&pdev->dev, "mpu_wdt_ick");
-               if (IS_ERR(mpu_wdt_ick)) {
-                       ret = PTR_ERR(mpu_wdt_ick);
-                       mpu_wdt_ick = NULL;
-                       goto fail;
-               }
-               mpu_wdt_fck = clk_get(&pdev->dev, "mpu_wdt_fck");
-               if (IS_ERR(mpu_wdt_fck)) {
-                       ret = PTR_ERR(mpu_wdt_fck);
-                       mpu_wdt_fck = NULL;
-                       goto fail;
-               }
-       }
-
-       omap_wdt_disable();
-       omap_wdt_adjust_timeout(timer_margin);
-
-       omap_wdt_miscdev.parent = &pdev->dev;
-       ret = misc_register(&omap_wdt_miscdev);
-       if (ret)
-               goto fail;
-
-       pr_info("OMAP Watchdog Timer: initial timeout %d sec\n", timer_margin);
-
-       /* autogate OCP interface clock */
-       omap_writel(0x01, OMAP_WATCHDOG_SYS_CONFIG);
-       return 0;
-
-fail:
-       if (armwdt_ck)
-               clk_put(armwdt_ck);
-       if (mpu_wdt_ick)
-               clk_put(mpu_wdt_ick);
-       if (mpu_wdt_fck)
-               clk_put(mpu_wdt_fck);
-       release_resource(mem);
-       return ret;
-}
-
-static void omap_wdt_shutdown(struct platform_device *pdev)
-{
-       omap_wdt_disable();
-}
-
-static int omap_wdt_remove(struct platform_device *pdev)
-{
-       struct resource *mem = platform_get_drvdata(pdev);
-       misc_deregister(&omap_wdt_miscdev);
-       release_resource(mem);
-       if (armwdt_ck)
-               clk_put(armwdt_ck);
-       if (mpu_wdt_ick)
-               clk_put(mpu_wdt_ick);
-       if (mpu_wdt_fck)
-               clk_put(mpu_wdt_fck);
-       return 0;
-}
-
-#ifdef CONFIG_PM
-
-/* REVISIT ... not clear this is the best way to handle system suspend; and
- * it's very inappropriate for selective device suspend (e.g. suspending this
- * through sysfs rather than by stopping the watchdog daemon).  Also, this
- * may not play well enough with NOWAYOUT...
- */
-
-static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state)
-{
-       if (omap_wdt_users)
-               omap_wdt_disable();
-       return 0;
-}
-
-static int omap_wdt_resume(struct platform_device *pdev)
-{
-       if (omap_wdt_users) {
-               omap_wdt_enable();
-               omap_wdt_ping();
-       }
-       return 0;
-}
-
-#else
-#define        omap_wdt_suspend        NULL
-#define        omap_wdt_resume         NULL
-#endif
-
-static struct platform_driver omap_wdt_driver = {
-       .probe          = omap_wdt_probe,
-       .remove         = omap_wdt_remove,
-       .shutdown       = omap_wdt_shutdown,
-       .suspend        = omap_wdt_suspend,
-       .resume         = omap_wdt_resume,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = "omap_wdt",
-       },
-};
-
-static int __init omap_wdt_init(void)
-{
-       return platform_driver_register(&omap_wdt_driver);
-}
-
-static void __exit omap_wdt_exit(void)
-{
-       platform_driver_unregister(&omap_wdt_driver);
-}
-
-module_init(omap_wdt_init);
-module_exit(omap_wdt_exit);
-
-MODULE_AUTHOR("George G. Davis");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/omap_wdt.h b/drivers/char/watchdog/omap_wdt.h
deleted file mode 100644 (file)
index 52a532a..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *  linux/drivers/char/watchdog/omap_wdt.h
- *
- *  BRIEF MODULE DESCRIPTION
- *      OMAP Watchdog timer register definitions
- *
- *  Copyright (C) 2004 Texas Instruments.
- *
- *  This program is free software; you can redistribute  it and/or modify it
- *  under  the terms of  the GNU General  Public License as published by the
- *  Free Software Foundation;  either version 2 of the  License, or (at your
- *  option) any later version.
- *
- *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
- *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
- *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
- *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
- *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
- *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *  You should have received a copy of the  GNU General Public License along
- *  with this program; if not, write  to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef _OMAP_WATCHDOG_H
-#define _OMAP_WATCHDOG_H
-
-#define OMAP1610_WATCHDOG_BASE         0xfffeb000
-#define OMAP2420_WATCHDOG_BASE         0x48022000      /*WDT Timer 2 */
-
-#ifdef CONFIG_ARCH_OMAP24XX
-#define OMAP_WATCHDOG_BASE             OMAP2420_WATCHDOG_BASE
-#else
-#define OMAP_WATCHDOG_BASE             OMAP1610_WATCHDOG_BASE
-#define RM_RSTST_WKUP                  0
-#endif
-
-#define OMAP_WATCHDOG_REV              (OMAP_WATCHDOG_BASE + 0x00)
-#define OMAP_WATCHDOG_SYS_CONFIG       (OMAP_WATCHDOG_BASE + 0x10)
-#define OMAP_WATCHDOG_STATUS           (OMAP_WATCHDOG_BASE + 0x14)
-#define OMAP_WATCHDOG_CNTRL            (OMAP_WATCHDOG_BASE + 0x24)
-#define OMAP_WATCHDOG_CRR              (OMAP_WATCHDOG_BASE + 0x28)
-#define OMAP_WATCHDOG_LDR              (OMAP_WATCHDOG_BASE + 0x2c)
-#define OMAP_WATCHDOG_TGR              (OMAP_WATCHDOG_BASE + 0x30)
-#define OMAP_WATCHDOG_WPS              (OMAP_WATCHDOG_BASE + 0x34)
-#define OMAP_WATCHDOG_SPR              (OMAP_WATCHDOG_BASE + 0x48)
-
-/* Using the prescaler, the OMAP watchdog could go for many
- * months before firing.  These limits work without scaling,
- * with the 60 second default assumed by most tools and docs.
- */
-#define TIMER_MARGIN_MAX       (24 * 60 * 60)  /* 1 day */
-#define TIMER_MARGIN_DEFAULT   60      /* 60 secs */
-#define TIMER_MARGIN_MIN       1
-
-#define PTV                    0       /* prescale */
-#define GET_WLDR_VAL(secs)     (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
-
-#endif                         /* _OMAP_WATCHDOG_H */
diff --git a/drivers/char/watchdog/pc87413_wdt.c b/drivers/char/watchdog/pc87413_wdt.c
deleted file mode 100644 (file)
index 3d3deae..0000000
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- *      NS pc87413-wdt Watchdog Timer driver for Linux 2.6.x.x
- *
- *      This code is based on wdt.c with original copyright.
- *
- *      (C) Copyright 2006 Sven Anders, <anders@anduras.de>
- *                     and Marcus Junker, <junker@anduras.de>
- *
- *      This program is free software; you can redistribute it and/or
- *      modify it under the terms of the GNU General Public License
- *      as published by the Free Software Foundation; either version
- *      2 of the License, or (at your option) any later version.
- *
- *      Neither Sven Anders, Marcus Junker nor ANDURAS AG
- *      admit liability nor provide warranty for any of this software.
- *      This material is provided "AS-IS" and at no charge.
- *
- *      Release 1.1
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/notifier.h>
-#include <linux/fs.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/moduleparam.h>
-#include <linux/version.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-/* #define DEBUG 1 */
-
-#define DEFAULT_TIMEOUT     1            /* 1 minute */
-#define MAX_TIMEOUT         255
-
-#define VERSION             "1.1"
-#define MODNAME             "pc87413 WDT"
-#define PFX                 MODNAME ": "
-#define DPFX                MODNAME " - DEBUG: "
-
-#define WDT_INDEX_IO_PORT   (io+0)       /* I/O port base (index register) */
-#define WDT_DATA_IO_PORT    (WDT_INDEX_IO_PORT+1)
-#define SWC_LDN             0x04
-#define SIOCFG2             0x22         /* Serial IO register */
-#define WDCTL               0x10         /* Watchdog-Timer-Controll-Register */
-#define WDTO                0x11         /* Watchdog timeout register */
-#define WDCFG               0x12         /* Watchdog config register */
-
-static int io = 0x2E;                   /* Address used on Portwell Boards */
-
-static int timeout = DEFAULT_TIMEOUT;    /* timeout value */
-static unsigned long timer_enabled = 0;  /* is the timer enabled? */
-
-static char expect_close;                /* is the close expected? */
-
-static spinlock_t io_lock;               /* to guard the watchdog from io races */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-/* -- Low level function ----------------------------------------*/
-
-/* Select pins for Watchdog output */
-
-static inline void pc87413_select_wdt_out (void)
-{
-       unsigned int cr_data = 0;
-
-       /* Step 1: Select multiple pin,pin55,as WDT output */
-
-       outb_p(SIOCFG2, WDT_INDEX_IO_PORT);
-
-       cr_data = inb (WDT_DATA_IO_PORT);
-
-       cr_data |= 0x80; /* Set Bit7 to 1*/
-       outb_p(SIOCFG2, WDT_INDEX_IO_PORT);
-
-       outb_p(cr_data, WDT_DATA_IO_PORT);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Select multiple pin,pin55,as WDT output:"
-                             " Bit7 to 1: %d\n", cr_data);
-#endif
-}
-
-/* Enable SWC functions */
-
-static inline void pc87413_enable_swc(void)
-{
-       unsigned int cr_data=0;
-
-       /* Step 2: Enable SWC functions */
-
-       outb_p(0x07, WDT_INDEX_IO_PORT);        /* Point SWC_LDN (LDN=4) */
-       outb_p(SWC_LDN, WDT_DATA_IO_PORT);
-
-       outb_p(0x30, WDT_INDEX_IO_PORT);        /* Read Index 0x30 First */
-       cr_data = inb(WDT_DATA_IO_PORT);
-       cr_data |= 0x01;                        /* Set Bit0 to 1 */
-       outb_p(0x30, WDT_INDEX_IO_PORT);
-       outb_p(cr_data, WDT_DATA_IO_PORT);      /* Index0x30_bit0P1 */
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n");
-#endif
-}
-
-/* Read SWC I/O base address */
-
-static inline unsigned int pc87413_get_swc_base(void)
-{
-       unsigned int  swc_base_addr = 0;
-       unsigned char addr_l, addr_h = 0;
-
-       /* Step 3: Read SWC I/O Base Address */
-
-       outb_p(0x60, WDT_INDEX_IO_PORT);        /* Read Index 0x60 */
-       addr_h = inb(WDT_DATA_IO_PORT);
-
-       outb_p(0x61, WDT_INDEX_IO_PORT);        /* Read Index 0x61 */
-
-       addr_l = inb(WDT_DATA_IO_PORT);
-
-       swc_base_addr = (addr_h << 8) + addr_l;
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Read SWC I/O Base Address: low %d, high %d,"
-                             " res %d\n", addr_l, addr_h, swc_base_addr);
-#endif
-
-       return swc_base_addr;
-}
-
-/* Select Bank 3 of SWC */
-
-static inline void pc87413_swc_bank3(unsigned int swc_base_addr)
-{
-       /* Step 4: Select Bank3 of SWC */
-
-       outb_p(inb(swc_base_addr + 0x0f) | 0x03, swc_base_addr + 0x0f);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Select Bank3 of SWC\n");
-#endif
-}
-
-/* Set watchdog timeout to x minutes */
-
-static inline void pc87413_programm_wdto(unsigned int swc_base_addr,
-                                        char pc87413_time)
-{
-       /* Step 5: Programm WDTO, Twd. */
-
-       outb_p(pc87413_time, swc_base_addr + WDTO);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Set WDTO to %d minutes\n", pc87413_time);
-#endif
-}
-
-/* Enable WDEN */
-
-static inline void pc87413_enable_wden(unsigned int swc_base_addr)
-{
-       /* Step 6: Enable WDEN */
-
-       outb_p(inb (swc_base_addr + WDCTL) | 0x01, swc_base_addr + WDCTL);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Enable WDEN\n");
-#endif
-}
-
-/* Enable SW_WD_TREN */
-static inline void pc87413_enable_sw_wd_tren(unsigned int swc_base_addr)
-{
-       /* Enable SW_WD_TREN */
-
-       outb_p(inb (swc_base_addr + WDCFG) | 0x80, swc_base_addr + WDCFG);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Enable SW_WD_TREN\n");
-#endif
-}
-
-/* Disable SW_WD_TREN */
-
-static inline void pc87413_disable_sw_wd_tren(unsigned int swc_base_addr)
-{
-       /* Disable SW_WD_TREN */
-
-       outb_p(inb (swc_base_addr + WDCFG) & 0x7f, swc_base_addr + WDCFG);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "pc87413 - Disable SW_WD_TREN\n");
-#endif
-}
-
-/* Enable SW_WD_TRG */
-
-static inline void pc87413_enable_sw_wd_trg(unsigned int swc_base_addr)
-{
-       /* Enable SW_WD_TRG */
-
-       outb_p(inb (swc_base_addr + WDCTL) | 0x80, swc_base_addr + WDCTL);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "pc87413 - Enable SW_WD_TRG\n");
-#endif
-}
-
-/* Disable SW_WD_TRG */
-
-static inline void pc87413_disable_sw_wd_trg(unsigned int swc_base_addr)
-{
-       /* Disable SW_WD_TRG */
-
-       outb_p(inb (swc_base_addr + WDCTL) & 0x7f, swc_base_addr + WDCTL);
-
-#ifdef DEBUG
-       printk(KERN_INFO DPFX "Disable SW_WD_TRG\n");
-#endif
-}
-
-/* -- Higher level functions ------------------------------------*/
-
-/* Enable the watchdog */
-
-static void pc87413_enable(void)
-{
-       unsigned int swc_base_addr;
-
-       spin_lock(&io_lock);
-
-       pc87413_select_wdt_out();
-       pc87413_enable_swc();
-       swc_base_addr = pc87413_get_swc_base();
-       pc87413_swc_bank3(swc_base_addr);
-       pc87413_programm_wdto(swc_base_addr, timeout);
-       pc87413_enable_wden(swc_base_addr);
-       pc87413_enable_sw_wd_tren(swc_base_addr);
-       pc87413_enable_sw_wd_trg(swc_base_addr);
-
-       spin_unlock(&io_lock);
-}
-
-/* Disable the watchdog */
-
-static void pc87413_disable(void)
-{
-       unsigned int swc_base_addr;
-
-       spin_lock(&io_lock);
-
-       pc87413_select_wdt_out();
-       pc87413_enable_swc();
-       swc_base_addr = pc87413_get_swc_base();
-       pc87413_swc_bank3(swc_base_addr);
-       pc87413_disable_sw_wd_tren(swc_base_addr);
-       pc87413_disable_sw_wd_trg(swc_base_addr);
-       pc87413_programm_wdto(swc_base_addr, 0);
-
-       spin_unlock(&io_lock);
-}
-
-/* Refresh the watchdog */
-
-static void pc87413_refresh(void)
-{
-       unsigned int swc_base_addr;
-
-       spin_lock(&io_lock);
-
-       pc87413_select_wdt_out();
-       pc87413_enable_swc();
-       swc_base_addr = pc87413_get_swc_base();
-       pc87413_swc_bank3(swc_base_addr);
-       pc87413_disable_sw_wd_tren(swc_base_addr);
-       pc87413_disable_sw_wd_trg(swc_base_addr);
-       pc87413_programm_wdto(swc_base_addr, timeout);
-       pc87413_enable_wden(swc_base_addr);
-       pc87413_enable_sw_wd_tren(swc_base_addr);
-       pc87413_enable_sw_wd_trg(swc_base_addr);
-
-       spin_unlock(&io_lock);
-}
-
-/* -- File operations -------------------------------------------*/
-
-/**
- *     pc87413_open:
- *     @inode: inode of device
- *     @file: file handle to device
- *
- */
-
-static int pc87413_open(struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-
-       if (test_and_set_bit(0, &timer_enabled))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Reload and activate timer */
-       pc87413_refresh();
-
-       printk(KERN_INFO MODNAME "Watchdog enabled. Timeout set to"
-                                " %d minute(s).\n", timeout);
-
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     pc87413_release:
- *     @inode: inode to board
- *     @file: file handle to board
- *
- *     The watchdog has a configurable API. There is a religious dispute
- *     between people who want their watchdog to be able to shut down and
- *     those who want to be sure if the watchdog manager dies the machine
- *     reboots. In the former case we disable the counters, in the latter
- *     case you have to open it again very soon.
- */
-
-static int pc87413_release(struct inode *inode, struct file *file)
-{
-       /* Shut off the timer. */
-
-       if (expect_close == 42) {
-               pc87413_disable();
-               printk(KERN_INFO MODNAME "Watchdog disabled,"
-                                        " sleeping again...\n");
-       } else {
-               printk(KERN_CRIT MODNAME "Unexpected close, not stopping"
-                                        " watchdog!\n");
-               pc87413_refresh();
-       }
-
-       clear_bit(0, &timer_enabled);
-       expect_close = 0;
-
-       return 0;
-}
-
-/**
- *     pc87413_status:
- *
- *      return, if the watchdog is enabled (timeout is set...)
- */
-
-
-static int pc87413_status(void)
-{
-         return 0; /* currently not supported */
-}
-
-/**
- *     pc87413_write:
- *     @file: file handle to the watchdog
- *     @data: data buffer to write
- *     @len: length in bytes
- *     @ppos: pointer to the position to write. No seeks allowed
- *
- *     A write to a watchdog device is defined as a keepalive signal. Any
- *     write of data will do, as we we don't define content meaning.
- */
-
-static ssize_t pc87413_write(struct file *file, const char __user *data,
-                            size_t len, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* reset expect flag */
-                       expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if (get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               pc87413_refresh();
-       }
-       return len;
-}
-
-/**
- *     pc87413_ioctl:
- *     @inode: inode of the device
- *     @file: file handle to the device
- *     @cmd: watchdog command
- *     @arg: argument pointer
- *
- *     The watchdog API defines a common set of functions for all watchdogs
- *     according to their available features. We only actually usefully support
- *     querying capabilities and current status.
- */
-
-static int pc87413_ioctl(struct inode *inode, struct file *file,
-                        unsigned int cmd, unsigned long arg)
-{
-       int new_timeout;
-
-       union {
-               struct watchdog_info __user *ident;
-               int __user *i;
-       } uarg;
-
-       static struct watchdog_info ident = {
-               .options          = WDIOF_KEEPALIVEPING |
-                                   WDIOF_SETTIMEOUT |
-                                   WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity         = "PC87413(HF/F) watchdog"
-       };
-
-       uarg.i = (int __user *)arg;
-
-       switch(cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(uarg.ident, &ident,
-                               sizeof(ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-                       return put_user(pc87413_status(), uarg.i);
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, uarg.i);
-
-               case WDIOC_KEEPALIVE:
-                       pc87413_refresh();
-#ifdef DEBUG
-                       printk(KERN_INFO DPFX "keepalive\n");
-#endif
-                       return 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_timeout, uarg.i))
-                               return -EFAULT;
-
-                       // the API states this is given in secs
-                       new_timeout /= 60;
-
-                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
-                               return -EINVAL;
-
-                       timeout = new_timeout;
-                       pc87413_refresh();
-
-                       // fall through and return the new timeout...
-
-               case WDIOC_GETTIMEOUT:
-
-                       new_timeout = timeout * 60;
-
-                       return put_user(new_timeout, uarg.i);
-
-               case WDIOC_SETOPTIONS:
-               {
-                       int options, retval = -EINVAL;
-
-                       if (get_user(options, uarg.i))
-                               return -EFAULT;
-
-                       if (options & WDIOS_DISABLECARD) {
-                               pc87413_disable();
-                               retval = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               pc87413_enable();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-       }
-}
-
-/* -- Notifier funtions -----------------------------------------*/
-
-/**
- *     notify_sys:
- *     @this: our notifier block
- *     @code: the event being reported
- *     @unused: unused
- *
- *     Our notifier is called on system shutdowns. We want to turn the card
- *     off at reboot otherwise the machine will reboot again during memory
- *     test or worse yet during the following fsck. This would suck, in fact
- *     trust me - if it happens it does suck.
- */
-
-static int pc87413_notify_sys(struct notifier_block *this,
-                             unsigned long code,
-                             void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-       {
-               /* Turn the card off */
-               pc87413_disable();
-       }
-       return NOTIFY_DONE;
-}
-
-/* -- Module's structures ---------------------------------------*/
-
-static const struct file_operations pc87413_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = pc87413_write,
-       .ioctl          = pc87413_ioctl,
-       .open           = pc87413_open,
-       .release        = pc87413_release,
-};
-
-static struct notifier_block pc87413_notifier =
-{
-       .notifier_call  = pc87413_notify_sys,
-};
-
-static struct miscdevice pc87413_miscdev=
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &pc87413_fops
-};
-
-/* -- Module init functions -------------------------------------*/
-
-/**
- *     pc87413_init: module's "constructor"
- *
- *     Set up the WDT watchdog board. All we have to do is grab the
- *     resources we require and bitch if anyone beat us to them.
- *     The open() function will actually kick the board off.
- */
-
-static int __init pc87413_init(void)
-{
-       int ret;
-
-       spin_lock_init(&io_lock);
-
-       printk(KERN_INFO PFX "Version " VERSION " at io 0x%X\n", WDT_INDEX_IO_PORT);
-
-       /* request_region(io, 2, "pc87413"); */
-
-       ret = register_reboot_notifier(&pc87413_notifier);
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-       }
-
-       ret = misc_register(&pc87413_miscdev);
-
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               unregister_reboot_notifier(&pc87413_notifier);
-               return ret;
-       }
-
-       printk(KERN_INFO PFX "initialized. timeout=%d min \n", timeout);
-
-       pc87413_enable();
-
-       return 0;
-}
-
-/**
- *     pc87413_exit: module's "destructor"
- *
- *     Unload the watchdog. You cannot do this with any file handles open.
- *     If your watchdog is set to continue ticking on close and you unload
- *     it, well it keeps ticking. We won't get the interrupt but the board
- *     will not touch PC memory so all is fine. You just have to load a new
- *     module in 60 seconds or reboot.
- */
-
-static void __exit pc87413_exit(void)
-{
-       /* Stop the timer before we leave */
-       if (!nowayout)
-       {
-               pc87413_disable();
-               printk(KERN_INFO MODNAME "Watchdog disabled.\n");
-       }
-
-       misc_deregister(&pc87413_miscdev);
-       unregister_reboot_notifier(&pc87413_notifier);
-       /* release_region(io,2); */
-
-       printk(MODNAME " watchdog component driver removed.\n");
-}
-
-module_init(pc87413_init);
-module_exit(pc87413_exit);
-
-MODULE_AUTHOR("Sven Anders <anders@anduras.de>, Marcus Junker <junker@anduras.de>,");
-MODULE_DESCRIPTION("PC87413 WDT driver");
-MODULE_LICENSE("GPL");
-
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-module_param(io, int, 0);
-MODULE_PARM_DESC(io, MODNAME " I/O port (default: " __MODULE_STRING(io) ").");
-
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes (default=" __MODULE_STRING(timeout) ").");
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
deleted file mode 100644 (file)
index 7b41434..0000000
+++ /dev/null
@@ -1,1013 +0,0 @@
-/*
- * PC Watchdog Driver
- * by Ken Hollis (khollis@bitgate.com)
- *
- * Permission granted from Simon Machell (smachell@berkprod.com)
- * Written for the Linux Kernel, and GPLed by Ken Hollis
- *
- * 960107      Added request_region routines, modulized the whole thing.
- * 960108      Fixed end-of-file pointer (Thanks to Dan Hollis), added
- *             WD_TIMEOUT define.
- * 960216      Added eof marker on the file, and changed verbose messages.
- * 960716      Made functional and cosmetic changes to the source for
- *             inclusion in Linux 2.0.x kernels, thanks to Alan Cox.
- * 960717      Removed read/seek routines, replaced with ioctl.  Also, added
- *             check_region command due to Alan's suggestion.
- * 960821      Made changes to compile in newer 2.0.x kernels.  Added
- *             "cold reboot sense" entry.
- * 960825      Made a few changes to code, deleted some defines and made
- *             typedefs to replace them.  Made heartbeat reset only available
- *             via ioctl, and removed the write routine.
- * 960828      Added new items for PC Watchdog Rev.C card.
- * 960829      Changed around all of the IOCTLs, added new features,
- *             added watchdog disable/re-enable routines.  Added firmware
- *             version reporting.  Added read routine for temperature.
- *             Removed some extra defines, added an autodetect Revision
- *             routine.
- * 961006       Revised some documentation, fixed some cosmetic bugs.  Made
- *              drivers to panic the system if it's overheating at bootup.
- * 961118      Changed some verbiage on some of the output, tidied up
- *             code bits, and added compatibility to 2.1.x.
- * 970912       Enabled board on open and disable on close.
- * 971107      Took account of recent VFS changes (broke read).
- * 971210       Disable board on initialisation in case board already ticking.
- * 971222       Changed open/close for temperature handling
- *              Michael Meskes <meskes@debian.org>.
- * 980112       Used minor numbers from include/linux/miscdevice.h
- * 990403       Clear reset status after reading control status register in
- *              pcwd_showprevstate(). [Marc Boucher <marc@mbsi.ca>]
- * 990605      Made changes to code to support Firmware 1.22a, added
- *             fairly useless proc entry.
- * 990610      removed said useless proc code for the merge <alan>
- * 000403      Removed last traces of proc code. <davej>
- * 011214      Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT <Matt_Domsch@dell.com>
- *              Added timeout module option to override default
- */
-
-/*
- *     A bells and whistles driver is available from http://www.pcwd.de/
- *     More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
- */
-
-#include <linux/module.h>      /* For module specific items */
-#include <linux/moduleparam.h> /* For new moduleparam's */
-#include <linux/types.h>       /* For standard types (like size_t) */
-#include <linux/errno.h>       /* For the -ENODEV/... values */
-#include <linux/kernel.h>      /* For printk/panic/... */
-#include <linux/delay.h>       /* For mdelay function */
-#include <linux/timer.h>       /* For timer related operations */
-#include <linux/jiffies.h>     /* For jiffies stuff */
-#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
-#include <linux/watchdog.h>    /* For the watchdog specific items */
-#include <linux/reboot.h>      /* For kernel_power_off() */
-#include <linux/init.h>                /* For __init/__exit/... */
-#include <linux/fs.h>          /* For file operations */
-#include <linux/isa.h>         /* For isa devices */
-#include <linux/ioport.h>      /* For io-port access */
-#include <linux/spinlock.h>    /* For spin_lock/spin_unlock/... */
-
-#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
-#include <asm/io.h>            /* For inb/outb/... */
-
-/* Module and version information */
-#define WATCHDOG_VERSION "1.20"
-#define WATCHDOG_DATE "18 Feb 2007"
-#define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
-#define WATCHDOG_NAME "pcwd"
-#define PFX WATCHDOG_NAME ": "
-#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n"
-#define WD_VER WATCHDOG_VERSION " (" WATCHDOG_DATE ")"
-
-/*
- * It should be noted that PCWD_REVISION_B was removed because A and B
- * are essentially the same types of card, with the exception that B
- * has temperature reporting.  Since I didn't receive a Rev.B card,
- * the Rev.B card is not supported.  (It's a good thing too, as they
- * are no longer in production.)
- */
-#define        PCWD_REVISION_A         1
-#define        PCWD_REVISION_C         2
-
-/*
- * These are the auto-probe addresses available.
- *
- * Revision A only uses ports 0x270 and 0x370.  Revision C introduced 0x350.
- * Revision A has an address range of 2 addresses, while Revision C has 4.
- */
-#define PCWD_ISA_NR_CARDS      3
-static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 };
-
-/*
- * These are the defines that describe the control status bits for the
- * PCI-PC Watchdog card.
-*/
-/* Port 1 : Control Status #1 for the PC Watchdog card, revision A. */
-#define WD_WDRST               0x01    /* Previously reset state */
-#define WD_T110                        0x02    /* Temperature overheat sense */
-#define WD_HRTBT               0x04    /* Heartbeat sense */
-#define WD_RLY2                        0x08    /* External relay triggered */
-#define WD_SRLY2               0x80    /* Software external relay triggered */
-/* Port 1 : Control Status #1 for the PC Watchdog card, revision C. */
-#define WD_REVC_WTRP           0x01    /* Watchdog Trip status */
-#define WD_REVC_HRBT           0x02    /* Watchdog Heartbeat */
-#define WD_REVC_TTRP           0x04    /* Temperature Trip status */
-#define WD_REVC_RL2A           0x08    /* Relay 2 activated by on-board processor */
-#define WD_REVC_RL1A           0x10    /* Relay 1 active */
-#define WD_REVC_R2DS           0x40    /* Relay 2 disable */
-#define WD_REVC_RLY2           0x80    /* Relay 2 activated? */
-/* Port 2 : Control Status #2 */
-#define WD_WDIS                        0x10    /* Watchdog Disabled */
-#define WD_ENTP                        0x20    /* Watchdog Enable Temperature Trip */
-#define WD_SSEL                        0x40    /* Watchdog Switch Select (1:SW1 <-> 0:SW2) */
-#define WD_WCMD                        0x80    /* Watchdog Command Mode */
-
-/* max. time we give an ISA watchdog card to process a command */
-/* 500ms for each 4 bit response (according to spec.) */
-#define ISA_COMMAND_TIMEOUT     1000
-
-/* Watchdog's internal commands */
-#define CMD_ISA_IDLE                   0x00
-#define CMD_ISA_VERSION_INTEGER                0x01
-#define CMD_ISA_VERSION_TENTH          0x02
-#define CMD_ISA_VERSION_HUNDRETH       0x03
-#define CMD_ISA_VERSION_MINOR          0x04
-#define CMD_ISA_SWITCH_SETTINGS                0x05
-#define CMD_ISA_RESET_PC               0x06
-#define CMD_ISA_ARM_0                  0x07
-#define CMD_ISA_ARM_30                 0x08
-#define CMD_ISA_ARM_60                 0x09
-#define CMD_ISA_DELAY_TIME_2SECS       0x0A
-#define CMD_ISA_DELAY_TIME_4SECS       0x0B
-#define CMD_ISA_DELAY_TIME_8SECS       0x0C
-#define CMD_ISA_RESET_RELAYS           0x0D
-
-/* Watchdog's Dip Switch heartbeat values */
-static const int heartbeat_tbl [] = {
-       20,     /* OFF-OFF-OFF  = 20 Sec  */
-       40,     /* OFF-OFF-ON   = 40 Sec  */
-       60,     /* OFF-ON-OFF   =  1 Min  */
-       300,    /* OFF-ON-ON    =  5 Min  */
-       600,    /* ON-OFF-OFF   = 10 Min  */
-       1800,   /* ON-OFF-ON    = 30 Min  */
-       3600,   /* ON-ON-OFF    =  1 Hour */
-       7200,   /* ON-ON-ON     =  2 hour */
-};
-
-/*
- * We are using an kernel timer to do the pinging of the watchdog
- * every ~500ms. We try to set the internal heartbeat of the
- * watchdog to 2 ms.
- */
-
-#define WDT_INTERVAL (HZ/2+1)
-
-/* We can only use 1 card due to the /dev/watchdog restriction */
-static int cards_found;
-
-/* internal variables */
-static atomic_t open_allowed = ATOMIC_INIT(1);
-static char expect_close;
-static int temp_panic;
-static struct {                                /* this is private data for each ISA-PC watchdog card */
-       char fw_ver_str[6];             /* The cards firmware version */
-       int revision;                   /* The card's revision */
-       int supports_temp;              /* Wether or not the card has a temperature device */
-       int command_mode;               /* Wether or not the card is in command mode */
-       int boot_status;                /* The card's boot status */
-       int io_addr;                    /* The cards I/O address */
-       spinlock_t io_lock;             /* the lock for io operations */
-       struct timer_list timer;        /* The timer that pings the watchdog */
-       unsigned long next_heartbeat;   /* the next_heartbeat for the timer */
-} pcwd_private;
-
-/* module parameters */
-#define QUIET  0       /* Default */
-#define VERBOSE        1       /* Verbose */
-#define DEBUG  2       /* print fancy stuff too */
-static int debug = QUIET;
-module_param(debug, int, 0);
-MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");
-
-#define WATCHDOG_HEARTBEAT 0           /* default heartbeat = delay-time from dip-switches */
-static int heartbeat = WATCHDOG_HEARTBEAT;
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Internal functions
- */
-
-static int send_isa_command(int cmd)
-{
-       int i;
-       int control_status;
-       int port0, last_port0;  /* Double read for stabilising */
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "sending following data cmd=0x%02x\n",
-                       cmd);
-
-       /* The WCMD bit must be 1 and the command is only 4 bits in size */
-       control_status = (cmd & 0x0F) | WD_WCMD;
-       outb_p(control_status, pcwd_private.io_addr + 2);
-       udelay(ISA_COMMAND_TIMEOUT);
-
-       port0 = inb_p(pcwd_private.io_addr);
-       for (i = 0; i < 25; ++i) {
-               last_port0 = port0;
-               port0 = inb_p(pcwd_private.io_addr);
-
-               if (port0 == last_port0)
-                       break;  /* Data is stable */
-
-               udelay (250);
-       }
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n",
-                       cmd, port0, last_port0);
-
-       return port0;
-}
-
-static int set_command_mode(void)
-{
-       int i, found=0, count=0;
-
-       /* Set the card into command mode */
-       spin_lock(&pcwd_private.io_lock);
-       while ((!found) && (count < 3)) {
-               i = send_isa_command(CMD_ISA_IDLE);
-
-               if (i == 0x00)
-                       found = 1;
-               else if (i == 0xF3) {
-                       /* Card does not like what we've done to it */
-                       outb_p(0x00, pcwd_private.io_addr + 2);
-                       udelay(1200);   /* Spec says wait 1ms */
-                       outb_p(0x00, pcwd_private.io_addr + 2);
-                       udelay(ISA_COMMAND_TIMEOUT);
-               }
-               count++;
-       }
-       spin_unlock(&pcwd_private.io_lock);
-       pcwd_private.command_mode = found;
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "command_mode=%d\n",
-                               pcwd_private.command_mode);
-
-       return(found);
-}
-
-static void unset_command_mode(void)
-{
-       /* Set the card into normal mode */
-       spin_lock(&pcwd_private.io_lock);
-       outb_p(0x00, pcwd_private.io_addr + 2);
-       udelay(ISA_COMMAND_TIMEOUT);
-       spin_unlock(&pcwd_private.io_lock);
-
-       pcwd_private.command_mode = 0;
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "command_mode=%d\n",
-                               pcwd_private.command_mode);
-}
-
-static inline void pcwd_check_temperature_support(void)
-{
-       if (inb(pcwd_private.io_addr) != 0xF0)
-               pcwd_private.supports_temp = 1;
-}
-
-static inline void pcwd_get_firmware(void)
-{
-       int one, ten, hund, minor;
-
-       strcpy(pcwd_private.fw_ver_str, "ERROR");
-
-       if (set_command_mode()) {
-               one = send_isa_command(CMD_ISA_VERSION_INTEGER);
-               ten = send_isa_command(CMD_ISA_VERSION_TENTH);
-               hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH);
-               minor = send_isa_command(CMD_ISA_VERSION_MINOR);
-               sprintf(pcwd_private.fw_ver_str, "%c.%c%c%c", one, ten, hund, minor);
-       }
-       unset_command_mode();
-
-       return;
-}
-
-static inline int pcwd_get_option_switches(void)
-{
-       int option_switches=0;
-
-       if (set_command_mode()) {
-               /* Get switch settings */
-               option_switches = send_isa_command(CMD_ISA_SWITCH_SETTINGS);
-       }
-
-       unset_command_mode();
-       return(option_switches);
-}
-
-static void pcwd_show_card_info(void)
-{
-       int option_switches;
-
-       /* Get some extra info from the hardware (in command/debug/diag mode) */
-       if (pcwd_private.revision == PCWD_REVISION_A)
-               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", pcwd_private.io_addr);
-       else if (pcwd_private.revision == PCWD_REVISION_C) {
-               pcwd_get_firmware();
-               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n",
-                       pcwd_private.io_addr, pcwd_private.fw_ver_str);
-               option_switches = pcwd_get_option_switches();
-               printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
-                       option_switches,
-                       ((option_switches & 0x10) ? "ON" : "OFF"),
-                       ((option_switches & 0x08) ? "ON" : "OFF"));
-
-               /* Reprogram internal heartbeat to 2 seconds */
-               if (set_command_mode()) {
-                       send_isa_command(CMD_ISA_DELAY_TIME_2SECS);
-                       unset_command_mode();
-               }
-       }
-
-       if (pcwd_private.supports_temp)
-               printk(KERN_INFO PFX "Temperature Option Detected\n");
-
-       if (pcwd_private.boot_status & WDIOF_CARDRESET)
-               printk(KERN_INFO PFX "Previous reboot was caused by the card\n");
-
-       if (pcwd_private.boot_status & WDIOF_OVERHEAT) {
-               printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n");
-               printk(KERN_EMERG PFX "CPU Overheat\n");
-       }
-
-       if (pcwd_private.boot_status == 0)
-               printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
-}
-
-static void pcwd_timer_ping(unsigned long data)
-{
-       int wdrst_stat;
-
-       /* If we got a heartbeat pulse within the WDT_INTERVAL
-        * we agree to ping the WDT */
-       if(time_before(jiffies, pcwd_private.next_heartbeat)) {
-               /* Ping the watchdog */
-               spin_lock(&pcwd_private.io_lock);
-               if (pcwd_private.revision == PCWD_REVISION_A) {
-                       /*  Rev A cards are reset by setting the WD_WDRST bit in register 1 */
-                       wdrst_stat = inb_p(pcwd_private.io_addr);
-                       wdrst_stat &= 0x0F;
-                       wdrst_stat |= WD_WDRST;
-
-                       outb_p(wdrst_stat, pcwd_private.io_addr + 1);
-               } else {
-                       /* Re-trigger watchdog by writing to port 0 */
-                       outb_p(0x00, pcwd_private.io_addr);
-               }
-
-               /* Re-set the timer interval */
-               mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
-
-               spin_unlock(&pcwd_private.io_lock);
-       } else {
-               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
-       }
-}
-
-static int pcwd_start(void)
-{
-       int stat_reg;
-
-       pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
-
-       /* Start the timer */
-       mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
-
-       /* Enable the port */
-       if (pcwd_private.revision == PCWD_REVISION_C) {
-               spin_lock(&pcwd_private.io_lock);
-               outb_p(0x00, pcwd_private.io_addr + 3);
-               udelay(ISA_COMMAND_TIMEOUT);
-               stat_reg = inb_p(pcwd_private.io_addr + 2);
-               spin_unlock(&pcwd_private.io_lock);
-               if (stat_reg & WD_WDIS) {
-                       printk(KERN_INFO PFX "Could not start watchdog\n");
-                       return -EIO;
-               }
-       }
-
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "Watchdog started\n");
-
-       return 0;
-}
-
-static int pcwd_stop(void)
-{
-       int stat_reg;
-
-       /* Stop the timer */
-       del_timer(&pcwd_private.timer);
-
-       /*  Disable the board  */
-       if (pcwd_private.revision == PCWD_REVISION_C) {
-               spin_lock(&pcwd_private.io_lock);
-               outb_p(0xA5, pcwd_private.io_addr + 3);
-               udelay(ISA_COMMAND_TIMEOUT);
-               outb_p(0xA5, pcwd_private.io_addr + 3);
-               udelay(ISA_COMMAND_TIMEOUT);
-               stat_reg = inb_p(pcwd_private.io_addr + 2);
-               spin_unlock(&pcwd_private.io_lock);
-               if ((stat_reg & WD_WDIS) == 0) {
-                       printk(KERN_INFO PFX "Could not stop watchdog\n");
-                       return -EIO;
-               }
-       }
-
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "Watchdog stopped\n");
-
-       return 0;
-}
-
-static int pcwd_keepalive(void)
-{
-       /* user land ping */
-       pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n");
-
-       return 0;
-}
-
-static int pcwd_set_heartbeat(int t)
-{
-       if ((t < 2) || (t > 7200)) /* arbitrary upper limit */
-               return -EINVAL;
-
-       heartbeat = t;
-
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "New heartbeat: %d\n",
-                      heartbeat);
-
-       return 0;
-}
-
-static int pcwd_get_status(int *status)
-{
-       int control_status;
-
-       *status=0;
-       spin_lock(&pcwd_private.io_lock);
-       if (pcwd_private.revision == PCWD_REVISION_A)
-               /* Rev A cards return status information from
-                * the base register, which is used for the
-                * temperature in other cards. */
-               control_status = inb(pcwd_private.io_addr);
-       else {
-               /* Rev C cards return card status in the base
-                * address + 1 register. And use different bits
-                * to indicate a card initiated reset, and an
-                * over-temperature condition. And the reboot
-                * status can be reset. */
-               control_status = inb(pcwd_private.io_addr + 1);
-       }
-       spin_unlock(&pcwd_private.io_lock);
-
-       if (pcwd_private.revision == PCWD_REVISION_A) {
-               if (control_status & WD_WDRST)
-                       *status |= WDIOF_CARDRESET;
-
-               if (control_status & WD_T110) {
-                       *status |= WDIOF_OVERHEAT;
-                       if (temp_panic) {
-                               printk(KERN_INFO PFX "Temperature overheat trip!\n");
-                               kernel_power_off();
-                               /* or should we just do a: panic(PFX "Temperature overheat trip!\n"); */
-                       }
-               }
-       } else {
-               if (control_status & WD_REVC_WTRP)
-                       *status |= WDIOF_CARDRESET;
-
-               if (control_status & WD_REVC_TTRP) {
-                       *status |= WDIOF_OVERHEAT;
-                       if (temp_panic) {
-                               printk(KERN_INFO PFX "Temperature overheat trip!\n");
-                               kernel_power_off();
-                               /* or should we just do a: panic(PFX "Temperature overheat trip!\n"); */
-                       }
-               }
-       }
-
-       return 0;
-}
-
-static int pcwd_clear_status(void)
-{
-       int control_status;
-
-       if (pcwd_private.revision == PCWD_REVISION_C) {
-               spin_lock(&pcwd_private.io_lock);
-
-               if (debug >= VERBOSE)
-                       printk(KERN_INFO PFX "clearing watchdog trip status\n");
-
-               control_status = inb_p(pcwd_private.io_addr + 1);
-
-               if (debug >= DEBUG) {
-                       printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status);
-                       printk(KERN_DEBUG PFX "sending: 0x%02x\n",
-                               (control_status & WD_REVC_R2DS));
-               }
-
-               /* clear reset status & Keep Relay 2 disable state as it is */
-               outb_p((control_status & WD_REVC_R2DS), pcwd_private.io_addr + 1);
-
-               spin_unlock(&pcwd_private.io_lock);
-       }
-       return 0;
-}
-
-static int pcwd_get_temperature(int *temperature)
-{
-       /* check that port 0 gives temperature info and no command results */
-       if (pcwd_private.command_mode)
-               return -1;
-
-       *temperature = 0;
-       if (!pcwd_private.supports_temp)
-               return -ENODEV;
-
-       /*
-        * Convert celsius to fahrenheit, since this was
-        * the decided 'standard' for this return value.
-        */
-       spin_lock(&pcwd_private.io_lock);
-       *temperature = ((inb(pcwd_private.io_addr)) * 9 / 5) + 32;
-       spin_unlock(&pcwd_private.io_lock);
-
-       if (debug >= DEBUG) {
-               printk(KERN_DEBUG PFX "temperature is: %d F\n",
-                       *temperature);
-       }
-
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static int pcwd_ioctl(struct inode *inode, struct file *file,
-                     unsigned int cmd, unsigned long arg)
-{
-       int rv;
-       int status;
-       int temperature;
-       int new_heartbeat;
-       int __user *argp = (int __user *)arg;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_OVERHEAT |
-                                       WDIOF_CARDRESET |
-                                       WDIOF_KEEPALIVEPING |
-                                       WDIOF_SETTIMEOUT |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     1,
-               .identity =             "PCWD",
-       };
-
-       switch(cmd) {
-       default:
-               return -ENOTTY;
-
-       case WDIOC_GETSUPPORT:
-               if(copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               return 0;
-
-       case WDIOC_GETSTATUS:
-               pcwd_get_status(&status);
-               return put_user(status, argp);
-
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(pcwd_private.boot_status, argp);
-
-       case WDIOC_GETTEMP:
-               if (pcwd_get_temperature(&temperature))
-                       return -EFAULT;
-
-               return put_user(temperature, argp);
-
-       case WDIOC_SETOPTIONS:
-               if (pcwd_private.revision == PCWD_REVISION_C)
-               {
-                       if(copy_from_user(&rv, argp, sizeof(int)))
-                               return -EFAULT;
-
-                       if (rv & WDIOS_DISABLECARD)
-                       {
-                               return pcwd_stop();
-                       }
-
-                       if (rv & WDIOS_ENABLECARD)
-                       {
-                               return pcwd_start();
-                       }
-
-                       if (rv & WDIOS_TEMPPANIC)
-                       {
-                               temp_panic = 1;
-                       }
-               }
-               return -EINVAL;
-
-       case WDIOC_KEEPALIVE:
-               pcwd_keepalive();
-               return 0;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_heartbeat, argp))
-                       return -EFAULT;
-
-               if (pcwd_set_heartbeat(new_heartbeat))
-                       return -EINVAL;
-
-               pcwd_keepalive();
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(heartbeat, argp);
-       }
-
-       return 0;
-}
-
-static ssize_t pcwd_write(struct file *file, const char __user *buf, size_t len,
-                         loff_t *ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               pcwd_keepalive();
-       }
-       return len;
-}
-
-static int pcwd_open(struct inode *inode, struct file *file)
-{
-       if (!atomic_dec_and_test(&open_allowed) ) {
-               if (debug >= VERBOSE)
-                       printk(KERN_ERR PFX "Attempt to open already opened device.\n");
-               atomic_inc( &open_allowed );
-               return -EBUSY;
-       }
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Activate */
-       pcwd_start();
-       pcwd_keepalive();
-       return nonseekable_open(inode, file);
-}
-
-static int pcwd_close(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               pcwd_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               pcwd_keepalive();
-       }
-       expect_close = 0;
-       atomic_inc( &open_allowed );
-       return 0;
-}
-
-/*
- *     /dev/temperature handling
- */
-
-static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
-                        loff_t *ppos)
-{
-       int temperature;
-
-       if (pcwd_get_temperature(&temperature))
-               return -EFAULT;
-
-       if (copy_to_user(buf, &temperature, 1))
-               return -EFAULT;
-
-       return 1;
-}
-
-static int pcwd_temp_open(struct inode *inode, struct file *file)
-{
-       if (!pcwd_private.supports_temp)
-               return -ENODEV;
-
-       return nonseekable_open(inode, file);
-}
-
-static int pcwd_temp_close(struct inode *inode, struct file *file)
-{
-       return 0;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations pcwd_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = pcwd_write,
-       .ioctl          = pcwd_ioctl,
-       .open           = pcwd_open,
-       .release        = pcwd_close,
-};
-
-static struct miscdevice pcwd_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &pcwd_fops,
-};
-
-static const struct file_operations pcwd_temp_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .read           = pcwd_temp_read,
-       .open           = pcwd_temp_open,
-       .release        = pcwd_temp_close,
-};
-
-static struct miscdevice temp_miscdev = {
-       .minor =        TEMP_MINOR,
-       .name =         "temperature",
-       .fops =         &pcwd_temp_fops,
-};
-
-/*
- *     Init & exit routines
- */
-
-static inline int get_revision(void)
-{
-       int r = PCWD_REVISION_C;
-
-       spin_lock(&pcwd_private.io_lock);
-       /* REV A cards use only 2 io ports; test
-        * presumes a floating bus reads as 0xff. */
-       if ((inb(pcwd_private.io_addr + 2) == 0xFF) ||
-           (inb(pcwd_private.io_addr + 3) == 0xFF))
-               r=PCWD_REVISION_A;
-       spin_unlock(&pcwd_private.io_lock);
-
-       return r;
-}
-
-/*
- *  The ISA cards have a heartbeat bit in one of the registers, which
- *  register is card dependent.  The heartbeat bit is monitored, and if
- *  found, is considered proof that a Berkshire card has been found.
- *  The initial rate is once per second at board start up, then twice
- *  per second for normal operation.
- */
-static int __devinit pcwd_isa_match(struct device *dev, unsigned int id)
-{
-       int base_addr=pcwd_ioports[id];
-       int port0, last_port0;  /* Reg 0, in case it's REV A */
-       int port1, last_port1;  /* Register 1 for REV C cards */
-       int i;
-       int retval;
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "pcwd_isa_match id=%d\n",
-                       id);
-
-       if (!request_region (base_addr, 4, "PCWD")) {
-               printk(KERN_INFO PFX "Port 0x%04x unavailable\n", base_addr);
-               return 0;
-       }
-
-       retval = 0;
-
-       port0 = inb_p(base_addr);       /* For REV A boards */
-       port1 = inb_p(base_addr + 1);   /* For REV C boards */
-       if (port0 != 0xff || port1 != 0xff) {
-               /* Not an 'ff' from a floating bus, so must be a card! */
-               for (i = 0; i < 4; ++i) {
-
-                       msleep(500);
-
-                       last_port0 = port0;
-                       last_port1 = port1;
-
-                       port0 = inb_p(base_addr);
-                       port1 = inb_p(base_addr + 1);
-
-                       /* Has either hearbeat bit changed?  */
-                       if ((port0 ^ last_port0) & WD_HRTBT ||
-                           (port1 ^ last_port1) & WD_REVC_HRBT) {
-                               retval = 1;
-                               break;
-                       }
-               }
-       }
-       release_region (base_addr, 4);
-
-       return retval;
-}
-
-static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id)
-{
-       int ret;
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "pcwd_isa_probe id=%d\n",
-                       id);
-
-       cards_found++;
-       if (cards_found == 1)
-               printk(KERN_INFO PFX "v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
-
-       if (cards_found > 1) {
-               printk(KERN_ERR PFX "This driver only supports 1 device\n");
-               return -ENODEV;
-       }
-
-       if (pcwd_ioports[id] == 0x0000) {
-               printk(KERN_ERR PFX "No I/O-Address for card detected\n");
-               return -ENODEV;
-       }
-       pcwd_private.io_addr = pcwd_ioports[id];
-
-       spin_lock_init(&pcwd_private.io_lock);
-
-       /* Check card's revision */
-       pcwd_private.revision = get_revision();
-
-       if (!request_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) {
-               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       pcwd_private.io_addr);
-               ret=-EIO;
-               goto error_request_region;
-       }
-
-       /* Initial variables */
-       pcwd_private.supports_temp = 0;
-       temp_panic = 0;
-       pcwd_private.boot_status = 0x0000;
-
-       /* get the boot_status */
-       pcwd_get_status(&pcwd_private.boot_status);
-
-       /* clear the "card caused reboot" flag */
-       pcwd_clear_status();
-
-       setup_timer(&pcwd_private.timer, pcwd_timer_ping, 0);
-
-       /*  Disable the board  */
-       pcwd_stop();
-
-       /*  Check whether or not the card supports the temperature device */
-       pcwd_check_temperature_support();
-
-       /* Show info about the card itself */
-       pcwd_show_card_info();
-
-       /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
-       if (heartbeat == 0)
-               heartbeat = heartbeat_tbl[(pcwd_get_option_switches() & 0x07)];
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (pcwd_set_heartbeat(heartbeat)) {
-               pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
-               printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",
-                       WATCHDOG_HEARTBEAT);
-       }
-
-       if (pcwd_private.supports_temp) {
-               ret = misc_register(&temp_miscdev);
-               if (ret) {
-                       printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                               TEMP_MINOR, ret);
-                       goto error_misc_register_temp;
-               }
-       }
-
-       ret = misc_register(&pcwd_miscdev);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto error_misc_register_watchdog;
-       }
-
-       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
-               heartbeat, nowayout);
-
-       return 0;
-
-error_misc_register_watchdog:
-       if (pcwd_private.supports_temp)
-               misc_deregister(&temp_miscdev);
-error_misc_register_temp:
-       release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
-error_request_region:
-       pcwd_private.io_addr = 0x0000;
-       cards_found--;
-       return ret;
-}
-
-static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id)
-{
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "pcwd_isa_remove id=%d\n",
-                       id);
-
-       if (!pcwd_private.io_addr)
-               return 1;
-
-       /*  Disable the board  */
-       if (!nowayout)
-               pcwd_stop();
-
-       /* Deregister */
-       misc_deregister(&pcwd_miscdev);
-       if (pcwd_private.supports_temp)
-               misc_deregister(&temp_miscdev);
-       release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
-       pcwd_private.io_addr = 0x0000;
-       cards_found--;
-
-       return 0;
-}
-
-static void pcwd_isa_shutdown(struct device *dev, unsigned int id)
-{
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "pcwd_isa_shutdown id=%d\n",
-                       id);
-
-       pcwd_stop();
-}
-
-static struct isa_driver pcwd_isa_driver = {
-       .match          = pcwd_isa_match,
-       .probe          = pcwd_isa_probe,
-       .remove         = __devexit_p(pcwd_isa_remove),
-       .shutdown       = pcwd_isa_shutdown,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = WATCHDOG_NAME,
-       },
-};
-
-static int __init pcwd_init_module(void)
-{
-       return isa_register_driver(&pcwd_isa_driver, PCWD_ISA_NR_CARDS);
-}
-
-static void __exit pcwd_cleanup_module(void)
-{
-       isa_unregister_driver(&pcwd_isa_driver);
-       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
-}
-
-module_init(pcwd_init_module);
-module_exit(pcwd_cleanup_module);
-
-MODULE_AUTHOR("Ken Hollis <kenji@bitgate.com>, Wim Van Sebroeck <wim@iguana.be>");
-MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver");
-MODULE_VERSION(WATCHDOG_VERSION);
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS_MISCDEV(TEMP_MINOR);
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
deleted file mode 100644 (file)
index 61a89e9..0000000
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- *     Berkshire PCI-PC Watchdog Card Driver
- *
- *     (c) Copyright 2003-2007 Wim Van Sebroeck <wim@iguana.be>.
- *
- *     Based on source code of the following authors:
- *       Ken Hollis <kenji@bitgate.com>,
- *       Lindsay Harris <lindsay@bluegum.com>,
- *       Alan Cox <alan@redhat.com>,
- *       Matt Domsch <Matt_Domsch@dell.com>,
- *       Rob Radez <rob@osinvestor.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
- *     provide warranty for any of this software. This material is
- *     provided "AS-IS" and at no charge.
- */
-
-/*
- *     A bells and whistles driver is available from:
- *     http://www.kernel.org/pub/linux/kernel/people/wim/pcwd/pcwd_pci/
- *
- *     More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
- */
-
-/*
- *     Includes, defines, variables, module parameters, ...
- */
-
-#include <linux/module.h>      /* For module specific items */
-#include <linux/moduleparam.h> /* For new moduleparam's */
-#include <linux/types.h>       /* For standard types (like size_t) */
-#include <linux/errno.h>       /* For the -ENODEV/... values */
-#include <linux/kernel.h>      /* For printk/panic/... */
-#include <linux/delay.h>       /* For mdelay function */
-#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
-#include <linux/watchdog.h>    /* For the watchdog specific items */
-#include <linux/notifier.h>    /* For notifier support */
-#include <linux/reboot.h>      /* For reboot_notifier stuff */
-#include <linux/init.h>                /* For __init/__exit/... */
-#include <linux/fs.h>          /* For file operations */
-#include <linux/pci.h>         /* For pci functions */
-#include <linux/ioport.h>      /* For io-port access */
-#include <linux/spinlock.h>    /* For spin_lock/spin_unlock/... */
-
-#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
-#include <asm/io.h>            /* For inb/outb/... */
-
-/* Module and version information */
-#define WATCHDOG_VERSION "1.03"
-#define WATCHDOG_DATE "21 Jan 2007"
-#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
-#define WATCHDOG_NAME "pcwd_pci"
-#define PFX WATCHDOG_NAME ": "
-#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n"
-
-/* Stuff for the PCI ID's  */
-#ifndef PCI_VENDOR_ID_QUICKLOGIC
-#define PCI_VENDOR_ID_QUICKLOGIC    0x11e3
-#endif
-
-#ifndef PCI_DEVICE_ID_WATCHDOG_PCIPCWD
-#define PCI_DEVICE_ID_WATCHDOG_PCIPCWD 0x5030
-#endif
-
-/*
- * These are the defines that describe the control status bits for the
- * PCI-PC Watchdog card.
- */
-/* Port 1 : Control Status #1 */
-#define WD_PCI_WTRP            0x01    /* Watchdog Trip status */
-#define WD_PCI_HRBT            0x02    /* Watchdog Heartbeat */
-#define WD_PCI_TTRP            0x04    /* Temperature Trip status */
-#define WD_PCI_RL2A            0x08    /* Relay 2 Active */
-#define WD_PCI_RL1A            0x10    /* Relay 1 Active */
-#define WD_PCI_R2DS            0x40    /* Relay 2 Disable Temperature-trip/reset */
-#define WD_PCI_RLY2            0x80    /* Activate Relay 2 on the board */
-/* Port 2 : Control Status #2 */
-#define WD_PCI_WDIS            0x10    /* Watchdog Disable */
-#define WD_PCI_ENTP            0x20    /* Enable Temperature Trip Reset */
-#define WD_PCI_WRSP            0x40    /* Watchdog wrote response */
-#define WD_PCI_PCMD            0x80    /* PC has sent command */
-
-/* according to documentation max. time to process a command for the pci
- * watchdog card is 100 ms, so we give it 150 ms to do it's job */
-#define PCI_COMMAND_TIMEOUT    150
-
-/* Watchdog's internal commands */
-#define CMD_GET_STATUS                         0x04
-#define CMD_GET_FIRMWARE_VERSION               0x08
-#define CMD_READ_WATCHDOG_TIMEOUT              0x18
-#define CMD_WRITE_WATCHDOG_TIMEOUT             0x19
-#define CMD_GET_CLEAR_RESET_COUNT              0x84
-
-/* Watchdog's Dip Switch heartbeat values */
-static const int heartbeat_tbl [] = {
-       5,      /* OFF-OFF-OFF  =  5 Sec  */
-       10,     /* OFF-OFF-ON   = 10 Sec  */
-       30,     /* OFF-ON-OFF   = 30 Sec  */
-       60,     /* OFF-ON-ON    =  1 Min  */
-       300,    /* ON-OFF-OFF   =  5 Min  */
-       600,    /* ON-OFF-ON    = 10 Min  */
-       1800,   /* ON-ON-OFF    = 30 Min  */
-       3600,   /* ON-ON-ON     =  1 hour */
-};
-
-/* We can only use 1 card due to the /dev/watchdog restriction */
-static int cards_found;
-
-/* internal variables */
-static int temp_panic;
-static unsigned long is_active;
-static char expect_release;
-static struct {                                /* this is private data for each PCI-PC watchdog card */
-       int supports_temp;              /* Wether or not the card has a temperature device */
-       int boot_status;                /* The card's boot status */
-       unsigned long io_addr;          /* The cards I/O address */
-       spinlock_t io_lock;             /* the lock for io operations */
-       struct pci_dev *pdev;           /* the PCI-device */
-} pcipcwd_private;
-
-/* module parameters */
-#define QUIET  0       /* Default */
-#define VERBOSE        1       /* Verbose */
-#define DEBUG  2       /* print fancy stuff too */
-static int debug = QUIET;
-module_param(debug, int, 0);
-MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");
-
-#define WATCHDOG_HEARTBEAT 0   /* default heartbeat = delay-time from dip-switches */
-static int heartbeat = WATCHDOG_HEARTBEAT;
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Internal functions
- */
-
-static int send_command(int cmd, int *msb, int *lsb)
-{
-       int got_response, count;
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n",
-               cmd, *msb, *lsb);
-
-       spin_lock(&pcipcwd_private.io_lock);
-       /* If a command requires data it should be written first.
-        * Data for commands with 8 bits of data should be written to port 4.
-        * Commands with 16 bits of data, should be written as LSB to port 4
-        * and MSB to port 5.
-        * After the required data has been written then write the command to
-        * port 6. */
-       outb_p(*lsb, pcipcwd_private.io_addr + 4);
-       outb_p(*msb, pcipcwd_private.io_addr + 5);
-       outb_p(cmd, pcipcwd_private.io_addr + 6);
-
-       /* wait till the pci card processed the command, signaled by
-        * the WRSP bit in port 2 and give it a max. timeout of
-        * PCI_COMMAND_TIMEOUT to process */
-       got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
-       for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) {
-               mdelay(1);
-               got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
-       }
-
-       if (debug >= DEBUG) {
-               if (got_response) {
-                       printk(KERN_DEBUG PFX "time to process command was: %d ms\n",
-                               count);
-               } else {
-                       printk(KERN_DEBUG PFX "card did not respond on command!\n");
-               }
-       }
-
-       if (got_response) {
-               /* read back response */
-               *lsb = inb_p(pcipcwd_private.io_addr + 4);
-               *msb = inb_p(pcipcwd_private.io_addr + 5);
-
-               /* clear WRSP bit */
-               inb_p(pcipcwd_private.io_addr + 6);
-
-               if (debug >= DEBUG)
-                       printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n",
-                               cmd, *msb, *lsb);
-       }
-
-       spin_unlock(&pcipcwd_private.io_lock);
-
-       return got_response;
-}
-
-static inline void pcipcwd_check_temperature_support(void)
-{
-       if (inb_p(pcipcwd_private.io_addr) != 0xF0)
-               pcipcwd_private.supports_temp = 1;
-}
-
-static int pcipcwd_get_option_switches(void)
-{
-       int option_switches;
-
-       option_switches = inb_p(pcipcwd_private.io_addr + 3);
-       return option_switches;
-}
-
-static void pcipcwd_show_card_info(void)
-{
-       int got_fw_rev, fw_rev_major, fw_rev_minor;
-       char fw_ver_str[20];            /* The cards firmware version */
-       int option_switches;
-
-       got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
-       if (got_fw_rev) {
-               sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
-       } else {
-               sprintf(fw_ver_str, "<card no answer>");
-       }
-
-       /* Get switch settings */
-       option_switches = pcipcwd_get_option_switches();
-
-       printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n",
-               (int) pcipcwd_private.io_addr, fw_ver_str,
-               (pcipcwd_private.supports_temp ? "with" : "without"));
-
-       printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
-               option_switches,
-               ((option_switches & 0x10) ? "ON" : "OFF"),
-               ((option_switches & 0x08) ? "ON" : "OFF"));
-
-       if (pcipcwd_private.boot_status & WDIOF_CARDRESET)
-               printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n");
-
-       if (pcipcwd_private.boot_status & WDIOF_OVERHEAT)
-               printk(KERN_INFO PFX "Card sensed a CPU Overheat\n");
-
-       if (pcipcwd_private.boot_status == 0)
-               printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
-}
-
-static int pcipcwd_start(void)
-{
-       int stat_reg;
-
-       spin_lock(&pcipcwd_private.io_lock);
-       outb_p(0x00, pcipcwd_private.io_addr + 3);
-       udelay(1000);
-
-       stat_reg = inb_p(pcipcwd_private.io_addr + 2);
-       spin_unlock(&pcipcwd_private.io_lock);
-
-       if (stat_reg & WD_PCI_WDIS) {
-               printk(KERN_ERR PFX "Card timer not enabled\n");
-               return -1;
-       }
-
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "Watchdog started\n");
-
-       return 0;
-}
-
-static int pcipcwd_stop(void)
-{
-       int stat_reg;
-
-       spin_lock(&pcipcwd_private.io_lock);
-       outb_p(0xA5, pcipcwd_private.io_addr + 3);
-       udelay(1000);
-
-       outb_p(0xA5, pcipcwd_private.io_addr + 3);
-       udelay(1000);
-
-       stat_reg = inb_p(pcipcwd_private.io_addr + 2);
-       spin_unlock(&pcipcwd_private.io_lock);
-
-       if (!(stat_reg & WD_PCI_WDIS)) {
-               printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n");
-               return -1;
-       }
-
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "Watchdog stopped\n");
-
-       return 0;
-}
-
-static int pcipcwd_keepalive(void)
-{
-       /* Re-trigger watchdog by writing to port 0 */
-       spin_lock(&pcipcwd_private.io_lock);
-       outb_p(0x42, pcipcwd_private.io_addr);  /* send out any data */
-       spin_unlock(&pcipcwd_private.io_lock);
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n");
-
-       return 0;
-}
-
-static int pcipcwd_set_heartbeat(int t)
-{
-       int t_msb = t / 256;
-       int t_lsb = t % 256;
-
-       if ((t < 0x0001) || (t > 0xFFFF))
-               return -EINVAL;
-
-       /* Write new heartbeat to watchdog */
-       send_command(CMD_WRITE_WATCHDOG_TIMEOUT, &t_msb, &t_lsb);
-
-       heartbeat = t;
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "New heartbeat: %d\n",
-                      heartbeat);
-
-       return 0;
-}
-
-static int pcipcwd_get_status(int *status)
-{
-       int control_status;
-
-       *status=0;
-       control_status = inb_p(pcipcwd_private.io_addr + 1);
-       if (control_status & WD_PCI_WTRP)
-               *status |= WDIOF_CARDRESET;
-       if (control_status & WD_PCI_TTRP) {
-               *status |= WDIOF_OVERHEAT;
-               if (temp_panic)
-                       panic(PFX "Temperature overheat trip!\n");
-       }
-
-       if (debug >= DEBUG)
-               printk(KERN_DEBUG PFX "Control Status #1: 0x%02x\n",
-                      control_status);
-
-       return 0;
-}
-
-static int pcipcwd_clear_status(void)
-{
-       int control_status;
-       int msb;
-       int reset_counter;
-
-       if (debug >= VERBOSE)
-               printk(KERN_INFO PFX "clearing watchdog trip status & LED\n");
-
-       control_status = inb_p(pcipcwd_private.io_addr + 1);
-
-       if (debug >= DEBUG) {
-               printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status);
-               printk(KERN_DEBUG PFX "sending: 0x%02x\n",
-                      (control_status & WD_PCI_R2DS) | WD_PCI_WTRP);
-       }
-
-       /* clear trip status & LED and keep mode of relay 2 */
-       outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1);
-
-       /* clear reset counter */
-       msb=0;
-       reset_counter=0xff;
-       send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter);
-
-       if (debug >= DEBUG) {
-               printk(KERN_DEBUG PFX "reset count was: 0x%02x\n",
-                      reset_counter);
-       }
-
-       return 0;
-}
-
-static int pcipcwd_get_temperature(int *temperature)
-{
-       *temperature = 0;
-       if (!pcipcwd_private.supports_temp)
-               return -ENODEV;
-
-       spin_lock(&pcipcwd_private.io_lock);
-       *temperature = inb_p(pcipcwd_private.io_addr);
-       spin_unlock(&pcipcwd_private.io_lock);
-
-       /*
-        * Convert celsius to fahrenheit, since this was
-        * the decided 'standard' for this return value.
-        */
-       *temperature = (*temperature * 9 / 5) + 32;
-
-       if (debug >= DEBUG) {
-               printk(KERN_DEBUG PFX "temperature is: %d F\n",
-                      *temperature);
-       }
-
-       return 0;
-}
-
-static int pcipcwd_get_timeleft(int *time_left)
-{
-       int msb;
-       int lsb;
-
-       /* Read the time that's left before rebooting */
-       /* Note: if the board is not yet armed then we will read 0xFFFF */
-       send_command(CMD_READ_WATCHDOG_TIMEOUT, &msb, &lsb);
-
-       *time_left = (msb << 8) + lsb;
-
-       if (debug >= VERBOSE)
-               printk(KERN_DEBUG PFX "Time left before next reboot: %d\n",
-                      *time_left);
-
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static ssize_t pcipcwd_write(struct file *file, const char __user *data,
-                            size_t len, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       expect_release = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if(get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_release = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               pcipcwd_keepalive();
-       }
-       return len;
-}
-
-static int pcipcwd_ioctl(struct inode *inode, struct file *file,
-                         unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_OVERHEAT |
-                                       WDIOF_CARDRESET |
-                                       WDIOF_KEEPALIVEPING |
-                                       WDIOF_SETTIMEOUT |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     1,
-               .identity =             WATCHDOG_DRIVER_NAME,
-       };
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof (ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               {
-                       int status;
-
-                       pcipcwd_get_status(&status);
-
-                       return put_user(status, p);
-               }
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(pcipcwd_private.boot_status, p);
-
-               case WDIOC_GETTEMP:
-               {
-                       int temperature;
-
-                       if (pcipcwd_get_temperature(&temperature))
-                               return -EFAULT;
-
-                       return put_user(temperature, p);
-               }
-
-               case WDIOC_KEEPALIVE:
-                       pcipcwd_keepalive();
-                       return 0;
-
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if (get_user (new_options, p))
-                               return -EFAULT;
-
-                       if (new_options & WDIOS_DISABLECARD) {
-                               if (pcipcwd_stop())
-                                       return -EIO;
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_ENABLECARD) {
-                               if (pcipcwd_start())
-                                       return -EIO;
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_TEMPPANIC) {
-                               temp_panic = 1;
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_heartbeat;
-
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (pcipcwd_set_heartbeat(new_heartbeat))
-                           return -EINVAL;
-
-                       pcipcwd_keepalive();
-                       /* Fall */
-               }
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-
-               case WDIOC_GETTIMELEFT:
-               {
-                       int time_left;
-
-                       if (pcipcwd_get_timeleft(&time_left))
-                               return -EFAULT;
-
-                       return put_user(time_left, p);
-               }
-
-               default:
-                       return -ENOTTY;
-       }
-}
-
-static int pcipcwd_open(struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-       if (test_and_set_bit(0, &is_active)) {
-               if (debug >= VERBOSE)
-                       printk(KERN_ERR PFX "Attempt to open already opened device.\n");
-               return -EBUSY;
-       }
-
-       /* Activate */
-       pcipcwd_start();
-       pcipcwd_keepalive();
-       return nonseekable_open(inode, file);
-}
-
-static int pcipcwd_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        */
-       if (expect_release == 42) {
-               pcipcwd_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               pcipcwd_keepalive();
-       }
-       expect_release = 0;
-       clear_bit(0, &is_active);
-       return 0;
-}
-
-/*
- *     /dev/temperature handling
- */
-
-static ssize_t pcipcwd_temp_read(struct file *file, char __user *data,
-                               size_t len, loff_t *ppos)
-{
-       int temperature;
-
-       if (pcipcwd_get_temperature(&temperature))
-               return -EFAULT;
-
-       if (copy_to_user (data, &temperature, 1))
-               return -EFAULT;
-
-       return 1;
-}
-
-static int pcipcwd_temp_open(struct inode *inode, struct file *file)
-{
-       if (!pcipcwd_private.supports_temp)
-               return -ENODEV;
-
-       return nonseekable_open(inode, file);
-}
-
-static int pcipcwd_temp_release(struct inode *inode, struct file *file)
-{
-       return 0;
-}
-
-/*
- *     Notify system
- */
-
-static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the WDT off */
-               pcipcwd_stop();
-       }
-
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations pcipcwd_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .write =        pcipcwd_write,
-       .ioctl =        pcipcwd_ioctl,
-       .open =         pcipcwd_open,
-       .release =      pcipcwd_release,
-};
-
-static struct miscdevice pcipcwd_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &pcipcwd_fops,
-};
-
-static const struct file_operations pcipcwd_temp_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .read =         pcipcwd_temp_read,
-       .open =         pcipcwd_temp_open,
-       .release =      pcipcwd_temp_release,
-};
-
-static struct miscdevice pcipcwd_temp_miscdev = {
-       .minor =        TEMP_MINOR,
-       .name =         "temperature",
-       .fops =         &pcipcwd_temp_fops,
-};
-
-static struct notifier_block pcipcwd_notifier = {
-       .notifier_call =        pcipcwd_notify_sys,
-};
-
-/*
- *     Init & exit routines
- */
-
-static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
-               const struct pci_device_id *ent)
-{
-       int ret = -EIO;
-
-       cards_found++;
-       if (cards_found == 1)
-               printk(KERN_INFO PFX DRIVER_VERSION);
-
-       if (cards_found > 1) {
-               printk(KERN_ERR PFX "This driver only supports 1 device\n");
-               return -ENODEV;
-       }
-
-       if (pci_enable_device(pdev)) {
-               printk(KERN_ERR PFX "Not possible to enable PCI Device\n");
-               return -ENODEV;
-       }
-
-       if (pci_resource_start(pdev, 0) == 0x0000) {
-               printk(KERN_ERR PFX "No I/O-Address for card detected\n");
-               ret = -ENODEV;
-               goto err_out_disable_device;
-       }
-
-       pcipcwd_private.pdev = pdev;
-       pcipcwd_private.io_addr = pci_resource_start(pdev, 0);
-
-       if (pci_request_regions(pdev, WATCHDOG_NAME)) {
-               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       (int) pcipcwd_private.io_addr);
-               ret = -EIO;
-               goto err_out_disable_device;
-       }
-
-       /* get the boot_status */
-       pcipcwd_get_status(&pcipcwd_private.boot_status);
-
-       /* clear the "card caused reboot" flag */
-       pcipcwd_clear_status();
-
-       /* disable card */
-       pcipcwd_stop();
-
-       /* Check whether or not the card supports the temperature device */
-       pcipcwd_check_temperature_support();
-
-       /* Show info about the card itself */
-       pcipcwd_show_card_info();
-
-       /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
-       if (heartbeat == 0)
-               heartbeat = heartbeat_tbl[(pcipcwd_get_option_switches() & 0x07)];
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (pcipcwd_set_heartbeat(heartbeat)) {
-               pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
-               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-                       WATCHDOG_HEARTBEAT);
-       }
-
-       ret = register_reboot_notifier(&pcipcwd_notifier);
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               goto err_out_release_region;
-       }
-
-       if (pcipcwd_private.supports_temp) {
-               ret = misc_register(&pcipcwd_temp_miscdev);
-               if (ret != 0) {
-                       printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                               TEMP_MINOR, ret);
-                       goto err_out_unregister_reboot;
-               }
-       }
-
-       ret = misc_register(&pcipcwd_miscdev);
-       if (ret != 0) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto err_out_misc_deregister;
-       }
-
-       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
-               heartbeat, nowayout);
-
-       return 0;
-
-err_out_misc_deregister:
-       if (pcipcwd_private.supports_temp)
-               misc_deregister(&pcipcwd_temp_miscdev);
-err_out_unregister_reboot:
-       unregister_reboot_notifier(&pcipcwd_notifier);
-err_out_release_region:
-       pci_release_regions(pdev);
-err_out_disable_device:
-       pci_disable_device(pdev);
-       return ret;
-}
-
-static void __devexit pcipcwd_card_exit(struct pci_dev *pdev)
-{
-       /* Stop the timer before we leave */
-       if (!nowayout)
-               pcipcwd_stop();
-
-       /* Deregister */
-       misc_deregister(&pcipcwd_miscdev);
-       if (pcipcwd_private.supports_temp)
-               misc_deregister(&pcipcwd_temp_miscdev);
-       unregister_reboot_notifier(&pcipcwd_notifier);
-       pci_release_regions(pdev);
-       pci_disable_device(pdev);
-       cards_found--;
-}
-
-static struct pci_device_id pcipcwd_pci_tbl[] = {
-       { PCI_VENDOR_ID_QUICKLOGIC, PCI_DEVICE_ID_WATCHDOG_PCIPCWD,
-               PCI_ANY_ID, PCI_ANY_ID, },
-       { 0 },                  /* End of list */
-};
-MODULE_DEVICE_TABLE(pci, pcipcwd_pci_tbl);
-
-static struct pci_driver pcipcwd_driver = {
-       .name           = WATCHDOG_NAME,
-       .id_table       = pcipcwd_pci_tbl,
-       .probe          = pcipcwd_card_init,
-       .remove         = __devexit_p(pcipcwd_card_exit),
-};
-
-static int __init pcipcwd_init_module(void)
-{
-       spin_lock_init(&pcipcwd_private.io_lock);
-
-       return pci_register_driver(&pcipcwd_driver);
-}
-
-static void __exit pcipcwd_cleanup_module(void)
-{
-       pci_unregister_driver(&pcipcwd_driver);
-
-       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
-}
-
-module_init(pcipcwd_init_module);
-module_exit(pcipcwd_cleanup_module);
-
-MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>");
-MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS_MISCDEV(TEMP_MINOR);
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
deleted file mode 100644 (file)
index 0f3fd6c..0000000
+++ /dev/null
@@ -1,824 +0,0 @@
-/*
- *     Berkshire USB-PC Watchdog Card Driver
- *
- *     (c) Copyright 2004-2007 Wim Van Sebroeck <wim@iguana.be>.
- *
- *     Based on source code of the following authors:
- *       Ken Hollis <kenji@bitgate.com>,
- *       Alan Cox <alan@redhat.com>,
- *       Matt Domsch <Matt_Domsch@dell.com>,
- *       Rob Radez <rob@osinvestor.com>,
- *       Greg Kroah-Hartman <greg@kroah.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
- *     provide warranty for any of this software. This material is
- *     provided "AS-IS" and at no charge.
- *
- *     Thanks also to Simon Machell at Berkshire Products Inc. for
- *     providing the test hardware. More info is available at
- *     http://www.berkprod.com/ or http://www.pcwatchdog.com/
- */
-
-#include <linux/module.h>      /* For module specific items */
-#include <linux/moduleparam.h> /* For new moduleparam's */
-#include <linux/types.h>       /* For standard types (like size_t) */
-#include <linux/errno.h>       /* For the -ENODEV/... values */
-#include <linux/kernel.h>      /* For printk/panic/... */
-#include <linux/delay.h>       /* For mdelay function */
-#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
-#include <linux/watchdog.h>    /* For the watchdog specific items */
-#include <linux/notifier.h>    /* For notifier support */
-#include <linux/reboot.h>      /* For reboot_notifier stuff */
-#include <linux/init.h>                /* For __init/__exit/... */
-#include <linux/fs.h>          /* For file operations */
-#include <linux/usb.h>         /* For USB functions */
-#include <linux/slab.h>                /* For kmalloc, ... */
-#include <linux/mutex.h>       /* For mutex locking */
-#include <linux/hid.h>         /* For HID_REQ_SET_REPORT & HID_DT_REPORT */
-
-#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
-
-
-#ifdef CONFIG_USB_DEBUG
-       static int debug = 1;
-#else
-       static int debug;
-#endif
-
-/* Use our own dbg macro */
-#undef dbg
-#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG PFX format "\n" , ## arg); } while (0)
-
-
-/* Module and Version Information */
-#define DRIVER_VERSION "1.02"
-#define DRIVER_DATE "21 Jan 2007"
-#define DRIVER_AUTHOR "Wim Van Sebroeck <wim@iguana.be>"
-#define DRIVER_DESC "Berkshire USB-PC Watchdog driver"
-#define DRIVER_LICENSE "GPL"
-#define DRIVER_NAME "pcwd_usb"
-#define PFX DRIVER_NAME ": "
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE(DRIVER_LICENSE);
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS_MISCDEV(TEMP_MINOR);
-
-/* Module Parameters */
-module_param(debug, int, 0);
-MODULE_PARM_DESC(debug, "Debug enabled or not");
-
-#define WATCHDOG_HEARTBEAT 0   /* default heartbeat = delay-time from dip-switches */
-static int heartbeat = WATCHDOG_HEARTBEAT;
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/* The vendor and product id's for the USB-PC Watchdog card */
-#define USB_PCWD_VENDOR_ID     0x0c98
-#define USB_PCWD_PRODUCT_ID    0x1140
-
-/* table of devices that work with this driver */
-static struct usb_device_id usb_pcwd_table [] = {
-       { USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) },
-       { }                                     /* Terminating entry */
-};
-MODULE_DEVICE_TABLE (usb, usb_pcwd_table);
-
-/* according to documentation max. time to process a command for the USB
- * watchdog card is 100 or 200 ms, so we give it 250 ms to do it's job */
-#define USB_COMMAND_TIMEOUT    250
-
-/* Watchdog's internal commands */
-#define CMD_READ_TEMP                  0x02    /* Read Temperature; Re-trigger Watchdog */
-#define CMD_TRIGGER                    CMD_READ_TEMP
-#define CMD_GET_STATUS                 0x04    /* Get Status Information */
-#define CMD_GET_FIRMWARE_VERSION       0x08    /* Get Firmware Version */
-#define CMD_GET_DIP_SWITCH_SETTINGS    0x0c    /* Get Dip Switch Settings */
-#define CMD_READ_WATCHDOG_TIMEOUT      0x18    /* Read Current Watchdog Time */
-#define CMD_WRITE_WATCHDOG_TIMEOUT     0x19    /* Write Current Watchdog Time */
-#define CMD_ENABLE_WATCHDOG            0x30    /* Enable / Disable Watchdog */
-#define CMD_DISABLE_WATCHDOG           CMD_ENABLE_WATCHDOG
-
-/* Watchdog's Dip Switch heartbeat values */
-static const int heartbeat_tbl [] = {
-       5,      /* OFF-OFF-OFF  =  5 Sec  */
-       10,     /* OFF-OFF-ON   = 10 Sec  */
-       30,     /* OFF-ON-OFF   = 30 Sec  */
-       60,     /* OFF-ON-ON    =  1 Min  */
-       300,    /* ON-OFF-OFF   =  5 Min  */
-       600,    /* ON-OFF-ON    = 10 Min  */
-       1800,   /* ON-ON-OFF    = 30 Min  */
-       3600,   /* ON-ON-ON     =  1 hour */
-};
-
-/* We can only use 1 card due to the /dev/watchdog restriction */
-static int cards_found;
-
-/* some internal variables */
-static unsigned long is_active;
-static char expect_release;
-
-/* Structure to hold all of our device specific stuff */
-struct usb_pcwd_private {
-       struct usb_device *     udev;                   /* save off the usb device pointer */
-       struct usb_interface *  interface;              /* the interface for this device */
-
-       unsigned int            interface_number;       /* the interface number used for cmd's */
-
-       unsigned char *         intr_buffer;            /* the buffer to intr data */
-       dma_addr_t              intr_dma;               /* the dma address for the intr buffer */
-       size_t                  intr_size;              /* the size of the intr buffer */
-       struct urb *            intr_urb;               /* the urb used for the intr pipe */
-
-       unsigned char           cmd_command;            /* The command that is reported back */
-       unsigned char           cmd_data_msb;           /* The data MSB that is reported back */
-       unsigned char           cmd_data_lsb;           /* The data LSB that is reported back */
-       atomic_t                cmd_received;           /* true if we received a report after a command */
-
-       int                     exists;                 /* Wether or not the device exists */
-       struct mutex            mtx;                    /* locks this structure */
-};
-static struct usb_pcwd_private *usb_pcwd_device;
-
-/* prevent races between open() and disconnect() */
-static DEFINE_MUTEX(disconnect_mutex);
-
-/* local function prototypes */
-static int usb_pcwd_probe      (struct usb_interface *interface, const struct usb_device_id *id);
-static void usb_pcwd_disconnect        (struct usb_interface *interface);
-
-/* usb specific object needed to register this driver with the usb subsystem */
-static struct usb_driver usb_pcwd_driver = {
-       .name =         DRIVER_NAME,
-       .probe =        usb_pcwd_probe,
-       .disconnect =   usb_pcwd_disconnect,
-       .id_table =     usb_pcwd_table,
-};
-
-
-static void usb_pcwd_intr_done(struct urb *urb)
-{
-       struct usb_pcwd_private *usb_pcwd = (struct usb_pcwd_private *)urb->context;
-       unsigned char *data = usb_pcwd->intr_buffer;
-       int retval;
-
-       switch (urb->status) {
-       case 0:                 /* success */
-               break;
-       case -ECONNRESET:       /* unlink */
-       case -ENOENT:
-       case -ESHUTDOWN:
-               /* this urb is terminated, clean up */
-               dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
-               return;
-       /* -EPIPE:  should clear the halt */
-       default:                /* error */
-               dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
-               goto resubmit;
-       }
-
-       dbg("received following data cmd=0x%02x msb=0x%02x lsb=0x%02x",
-               data[0], data[1], data[2]);
-
-       usb_pcwd->cmd_command  = data[0];
-       usb_pcwd->cmd_data_msb = data[1];
-       usb_pcwd->cmd_data_lsb = data[2];
-
-       /* notify anyone waiting that the cmd has finished */
-       atomic_set (&usb_pcwd->cmd_received, 1);
-
-resubmit:
-       retval = usb_submit_urb (urb, GFP_ATOMIC);
-       if (retval)
-               printk(KERN_ERR PFX "can't resubmit intr, usb_submit_urb failed with result %d\n",
-                       retval);
-}
-
-static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, unsigned char cmd,
-       unsigned char *msb, unsigned char *lsb)
-{
-       int got_response, count;
-       unsigned char buf[6];
-
-       /* We will not send any commands if the USB PCWD device does not exist */
-       if ((!usb_pcwd) || (!usb_pcwd->exists))
-               return -1;
-
-       /* The USB PC Watchdog uses a 6 byte report format. The board currently uses
-        * only 3 of the six bytes of the report. */
-       buf[0] = cmd;                   /* Byte 0 = CMD */
-       buf[1] = *msb;                  /* Byte 1 = Data MSB */
-       buf[2] = *lsb;                  /* Byte 2 = Data LSB */
-       buf[3] = buf[4] = buf[5] = 0;   /* All other bytes not used */
-
-       dbg("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x",
-               buf[0], buf[1], buf[2]);
-
-       atomic_set (&usb_pcwd->cmd_received, 0);
-
-       if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
-                       HID_REQ_SET_REPORT, HID_DT_REPORT,
-                       0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
-                       USB_COMMAND_TIMEOUT) != sizeof(buf)) {
-               dbg("usb_pcwd_send_command: error in usb_control_msg for cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
-       }
-       /* wait till the usb card processed the command,
-        * with a max. timeout of USB_COMMAND_TIMEOUT */
-       got_response = 0;
-       for (count = 0; (count < USB_COMMAND_TIMEOUT) && (!got_response); count++) {
-               mdelay(1);
-               if (atomic_read (&usb_pcwd->cmd_received))
-                       got_response = 1;
-       }
-
-       if ((got_response) && (cmd == usb_pcwd->cmd_command)) {
-               /* read back response */
-               *msb = usb_pcwd->cmd_data_msb;
-               *lsb = usb_pcwd->cmd_data_lsb;
-       }
-
-       return got_response;
-}
-
-static int usb_pcwd_start(struct usb_pcwd_private *usb_pcwd)
-{
-       unsigned char msb = 0x00;
-       unsigned char lsb = 0x00;
-       int retval;
-
-       /* Enable Watchdog */
-       retval = usb_pcwd_send_command(usb_pcwd, CMD_ENABLE_WATCHDOG, &msb, &lsb);
-
-       if ((retval == 0) || (lsb == 0)) {
-               printk(KERN_ERR PFX "Card did not acknowledge enable attempt\n");
-               return -1;
-       }
-
-       return 0;
-}
-
-static int usb_pcwd_stop(struct usb_pcwd_private *usb_pcwd)
-{
-       unsigned char msb = 0xA5;
-       unsigned char lsb = 0xC3;
-       int retval;
-
-       /* Disable Watchdog */
-       retval = usb_pcwd_send_command(usb_pcwd, CMD_DISABLE_WATCHDOG, &msb, &lsb);
-
-       if ((retval == 0) || (lsb != 0)) {
-               printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n");
-               return -1;
-       }
-
-       return 0;
-}
-
-static int usb_pcwd_keepalive(struct usb_pcwd_private *usb_pcwd)
-{
-       unsigned char dummy;
-
-       /* Re-trigger Watchdog */
-       usb_pcwd_send_command(usb_pcwd, CMD_TRIGGER, &dummy, &dummy);
-
-       return 0;
-}
-
-static int usb_pcwd_set_heartbeat(struct usb_pcwd_private *usb_pcwd, int t)
-{
-       unsigned char msb = t / 256;
-       unsigned char lsb = t % 256;
-
-       if ((t < 0x0001) || (t > 0xFFFF))
-               return -EINVAL;
-
-       /* Write new heartbeat to watchdog */
-       usb_pcwd_send_command(usb_pcwd, CMD_WRITE_WATCHDOG_TIMEOUT, &msb, &lsb);
-
-       heartbeat = t;
-       return 0;
-}
-
-static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, int *temperature)
-{
-       unsigned char msb, lsb;
-
-       usb_pcwd_send_command(usb_pcwd, CMD_READ_TEMP, &msb, &lsb);
-
-       /*
-        * Convert celsius to fahrenheit, since this was
-        * the decided 'standard' for this return value.
-        */
-       *temperature = (lsb * 9 / 5) + 32;
-
-       return 0;
-}
-
-static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd, int *time_left)
-{
-       unsigned char msb, lsb;
-
-       /* Read the time that's left before rebooting */
-       /* Note: if the board is not yet armed then we will read 0xFFFF */
-       usb_pcwd_send_command(usb_pcwd, CMD_READ_WATCHDOG_TIMEOUT, &msb, &lsb);
-
-       *time_left = (msb << 8) + lsb;
-
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
-                             size_t len, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       expect_release = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if(get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_release = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               usb_pcwd_keepalive(usb_pcwd_device);
-       }
-       return len;
-}
-
-static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
-                         unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_KEEPALIVEPING |
-                                       WDIOF_SETTIMEOUT |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     1,
-               .identity =             DRIVER_NAME,
-       };
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof (ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_GETTEMP:
-               {
-                       int temperature;
-
-                       if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
-                               return -EFAULT;
-
-                       return put_user(temperature, p);
-               }
-
-               case WDIOC_KEEPALIVE:
-                       usb_pcwd_keepalive(usb_pcwd_device);
-                       return 0;
-
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if (get_user (new_options, p))
-                               return -EFAULT;
-
-                       if (new_options & WDIOS_DISABLECARD) {
-                               usb_pcwd_stop(usb_pcwd_device);
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_ENABLECARD) {
-                               usb_pcwd_start(usb_pcwd_device);
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_heartbeat;
-
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
-                           return -EINVAL;
-
-                       usb_pcwd_keepalive(usb_pcwd_device);
-                       /* Fall */
-               }
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-
-               case WDIOC_GETTIMELEFT:
-               {
-                       int time_left;
-
-                       if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left))
-                               return -EFAULT;
-
-                       return put_user(time_left, p);
-               }
-
-               default:
-                       return -ENOTTY;
-       }
-}
-
-static int usb_pcwd_open(struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-       if (test_and_set_bit(0, &is_active))
-               return -EBUSY;
-
-       /* Activate */
-       usb_pcwd_start(usb_pcwd_device);
-       usb_pcwd_keepalive(usb_pcwd_device);
-       return nonseekable_open(inode, file);
-}
-
-static int usb_pcwd_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        */
-       if (expect_release == 42) {
-               usb_pcwd_stop(usb_pcwd_device);
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               usb_pcwd_keepalive(usb_pcwd_device);
-       }
-       expect_release = 0;
-       clear_bit(0, &is_active);
-       return 0;
-}
-
-/*
- *     /dev/temperature handling
- */
-
-static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data,
-                               size_t len, loff_t *ppos)
-{
-       int temperature;
-
-       if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
-               return -EFAULT;
-
-       if (copy_to_user(data, &temperature, 1))
-               return -EFAULT;
-
-       return 1;
-}
-
-static int usb_pcwd_temperature_open(struct inode *inode, struct file *file)
-{
-       return nonseekable_open(inode, file);
-}
-
-static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
-{
-       return 0;
-}
-
-/*
- *     Notify system
- */
-
-static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the WDT off */
-               usb_pcwd_stop(usb_pcwd_device);
-       }
-
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations usb_pcwd_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .write =        usb_pcwd_write,
-       .ioctl =        usb_pcwd_ioctl,
-       .open =         usb_pcwd_open,
-       .release =      usb_pcwd_release,
-};
-
-static struct miscdevice usb_pcwd_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &usb_pcwd_fops,
-};
-
-static const struct file_operations usb_pcwd_temperature_fops = {
-       .owner =        THIS_MODULE,
-       .llseek =       no_llseek,
-       .read =         usb_pcwd_temperature_read,
-       .open =         usb_pcwd_temperature_open,
-       .release =      usb_pcwd_temperature_release,
-};
-
-static struct miscdevice usb_pcwd_temperature_miscdev = {
-       .minor =        TEMP_MINOR,
-       .name =         "temperature",
-       .fops =         &usb_pcwd_temperature_fops,
-};
-
-static struct notifier_block usb_pcwd_notifier = {
-       .notifier_call =        usb_pcwd_notify_sys,
-};
-
-/**
- *     usb_pcwd_delete
- */
-static inline void usb_pcwd_delete (struct usb_pcwd_private *usb_pcwd)
-{
-       usb_free_urb(usb_pcwd->intr_urb);
-       if (usb_pcwd->intr_buffer != NULL)
-               usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size,
-                               usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
-       kfree (usb_pcwd);
-}
-
-/**
- *     usb_pcwd_probe
- *
- *     Called by the usb core when a new device is connected that it thinks
- *     this driver might be interested in.
- */
-static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_device_id *id)
-{
-       struct usb_device *udev = interface_to_usbdev(interface);
-       struct usb_host_interface *iface_desc;
-       struct usb_endpoint_descriptor *endpoint;
-       struct usb_pcwd_private *usb_pcwd = NULL;
-       int pipe, maxp;
-       int retval = -ENOMEM;
-       int got_fw_rev;
-       unsigned char fw_rev_major, fw_rev_minor;
-       char fw_ver_str[20];
-       unsigned char option_switches, dummy;
-
-       cards_found++;
-       if (cards_found > 1) {
-               printk(KERN_ERR PFX "This driver only supports 1 device\n");
-               return -ENODEV;
-       }
-
-       /* get the active interface descriptor */
-       iface_desc = interface->cur_altsetting;
-
-       /* check out that we have a HID device */
-       if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) {
-               printk(KERN_ERR PFX "The device isn't a Human Interface Device\n");
-               return -ENODEV;
-       }
-
-       /* check out the endpoint: it has to be Interrupt & IN */
-       endpoint = &iface_desc->endpoint[0].desc;
-
-       if (!((endpoint->bEndpointAddress & USB_DIR_IN) &&
-            ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
-                               == USB_ENDPOINT_XFER_INT))) {
-               /* we didn't find a Interrupt endpoint with direction IN */
-               printk(KERN_ERR PFX "Couldn't find an INTR & IN endpoint\n");
-               return -ENODEV;
-       }
-
-       /* get a handle to the interrupt data pipe */
-       pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
-       maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
-
-       /* allocate memory for our device and initialize it */
-       usb_pcwd = kzalloc (sizeof(struct usb_pcwd_private), GFP_KERNEL);
-       if (usb_pcwd == NULL) {
-               printk(KERN_ERR PFX "Out of memory\n");
-               goto error;
-       }
-
-       usb_pcwd_device = usb_pcwd;
-
-       mutex_init(&usb_pcwd->mtx);
-       usb_pcwd->udev = udev;
-       usb_pcwd->interface = interface;
-       usb_pcwd->interface_number = iface_desc->desc.bInterfaceNumber;
-       usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8);
-
-       /* set up the memory buffer's */
-       if (!(usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma))) {
-               printk(KERN_ERR PFX "Out of memory\n");
-               goto error;
-       }
-
-       /* allocate the urb's */
-       usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
-       if (!usb_pcwd->intr_urb) {
-               printk(KERN_ERR PFX "Out of memory\n");
-               goto error;
-       }
-
-       /* initialise the intr urb's */
-       usb_fill_int_urb(usb_pcwd->intr_urb, udev, pipe,
-                       usb_pcwd->intr_buffer, usb_pcwd->intr_size,
-                       usb_pcwd_intr_done, usb_pcwd, endpoint->bInterval);
-       usb_pcwd->intr_urb->transfer_dma = usb_pcwd->intr_dma;
-       usb_pcwd->intr_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
-
-       /* register our interrupt URB with the USB system */
-       if (usb_submit_urb(usb_pcwd->intr_urb, GFP_KERNEL)) {
-               printk(KERN_ERR PFX "Problem registering interrupt URB\n");
-               retval = -EIO; /* failure */
-               goto error;
-       }
-
-       /* The device exists and can be communicated with */
-       usb_pcwd->exists = 1;
-
-       /* disable card */
-       usb_pcwd_stop(usb_pcwd);
-
-       /* Get the Firmware Version */
-       got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
-       if (got_fw_rev) {
-               sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
-       } else {
-               sprintf(fw_ver_str, "<card no answer>");
-       }
-
-       printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n",
-               fw_ver_str);
-
-       /* Get switch settings */
-       usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy, &option_switches);
-
-       printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
-               option_switches,
-               ((option_switches & 0x10) ? "ON" : "OFF"),
-               ((option_switches & 0x08) ? "ON" : "OFF"));
-
-       /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
-       if (heartbeat == 0)
-               heartbeat = heartbeat_tbl[(option_switches & 0x07)];
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) {
-               usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT);
-               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-                       WATCHDOG_HEARTBEAT);
-       }
-
-       retval = register_reboot_notifier(&usb_pcwd_notifier);
-       if (retval != 0) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       retval);
-               goto error;
-       }
-
-       retval = misc_register(&usb_pcwd_temperature_miscdev);
-       if (retval != 0) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, retval);
-               goto err_out_unregister_reboot;
-       }
-
-       retval = misc_register(&usb_pcwd_miscdev);
-       if (retval != 0) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, retval);
-               goto err_out_misc_deregister;
-       }
-
-       /* we can register the device now, as it is ready */
-       usb_set_intfdata (interface, usb_pcwd);
-
-       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
-               heartbeat, nowayout);
-
-       return 0;
-
-err_out_misc_deregister:
-       misc_deregister(&usb_pcwd_temperature_miscdev);
-err_out_unregister_reboot:
-       unregister_reboot_notifier(&usb_pcwd_notifier);
-error:
-       if (usb_pcwd)
-               usb_pcwd_delete(usb_pcwd);
-       usb_pcwd_device = NULL;
-       return retval;
-}
-
-
-/**
- *     usb_pcwd_disconnect
- *
- *     Called by the usb core when the device is removed from the system.
- *
- *     This routine guarantees that the driver will not submit any more urbs
- *     by clearing dev->udev.
- */
-static void usb_pcwd_disconnect(struct usb_interface *interface)
-{
-       struct usb_pcwd_private *usb_pcwd;
-
-       /* prevent races with open() */
-       mutex_lock(&disconnect_mutex);
-
-       usb_pcwd = usb_get_intfdata (interface);
-       usb_set_intfdata (interface, NULL);
-
-       mutex_lock(&usb_pcwd->mtx);
-
-       /* Stop the timer before we leave */
-       if (!nowayout)
-               usb_pcwd_stop(usb_pcwd);
-
-       /* We should now stop communicating with the USB PCWD device */
-       usb_pcwd->exists = 0;
-
-       /* Deregister */
-       misc_deregister(&usb_pcwd_miscdev);
-       misc_deregister(&usb_pcwd_temperature_miscdev);
-       unregister_reboot_notifier(&usb_pcwd_notifier);
-
-       mutex_unlock(&usb_pcwd->mtx);
-
-       /* Delete the USB PCWD device */
-       usb_pcwd_delete(usb_pcwd);
-
-       cards_found--;
-
-       mutex_unlock(&disconnect_mutex);
-
-       printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
-}
-
-
-
-/**
- *     usb_pcwd_init
- */
-static int __init usb_pcwd_init(void)
-{
-       int result;
-
-       /* register this driver with the USB subsystem */
-       result = usb_register(&usb_pcwd_driver);
-       if (result) {
-               printk(KERN_ERR PFX "usb_register failed. Error number %d\n",
-                   result);
-               return result;
-       }
-
-       printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION " (" DRIVER_DATE ")\n");
-       return 0;
-}
-
-
-/**
- *     usb_pcwd_exit
- */
-static void __exit usb_pcwd_exit(void)
-{
-       /* deregister this driver with the USB subsystem */
-       usb_deregister(&usb_pcwd_driver);
-}
-
-
-module_init (usb_pcwd_init);
-module_exit (usb_pcwd_exit);
diff --git a/drivers/char/watchdog/pnx4008_wdt.c b/drivers/char/watchdog/pnx4008_wdt.c
deleted file mode 100644 (file)
index 22f8873..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * drivers/char/watchdog/pnx4008_wdt.c
- *
- * Watchdog driver for PNX4008 board
- *
- * Authors: Dmitry Chigirev <source@mvista.com>,
- *         Vitaly Wool <vitalywool@gmail.com>
- * Based on sa1100 driver,
- * Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
- *
- * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/init.h>
-#include <linux/bitops.h>
-#include <linux/ioport.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/spinlock.h>
-
-#include <asm/hardware.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#define MODULE_NAME "PNX4008-WDT: "
-
-/* WatchDog Timer - Chapter 23 Page 207 */
-
-#define DEFAULT_HEARTBEAT 19
-#define MAX_HEARTBEAT     60
-
-/* Watchdog timer register set definition */
-#define WDTIM_INT(p)     ((p) + 0x0)
-#define WDTIM_CTRL(p)    ((p) + 0x4)
-#define WDTIM_COUNTER(p) ((p) + 0x8)
-#define WDTIM_MCTRL(p)   ((p) + 0xC)
-#define WDTIM_MATCH0(p)  ((p) + 0x10)
-#define WDTIM_EMR(p)     ((p) + 0x14)
-#define WDTIM_PULSE(p)   ((p) + 0x18)
-#define WDTIM_RES(p)     ((p) + 0x1C)
-
-/* WDTIM_INT bit definitions */
-#define MATCH_INT      1
-
-/* WDTIM_CTRL bit definitions */
-#define COUNT_ENAB     1
-#define RESET_COUNT    (1<<1)
-#define DEBUG_EN       (1<<2)
-
-/* WDTIM_MCTRL bit definitions */
-#define MR0_INT        1
-#undef  RESET_COUNT0
-#define RESET_COUNT0   (1<<2)
-#define STOP_COUNT0    (1<<2)
-#define M_RES1         (1<<3)
-#define M_RES2         (1<<4)
-#define RESFRC1        (1<<5)
-#define RESFRC2        (1<<6)
-
-/* WDTIM_EMR bit definitions */
-#define EXT_MATCH0      1
-#define MATCH_OUTPUT_HIGH (2<<4)       /*a MATCH_CTRL setting */
-
-/* WDTIM_RES bit definitions */
-#define WDOG_RESET      1      /* read only */
-
-#define WDOG_COUNTER_RATE 13000000     /*the counter clock is 13 MHz fixed */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-static int heartbeat = DEFAULT_HEARTBEAT;
-
-static spinlock_t io_lock;
-static unsigned long wdt_status;
-#define WDT_IN_USE        0
-#define WDT_OK_TO_CLOSE   1
-#define WDT_REGION_INITED 2
-#define WDT_DEVICE_INITED 3
-
-static unsigned long boot_status;
-
-static struct resource *wdt_mem;
-static void __iomem    *wdt_base;
-struct clk             *wdt_clk;
-
-static void wdt_enable(void)
-{
-       spin_lock(&io_lock);
-
-       if (wdt_clk)
-               clk_set_rate(wdt_clk, 1);
-
-       /* stop counter, initiate counter reset */
-       __raw_writel(RESET_COUNT, WDTIM_CTRL(wdt_base));
-       /*wait for reset to complete. 100% guarantee event */
-       while (__raw_readl(WDTIM_COUNTER(wdt_base)))
-               cpu_relax();
-       /* internal and external reset, stop after that */
-       __raw_writel(M_RES2 | STOP_COUNT0 | RESET_COUNT0,
-               WDTIM_MCTRL(wdt_base));
-       /* configure match output */
-       __raw_writel(MATCH_OUTPUT_HIGH, WDTIM_EMR(wdt_base));
-       /* clear interrupt, just in case */
-       __raw_writel(MATCH_INT, WDTIM_INT(wdt_base));
-       /* the longest pulse period 65541/(13*10^6) seconds ~ 5 ms. */
-       __raw_writel(0xFFFF, WDTIM_PULSE(wdt_base));
-       __raw_writel(heartbeat * WDOG_COUNTER_RATE, WDTIM_MATCH0(wdt_base));
-       /*enable counter, stop when debugger active */
-       __raw_writel(COUNT_ENAB | DEBUG_EN, WDTIM_CTRL(wdt_base));
-
-       spin_unlock(&io_lock);
-}
-
-static void wdt_disable(void)
-{
-       spin_lock(&io_lock);
-
-       __raw_writel(0, WDTIM_CTRL(wdt_base));  /*stop counter */
-       if (wdt_clk)
-               clk_set_rate(wdt_clk, 0);
-
-       spin_unlock(&io_lock);
-}
-
-static int pnx4008_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
-               return -EBUSY;
-
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       wdt_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static ssize_t
-pnx4008_wdt_write(struct file *file, const char *data, size_t len,
-                 loff_t * ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
-                       }
-               }
-               wdt_enable();
-       }
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE |
-           WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-       .identity = "PNX4008 Watchdog",
-};
-
-static int
-pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                 unsigned long arg)
-{
-       int ret = -ENOTTY;
-       int time;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user((struct watchdog_info *)arg, &ident,
-                                  sizeof(ident)) ? -EFAULT : 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-               ret = put_user(0, (int *)arg);
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(boot_status, (int *)arg);
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(time, (int *)arg);
-               if (ret)
-                       break;
-
-               if (time <= 0 || time > MAX_HEARTBEAT) {
-                       ret = -EINVAL;
-                       break;
-               }
-
-               heartbeat = time;
-               wdt_enable();
-               /* Fall through */
-
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(heartbeat, (int *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_enable();
-               ret = 0;
-               break;
-       }
-       return ret;
-}
-
-static int pnx4008_wdt_release(struct inode *inode, struct file *file)
-{
-       if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status))
-               printk(KERN_WARNING "WATCHDOG: Device closed unexpectdly\n");
-
-       wdt_disable();
-       clear_bit(WDT_IN_USE, &wdt_status);
-       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
-
-       return 0;
-}
-
-static const struct file_operations pnx4008_wdt_fops = {
-       .owner = THIS_MODULE,
-       .llseek = no_llseek,
-       .write = pnx4008_wdt_write,
-       .ioctl = pnx4008_wdt_ioctl,
-       .open = pnx4008_wdt_open,
-       .release = pnx4008_wdt_release,
-};
-
-static struct miscdevice pnx4008_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &pnx4008_wdt_fops,
-};
-
-static int pnx4008_wdt_probe(struct platform_device *pdev)
-{
-       int ret = 0, size;
-       struct resource *res;
-
-       spin_lock_init(&io_lock);
-
-       if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
-               heartbeat = DEFAULT_HEARTBEAT;
-
-       printk(KERN_INFO MODULE_NAME
-               "PNX4008 Watchdog Timer: heartbeat %d sec\n", heartbeat);
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (res == NULL) {
-               printk(KERN_INFO MODULE_NAME
-                       "failed to get memory region resouce\n");
-               return -ENOENT;
-       }
-
-       size = res->end - res->start + 1;
-       wdt_mem = request_mem_region(res->start, size, pdev->name);
-
-       if (wdt_mem == NULL) {
-               printk(KERN_INFO MODULE_NAME "failed to get memory region\n");
-               return -ENOENT;
-       }
-       wdt_base = (void __iomem *)IO_ADDRESS(res->start);
-
-       wdt_clk = clk_get(&pdev->dev, "wdt_ck");
-       if (IS_ERR(wdt_clk)) {
-               ret = PTR_ERR(wdt_clk);
-               release_resource(wdt_mem);
-               kfree(wdt_mem);
-               goto out;
-       } else
-               clk_set_rate(wdt_clk, 1);
-
-       ret = misc_register(&pnx4008_wdt_miscdev);
-       if (ret < 0) {
-               printk(KERN_ERR MODULE_NAME "cannot register misc device\n");
-               release_resource(wdt_mem);
-               kfree(wdt_mem);
-               clk_set_rate(wdt_clk, 0);
-       } else {
-               boot_status = (__raw_readl(WDTIM_RES(wdt_base)) & WDOG_RESET) ?
-                   WDIOF_CARDRESET : 0;
-               wdt_disable();          /*disable for now */
-               set_bit(WDT_DEVICE_INITED, &wdt_status);
-       }
-
-out:
-       return ret;
-}
-
-static int pnx4008_wdt_remove(struct platform_device *pdev)
-{
-       misc_deregister(&pnx4008_wdt_miscdev);
-       if (wdt_clk) {
-               clk_set_rate(wdt_clk, 0);
-               clk_put(wdt_clk);
-               wdt_clk = NULL;
-       }
-       if (wdt_mem) {
-               release_resource(wdt_mem);
-               kfree(wdt_mem);
-               wdt_mem = NULL;
-       }
-       return 0;
-}
-
-static struct platform_driver platform_wdt_driver = {
-       .driver = {
-               .name = "watchdog",
-       },
-       .probe = pnx4008_wdt_probe,
-       .remove = pnx4008_wdt_remove,
-};
-
-static int __init pnx4008_wdt_init(void)
-{
-       return platform_driver_register(&platform_wdt_driver);
-}
-
-static void __exit pnx4008_wdt_exit(void)
-{
-       return platform_driver_unregister(&platform_wdt_driver);
-}
-
-module_init(pnx4008_wdt_init);
-module_exit(pnx4008_wdt_exit);
-
-MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
-MODULE_DESCRIPTION("PNX4008 Watchdog Driver");
-
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat,
-                "Watchdog heartbeat period in seconds from 1 to "
-                __MODULE_STRING(MAX_HEARTBEAT) ", default "
-                __MODULE_STRING(DEFAULT_HEARTBEAT));
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout,
-                "Set to 1 to keep watchdog running after device release");
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/rm9k_wdt.c b/drivers/char/watchdog/rm9k_wdt.c
deleted file mode 100644 (file)
index 5c921e4..0000000
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- *  Watchdog implementation for GPI h/w found on PMC-Sierra RM9xxx
- *  chips.
- *
- *  Copyright (C) 2004 by Basler Vision Technologies AG
- *  Author: Thomas Koeller <thomas.koeller@baslerweb.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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/interrupt.h>
-#include <linux/fs.h>
-#include <linux/reboot.h>
-#include <linux/notifier.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <asm/io.h>
-#include <asm/atomic.h>
-#include <asm/processor.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/rm9k-ocd.h>
-
-#include <rm9k_wdt.h>
-
-
-#define CLOCK                  125000000
-#define MAX_TIMEOUT_SECONDS    32
-#define CPCCR                  0x0080
-#define CPGIG1SR               0x0044
-#define CPGIG1ER               0x0054
-
-
-/* Function prototypes */
-static irqreturn_t wdt_gpi_irqhdl(int, void *);
-static void wdt_gpi_start(void);
-static void wdt_gpi_stop(void);
-static void wdt_gpi_set_timeout(unsigned int);
-static int wdt_gpi_open(struct inode *, struct file *);
-static int wdt_gpi_release(struct inode *, struct file *);
-static ssize_t wdt_gpi_write(struct file *, const char __user *, size_t, loff_t *);
-static long wdt_gpi_ioctl(struct file *, unsigned int, unsigned long);
-static int wdt_gpi_notify(struct notifier_block *, unsigned long, void *);
-static const struct resource *wdt_gpi_get_resource(struct platform_device *, const char *, unsigned int);
-static int __init wdt_gpi_probe(struct device *);
-static int __exit wdt_gpi_remove(struct device *);
-
-
-static const char wdt_gpi_name[] = "wdt_gpi";
-static atomic_t opencnt;
-static int expect_close;
-static int locked;
-
-
-/* These are set from device resources */
-static void __iomem * wd_regs;
-static unsigned int wd_irq, wd_ctr;
-
-
-/* Module arguments */
-static int timeout = MAX_TIMEOUT_SECONDS;
-module_param(timeout, int, 0444);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds");
-
-static unsigned long resetaddr = 0xbffdc200;
-module_param(resetaddr, ulong, 0444);
-MODULE_PARM_DESC(resetaddr, "Address to write to to force a reset");
-
-static unsigned long flagaddr = 0xbffdc104;
-module_param(flagaddr, ulong, 0444);
-MODULE_PARM_DESC(flagaddr, "Address to write to boot flags to");
-
-static int powercycle;
-module_param(powercycle, bool, 0444);
-MODULE_PARM_DESC(powercycle, "Cycle power if watchdog expires");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, bool, 0444);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started");
-
-
-/* Kernel interfaces */
-static const struct file_operations fops = {
-       .owner          = THIS_MODULE,
-       .open           = wdt_gpi_open,
-       .release        = wdt_gpi_release,
-       .write          = wdt_gpi_write,
-       .unlocked_ioctl = wdt_gpi_ioctl,
-};
-
-static struct miscdevice miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = wdt_gpi_name,
-       .fops           = &fops,
-};
-
-static struct notifier_block wdt_gpi_shutdown = {
-       .notifier_call  = wdt_gpi_notify,
-};
-
-
-/* Interrupt handler */
-static irqreturn_t wdt_gpi_irqhdl(int irq, void *ctxt)
-{
-       if (!unlikely(__raw_readl(wd_regs + 0x0008) & 0x1))
-               return IRQ_NONE;
-       __raw_writel(0x1, wd_regs + 0x0008);
-
-
-       printk(KERN_CRIT "%s: watchdog expired - resetting system\n",
-               wdt_gpi_name);
-
-       *(volatile char *) flagaddr |= 0x01;
-       *(volatile char *) resetaddr = powercycle ? 0x01 : 0x2;
-       iob();
-       while (1)
-               cpu_relax();
-}
-
-
-/* Watchdog functions */
-static void wdt_gpi_start(void)
-{
-       u32 reg;
-
-       lock_titan_regs();
-       reg = titan_readl(CPGIG1ER);
-       titan_writel(reg | (0x100 << wd_ctr), CPGIG1ER);
-       iob();
-       unlock_titan_regs();
-}
-
-static void wdt_gpi_stop(void)
-{
-       u32 reg;
-
-       lock_titan_regs();
-       reg = titan_readl(CPCCR) & ~(0xf << (wd_ctr * 4));
-       titan_writel(reg, CPCCR);
-       reg = titan_readl(CPGIG1ER);
-       titan_writel(reg & ~(0x100 << wd_ctr), CPGIG1ER);
-       iob();
-       unlock_titan_regs();
-}
-
-static void wdt_gpi_set_timeout(unsigned int to)
-{
-       u32 reg;
-       const u32 wdval = (to * CLOCK) & ~0x0000000f;
-
-       lock_titan_regs();
-       reg = titan_readl(CPCCR) & ~(0xf << (wd_ctr * 4));
-       titan_writel(reg, CPCCR);
-       wmb();
-       __raw_writel(wdval, wd_regs + 0x0000);
-       wmb();
-       titan_writel(reg | (0x2 << (wd_ctr * 4)), CPCCR);
-       wmb();
-       titan_writel(reg | (0x5 << (wd_ctr * 4)), CPCCR);
-       iob();
-       unlock_titan_regs();
-}
-
-
-/* /dev/watchdog operations */
-static int wdt_gpi_open(struct inode *inode, struct file *file)
-{
-       int res;
-
-       if (unlikely(atomic_dec_if_positive(&opencnt) < 0))
-               return -EBUSY;
-
-       expect_close = 0;
-       if (locked) {
-               module_put(THIS_MODULE);
-               free_irq(wd_irq, &miscdev);
-               locked = 0;
-       }
-
-       res = request_irq(wd_irq, wdt_gpi_irqhdl, IRQF_SHARED | IRQF_DISABLED,
-                         wdt_gpi_name, &miscdev);
-       if (unlikely(res))
-               return res;
-
-       wdt_gpi_set_timeout(timeout);
-       wdt_gpi_start();
-
-       printk(KERN_INFO "%s: watchdog started, timeout = %u seconds\n",
-               wdt_gpi_name, timeout);
-       return nonseekable_open(inode, file);
-}
-
-static int wdt_gpi_release(struct inode *inode, struct file *file)
-{
-       if (nowayout) {
-               printk(KERN_INFO "%s: no way out - watchdog left running\n",
-                       wdt_gpi_name);
-               __module_get(THIS_MODULE);
-               locked = 1;
-       } else {
-               if (expect_close) {
-                       wdt_gpi_stop();
-                       free_irq(wd_irq, &miscdev);
-                       printk(KERN_INFO "%s: watchdog stopped\n", wdt_gpi_name);
-               } else {
-                       printk(KERN_CRIT "%s: unexpected close() -"
-                               " watchdog left running\n",
-                               wdt_gpi_name);
-                       wdt_gpi_set_timeout(timeout);
-                       __module_get(THIS_MODULE);
-                       locked = 1;
-               }
-       }
-
-       atomic_inc(&opencnt);
-       return 0;
-}
-
-static ssize_t
-wdt_gpi_write(struct file *f, const char __user *d, size_t s, loff_t *o)
-{
-       char val;
-
-       wdt_gpi_set_timeout(timeout);
-       expect_close = (s > 0) && !get_user(val, d) && (val == 'V');
-       return s ? 1 : 0;
-}
-
-static long
-wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
-{
-       long res = -ENOTTY;
-       const long size = _IOC_SIZE(cmd);
-       int stat;
-       void __user *argp = (void __user *)arg;
-       static struct watchdog_info wdinfo = {
-               .identity               = "RM9xxx/GPI watchdog",
-               .firmware_version       = 0,
-               .options                = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING
-       };
-
-       if (unlikely(_IOC_TYPE(cmd) != WATCHDOG_IOCTL_BASE))
-               return -ENOTTY;
-
-       if ((_IOC_DIR(cmd) & _IOC_READ)
-           && !access_ok(VERIFY_WRITE, arg, size))
-               return -EFAULT;
-
-       if ((_IOC_DIR(cmd) & _IOC_WRITE)
-           && !access_ok(VERIFY_READ, arg, size))
-               return -EFAULT;
-
-       expect_close = 0;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               wdinfo.options = nowayout ?
-                       WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING :
-                       WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE;
-               res = __copy_to_user(argp, &wdinfo, size) ?  -EFAULT : size;
-               break;
-
-       case WDIOC_GETSTATUS:
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               stat = (*(volatile char *) flagaddr & 0x01)
-                       ? WDIOF_CARDRESET : 0;
-               res = __copy_to_user(argp, &stat, size) ?
-                       -EFAULT : size;
-               break;
-
-       case WDIOC_SETOPTIONS:
-               break;
-
-       case WDIOC_KEEPALIVE:
-               wdt_gpi_set_timeout(timeout);
-               res = size;
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               {
-                       int val;
-                       if (unlikely(__copy_from_user(&val, argp, size))) {
-                               res = -EFAULT;
-                               break;
-                       }
-
-                       if (val > MAX_TIMEOUT_SECONDS)
-                               val = MAX_TIMEOUT_SECONDS;
-                       timeout = val;
-                       wdt_gpi_set_timeout(val);
-                       res = size;
-                       printk(KERN_INFO "%s: timeout set to %u seconds\n",
-                               wdt_gpi_name, timeout);
-               }
-               break;
-
-       case WDIOC_GETTIMEOUT:
-               res = __copy_to_user(argp, &timeout, size) ?
-                       -EFAULT : size;
-               break;
-       }
-
-       return res;
-}
-
-
-/* Shutdown notifier */
-static int
-wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-               wdt_gpi_stop();
-
-       return NOTIFY_DONE;
-}
-
-
-/* Init & exit procedures */
-static const struct resource *
-wdt_gpi_get_resource(struct platform_device *pdv, const char *name,
-                     unsigned int type)
-{
-       char buf[80];
-       if (snprintf(buf, sizeof buf, "%s_0", name) >= sizeof buf)
-               return NULL;
-       return platform_get_resource_byname(pdv, type, buf);
-}
-
-/* No hotplugging on the platform bus - use __init */
-static int __init wdt_gpi_probe(struct device *dev)
-{
-       int res;
-       struct platform_device * const pdv = to_platform_device(dev);
-       const struct resource
-               * const rr = wdt_gpi_get_resource(pdv, WDT_RESOURCE_REGS,
-                                                 IORESOURCE_MEM),
-               * const ri = wdt_gpi_get_resource(pdv, WDT_RESOURCE_IRQ,
-                                                 IORESOURCE_IRQ),
-               * const rc = wdt_gpi_get_resource(pdv, WDT_RESOURCE_COUNTER,
-                                                 0);
-
-       if (unlikely(!rr || !ri || !rc))
-               return -ENXIO;
-
-       wd_regs = ioremap_nocache(rr->start, rr->end + 1 - rr->start);
-       if (unlikely(!wd_regs))
-               return -ENOMEM;
-       wd_irq = ri->start;
-       wd_ctr = rc->start;
-       res = misc_register(&miscdev);
-       if (res)
-               iounmap(wd_regs);
-       else
-               register_reboot_notifier(&wdt_gpi_shutdown);
-       return res;
-}
-
-static int __exit wdt_gpi_remove(struct device *dev)
-{
-       int res;
-
-       unregister_reboot_notifier(&wdt_gpi_shutdown);
-       res = misc_deregister(&miscdev);
-       iounmap(wd_regs);
-       wd_regs = NULL;
-       return res;
-}
-
-
-/* Device driver init & exit */
-static struct device_driver wdt_gpi_driver = {
-       .name           = (char *) wdt_gpi_name,
-       .bus            = &platform_bus_type,
-       .owner          = THIS_MODULE,
-       .probe          = wdt_gpi_probe,
-       .remove         = __exit_p(wdt_gpi_remove),
-       .shutdown       = NULL,
-       .suspend        = NULL,
-       .resume         = NULL,
-};
-
-static int __init wdt_gpi_init_module(void)
-{
-       atomic_set(&opencnt, 1);
-       if (timeout > MAX_TIMEOUT_SECONDS)
-               timeout = MAX_TIMEOUT_SECONDS;
-       return driver_register(&wdt_gpi_driver);
-}
-
-static void __exit wdt_gpi_cleanup_module(void)
-{
-       driver_unregister(&wdt_gpi_driver);
-}
-
-module_init(wdt_gpi_init_module);
-module_exit(wdt_gpi_cleanup_module);
-
-MODULE_AUTHOR("Thomas Koeller <thomas.koeller@baslerweb.com>");
-MODULE_DESCRIPTION("Basler eXcite watchdog driver for gpi devices");
-MODULE_VERSION("0.1");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
deleted file mode 100644 (file)
index 5d1c15f..0000000
+++ /dev/null
@@ -1,563 +0,0 @@
-/* linux/drivers/char/watchdog/s3c2410_wdt.c
- *
- * Copyright (c) 2004 Simtec Electronics
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S3C2410 Watchdog Timer Support
- *
- * Based on, softdog.c by Alan Cox,
- *     (c) Copyright 1996 Alan Cox <alan@redhat.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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Changelog:
- *     05-Oct-2004     BJD     Added semaphore init to stop crashes on open
- *                             Fixed tmr_count / wdt_count confusion
- *                             Added configurable debug
- *
- *     11-Jan-2005     BJD     Fixed divide-by-2 in timeout code
- *
- *     25-Jan-2005     DA      Added suspend/resume support
- *                             Replaced reboot notifier with .shutdown method
- *
- *     10-Mar-2005     LCVR    Changed S3C2410_VA to S3C24XX_VA
-*/
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/clk.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#include <asm/arch/map.h>
-
-#undef S3C_VA_WATCHDOG
-#define S3C_VA_WATCHDOG (0)
-
-#include <asm/plat-s3c/regs-watchdog.h>
-
-#define PFX "s3c2410-wdt: "
-
-#define CONFIG_S3C2410_WATCHDOG_ATBOOT         (0)
-#define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)
-
-static int nowayout    = WATCHDOG_NOWAYOUT;
-static int tmr_margin  = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME;
-static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
-static int soft_noboot = 0;
-static int debug       = 0;
-
-module_param(tmr_margin,  int, 0);
-module_param(tmr_atboot,  int, 0);
-module_param(nowayout,    int, 0);
-module_param(soft_noboot, int, 0);
-module_param(debug,      int, 0);
-
-MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
-
-MODULE_PARM_DESC(tmr_atboot, "Watchdog is started at boot time if set to 1, default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT));
-
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
-
-MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)");
-
-
-typedef enum close_state {
-       CLOSE_STATE_NOT,
-       CLOSE_STATE_ALLOW=0x4021
-} close_state_t;
-
-static DECLARE_MUTEX(open_lock);
-
-static struct device    *wdt_dev;      /* platform device attached to */
-static struct resource *wdt_mem;
-static struct resource *wdt_irq;
-static struct clk      *wdt_clock;
-static void __iomem    *wdt_base;
-static unsigned int     wdt_count;
-static close_state_t    allow_close;
-
-/* watchdog control routines */
-
-#define DBG(msg...) do { \
-       if (debug) \
-               printk(KERN_INFO msg); \
-       } while(0)
-
-/* functions */
-
-static int s3c2410wdt_keepalive(void)
-{
-       writel(wdt_count, wdt_base + S3C2410_WTCNT);
-       return 0;
-}
-
-static int s3c2410wdt_stop(void)
-{
-       unsigned long wtcon;
-
-       wtcon = readl(wdt_base + S3C2410_WTCON);
-       wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN);
-       writel(wtcon, wdt_base + S3C2410_WTCON);
-
-       return 0;
-}
-
-static int s3c2410wdt_start(void)
-{
-       unsigned long wtcon;
-
-       s3c2410wdt_stop();
-
-       wtcon = readl(wdt_base + S3C2410_WTCON);
-       wtcon |= S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128;
-
-       if (soft_noboot) {
-               wtcon |= S3C2410_WTCON_INTEN;
-               wtcon &= ~S3C2410_WTCON_RSTEN;
-       } else {
-               wtcon &= ~S3C2410_WTCON_INTEN;
-               wtcon |= S3C2410_WTCON_RSTEN;
-       }
-
-       DBG("%s: wdt_count=0x%08x, wtcon=%08lx\n",
-           __FUNCTION__, wdt_count, wtcon);
-
-       writel(wdt_count, wdt_base + S3C2410_WTDAT);
-       writel(wdt_count, wdt_base + S3C2410_WTCNT);
-       writel(wtcon, wdt_base + S3C2410_WTCON);
-
-       return 0;
-}
-
-static int s3c2410wdt_set_heartbeat(int timeout)
-{
-       unsigned int freq = clk_get_rate(wdt_clock);
-       unsigned int count;
-       unsigned int divisor = 1;
-       unsigned long wtcon;
-
-       if (timeout < 1)
-               return -EINVAL;
-
-       freq /= 128;
-       count = timeout * freq;
-
-       DBG("%s: count=%d, timeout=%d, freq=%d\n",
-           __FUNCTION__, count, timeout, freq);
-
-       /* if the count is bigger than the watchdog register,
-          then work out what we need to do (and if) we can
-          actually make this value
-       */
-
-       if (count >= 0x10000) {
-               for (divisor = 1; divisor <= 0x100; divisor++) {
-                       if ((count / divisor) < 0x10000)
-                               break;
-               }
-
-               if ((count / divisor) >= 0x10000) {
-                       dev_err(wdt_dev, "timeout %d too big\n", timeout);
-                       return -EINVAL;
-               }
-       }
-
-       tmr_margin = timeout;
-
-       DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n",
-           __FUNCTION__, timeout, divisor, count, count/divisor);
-
-       count /= divisor;
-       wdt_count = count;
-
-       /* update the pre-scaler */
-       wtcon = readl(wdt_base + S3C2410_WTCON);
-       wtcon &= ~S3C2410_WTCON_PRESCALE_MASK;
-       wtcon |= S3C2410_WTCON_PRESCALE(divisor-1);
-
-       writel(count, wdt_base + S3C2410_WTDAT);
-       writel(wtcon, wdt_base + S3C2410_WTCON);
-
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static int s3c2410wdt_open(struct inode *inode, struct file *file)
-{
-       if(down_trylock(&open_lock))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       allow_close = CLOSE_STATE_NOT;
-
-       /* start the timer */
-       s3c2410wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-static int s3c2410wdt_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        *      Lock it in if it's a module and we set nowayout
-        */
-
-       if (allow_close == CLOSE_STATE_ALLOW) {
-               s3c2410wdt_stop();
-       } else {
-               dev_err(wdt_dev, "Unexpected close, not stopping watchdog\n");
-               s3c2410wdt_keepalive();
-       }
-
-       allow_close = CLOSE_STATE_NOT;
-       up(&open_lock);
-       return 0;
-}
-
-static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
-                               size_t len, loff_t *ppos)
-{
-       /*
-        *      Refresh the timer.
-        */
-       if(len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       allow_close = CLOSE_STATE_NOT;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       allow_close = CLOSE_STATE_ALLOW;
-                       }
-               }
-
-               s3c2410wdt_keepalive();
-       }
-       return len;
-}
-
-#define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE
-
-static struct watchdog_info s3c2410_wdt_ident = {
-       .options          =     OPTIONS,
-       .firmware_version =     0,
-       .identity         =     "S3C2410 Watchdog",
-};
-
-
-static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_margin;
-
-       switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &s3c2410_wdt_ident,
-                               sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       s3c2410wdt_keepalive();
-                       return 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_margin, p))
-                               return -EFAULT;
-
-                       if (s3c2410wdt_set_heartbeat(new_margin))
-                               return -EINVAL;
-
-                       s3c2410wdt_keepalive();
-                       return put_user(tmr_margin, p);
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(tmr_margin, p);
-       }
-}
-
-/* kernel interface */
-
-static const struct file_operations s3c2410wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = s3c2410wdt_write,
-       .ioctl          = s3c2410wdt_ioctl,
-       .open           = s3c2410wdt_open,
-       .release        = s3c2410wdt_release,
-};
-
-static struct miscdevice s3c2410wdt_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &s3c2410wdt_fops,
-};
-
-/* interrupt handler code */
-
-static irqreturn_t s3c2410wdt_irq(int irqno, void *param)
-{
-       dev_info(wdt_dev, "watchdog timer expired (irq)\n");
-
-       s3c2410wdt_keepalive();
-       return IRQ_HANDLED;
-}
-/* device interface */
-
-static int s3c2410wdt_probe(struct platform_device *pdev)
-{
-       struct resource *res;
-       struct device *dev;
-       unsigned int wtcon;
-       int started = 0;
-       int ret;
-       int size;
-
-       DBG("%s: probe=%p\n", __FUNCTION__, pdev);
-
-       dev = &pdev->dev;
-       wdt_dev = &pdev->dev;
-
-       /* get the memory region for the watchdog timer */
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (res == NULL) {
-               dev_err(dev, "no memory resource specified\n");
-               return -ENOENT;
-       }
-
-       size = (res->end-res->start)+1;
-       wdt_mem = request_mem_region(res->start, size, pdev->name);
-       if (wdt_mem == NULL) {
-               dev_err(dev, "failed to get memory region\n");
-               ret = -ENOENT;
-               goto err_req;
-       }
-
-       wdt_base = ioremap(res->start, size);
-       if (wdt_base == 0) {
-               dev_err(dev, "failed to ioremap() region\n");
-               ret = -EINVAL;
-               goto err_req;
-       }
-
-       DBG("probe: mapped wdt_base=%p\n", wdt_base);
-
-       wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       if (wdt_irq == NULL) {
-               dev_err(dev, "no irq resource specified\n");
-               ret = -ENOENT;
-               goto err_map;
-       }
-
-       ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev);
-       if (ret != 0) {
-               dev_err(dev, "failed to install irq (%d)\n", ret);
-               goto err_map;
-       }
-
-       wdt_clock = clk_get(&pdev->dev, "watchdog");
-       if (IS_ERR(wdt_clock)) {
-               dev_err(dev, "failed to find watchdog clock source\n");
-               ret = PTR_ERR(wdt_clock);
-               goto err_irq;
-       }
-
-       clk_enable(wdt_clock);
-
-       /* see if we can actually set the requested timer margin, and if
-        * not, try the default value */
-
-       if (s3c2410wdt_set_heartbeat(tmr_margin)) {
-               started = s3c2410wdt_set_heartbeat(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
-
-               if (started == 0) {
-                       dev_info(dev,"tmr_margin value out of range, default %d used\n",
-                              CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
-               } else {
-                       dev_info(dev, "default timer value is out of range, cannot start\n");
-               }
-       }
-
-       ret = misc_register(&s3c2410wdt_miscdev);
-       if (ret) {
-               dev_err(dev, "cannot register miscdev on minor=%d (%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto err_clk;
-       }
-
-       if (tmr_atboot && started == 0) {
-               dev_info(dev, "starting watchdog timer\n");
-               s3c2410wdt_start();
-       } else if (!tmr_atboot) {
-               /* if we're not enabling the watchdog, then ensure it is
-                * disabled if it has been left running from the bootloader
-                * or other source */
-
-               s3c2410wdt_stop();
-       }
-
-       /* print out a statement of readiness */
-
-       wtcon = readl(wdt_base + S3C2410_WTCON);
-
-       dev_info(dev, "watchdog %sactive, reset %sabled, irq %sabled\n",
-                (wtcon & S3C2410_WTCON_ENABLE) ?  "" : "in",
-                (wtcon & S3C2410_WTCON_RSTEN) ? "" : "dis",
-                (wtcon & S3C2410_WTCON_INTEN) ? "" : "en");
-       
-       return 0;
-
- err_clk:
-       clk_disable(wdt_clock);
-       clk_put(wdt_clock);
-
- err_irq:
-       free_irq(wdt_irq->start, pdev);
-
- err_map:
-       iounmap(wdt_base);
-
- err_req:
-       release_resource(wdt_mem);
-       kfree(wdt_mem);
-
-       return ret;
-}
-
-static int s3c2410wdt_remove(struct platform_device *dev)
-{
-       release_resource(wdt_mem);
-       kfree(wdt_mem);
-       wdt_mem = NULL;
-
-       free_irq(wdt_irq->start, dev);
-       wdt_irq = NULL;
-
-       clk_disable(wdt_clock);
-       clk_put(wdt_clock);
-       wdt_clock = NULL;
-
-       iounmap(wdt_base);
-       misc_deregister(&s3c2410wdt_miscdev);
-       return 0;
-}
-
-static void s3c2410wdt_shutdown(struct platform_device *dev)
-{
-       s3c2410wdt_stop();      
-}
-
-#ifdef CONFIG_PM
-
-static unsigned long wtcon_save;
-static unsigned long wtdat_save;
-
-static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
-{
-       /* Save watchdog state, and turn it off. */
-       wtcon_save = readl(wdt_base + S3C2410_WTCON);
-       wtdat_save = readl(wdt_base + S3C2410_WTDAT);
-
-       /* Note that WTCNT doesn't need to be saved. */
-       s3c2410wdt_stop();
-
-       return 0;
-}
-
-static int s3c2410wdt_resume(struct platform_device *dev)
-{
-       /* Restore watchdog state. */
-
-       writel(wtdat_save, wdt_base + S3C2410_WTDAT);
-       writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
-       writel(wtcon_save, wdt_base + S3C2410_WTCON);
-
-       printk(KERN_INFO PFX "watchdog %sabled\n",
-              (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
-
-       return 0;
-}
-
-#else
-#define s3c2410wdt_suspend NULL
-#define s3c2410wdt_resume  NULL
-#endif /* CONFIG_PM */
-
-
-static struct platform_driver s3c2410wdt_driver = {
-       .probe          = s3c2410wdt_probe,
-       .remove         = s3c2410wdt_remove,
-       .shutdown       = s3c2410wdt_shutdown,
-       .suspend        = s3c2410wdt_suspend,
-       .resume         = s3c2410wdt_resume,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = "s3c2410-wdt",
-       },
-};
-
-
-static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
-
-static int __init watchdog_init(void)
-{
-       printk(banner);
-       return platform_driver_register(&s3c2410wdt_driver);
-}
-
-static void __exit watchdog_exit(void)
-{
-       platform_driver_unregister(&s3c2410wdt_driver);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);
-
-MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, "
-             "Dimitry Andric <dimitry.andric@tomtom.com>");
-MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
deleted file mode 100644 (file)
index 3475f47..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *     Watchdog driver for the SA11x0/PXA2xx
- *
- *      (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
- *          Based on SoftDog driver by Alan Cox <alan@redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Oleg Drokin nor iXcelerator.com admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 2000           Oleg Drokin <green@crimea.edu>
- *
- *      27/11/2000 Initial release
- */
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/init.h>
-
-#ifdef CONFIG_ARCH_PXA
-#include <asm/arch/pxa-regs.h>
-#endif
-
-#include <asm/hardware.h>
-#include <asm/bitops.h>
-#include <asm/uaccess.h>
-
-#define OSCR_FREQ              CLOCK_TICK_RATE
-
-static unsigned long sa1100wdt_users;
-static int pre_margin;
-static int boot_status;
-
-/*
- *     Allow only one person to hold it open
- */
-static int sa1100dog_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(1,&sa1100wdt_users))
-               return -EBUSY;
-
-       /* Activate SA1100 Watchdog timer */
-       OSMR3 = OSCR + pre_margin;
-       OSSR = OSSR_M3;
-       OWER = OWER_WME;
-       OIER |= OIER_E3;
-       return nonseekable_open(inode, file);
-}
-
-/*
- * The watchdog cannot be disabled.
- *
- * Previous comments suggested that turning off the interrupt by
- * clearing OIER[E3] would prevent the watchdog timing out but this
- * does not appear to be true (at least on the PXA255).
- */
-static int sa1100dog_release(struct inode *inode, struct file *file)
-{
-       printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n");
-
-       clear_bit(1, &sa1100wdt_users);
-
-       return 0;
-}
-
-static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
-{
-       if (len)
-               /* Refresh OSMR3 timer. */
-               OSMR3 = OSCR + pre_margin;
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options        = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-       .identity       = "SA1100/PXA255 Watchdog",
-};
-
-static int sa1100dog_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       int ret = -ENOTTY;
-       int time;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = copy_to_user(argp, &ident,
-                                  sizeof(ident)) ? -EFAULT : 0;
-               break;
-
-       case WDIOC_GETSTATUS:
-               ret = put_user(0, p);
-               break;
-
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(boot_status, p);
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(time, p);
-               if (ret)
-                       break;
-
-               if (time <= 0 || time > 255) {
-                       ret = -EINVAL;
-                       break;
-               }
-
-               pre_margin = OSCR_FREQ * time;
-               OSMR3 = OSCR + pre_margin;
-               /*fall through*/
-
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(pre_margin / OSCR_FREQ, p);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               OSMR3 = OSCR + pre_margin;
-               ret = 0;
-               break;
-       }
-       return ret;
-}
-
-static const struct file_operations sa1100dog_fops =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = sa1100dog_write,
-       .ioctl          = sa1100dog_ioctl,
-       .open           = sa1100dog_open,
-       .release        = sa1100dog_release,
-};
-
-static struct miscdevice sa1100dog_miscdev =
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &sa1100dog_fops,
-};
-
-static int margin __initdata = 60;             /* (secs) Default is 1 minute */
-
-static int __init sa1100dog_init(void)
-{
-       int ret;
-
-       /*
-        * Read the reset status, and save it for later.  If
-        * we suspend, RCSR will be cleared, and the watchdog
-        * reset reason will be lost.
-        */
-       boot_status = (RCSR & RCSR_WDR) ? WDIOF_CARDRESET : 0;
-       pre_margin = OSCR_FREQ * margin;
-
-       ret = misc_register(&sa1100dog_miscdev);
-       if (ret == 0)
-               printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
-                      margin);
-       return ret;
-}
-
-static void __exit sa1100dog_exit(void)
-{
-       misc_deregister(&sa1100dog_miscdev);
-}
-
-module_init(sa1100dog_init);
-module_exit(sa1100dog_exit);
-
-MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
-MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog");
-
-module_param(margin, int, 0);
-MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
deleted file mode 100644 (file)
index e4f3cb6..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- *     60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x
- *
- *      Based on acquirewdt.c by Alan Cox.
- *
- *     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 author does NOT admit liability nor provide warranty for
- *     any of this software. This material is provided "AS-IS" in
- *     the hope that it may be useful for others.
- *
- *     (c) Copyright 2000    Jakob Oestergaard <jakob@unthought.net>
- *
- *           12/4 - 2000      [Initial revision]
- *           25/4 - 2000      Added /dev/watchdog support
- *           09/5 - 2001      [smj@oro.net] fixed fop_write to "return 1" on success
- *           12/4 - 2002      [rob@osinvestor.com] eliminate fop_read
- *                            fix possible wdt_is_open race
- *                            add CONFIG_WATCHDOG_NOWAYOUT support
- *                            remove lock_kernel/unlock_kernel pairs
- *                            added KERN_* to printk's
- *                            got rid of extraneous comments
- *                            changed watchdog_info to correctly reflect what the driver offers
- *                            added WDIOC_GETSTATUS, WDIOC_GETBOOTSTATUS, WDIOC_SETTIMEOUT,
- *                            WDIOC_GETTIMEOUT, and WDIOC_SETOPTIONS ioctls
- *           09/8 - 2003      [wim@iguana.be] cleanup of trailing spaces
- *                            use module_param
- *                            made timeout (the emulated heartbeat) a module_param
- *                            made the keepalive ping an internal subroutine
- *                            made wdt_stop and wdt_start module params
- *                            added extra printk's for startup problems
- *                            added MODULE_AUTHOR and MODULE_DESCRIPTION info
- *
- *
- *  This WDT driver is different from the other Linux WDT
- *  drivers in the following ways:
- *  *)  The driver will ping the watchdog by itself, because this
- *      particular WDT has a very short timeout (one second) and it
- *      would be insane to count on any userspace daemon always
- *      getting scheduled within that time frame.
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/jiffies.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define OUR_NAME "sbc60xxwdt"
-#define PFX OUR_NAME ": "
-
-/*
- * You must set these - The driver cannot probe for the settings
- */
-
-static int wdt_stop = 0x45;
-module_param(wdt_stop, int, 0);
-MODULE_PARM_DESC(wdt_stop, "SBC60xx WDT 'stop' io port (default 0x45)");
-
-static int wdt_start = 0x443;
-module_param(wdt_start, int, 0);
-MODULE_PARM_DESC(wdt_start, "SBC60xx WDT 'start' io port (default 0x443)");
-
-/*
- * The 60xx board can use watchdog timeout values from one second
- * to several minutes.  The default is one second, so if we reset
- * the watchdog every ~250ms we should be safe.
- */
-
-#define WDT_INTERVAL (HZ/4+1)
-
-/*
- * We must not require too good response from the userspace daemon.
- * Here we require the userspace daemon to send us a heartbeat
- * char to /dev/watchdog every 30 seconds.
- * If the daemon pulses us every 25 seconds, we can still afford
- * a 5 second scheduling delay on the (high priority) daemon. That
- * should be sufficient for a box under any load.
- */
-
-#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void wdt_timer_ping(unsigned long);
-static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
-static unsigned long next_heartbeat;
-static unsigned long wdt_is_open;
-static char wdt_expect_close;
-
-/*
- *     Whack the dog
- */
-
-static void wdt_timer_ping(unsigned long data)
-{
-       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
-        * we agree to ping the WDT
-        */
-       if(time_before(jiffies, next_heartbeat))
-       {
-               /* Ping the WDT by reading from wdt_start */
-               inb_p(wdt_start);
-               /* Re-set the timer interval */
-               mod_timer(&timer, jiffies + WDT_INTERVAL);
-       } else {
-               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
-       }
-}
-
-/*
- * Utility routines
- */
-
-static void wdt_startup(void)
-{
-       next_heartbeat = jiffies + (timeout * HZ);
-
-       /* Start the timer */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
-}
-
-static void wdt_turnoff(void)
-{
-       /* Stop the timer */
-       del_timer(&timer);
-       inb_p(wdt_stop);
-       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
-}
-
-static void wdt_keepalive(void)
-{
-       /* user land ping */
-       next_heartbeat = jiffies + (timeout * HZ);
-}
-
-/*
- * /dev/watchdog handling
- */
-
-static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if(count)
-       {
-               if (!nowayout)
-               {
-                       size_t ofs;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       wdt_expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for(ofs = 0; ofs != count; ofs++)
-                       {
-                               char c;
-                               if(get_user(c, buf+ofs))
-                                       return -EFAULT;
-                               if(c == 'V')
-                                       wdt_expect_close = 42;
-                       }
-               }
-
-               /* Well, anyhow someone wrote to us, we should return that favour */
-               wdt_keepalive();
-       }
-       return count;
-}
-
-static int fop_open(struct inode * inode, struct file * file)
-{
-       /* Just in case we're already talking to someone... */
-       if(test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Good, fire up the show */
-       wdt_startup();
-       return nonseekable_open(inode, file);
-}
-
-static int fop_close(struct inode * inode, struct file * file)
-{
-       if(wdt_expect_close == 42)
-               wdt_turnoff();
-       else {
-               del_timer(&timer);
-               printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
-       }
-       clear_bit(0, &wdt_is_open);
-       wdt_expect_close = 0;
-       return 0;
-}
-
-static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident=
-       {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "SBC60xx",
-       };
-
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_keepalive();
-                       return 0;
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if(get_user(new_options, p))
-                               return -EFAULT;
-
-                       if(new_options & WDIOS_DISABLECARD) {
-                               wdt_turnoff();
-                               retval = 0;
-                       }
-
-                       if(new_options & WDIOS_ENABLECARD) {
-                               wdt_startup();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_timeout;
-
-                       if(get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
-                               return -EINVAL;
-
-                       timeout = new_timeout;
-                       wdt_keepalive();
-                       /* Fall through */
-               }
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout, p);
-       }
-}
-
-static const struct file_operations wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = fop_write,
-       .open           = fop_open,
-       .release        = fop_close,
-       .ioctl          = fop_ioctl,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &wdt_fops,
-};
-
-/*
- *     Notifier for system down
- */
-
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if(code==SYS_DOWN || code==SYS_HALT)
-               wdt_turnoff();
-       return NOTIFY_DONE;
-}
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier=
-{
-       .notifier_call = wdt_notify_sys,
-};
-
-static void __exit sbc60xxwdt_unload(void)
-{
-       wdt_turnoff();
-
-       /* Deregister */
-       misc_deregister(&wdt_miscdev);
-
-       unregister_reboot_notifier(&wdt_notifier);
-       if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
-               release_region(wdt_stop,1);
-       release_region(wdt_start,1);
-}
-
-static int __init sbc60xxwdt_init(void)
-{
-       int rc = -EBUSY;
-
-       if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
-       {
-               timeout = WATCHDOG_TIMEOUT;
-               printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
-                       timeout);
-       }
-
-       if (!request_region(wdt_start, 1, "SBC 60XX WDT"))
-       {
-               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       wdt_start);
-               rc = -EIO;
-               goto err_out;
-       }
-
-       /* We cannot reserve 0x45 - the kernel already has! */
-       if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
-       {
-               if (!request_region(wdt_stop, 1, "SBC 60XX WDT"))
-               {
-                       printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                               wdt_stop);
-                       rc = -EIO;
-                       goto err_out_region1;
-               }
-       }
-
-       rc = misc_register(&wdt_miscdev);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       wdt_miscdev.minor, rc);
-               goto err_out_region2;
-       }
-
-       rc = register_reboot_notifier(&wdt_notifier);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_miscdev;
-       }
-
-       printk(KERN_INFO PFX "WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-       return 0;
-
-err_out_miscdev:
-       misc_deregister(&wdt_miscdev);
-err_out_region2:
-       if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
-               release_region(wdt_stop,1);
-err_out_region1:
-       release_region(wdt_start,1);
-err_out:
-       return rc;
-}
-
-module_init(sbc60xxwdt_init);
-module_exit(sbc60xxwdt_unload);
-
-MODULE_AUTHOR("Jakob Oestergaard <jakob@unthought.net>");
-MODULE_DESCRIPTION("60xx Single Board Computer Watchdog Timer driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/sbc8360.c b/drivers/char/watchdog/sbc8360.c
deleted file mode 100644 (file)
index 285d852..0000000
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- *     SBC8360 Watchdog driver
- *
- *     (c) Copyright 2005 Webcon, Inc.
- *
- *     Based on ib700wdt.c, which is based on advantechwdt.c which is based
- *      on acquirewdt.c which is based on wdt.c.
- *
- *     (c) Copyright 2001 Charles Howes <chowes@vsol.net>
- *
- *      Based on advantechwdt.c which is based on acquirewdt.c which
- *       is based on wdt.c.
- *
- *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
- *
- *     Based on acquirewdt.c which is based on wdt.c.
- *     Original copyright messages:
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
- *
- *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *           Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *           Added timeout module option to override default
- *
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/notifier.h>
-#include <linux/fs.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/moduleparam.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-static unsigned long sbc8360_is_open;
-static spinlock_t sbc8360_lock;
-static char expect_close;
-
-#define PFX "sbc8360: "
-
-/*
- *
- * Watchdog Timer Configuration
- *
- * The function of the watchdog timer is to reset the system automatically
- * and is defined at I/O port 0120H and 0121H.  To enable the watchdog timer
- * and allow the system to reset, write appropriate values from the table
- * below to I/O port 0120H and 0121H.  To disable the timer, write a zero
- * value to I/O port 0121H for the system to stop the watchdog function.
- *
- * The following describes how the timer should be programmed (according to
- * the vendor documentation)
- *
- * Enabling Watchdog:
- * MOV AX,000AH (enable, phase I)
- * MOV DX,0120H
- * OUT DX,AX
- * MOV AX,000BH (enable, phase II)
- * MOV DX,0120H
- * OUT DX,AX
- * MOV AX,000nH (set multiplier n, from 1-4)
- * MOV DX,0120H
- * OUT DX,AX
- * MOV AX,000mH (set base timer m, from 0-F)
- * MOV DX,0121H
- * OUT DX,AX
- *
- * Reset timer:
- * MOV AX,000mH (same as set base timer, above)
- * MOV DX,0121H
- * OUT DX,AX
- *
- * Disabling Watchdog:
- * MOV AX,0000H (a zero value)
- * MOV DX,0120H
- * OUT DX,AX
- *
- * Watchdog timeout configuration values:
- *             N
- *     M |     1       2       3       4
- *     --|----------------------------------
- *     0 |     0.5s    5s      50s     100s
- *     1 |     1s      10s     100s    200s
- *     2 |     1.5s    15s     150s    300s
- *     3 |     2s      20s     200s    400s
- *     4 |     2.5s    25s     250s    500s
- *     5 |     3s      30s     300s    600s
- *     6 |     3.5s    35s     350s    700s
- *     7 |     4s      40s     400s    800s
- *     8 |     4.5s    45s     450s    900s
- *     9 |     5s      50s     500s    1000s
- *     A |     5.5s    55s     550s    1100s
- *     B |     6s      60s     600s    1200s
- *     C |     6.5s    65s     650s    1300s
- *     D |     7s      70s     700s    1400s
- *     E |     7.5s    75s     750s    1500s
- *     F |     8s      80s     800s    1600s
- *
- * Another way to say the same things is:
- *  For N=1, Timeout = (M+1) * 0.5s
- *  For N=2, Timeout = (M+1) * 5s
- *  For N=3, Timeout = (M+1) * 50s
- *  For N=4, Timeout = (M+1) * 100s
- *
- */
-
-static int wd_times[64][2] = {
-       {0, 1},                 /* 0  = 0.5s */
-       {1, 1},                 /* 1  = 1s   */
-       {2, 1},                 /* 2  = 1.5s */
-       {3, 1},                 /* 3  = 2s   */
-       {4, 1},                 /* 4  = 2.5s */
-       {5, 1},                 /* 5  = 3s   */
-       {6, 1},                 /* 6  = 3.5s */
-       {7, 1},                 /* 7  = 4s   */
-       {8, 1},                 /* 8  = 4.5s */
-       {9, 1},                 /* 9  = 5s   */
-       {0xA, 1},               /* 10 = 5.5s */
-       {0xB, 1},               /* 11 = 6s   */
-       {0xC, 1},               /* 12 = 6.5s */
-       {0xD, 1},               /* 13 = 7s   */
-       {0xE, 1},               /* 14 = 7.5s */
-       {0xF, 1},               /* 15 = 8s   */
-       {0, 2},                 /* 16 = 5s  */
-       {1, 2},                 /* 17 = 10s */
-       {2, 2},                 /* 18 = 15s */
-       {3, 2},                 /* 19 = 20s */
-       {4, 2},                 /* 20 = 25s */
-       {5, 2},                 /* 21 = 30s */
-       {6, 2},                 /* 22 = 35s */
-       {7, 2},                 /* 23 = 40s */
-       {8, 2},                 /* 24 = 45s */
-       {9, 2},                 /* 25 = 50s */
-       {0xA, 2},               /* 26 = 55s */
-       {0xB, 2},               /* 27 = 60s */
-       {0xC, 2},               /* 28 = 65s */
-       {0xD, 2},               /* 29 = 70s */
-       {0xE, 2},               /* 30 = 75s */
-       {0xF, 2},               /* 31 = 80s */
-       {0, 3},                 /* 32 = 50s  */
-       {1, 3},                 /* 33 = 100s */
-       {2, 3},                 /* 34 = 150s */
-       {3, 3},                 /* 35 = 200s */
-       {4, 3},                 /* 36 = 250s */
-       {5, 3},                 /* 37 = 300s */
-       {6, 3},                 /* 38 = 350s */
-       {7, 3},                 /* 39 = 400s */
-       {8, 3},                 /* 40 = 450s */
-       {9, 3},                 /* 41 = 500s */
-       {0xA, 3},               /* 42 = 550s */
-       {0xB, 3},               /* 43 = 600s */
-       {0xC, 3},               /* 44 = 650s */
-       {0xD, 3},               /* 45 = 700s */
-       {0xE, 3},               /* 46 = 750s */
-       {0xF, 3},               /* 47 = 800s */
-       {0, 4},                 /* 48 = 100s */
-       {1, 4},                 /* 49 = 200s */
-       {2, 4},                 /* 50 = 300s */
-       {3, 4},                 /* 51 = 400s */
-       {4, 4},                 /* 52 = 500s */
-       {5, 4},                 /* 53 = 600s */
-       {6, 4},                 /* 54 = 700s */
-       {7, 4},                 /* 55 = 800s */
-       {8, 4},                 /* 56 = 900s */
-       {9, 4},                 /* 57 = 1000s */
-       {0xA, 4},               /* 58 = 1100s */
-       {0xB, 4},               /* 59 = 1200s */
-       {0xC, 4},               /* 60 = 1300s */
-       {0xD, 4},               /* 61 = 1400s */
-       {0xE, 4},               /* 62 = 1500s */
-       {0xF, 4}                /* 63 = 1600s */
-};
-
-#define SBC8360_ENABLE 0x120
-#define SBC8360_BASETIME 0x121
-
-static int timeout = 27;
-static int wd_margin = 0xB;
-static int wd_multiplier = 2;
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))");
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout,
-                "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Kernel methods.
- */
-
-/* Activate and pre-configure watchdog */
-static void sbc8360_activate(void)
-{
-       /* Enable the watchdog */
-       outb(0x0A, SBC8360_ENABLE);
-       msleep_interruptible(100);
-       outb(0x0B, SBC8360_ENABLE);
-       msleep_interruptible(100);
-       /* Set timeout multiplier */
-       outb(wd_multiplier, SBC8360_ENABLE);
-       msleep_interruptible(100);
-       /* Nothing happens until first sbc8360_ping() */
-}
-
-/* Kernel pings watchdog */
-static void sbc8360_ping(void)
-{
-       /* Write the base timer register */
-       outb(wd_margin, SBC8360_BASETIME);
-}
-
-/* Userspace pings kernel driver, or requests clean close */
-static ssize_t sbc8360_write(struct file *file, const char __user * buf,
-                            size_t count, loff_t * ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               sbc8360_ping();
-       }
-       return count;
-}
-
-static int sbc8360_open(struct inode *inode, struct file *file)
-{
-       spin_lock(&sbc8360_lock);
-       if (test_and_set_bit(0, &sbc8360_is_open)) {
-               spin_unlock(&sbc8360_lock);
-               return -EBUSY;
-       }
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Activate and ping once to start the countdown */
-       spin_unlock(&sbc8360_lock);
-       sbc8360_activate();
-       sbc8360_ping();
-       return nonseekable_open(inode, file);
-}
-
-static int sbc8360_close(struct inode *inode, struct file *file)
-{
-       spin_lock(&sbc8360_lock);
-       if (expect_close == 42)
-               outb(0, SBC8360_ENABLE);
-       else
-               printk(KERN_CRIT PFX
-                      "SBC8360 device closed unexpectedly.  SBC8360 will not stop!\n");
-
-       clear_bit(0, &sbc8360_is_open);
-       expect_close = 0;
-       spin_unlock(&sbc8360_lock);
-       return 0;
-}
-
-/*
- *     Notifier for system down
- */
-
-static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code,
-                             void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT) {
-               /* Disable the SBC8360 Watchdog */
-               outb(0, SBC8360_ENABLE);
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations sbc8360_fops = {
-       .owner = THIS_MODULE,
-       .llseek = no_llseek,
-       .write = sbc8360_write,
-       .open = sbc8360_open,
-       .release = sbc8360_close,
-};
-
-static struct miscdevice sbc8360_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &sbc8360_fops,
-};
-
-/*
- *     The SBC8360 needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block sbc8360_notifier = {
-       .notifier_call = sbc8360_notify_sys,
-};
-
-static int __init sbc8360_init(void)
-{
-       int res;
-       unsigned long int mseconds = 60000;
-
-       if (timeout < 0 || timeout > 63) {
-               printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n");
-               res = -EINVAL;
-               goto out;
-       }
-
-       if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) {
-               printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n",
-                      SBC8360_ENABLE);
-               res = -EIO;
-               goto out;
-       }
-       if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) {
-               printk(KERN_ERR PFX
-                      "BASETIME method I/O %X is not available.\n",
-                      SBC8360_BASETIME);
-               res = -EIO;
-               goto out_nobasetimereg;
-       }
-
-       res = register_reboot_notifier(&sbc8360_notifier);
-       if (res) {
-               printk(KERN_ERR PFX "Failed to register reboot notifier.\n");
-               goto out_noreboot;
-       }
-
-       spin_lock_init(&sbc8360_lock);
-       res = misc_register(&sbc8360_miscdev);
-       if (res) {
-               printk(KERN_ERR PFX "failed to register misc device\n");
-               goto out_nomisc;
-       }
-
-       wd_margin = wd_times[timeout][0];
-       wd_multiplier = wd_times[timeout][1];
-
-       if (wd_multiplier == 1)
-               mseconds = (wd_margin + 1) * 500;
-       else if (wd_multiplier == 2)
-               mseconds = (wd_margin + 1) * 5000;
-       else if (wd_multiplier == 3)
-               mseconds = (wd_margin + 1) * 50000;
-       else if (wd_multiplier == 4)
-               mseconds = (wd_margin + 1) * 100000;
-
-       /* My kingdom for the ability to print "0.5 seconds" in the kernel! */
-       printk(KERN_INFO PFX "Timeout set at %ld ms.\n", mseconds);
-
-       return 0;
-
-      out_nomisc:
-       unregister_reboot_notifier(&sbc8360_notifier);
-      out_noreboot:
-       release_region(SBC8360_BASETIME, 1);
-      out_nobasetimereg:
-       release_region(SBC8360_ENABLE, 1);
-      out:
-       return res;
-}
-
-static void __exit sbc8360_exit(void)
-{
-       misc_deregister(&sbc8360_miscdev);
-       unregister_reboot_notifier(&sbc8360_notifier);
-       release_region(SBC8360_ENABLE, 1);
-       release_region(SBC8360_BASETIME, 1);
-}
-
-module_init(sbc8360_init);
-module_exit(sbc8360_exit);
-
-MODULE_AUTHOR("Ian E. Morgan <imorgan@webcon.ca>");
-MODULE_DESCRIPTION("SBC8360 watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_VERSION("1.01");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-/* end of sbc8360.c */
diff --git a/drivers/char/watchdog/sbc_epx_c3.c b/drivers/char/watchdog/sbc_epx_c3.c
deleted file mode 100644 (file)
index 82cbd88..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- *     SBC EPX C3 0.1  A Hardware Watchdog Device for the Winsystems EPX-C3
- *     single board computer
- *
- *     (c) Copyright 2006 Calin A. Culianu <calin@ajvar.org>, All Rights
- *     Reserved.
- *
- *     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.
- *
- *     based on softdog.c by Alan Cox <alan@redhat.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#define PFX "epx_c3: "
-static int epx_c3_alive;
-
-#define WATCHDOG_TIMEOUT 1             /* 1 sec default timeout */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-#define EPXC3_WATCHDOG_CTL_REG 0x1ee /* write 1 to enable, 0 to disable */
-#define EPXC3_WATCHDOG_PET_REG 0x1ef /* write anything to pet once enabled */
-
-static void epx_c3_start(void)
-{
-       outb(1, EPXC3_WATCHDOG_CTL_REG);
-}
-
-static void epx_c3_stop(void)
-{
-
-       outb(0, EPXC3_WATCHDOG_CTL_REG);
-
-       printk(KERN_INFO PFX "Stopped watchdog timer.\n");
-}
-
-static void epx_c3_pet(void)
-{
-       outb(1, EPXC3_WATCHDOG_PET_REG);
-}
-
-/*
- *     Allow only one person to hold it open
- */
-static int epx_c3_open(struct inode *inode, struct file *file)
-{
-       if (epx_c3_alive)
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Activate timer */
-       epx_c3_start();
-       epx_c3_pet();
-
-       epx_c3_alive = 1;
-       printk(KERN_INFO "Started watchdog timer.\n");
-
-       return nonseekable_open(inode, file);
-}
-
-static int epx_c3_release(struct inode *inode, struct file *file)
-{
-       /* Shut off the timer.
-        * Lock it in if it's a module and we defined ...NOWAYOUT */
-       if (!nowayout)
-               epx_c3_stop();          /* Turn the WDT off */
-
-       epx_c3_alive = 0;
-
-       return 0;
-}
-
-static ssize_t epx_c3_write(struct file *file, const char __user *data,
-                       size_t len, loff_t *ppos)
-{
-       /* Refresh the timer. */
-       if (len)
-               epx_c3_pet();
-       return len;
-}
-
-static int epx_c3_ioctl(struct inode *inode, struct file *file,
-                       unsigned int cmd, unsigned long arg)
-{
-       int options, retval = -EINVAL;
-       int __user *argp = (void __user *)arg;
-       static struct watchdog_info ident = {
-               .options                = WDIOF_KEEPALIVEPING |
-                                         WDIOF_MAGICCLOSE,
-               .firmware_version       = 0,
-               .identity               = "Winsystems EPX-C3 H/W Watchdog",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               return 0;
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, argp);
-       case WDIOC_KEEPALIVE:
-               epx_c3_pet();
-               return 0;
-       case WDIOC_GETTIMEOUT:
-               return put_user(WATCHDOG_TIMEOUT, argp);
-       case WDIOC_SETOPTIONS:
-               if (get_user(options, argp))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD) {
-                       epx_c3_stop();
-                       retval = 0;
-               }
-
-               if (options & WDIOS_ENABLECARD) {
-                       epx_c3_start();
-                       retval = 0;
-               }
-
-               return retval;
-       default:
-               return -ENOTTY;
-       }
-}
-
-static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code,
-                               void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-               epx_c3_stop();          /* Turn the WDT off */
-
-       return NOTIFY_DONE;
-}
-
-static const struct file_operations epx_c3_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = epx_c3_write,
-       .ioctl          = epx_c3_ioctl,
-       .open           = epx_c3_open,
-       .release        = epx_c3_release,
-};
-
-static struct miscdevice epx_c3_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &epx_c3_fops,
-};
-
-static struct notifier_block epx_c3_notifier = {
-       .notifier_call = epx_c3_notify_sys,
-};
-
-static const char banner[] __initdata =
-    KERN_INFO PFX "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n";
-
-static int __init watchdog_init(void)
-{
-       int ret;
-
-       if (!request_region(EPXC3_WATCHDOG_CTL_REG, 2, "epxc3_watchdog"))
-               return -EBUSY;
-
-       ret = register_reboot_notifier(&epx_c3_notifier);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register reboot notifier "
-                       "(err=%d)\n", ret);
-               goto out;
-       }
-
-       ret = misc_register(&epx_c3_miscdev);
-       if (ret) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d "
-                       "(err=%d)\n", WATCHDOG_MINOR, ret);
-               unregister_reboot_notifier(&epx_c3_notifier);
-               goto out;
-       }
-
-       printk(banner);
-
-       return 0;
-
-out:
-       release_region(EPXC3_WATCHDOG_CTL_REG, 2);
-       return ret;
-}
-
-static void __exit watchdog_exit(void)
-{
-       misc_deregister(&epx_c3_miscdev);
-       unregister_reboot_notifier(&epx_c3_notifier);
-       release_region(EPXC3_WATCHDOG_CTL_REG, 2);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);
-
-MODULE_AUTHOR("Calin A. Culianu <calin@ajvar.org>");
-MODULE_DESCRIPTION("Hardware Watchdog Device for Winsystems EPX-C3 SBC.  Note that there is no way to probe for this device -- so only use it if you are *sure* you are runnning on this specific SBC system from Winsystems!  It writes to IO ports 0x1ee and 0x1ef!");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
deleted file mode 100644 (file)
index 9670d47..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- *     National Semiconductor PC87307/PC97307 (ala SC1200) WDT driver
- *     (c) Copyright 2002 Zwane Mwaikambo <zwane@commfireservices.com>,
- *                     All Rights Reserved.
- *     Based on wdt.c and wdt977.c by Alan Cox and Woody Suwalski respectively.
- *
- *     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 author(s) of this software shall not be held liable for damages
- *     of any nature resulting due to the use of this software. This
- *     software is provided AS-IS with no warranties.
- *
- *     Changelog:
- *     20020220 Zwane Mwaikambo        Code based on datasheet, no hardware.
- *     20020221 Zwane Mwaikambo        Cleanups as suggested by Jeff Garzik and Alan Cox.
- *     20020222 Zwane Mwaikambo        Added probing.
- *     20020225 Zwane Mwaikambo        Added ISAPNP support.
- *     20020412 Rob Radez              Broke out start/stop functions
- *              <rob@osinvestor.com>   Return proper status instead of temperature warning
- *                                     Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls
- *                                     Fix CONFIG_WATCHDOG_NOWAYOUT
- *     20020530 Joel Becker            Add Matt Domsch's nowayout module option
- *     20030116 Adam Belay             Updated to the latest pnp code
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/spinlock.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/pnp.h>
-#include <linux/fs.h>
-
-#include <asm/semaphore.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#define SC1200_MODULE_VER      "build 20020303"
-#define SC1200_MODULE_NAME     "sc1200wdt"
-#define PFX                    SC1200_MODULE_NAME ": "
-
-#define        MAX_TIMEOUT     255     /* 255 minutes */
-#define PMIR           (io)    /* Power Management Index Register */
-#define PMDR           (io+1)  /* Power Management Data Register */
-
-/* Data Register indexes */
-#define FER1           0x00    /* Function enable register 1 */
-#define FER2           0x01    /* Function enable register 2 */
-#define PMC1           0x02    /* Power Management Ctrl 1 */
-#define PMC2           0x03    /* Power Management Ctrl 2 */
-#define PMC3           0x04    /* Power Management Ctrl 3 */
-#define WDTO           0x05    /* Watchdog timeout register */
-#define        WDCF            0x06    /* Watchdog config register */
-#define WDST           0x07    /* Watchdog status register */
-
-/* WDCF bitfields - which devices assert WDO */
-#define KBC_IRQ                0x01    /* Keyboard Controller */
-#define MSE_IRQ                0x02    /* Mouse */
-#define UART1_IRQ      0x03    /* Serial0 */
-#define UART2_IRQ      0x04    /* Serial1 */
-/* 5 -7 are reserved */
-
-static char banner[] __initdata = KERN_INFO PFX SC1200_MODULE_VER;
-static int timeout = 1;
-static int io = -1;
-static int io_len = 2;         /* for non plug and play */
-static struct semaphore open_sem;
-static char expect_close;
-static spinlock_t sc1200wdt_lock;      /* io port access serialisation */
-
-#if defined CONFIG_PNP
-static int isapnp = 1;
-static struct pnp_dev *wdt_dev;
-
-module_param(isapnp, int, 0);
-MODULE_PARM_DESC(isapnp, "When set to 0 driver ISA PnP support will be disabled");
-#endif
-
-module_param(io, int, 0);
-MODULE_PARM_DESC(io, "io port");
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-
-
-/* Read from Data Register */
-static inline void sc1200wdt_read_data(unsigned char index, unsigned char *data)
-{
-       spin_lock(&sc1200wdt_lock);
-       outb_p(index, PMIR);
-       *data = inb(PMDR);
-       spin_unlock(&sc1200wdt_lock);
-}
-
-
-/* Write to Data Register */
-static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
-{
-       spin_lock(&sc1200wdt_lock);
-       outb_p(index, PMIR);
-       outb(data, PMDR);
-       spin_unlock(&sc1200wdt_lock);
-}
-
-
-static void sc1200wdt_start(void)
-{
-       unsigned char reg;
-
-       sc1200wdt_read_data(WDCF, &reg);
-       /* assert WDO when any of the following interrupts are triggered too */
-       reg |= (KBC_IRQ | MSE_IRQ | UART1_IRQ | UART2_IRQ);
-       sc1200wdt_write_data(WDCF, reg);
-       /* set the timeout and get the ball rolling */
-       sc1200wdt_write_data(WDTO, timeout);
-}
-
-
-static void sc1200wdt_stop(void)
-{
-       sc1200wdt_write_data(WDTO, 0);
-}
-
-
-/* This returns the status of the WDO signal, inactive high. */
-static inline int sc1200wdt_status(void)
-{
-       unsigned char ret;
-
-       sc1200wdt_read_data(WDST, &ret);
-       /* If the bit is inactive, the watchdog is enabled, so return
-        * KEEPALIVEPING which is a bit of a kludge because there's nothing
-        * else for enabled/disabled status
-        */
-       return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING;  /* bits 1 - 7 are undefined */
-}
-
-
-static int sc1200wdt_open(struct inode *inode, struct file *file)
-{
-       /* allow one at a time */
-       if (down_trylock(&open_sem))
-               return -EBUSY;
-
-       if (timeout > MAX_TIMEOUT)
-               timeout = MAX_TIMEOUT;
-
-       sc1200wdt_start();
-       printk(KERN_INFO PFX "Watchdog enabled, timeout = %d min(s)", timeout);
-
-       return nonseekable_open(inode, file);
-}
-
-
-static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       int new_timeout;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 0,
-               .identity = "PC87307/PC97307",
-       };
-
-       switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       if (copy_to_user(argp, &ident, sizeof ident))
-                               return -EFAULT;
-                       return 0;
-
-               case WDIOC_GETSTATUS:
-                       return put_user(sc1200wdt_status(), p);
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-
-               case WDIOC_KEEPALIVE:
-                       sc1200wdt_write_data(WDTO, timeout);
-                       return 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       /* the API states this is given in secs */
-                       new_timeout /= 60;
-                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
-                               return -EINVAL;
-
-                       timeout = new_timeout;
-                       sc1200wdt_write_data(WDTO, timeout);
-                       /* fall through and return the new timeout */
-
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout * 60, p);
-
-               case WDIOC_SETOPTIONS:
-               {
-                       int options, retval = -EINVAL;
-
-                       if (get_user(options, p))
-                               return -EFAULT;
-
-                       if (options & WDIOS_DISABLECARD) {
-                               sc1200wdt_stop();
-                               retval = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               sc1200wdt_start();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-       }
-}
-
-
-static int sc1200wdt_release(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               sc1200wdt_stop();
-               printk(KERN_INFO PFX "Watchdog disabled\n");
-       } else {
-               sc1200wdt_write_data(WDTO, timeout);
-               printk(KERN_CRIT PFX "Unexpected close!, timeout = %d min(s)\n", timeout);
-       }
-       up(&open_sem);
-       expect_close = 0;
-
-       return 0;
-}
-
-
-static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
-{
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-
-               sc1200wdt_write_data(WDTO, timeout);
-               return len;
-       }
-
-       return 0;
-}
-
-
-static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-               sc1200wdt_stop();
-
-       return NOTIFY_DONE;
-}
-
-
-static struct notifier_block sc1200wdt_notifier =
-{
-       .notifier_call =        sc1200wdt_notify_sys,
-};
-
-static const struct file_operations sc1200wdt_fops =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = sc1200wdt_write,
-       .ioctl          = sc1200wdt_ioctl,
-       .open           = sc1200wdt_open,
-       .release        = sc1200wdt_release,
-};
-
-static struct miscdevice sc1200wdt_miscdev =
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &sc1200wdt_fops,
-};
-
-
-static int __init sc1200wdt_probe(void)
-{
-       /* The probe works by reading the PMC3 register's default value of 0x0e
-        * there is one caveat, if the device disables the parallel port or any
-        * of the UARTs we won't be able to detect it.
-        * Nb. This could be done with accuracy by reading the SID registers, but
-        * we don't have access to those io regions.
-        */
-
-       unsigned char reg;
-
-       sc1200wdt_read_data(PMC3, &reg);
-       reg &= 0x0f;                            /* we don't want the UART busy bits */
-       return (reg == 0x0e) ? 0 : -ENODEV;
-}
-
-
-#if defined CONFIG_PNP
-
-static struct pnp_device_id scl200wdt_pnp_devices[] = {
-       /* National Semiconductor PC87307/PC97307 watchdog component */
-       {.id = "NSC0800", .driver_data = 0},
-       {.id = ""},
-};
-
-static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
-{
-       /* this driver only supports one card at a time */
-       if (wdt_dev || !isapnp)
-               return -EBUSY;
-
-       wdt_dev = dev;
-       io = pnp_port_start(wdt_dev, 0);
-       io_len = pnp_port_len(wdt_dev, 0);
-
-       if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
-               printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
-               return -EBUSY;
-       }
-
-       printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", io, io_len);
-       return 0;
-}
-
-static void scl200wdt_pnp_remove(struct pnp_dev * dev)
-{
-       if (wdt_dev){
-               release_region(io, io_len);
-               wdt_dev = NULL;
-       }
-}
-
-static struct pnp_driver scl200wdt_pnp_driver = {
-       .name           = "scl200wdt",
-       .id_table       = scl200wdt_pnp_devices,
-       .probe          = scl200wdt_pnp_probe,
-       .remove         = scl200wdt_pnp_remove,
-};
-
-#endif /* CONFIG_PNP */
-
-
-static int __init sc1200wdt_init(void)
-{
-       int ret;
-
-       printk("%s\n", banner);
-
-       spin_lock_init(&sc1200wdt_lock);
-       sema_init(&open_sem, 1);
-
-#if defined CONFIG_PNP
-       if (isapnp) {
-               ret = pnp_register_driver(&scl200wdt_pnp_driver);
-               if (ret)
-                       goto out_clean;
-       }
-#endif
-
-       if (io == -1) {
-               printk(KERN_ERR PFX "io parameter must be specified\n");
-               ret = -EINVAL;
-               goto out_pnp;
-       }
-
-#if defined CONFIG_PNP
-       /* now that the user has specified an IO port and we haven't detected
-        * any devices, disable pnp support */
-       isapnp = 0;
-       pnp_unregister_driver(&scl200wdt_pnp_driver);
-#endif
-
-       if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
-               printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
-               ret = -EBUSY;
-               goto out_pnp;
-       }
-
-       ret = sc1200wdt_probe();
-       if (ret)
-               goto out_io;
-
-       ret = register_reboot_notifier(&sc1200wdt_notifier);
-       if (ret) {
-               printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret);
-               goto out_io;
-       }
-
-       ret = misc_register(&sc1200wdt_miscdev);
-       if (ret) {
-               printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
-               goto out_rbt;
-       }
-
-       /* ret = 0 */
-
-out_clean:
-       return ret;
-
-out_rbt:
-       unregister_reboot_notifier(&sc1200wdt_notifier);
-
-out_io:
-       release_region(io, io_len);
-
-out_pnp:
-#if defined CONFIG_PNP
-       if (isapnp)
-               pnp_unregister_driver(&scl200wdt_pnp_driver);
-#endif
-       goto out_clean;
-}
-
-
-static void __exit sc1200wdt_exit(void)
-{
-       misc_deregister(&sc1200wdt_miscdev);
-       unregister_reboot_notifier(&sc1200wdt_notifier);
-
-#if defined CONFIG_PNP
-       if(isapnp)
-               pnp_unregister_driver(&scl200wdt_pnp_driver);
-       else
-#endif
-       release_region(io, io_len);
-}
-
-module_init(sc1200wdt_init);
-module_exit(sc1200wdt_exit);
-
-MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>");
-MODULE_DESCRIPTION("Driver for National Semiconductor PC87307/PC97307 watchdog component");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c
deleted file mode 100644 (file)
index e8594c6..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- *     AMD Elan SC520 processor Watchdog Timer driver
- *
- *      Based on acquirewdt.c by Alan Cox,
- *           and sbc60xxwdt.c by Jakob Oestergaard <jakob@unthought.net>
- *
- *     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 authors do NOT admit liability nor provide warranty for
- *     any of this software. This material is provided "AS-IS" in
- *      the hope that it may be useful for others.
- *
- *     (c) Copyright 2001    Scott Jennings <linuxdrivers@oro.net>
- *           9/27 - 2001      [Initial release]
- *
- *     Additional fixes Alan Cox
- *     -       Fixed formatting
- *     -       Removed debug printks
- *     -       Fixed SMP built kernel deadlock
- *     -       Switched to private locks not lock_kernel
- *     -       Used ioremap/writew/readw
- *     -       Added NOWAYOUT support
- *     4/12 - 2002 Changes by Rob Radez <rob@osinvestor.com>
- *     -       Change comments
- *     -       Eliminate fop_llseek
- *     -       Change CONFIG_WATCHDOG_NOWAYOUT semantics
- *     -       Add KERN_* tags to printks
- *     -       fix possible wdt_is_open race
- *     -       Report proper capabilities in watchdog_info
- *     -       Add WDIOC_{GETSTATUS, GETBOOTSTATUS, SETTIMEOUT,
- *             GETTIMEOUT, SETOPTIONS} ioctls
- *     09/8 - 2003 Changes by Wim Van Sebroeck <wim@iguana.be>
- *     -       cleanup of trailing spaces
- *     -       added extra printk's for startup problems
- *     -       use module_param
- *     -       made timeout (the emulated heartbeat) a module_param
- *     -       made the keepalive ping an internal subroutine
- *     3/27 - 2004 Changes by Sean Young <sean@mess.org>
- *     -       set MMCR_BASE to 0xfffef000
- *     -       CBAR does not need to be read
- *     -       removed debugging printks
- *
- *  This WDT driver is different from most other Linux WDT
- *  drivers in that the driver will ping the watchdog by itself,
- *  because this particular WDT has a very short timeout (1.6
- *  seconds) and it would be insane to count on any userspace
- *  daemon always getting scheduled within that time frame.
- *
- *  This driver uses memory mapped IO, and spinlock.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/jiffies.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define OUR_NAME "sc520_wdt"
-#define PFX OUR_NAME ": "
-
-/*
- * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7)
- *
- *   0: 492us    2: 1.01s    4: 4.03s   6: 16.22s
- *   1: 503ms    3: 2.01s    5: 8.05s   7: 32.21s
- *
- * We will program the SC520 watchdog for a timeout of 2.01s.
- * If we reset the watchdog every ~250ms we should be safe.
- */
-
-#define WDT_INTERVAL (HZ/4+1)
-
-/*
- * We must not require too good response from the userspace daemon.
- * Here we require the userspace daemon to send us a heartbeat
- * char to /dev/watchdog every 30 seconds.
- */
-
-#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- * AMD Elan SC520 - Watchdog Timer Registers
- */
-#define MMCR_BASE      0xfffef000      /* The default base address */
-#define OFFS_WDTMRCTL  0xCB0   /* Watchdog Timer Control Register */
-
-/* WDT Control Register bit definitions */
-#define WDT_EXP_SEL_01 0x0001  /* [01] Time-out = 496 us (with 33 Mhz clk). */
-#define WDT_EXP_SEL_02 0x0002  /* [02] Time-out = 508 ms (with 33 Mhz clk). */
-#define WDT_EXP_SEL_03 0x0004  /* [03] Time-out = 1.02 s (with 33 Mhz clk). */
-#define WDT_EXP_SEL_04 0x0008  /* [04] Time-out = 2.03 s (with 33 Mhz clk). */
-#define WDT_EXP_SEL_05 0x0010  /* [05] Time-out = 4.07 s (with 33 Mhz clk). */
-#define WDT_EXP_SEL_06 0x0020  /* [06] Time-out = 8.13 s (with 33 Mhz clk). */
-#define WDT_EXP_SEL_07 0x0040  /* [07] Time-out = 16.27s (with 33 Mhz clk). */
-#define WDT_EXP_SEL_08 0x0080  /* [08] Time-out = 32.54s (with 33 Mhz clk). */
-#define WDT_IRQ_FLG    0x1000  /* [12] Interrupt Request Flag */
-#define WDT_WRST_ENB   0x4000  /* [14] Watchdog Timer Reset Enable */
-#define WDT_ENB                0x8000  /* [15] Watchdog Timer Enable */
-
-static __u16 __iomem *wdtmrctl;
-
-static void wdt_timer_ping(unsigned long);
-static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
-static unsigned long next_heartbeat;
-static unsigned long wdt_is_open;
-static char wdt_expect_close;
-static spinlock_t wdt_spinlock;
-
-/*
- *     Whack the dog
- */
-
-static void wdt_timer_ping(unsigned long data)
-{
-       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
-        * we agree to ping the WDT
-        */
-       if(time_before(jiffies, next_heartbeat))
-       {
-               /* Ping the WDT */
-               spin_lock(&wdt_spinlock);
-               writew(0xAAAA, wdtmrctl);
-               writew(0x5555, wdtmrctl);
-               spin_unlock(&wdt_spinlock);
-
-               /* Re-set the timer interval */
-               mod_timer(&timer, jiffies + WDT_INTERVAL);
-       } else {
-               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
-       }
-}
-
-/*
- *     Utility routines
- */
-
-static void wdt_config(int writeval)
-{
-       __u16 dummy;
-       unsigned long flags;
-
-       /* buy some time (ping) */
-       spin_lock_irqsave(&wdt_spinlock, flags);
-       dummy=readw(wdtmrctl);  /* ensure write synchronization */
-       writew(0xAAAA, wdtmrctl);
-       writew(0x5555, wdtmrctl);
-       /* unlock WDT = make WDT configuration register writable one time */
-       writew(0x3333, wdtmrctl);
-       writew(0xCCCC, wdtmrctl);
-       /* write WDT configuration register */
-       writew(writeval, wdtmrctl);
-       spin_unlock_irqrestore(&wdt_spinlock, flags);
-}
-
-static int wdt_startup(void)
-{
-       next_heartbeat = jiffies + (timeout * HZ);
-
-       /* Start the timer */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-
-       /* Start the watchdog */
-       wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04);
-
-       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
-       return 0;
-}
-
-static int wdt_turnoff(void)
-{
-       /* Stop the timer */
-       del_timer(&timer);
-
-       /* Stop the watchdog */
-       wdt_config(0);
-
-       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
-       return 0;
-}
-
-static int wdt_keepalive(void)
-{
-       /* user land ping */
-       next_heartbeat = jiffies + (timeout * HZ);
-       return 0;
-}
-
-static int wdt_set_heartbeat(int t)
-{
-       if ((t < 1) || (t > 3600))      /* arbitrary upper limit */
-               return -EINVAL;
-
-       timeout = t;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if(count) {
-               if (!nowayout) {
-                       size_t ofs;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       wdt_expect_close = 0;
-
-                       /* now scan */
-                       for(ofs = 0; ofs != count; ofs++) {
-                               char c;
-                               if (get_user(c, buf + ofs))
-                                       return -EFAULT;
-                               if(c == 'V')
-                                       wdt_expect_close = 42;
-                       }
-               }
-
-               /* Well, anyhow someone wrote to us, we should return that favour */
-               wdt_keepalive();
-       }
-       return count;
-}
-
-static int fop_open(struct inode * inode, struct file * file)
-{
-       /* Just in case we're already talking to someone... */
-       if(test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Good, fire up the show */
-       wdt_startup();
-       return nonseekable_open(inode, file);
-}
-
-static int fop_close(struct inode * inode, struct file * file)
-{
-       if(wdt_expect_close == 42) {
-               wdt_turnoff();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               wdt_keepalive();
-       }
-       clear_bit(0, &wdt_is_open);
-       wdt_expect_close = 0;
-       return 0;
-}
-
-static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "SC520",
-       };
-
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_keepalive();
-                       return 0;
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if(get_user(new_options, p))
-                               return -EFAULT;
-
-                       if(new_options & WDIOS_DISABLECARD) {
-                               wdt_turnoff();
-                               retval = 0;
-                       }
-
-                       if(new_options & WDIOS_ENABLECARD) {
-                               wdt_startup();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_timeout;
-
-                       if(get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       if(wdt_set_heartbeat(new_timeout))
-                               return -EINVAL;
-
-                       wdt_keepalive();
-                       /* Fall through */
-               }
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout, p);
-       }
-}
-
-static const struct file_operations wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = fop_write,
-       .open           = fop_open,
-       .release        = fop_close,
-       .ioctl          = fop_ioctl,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &wdt_fops,
-};
-
-/*
- *     Notifier for system down
- */
-
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if(code==SYS_DOWN || code==SYS_HALT)
-               wdt_turnoff();
-       return NOTIFY_DONE;
-}
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier = {
-       .notifier_call = wdt_notify_sys,
-};
-
-static void __exit sc520_wdt_unload(void)
-{
-       if (!nowayout)
-               wdt_turnoff();
-
-       /* Deregister */
-       misc_deregister(&wdt_miscdev);
-       unregister_reboot_notifier(&wdt_notifier);
-       iounmap(wdtmrctl);
-}
-
-static int __init sc520_wdt_init(void)
-{
-       int rc = -EBUSY;
-
-       spin_lock_init(&wdt_spinlock);
-
-       /* Check that the timeout value is within it's range ; if not reset to the default */
-       if (wdt_set_heartbeat(timeout)) {
-               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
-               printk(KERN_INFO PFX "timeout value must be 1<=timeout<=3600, using %d\n",
-                       WATCHDOG_TIMEOUT);
-       }
-
-       wdtmrctl = ioremap((unsigned long)(MMCR_BASE + OFFS_WDTMRCTL), 2);
-       if (!wdtmrctl) {
-               printk(KERN_ERR PFX "Unable to remap memory\n");
-               rc = -ENOMEM;
-               goto err_out_region2;
-       }
-
-       rc = register_reboot_notifier(&wdt_notifier);
-       if (rc) {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_ioremap;
-       }
-
-       rc = misc_register(&wdt_miscdev);
-       if (rc) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, rc);
-               goto err_out_notifier;
-       }
-
-       printk(KERN_INFO PFX "WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n",
-               timeout,nowayout);
-
-       return 0;
-
-err_out_notifier:
-       unregister_reboot_notifier(&wdt_notifier);
-err_out_ioremap:
-       iounmap(wdtmrctl);
-err_out_region2:
-       return rc;
-}
-
-module_init(sc520_wdt_init);
-module_exit(sc520_wdt_unload);
-
-MODULE_AUTHOR("Scott and Bill Jennings");
-MODULE_DESCRIPTION("Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
deleted file mode 100644 (file)
index d4fd0fa..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/* drivers/char/watchdog/scx200_wdt.c
-
-   National Semiconductor SCx200 Watchdog support
-
-   Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
-
-   Some code taken from:
-   National Semiconductor PC87307/PC97307 (ala SC1200) WDT driver
-   (c) Copyright 2002 Zwane Mwaikambo <zwane@commfireservices.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 the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The author(s) of this software shall not be held liable for damages
-   of any nature resulting due to the use of this software. This
-   software is provided AS-IS with no warranties. */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/scx200.h>
-
-#include <asm/uaccess.h>
-#include <asm/io.h>
-
-#define NAME "scx200_wdt"
-
-MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
-MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-static int margin = 60;                /* in seconds */
-module_param(margin, int, 0);
-MODULE_PARM_DESC(margin, "Watchdog margin in seconds");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
-
-static u16 wdto_restart;
-static struct semaphore open_semaphore;
-static char expect_close;
-
-/* Bits of the WDCNFG register */
-#define W_ENABLE 0x00fa                /* Enable watchdog */
-#define W_DISABLE 0x0000       /* Disable watchdog */
-
-/* The scaling factor for the timer, this depends on the value of W_ENABLE */
-#define W_SCALE (32768/1024)
-
-static void scx200_wdt_ping(void)
-{
-       outw(wdto_restart, scx200_cb_base + SCx200_WDT_WDTO);
-}
-
-static void scx200_wdt_update_margin(void)
-{
-       printk(KERN_INFO NAME ": timer margin %d seconds\n", margin);
-       wdto_restart = margin * W_SCALE;
-}
-
-static void scx200_wdt_enable(void)
-{
-       printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n",
-              wdto_restart);
-
-       outw(0, scx200_cb_base + SCx200_WDT_WDTO);
-       outb(SCx200_WDT_WDSTS_WDOVF, scx200_cb_base + SCx200_WDT_WDSTS);
-       outw(W_ENABLE, scx200_cb_base + SCx200_WDT_WDCNFG);
-
-       scx200_wdt_ping();
-}
-
-static void scx200_wdt_disable(void)
-{
-       printk(KERN_DEBUG NAME ": disabling watchdog timer\n");
-
-       outw(0, scx200_cb_base + SCx200_WDT_WDTO);
-       outb(SCx200_WDT_WDSTS_WDOVF, scx200_cb_base + SCx200_WDT_WDSTS);
-       outw(W_DISABLE, scx200_cb_base + SCx200_WDT_WDCNFG);
-}
-
-static int scx200_wdt_open(struct inode *inode, struct file *file)
-{
-       /* only allow one at a time */
-       if (down_trylock(&open_semaphore))
-               return -EBUSY;
-       scx200_wdt_enable();
-
-       return nonseekable_open(inode, file);
-}
-
-static int scx200_wdt_release(struct inode *inode, struct file *file)
-{
-       if (expect_close != 42) {
-               printk(KERN_WARNING NAME ": watchdog device closed unexpectedly, will not disable the watchdog timer\n");
-       } else if (!nowayout) {
-               scx200_wdt_disable();
-       }
-       expect_close = 0;
-       up(&open_semaphore);
-
-       return 0;
-}
-
-static int scx200_wdt_notify_sys(struct notifier_block *this,
-                                     unsigned long code, void *unused)
-{
-       if (code == SYS_HALT || code == SYS_POWER_OFF)
-               if (!nowayout)
-                       scx200_wdt_disable();
-
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block scx200_wdt_notifier =
-{
-       .notifier_call = scx200_wdt_notify_sys,
-};
-
-static ssize_t scx200_wdt_write(struct file *file, const char __user *data,
-                                    size_t len, loff_t *ppos)
-{
-       /* check for a magic close character */
-       if (len)
-       {
-               size_t i;
-
-               scx200_wdt_ping();
-
-               expect_close = 0;
-               for (i = 0; i < len; ++i) {
-                       char c;
-                       if (get_user(c, data+i))
-                               return -EFAULT;
-                       if (c == 'V')
-                               expect_close = 42;
-               }
-
-               return len;
-       }
-
-       return 0;
-}
-
-static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .identity = "NatSemi SCx200 Watchdog",
-               .firmware_version = 1,
-               .options = (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING),
-       };
-       int new_margin;
-
-       switch (cmd) {
-       default:
-               return -ENOTTY;
-       case WDIOC_GETSUPPORT:
-               if(copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               return 0;
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               if (put_user(0, p))
-                       return -EFAULT;
-               return 0;
-       case WDIOC_KEEPALIVE:
-               scx200_wdt_ping();
-               return 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_margin, p))
-                       return -EFAULT;
-               if (new_margin < 1)
-                       return -EINVAL;
-               margin = new_margin;
-               scx200_wdt_update_margin();
-               scx200_wdt_ping();
-       case WDIOC_GETTIMEOUT:
-               if (put_user(margin, p))
-                       return -EFAULT;
-               return 0;
-       }
-}
-
-static const struct file_operations scx200_wdt_fops = {
-       .owner   = THIS_MODULE,
-       .llseek  = no_llseek,
-       .write   = scx200_wdt_write,
-       .ioctl   = scx200_wdt_ioctl,
-       .open    = scx200_wdt_open,
-       .release = scx200_wdt_release,
-};
-
-static struct miscdevice scx200_wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name  = "watchdog",
-       .fops  = &scx200_wdt_fops,
-};
-
-static int __init scx200_wdt_init(void)
-{
-       int r;
-
-       printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n");
-
-       /* check that we have found the configuration block */
-       if (!scx200_cb_present())
-               return -ENODEV;
-
-       if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET,
-                           SCx200_WDT_SIZE,
-                           "NatSemi SCx200 Watchdog")) {
-               printk(KERN_WARNING NAME ": watchdog I/O region busy\n");
-               return -EBUSY;
-       }
-
-       scx200_wdt_update_margin();
-       scx200_wdt_disable();
-
-       sema_init(&open_semaphore, 1);
-
-       r = misc_register(&scx200_wdt_miscdev);
-       if (r) {
-               release_region(scx200_cb_base + SCx200_WDT_OFFSET,
-                               SCx200_WDT_SIZE);
-               return r;
-       }
-
-       r = register_reboot_notifier(&scx200_wdt_notifier);
-       if (r) {
-               printk(KERN_ERR NAME ": unable to register reboot notifier");
-               misc_deregister(&scx200_wdt_miscdev);
-               release_region(scx200_cb_base + SCx200_WDT_OFFSET,
-                               SCx200_WDT_SIZE);
-               return r;
-       }
-
-       return 0;
-}
-
-static void __exit scx200_wdt_cleanup(void)
-{
-       unregister_reboot_notifier(&scx200_wdt_notifier);
-       misc_deregister(&scx200_wdt_miscdev);
-       release_region(scx200_cb_base + SCx200_WDT_OFFSET,
-                      SCx200_WDT_SIZE);
-}
-
-module_init(scx200_wdt_init);
-module_exit(scx200_wdt_cleanup);
-
-/*
-    Local variables:
-        compile-command: "make -k -C ../.. SUBDIRS=drivers/char modules"
-        c-basic-offset: 8
-    End:
-*/
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
deleted file mode 100644 (file)
index cecbedd..0000000
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * drivers/char/watchdog/shwdt.c
- *
- * Watchdog driver for integrated watchdog in the SuperH processors.
- *
- * Copyright (C) 2001, 2002, 2003 Paul Mundt <lethal@linux-sh.org>
- *
- * 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.
- *
- * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *     Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *
- * 19-Apr-2002 Rob Radez <rob@osinvestor.com>
- *     Added expect close support, made emulated timeout runtime changeable
- *     general cleanups, add some ioctls
- */
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/reboot.h>
-#include <linux/notifier.h>
-#include <linux/ioport.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/watchdog.h>
-
-#define PFX "shwdt: "
-
-/*
- * Default clock division ratio is 5.25 msecs. For an additional table of
- * values, consult the asm-sh/watchdog.h. Overload this at module load
- * time.
- *
- * In order for this to work reliably we need to have HZ set to 1000 or
- * something quite higher than 100 (or we need a proper high-res timer
- * implementation that will deal with this properly), otherwise the 10ms
- * resolution of a jiffy is enough to trigger the overflow. For things like
- * the SH-4 and SH-5, this isn't necessarily that big of a problem, though
- * for the SH-2 and SH-3, this isn't recommended unless the WDT is absolutely
- * necssary.
- *
- * As a result of this timing problem, the only modes that are particularly
- * feasible are the 4096 and the 2048 divisors, which yeild 5.25 and 2.62ms
- * overflow periods respectively.
- *
- * Also, since we can't really expect userspace to be responsive enough
- * before the overflow happens, we maintain two seperate timers .. One in
- * the kernel for clearing out WOVF every 2ms or so (again, this depends on
- * HZ == 1000), and another for monitoring userspace writes to the WDT device.
- *
- * As such, we currently use a configurable heartbeat interval which defaults
- * to 30s. In this case, the userspace daemon is only responsible for periodic
- * writes to the device before the next heartbeat is scheduled. If the daemon
- * misses its deadline, the kernel timer will allow the WDT to overflow.
- */
-static int clock_division_ratio = WTCSR_CKS_4096;
-
-#define next_ping_period(cks)  msecs_to_jiffies(cks - 4)
-
-static void sh_wdt_ping(unsigned long data);
-
-static unsigned long shwdt_is_open;
-static struct watchdog_info sh_wdt_info;
-static char shwdt_expect_close;
-static DEFINE_TIMER(timer, sh_wdt_ping, 0, 0);
-static unsigned long next_heartbeat;
-
-#define WATCHDOG_HEARTBEAT 30                  /* 30 sec default heartbeat */
-static int heartbeat = WATCHDOG_HEARTBEAT;     /* in seconds */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-/**
- *     sh_wdt_start - Start the Watchdog
- *
- *     Starts the watchdog.
- */
-static void sh_wdt_start(void)
-{
-       __u8 csr;
-
-       next_heartbeat = jiffies + (heartbeat * HZ);
-       mod_timer(&timer, next_ping_period(clock_division_ratio));
-
-       csr = sh_wdt_read_csr();
-       csr |= WTCSR_WT | clock_division_ratio;
-       sh_wdt_write_csr(csr);
-
-       sh_wdt_write_cnt(0);
-
-       /*
-        * These processors have a bit of an inconsistent initialization
-        * process.. starting with SH-3, RSTS was moved to WTCSR, and the
-        * RSTCSR register was removed.
-        *
-        * On the SH-2 however, in addition with bits being in different
-        * locations, we must deal with RSTCSR outright..
-        */
-       csr = sh_wdt_read_csr();
-       csr |= WTCSR_TME;
-       csr &= ~WTCSR_RSTS;
-       sh_wdt_write_csr(csr);
-
-#ifdef CONFIG_CPU_SH2
-       /*
-        * Whoever came up with the RSTCSR semantics must've been smoking
-        * some of the good stuff, since in addition to the WTCSR/WTCNT write
-        * brain-damage, it's managed to fuck things up one step further..
-        *
-        * If we need to clear the WOVF bit, the upper byte has to be 0xa5..
-        * but if we want to touch RSTE or RSTS, the upper byte has to be
-        * 0x5a..
-        */
-       csr = sh_wdt_read_rstcsr();
-       csr &= ~RSTCSR_RSTS;
-       sh_wdt_write_rstcsr(csr);
-#endif
-}
-
-/**
- *     sh_wdt_stop - Stop the Watchdog
- *     Stops the watchdog.
- */
-static void sh_wdt_stop(void)
-{
-       __u8 csr;
-
-       del_timer(&timer);
-
-       csr = sh_wdt_read_csr();
-       csr &= ~WTCSR_TME;
-       sh_wdt_write_csr(csr);
-}
-
-/**
- *     sh_wdt_keepalive - Keep the Userspace Watchdog Alive
- *     The Userspace watchdog got a KeepAlive: schedule the next heartbeat.
- */
-static inline void sh_wdt_keepalive(void)
-{
-       next_heartbeat = jiffies + (heartbeat * HZ);
-}
-
-/**
- *     sh_wdt_set_heartbeat - Set the Userspace Watchdog heartbeat
- *     Set the Userspace Watchdog heartbeat
- */
-static int sh_wdt_set_heartbeat(int t)
-{
-       if (unlikely((t < 1) || (t > 3600))) /* arbitrary upper limit */
-               return -EINVAL;
-
-       heartbeat = t;
-       return 0;
-}
-
-/**
- *     sh_wdt_ping - Ping the Watchdog
- *     @data: Unused
- *
- *     Clears overflow bit, resets timer counter.
- */
-static void sh_wdt_ping(unsigned long data)
-{
-       if (time_before(jiffies, next_heartbeat)) {
-               __u8 csr;
-
-               csr = sh_wdt_read_csr();
-               csr &= ~WTCSR_IOVF;
-               sh_wdt_write_csr(csr);
-
-               sh_wdt_write_cnt(0);
-
-               mod_timer(&timer, next_ping_period(clock_division_ratio));
-       } else
-               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping "
-                      "the watchdog\n");
-}
-
-/**
- *     sh_wdt_open - Open the Device
- *     @inode: inode of device
- *     @file: file handle of device
- *
- *     Watchdog device is opened and started.
- */
-static int sh_wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &shwdt_is_open))
-               return -EBUSY;
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       sh_wdt_start();
-
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     sh_wdt_close - Close the Device
- *     @inode: inode of device
- *     @file: file handle of device
- *
- *     Watchdog device is closed and stopped.
- */
-static int sh_wdt_close(struct inode *inode, struct file *file)
-{
-       if (shwdt_expect_close == 42) {
-               sh_wdt_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not "
-                      "stopping watchdog!\n");
-               sh_wdt_keepalive();
-       }
-
-       clear_bit(0, &shwdt_is_open);
-       shwdt_expect_close = 0;
-
-       return 0;
-}
-
-/**
- *     sh_wdt_write - Write to Device
- *     @file: file handle of device
- *     @buf: buffer to write
- *     @count: length of buffer
- *     @ppos: offset
- *
- *     Pings the watchdog on write.
- */
-static ssize_t sh_wdt_write(struct file *file, const char *buf,
-                           size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       shwdt_expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       shwdt_expect_close = 42;
-                       }
-               }
-               sh_wdt_keepalive();
-       }
-
-       return count;
-}
-
-/**
- *     sh_wdt_mmap - map WDT/CPG registers into userspace
- *     @file: file structure for the device
- *     @vma: VMA to map the registers into
- *
- *     A simple mmap() implementation for the corner cases where the counter
- *     needs to be mapped in userspace directly. Due to the relatively small
- *     size of the area, neighbouring registers not necessarily tied to the
- *     CPG will also be accessible through the register page, so this remains
- *     configurable for users that really know what they're doing.
- *
- *     Additionaly, the register page maps in the CPG register base relative
- *     to the nearest page-aligned boundary, which requires that userspace do
- *     the appropriate CPU subtype math for calculating the page offset for
- *     the counter value.
- */
-static int sh_wdt_mmap(struct file *file, struct vm_area_struct *vma)
-{
-       int ret = -ENOSYS;
-
-#ifdef CONFIG_SH_WDT_MMAP
-       unsigned long addr;
-
-       /* Only support the simple cases where we map in a register page. */
-       if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff)
-               return -EINVAL;
-
-       /*
-        * Pick WTCNT as the start, it's usually the first register after the
-        * FRQCR, and neither one are generally page-aligned out of the box.
-        */
-       addr = WTCNT & ~(PAGE_SIZE - 1);
-
-       vma->vm_flags |= VM_IO;
-       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-
-       if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
-                              PAGE_SIZE, vma->vm_page_prot)) {
-               printk(KERN_ERR PFX "%s: io_remap_pfn_range failed\n",
-                      __FUNCTION__);
-               return -EAGAIN;
-       }
-
-       ret = 0;
-#endif
-
-       return ret;
-}
-
-/**
- *     sh_wdt_ioctl - Query Device
- *     @inode: inode of device
- *     @file: file handle of device
- *     @cmd: watchdog command
- *     @arg: argument
- *
- *     Query basic information from the device or ping it, as outlined by the
- *     watchdog API.
- */
-static int sh_wdt_ioctl(struct inode *inode, struct file *file,
-                       unsigned int cmd, unsigned long arg)
-{
-       int new_heartbeat;
-       int options, retval = -EINVAL;
-
-       switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user((struct watchdog_info *)arg,
-                                         &sh_wdt_info,
-                                         sizeof(sh_wdt_info)) ? -EFAULT : 0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, (int *)arg);
-               case WDIOC_KEEPALIVE:
-                       sh_wdt_keepalive();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, (int *)arg))
-                               return -EFAULT;
-
-                       if (sh_wdt_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       sh_wdt_keepalive();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, (int *)arg);
-               case WDIOC_SETOPTIONS:
-                       if (get_user(options, (int *)arg))
-                               return -EFAULT;
-
-                       if (options & WDIOS_DISABLECARD) {
-                               sh_wdt_stop();
-                               retval = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               sh_wdt_start();
-                               retval = 0;
-                       }
-
-                       return retval;
-               default:
-                       return -ENOTTY;
-       }
-
-       return 0;
-}
-
-/**
- *     sh_wdt_notify_sys - Notifier Handler
- *     @this: notifier block
- *     @code: notifier event
- *     @unused: unused
- *
- *     Handles specific events, such as turning off the watchdog during a
- *     shutdown event.
- */
-static int sh_wdt_notify_sys(struct notifier_block *this,
-                            unsigned long code, void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-               sh_wdt_stop();
-
-       return NOTIFY_DONE;
-}
-
-static const struct file_operations sh_wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = sh_wdt_write,
-       .ioctl          = sh_wdt_ioctl,
-       .open           = sh_wdt_open,
-       .release        = sh_wdt_close,
-       .mmap           = sh_wdt_mmap,
-};
-
-static struct watchdog_info sh_wdt_info = {
-       .options                = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
-                                 WDIOF_MAGICCLOSE,
-       .firmware_version       = 1,
-       .identity               = "SH WDT",
-};
-
-static struct notifier_block sh_wdt_notifier = {
-       .notifier_call          = sh_wdt_notify_sys,
-};
-
-static struct miscdevice sh_wdt_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &sh_wdt_fops,
-};
-
-/**
- *     sh_wdt_init - Initialize module
- *     Registers the device and notifier handler. Actual device
- *     initialization is handled by sh_wdt_open().
- */
-static int __init sh_wdt_init(void)
-{
-       int rc;
-
-       if ((clock_division_ratio < 0x5) || (clock_division_ratio > 0x7)) {
-               clock_division_ratio = WTCSR_CKS_4096;
-               printk(KERN_INFO PFX "clock_division_ratio value must "
-                      "be 0x5<=x<=0x7, using %d\n", clock_division_ratio);
-       }
-
-       rc = sh_wdt_set_heartbeat(heartbeat);
-       if (unlikely(rc)) {
-               heartbeat = WATCHDOG_HEARTBEAT;
-               printk(KERN_INFO PFX "heartbeat value must "
-                      "be 1<=x<=3600, using %d\n", heartbeat);
-       }
-
-       rc = register_reboot_notifier(&sh_wdt_notifier);
-       if (unlikely(rc)) {
-               printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n",
-                      rc);
-               return rc;
-       }
-
-       rc = misc_register(&sh_wdt_miscdev);
-       if (unlikely(rc)) {
-               printk(KERN_ERR PFX "Can't register miscdev on "
-                      "minor=%d (err=%d)\n", sh_wdt_miscdev.minor, rc);
-               unregister_reboot_notifier(&sh_wdt_notifier);
-               return rc;
-       }
-
-       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
-               heartbeat, nowayout);
-
-       return 0;
-}
-
-/**
- *     sh_wdt_exit - Deinitialize module
- *     Unregisters the device and notifier handler. Actual device
- *     deinitialization is handled by sh_wdt_close().
- */
-static void __exit sh_wdt_exit(void)
-{
-       misc_deregister(&sh_wdt_miscdev);
-       unregister_reboot_notifier(&sh_wdt_notifier);
-}
-
-MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
-MODULE_DESCRIPTION("SuperH watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-module_param(clock_division_ratio, int, 0);
-MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). (default=" __MODULE_STRING(clock_division_ratio) ")");
-
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<=heartbeat<=3600, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-module_init(sh_wdt_init);
-module_exit(sh_wdt_exit);
diff --git a/drivers/char/watchdog/smsc37b787_wdt.c b/drivers/char/watchdog/smsc37b787_wdt.c
deleted file mode 100644 (file)
index d3cb0a7..0000000
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- *     SMsC 37B787 Watchdog Timer driver for Linux 2.6.x.x
- *
- *      Based on acquirewdt.c by Alan Cox <alan@redhat.com>
- *       and some other existing drivers
- *
- *     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 authors do NOT admit liability nor provide warranty for
- *     any of this software. This material is provided "AS-IS" in
- *      the hope that it may be useful for others.
- *
- *     (C) Copyright 2003-2006  Sven Anders <anders@anduras.de>
- *
- *  History:
- *     2003 - Created version 1.0 for Linux 2.4.x.
- *     2006 - Ported to Linux 2.6, added nowayout and MAGICCLOSE
- *             features. Released version 1.1
- *
- *  Theory of operation:
- *
- *      A Watchdog Timer (WDT) is a hardware circuit that can
- *      reset the computer system in case of a software fault.
- *      You probably knew that already.
- *
- *      Usually a userspace daemon will notify the kernel WDT driver
- *      via the /dev/watchdog special device file that userspace is
- *      still alive, at regular intervals.  When such a notification
- *      occurs, the driver will usually tell the hardware watchdog
- *      that everything is in order, and that the watchdog should wait
- *      for yet another little while to reset the system.
- *      If userspace fails (RAM error, kernel bug, whatever), the
- *      notifications cease to occur, and the hardware watchdog will
- *      reset the system (causing a reboot) after the timeout occurs.
- *
- * Create device with:
- *  mknod /dev/watchdog c 10 130
- *
- * For an example userspace keep-alive daemon, see:
- *   Documentation/watchdog/watchdog.txt
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/delay.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-/* enable support for minutes as units? */
-/* (does not always work correctly, so disabled by default!) */
-#define SMSC_SUPPORT_MINUTES
-#undef SMSC_SUPPORT_MINUTES
-
-#define MAX_TIMEOUT     255
-
-#define UNIT_SECOND     0
-#define UNIT_MINUTE     1
-
-#define MODNAME                "smsc37b787_wdt: "
-#define VERSION         "1.1"
-
-#define IOPORT          0x3F0
-#define IOPORT_SIZE     2
-#define IODEV_NO        8
-
-static int unit = UNIT_SECOND;  /* timer's unit */
-static int timeout = 60;        /* timeout value: default is 60 "units" */
-static unsigned long timer_enabled = 0;   /* is the timer enabled? */
-
-static char expect_close;       /* is the close expected? */
-
-static spinlock_t io_lock;     /* to guard the watchdog from io races */
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-
-/* -- Low level function ----------------------------------------*/
-
-/* unlock the IO chip */
-
-static inline void open_io_config(void)
-{
-        outb(0x55, IOPORT);
-       mdelay(1);
-        outb(0x55, IOPORT);
-}
-
-/* lock the IO chip */
-static inline void close_io_config(void)
-{
-        outb(0xAA, IOPORT);
-}
-
-/* select the IO device */
-static inline void select_io_device(unsigned char devno)
-{
-        outb(0x07, IOPORT);
-        outb(devno, IOPORT+1);
-}
-
-/* write to the control register */
-static inline void write_io_cr(unsigned char reg, unsigned char data)
-{
-        outb(reg, IOPORT);
-        outb(data, IOPORT+1);
-}
-
-/* read from the control register */
-static inline char read_io_cr(unsigned char reg)
-{
-        outb(reg, IOPORT);
-        return inb(IOPORT+1);
-}
-
-/* -- Medium level functions ------------------------------------*/
-
-static inline void gpio_bit12(unsigned char reg)
-{
-       // -- General Purpose I/O Bit 1.2 --
-       // Bit 0,   In/Out: 0 = Output, 1 = Input
-       // Bit 1,   Polarity: 0 = No Invert, 1 = Invert
-       // Bit 2,   Group Enable Intr.: 0 = Disable, 1 = Enable
-       // Bit 3/4, Function select: 00 = GPI/O, 01 = WDT, 10 = P17,
-       //                           11 = Either Edge Triggered Intr. 2
-        // Bit 5/6  (Reserved)
-       // Bit 7,   Output Type: 0 = Push Pull Bit, 1 = Open Drain
-        write_io_cr(0xE2, reg);
-}
-
-static inline void gpio_bit13(unsigned char reg)
-{
-       // -- General Purpose I/O Bit 1.3 --
-       // Bit 0,  In/Out: 0 = Output, 1 = Input
-       // Bit 1,  Polarity: 0 = No Invert, 1 = Invert
-       // Bit 2,  Group Enable Intr.: 0 = Disable, 1 = Enable
-       // Bit 3,  Function select: 0 = GPI/O, 1 = LED
-        // Bit 4-6 (Reserved)
-       // Bit 7,  Output Type: 0 = Push Pull Bit, 1 = Open Drain
-        write_io_cr(0xE3, reg);
-}
-
-static inline void wdt_timer_units(unsigned char new_units)
-{
-       // -- Watchdog timer units --
-       // Bit 0-6 (Reserved)
-       // Bit 7,  WDT Time-out Value Units Select
-       //         (0 = Minutes, 1 = Seconds)
-        write_io_cr(0xF1, new_units);
-}
-
-static inline void wdt_timeout_value(unsigned char new_timeout)
-{
-       // -- Watchdog Timer Time-out Value --
-       // Bit 0-7 Binary coded units (0=Disabled, 1..255)
-        write_io_cr(0xF2, new_timeout);
-}
-
-static inline void wdt_timer_conf(unsigned char conf)
-{
-       // -- Watchdog timer configuration --
-       // Bit 0   Joystick enable: 0* = No Reset, 1 = Reset WDT upon Gameport I/O
-       // Bit 1   Keyboard enable: 0* = No Reset, 1 = Reset WDT upon KBD Intr.
-       // Bit 2   Mouse enable: 0* = No Reset, 1 = Reset WDT upon Mouse Intr.
-        // Bit 3   Reset the timer
-        //         (Wrong in SMsC documentation? Given as: PowerLED Timout Enabled)
-       // Bit 4-7 WDT Interrupt Mapping: (0000* = Disabled,
-       //            0001=IRQ1, 0010=(Invalid), 0011=IRQ3 to 1111=IRQ15)
-        write_io_cr(0xF3, conf);
-}
-
-static inline void wdt_timer_ctrl(unsigned char reg)
-{
-       // -- Watchdog timer control --
-       // Bit 0   Status Bit: 0 = Timer counting, 1 = Timeout occured
-       // Bit 1   Power LED Toggle: 0 = Disable Toggle, 1 = Toggle at 1 Hz
-       // Bit 2   Force Timeout: 1 = Forces WD timeout event (self-cleaning)
-       // Bit 3   P20 Force Timeout enabled:
-       //          0 = P20 activity does not generate the WD timeout event
-       //          1 = P20 Allows rising edge of P20, from the keyboard
-       //              controller, to force the WD timeout event.
-       // Bit 4   (Reserved)
-       // -- Soft power management --
-       // Bit 5   Stop Counter: 1 = Stop software power down counter
-       //            set via register 0xB8, (self-cleaning)
-       //            (Upon read: 0 = Counter running, 1 = Counter stopped)
-       // Bit 6   Restart Counter: 1 = Restart software power down counter
-       //            set via register 0xB8, (self-cleaning)
-       // Bit 7   SPOFF: 1 = Force software power down (self-cleaning)
-
-        write_io_cr(0xF4, reg);
-}
-
-/* -- Higher level functions ------------------------------------*/
-
-/* initialize watchdog */
-
-static void wb_smsc_wdt_initialize(void)
-{
-        unsigned char old;
-
-       spin_lock(&io_lock);
-        open_io_config();
-        select_io_device(IODEV_NO);
-
-       // enable the watchdog
-       gpio_bit13(0x08);  // Select pin 80 = LED not GPIO
-       gpio_bit12(0x0A);  // Set pin 79 = WDT not GPIO/Output/Polarity=Invert
-
-       // disable the timeout
-        wdt_timeout_value(0);
-
-       // reset control register
-        wdt_timer_ctrl(0x00);
-
-       // reset configuration register
-       wdt_timer_conf(0x00);
-
-       // read old (timer units) register
-        old = read_io_cr(0xF1) & 0x7F;
-        if (unit == UNIT_SECOND) old |= 0x80; // set to seconds
-
-       // set the watchdog timer units
-        wdt_timer_units(old);
-
-        close_io_config();
-       spin_unlock(&io_lock);
-}
-
-/* shutdown the watchdog */
-
-static void wb_smsc_wdt_shutdown(void)
-{
-       spin_lock(&io_lock);
-        open_io_config();
-        select_io_device(IODEV_NO);
-
-       // disable the watchdog
-        gpio_bit13(0x09);
-        gpio_bit12(0x09);
-
-       // reset watchdog config register
-       wdt_timer_conf(0x00);
-
-       // reset watchdog control register
-        wdt_timer_ctrl(0x00);
-
-       // disable timeout
-        wdt_timeout_value(0x00);
-
-        close_io_config();
-       spin_unlock(&io_lock);
-}
-
-/* set timeout => enable watchdog */
-
-static void wb_smsc_wdt_set_timeout(unsigned char new_timeout)
-{
-       spin_lock(&io_lock);
-        open_io_config();
-        select_io_device(IODEV_NO);
-
-       // set Power LED to blink, if we enable the timeout
-        wdt_timer_ctrl((new_timeout == 0) ? 0x00 : 0x02);
-
-       // set timeout value
-        wdt_timeout_value(new_timeout);
-
-        close_io_config();
-       spin_unlock(&io_lock);
-}
-
-/* get timeout */
-
-static unsigned char wb_smsc_wdt_get_timeout(void)
-{
-        unsigned char set_timeout;
-
-       spin_lock(&io_lock);
-        open_io_config();
-        select_io_device(IODEV_NO);
-        set_timeout = read_io_cr(0xF2);
-        close_io_config();
-       spin_unlock(&io_lock);
-
-        return set_timeout;
-}
-
-/* disable watchdog */
-
-static void wb_smsc_wdt_disable(void)
-{
-        // set the timeout to 0 to disable the watchdog
-        wb_smsc_wdt_set_timeout(0);
-}
-
-/* enable watchdog by setting the current timeout */
-
-static void wb_smsc_wdt_enable(void)
-{
-        // set the current timeout...
-        wb_smsc_wdt_set_timeout(timeout);
-}
-
-/* reset the timer */
-
-static void wb_smsc_wdt_reset_timer(void)
-{
-       spin_lock(&io_lock);
-        open_io_config();
-        select_io_device(IODEV_NO);
-
-       // reset the timer
-       wdt_timeout_value(timeout);
-       wdt_timer_conf(0x08);
-
-        close_io_config();
-       spin_unlock(&io_lock);
-}
-
-/* return, if the watchdog is enabled (timeout is set...) */
-
-static int wb_smsc_wdt_status(void)
-{
-       return (wb_smsc_wdt_get_timeout() == 0) ? 0 : WDIOF_KEEPALIVEPING;
-}
-
-
-/* -- File operations -------------------------------------------*/
-
-/* open => enable watchdog and set initial timeout */
-
-static int wb_smsc_wdt_open(struct inode *inode, struct file *file)
-{
-       /* /dev/watchdog can only be opened once */
-
-       if (test_and_set_bit(0, &timer_enabled))
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       /* Reload and activate timer */
-       wb_smsc_wdt_enable();
-
-       printk(KERN_INFO MODNAME "Watchdog enabled. Timeout set to %d %s.\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)");
-
-       return nonseekable_open(inode, file);
-}
-
-/* close => shut off the timer */
-
-static int wb_smsc_wdt_release(struct inode *inode, struct file *file)
-{
-       /* Shut off the timer. */
-
-       if (expect_close == 42) {
-               wb_smsc_wdt_disable();
-               printk(KERN_INFO MODNAME "Watchdog disabled, sleeping again...\n");
-       } else {
-               printk(KERN_CRIT MODNAME "Unexpected close, not stopping watchdog!\n");
-               wb_smsc_wdt_reset_timer();
-       }
-
-       clear_bit(0, &timer_enabled);
-       expect_close = 0;
-       return 0;
-}
-
-/* write => update the timer to keep the machine alive */
-
-static ssize_t wb_smsc_wdt_write(struct file *file, const char __user *data,
-                                size_t len, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* reset expect flag */
-                       expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != len; i++) {
-                               char c;
-                               if (get_user(c, data+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should reload the timer */
-               wb_smsc_wdt_reset_timer();
-       }
-       return len;
-}
-
-/* ioctl => control interface */
-
-static int wb_smsc_wdt_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, unsigned long arg)
-{
-       int new_timeout;
-
-       union {
-               struct watchdog_info __user *ident;
-               int __user *i;
-       } uarg;
-
-       static struct watchdog_info ident = {
-               .options =              WDIOF_KEEPALIVEPING |
-                                       WDIOF_SETTIMEOUT |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     0,
-               .identity =             "SMsC 37B787 Watchdog"
-       };
-
-       uarg.i = (int __user *)arg;
-
-       switch (cmd) {
-               default:
-                       return -ENOTTY;
-
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(uarg.ident, &ident,
-                               sizeof(ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-                       return put_user(wb_smsc_wdt_status(), uarg.i);
-
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, uarg.i);
-
-               case WDIOC_KEEPALIVE:
-                       wb_smsc_wdt_reset_timer();
-                       return 0;
-
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_timeout, uarg.i))
-                               return -EFAULT;
-
-                       // the API states this is given in secs
-                       if (unit == UNIT_MINUTE)
-                         new_timeout /= 60;
-
-                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
-                               return -EINVAL;
-
-                       timeout = new_timeout;
-                       wb_smsc_wdt_set_timeout(timeout);
-
-                       // fall through and return the new timeout...
-
-               case WDIOC_GETTIMEOUT:
-
-                       new_timeout = timeout;
-
-                       if (unit == UNIT_MINUTE)
-                         new_timeout *= 60;
-
-                       return put_user(new_timeout, uarg.i);
-
-               case WDIOC_SETOPTIONS:
-               {
-                       int options, retval = -EINVAL;
-
-                       if (get_user(options, uarg.i))
-                               return -EFAULT;
-
-                       if (options & WDIOS_DISABLECARD) {
-                               wb_smsc_wdt_disable();
-                               retval = 0;
-                       }
-
-                       if (options & WDIOS_ENABLECARD) {
-                               wb_smsc_wdt_enable();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-       }
-}
-
-/* -- Notifier funtions -----------------------------------------*/
-
-static int wb_smsc_wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT)
-       {
-                // set timeout to 0, to avoid possible race-condition
-               timeout = 0;
-               wb_smsc_wdt_disable();
-       }
-       return NOTIFY_DONE;
-}
-
-/* -- Module's structures ---------------------------------------*/
-
-static const struct file_operations wb_smsc_wdt_fops =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wb_smsc_wdt_write,
-       .ioctl          = wb_smsc_wdt_ioctl,
-       .open           = wb_smsc_wdt_open,
-       .release        = wb_smsc_wdt_release,
-};
-
-static struct notifier_block wb_smsc_wdt_notifier =
-{
-       .notifier_call  = wb_smsc_wdt_notify_sys,
-};
-
-static struct miscdevice wb_smsc_wdt_miscdev =
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &wb_smsc_wdt_fops,
-};
-
-/* -- Module init functions -------------------------------------*/
-
-/* module's "constructor" */
-
-static int __init wb_smsc_wdt_init(void)
-{
-       int ret;
-
-       spin_lock_init(&io_lock);
-
-       printk("SMsC 37B787 watchdog component driver " VERSION " initialising...\n");
-
-       if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) {
-               printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", IOPORT);
-               ret = -EBUSY;
-               goto out_pnp;
-       }
-
-        // set new maximum, if it's too big
-        if (timeout > MAX_TIMEOUT)
-               timeout = MAX_TIMEOUT;
-
-        // init the watchdog timer
-        wb_smsc_wdt_initialize();
-
-       ret = register_reboot_notifier(&wb_smsc_wdt_notifier);
-       if (ret) {
-               printk(KERN_ERR MODNAME "Unable to register reboot notifier err = %d\n", ret);
-               goto out_io;
-       }
-
-       ret = misc_register(&wb_smsc_wdt_miscdev);
-       if (ret) {
-               printk(KERN_ERR MODNAME "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
-               goto out_rbt;
-       }
-
-       // output info
-       printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)");
-       printk(KERN_INFO MODNAME "Watchdog initialized and sleeping (nowayout=%d)...\n", nowayout);
-
-       // ret = 0
-
-out_clean:
-       return ret;
-
-out_rbt:
-       unregister_reboot_notifier(&wb_smsc_wdt_notifier);
-
-out_io:
-       release_region(IOPORT, IOPORT_SIZE);
-
-out_pnp:
-       goto out_clean;
-}
-
-/* module's "destructor" */
-
-static void __exit wb_smsc_wdt_exit(void)
-{
-       /* Stop the timer before we leave */
-       if (!nowayout)
-       {
-               wb_smsc_wdt_shutdown();
-               printk(KERN_INFO MODNAME "Watchdog disabled.\n");
-       }
-
-       misc_deregister(&wb_smsc_wdt_miscdev);
-       unregister_reboot_notifier(&wb_smsc_wdt_notifier);
-       release_region(IOPORT, IOPORT_SIZE);
-
-       printk("SMsC 37B787 watchdog component driver removed.\n");
-}
-
-module_init(wb_smsc_wdt_init);
-module_exit(wb_smsc_wdt_exit);
-
-MODULE_AUTHOR("Sven Anders <anders@anduras.de>");
-MODULE_DESCRIPTION("Driver for SMsC 37B787 watchdog component (Version " VERSION ")");
-MODULE_LICENSE("GPL");
-
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-#ifdef SMSC_SUPPORT_MINUTES
-module_param(unit, int, 0);
-MODULE_PARM_DESC(unit, "set unit to use, 0=seconds or 1=minutes, default is 0");
-#endif
-
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60");
-
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
deleted file mode 100644 (file)
index 9c36949..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- *     SoftDog 0.07:   A Software Watchdog Device
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
- *
- *     Software only watchdog driver. Unlike its big brother the WDT501P
- *     driver this won't always recover a failed machine.
- *
- *  03/96: Angelo Haritsis <ah@doc.ic.ac.uk> :
- *     Modularised.
- *     Added soft_margin; use upon insmod to change the timer delay.
- *     NB: uses same minor as wdt (WATCHDOG_MINOR); we could use separate
- *         minors.
- *
- *  19980911 Alan Cox
- *     Made SMP safe for 2.3.x
- *
- *  20011127 Joel Becker (jlbec@evilplan.org>
- *     Added soft_noboot; Allows testing the softdog trigger without
- *     requiring a recompile.
- *     Added WDIOC_GETTIMEOUT and WDIOC_SETTIMOUT.
- *
- *  20020530 Joel Becker <joel.becker@oracle.com>
- *     Added Matt Domsch's nowayout module option.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/jiffies.h>
-
-#include <asm/uaccess.h>
-
-#define PFX "SoftDog: "
-
-#define TIMER_MARGIN   60              /* Default is 60 seconds */
-static int soft_margin = TIMER_MARGIN; /* in seconds */
-module_param(soft_margin, int, 0);
-MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-#ifdef ONLY_TESTING
-static int soft_noboot = 1;
-#else
-static int soft_noboot = 0;
-#endif  /* ONLY_TESTING */
-
-module_param(soft_noboot, int, 0);
-MODULE_PARM_DESC(soft_noboot, "Softdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
-
-/*
- *     Our timer
- */
-
-static void watchdog_fire(unsigned long);
-
-static struct timer_list watchdog_ticktock =
-               TIMER_INITIALIZER(watchdog_fire, 0, 0);
-static unsigned long driver_open, orphan_timer;
-static char expect_close;
-
-
-/*
- *     If the timer expires..
- */
-
-static void watchdog_fire(unsigned long data)
-{
-       if (test_and_clear_bit(0, &orphan_timer))
-               module_put(THIS_MODULE);
-
-       if (soft_noboot)
-               printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n");
-       else
-       {
-               printk(KERN_CRIT PFX "Initiating system reboot.\n");
-               emergency_restart();
-               printk(KERN_CRIT PFX "Reboot didn't ?????\n");
-       }
-}
-
-/*
- *     Softdog operations
- */
-
-static int softdog_keepalive(void)
-{
-       mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
-       return 0;
-}
-
-static int softdog_stop(void)
-{
-       del_timer(&watchdog_ticktock);
-       return 0;
-}
-
-static int softdog_set_heartbeat(int t)
-{
-       if ((t < 0x0001) || (t > 0xFFFF))
-               return -EINVAL;
-
-       soft_margin = t;
-       return 0;
-}
-
-/*
- *     /dev/watchdog handling
- */
-
-static int softdog_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &driver_open))
-               return -EBUSY;
-       if (!test_and_clear_bit(0, &orphan_timer))
-               __module_get(THIS_MODULE);
-       /*
-        *      Activate timer
-        */
-       softdog_keepalive();
-       return nonseekable_open(inode, file);
-}
-
-static int softdog_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        *      Lock it in if it's a module and we set nowayout
-        */
-       if (expect_close == 42) {
-               softdog_stop();
-               module_put(THIS_MODULE);
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               set_bit(0, &orphan_timer);
-               softdog_keepalive();
-       }
-       clear_bit(0, &driver_open);
-       expect_close = 0;
-       return 0;
-}
-
-static ssize_t softdog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
-{
-       /*
-        *      Refresh the timer.
-        */
-       if(len) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != len; i++) {
-                               char c;
-
-                               if (get_user(c, data + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               softdog_keepalive();
-       }
-       return len;
-}
-
-static int softdog_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_margin;
-       static struct watchdog_info ident = {
-               .options =              WDIOF_SETTIMEOUT |
-                                       WDIOF_KEEPALIVEPING |
-                                       WDIOF_MAGICCLOSE,
-               .firmware_version =     0,
-               .identity =             "Software Watchdog",
-       };
-       switch (cmd) {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof(ident)) ? -EFAULT : 0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       softdog_keepalive();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_margin, p))
-                               return -EFAULT;
-                       if (softdog_set_heartbeat(new_margin))
-                               return -EINVAL;
-                       softdog_keepalive();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(soft_margin, p);
-       }
-}
-
-/*
- *     Notifier for system down
- */
-
-static int softdog_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if(code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the WDT off */
-               softdog_stop();
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations softdog_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = softdog_write,
-       .ioctl          = softdog_ioctl,
-       .open           = softdog_open,
-       .release        = softdog_release,
-};
-
-static struct miscdevice softdog_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &softdog_fops,
-};
-
-static struct notifier_block softdog_notifier = {
-       .notifier_call  = softdog_notify_sys,
-};
-
-static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 initialized. soft_noboot=%d soft_margin=%d sec (nowayout= %d)\n";
-
-static int __init watchdog_init(void)
-{
-       int ret;
-
-       /* Check that the soft_margin value is within it's range ; if not reset to the default */
-       if (softdog_set_heartbeat(soft_margin)) {
-               softdog_set_heartbeat(TIMER_MARGIN);
-               printk(KERN_INFO PFX "soft_margin value must be 0<soft_margin<65536, using %d\n",
-                       TIMER_MARGIN);
-       }
-
-       ret = register_reboot_notifier(&softdog_notifier);
-       if (ret) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               return ret;
-       }
-
-       ret = misc_register(&softdog_miscdev);
-       if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               unregister_reboot_notifier(&softdog_notifier);
-               return ret;
-       }
-
-       printk(banner, soft_noboot, soft_margin, nowayout);
-
-       return 0;
-}
-
-static void __exit watchdog_exit(void)
-{
-       misc_deregister(&softdog_miscdev);
-       unregister_reboot_notifier(&softdog_notifier);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);
-
-MODULE_AUTHOR("Alan Cox");
-MODULE_DESCRIPTION("Software Watchdog Device Driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
deleted file mode 100644 (file)
index df33b3b..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- *     w83627hf/thf WDT driver
- *
- *     (c) Copyright 2007 Vlad Drukker <vlad@storewiz.com>
- *             added support for W83627THF.
- *
- *     (c) Copyright 2003,2007 Pádraig Brady <P@draigBrady.com>
- *
- *     Based on advantechwdt.c which is based on wdt.c.
- *     Original copyright messages:
- *
- *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define WATCHDOG_NAME "w83627hf/thf/hg WDT"
-#define PFX WATCHDOG_NAME ": "
-#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
-
-static unsigned long wdt_is_open;
-static char expect_close;
-static spinlock_t io_lock;
-
-/* You must set this - there is no sane way to probe for this board. */
-static int wdt_io = 0x2E;
-module_param(wdt_io, int, 0);
-MODULE_PARM_DESC(wdt_io, "w83627hf/thf WDT io port (default 0x2E)");
-
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Kernel methods.
- */
-
-#define WDT_EFER (wdt_io+0)   /* Extended Function Enable Registers */
-#define WDT_EFIR (wdt_io+0)   /* Extended Function Index Register (same as EFER) */
-#define WDT_EFDR (WDT_EFIR+1) /* Extended Function Data Register */
-
-static void
-w83627hf_select_wd_register(void)
-{
-       unsigned char c;
-       outb_p(0x87, WDT_EFER); /* Enter extended function mode */
-       outb_p(0x87, WDT_EFER); /* Again according to manual */
-
-       outb(0x20, WDT_EFER);   /* check chip version   */
-       c = inb(WDT_EFDR);
-       if (c == 0x82) {        /* W83627THF            */
-               outb_p(0x2b, WDT_EFER); /* select GPIO3 */
-               c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */
-               outb_p(0x2b, WDT_EFER);
-               outb_p(c, WDT_EFDR);    /* set GPIO3 to WDT0 */
-       }
-
-       outb_p(0x07, WDT_EFER); /* point to logical device number reg */
-       outb_p(0x08, WDT_EFDR); /* select logical device 8 (GPIO2) */
-       outb_p(0x30, WDT_EFER); /* select CR30 */
-       outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
-}
-
-static void
-w83627hf_unselect_wd_register(void)
-{
-       outb_p(0xAA, WDT_EFER); /* Leave extended function mode */
-}
-
-/* tyan motherboards seem to set F5 to 0x4C ?
- * So explicitly init to appropriate value. */
-static void
-w83627hf_init(void)
-{
-       unsigned char t;
-
-       w83627hf_select_wd_register();
-
-       outb_p(0xF6, WDT_EFER); /* Select CRF6 */
-       t=inb_p(WDT_EFDR);      /* read CRF6 */
-       if (t != 0) {
-               printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
-               outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
-       }
-
-       outb_p(0xF5, WDT_EFER); /* Select CRF5 */
-       t=inb_p(WDT_EFDR);      /* read CRF5 */
-       t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */
-       outb_p(t, WDT_EFDR);    /* Write back to CRF5 */
-
-       outb_p(0xF7, WDT_EFER); /* Select CRF7 */
-       t=inb_p(WDT_EFDR);      /* read CRF7 */
-       t&=~0xC0;               /* disable keyboard & mouse turning off watchdog */
-       outb_p(t, WDT_EFDR);    /* Write back to CRF7 */
-
-       w83627hf_unselect_wd_register();
-}
-
-static void
-wdt_ctrl(int timeout)
-{
-       spin_lock(&io_lock);
-
-       w83627hf_select_wd_register();
-
-       outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
-       outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */
-
-       w83627hf_unselect_wd_register();
-
-       spin_unlock(&io_lock);
-}
-
-static int
-wdt_ping(void)
-{
-       wdt_ctrl(timeout);
-       return 0;
-}
-
-static int
-wdt_disable(void)
-{
-       wdt_ctrl(0);
-       return 0;
-}
-
-static int
-wdt_set_heartbeat(int t)
-{
-       if ((t < 1) || (t > 255))
-               return -EINVAL;
-
-       timeout = t;
-       return 0;
-}
-
-static ssize_t
-wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               wdt_ping();
-       }
-       return count;
-}
-
-static int
-wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-         unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_timeout;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "W83627HF WDT",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-         if (copy_to_user(argp, &ident, sizeof(ident)))
-           return -EFAULT;
-         break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-         return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-         wdt_ping();
-         break;
-
-       case WDIOC_SETTIMEOUT:
-         if (get_user(new_timeout, p))
-                 return -EFAULT;
-         if (wdt_set_heartbeat(new_timeout))
-                 return -EINVAL;
-         wdt_ping();
-         /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-         return put_user(timeout, p);
-
-       case WDIOC_SETOPTIONS:
-       {
-         int options, retval = -EINVAL;
-
-         if (get_user(options, p))
-           return -EFAULT;
-
-         if (options & WDIOS_DISABLECARD) {
-           wdt_disable();
-           retval = 0;
-         }
-
-         if (options & WDIOS_ENABLECARD) {
-           wdt_ping();
-           retval = 0;
-         }
-
-         return retval;
-       }
-
-       default:
-         return -ENOTTY;
-       }
-       return 0;
-}
-
-static int
-wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-       /*
-        *      Activate
-        */
-
-       wdt_ping();
-       return nonseekable_open(inode, file);
-}
-
-static int
-wdt_close(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               wdt_disable();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               wdt_ping();
-       }
-       expect_close = 0;
-       clear_bit(0, &wdt_is_open);
-       return 0;
-}
-
-/*
- *     Notifier for system down
- */
-
-static int
-wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT) {
-               /* Turn the WDT off */
-               wdt_disable();
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdt_write,
-       .ioctl          = wdt_ioctl,
-       .open           = wdt_open,
-       .release        = wdt_close,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &wdt_fops,
-};
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier = {
-       .notifier_call = wdt_notify_sys,
-};
-
-static int __init
-wdt_init(void)
-{
-       int ret;
-
-       spin_lock_init(&io_lock);
-
-       printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG Super I/O chip initialising.\n");
-
-       if (wdt_set_heartbeat(timeout)) {
-               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
-               printk (KERN_INFO PFX "timeout value must be 1<=timeout<=255, using %d\n",
-                       WATCHDOG_TIMEOUT);
-       }
-
-       if (!request_region(wdt_io, 1, WATCHDOG_NAME)) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       wdt_io);
-               ret = -EIO;
-               goto out;
-       }
-
-       w83627hf_init();
-
-       ret = register_reboot_notifier(&wdt_notifier);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               goto unreg_regions;
-       }
-
-       ret = misc_register(&wdt_miscdev);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto unreg_reboot;
-       }
-
-       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-out:
-       return ret;
-unreg_reboot:
-       unregister_reboot_notifier(&wdt_notifier);
-unreg_regions:
-       release_region(wdt_io, 1);
-       goto out;
-}
-
-static void __exit
-wdt_exit(void)
-{
-       misc_deregister(&wdt_miscdev);
-       unregister_reboot_notifier(&wdt_notifier);
-       release_region(wdt_io,1);
-}
-
-module_init(wdt_init);
-module_exit(wdt_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Pádraig Brady <P@draigBrady.com>");
-MODULE_DESCRIPTION("w83627hf/thf WDT driver");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
deleted file mode 100644 (file)
index d9e821d..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- *     w83697hf/hg WDT driver
- *
- *     (c) Copyright 2006 Samuel Tardieu <sam@rfc1149.net>
- *     (c) Copyright 2006 Marcus Junker <junker@anduras.de>
- *
- *     Based on w83627hf_wdt.c which is based on advantechwdt.c
- *     which is based on wdt.c.
- *     Original copyright messages:
- *
- *     (c) Copyright 2003 Pádraig Brady <P@draigBrady.com>
- *
- *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Marcus Junker nor ANDURAS AG admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define WATCHDOG_NAME "w83697hf/hg WDT"
-#define PFX WATCHDOG_NAME ": "
-#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
-
-static unsigned long wdt_is_open;
-static char expect_close;
-static spinlock_t io_lock;
-
-/* You must set this - there is no sane way to probe for this board. */
-static int wdt_io = 0x2e;
-module_param(wdt_io, int, 0);
-MODULE_PARM_DESC(wdt_io, "w83697hf/hg WDT io port (default 0x2e, 0 = autodetect)");
-
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- *     Kernel methods.
- */
-
-#define W83697HF_EFER (wdt_io+0)       /* Extended Function Enable Register */
-#define W83697HF_EFIR (wdt_io+0)       /* Extended Function Index Register (same as EFER) */
-#define W83697HF_EFDR (wdt_io+1)       /* Extended Function Data Register */
-
-static inline void
-w83697hf_unlock(void)
-{
-       outb_p(0x87, W83697HF_EFER);    /* Enter extended function mode */
-       outb_p(0x87, W83697HF_EFER);    /* Again according to manual */
-}
-
-static inline void
-w83697hf_lock(void)
-{
-       outb_p(0xAA, W83697HF_EFER);    /* Leave extended function mode */
-}
-
-/*
- *     The three functions w83697hf_get_reg(), w83697hf_set_reg() and
- *     w83697hf_write_timeout() must be called with the device unlocked.
- */
-
-static unsigned char
-w83697hf_get_reg(unsigned char reg)
-{
-       outb_p(reg, W83697HF_EFIR);
-       return inb_p(W83697HF_EFDR);
-}
-
-static void
-w83697hf_set_reg(unsigned char reg, unsigned char data)
-{
-       outb_p(reg, W83697HF_EFIR);
-       outb_p(data, W83697HF_EFDR);
-}
-
-static void
-w83697hf_write_timeout(int timeout)
-{
-       w83697hf_set_reg(0xF4, timeout);        /* Write Timeout counter to CRF4 */
-}
-
-static void
-w83697hf_select_wdt(void)
-{
-       w83697hf_unlock();
-       w83697hf_set_reg(0x07, 0x08);   /* Switch to logic device 8 (GPIO2) */
-}
-
-static inline void
-w83697hf_deselect_wdt(void)
-{
-       w83697hf_lock();
-}
-
-static void
-w83697hf_init(void)
-{
-       unsigned char bbuf;
-
-       w83697hf_select_wdt();
-
-       bbuf = w83697hf_get_reg(0x29);
-       bbuf &= ~0x60;
-       bbuf |= 0x20;
-       w83697hf_set_reg(0x29, bbuf);   /* Set pin 119 to WDTO# mode (= CR29, WDT0) */
-
-       bbuf = w83697hf_get_reg(0xF3);
-       bbuf &= ~0x04;
-       w83697hf_set_reg(0xF3, bbuf);   /* Count mode is seconds */
-
-       w83697hf_deselect_wdt();
-}
-
-static int
-wdt_ping(void)
-{
-       spin_lock(&io_lock);
-       w83697hf_select_wdt();
-
-       w83697hf_write_timeout(timeout);
-
-       w83697hf_deselect_wdt();
-       spin_unlock(&io_lock);
-       return 0;
-}
-
-static int
-wdt_enable(void)
-{
-       spin_lock(&io_lock);
-       w83697hf_select_wdt();
-
-       w83697hf_write_timeout(timeout);
-       w83697hf_set_reg(0x30, 1);      /* Enable timer */
-
-       w83697hf_deselect_wdt();
-       spin_unlock(&io_lock);
-       return 0;
-}
-
-static int
-wdt_disable(void)
-{
-       spin_lock(&io_lock);
-       w83697hf_select_wdt();
-
-       w83697hf_set_reg(0x30, 0);      /* Disable timer */
-       w83697hf_write_timeout(0);
-
-       w83697hf_deselect_wdt();
-       spin_unlock(&io_lock);
-       return 0;
-}
-
-static int
-wdt_set_heartbeat(int t)
-{
-       if ((t < 1) || (t > 255))
-               return -EINVAL;
-
-       timeout = t;
-       return 0;
-}
-
-static ssize_t
-wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               wdt_ping();
-       }
-       return count;
-}
-
-static int
-wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-         unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_timeout;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "W83697HF WDT",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-               wdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if (wdt_set_heartbeat(new_timeout))
-                       return -EINVAL;
-               wdt_ping();
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
-
-       case WDIOC_SETOPTIONS:
-       {
-               int options, retval = -EINVAL;
-
-               if (get_user(options, p))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD) {
-                       wdt_disable();
-                       retval = 0;
-               }
-
-               if (options & WDIOS_ENABLECARD) {
-                       wdt_enable();
-                       retval = 0;
-               }
-
-               return retval;
-       }
-
-       default:
-               return -ENOTTY;
-       }
-       return 0;
-}
-
-static int
-wdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-       /*
-        *      Activate
-        */
-
-       wdt_enable();
-       return nonseekable_open(inode, file);
-}
-
-static int
-wdt_close(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               wdt_disable();
-       } else {
-               printk (KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-               wdt_ping();
-       }
-       expect_close = 0;
-       clear_bit(0, &wdt_is_open);
-       return 0;
-}
-
-/*
- *     Notifier for system down
- */
-
-static int
-wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT) {
-               /* Turn the WDT off */
-               wdt_disable();
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdt_write,
-       .ioctl          = wdt_ioctl,
-       .open           = wdt_open,
-       .release        = wdt_close,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor = WATCHDOG_MINOR,
-       .name = "watchdog",
-       .fops = &wdt_fops,
-};
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier = {
-       .notifier_call = wdt_notify_sys,
-};
-
-static int
-w83697hf_check_wdt(void)
-{
-       if (!request_region(wdt_io, 2, WATCHDOG_NAME)) {
-               printk (KERN_ERR PFX "I/O address 0x%x already in use\n", wdt_io);
-               return -EIO;
-       }
-
-       printk (KERN_DEBUG PFX "Looking for watchdog at address 0x%x\n", wdt_io);
-       w83697hf_unlock();
-       if (w83697hf_get_reg(0x20) == 0x60) {
-               printk (KERN_INFO PFX "watchdog found at address 0x%x\n", wdt_io);
-               w83697hf_lock();
-               return 0;
-       }
-       w83697hf_lock();        /* Reprotect in case it was a compatible device */
-
-       printk (KERN_INFO PFX "watchdog not found at address 0x%x\n", wdt_io);
-       release_region(wdt_io, 2);
-       return -EIO;
-}
-
-static int w83697hf_ioports[] = { 0x2e, 0x4e, 0x00 };
-
-static int __init
-wdt_init(void)
-{
-       int ret, i, found = 0;
-
-       spin_lock_init(&io_lock);
-
-       printk (KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n");
-
-       if (wdt_io == 0) {
-               /* we will autodetect the W83697HF/HG watchdog */
-               for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) {
-                       wdt_io = w83697hf_ioports[i];
-                       if (!w83697hf_check_wdt())
-                               found++;
-               }
-       } else {
-               if (!w83697hf_check_wdt())
-                       found++;
-       }
-
-       if (!found) {
-               printk (KERN_ERR PFX "No W83697HF/HG could be found\n");
-               ret = -EIO;
-               goto out;
-       }
-
-       w83697hf_init();
-       wdt_disable();  /* Disable watchdog until first use */
-
-       if (wdt_set_heartbeat(timeout)) {
-               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
-               printk (KERN_INFO PFX "timeout value must be 1<=timeout<=255, using %d\n",
-                       WATCHDOG_TIMEOUT);
-       }
-
-       ret = register_reboot_notifier(&wdt_notifier);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               goto unreg_regions;
-       }
-
-       ret = misc_register(&wdt_miscdev);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto unreg_reboot;
-       }
-
-       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-out:
-       return ret;
-unreg_reboot:
-       unregister_reboot_notifier(&wdt_notifier);
-unreg_regions:
-       release_region(wdt_io, 2);
-       goto out;
-}
-
-static void __exit
-wdt_exit(void)
-{
-       misc_deregister(&wdt_miscdev);
-       unregister_reboot_notifier(&wdt_notifier);
-       release_region(wdt_io, 2);
-}
-
-module_init(wdt_init);
-module_exit(wdt_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, Samuel Tardieu <sam@rfc1149.net>");
-MODULE_DESCRIPTION("w83697hf/hg WDT driver");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
deleted file mode 100644 (file)
index 3c88fe1..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- *     W83877F Computer Watchdog Timer driver
- *
- *      Based on acquirewdt.c by Alan Cox,
- *           and sbc60xxwdt.c by Jakob Oestergaard <jakob@unthought.net>
- *
- *     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 authors do NOT admit liability nor provide warranty for
- *     any of this software. This material is provided "AS-IS" in
- *      the hope that it may be useful for others.
- *
- *     (c) Copyright 2001    Scott Jennings <linuxdrivers@oro.net>
- *
- *           4/19 - 2001      [Initial revision]
- *           9/27 - 2001      Added spinlocking
- *           4/12 - 2002      [rob@osinvestor.com] Eliminate extra comments
- *                            Eliminate fop_read
- *                            Eliminate extra spin_unlock
- *                            Added KERN_* tags to printks
- *                            add CONFIG_WATCHDOG_NOWAYOUT support
- *                            fix possible wdt_is_open race
- *                            changed watchdog_info to correctly reflect what the driver offers
- *                            added WDIOC_GETSTATUS, WDIOC_GETBOOTSTATUS, WDIOC_SETTIMEOUT,
- *                            WDIOC_GETTIMEOUT, and WDIOC_SETOPTIONS ioctls
- *           09/8 - 2003      [wim@iguana.be] cleanup of trailing spaces
- *                            added extra printk's for startup problems
- *                            use module_param
- *                            made timeout (the emulated heartbeat) a module_param
- *                            made the keepalive ping an internal subroutine
- *
- *  This WDT driver is different from most other Linux WDT
- *  drivers in that the driver will ping the watchdog by itself,
- *  because this particular WDT has a very short timeout (1.6
- *  seconds) and it would be insane to count on any userspace
- *  daemon always getting scheduled within that time frame.
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/jiffies.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define OUR_NAME "w83877f_wdt"
-#define PFX OUR_NAME ": "
-
-#define ENABLE_W83877F_PORT 0x3F0
-#define ENABLE_W83877F 0x87
-#define DISABLE_W83877F 0xAA
-#define WDT_PING 0x443
-#define WDT_REGISTER 0x14
-#define WDT_ENABLE 0x9C
-#define WDT_DISABLE 0x8C
-
-/*
- * The W83877F seems to be fixed at 1.6s timeout (at least on the
- * EMACS PC-104 board I'm using). If we reset the watchdog every
- * ~250ms we should be safe.  */
-
-#define WDT_INTERVAL (HZ/4+1)
-
-/*
- * We must not require too good response from the userspace daemon.
- * Here we require the userspace daemon to send us a heartbeat
- * char to /dev/watchdog every 30 seconds.
- */
-
-#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
-static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
-
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void wdt_timer_ping(unsigned long);
-static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
-static unsigned long next_heartbeat;
-static unsigned long wdt_is_open;
-static char wdt_expect_close;
-static spinlock_t wdt_spinlock;
-
-/*
- *     Whack the dog
- */
-
-static void wdt_timer_ping(unsigned long data)
-{
-       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
-        * we agree to ping the WDT
-        */
-       if(time_before(jiffies, next_heartbeat))
-       {
-               /* Ping the WDT */
-               spin_lock(&wdt_spinlock);
-
-               /* Ping the WDT by reading from WDT_PING */
-               inb_p(WDT_PING);
-
-               /* Re-set the timer interval */
-               mod_timer(&timer, jiffies + WDT_INTERVAL);
-
-               spin_unlock(&wdt_spinlock);
-
-       } else {
-               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
-       }
-}
-
-/*
- * Utility routines
- */
-
-static void wdt_change(int writeval)
-{
-       unsigned long flags;
-       spin_lock_irqsave(&wdt_spinlock, flags);
-
-       /* buy some time */
-       inb_p(WDT_PING);
-
-       /* make W83877F available */
-       outb_p(ENABLE_W83877F,  ENABLE_W83877F_PORT);
-       outb_p(ENABLE_W83877F,  ENABLE_W83877F_PORT);
-
-       /* enable watchdog */
-       outb_p(WDT_REGISTER,    ENABLE_W83877F_PORT);
-       outb_p(writeval,        ENABLE_W83877F_PORT+1);
-
-       /* lock the W8387FF away */
-       outb_p(DISABLE_W83877F, ENABLE_W83877F_PORT);
-
-       spin_unlock_irqrestore(&wdt_spinlock, flags);
-}
-
-static void wdt_startup(void)
-{
-       next_heartbeat = jiffies + (timeout * HZ);
-
-       /* Start the timer */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
-
-       wdt_change(WDT_ENABLE);
-
-       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
-}
-
-static void wdt_turnoff(void)
-{
-       /* Stop the timer */
-       del_timer(&timer);
-
-       wdt_change(WDT_DISABLE);
-
-       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
-}
-
-static void wdt_keepalive(void)
-{
-       /* user land ping */
-       next_heartbeat = jiffies + (timeout * HZ);
-}
-
-/*
- * /dev/watchdog handling
- */
-
-static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if(count)
-       {
-               if (!nowayout)
-               {
-                       size_t ofs;
-
-                       /* note: just in case someone wrote the magic character
-                        * five months ago... */
-                       wdt_expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for(ofs = 0; ofs != count; ofs++)
-                       {
-                               char c;
-                               if (get_user(c, buf + ofs))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       wdt_expect_close = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should restart timer */
-               wdt_keepalive();
-       }
-       return count;
-}
-
-static int fop_open(struct inode * inode, struct file * file)
-{
-       /* Just in case we're already talking to someone... */
-       if(test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-
-       /* Good, fire up the show */
-       wdt_startup();
-       return nonseekable_open(inode, file);
-}
-
-static int fop_close(struct inode * inode, struct file * file)
-{
-       if(wdt_expect_close == 42)
-               wdt_turnoff();
-       else {
-               del_timer(&timer);
-               printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
-       }
-       clear_bit(0, &wdt_is_open);
-       wdt_expect_close = 0;
-       return 0;
-}
-
-static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident=
-       {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "W83877F",
-       };
-
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_keepalive();
-                       return 0;
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
-
-                       if(get_user(new_options, p))
-                               return -EFAULT;
-
-                       if(new_options & WDIOS_DISABLECARD) {
-                               wdt_turnoff();
-                               retval = 0;
-                       }
-
-                       if(new_options & WDIOS_ENABLECARD) {
-                               wdt_startup();
-                               retval = 0;
-                       }
-
-                       return retval;
-               }
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_timeout;
-
-                       if(get_user(new_timeout, p))
-                               return -EFAULT;
-
-                       if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
-                               return -EINVAL;
-
-                       timeout = new_timeout;
-                       wdt_keepalive();
-                       /* Fall through */
-               }
-               case WDIOC_GETTIMEOUT:
-                       return put_user(timeout, p);
-       }
-}
-
-static const struct file_operations wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = fop_write,
-       .open           = fop_open,
-       .release        = fop_close,
-       .ioctl          = fop_ioctl,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &wdt_fops,
-};
-
-/*
- *     Notifier for system down
- */
-
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if(code==SYS_DOWN || code==SYS_HALT)
-               wdt_turnoff();
-       return NOTIFY_DONE;
-}
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier=
-{
-       .notifier_call = wdt_notify_sys,
-};
-
-static void __exit w83877f_wdt_unload(void)
-{
-       wdt_turnoff();
-
-       /* Deregister */
-       misc_deregister(&wdt_miscdev);
-
-       unregister_reboot_notifier(&wdt_notifier);
-       release_region(WDT_PING,1);
-       release_region(ENABLE_W83877F_PORT,2);
-}
-
-static int __init w83877f_wdt_init(void)
-{
-       int rc = -EBUSY;
-
-       spin_lock_init(&wdt_spinlock);
-
-       if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
-       {
-               timeout = WATCHDOG_TIMEOUT;
-               printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
-                       timeout);
-       }
-
-       if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT"))
-       {
-               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       ENABLE_W83877F_PORT);
-               rc = -EIO;
-               goto err_out;
-       }
-
-       if (!request_region(WDT_PING, 1, "W8387FF WDT"))
-       {
-               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       WDT_PING);
-               rc = -EIO;
-               goto err_out_region1;
-       }
-
-       rc = misc_register(&wdt_miscdev);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       wdt_miscdev.minor, rc);
-               goto err_out_region2;
-       }
-
-       rc = register_reboot_notifier(&wdt_notifier);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_miscdev;
-       }
-
-       printk(KERN_INFO PFX "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-       return 0;
-
-err_out_miscdev:
-       misc_deregister(&wdt_miscdev);
-err_out_region2:
-       release_region(WDT_PING,1);
-err_out_region1:
-       release_region(ENABLE_W83877F_PORT,2);
-err_out:
-       return rc;
-}
-
-module_init(w83877f_wdt_init);
-module_exit(w83877f_wdt_unload);
-
-MODULE_AUTHOR("Scott and Bill Jennings");
-MODULE_DESCRIPTION("Driver for watchdog timer in w83877f chip");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/w83977f_wdt.c b/drivers/char/watchdog/w83977f_wdt.c
deleted file mode 100644 (file)
index 1579684..0000000
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- *     W83977F Watchdog Timer Driver for Winbond W83977F I/O Chip
- *
- *     (c) Copyright 2005  Jose Goncalves <jose.goncalves@inov.pt>
- *
- *      Based on w83877f_wdt.c by Scott Jennings,
- *           and wdt977.c by Woody Suwalski
- *
- *                     -----------------------
- *
- *     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.
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/watchdog.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-
-#include <asm/io.h>
-#include <asm/system.h>
-#include <asm/uaccess.h>
-
-#define WATCHDOG_VERSION  "1.00"
-#define WATCHDOG_NAME     "W83977F WDT"
-#define PFX WATCHDOG_NAME ": "
-#define DRIVER_VERSION    WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
-
-#define IO_INDEX_PORT     0x3F0
-#define IO_DATA_PORT      (IO_INDEX_PORT+1)
-
-#define UNLOCK_DATA       0x87
-#define LOCK_DATA         0xAA
-#define DEVICE_REGISTER   0x07
-
-#define        DEFAULT_TIMEOUT   45            /* default timeout in seconds */
-
-static int timeout = DEFAULT_TIMEOUT;
-static int timeoutW;                   /* timeout in watchdog counter units */
-static unsigned long timer_alive;
-static int testmode;
-static char expect_close;
-static spinlock_t spinlock;
-
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (15..7635), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")");
-module_param(testmode, int, 0);
-MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- * Start the watchdog
- */
-
-static int wdt_start(void)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* Unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-
-       /*
-        * Select device Aux2 (device=8) to set watchdog regs F2, F3 and F4.
-        * F2 has the timeout in watchdog counter units.
-        * F3 is set to enable watchdog LED blink at timeout.
-        * F4 is used to just clear the TIMEOUT'ed state (bit 0).
-        */
-       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
-       outb_p(0x08,IO_DATA_PORT);
-       outb_p(0xF2,IO_INDEX_PORT);
-       outb_p(timeoutW,IO_DATA_PORT);
-       outb_p(0xF3,IO_INDEX_PORT);
-       outb_p(0x08,IO_DATA_PORT);
-       outb_p(0xF4,IO_INDEX_PORT);
-       outb_p(0x00,IO_DATA_PORT);
-
-       /* Set device Aux2 active */
-       outb_p(0x30,IO_INDEX_PORT);
-       outb_p(0x01,IO_DATA_PORT);
-
-       /* 
-        * Select device Aux1 (dev=7) to set GP16 as the watchdog output
-        * (in reg E6) and GP13 as the watchdog LED output (in reg E3).
-        * Map GP16 at pin 119.
-        * In test mode watch the bit 0 on F4 to indicate "triggered" or
-        * check watchdog LED on SBC.
-        */
-       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
-       outb_p(0x07,IO_DATA_PORT);
-       if (!testmode)
-       {
-               unsigned pin_map;
-
-               outb_p(0xE6,IO_INDEX_PORT);
-               outb_p(0x0A,IO_DATA_PORT);
-               outb_p(0x2C,IO_INDEX_PORT);
-               pin_map = inb_p(IO_DATA_PORT);
-               pin_map |= 0x10;
-               pin_map &= ~(0x20);
-               outb_p(0x2C,IO_INDEX_PORT);
-               outb_p(pin_map,IO_DATA_PORT);
-       }
-       outb_p(0xE3,IO_INDEX_PORT);
-       outb_p(0x08,IO_DATA_PORT);
-
-       /* Set device Aux1 active */
-       outb_p(0x30,IO_INDEX_PORT);
-       outb_p(0x01,IO_DATA_PORT);
-
-       /* Lock the SuperIO chip */
-       outb_p(LOCK_DATA,IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-
-       printk(KERN_INFO PFX "activated.\n");
-
-       return 0;
-}
-
-/*
- * Stop the watchdog
- */
-
-static int wdt_stop(void)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* Unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-
-       /* 
-        * Select device Aux2 (device=8) to set watchdog regs F2, F3 and F4.
-        * F2 is reset to its default value (watchdog timer disabled).
-        * F3 is reset to its default state.
-        * F4 clears the TIMEOUT'ed state (bit 0) - back to default.
-        */
-       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
-       outb_p(0x08,IO_DATA_PORT);
-       outb_p(0xF2,IO_INDEX_PORT);
-       outb_p(0xFF,IO_DATA_PORT);
-       outb_p(0xF3,IO_INDEX_PORT);
-       outb_p(0x00,IO_DATA_PORT);
-       outb_p(0xF4,IO_INDEX_PORT);
-       outb_p(0x00,IO_DATA_PORT);
-       outb_p(0xF2,IO_INDEX_PORT);
-       outb_p(0x00,IO_DATA_PORT);
-
-       /*
-        * Select device Aux1 (dev=7) to set GP16 (in reg E6) and 
-        * Gp13 (in reg E3) as inputs.
-        */
-       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
-       outb_p(0x07,IO_DATA_PORT);
-       if (!testmode)
-       {
-               outb_p(0xE6,IO_INDEX_PORT);
-               outb_p(0x01,IO_DATA_PORT);
-       }
-       outb_p(0xE3,IO_INDEX_PORT);
-       outb_p(0x01,IO_DATA_PORT);
-
-       /* Lock the SuperIO chip */
-       outb_p(LOCK_DATA,IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-
-       printk(KERN_INFO PFX "shutdown.\n");
-
-       return 0;
-}
-
-/*
- * Send a keepalive ping to the watchdog
- * This is done by simply re-writing the timeout to reg. 0xF2
- */
-
-static int wdt_keepalive(void)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* Unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-
-       /* Select device Aux2 (device=8) to kick watchdog reg F2 */
-       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
-       outb_p(0x08,IO_DATA_PORT);
-       outb_p(0xF2,IO_INDEX_PORT);
-       outb_p(timeoutW,IO_DATA_PORT);
-
-       /* Lock the SuperIO chip */
-       outb_p(LOCK_DATA,IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-
-       return 0;
-}
-
-/*
- * Set the watchdog timeout value
- */
-
-static int wdt_set_timeout(int t)
-{
-       int tmrval;
-
-       /*
-        * Convert seconds to watchdog counter time units, rounding up.
-        * On PCM-5335 watchdog units are 30 seconds/step with 15 sec startup 
-        * value. This information is supplied in the PCM-5335 manual and was
-        * checked by me on a real board. This is a bit strange because W83977f
-        * datasheet says counter unit is in minutes!
-        */
-       if (t < 15)
-               return -EINVAL;
-
-       tmrval = ((t + 15) + 29) / 30;
-
-       if (tmrval > 255)
-               return -EINVAL;
-
-       /*
-        * timeout is the timeout in seconds, 
-        * timeoutW is the timeout in watchdog counter units.
-        */
-       timeoutW = tmrval;
-       timeout = (timeoutW * 30) - 15;
-       return 0;
-}
-
-/*
- * Get the watchdog status
- */
-
-static int wdt_get_status(int *status)
-{
-       int new_status;
-       unsigned long flags;
-
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* Unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
-
-       /* Select device Aux2 (device=8) to read watchdog reg F4 */
-       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
-       outb_p(0x08,IO_DATA_PORT);
-       outb_p(0xF4,IO_INDEX_PORT);
-       new_status = inb_p(IO_DATA_PORT);
-
-       /* Lock the SuperIO chip */
-       outb_p(LOCK_DATA,IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-
-       *status = 0;
-       if (new_status & 1)
-               *status |= WDIOF_CARDRESET;
-
-       return 0;
-}
-
-
-/*
- *     /dev/watchdog handling
- */
-
-static int wdt_open(struct inode *inode, struct file *file)
-{
-       /* If the watchdog is alive we don't need to start it again */
-       if( test_and_set_bit(0, &timer_alive) )
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-static int wdt_release(struct inode *inode, struct file *file)
-{
-       /*
-        * Shut off the timer.
-        * Lock it in if it's a module and we set nowayout
-        */
-       if (expect_close == 42)
-       {
-               wdt_stop();
-               clear_bit(0, &timer_alive);
-       } else {
-               wdt_keepalive();
-               printk(KERN_CRIT PFX "unexpected close, not stopping watchdog!\n");
-       }
-       expect_close = 0;
-       return 0;
-}
-
-/*
- *      wdt_write:
- *      @file: file handle to the watchdog
- *      @buf: buffer to write (unused as data does not matter here
- *      @count: count of bytes
- *      @ppos: pointer to the position to write. No seeks allowed
- *
- *      A write to a watchdog device is defined as a keepalive signal. Any
- *      write of data will do, as we we don't define content meaning.
- */
-
-static ssize_t wdt_write(struct file *file, const char __user *buf,
-                           size_t count, loff_t *ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if(count)
-       {
-               if (!nowayout)
-               {
-                       size_t ofs;
-
-                       /* note: just in case someone wrote the magic character long ago */
-                       expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for(ofs = 0; ofs != count; ofs++)
-                       {
-                               char c;
-                               if (get_user(c, buf + ofs))
-                                       return -EFAULT;
-                               if (c == 'V') {
-                                       expect_close = 42;
-                               }
-                       }
-               }
-
-               /* someone wrote to us, we should restart timer */
-               wdt_keepalive();
-       }
-       return count;
-}
-
-/*
- *      wdt_ioctl:
- *      @inode: inode of the device
- *      @file: file handle to the device
- *      @cmd: watchdog command
- *      @arg: argument pointer
- *
- *      The watchdog API defines a common set of functions for all watchdogs
- *      according to their available features.
- */
-
-static struct watchdog_info ident = {
-       .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
-       .firmware_version =     1,
-       .identity = WATCHDOG_NAME,
-};
-
-static int wdt_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       int status;
-       int new_options, retval = -EINVAL;
-       int new_timeout;
-       union {
-               struct watchdog_info __user *ident;
-               int __user *i;
-       } uarg;
-
-       uarg.i = (int __user *)arg;
-
-       switch(cmd)
-       {
-       default:
-               return -ENOTTY;
-
-       case WDIOC_GETSUPPORT:
-               return copy_to_user(uarg.ident, &ident, sizeof(ident)) ? -EFAULT : 0;
-
-       case WDIOC_GETSTATUS:
-               wdt_get_status(&status);
-               return put_user(status, uarg.i);
-
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, uarg.i);
-
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
-
-       case WDIOC_SETOPTIONS:
-               if (get_user (new_options, uarg.i))
-                       return -EFAULT;
-
-               if (new_options & WDIOS_DISABLECARD) {
-                       wdt_stop();
-                       retval = 0;
-               }
-
-               if (new_options & WDIOS_ENABLECARD) {
-                       wdt_start();
-                       retval = 0;
-               }
-
-               return retval;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, uarg.i))
-                       return -EFAULT;
-
-               if (wdt_set_timeout(new_timeout))
-                   return -EINVAL;
-
-               wdt_keepalive();
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, uarg.i);
-
-       }
-}
-
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if (code==SYS_DOWN || code==SYS_HALT)
-               wdt_stop();
-       return NOTIFY_DONE;
-}
-
-static const struct file_operations wdt_fops=
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdt_write,
-       .ioctl          = wdt_ioctl,
-       .open           = wdt_open,
-       .release        = wdt_release,
-};
-
-static struct miscdevice wdt_miscdev=
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &wdt_fops,
-};
-
-static struct notifier_block wdt_notifier = {
-       .notifier_call = wdt_notify_sys,
-};
-
-static int __init w83977f_wdt_init(void)
-{
-       int rc;
-
-        printk(KERN_INFO PFX DRIVER_VERSION);
-
-       spin_lock_init(&spinlock);
-
-       /*
-        * Check that the timeout value is within it's range ; 
-        * if not reset to the default
-        */
-       if (wdt_set_timeout(timeout)) {
-               wdt_set_timeout(DEFAULT_TIMEOUT);
-               printk(KERN_INFO PFX "timeout value must be 15<=timeout<=7635, using %d\n",
-                       DEFAULT_TIMEOUT);
-       }
-
-       if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME))
-       {
-               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       IO_INDEX_PORT);
-               rc = -EIO;
-               goto err_out;
-       }
-
-       rc = misc_register(&wdt_miscdev);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       wdt_miscdev.minor, rc);
-               goto err_out_region;
-       }
-
-       rc = register_reboot_notifier(&wdt_notifier);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_miscdev;
-       }
-
-       printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n",
-               timeout, nowayout, testmode);
-
-       return 0;
-
-err_out_miscdev:
-       misc_deregister(&wdt_miscdev);
-err_out_region:
-       release_region(IO_INDEX_PORT,2);
-err_out:
-       return rc;
-}
-
-static void __exit w83977f_wdt_exit(void)
-{
-       wdt_stop();
-       misc_deregister(&wdt_miscdev);
-       unregister_reboot_notifier(&wdt_notifier);
-       release_region(IO_INDEX_PORT,2);
-}
-
-module_init(w83977f_wdt_init);
-module_exit(w83977f_wdt_exit);
-
-MODULE_AUTHOR("Jose Goncalves <jose.goncalves@inov.pt>");
-MODULE_DESCRIPTION("Driver for watchdog timer in W83977F I/O chip");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c
deleted file mode 100644 (file)
index 950905d..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- *     ICP Wafer 5823 Single Board Computer WDT driver
- *      http://www.icpamerica.com/wafer_5823.php
- *      May also work on other similar models
- *
- *     (c) Copyright 2002 Justin Cormack <justin@street-vision.com>
- *
- *      Release 0.02
- *
- *     Based on advantechwdt.c which is based on wdt.c.
- *     Original copyright messages:
- *
- *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-
-#define WATCHDOG_NAME "Wafer 5823 WDT"
-#define PFX WATCHDOG_NAME ": "
-#define WD_TIMO 60                     /* 60 sec default timeout */
-
-static unsigned long wafwdt_is_open;
-static char expect_close;
-static spinlock_t wafwdt_lock;
-
-/*
- *     You must set these - there is no sane way to probe for this board.
- *
- *      To enable, write the timeout value in seconds (1 to 255) to I/O
- *      port WDT_START, then read the port to start the watchdog. To pat
- *      the dog, read port WDT_STOP to stop the timer, then read WDT_START
- *      to restart it again.
- */
-
-static int wdt_stop = 0x843;
-static int wdt_start = 0x443;
-
-static int timeout = WD_TIMO;  /* in seconds */
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) ".");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void wafwdt_ping(void)
-{
-       /* pat watchdog */
-       spin_lock(&wafwdt_lock);
-       inb_p(wdt_stop);
-       inb_p(wdt_start);
-       spin_unlock(&wafwdt_lock);
-}
-
-static void wafwdt_start(void)
-{
-       /* start up watchdog */
-       outb_p(timeout, wdt_start);
-       inb_p(wdt_start);
-}
-
-static void
-wafwdt_stop(void)
-{
-       /* stop watchdog */
-       inb_p(wdt_stop);
-}
-
-static ssize_t wafwdt_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
-{
-       /* See if we got the magic character 'V' and reload the timer */
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       /* scan to see whether or not we got the magic character */
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               /* Well, anyhow someone wrote to us, we should return that favour */
-               wafwdt_ping();
-       }
-       return count;
-}
-
-static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-            unsigned long arg)
-{
-       int new_timeout;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       static struct watchdog_info ident = {
-               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
-               .firmware_version = 1,
-               .identity = "Wafer 5823 WDT",
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof (ident)))
-                       return -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, p);
-
-       case WDIOC_KEEPALIVE:
-               wafwdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if ((new_timeout < 1) || (new_timeout > 255))
-                       return -EINVAL;
-               timeout = new_timeout;
-               wafwdt_stop();
-               wafwdt_start();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
-
-       case WDIOC_SETOPTIONS:
-       {
-               int options, retval = -EINVAL;
-
-               if (get_user(options, p))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD) {
-                       wafwdt_start();
-                       retval = 0;
-               }
-
-               if (options & WDIOS_ENABLECARD) {
-                       wafwdt_stop();
-                       retval = 0;
-               }
-
-               return retval;
-       }
-
-       default:
-               return -ENOTTY;
-       }
-       return 0;
-}
-
-static int wafwdt_open(struct inode *inode, struct file *file)
-{
-       if (test_and_set_bit(0, &wafwdt_is_open))
-               return -EBUSY;
-
-       /*
-        *      Activate
-        */
-       wafwdt_start();
-       return nonseekable_open(inode, file);
-}
-
-static int
-wafwdt_close(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               wafwdt_stop();
-       } else {
-               printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
-               wafwdt_ping();
-       }
-       clear_bit(0, &wafwdt_is_open);
-       expect_close = 0;
-       return 0;
-}
-
-/*
- *     Notifier for system down
- */
-
-static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
-{
-       if (code == SYS_DOWN || code == SYS_HALT) {
-               /* Turn the WDT off */
-               wafwdt_stop();
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-static const struct file_operations wafwdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wafwdt_write,
-       .ioctl          = wafwdt_ioctl,
-       .open           = wafwdt_open,
-       .release        = wafwdt_close,
-};
-
-static struct miscdevice wafwdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &wafwdt_fops,
-};
-
-/*
- *     The WDT needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wafwdt_notifier = {
-       .notifier_call = wafwdt_notify_sys,
-};
-
-static int __init wafwdt_init(void)
-{
-       int ret;
-
-       printk(KERN_INFO "WDT driver for Wafer 5823 single board computer initialising.\n");
-
-       spin_lock_init(&wafwdt_lock);
-
-       if (timeout < 1 || timeout > 255) {
-               timeout = WD_TIMO;
-               printk (KERN_INFO PFX "timeout value must be 1<=x<=255, using %d\n",
-                       timeout);
-       }
-
-       if (wdt_stop != wdt_start) {
-               if(!request_region(wdt_stop, 1, "Wafer 5823 WDT")) {
-                       printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       wdt_stop);
-                       ret = -EIO;
-                       goto error;
-               }
-       }
-
-       if(!request_region(wdt_start, 1, "Wafer 5823 WDT")) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       wdt_start);
-               ret = -EIO;
-               goto error2;
-       }
-
-       ret = register_reboot_notifier(&wafwdt_notifier);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       ret);
-               goto error3;
-       }
-
-       ret = misc_register(&wafwdt_miscdev);
-       if (ret != 0) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto error4;
-       }
-
-       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
-               timeout, nowayout);
-
-       return ret;
-error4:
-       unregister_reboot_notifier(&wafwdt_notifier);
-error3:
-       release_region(wdt_start, 1);
-error2:
-       if (wdt_stop != wdt_start)
-               release_region(wdt_stop, 1);
-error:
-       return ret;
-}
-
-static void __exit wafwdt_exit(void)
-{
-       misc_deregister(&wafwdt_miscdev);
-       unregister_reboot_notifier(&wafwdt_notifier);
-       if(wdt_stop != wdt_start)
-               release_region(wdt_stop, 1);
-       release_region(wdt_start, 1);
-}
-
-module_init(wafwdt_init);
-module_exit(wafwdt_exit);
-
-MODULE_AUTHOR("Justin Cormack");
-MODULE_DESCRIPTION("ICP Wafer 5823 Single Board Computer WDT driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-/* end of wafer5823wdt.c */
diff --git a/drivers/char/watchdog/wd501p.h b/drivers/char/watchdog/wd501p.h
deleted file mode 100644 (file)
index a4504f4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *     Industrial Computer Source WDT500/501 driver
- *
- *     (c) Copyright 1995      CymruNET Ltd
- *                             Innovation Centre
- *                             Singleton Park
- *                             Swansea
- *                             Wales
- *                             UK
- *                             SA2 8PP
- *
- *     http://www.cymru.net
- *
- *     This driver is provided under the GNU General Public License, incorporated
- *     herein by reference. The driver is provided without warranty or 
- *     support.
- *
- *     Release 0.04.
- *
- */
-
-
-#define WDT_COUNT0             (io+0)
-#define WDT_COUNT1             (io+1)
-#define WDT_COUNT2             (io+2)
-#define WDT_CR                 (io+3)
-#define WDT_SR                 (io+4)  /* Start buzzer on PCI write */
-#define WDT_RT                 (io+5)  /* Stop buzzer on PCI write */
-#define WDT_BUZZER             (io+6)  /* PCI only: rd=disable, wr=enable */
-#define WDT_DC                 (io+7)
-
-/* The following are only on the PCI card, they're outside of I/O space on
- * the ISA card: */
-#define WDT_CLOCK              (io+12) /* COUNT2: rd=16.67MHz, wr=2.0833MHz */
-/* inverted opto isolated reset output: */
-#define WDT_OPTONOTRST         (io+13) /* wr=enable, rd=disable */
-/* opto isolated reset output: */
-#define WDT_OPTORST            (io+14) /* wr=enable, rd=disable */
-/* programmable outputs: */
-#define WDT_PROGOUT            (io+15) /* wr=enable, rd=disable */
-
-                                                               /* FAN 501 500 */
-#define WDC_SR_WCCR            1       /* Active low */        /*  X   X   X  */
-#define WDC_SR_TGOOD           2                               /*  X   X   -  */
-#define WDC_SR_ISOI0           4                               /*  X   X   X  */
-#define WDC_SR_ISII1           8                               /*  X   X   X  */
-#define WDC_SR_FANGOOD         16                              /*  X   -   -  */
-#define WDC_SR_PSUOVER         32      /* Active low */        /*  X   X   -  */
-#define WDC_SR_PSUUNDR         64      /* Active low */        /*  X   X   -  */
-#define WDC_SR_IRQ             128     /* Active low */        /*  X   X   X  */
-
diff --git a/drivers/char/watchdog/wdrtas.c b/drivers/char/watchdog/wdrtas.c
deleted file mode 100644 (file)
index 1d64e27..0000000
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * FIXME: add wdrtas_get_status and wdrtas_get_boot_status as soon as
- * RTAS calls are available
- */
-
-/*
- * RTAS watchdog driver
- *
- * (C) Copyright IBM Corp. 2005
- * device driver to exploit watchdog RTAS functions
- *
- * Authors : Utz Bacher <utz.bacher@de.ibm.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
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <linux/fs.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/miscdevice.h>
-#include <linux/module.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-
-#include <asm/rtas.h>
-#include <asm/uaccess.h>
-
-#define WDRTAS_MAGIC_CHAR              42
-#define WDRTAS_SUPPORTED_MASK          (WDIOF_SETTIMEOUT | \
-                                        WDIOF_MAGICCLOSE)
-
-MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>");
-MODULE_DESCRIPTION("RTAS watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS_MISCDEV(TEMP_MINOR);
-
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-static int wdrtas_nowayout = 1;
-#else
-static int wdrtas_nowayout = 0;
-#endif
-
-static atomic_t wdrtas_miscdev_open = ATOMIC_INIT(0);
-static char wdrtas_expect_close = 0;
-
-static int wdrtas_interval;
-
-#define WDRTAS_THERMAL_SENSOR          3
-static int wdrtas_token_get_sensor_state;
-#define WDRTAS_SURVEILLANCE_IND                9000
-static int wdrtas_token_set_indicator;
-#define WDRTAS_SP_SPI                  28
-static int wdrtas_token_get_sp;
-static int wdrtas_token_event_scan;
-
-#define WDRTAS_DEFAULT_INTERVAL                300
-
-#define WDRTAS_LOGBUFFER_LEN           128
-static char wdrtas_logbuffer[WDRTAS_LOGBUFFER_LEN];
-
-
-/*** watchdog access functions */
-
-/**
- * wdrtas_set_interval - sets the watchdog interval
- * @interval: new interval
- *
- * returns 0 on success, <0 on failures
- *
- * wdrtas_set_interval sets the watchdog keepalive interval by calling the
- * RTAS function set-indicator (surveillance). The unit of interval is
- * seconds.
- */
-static int
-wdrtas_set_interval(int interval)
-{
-       long result;
-       static int print_msg = 10;
-
-       /* rtas uses minutes */
-       interval = (interval + 59) / 60;
-
-       result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL,
-                          WDRTAS_SURVEILLANCE_IND, 0, interval);
-       if ( (result < 0) && (print_msg) ) {
-               printk(KERN_ERR "wdrtas: setting the watchdog to %i "
-                      "timeout failed: %li\n", interval, result);
-               print_msg--;
-       }
-
-       return result;
-}
-
-/**
- * wdrtas_get_interval - returns the current watchdog interval
- * @fallback_value: value (in seconds) to use, if the RTAS call fails
- *
- * returns the interval
- *
- * wdrtas_get_interval returns the current watchdog keepalive interval
- * as reported by the RTAS function ibm,get-system-parameter. The unit
- * of the return value is seconds.
- */
-static int
-wdrtas_get_interval(int fallback_value)
-{
-       long result;
-       char value[4];
-
-       result = rtas_call(wdrtas_token_get_sp, 3, 1, NULL,
-                          WDRTAS_SP_SPI, (void *)__pa(&value), 4);
-       if ( (value[0] != 0) || (value[1] != 2) || (value[3] != 0) ||
-            (result < 0) ) {
-               printk(KERN_WARNING "wdrtas: could not get sp_spi watchdog "
-                      "timeout (%li). Continuing\n", result);
-               return fallback_value;
-       }
-
-       /* rtas uses minutes */
-       return ((int)value[2]) * 60;
-}
-
-/**
- * wdrtas_timer_start - starts watchdog
- *
- * wdrtas_timer_start starts the watchdog by calling the RTAS function
- * set-interval (surveillance)
- */
-static void
-wdrtas_timer_start(void)
-{
-       wdrtas_set_interval(wdrtas_interval);
-}
-
-/**
- * wdrtas_timer_stop - stops watchdog
- *
- * wdrtas_timer_stop stops the watchdog timer by calling the RTAS function
- * set-interval (surveillance)
- */
-static void
-wdrtas_timer_stop(void)
-{
-       wdrtas_set_interval(0);
-}
-
-/**
- * wdrtas_log_scanned_event - logs an event we received during keepalive
- *
- * wdrtas_log_scanned_event prints a message to the log buffer dumping
- * the results of the last event-scan call
- */
-static void
-wdrtas_log_scanned_event(void)
-{
-       int i;
-
-       for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16)
-               printk(KERN_INFO "wdrtas: dumping event (line %i/%i), data = "
-                      "%02x %02x %02x %02x  %02x %02x %02x %02x   "
-                      "%02x %02x %02x %02x  %02x %02x %02x %02x\n",
-                      (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16),
-                      wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], 
-                      wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], 
-                      wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], 
-                      wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], 
-                      wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], 
-                      wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], 
-                      wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], 
-                      wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]);
-}
-
-/**
- * wdrtas_timer_keepalive - resets watchdog timer to keep system alive
- *
- * wdrtas_timer_keepalive restarts the watchdog timer by calling the
- * RTAS function event-scan and repeats these calls as long as there are
- * events available. All events will be dumped.
- */
-static void
-wdrtas_timer_keepalive(void)
-{
-       long result;
-
-       do {
-               result = rtas_call(wdrtas_token_event_scan, 4, 1, NULL,
-                                  RTAS_EVENT_SCAN_ALL_EVENTS, 0,
-                                  (void *)__pa(wdrtas_logbuffer),
-                                  WDRTAS_LOGBUFFER_LEN);
-               if (result < 0)
-                       printk(KERN_ERR "wdrtas: event-scan failed: %li\n",
-                              result);
-               if (result == 0)
-                       wdrtas_log_scanned_event();
-       } while (result == 0);
-}
-
-/**
- * wdrtas_get_temperature - returns current temperature
- *
- * returns temperature or <0 on failures
- *
- * wdrtas_get_temperature returns the current temperature in Fahrenheit. It
- * uses the RTAS call get-sensor-state, token 3 to do so
- */
-static int
-wdrtas_get_temperature(void)
-{
-       long result;
-       int temperature = 0;
-
-       result = rtas_call(wdrtas_token_get_sensor_state, 2, 2,
-                          (void *)__pa(&temperature),
-                          WDRTAS_THERMAL_SENSOR, 0);
-
-       if (result < 0)
-               printk(KERN_WARNING "wdrtas: reading the thermal sensor "
-                      "faild: %li\n", result);
-       else
-               temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */
-
-       return temperature;
-}
-
-/**
- * wdrtas_get_status - returns the status of the watchdog
- *
- * returns a bitmask of defines WDIOF_... as defined in
- * include/linux/watchdog.h
- */
-static int
-wdrtas_get_status(void)
-{
-       return 0; /* TODO */
-}
-
-/**
- * wdrtas_get_boot_status - returns the reason for the last boot
- *
- * returns a bitmask of defines WDIOF_... as defined in
- * include/linux/watchdog.h, indicating why the watchdog rebooted the system
- */
-static int
-wdrtas_get_boot_status(void)
-{
-       return 0; /* TODO */
-}
-
-/*** watchdog API and operations stuff */
-
-/* wdrtas_write - called when watchdog device is written to
- * @file: file structure
- * @buf: user buffer with data
- * @len: amount to data written
- * @ppos: position in file
- *
- * returns the number of successfully processed characters, which is always
- * the number of bytes passed to this function
- *
- * wdrtas_write processes all the data given to it and looks for the magic
- * character 'V'. This character allows the watchdog device to be closed
- * properly.
- */
-static ssize_t
-wdrtas_write(struct file *file, const char __user *buf,
-            size_t len, loff_t *ppos)
-{
-       int i;
-       char c;
-
-       if (!len)
-               goto out;
-
-       if (!wdrtas_nowayout) {
-               wdrtas_expect_close = 0;
-               /* look for 'V' */
-               for (i = 0; i < len; i++) {
-                       if (get_user(c, buf + i))
-                               return -EFAULT;
-                       /* allow to close device */
-                       if (c == 'V')
-                               wdrtas_expect_close = WDRTAS_MAGIC_CHAR;
-               }
-       }
-
-       wdrtas_timer_keepalive();
-
-out:
-       return len;
-}
-
-/**
- * wdrtas_ioctl - ioctl function for the watchdog device
- * @inode: inode structure
- * @file: file structure
- * @cmd: command for ioctl
- * @arg: argument pointer
- *
- * returns 0 on success, <0 on failure
- *
- * wdrtas_ioctl implements the watchdog API ioctls
- */
-static int
-wdrtas_ioctl(struct inode *inode, struct file *file,
-            unsigned int cmd, unsigned long arg)
-{
-       int __user *argp = (void __user *)arg;
-       int i;
-       static struct watchdog_info wdinfo = {
-               .options = WDRTAS_SUPPORTED_MASK,
-               .firmware_version = 0,
-               .identity = "wdrtas"
-       };
-
-       switch (cmd) {
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &wdinfo, sizeof(wdinfo)))
-                       return -EFAULT;
-               return 0;
-
-       case WDIOC_GETSTATUS:
-               i = wdrtas_get_status();
-               return put_user(i, argp);
-
-       case WDIOC_GETBOOTSTATUS:
-               i = wdrtas_get_boot_status();
-               return put_user(i, argp);
-
-       case WDIOC_GETTEMP:
-               if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE)
-                       return -EOPNOTSUPP;
-
-               i = wdrtas_get_temperature();
-               return put_user(i, argp);
-
-       case WDIOC_SETOPTIONS:
-               if (get_user(i, argp))
-                       return -EFAULT;
-               if (i & WDIOS_DISABLECARD)
-                       wdrtas_timer_stop();
-               if (i & WDIOS_ENABLECARD) {
-                       wdrtas_timer_keepalive();
-                       wdrtas_timer_start();
-               }
-               if (i & WDIOS_TEMPPANIC) {
-                       /* not implemented. Done by H8 */
-               }
-               return 0;
-
-       case WDIOC_KEEPALIVE:
-               wdrtas_timer_keepalive();
-               return 0;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(i, argp))
-                       return -EFAULT;
-
-               if (wdrtas_set_interval(i))
-                       return -EINVAL;
-
-               wdrtas_timer_keepalive();
-
-               if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE)
-                       wdrtas_interval = i;
-               else
-                       wdrtas_interval = wdrtas_get_interval(i);
-               /* fallthrough */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(wdrtas_interval, argp);
-
-       default:
-               return -ENOTTY;
-       }
-}
-
-/**
- * wdrtas_open - open function of watchdog device
- * @inode: inode structure
- * @file: file structure
- *
- * returns 0 on success, -EBUSY if the file has been opened already, <0 on
- * other failures
- *
- * function called when watchdog device is opened
- */
-static int
-wdrtas_open(struct inode *inode, struct file *file)
-{
-       /* only open once */
-       if (atomic_inc_return(&wdrtas_miscdev_open) > 1) {
-               atomic_dec(&wdrtas_miscdev_open);
-               return -EBUSY;
-       }
-
-       wdrtas_timer_start();
-       wdrtas_timer_keepalive();
-
-       return nonseekable_open(inode, file);
-}
-
-/**
- * wdrtas_close - close function of watchdog device
- * @inode: inode structure
- * @file: file structure
- *
- * returns 0 on success
- *
- * close function. Always succeeds
- */
-static int
-wdrtas_close(struct inode *inode, struct file *file)
-{
-       /* only stop watchdog, if this was announced using 'V' before */
-       if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR)
-               wdrtas_timer_stop();
-       else {
-               printk(KERN_WARNING "wdrtas: got unexpected close. Watchdog "
-                      "not stopped.\n");
-               wdrtas_timer_keepalive();
-       }
-
-       wdrtas_expect_close = 0;
-       atomic_dec(&wdrtas_miscdev_open);
-       return 0;
-}
-
-/**
- * wdrtas_temp_read - gives back the temperature in fahrenheit
- * @file: file structure
- * @buf: user buffer
- * @count: number of bytes to be read
- * @ppos: position in file
- *
- * returns always 1 or -EFAULT in case of user space copy failures, <0 on
- * other failures
- *
- * wdrtas_temp_read gives the temperature to the users by copying this
- * value as one byte into the user space buffer. The unit is Fahrenheit...
- */
-static ssize_t
-wdrtas_temp_read(struct file *file, char __user *buf,
-                size_t count, loff_t *ppos)
-{
-       int temperature = 0;
-
-       temperature = wdrtas_get_temperature();
-       if (temperature < 0)
-               return temperature;
-
-       if (copy_to_user(buf, &temperature, 1))
-               return -EFAULT;
-
-       return 1;
-}
-
-/**
- * wdrtas_temp_open - open function of temperature device
- * @inode: inode structure
- * @file: file structure
- *
- * returns 0 on success, <0 on failure
- *
- * function called when temperature device is opened
- */
-static int
-wdrtas_temp_open(struct inode *inode, struct file *file)
-{
-       return nonseekable_open(inode, file);
-}
-
-/**
- * wdrtas_temp_close - close function of temperature device
- * @inode: inode structure
- * @file: file structure
- *
- * returns 0 on success
- *
- * close function. Always succeeds
- */
-static int
-wdrtas_temp_close(struct inode *inode, struct file *file)
-{
-       return 0;
-}
-
-/**
- * wdrtas_reboot - reboot notifier function
- * @nb: notifier block structure
- * @code: reboot code
- * @ptr: unused
- *
- * returns NOTIFY_DONE
- *
- * wdrtas_reboot stops the watchdog in case of a reboot
- */
-static int
-wdrtas_reboot(struct notifier_block *this, unsigned long code, void *ptr)
-{
-       if ( (code==SYS_DOWN) || (code==SYS_HALT) )
-               wdrtas_timer_stop();
-
-       return NOTIFY_DONE;
-}
-
-/*** initialization stuff */
-
-static const struct file_operations wdrtas_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdrtas_write,
-       .ioctl          = wdrtas_ioctl,
-       .open           = wdrtas_open,
-       .release        = wdrtas_close,
-};
-
-static struct miscdevice wdrtas_miscdev = {
-       .minor =        WATCHDOG_MINOR,
-       .name =         "watchdog",
-       .fops =         &wdrtas_fops,
-};
-
-static const struct file_operations wdrtas_temp_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .read           = wdrtas_temp_read,
-       .open           = wdrtas_temp_open,
-       .release        = wdrtas_temp_close,
-};
-
-static struct miscdevice wdrtas_tempdev = {
-       .minor =        TEMP_MINOR,
-       .name =         "temperature",
-       .fops =         &wdrtas_temp_fops,
-};
-
-static struct notifier_block wdrtas_notifier = {
-       .notifier_call =        wdrtas_reboot,
-};
-
-/**
- * wdrtas_get_tokens - reads in RTAS tokens
- *
- * returns 0 on succes, <0 on failure
- *
- * wdrtas_get_tokens reads in the tokens for the RTAS calls used in
- * this watchdog driver. It tolerates, if "get-sensor-state" and
- * "ibm,get-system-parameter" are not available.
- */
-static int
-wdrtas_get_tokens(void)
-{
-       wdrtas_token_get_sensor_state = rtas_token("get-sensor-state");
-       if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) {
-               printk(KERN_WARNING "wdrtas: couldn't get token for "
-                      "get-sensor-state. Trying to continue without "
-                      "temperature support.\n");
-       }
-
-       wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter");
-       if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) {
-               printk(KERN_WARNING "wdrtas: couldn't get token for "
-                      "ibm,get-system-parameter. Trying to continue with "
-                      "a default timeout value of %i seconds.\n",
-                      WDRTAS_DEFAULT_INTERVAL);
-       }
-
-       wdrtas_token_set_indicator = rtas_token("set-indicator");
-       if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) {
-               printk(KERN_ERR "wdrtas: couldn't get token for "
-                      "set-indicator. Terminating watchdog code.\n");
-               return -EIO;
-       }
-
-       wdrtas_token_event_scan = rtas_token("event-scan");
-       if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) {
-               printk(KERN_ERR "wdrtas: couldn't get token for event-scan. "
-                      "Terminating watchdog code.\n");
-               return -EIO;
-       }
-
-       return 0;
-}
-
-/**
- * wdrtas_unregister_devs - unregisters the misc dev handlers
- *
- * wdrtas_register_devs unregisters the watchdog and temperature watchdog
- * misc devs
- */
-static void
-wdrtas_unregister_devs(void)
-{
-       misc_deregister(&wdrtas_miscdev);
-       if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE)
-               misc_deregister(&wdrtas_tempdev);
-}
-
-/**
- * wdrtas_register_devs - registers the misc dev handlers
- *
- * returns 0 on succes, <0 on failure
- *
- * wdrtas_register_devs registers the watchdog and temperature watchdog
- * misc devs
- */
-static int
-wdrtas_register_devs(void)
-{
-       int result;
-
-       result = misc_register(&wdrtas_miscdev);
-       if (result) {
-               printk(KERN_ERR "wdrtas: couldn't register watchdog misc "
-                      "device. Terminating watchdog code.\n");
-               return result;
-       }
-
-       if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) {
-               result = misc_register(&wdrtas_tempdev);
-               if (result) {
-                       printk(KERN_WARNING "wdrtas: couldn't register "
-                              "watchdog temperature misc device. Continuing "
-                              "without temperature support.\n");
-                       wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE;
-               }
-       }
-
-       return 0;
-}
-
-/**
- * wdrtas_init - init function of the watchdog driver
- *
- * returns 0 on succes, <0 on failure
- *
- * registers the file handlers and the reboot notifier
- */
-static int __init
-wdrtas_init(void)
-{
-       if (wdrtas_get_tokens())
-               return -ENODEV;
-
-       if (wdrtas_register_devs())
-               return -ENODEV;
-
-       if (register_reboot_notifier(&wdrtas_notifier)) {
-               printk(KERN_ERR "wdrtas: could not register reboot notifier. "
-                      "Terminating watchdog code.\n");
-               wdrtas_unregister_devs();
-               return -ENODEV;
-       }
-
-       if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE)
-               wdrtas_interval = WDRTAS_DEFAULT_INTERVAL;
-       else
-               wdrtas_interval = wdrtas_get_interval(WDRTAS_DEFAULT_INTERVAL);
-
-       return 0;
-}
-
-/**
- * wdrtas_exit - exit function of the watchdog driver
- *
- * unregisters the file handlers and the reboot notifier
- */
-static void __exit
-wdrtas_exit(void)
-{
-       if (!wdrtas_nowayout)
-               wdrtas_timer_stop();
-
-       wdrtas_unregister_devs();
-
-       unregister_reboot_notifier(&wdrtas_notifier);
-}
-
-module_init(wdrtas_init);
-module_exit(wdrtas_exit);
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
deleted file mode 100644 (file)
index 0a3de6a..0000000
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
- *     Industrial Computer Source WDT500/501 driver
- *
- *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
- *
- *     Release 0.10.
- *
- *     Fixes
- *             Dave Gregorich  :       Modularisation and minor bugs
- *             Alan Cox        :       Added the watchdog ioctl() stuff
- *             Alan Cox        :       Fixed the reboot problem (as noted by
- *                                     Matt Crocker).
- *             Alan Cox        :       Added wdt= boot option
- *             Alan Cox        :       Cleaned up copy/user stuff
- *             Tim Hockin      :       Added insmod parameters, comment cleanup
- *                                     Parameterized timeout
- *             Tigran Aivazian :       Restructured wdt_init() to handle failures
- *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
- *             Matt Domsch     :       Added nowayout module option
- */
-
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/fs.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include "wd501p.h"
-
-static unsigned long wdt_is_open;
-static char expect_close;
-
-/*
- *     Module parameters
- */
-
-#define WD_TIMO 60                     /* Default heartbeat = 60 seconds */
-
-static int heartbeat = WD_TIMO;
-static int wd_heartbeat;
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/* You must set these - there is no sane way to probe for this board. */
-static int io=0x240;
-static int irq=11;
-
-module_param(io, int, 0);
-MODULE_PARM_DESC(io, "WDT io port (default=0x240)");
-module_param(irq, int, 0);
-MODULE_PARM_DESC(irq, "WDT irq (default=11)");
-
-#ifdef CONFIG_WDT_501
-/* Support for the Fan Tachometer on the WDT501-P */
-static int tachometer;
-
-module_param(tachometer, int, 0);
-MODULE_PARM_DESC(tachometer, "WDT501-P Fan Tachometer support (0=disable, default=0)");
-#endif /* CONFIG_WDT_501 */
-
-/*
- *     Programming support
- */
-
-static void wdt_ctr_mode(int ctr, int mode)
-{
-       ctr<<=6;
-       ctr|=0x30;
-       ctr|=(mode<<1);
-       outb_p(ctr, WDT_CR);
-}
-
-static void wdt_ctr_load(int ctr, int val)
-{
-       outb_p(val&0xFF, WDT_COUNT0+ctr);
-       outb_p(val>>8, WDT_COUNT0+ctr);
-}
-
-/**
- *     wdt_start:
- *
- *     Start the watchdog driver.
- */
-
-static int wdt_start(void)
-{
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_mode(0,3);              /* Program CTR0 for Mode 3: Square Wave Generator */
-       wdt_ctr_mode(1,2);              /* Program CTR1 for Mode 2: Rate Generator */
-       wdt_ctr_mode(2,0);              /* Program CTR2 for Mode 0: Pulse on Terminal Count */
-       wdt_ctr_load(0, 8948);          /* Count at 100Hz */
-       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
-       wdt_ctr_load(2,65535);          /* Length of reset pulse */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-       return 0;
-}
-
-/**
- *     wdt_stop:
- *
- *     Stop the watchdog driver.
- */
-
-static int wdt_stop (void)
-{
-       /* Turn the card off */
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_load(2,0);              /* 0 length reset pulses now */
-       return 0;
-}
-
-/**
- *     wdt_ping:
- *
- *     Reload counter one with the watchdog heartbeat. We don't bother reloading
- *     the cascade counter.
- */
-
-static int wdt_ping(void)
-{
-       /* Write a watchdog value */
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdt_ctr_mode(1,2);              /* Re-Program CTR1 for Mode 2: Rate Generator */
-       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-       return 0;
-}
-
-/**
- *     wdt_set_heartbeat:
- *     @t:             the new heartbeat value that needs to be set.
- *
- *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
- *     incorrect we keep the old value and return -EINVAL. If successfull we
- *     return 0.
- */
-static int wdt_set_heartbeat(int t)
-{
-       if ((t < 1) || (t > 65535))
-               return -EINVAL;
-
-       heartbeat = t;
-       wd_heartbeat = t * 100;
-       return 0;
-}
-
-/**
- *     wdt_get_status:
- *     @status:                the new status.
- *
- *     Extract the status information from a WDT watchdog device. There are
- *     several board variants so we have to know which bits are valid. Some
- *     bits default to one and some to zero in order to be maximally painful.
- *
- *     we then map the bits onto the status ioctl flags.
- */
-
-static int wdt_get_status(int *status)
-{
-       unsigned char new_status=inb_p(WDT_SR);
-
-       *status=0;
-       if (new_status & WDC_SR_ISOI0)
-               *status |= WDIOF_EXTERN1;
-       if (new_status & WDC_SR_ISII1)
-               *status |= WDIOF_EXTERN2;
-#ifdef CONFIG_WDT_501
-       if (!(new_status & WDC_SR_TGOOD))
-               *status |= WDIOF_OVERHEAT;
-       if (!(new_status & WDC_SR_PSUOVER))
-               *status |= WDIOF_POWEROVER;
-       if (!(new_status & WDC_SR_PSUUNDR))
-               *status |= WDIOF_POWERUNDER;
-       if (tachometer) {
-               if (!(new_status & WDC_SR_FANGOOD))
-                       *status |= WDIOF_FANFAULT;
-       }
-#endif /* CONFIG_WDT_501 */
-       return 0;
-}
-
-#ifdef CONFIG_WDT_501
-/**
- *     wdt_get_temperature:
- *
- *     Reports the temperature in degrees Fahrenheit. The API is in
- *     farenheit. It was designed by an imperial measurement luddite.
- */
-
-static int wdt_get_temperature(int *temperature)
-{
-       unsigned short c=inb_p(WDT_RT);
-
-       *temperature = (c * 11 / 15) + 7;
-       return 0;
-}
-#endif /* CONFIG_WDT_501 */
-
-/**
- *     wdt_interrupt:
- *     @irq:           Interrupt number
- *     @dev_id:        Unused as we don't allow multiple devices.
- *
- *     Handle an interrupt from the board. These are raised when the status
- *     map changes in what the board considers an interesting way. That means
- *     a failure condition occurring.
- */
-
-static irqreturn_t wdt_interrupt(int irq, void *dev_id)
-{
-       /*
-        *      Read the status register see what is up and
-        *      then printk it.
-        */
-       unsigned char status=inb_p(WDT_SR);
-
-       printk(KERN_CRIT "WDT status %d\n", status);
-
-#ifdef CONFIG_WDT_501
-       if (!(status & WDC_SR_TGOOD))
-               printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT));
-       if (!(status & WDC_SR_PSUOVER))
-               printk(KERN_CRIT "PSU over voltage.\n");
-       if (!(status & WDC_SR_PSUUNDR))
-               printk(KERN_CRIT "PSU under voltage.\n");
-       if (tachometer) {
-               if (!(status & WDC_SR_FANGOOD))
-                       printk(KERN_CRIT "Possible fan fault.\n");
-       }
-#endif /* CONFIG_WDT_501 */
-       if (!(status & WDC_SR_WCCR))
-#ifdef SOFTWARE_REBOOT
-#ifdef ONLY_TESTING
-               printk(KERN_CRIT "Would Reboot.\n");
-#else
-               printk(KERN_CRIT "Initiating system reboot.\n");
-               emergency_restart();
-#endif
-#else
-               printk(KERN_CRIT "Reset in 5ms.\n");
-#endif
-       return IRQ_HANDLED;
-}
-
-
-/**
- *     wdt_write:
- *     @file: file handle to the watchdog
- *     @buf: buffer to write (unused as data does not matter here
- *     @count: count of bytes
- *     @ppos: pointer to the position to write. No seeks allowed
- *
- *     A write to a watchdog device is defined as a keepalive signal. Any
- *     write of data will do, as we we don't define content meaning.
- */
-
-static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if(count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               wdt_ping();
-       }
-       return count;
-}
-
-/**
- *     wdt_ioctl:
- *     @inode: inode of the device
- *     @file: file handle to the device
- *     @cmd: watchdog command
- *     @arg: argument pointer
- *
- *     The watchdog API defines a common set of functions for all watchdogs
- *     according to their available features. We only actually usefully support
- *     querying capabilities and current status.
- */
-
-static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-       int new_heartbeat;
-       int status;
-
-       static struct watchdog_info ident = {
-               .options =              WDIOF_SETTIMEOUT|
-                                       WDIOF_MAGICCLOSE|
-                                       WDIOF_KEEPALIVEPING,
-               .firmware_version =     1,
-               .identity =             "WDT500/501",
-       };
-
-       /* Add options according to the card we have */
-       ident.options |= (WDIOF_EXTERN1|WDIOF_EXTERN2);
-#ifdef CONFIG_WDT_501
-       ident.options |= (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER);
-       if (tachometer)
-               ident.options |= WDIOF_FANFAULT;
-#endif /* CONFIG_WDT_501 */
-
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-
-               case WDIOC_GETSTATUS:
-                       wdt_get_status(&status);
-                       return put_user(status, p);
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdt_ping();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (wdt_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       wdt_ping();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-       }
-}
-
-/**
- *     wdt_open:
- *     @inode: inode of device
- *     @file: file handle to device
- *
- *     The watchdog device has been opened. The watchdog device is single
- *     open and on opening we load the counters. Counter zero is a 100Hz
- *     cascade, into counter 1 which downcounts to reboot. When the counter
- *     triggers counter 2 downcounts the length of the reset pulse which
- *     set set to be as long as possible.
- */
-
-static int wdt_open(struct inode *inode, struct file *file)
-{
-       if(test_and_set_bit(0, &wdt_is_open))
-               return -EBUSY;
-       /*
-        *      Activate
-        */
-       wdt_start();
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     wdt_release:
- *     @inode: inode to board
- *     @file: file handle to board
- *
- *     The watchdog has a configurable API. There is a religious dispute
- *     between people who want their watchdog to be able to shut down and
- *     those who want to be sure if the watchdog manager dies the machine
- *     reboots. In the former case we disable the counters, in the latter
- *     case you have to open it again very soon.
- */
-
-static int wdt_release(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               wdt_stop();
-               clear_bit(0, &wdt_is_open);
-       } else {
-               printk(KERN_CRIT "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
-               wdt_ping();
-       }
-       expect_close = 0;
-       return 0;
-}
-
-#ifdef CONFIG_WDT_501
-/**
- *     wdt_temp_read:
- *     @file: file handle to the watchdog board
- *     @buf: buffer to write 1 byte into
- *     @count: length of buffer
- *     @ptr: offset (no seek allowed)
- *
- *     Temp_read reports the temperature in degrees Fahrenheit. The API is in
- *     farenheit. It was designed by an imperial measurement luddite.
- */
-
-static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
-{
-       int temperature;
-
-       if (wdt_get_temperature(&temperature))
-               return -EFAULT;
-
-       if (copy_to_user (buf, &temperature, 1))
-               return -EFAULT;
-
-       return 1;
-}
-
-/**
- *     wdt_temp_open:
- *     @inode: inode of device
- *     @file: file handle to device
- *
- *     The temperature device has been opened.
- */
-
-static int wdt_temp_open(struct inode *inode, struct file *file)
-{
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     wdt_temp_release:
- *     @inode: inode to board
- *     @file: file handle to board
- *
- *     The temperature device has been closed.
- */
-
-static int wdt_temp_release(struct inode *inode, struct file *file)
-{
-       return 0;
-}
-#endif /* CONFIG_WDT_501 */
-
-/**
- *     notify_sys:
- *     @this: our notifier block
- *     @code: the event being reported
- *     @unused: unused
- *
- *     Our notifier is called on system shutdowns. We want to turn the card
- *     off at reboot otherwise the machine will reboot again during memory
- *     test or worse yet during the following fsck. This would suck, in fact
- *     trust me - if it happens it does suck.
- */
-
-static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if(code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the card off */
-               wdt_stop();
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-
-static const struct file_operations wdt_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdt_write,
-       .ioctl          = wdt_ioctl,
-       .open           = wdt_open,
-       .release        = wdt_release,
-};
-
-static struct miscdevice wdt_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &wdt_fops,
-};
-
-#ifdef CONFIG_WDT_501
-static const struct file_operations wdt_temp_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .read           = wdt_temp_read,
-       .open           = wdt_temp_open,
-       .release        = wdt_temp_release,
-};
-
-static struct miscdevice temp_miscdev = {
-       .minor  = TEMP_MINOR,
-       .name   = "temperature",
-       .fops   = &wdt_temp_fops,
-};
-#endif /* CONFIG_WDT_501 */
-
-/*
- *     The WDT card needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdt_notifier = {
-       .notifier_call = wdt_notify_sys,
-};
-
-/**
- *     cleanup_module:
- *
- *     Unload the watchdog. You cannot do this with any file handles open.
- *     If your watchdog is set to continue ticking on close and you unload
- *     it, well it keeps ticking. We won't get the interrupt but the board
- *     will not touch PC memory so all is fine. You just have to load a new
- *     module in 60 seconds or reboot.
- */
-
-static void __exit wdt_exit(void)
-{
-       misc_deregister(&wdt_miscdev);
-#ifdef CONFIG_WDT_501
-       misc_deregister(&temp_miscdev);
-#endif /* CONFIG_WDT_501 */
-       unregister_reboot_notifier(&wdt_notifier);
-       free_irq(irq, NULL);
-       release_region(io,8);
-}
-
-/**
- *     wdt_init:
- *
- *     Set up the WDT watchdog board. All we have to do is grab the
- *     resources we require and bitch if anyone beat us to them.
- *     The open() function will actually kick the board off.
- */
-
-static int __init wdt_init(void)
-{
-       int ret;
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (wdt_set_heartbeat(heartbeat)) {
-               wdt_set_heartbeat(WD_TIMO);
-               printk(KERN_INFO "wdt: heartbeat value must be 0<heartbeat<65536, using %d\n",
-                       WD_TIMO);
-       }
-
-       if (!request_region(io, 8, "wdt501p")) {
-               printk(KERN_ERR "wdt: I/O address 0x%04x already in use\n", io);
-               ret = -EBUSY;
-               goto out;
-       }
-
-       ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL);
-       if(ret) {
-               printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq);
-               goto outreg;
-       }
-
-       ret = register_reboot_notifier(&wdt_notifier);
-       if(ret) {
-               printk(KERN_ERR "wdt: cannot register reboot notifier (err=%d)\n", ret);
-               goto outirq;
-       }
-
-#ifdef CONFIG_WDT_501
-       ret = misc_register(&temp_miscdev);
-       if (ret) {
-               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, ret);
-               goto outrbt;
-       }
-#endif /* CONFIG_WDT_501 */
-
-       ret = misc_register(&wdt_miscdev);
-       if (ret) {
-               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto outmisc;
-       }
-
-       ret = 0;
-       printk(KERN_INFO "WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n",
-               io, irq, heartbeat, nowayout);
-#ifdef CONFIG_WDT_501
-       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
-#endif /* CONFIG_WDT_501 */
-
-out:
-       return ret;
-
-outmisc:
-#ifdef CONFIG_WDT_501
-       misc_deregister(&temp_miscdev);
-outrbt:
-#endif /* CONFIG_WDT_501 */
-       unregister_reboot_notifier(&wdt_notifier);
-outirq:
-       free_irq(irq, NULL);
-outreg:
-       release_region(io,8);
-       goto out;
-}
-
-module_init(wdt_init);
-module_exit(wdt_exit);
-
-MODULE_AUTHOR("Alan Cox");
-MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS_MISCDEV(TEMP_MINOR);
-MODULE_LICENSE("GPL");
diff --git a/drivers/char/watchdog/wdt285.c b/drivers/char/watchdog/wdt285.c
deleted file mode 100644 (file)
index e4cf661..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- *     Intel 21285 watchdog driver
- *     Copyright (c) Phil Blundell <pb@nexus.co.uk>, 1998
- *
- *     based on
- *
- *     SoftDog 0.05:   A Software Watchdog Device
- *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *
- *     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.
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-
-#include <asm/irq.h>
-#include <asm/uaccess.h>
-#include <asm/hardware.h>
-#include <asm/mach-types.h>
-#include <asm/hardware/dec21285.h>
-
-/*
- * Define this to stop the watchdog actually rebooting the machine.
- */
-#undef ONLY_TESTING
-
-static unsigned int soft_margin = 60;          /* in seconds */
-static unsigned int reload;
-static unsigned long timer_alive;
-
-#ifdef ONLY_TESTING
-/*
- *     If the timer expires..
- */
-static void watchdog_fire(int irq, void *dev_id)
-{
-       printk(KERN_CRIT "Watchdog: Would Reboot.\n");
-       *CSR_TIMER4_CNTL = 0;
-       *CSR_TIMER4_CLR = 0;
-}
-#endif
-
-/*
- *     Refresh the timer.
- */
-static void watchdog_ping(void)
-{
-       *CSR_TIMER4_LOAD = reload;
-}
-
-/*
- *     Allow only one person to hold it open
- */
-static int watchdog_open(struct inode *inode, struct file *file)
-{
-       int ret;
-
-       if (*CSR_SA110_CNTL & (1 << 13))
-               return -EBUSY;
-
-       if (test_and_set_bit(1, &timer_alive))
-               return -EBUSY;
-
-       reload = soft_margin * (mem_fclk_21285 / 256);
-
-       *CSR_TIMER4_CLR = 0;
-       watchdog_ping();
-       *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD
-               | TIMER_CNTL_DIV256;
-
-#ifdef ONLY_TESTING
-       ret = request_irq(IRQ_TIMER4, watchdog_fire, 0, "watchdog", NULL);
-       if (ret) {
-               *CSR_TIMER4_CNTL = 0;
-               clear_bit(1, &timer_alive);
-       }
-#else
-       /*
-        * Setting this bit is irreversible; once enabled, there is
-        * no way to disable the watchdog.
-        */
-       *CSR_SA110_CNTL |= 1 << 13;
-
-       ret = 0;
-#endif
-       nonseekable_open(inode, file);
-       return ret;
-}
-
-/*
- *     Shut off the timer.
- *     Note: if we really have enabled the watchdog, there
- *     is no way to turn off.
- */
-static int watchdog_release(struct inode *inode, struct file *file)
-{
-#ifdef ONLY_TESTING
-       free_irq(IRQ_TIMER4, NULL);
-       clear_bit(1, &timer_alive);
-#endif
-       return 0;
-}
-
-static ssize_t
-watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
-{
-       /*
-        *      Refresh the timer.
-        */
-       if (len)
-               watchdog_ping();
-
-       return len;
-}
-
-static struct watchdog_info ident = {
-       .options        = WDIOF_SETTIMEOUT,
-       .identity       = "Footbridge Watchdog",
-};
-
-static int
-watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-              unsigned long arg)
-{
-       unsigned int new_margin;
-       int ret = -ENOTTY;
-
-       switch(cmd) {
-       case WDIOC_GETSUPPORT:
-               ret = 0;
-               if (copy_to_user((void *)arg, &ident, sizeof(ident)))
-                       ret = -EFAULT;
-               break;
-
-       case WDIOC_GETSTATUS:
-       case WDIOC_GETBOOTSTATUS:
-               ret = put_user(0,(int *)arg);
-               break;
-
-       case WDIOC_KEEPALIVE:
-               watchdog_ping();
-               ret = 0;
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               ret = get_user(new_margin, (int *)arg);
-               if (ret)
-                       break;
-
-               /* Arbitrary, can't find the card's limits */
-               if (new_margin < 0 || new_margin > 60) {
-                       ret = -EINVAL;
-                       break;
-               }
-
-               soft_margin = new_margin;
-               reload = soft_margin * (mem_fclk_21285 / 256);
-               watchdog_ping();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               ret = put_user(soft_margin, (int *)arg);
-               break;
-       }
-       return ret;
-}
-
-static const struct file_operations watchdog_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = watchdog_write,
-       .ioctl          = watchdog_ioctl,
-       .open           = watchdog_open,
-       .release        = watchdog_release,
-};
-
-static struct miscdevice watchdog_miscdev = {
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &watchdog_fops,
-};
-
-static int __init footbridge_watchdog_init(void)
-{
-       int retval;
-
-       if (machine_is_netwinder())
-               return -ENODEV;
-
-       retval = misc_register(&watchdog_miscdev);
-       if (retval < 0)
-               return retval;
-
-       printk("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
-              soft_margin);
-
-       if (machine_is_cats())
-               printk("Warning: Watchdog reset may not work on this machine.\n");
-       return 0;
-}
-
-static void __exit footbridge_watchdog_exit(void)
-{
-       misc_deregister(&watchdog_miscdev);
-}
-
-MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>");
-MODULE_DESCRIPTION("Footbridge watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-
-module_param(soft_margin, int, 0);
-MODULE_PARM_DESC(soft_margin,"Watchdog timeout in seconds");
-
-module_init(footbridge_watchdog_init);
-module_exit(footbridge_watchdog_exit);
diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c
deleted file mode 100644 (file)
index 7d300ff..0000000
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- *     Wdt977  0.04:   A Watchdog Device for Netwinder W83977AF chip
- *
- *     (c) Copyright 1998 Rebel.com (Woody Suwalski <woody@netwinder.org>)
- *
- *                     -----------------------
- *
- *     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.
- *
- *                     -----------------------
- *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
- *           Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
- *     19-Dec-2001 Woody Suwalski: Netwinder fixes, ioctl interface
- *     06-Jan-2002 Woody Suwalski: For compatibility, convert all timeouts
- *                                 from minutes to seconds.
- *      07-Jul-2003 Daniele Bellucci: Audit return code of misc_register in
- *                                    nwwatchdog_init.
- *      25-Oct-2005 Woody Suwalski: Convert addresses to #defs, add spinlocks
- *                                 remove limitiation to be used on Netwinders only
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/watchdog.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-
-#include <asm/io.h>
-#include <asm/system.h>
-#include <asm/mach-types.h>
-#include <asm/uaccess.h>
-
-#define WATCHDOG_VERSION  "0.04"
-#define WATCHDOG_NAME     "Wdt977"
-#define PFX WATCHDOG_NAME ": "
-#define DRIVER_VERSION    WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
-
-#define IO_INDEX_PORT  0x370           /* on some systems it can be 0x3F0 */
-#define IO_DATA_PORT   (IO_INDEX_PORT+1)
-
-#define UNLOCK_DATA    0x87
-#define LOCK_DATA      0xAA
-#define DEVICE_REGISTER        0x07
-
-
-#define        DEFAULT_TIMEOUT 60                      /* default timeout in seconds */
-
-static int timeout = DEFAULT_TIMEOUT;
-static int timeoutM;                           /* timeout in minutes */
-static unsigned long timer_alive;
-static int testmode;
-static char expect_close;
-static spinlock_t spinlock;
-
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")");
-module_param(testmode, int, 0);
-MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-/*
- * Start the watchdog
- */
-
-static int wdt977_start(void)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-
-       /* select device Aux2 (device=8) and set watchdog regs F2, F3 and F4
-        * F2 has the timeout in minutes
-        * F3 could be set to the POWER LED blink (with GP17 set to PowerLed)
-        *   at timeout, and to reset timer on kbd/mouse activity (not impl.)
-        * F4 is used to just clear the TIMEOUT'ed state (bit 0)
-        */
-       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
-       outb_p(0x08, IO_DATA_PORT);
-       outb_p(0xF2, IO_INDEX_PORT);
-       outb_p(timeoutM, IO_DATA_PORT);
-       outb_p(0xF3, IO_INDEX_PORT);
-       outb_p(0x00, IO_DATA_PORT);     /* another setting is 0E for kbd/mouse/LED */
-       outb_p(0xF4, IO_INDEX_PORT);
-       outb_p(0x00, IO_DATA_PORT);
-
-       /* at last select device Aux1 (dev=7) and set GP16 as a watchdog output */
-       /* in test mode watch the bit 1 on F4 to indicate "triggered" */
-       if (!testmode)
-       {
-               outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
-               outb_p(0x07, IO_DATA_PORT);
-               outb_p(0xE6, IO_INDEX_PORT);
-               outb_p(0x08, IO_DATA_PORT);
-       }
-
-       /* lock the SuperIO chip */
-       outb_p(LOCK_DATA, IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-       printk(KERN_INFO PFX "activated.\n");
-
-       return 0;
-}
-
-/*
- * Stop the watchdog
- */
-
-static int wdt977_stop(void)
-{
-       unsigned long flags;
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-
-       /* select device Aux2 (device=8) and set watchdog regs F2,F3 and F4
-       * F3 is reset to its default state
-       * F4 can clear the TIMEOUT'ed state (bit 0) - back to default
-       * We can not use GP17 as a PowerLed, as we use its usage as a RedLed
-       */
-       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
-       outb_p(0x08, IO_DATA_PORT);
-       outb_p(0xF2, IO_INDEX_PORT);
-       outb_p(0xFF, IO_DATA_PORT);
-       outb_p(0xF3, IO_INDEX_PORT);
-       outb_p(0x00, IO_DATA_PORT);
-       outb_p(0xF4, IO_INDEX_PORT);
-       outb_p(0x00, IO_DATA_PORT);
-       outb_p(0xF2, IO_INDEX_PORT);
-       outb_p(0x00, IO_DATA_PORT);
-
-       /* at last select device Aux1 (dev=7) and set GP16 as a watchdog output */
-       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
-       outb_p(0x07, IO_DATA_PORT);
-       outb_p(0xE6, IO_INDEX_PORT);
-       outb_p(0x08, IO_DATA_PORT);
-
-       /* lock the SuperIO chip */
-       outb_p(LOCK_DATA, IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-       printk(KERN_INFO PFX "shutdown.\n");
-
-       return 0;
-}
-
-/*
- * Send a keepalive ping to the watchdog
- * This is done by simply re-writing the timeout to reg. 0xF2
- */
-
-static int wdt977_keepalive(void)
-{
-       unsigned long flags;
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-
-       /* select device Aux2 (device=8) and kicks watchdog reg F2 */
-       /* F2 has the timeout in minutes */
-       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
-       outb_p(0x08, IO_DATA_PORT);
-       outb_p(0xF2, IO_INDEX_PORT);
-       outb_p(timeoutM, IO_DATA_PORT);
-
-       /* lock the SuperIO chip */
-       outb_p(LOCK_DATA, IO_INDEX_PORT);
-       spin_unlock_irqrestore(&spinlock, flags);
-
-       return 0;
-}
-
-/*
- * Set the watchdog timeout value
- */
-
-static int wdt977_set_timeout(int t)
-{
-       int tmrval;
-
-       /* convert seconds to minutes, rounding up */
-       tmrval = (t + 59) / 60;
-
-       if (machine_is_netwinder()) {
-               /* we have a hw bug somewhere, so each 977 minute is actually only 30sec
-                *  this limits the max timeout to half of device max of 255 minutes...
-                */
-               tmrval += tmrval;
-       }
-
-       if ((tmrval < 1) || (tmrval > 255))
-               return -EINVAL;
-
-       /* timeout is the timeout in seconds, timeoutM is the timeout in minutes) */
-       timeout = t;
-       timeoutM = tmrval;
-       return 0;
-}
-
-/*
- * Get the watchdog status
- */
-
-static int wdt977_get_status(int *status)
-{
-       int new_status;
-       unsigned long flags;
-
-       spin_lock_irqsave(&spinlock, flags);
-
-       /* unlock the SuperIO chip */
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
-
-       /* select device Aux2 (device=8) and read watchdog reg F4 */
-       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
-       outb_p(0x08, IO_DATA_PORT);
-       outb_p(0xF4, IO_INDEX_PORT);
-       new_status = inb_p(IO_DATA_PORT);
-
-       /* lock the SuperIO chip */
-       outb_p(LOCK_DATA, IO_INDEX_PORT);
-
-       spin_unlock_irqrestore(&spinlock, flags);
-
-       *status=0;
-       if (new_status & 1)
-               *status |= WDIOF_CARDRESET;
-
-       return 0;
-}
-
-
-/*
- *     /dev/watchdog handling
- */
-
-static int wdt977_open(struct inode *inode, struct file *file)
-{
-       /* If the watchdog is alive we don't need to start it again */
-       if( test_and_set_bit(0,&timer_alive) )
-               return -EBUSY;
-
-       if (nowayout)
-               __module_get(THIS_MODULE);
-
-       wdt977_start();
-       return nonseekable_open(inode, file);
-}
-
-static int wdt977_release(struct inode *inode, struct file *file)
-{
-       /*
-        *      Shut off the timer.
-        *      Lock it in if it's a module and we set nowayout
-        */
-       if (expect_close == 42)
-       {
-               wdt977_stop();
-               clear_bit(0,&timer_alive);
-       } else {
-               wdt977_keepalive();
-               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
-       }
-       expect_close = 0;
-       return 0;
-}
-
-
-/*
- *      wdt977_write:
- *      @file: file handle to the watchdog
- *      @buf: buffer to write (unused as data does not matter here
- *      @count: count of bytes
- *      @ppos: pointer to the position to write. No seeks allowed
- *
- *      A write to a watchdog device is defined as a keepalive signal. Any
- *      write of data will do, as we we don't define content meaning.
- */
-
-static ssize_t wdt977_write(struct file *file, const char __user *buf,
-                           size_t count, loff_t *ppos)
-{
-       if (count)
-       {
-               if (!nowayout)
-               {
-                       size_t i;
-
-                       /* In case it was set long ago */
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++)
-                       {
-                               char c;
-                               if (get_user(c, buf + i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-
-               /* someone wrote to us, we should restart timer */
-               wdt977_keepalive();
-       }
-       return count;
-}
-
-/*
- *      wdt977_ioctl:
- *      @inode: inode of the device
- *      @file: file handle to the device
- *      @cmd: watchdog command
- *      @arg: argument pointer
- *
- *      The watchdog API defines a common set of functions for all watchdogs
- *      according to their available features.
- */
-
-static struct watchdog_info ident = {
-       .options =              WDIOF_SETTIMEOUT |
-                               WDIOF_MAGICCLOSE |
-                               WDIOF_KEEPALIVEPING,
-       .firmware_version =     1,
-       .identity =             WATCHDOG_NAME,
-};
-
-static int wdt977_ioctl(struct inode *inode, struct file *file,
-       unsigned int cmd, unsigned long arg)
-{
-       int status;
-       int new_options, retval = -EINVAL;
-       int new_timeout;
-       union {
-               struct watchdog_info __user *ident;
-               int __user *i;
-       } uarg;
-
-       uarg.i = (int __user *)arg;
-
-       switch(cmd)
-       {
-       default:
-               return -ENOTTY;
-
-       case WDIOC_GETSUPPORT:
-               return copy_to_user(uarg.ident, &ident,
-                       sizeof(ident)) ? -EFAULT : 0;
-
-       case WDIOC_GETSTATUS:
-               wdt977_get_status(&status);
-               return put_user(status, uarg.i);
-
-       case WDIOC_GETBOOTSTATUS:
-               return put_user(0, uarg.i);
-
-       case WDIOC_KEEPALIVE:
-               wdt977_keepalive();
-               return 0;
-
-       case WDIOC_SETOPTIONS:
-               if (get_user (new_options, uarg.i))
-                       return -EFAULT;
-
-               if (new_options & WDIOS_DISABLECARD) {
-                       wdt977_stop();
-                       retval = 0;
-               }
-
-               if (new_options & WDIOS_ENABLECARD) {
-                       wdt977_start();
-                       retval = 0;
-               }
-
-               return retval;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, uarg.i))
-                       return -EFAULT;
-
-               if (wdt977_set_timeout(new_timeout))
-                   return -EINVAL;
-
-               wdt977_keepalive();
-               /* Fall */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, uarg.i);
-
-       }
-}
-
-static int wdt977_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if(code==SYS_DOWN || code==SYS_HALT)
-               wdt977_stop();
-       return NOTIFY_DONE;
-}
-
-static const struct file_operations wdt977_fops=
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdt977_write,
-       .ioctl          = wdt977_ioctl,
-       .open           = wdt977_open,
-       .release        = wdt977_release,
-};
-
-static struct miscdevice wdt977_miscdev=
-{
-       .minor          = WATCHDOG_MINOR,
-       .name           = "watchdog",
-       .fops           = &wdt977_fops,
-};
-
-static struct notifier_block wdt977_notifier = {
-       .notifier_call = wdt977_notify_sys,
-};
-
-static int __init wd977_init(void)
-{
-       int rc;
-
-       //if (!machine_is_netwinder())
-       //      return -ENODEV;
-
-       printk(KERN_INFO PFX DRIVER_VERSION);
-
-       spin_lock_init(&spinlock);
-
-       /* Check that the timeout value is within it's range ; if not reset to the default */
-       if (wdt977_set_timeout(timeout))
-       {
-               wdt977_set_timeout(DEFAULT_TIMEOUT);
-               printk(KERN_INFO PFX "timeout value must be 60<timeout<15300, using %d\n",
-                       DEFAULT_TIMEOUT);
-       }
-
-       /* on Netwinder the IOports are already reserved by
-        * arch/arm/mach-footbridge/netwinder-hw.c
-        */
-       if (!machine_is_netwinder())
-       {
-               if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME))
-               {
-                       printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                               IO_INDEX_PORT);
-                       rc = -EIO;
-                       goto err_out;
-               }
-       }
-
-       rc = misc_register(&wdt977_miscdev);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       wdt977_miscdev.minor, rc);
-               goto err_out_region;
-       }
-
-       rc = register_reboot_notifier(&wdt977_notifier);
-       if (rc)
-       {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_miscdev;
-       }
-
-       printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n",
-               timeout, nowayout, testmode);
-
-       return 0;
-
-err_out_miscdev:
-        misc_deregister(&wdt977_miscdev);
-err_out_region:
-       if (!machine_is_netwinder())
-               release_region(IO_INDEX_PORT,2);
-err_out:
-       return rc;
-}
-
-static void __exit wd977_exit(void)
-{
-       wdt977_stop();
-       misc_deregister(&wdt977_miscdev);
-       unregister_reboot_notifier(&wdt977_notifier);
-       release_region(IO_INDEX_PORT,2);
-}
-
-module_init(wd977_init);
-module_exit(wd977_exit);
-
-MODULE_AUTHOR("Woody Suwalski <woodys@xandros.com>");
-MODULE_DESCRIPTION("W83977AF Watchdog driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
deleted file mode 100644 (file)
index 6baf4ae..0000000
+++ /dev/null
@@ -1,756 +0,0 @@
-/*
- *     Industrial Computer Source PCI-WDT500/501 driver
- *
- *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.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 the Free Software Foundation; either version
- *     2 of the License, or (at your option) any later version.
- *
- *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- *     warranty for any of this software. This material is provided
- *     "AS-IS" and at no charge.
- *
- *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
- *
- *     Release 0.10.
- *
- *     Fixes
- *             Dave Gregorich  :       Modularisation and minor bugs
- *             Alan Cox        :       Added the watchdog ioctl() stuff
- *             Alan Cox        :       Fixed the reboot problem (as noted by
- *                                     Matt Crocker).
- *             Alan Cox        :       Added wdt= boot option
- *             Alan Cox        :       Cleaned up copy/user stuff
- *             Tim Hockin      :       Added insmod parameters, comment cleanup
- *                                     Parameterized timeout
- *             JP Nollmann     :       Added support for PCI wdt501p
- *             Alan Cox        :       Split ISA and PCI cards into two drivers
- *             Jeff Garzik     :       PCI cleanups
- *             Tigran Aivazian :       Restructured wdtpci_init_one() to handle failures
- *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
- *             Zwane Mwaikambo :       Magic char closing, locking changes, cleanups
- *             Matt Domsch     :       nowayout module option
- */
-
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/ioport.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/pci.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
-#define WDT_IS_PCI
-#include "wd501p.h"
-
-#define PFX "wdt_pci: "
-
-/*
- * Until Access I/O gets their application for a PCI vendor ID approved,
- * I don't think that it's appropriate to move these constants into the
- * regular pci_ids.h file. -- JPN 2000/01/18
- */
-
-#ifndef PCI_VENDOR_ID_ACCESSIO
-#define PCI_VENDOR_ID_ACCESSIO 0x494f
-#endif
-#ifndef PCI_DEVICE_ID_WDG_CSM
-#define PCI_DEVICE_ID_WDG_CSM 0x22c0
-#endif
-
-/* We can only use 1 card due to the /dev/watchdog restriction */
-static int dev_count;
-
-static struct semaphore open_sem;
-static spinlock_t wdtpci_lock;
-static char expect_close;
-
-static int io;
-static int irq;
-
-/* Default timeout */
-#define WD_TIMO 60                     /* Default heartbeat = 60 seconds */
-
-static int heartbeat = WD_TIMO;
-static int wd_heartbeat;
-module_param(heartbeat, int, 0);
-MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
-
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-#ifdef CONFIG_WDT_501_PCI
-/* Support for the Fan Tachometer on the PCI-WDT501 */
-static int tachometer;
-
-module_param(tachometer, int, 0);
-MODULE_PARM_DESC(tachometer, "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
-#endif /* CONFIG_WDT_501_PCI */
-
-/*
- *     Programming support
- */
-
-static void wdtpci_ctr_mode(int ctr, int mode)
-{
-       ctr<<=6;
-       ctr|=0x30;
-       ctr|=(mode<<1);
-       outb_p(ctr, WDT_CR);
-}
-
-static void wdtpci_ctr_load(int ctr, int val)
-{
-       outb_p(val&0xFF, WDT_COUNT0+ctr);
-       outb_p(val>>8, WDT_COUNT0+ctr);
-}
-
-/**
- *     wdtpci_start:
- *
- *     Start the watchdog driver.
- */
-
-static int wdtpci_start(void)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&wdtpci_lock, flags);
-
-       /*
-        * "pet" the watchdog, as Access says.
-        * This resets the clock outputs.
-        */
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_mode(2,0);           /* Program CTR2 for Mode 0: Pulse on Terminal Count */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       outb_p(0, WDT_CLOCK);           /* 2.0833MHz clock */
-       inb_p(WDT_BUZZER);              /* disable */
-       inb_p(WDT_OPTONOTRST);          /* disable */
-       inb_p(WDT_OPTORST);             /* disable */
-       inb_p(WDT_PROGOUT);             /* disable */
-       wdtpci_ctr_mode(0,3);           /* Program CTR0 for Mode 3: Square Wave Generator */
-       wdtpci_ctr_mode(1,2);           /* Program CTR1 for Mode 2: Rate Generator */
-       wdtpci_ctr_mode(2,1);           /* Program CTR2 for Mode 1: Retriggerable One-Shot */
-       wdtpci_ctr_load(0,20833);       /* count at 100Hz */
-       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
-       /* DO NOT LOAD CTR2 on PCI card! -- JPN */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-
-       spin_unlock_irqrestore(&wdtpci_lock, flags);
-       return 0;
-}
-
-/**
- *     wdtpci_stop:
- *
- *     Stop the watchdog driver.
- */
-
-static int wdtpci_stop (void)
-{
-       unsigned long flags;
-
-       /* Turn the card off */
-       spin_lock_irqsave(&wdtpci_lock, flags);
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_load(2,0);           /* 0 length reset pulses now */
-       spin_unlock_irqrestore(&wdtpci_lock, flags);
-       return 0;
-}
-
-/**
- *     wdtpci_ping:
- *
- *     Reload counter one with the watchdog heartbeat. We don't bother reloading
- *     the cascade counter.
- */
-
-static int wdtpci_ping(void)
-{
-       unsigned long flags;
-
-       /* Write a watchdog value */
-       spin_lock_irqsave(&wdtpci_lock, flags);
-       inb_p(WDT_DC);                  /* Disable watchdog */
-       wdtpci_ctr_mode(1,2);           /* Re-Program CTR1 for Mode 2: Rate Generator */
-       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
-       outb_p(0, WDT_DC);              /* Enable watchdog */
-       spin_unlock_irqrestore(&wdtpci_lock, flags);
-       return 0;
-}
-
-/**
- *     wdtpci_set_heartbeat:
- *     @t:             the new heartbeat value that needs to be set.
- *
- *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
- *     incorrect we keep the old value and return -EINVAL. If successfull we
- *     return 0.
- */
-static int wdtpci_set_heartbeat(int t)
-{
-       /* Arbitrary, can't find the card's limits */
-       if ((t < 1) || (t > 65535))
-               return -EINVAL;
-
-       heartbeat = t;
-       wd_heartbeat = t * 100;
-       return 0;
-}
-
-/**
- *     wdtpci_get_status:
- *     @status:                the new status.
- *
- *     Extract the status information from a WDT watchdog device. There are
- *     several board variants so we have to know which bits are valid. Some
- *     bits default to one and some to zero in order to be maximally painful.
- *
- *     we then map the bits onto the status ioctl flags.
- */
-
-static int wdtpci_get_status(int *status)
-{
-       unsigned char new_status=inb_p(WDT_SR);
-
-       *status=0;
-       if (new_status & WDC_SR_ISOI0)
-               *status |= WDIOF_EXTERN1;
-       if (new_status & WDC_SR_ISII1)
-               *status |= WDIOF_EXTERN2;
-#ifdef CONFIG_WDT_501_PCI
-       if (!(new_status & WDC_SR_TGOOD))
-               *status |= WDIOF_OVERHEAT;
-       if (!(new_status & WDC_SR_PSUOVER))
-               *status |= WDIOF_POWEROVER;
-       if (!(new_status & WDC_SR_PSUUNDR))
-               *status |= WDIOF_POWERUNDER;
-       if (tachometer) {
-               if (!(new_status & WDC_SR_FANGOOD))
-                       *status |= WDIOF_FANFAULT;
-       }
-#endif /* CONFIG_WDT_501_PCI */
-       return 0;
-}
-
-#ifdef CONFIG_WDT_501_PCI
-/**
- *     wdtpci_get_temperature:
- *
- *     Reports the temperature in degrees Fahrenheit. The API is in
- *     farenheit. It was designed by an imperial measurement luddite.
- */
-
-static int wdtpci_get_temperature(int *temperature)
-{
-       unsigned short c=inb_p(WDT_RT);
-
-       *temperature = (c * 11 / 15) + 7;
-       return 0;
-}
-#endif /* CONFIG_WDT_501_PCI */
-
-/**
- *     wdtpci_interrupt:
- *     @irq:           Interrupt number
- *     @dev_id:        Unused as we don't allow multiple devices.
- *
- *     Handle an interrupt from the board. These are raised when the status
- *     map changes in what the board considers an interesting way. That means
- *     a failure condition occurring.
- */
-
-static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
-{
-       /*
-        *      Read the status register see what is up and
-        *      then printk it.
-        */
-       unsigned char status=inb_p(WDT_SR);
-
-       printk(KERN_CRIT PFX "status %d\n", status);
-
-#ifdef CONFIG_WDT_501_PCI
-       if (!(status & WDC_SR_TGOOD))
-               printk(KERN_CRIT PFX "Overheat alarm.(%d)\n",inb_p(WDT_RT));
-       if (!(status & WDC_SR_PSUOVER))
-               printk(KERN_CRIT PFX "PSU over voltage.\n");
-       if (!(status & WDC_SR_PSUUNDR))
-               printk(KERN_CRIT PFX "PSU under voltage.\n");
-       if (tachometer) {
-               if (!(status & WDC_SR_FANGOOD))
-                       printk(KERN_CRIT PFX "Possible fan fault.\n");
-       }
-#endif /* CONFIG_WDT_501_PCI */
-       if (!(status&WDC_SR_WCCR))
-#ifdef SOFTWARE_REBOOT
-#ifdef ONLY_TESTING
-               printk(KERN_CRIT PFX "Would Reboot.\n");
-#else
-               printk(KERN_CRIT PFX "Initiating system reboot.\n");
-               emergency_restart(NULL);
-#endif
-#else
-               printk(KERN_CRIT PFX "Reset in 5ms.\n");
-#endif
-       return IRQ_HANDLED;
-}
-
-
-/**
- *     wdtpci_write:
- *     @file: file handle to the watchdog
- *     @buf: buffer to write (unused as data does not matter here
- *     @count: count of bytes
- *     @ppos: pointer to the position to write. No seeks allowed
- *
- *     A write to a watchdog device is defined as a keepalive signal. Any
- *     write of data will do, as we we don't define content meaning.
- */
-
-static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
-{
-       if (count) {
-               if (!nowayout) {
-                       size_t i;
-
-                       expect_close = 0;
-
-                       for (i = 0; i != count; i++) {
-                               char c;
-                               if(get_user(c, buf+i))
-                                       return -EFAULT;
-                               if (c == 'V')
-                                       expect_close = 42;
-                       }
-               }
-               wdtpci_ping();
-       }
-
-       return count;
-}
-
-/**
- *     wdtpci_ioctl:
- *     @inode: inode of the device
- *     @file: file handle to the device
- *     @cmd: watchdog command
- *     @arg: argument pointer
- *
- *     The watchdog API defines a common set of functions for all watchdogs
- *     according to their available features. We only actually usefully support
- *     querying capabilities and current status.
- */
-
-static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-       unsigned long arg)
-{
-       int new_heartbeat;
-       int status;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-
-       static struct watchdog_info ident = {
-               .options =              WDIOF_SETTIMEOUT|
-                                       WDIOF_MAGICCLOSE|
-                                       WDIOF_KEEPALIVEPING,
-               .firmware_version =     1,
-               .identity =             "PCI-WDT500/501",
-       };
-
-       /* Add options according to the card we have */
-       ident.options |= (WDIOF_EXTERN1|WDIOF_EXTERN2);
-#ifdef CONFIG_WDT_501_PCI
-       ident.options |= (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER);
-       if (tachometer)
-               ident.options |= WDIOF_FANFAULT;
-#endif /* CONFIG_WDT_501_PCI */
-
-       switch(cmd)
-       {
-               default:
-                       return -ENOTTY;
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
-
-               case WDIOC_GETSTATUS:
-                       wdtpci_get_status(&status);
-                       return put_user(status, p);
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
-               case WDIOC_KEEPALIVE:
-                       wdtpci_ping();
-                       return 0;
-               case WDIOC_SETTIMEOUT:
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
-
-                       if (wdtpci_set_heartbeat(new_heartbeat))
-                               return -EINVAL;
-
-                       wdtpci_ping();
-                       /* Fall */
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
-       }
-}
-
-/**
- *     wdtpci_open:
- *     @inode: inode of device
- *     @file: file handle to device
- *
- *     The watchdog device has been opened. The watchdog device is single
- *     open and on opening we load the counters. Counter zero is a 100Hz
- *     cascade, into counter 1 which downcounts to reboot. When the counter
- *     triggers counter 2 downcounts the length of the reset pulse which
- *     set set to be as long as possible.
- */
-
-static int wdtpci_open(struct inode *inode, struct file *file)
-{
-       if (down_trylock(&open_sem))
-               return -EBUSY;
-
-       if (nowayout) {
-               __module_get(THIS_MODULE);
-       }
-       /*
-        *      Activate
-        */
-       wdtpci_start();
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     wdtpci_release:
- *     @inode: inode to board
- *     @file: file handle to board
- *
- *     The watchdog has a configurable API. There is a religious dispute
- *     between people who want their watchdog to be able to shut down and
- *     those who want to be sure if the watchdog manager dies the machine
- *     reboots. In the former case we disable the counters, in the latter
- *     case you have to open it again very soon.
- */
-
-static int wdtpci_release(struct inode *inode, struct file *file)
-{
-       if (expect_close == 42) {
-               wdtpci_stop();
-       } else {
-               printk(KERN_CRIT PFX "Unexpected close, not stopping timer!");
-               wdtpci_ping();
-       }
-       expect_close = 0;
-       up(&open_sem);
-       return 0;
-}
-
-#ifdef CONFIG_WDT_501_PCI
-/**
- *     wdtpci_temp_read:
- *     @file: file handle to the watchdog board
- *     @buf: buffer to write 1 byte into
- *     @count: length of buffer
- *     @ptr: offset (no seek allowed)
- *
- *     Read reports the temperature in degrees Fahrenheit. The API is in
- *     fahrenheit. It was designed by an imperial measurement luddite.
- */
-
-static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
-{
-       int temperature;
-
-       if (wdtpci_get_temperature(&temperature))
-               return -EFAULT;
-
-       if (copy_to_user (buf, &temperature, 1))
-               return -EFAULT;
-
-       return 1;
-}
-
-/**
- *     wdtpci_temp_open:
- *     @inode: inode of device
- *     @file: file handle to device
- *
- *     The temperature device has been opened.
- */
-
-static int wdtpci_temp_open(struct inode *inode, struct file *file)
-{
-       return nonseekable_open(inode, file);
-}
-
-/**
- *     wdtpci_temp_release:
- *     @inode: inode to board
- *     @file: file handle to board
- *
- *     The temperature device has been closed.
- */
-
-static int wdtpci_temp_release(struct inode *inode, struct file *file)
-{
-       return 0;
-}
-#endif /* CONFIG_WDT_501_PCI */
-
-/**
- *     notify_sys:
- *     @this: our notifier block
- *     @code: the event being reported
- *     @unused: unused
- *
- *     Our notifier is called on system shutdowns. We want to turn the card
- *     off at reboot otherwise the machine will reboot again during memory
- *     test or worse yet during the following fsck. This would suck, in fact
- *     trust me - if it happens it does suck.
- */
-
-static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code,
-       void *unused)
-{
-       if (code==SYS_DOWN || code==SYS_HALT) {
-               /* Turn the card off */
-               wdtpci_stop();
-       }
-       return NOTIFY_DONE;
-}
-
-/*
- *     Kernel Interfaces
- */
-
-
-static const struct file_operations wdtpci_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = wdtpci_write,
-       .ioctl          = wdtpci_ioctl,
-       .open           = wdtpci_open,
-       .release        = wdtpci_release,
-};
-
-static struct miscdevice wdtpci_miscdev = {
-       .minor  = WATCHDOG_MINOR,
-       .name   = "watchdog",
-       .fops   = &wdtpci_fops,
-};
-
-#ifdef CONFIG_WDT_501_PCI
-static const struct file_operations wdtpci_temp_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .read           = wdtpci_temp_read,
-       .open           = wdtpci_temp_open,
-       .release        = wdtpci_temp_release,
-};
-
-static struct miscdevice temp_miscdev = {
-       .minor  = TEMP_MINOR,
-       .name   = "temperature",
-       .fops   = &wdtpci_temp_fops,
-};
-#endif /* CONFIG_WDT_501_PCI */
-
-/*
- *     The WDT card needs to learn about soft shutdowns in order to
- *     turn the timebomb registers off.
- */
-
-static struct notifier_block wdtpci_notifier = {
-       .notifier_call = wdtpci_notify_sys,
-};
-
-
-static int __devinit wdtpci_init_one (struct pci_dev *dev,
-                                  const struct pci_device_id *ent)
-{
-       int ret = -EIO;
-
-       dev_count++;
-       if (dev_count > 1) {
-               printk (KERN_ERR PFX "this driver only supports 1 device\n");
-               return -ENODEV;
-       }
-
-       if (pci_enable_device (dev)) {
-               printk (KERN_ERR PFX "Not possible to enable PCI Device\n");
-               return -ENODEV;
-       }
-
-       if (pci_resource_start (dev, 2) == 0x0000) {
-               printk (KERN_ERR PFX "No I/O-Address for card detected\n");
-               ret = -ENODEV;
-               goto out_pci;
-       }
-
-       sema_init(&open_sem, 1);
-       spin_lock_init(&wdtpci_lock);
-
-       irq = dev->irq;
-       io = pci_resource_start (dev, 2);
-
-       if (request_region (io, 16, "wdt_pci") == NULL) {
-               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
-               goto out_pci;
-       }
-
-       if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
-                        "wdt_pci", &wdtpci_miscdev)) {
-               printk (KERN_ERR PFX "IRQ %d is not free\n", irq);
-               goto out_reg;
-       }
-
-       printk ("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n",
-               io, irq);
-
-       /* Check that the heartbeat value is within it's range ; if not reset to the default */
-       if (wdtpci_set_heartbeat(heartbeat)) {
-               wdtpci_set_heartbeat(WD_TIMO);
-               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
-                       WD_TIMO);
-       }
-
-       ret = register_reboot_notifier (&wdtpci_notifier);
-       if (ret) {
-               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
-               goto out_irq;
-       }
-
-#ifdef CONFIG_WDT_501_PCI
-       ret = misc_register (&temp_miscdev);
-       if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       TEMP_MINOR, ret);
-               goto out_rbt;
-       }
-#endif /* CONFIG_WDT_501_PCI */
-
-       ret = misc_register (&wdtpci_miscdev);
-       if (ret) {
-               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       WATCHDOG_MINOR, ret);
-               goto out_misc;
-       }
-
-       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
-               heartbeat, nowayout);
-#ifdef CONFIG_WDT_501_PCI
-       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
-#endif /* CONFIG_WDT_501_PCI */
-
-       ret = 0;
-out:
-       return ret;
-
-out_misc:
-#ifdef CONFIG_WDT_501_PCI
-       misc_deregister(&temp_miscdev);
-out_rbt:
-#endif /* CONFIG_WDT_501_PCI */
-       unregister_reboot_notifier(&wdtpci_notifier);
-out_irq:
-       free_irq(irq, &wdtpci_miscdev);
-out_reg:
-       release_region (io, 16);
-out_pci:
-       pci_disable_device(dev);
-       goto out;
-}
-
-
-static void __devexit wdtpci_remove_one (struct pci_dev *pdev)
-{
-       /* here we assume only one device will ever have
-        * been picked up and registered by probe function */
-       misc_deregister(&wdtpci_miscdev);
-#ifdef CONFIG_WDT_501_PCI
-       misc_deregister(&temp_miscdev);
-#endif /* CONFIG_WDT_501_PCI */
-       unregister_reboot_notifier(&wdtpci_notifier);
-       free_irq(irq, &wdtpci_miscdev);
-       release_region(io, 16);
-       pci_disable_device(pdev);
-       dev_count--;
-}
-
-
-static struct pci_device_id wdtpci_pci_tbl[] = {
-       {
-               .vendor    = PCI_VENDOR_ID_ACCESSIO,
-               .device    = PCI_DEVICE_ID_WDG_CSM,
-               .subvendor = PCI_ANY_ID,
-               .subdevice = PCI_ANY_ID,
-       },
-       { 0, }, /* terminate list */
-};
-MODULE_DEVICE_TABLE(pci, wdtpci_pci_tbl);
-
-
-static struct pci_driver wdtpci_driver = {
-       .name           = "wdt_pci",
-       .id_table       = wdtpci_pci_tbl,
-       .probe          = wdtpci_init_one,
-       .remove         = __devexit_p(wdtpci_remove_one),
-};
-
-
-/**
- *     wdtpci_cleanup:
- *
- *     Unload the watchdog. You cannot do this with any file handles open.
- *     If your watchdog is set to continue ticking on close and you unload
- *     it, well it keeps ticking. We won't get the interrupt but the board
- *     will not touch PC memory so all is fine. You just have to load a new
- *     module in xx seconds or reboot.
- */
-
-static void __exit wdtpci_cleanup(void)
-{
-       pci_unregister_driver (&wdtpci_driver);
-}
-
-
-/**
- *     wdtpci_init:
- *
- *     Set up the WDT watchdog board. All we have to do is grab the
- *     resources we require and bitch if anyone beat us to them.
- *     The open() function will actually kick the board off.
- */
-
-static int __init wdtpci_init(void)
-{
-       return pci_register_driver (&wdtpci_driver);
-}
-
-
-module_init(wdtpci_init);
-module_exit(wdtpci_cleanup);
-
-MODULE_AUTHOR("JP Nollmann, Alan Cox");
-MODULE_DESCRIPTION("Driver for the ICS PCI-WDT500/501 watchdog cards");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
-MODULE_ALIAS_MISCDEV(TEMP_MINOR);
index f7276bf2fe7eaa05051efc507e47387c9c8eda02..f204c39fb412e2c25469ffbe41dc7e483d65096d 100644 (file)
@@ -34,7 +34,7 @@
 #include "ioatdma_registers.h"
 #include "ioatdma_hw.h"
 
-MODULE_VERSION("1.24");
+MODULE_VERSION(IOAT_DMA_VERSION);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Intel Corporation");
 
@@ -55,9 +55,7 @@ struct ioat_device {
 
 static int __devinit ioat_probe(struct pci_dev *pdev,
                                const struct pci_device_id *id);
-#ifdef IOAT_DMA_REMOVE
 static void __devexit ioat_remove(struct pci_dev *pdev);
-#endif
 
 static int ioat_dca_enabled = 1;
 module_param(ioat_dca_enabled, int, 0644);
@@ -73,7 +71,7 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
        switch (version) {
        case IOAT_VER_1_2:
                device->dma = ioat_dma_probe(pdev, iobase);
-               if (ioat_dca_enabled)
+               if (device->dma && ioat_dca_enabled)
                        device->dca = ioat_dca_init(pdev, iobase);
                break;
        default:
@@ -87,27 +85,25 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)
 {
        struct ioat_device *device = pci_get_drvdata(pdev);
 
-       if (device->dma) {
-               ioat_dma_remove(device->dma);
-               device->dma = NULL;
-       }
-
+       dev_err(&pdev->dev, "Removing dma and dca services\n");
        if (device->dca) {
                unregister_dca_provider(device->dca);
                free_dca_provider(device->dca);
                device->dca = NULL;
        }
 
+       if (device->dma) {
+               ioat_dma_remove(device->dma);
+               device->dma = NULL;
+       }
 }
 
-static struct pci_driver ioat_pci_drv = {
+static struct pci_driver ioat_pci_driver = {
        .name           = "ioatdma",
        .id_table       = ioat_pci_tbl,
        .probe          = ioat_probe,
        .shutdown       = ioat_shutdown_functionality,
-#ifdef IOAT_DMA_REMOVE
        .remove         = __devexit_p(ioat_remove),
-#endif
 };
 
 static int __devinit ioat_probe(struct pci_dev *pdev,
@@ -122,7 +118,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
        if (err)
                goto err_enable_device;
 
-       err = pci_request_regions(pdev, ioat_pci_drv.name);
+       err = pci_request_regions(pdev, ioat_pci_driver.name);
        if (err)
                goto err_request_regions;
 
@@ -176,13 +172,11 @@ err_enable_device:
        return err;
 }
 
-#ifdef IOAT_DMA_REMOVE
 /*
  * It is unsafe to remove this module: if removed while a requested
  * dma is outstanding, esp. from tcp, it is possible to hang while
- * waiting for something that will never finish, thus hanging at
- * least one cpu.  However, if you're feeling lucky and need to do
- * some testing, this usually works just fine.
+ * waiting for something that will never finish.  However, if you're
+ * feeling lucky, this usually works just fine.
  */
 static void __devexit ioat_remove(struct pci_dev *pdev)
 {
@@ -191,21 +185,16 @@ static void __devexit ioat_remove(struct pci_dev *pdev)
        ioat_shutdown_functionality(pdev);
 
        kfree(device);
-
-       iounmap(device->iobase);
-       pci_release_regions(pdev);
-       pci_disable_device(pdev);
 }
-#endif
 
 static int __init ioat_init_module(void)
 {
-       return pci_register_driver(&ioat_pci_drv);
+       return pci_register_driver(&ioat_pci_driver);
 }
 module_init(ioat_init_module);
 
 static void __exit ioat_exit_module(void)
 {
-       pci_unregister_driver(&ioat_pci_drv);
+       pci_unregister_driver(&ioat_pci_driver);
 }
 module_exit(ioat_exit_module);
index 2ae04c30edebba365cc956ad81e9d5d64deb7c06..ba985715b80306fe568018c59ffe016a1404db24 100644 (file)
@@ -65,7 +65,7 @@ static inline u16 dcaid_from_pcidev(struct pci_dev *pci)
        return (pci->bus->number << 8) | pci->devfn;
 }
 
-static int dca_enabled_in_bios(void)
+static int dca_enabled_in_bios(struct pci_dev *pdev)
 {
        /* CPUID level 9 returns DCA configuration */
        /* Bit 0 indicates DCA enabled by the BIOS */
@@ -75,17 +75,17 @@ static int dca_enabled_in_bios(void)
        cpuid_level_9 = cpuid_eax(9);
        res = test_bit(0, &cpuid_level_9);
        if (!res)
-               printk(KERN_ERR "ioat dma: DCA is disabled in BIOS\n");
+               dev_err(&pdev->dev, "DCA is disabled in BIOS\n");
 
        return res;
 }
 
-static int system_has_dca_enabled(void)
+static int system_has_dca_enabled(struct pci_dev *pdev)
 {
        if (boot_cpu_has(X86_FEATURE_DCA))
-               return dca_enabled_in_bios();
+               return dca_enabled_in_bios(pdev);
 
-       printk(KERN_ERR "ioat dma: boot cpu doesn't have X86_FEATURE_DCA\n");
+       dev_err(&pdev->dev, "boot cpu doesn't have X86_FEATURE_DCA\n");
        return 0;
 }
 
@@ -208,7 +208,7 @@ struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
        int i;
        int err;
 
-       if (!system_has_dca_enabled())
+       if (!system_has_dca_enabled(pdev))
                return NULL;
 
        /* I/OAT v1 systems must have a known tag_map to support DCA */
index 66c5bb53211bceef2f3494a9a43fc4f9d4b6724e..7e4a785c2dff6fdb5d1640e9b0499974f27f8cc5 100644 (file)
 /* internal functions */
 static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan);
 static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan);
+static struct ioat_desc_sw *
+ioat_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan);
 
-static struct ioat_dma_chan *ioat_lookup_chan_by_index(struct ioatdma_device *device,
-                                                      int index)
+static inline struct ioat_dma_chan *ioat_lookup_chan_by_index(
+                                               struct ioatdma_device *device,
+                                               int index)
 {
        return device->idx[index];
 }
@@ -148,57 +151,102 @@ static void ioat_set_src(dma_addr_t addr,
                         struct dma_async_tx_descriptor *tx,
                         int index)
 {
-       struct ioat_desc_sw *iter, *desc = tx_to_ioat_desc(tx);
-       struct ioat_dma_chan *ioat_chan = to_ioat_chan(tx->chan);
-
-       pci_unmap_addr_set(desc, src, addr);
-
-       list_for_each_entry(iter, &desc->async_tx.tx_list, node) {
-               iter->hw->src_addr = addr;
-               addr += ioat_chan->xfercap;
-       }
-
+       tx_to_ioat_desc(tx)->src = addr;
 }
 
 static void ioat_set_dest(dma_addr_t addr,
                          struct dma_async_tx_descriptor *tx,
                          int index)
 {
-       struct ioat_desc_sw *iter, *desc = tx_to_ioat_desc(tx);
-       struct ioat_dma_chan *ioat_chan = to_ioat_chan(tx->chan);
-
-       pci_unmap_addr_set(desc, dst, addr);
-
-       list_for_each_entry(iter, &desc->async_tx.tx_list, node) {
-               iter->hw->dst_addr = addr;
-               addr += ioat_chan->xfercap;
-       }
+       tx_to_ioat_desc(tx)->dst = addr;
 }
 
 static dma_cookie_t ioat_tx_submit(struct dma_async_tx_descriptor *tx)
 {
        struct ioat_dma_chan *ioat_chan = to_ioat_chan(tx->chan);
-       struct ioat_desc_sw *desc = tx_to_ioat_desc(tx);
+       struct ioat_desc_sw *first = tx_to_ioat_desc(tx);
+       struct ioat_desc_sw *prev, *new;
+       struct ioat_dma_descriptor *hw;
        int append = 0;
        dma_cookie_t cookie;
-       struct ioat_desc_sw *group_start;
+       LIST_HEAD(new_chain);
+       u32 copy;
+       size_t len;
+       dma_addr_t src, dst;
+       int orig_ack;
+       unsigned int desc_count = 0;
+
+       /* src and dest and len are stored in the initial descriptor */
+       len = first->len;
+       src = first->src;
+       dst = first->dst;
+       orig_ack = first->async_tx.ack;
+       new = first;
 
-       group_start = list_entry(desc->async_tx.tx_list.next,
-                                struct ioat_desc_sw, node);
        spin_lock_bh(&ioat_chan->desc_lock);
+       prev = to_ioat_desc(ioat_chan->used_desc.prev);
+       prefetch(prev->hw);
+       do {
+               copy = min((u32) len, ioat_chan->xfercap);
+
+               new->async_tx.ack = 1;
+
+               hw = new->hw;
+               hw->size = copy;
+               hw->ctl = 0;
+               hw->src_addr = src;
+               hw->dst_addr = dst;
+               hw->next = 0;
+
+               /* chain together the physical address list for the HW */
+               wmb();
+               prev->hw->next = (u64) new->async_tx.phys;
+
+               len -= copy;
+               dst += copy;
+               src += copy;
+
+               list_add_tail(&new->node, &new_chain);
+               desc_count++;
+               prev = new;
+       } while (len && (new = ioat_dma_get_next_descriptor(ioat_chan)));
+
+       hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
+       if (new->async_tx.callback) {
+               hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN;
+               if (first != new) {
+                       /* move callback into to last desc */
+                       new->async_tx.callback = first->async_tx.callback;
+                       new->async_tx.callback_param
+                                       = first->async_tx.callback_param;
+                       first->async_tx.callback = NULL;
+                       first->async_tx.callback_param = NULL;
+               }
+       }
+
+       new->tx_cnt = desc_count;
+       new->async_tx.ack = orig_ack; /* client is in control of this ack */
+
+       /* store the original values for use in later cleanup */
+       if (new != first) {
+               new->src = first->src;
+               new->dst = first->dst;
+               new->len = first->len;
+       }
+
        /* cookie incr and addition to used_list must be atomic */
        cookie = ioat_chan->common.cookie;
        cookie++;
        if (cookie < 0)
                cookie = 1;
-       ioat_chan->common.cookie = desc->async_tx.cookie = cookie;
+       ioat_chan->common.cookie = new->async_tx.cookie = cookie;
 
        /* write address into NextDescriptor field of last desc in chain */
        to_ioat_desc(ioat_chan->used_desc.prev)->hw->next =
-                                               group_start->async_tx.phys;
-       list_splice_init(&desc->async_tx.tx_list, ioat_chan->used_desc.prev);
+                                                       first->async_tx.phys;
+       __list_splice(&new_chain, ioat_chan->used_desc.prev);
 
-       ioat_chan->pending += desc->tx_cnt;
+       ioat_chan->pending += desc_count;
        if (ioat_chan->pending >= 4) {
                append = 1;
                ioat_chan->pending = 0;
@@ -267,7 +315,7 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
        chanerr = readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET);
        if (chanerr) {
                dev_err(&ioat_chan->device->pdev->dev,
-                       "ioatdma: CHANERR = %x, clearing\n", chanerr);
+                       "CHANERR = %x, clearing\n", chanerr);
                writel(chanerr, ioat_chan->reg_base + IOAT_CHANERR_OFFSET);
        }
 
@@ -276,7 +324,7 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
                desc = ioat_dma_alloc_descriptor(ioat_chan, GFP_KERNEL);
                if (!desc) {
                        dev_err(&ioat_chan->device->pdev->dev,
-                               "ioatdma: Only %d initial descriptors\n", i);
+                               "Only %d initial descriptors\n", i);
                        break;
                }
                list_add_tail(&desc->node, &tmp_list);
@@ -342,12 +390,13 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
        /* one is ok since we left it on there on purpose */
        if (in_use_descs > 1)
                dev_err(&ioat_chan->device->pdev->dev,
-                       "ioatdma: Freeing %d in use descriptors!\n",
+                       "Freeing %d in use descriptors!\n",
                        in_use_descs - 1);
 
        ioat_chan->last_completion = ioat_chan->completion_addr = 0;
        ioat_chan->pending = 0;
 }
+
 /**
  * ioat_dma_get_next_descriptor - return the next available descriptor
  * @ioat_chan: IOAT DMA channel handle
@@ -356,8 +405,8 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
  * channel's desc_lock held.  Allocates more descriptors if the channel
  * has run out.
  */
-static struct ioat_desc_sw *ioat_dma_get_next_descriptor(
-                                               struct ioat_dma_chan *ioat_chan)
+static struct ioat_desc_sw *
+ioat_dma_get_next_descriptor(struct ioat_dma_chan *ioat_chan)
 {
        struct ioat_desc_sw *new = NULL;
 
@@ -382,51 +431,11 @@ static struct dma_async_tx_descriptor *ioat_dma_prep_memcpy(
                                                int int_en)
 {
        struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan);
-       struct ioat_desc_sw *first, *prev, *new;
-       LIST_HEAD(new_chain);
-       u32 copy;
-       size_t orig_len;
-       int desc_count = 0;
-
-       if (!len)
-               return NULL;
-
-       orig_len = len;
-
-       first = NULL;
-       prev = NULL;
+       struct ioat_desc_sw *new;
 
        spin_lock_bh(&ioat_chan->desc_lock);
-       while (len) {
-               new = ioat_dma_get_next_descriptor(ioat_chan);
-               copy = min((u32) len, ioat_chan->xfercap);
-
-               new->hw->size = copy;
-               new->hw->ctl = 0;
-               new->async_tx.cookie = 0;
-               new->async_tx.ack = 1;
-
-               /* chain together the physical address list for the HW */
-               if (!first)
-                       first = new;
-               else
-                       prev->hw->next = (u64) new->async_tx.phys;
-
-               prev = new;
-               len  -= copy;
-               list_add_tail(&new->node, &new_chain);
-               desc_count++;
-       }
-
-       list_splice(&new_chain, &new->async_tx.tx_list);
-
-       new->hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
-       new->hw->next = 0;
-       new->tx_cnt = desc_count;
-       new->async_tx.ack = 0; /* client is in control of this ack */
-       new->async_tx.cookie = -EBUSY;
-
-       pci_unmap_len_set(new, len, orig_len);
+       new = ioat_dma_get_next_descriptor(ioat_chan);
+       new->len = len;
        spin_unlock_bh(&ioat_chan->desc_lock);
 
        return new ? &new->async_tx : NULL;
@@ -464,7 +473,7 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan)
 
        prefetch(ioat_chan->completion_virt);
 
-       if (!spin_trylock(&ioat_chan->cleanup_lock))
+       if (!spin_trylock_bh(&ioat_chan->cleanup_lock))
                return;
 
        /* The completion writeback can happen at any time,
@@ -474,22 +483,25 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan)
 
 #if (BITS_PER_LONG == 64)
        phys_complete =
-       ioat_chan->completion_virt->full & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR;
+               ioat_chan->completion_virt->full
+               & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_ADDR;
 #else
-       phys_complete = ioat_chan->completion_virt->low & IOAT_LOW_COMPLETION_MASK;
+       phys_complete =
+               ioat_chan->completion_virt->low & IOAT_LOW_COMPLETION_MASK;
 #endif
 
-       if ((ioat_chan->completion_virt->full & IOAT_CHANSTS_DMA_TRANSFER_STATUS) ==
+       if ((ioat_chan->completion_virt->full
+               & IOAT_CHANSTS_DMA_TRANSFER_STATUS) ==
                                IOAT_CHANSTS_DMA_TRANSFER_STATUS_HALTED) {
                dev_err(&ioat_chan->device->pdev->dev,
-                       "ioatdma: Channel halted, chanerr = %x\n",
+                       "Channel halted, chanerr = %x\n",
                        readl(ioat_chan->reg_base + IOAT_CHANERR_OFFSET));
 
                /* TODO do something to salvage the situation */
        }
 
        if (phys_complete == ioat_chan->last_completion) {
-               spin_unlock(&ioat_chan->cleanup_lock);
+               spin_unlock_bh(&ioat_chan->cleanup_lock);
                return;
        }
 
@@ -517,6 +529,11 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan)
                                        pci_unmap_addr(desc, src),
                                        pci_unmap_len(desc, len),
                                        PCI_DMA_TODEVICE);
+                       if (desc->async_tx.callback) {
+                               desc->async_tx.callback(
+                                               desc->async_tx.callback_param);
+                               desc->async_tx.callback = NULL;
+                       }
                }
 
                if (desc->async_tx.phys != phys_complete) {
@@ -548,7 +565,7 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan)
        if (cookie != 0)
                ioat_chan->completed_cookie = cookie;
 
-       spin_unlock(&ioat_chan->cleanup_lock);
+       spin_unlock_bh(&ioat_chan->cleanup_lock);
 }
 
 static void ioat_dma_dependency_added(struct dma_chan *chan)
@@ -613,8 +630,13 @@ static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan)
        spin_lock_bh(&ioat_chan->desc_lock);
 
        desc = ioat_dma_get_next_descriptor(ioat_chan);
-       desc->hw->ctl = IOAT_DMA_DESCRIPTOR_NUL;
+       desc->hw->ctl = IOAT_DMA_DESCRIPTOR_NUL
+                               | IOAT_DMA_DESCRIPTOR_CTL_INT_GN
+                               | IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
        desc->hw->next = 0;
+       desc->hw->size = 0;
+       desc->hw->src_addr = 0;
+       desc->hw->dst_addr = 0;
        desc->async_tx.ack = 1;
 
        list_add_tail(&desc->node, &ioat_chan->used_desc);
@@ -633,6 +655,12 @@ static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan)
  */
 #define IOAT_TEST_SIZE 2000
 
+static void ioat_dma_test_callback(void *dma_async_param)
+{
+       printk(KERN_ERR "ioatdma: ioat_dma_test_callback(%p)\n",
+                       dma_async_param);
+}
+
 /**
  * ioat_dma_self_test - Perform a IOAT transaction to verify the HW works.
  * @device: device to be tested
@@ -643,7 +671,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
        u8 *src;
        u8 *dest;
        struct dma_chan *dma_chan;
-       struct dma_async_tx_descriptor *tx;
+       struct dma_async_tx_descriptor *tx = NULL;
        dma_addr_t addr;
        dma_cookie_t cookie;
        int err = 0;
@@ -673,6 +701,13 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
        }
 
        tx = ioat_dma_prep_memcpy(dma_chan, IOAT_TEST_SIZE, 0);
+       if (!tx) {
+               dev_err(&device->pdev->dev,
+                       "Self-test prep failed, disabling\n");
+               err = -ENODEV;
+               goto free_resources;
+       }
+
        async_tx_ack(tx);
        addr = dma_map_single(dma_chan->device->dev, src, IOAT_TEST_SIZE,
                        DMA_TO_DEVICE);
@@ -680,19 +715,27 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
        addr = dma_map_single(dma_chan->device->dev, dest, IOAT_TEST_SIZE,
                        DMA_FROM_DEVICE);
        ioat_set_dest(addr, tx, 0);
+       tx->callback = ioat_dma_test_callback;
+       tx->callback_param = (void *)0x8086;
        cookie = ioat_tx_submit(tx);
+       if (cookie < 0) {
+               dev_err(&device->pdev->dev,
+                       "Self-test setup failed, disabling\n");
+               err = -ENODEV;
+               goto free_resources;
+       }
        ioat_dma_memcpy_issue_pending(dma_chan);
        msleep(1);
 
        if (ioat_dma_is_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) {
                dev_err(&device->pdev->dev,
-                       "ioatdma: Self-test copy timed out, disabling\n");
+                       "Self-test copy timed out, disabling\n");
                err = -ENODEV;
                goto free_resources;
        }
        if (memcmp(src, dest, IOAT_TEST_SIZE)) {
                dev_err(&device->pdev->dev,
-                       "ioatdma: Self-test copy failed compare, disabling\n");
+                       "Self-test copy failed compare, disabling\n");
                err = -ENODEV;
                goto free_resources;
        }
@@ -730,6 +773,9 @@ static int ioat_dma_setup_interrupts(struct ioatdma_device *device)
                goto msi;
        if (!strcmp(ioat_interrupt_style, "intx"))
                goto intx;
+       dev_err(&device->pdev->dev, "invalid ioat_interrupt_style %s\n",
+               ioat_interrupt_style);
+       goto err_no_irq;
 
 msix:
        /* The number of MSI-X vectors should equal the number of channels */
@@ -906,9 +952,9 @@ struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev,
        device->common.device_dependency_added = ioat_dma_dependency_added;
        device->common.dev = &pdev->dev;
        dev_err(&device->pdev->dev,
-               "ioatdma: Intel(R) I/OAT DMA Engine found,"
-               " %d channels, device version 0x%02x\n",
-               device->common.chancnt, device->version);
+               "Intel(R) I/OAT DMA Engine found,"
+               " %d channels, device version 0x%02x, driver version %s\n",
+               device->common.chancnt, device->version, IOAT_DMA_VERSION);
 
        err = ioat_dma_setup_interrupts(device);
        if (err)
@@ -931,9 +977,8 @@ err_completion_pool:
 err_dma_pool:
        kfree(device);
 err_kzalloc:
-       iounmap(iobase);
        dev_err(&device->pdev->dev,
-               "ioatdma: Intel(R) I/OAT DMA Engine initialization failed\n");
+               "Intel(R) I/OAT DMA Engine initialization failed\n");
        return NULL;
 }
 
@@ -942,13 +987,17 @@ void ioat_dma_remove(struct ioatdma_device *device)
        struct dma_chan *chan, *_chan;
        struct ioat_dma_chan *ioat_chan;
 
-       dma_async_device_unregister(&device->common);
-
        ioat_dma_remove_interrupts(device);
 
+       dma_async_device_unregister(&device->common);
+
        pci_pool_destroy(device->dma_pool);
        pci_pool_destroy(device->completion_pool);
 
+       iounmap(device->reg_base);
+       pci_release_regions(device->pdev);
+       pci_disable_device(device->pdev);
+
        list_for_each_entry_safe(chan, _chan,
                                 &device->common.channels, device_node) {
                ioat_chan = to_ioat_chan(chan);
index 2a319e124ece8c492a74b99f9e070079a0664635..5f9881e7b0ed25bc2722ac67c3f2b2cd10a1ed4d 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/cache.h>
 #include <linux/pci_ids.h>
 
+#define IOAT_DMA_VERSION "1.26"
+
 enum ioat_interrupt {
        none = 0,
        msix_multi_vector = 1,
@@ -122,9 +124,9 @@ struct ioat_desc_sw {
        struct ioat_dma_descriptor *hw;
        struct list_head node;
        int tx_cnt;
-       DECLARE_PCI_UNMAP_LEN(len)
-       DECLARE_PCI_UNMAP_ADDR(src)
-       DECLARE_PCI_UNMAP_ADDR(dst)
+       size_t len;
+       dma_addr_t src;
+       dma_addr_t dst;
        struct dma_async_tx_descriptor async_tx;
 };
 
index aa875ca50d9bc1282771fe180907d6555d424c6b..3e63c148677095dc38ce5e67dab90355a40fda8d 100644 (file)
@@ -1651,7 +1651,7 @@ static int adm1026_detect(struct i2c_adapter *adapter, int address,
                break;
        default :
                dev_err(&adapter->dev, ": Internal error, invalid "
-                       "kind (%d)!", kind);
+                       "kind (%d)!\n", kind);
                err = -EFAULT;
                goto exitfree;
        }
index f207434730de66f472d7e6203e4eb31b1752827d..650b07d5b902f997d3f887e0bc9c8ff978d5a911 100644 (file)
@@ -533,7 +533,7 @@ static void lm63_init_client(struct i2c_client *client)
 
        /* Start converting if needed */
        if (data->config & 0x40) { /* standby */
-               dev_dbg(&client->dev, "Switching to operational mode");
+               dev_dbg(&client->dev, "Switching to operational mode\n");
                data->config &= 0xA7;
                i2c_smbus_write_byte_data(client, LM63_REG_CONFIG1,
                                          data->config);
index e69416465e6dbbe6fae9295d6fcde620568e26da..7dfcc8dd316dcadceb4362b13aaf877f9e0e7d79 100644 (file)
@@ -795,7 +795,7 @@ static ssize_t set_pwm_auto_point_pwm(struct device *dev,
 
        if ((val < 0) || (val > 255)) {
                dev_err(dev, "pwm value %ld is out of range. "
-                       "Choose a value between 0 and 255." , val);
+                       "Choose a value between 0 and 255.\n" , val);
                return -EINVAL;
        }
 
index b6f2ebf9f9cf54e4648c8772856bbd4f0952d0a7..a9c01a6f00571d0f39b9a0d6e2dbf3e483e54c5e 100644 (file)
@@ -1096,7 +1096,7 @@ static int w83791d_detect(struct i2c_adapter *adapter, int address, int kind)
        if (kind == w83791d) {
                client_name = "w83791d";
        } else {
-               dev_err(dev, "w83791d: Internal error: unknown kind (%d)?!?",
+               dev_err(dev, "w83791d: Internal error: unknown kind (%d)?!?\n",
                        kind);
                goto error1;
        }
index f836198b705c231ef9d7eda88b92079365c9bdc8..007449d3e16ee4d5804a2ccf70759a56e8c4dcf1 100644 (file)
@@ -1385,8 +1385,8 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
        if (kind == w83792d) {
                client_name = "w83792d";
        } else {
-               dev_err(dev, "w83792d: Internal error: unknown"
-                                         " kind (%d)?!?", kind);
+               dev_err(dev, "w83792d: Internal error: unknown kind (%d)?!?\n",
+                       kind);
                goto ERROR1;
        }
 
index 17cecf1ea79767ed701e49a3d974ccfb48fe84f3..be99c02ecac57e84c5616a073ea7821dd2809fdf 100644 (file)
@@ -591,18 +591,18 @@ static int pmcmsptwi_master_xfer(struct i2c_adapter *adap,
        if (msg->flags & I2C_M_TEN)
                pmcmsptwi_set_twi_config(&oldcfg, data);
 
-       dev_dbg(&adap->dev, "I2C %s of %d bytes ",
-               (msg->flags & I2C_M_RD) ? "read" : "write", msg->len);
+       dev_dbg(&adap->dev, "I2C %s of %d bytes %s\n",
+               (msg->flags & I2C_M_RD) ? "read" : "write", msg->len,
+               (ret == MSP_TWI_XFER_OK) ? "succeeded" : "failed");
+
        if (ret != MSP_TWI_XFER_OK) {
                /*
                 * TODO: We could potentially loop and retry in the case
                 * of MSP_TWI_XFER_TIMEOUT.
                 */
-               dev_dbg(&adap->dev, "failed\n");
                return -1;
        }
 
-       dev_dbg(&adap->dev, "succeeded\n");
        return 0;
 }
 
index 17376feb1acc6b95c29196ac538515b9a58ead4d..f8d0dff0de7eab4d77e06ae33794b510fb39817d 100644 (file)
@@ -575,7 +575,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
        else {
                freq_mhz = PNX_DEFAULT_FREQ;
                dev_info(&pdev->dev, "Setting bus frequency to default value: "
-                      "%d MHz", freq_mhz);
+                      "%d MHz\n", freq_mhz);
        }
 
        i2c_pnx->adapter->algo = &pnx_algorithm;
index 66436bae11acbcde6aa1074ea4ba3513073e5376..2dea0123a958577ad87a3095c159edf177d7050e 100644 (file)
@@ -1195,7 +1195,7 @@ static int menelaus_probe(struct i2c_client *client)
                err = request_irq(client->irq, menelaus_irq, IRQF_DISABLED,
                                  DRIVER_NAME, menelaus);
                if (err) {
-                       dev_dbg(&client->dev,  "can't get IRQ %d, err %d",
+                       dev_dbg(&client->dev,  "can't get IRQ %d, err %d\n",
                                        client->irq, err);
                        goto fail1;
                }
index a3409fdb307c88d3de45e37c633bd66a3910c797..7a7dab890f6dfbbc664f9b1115b6937420d33225 100644 (file)
@@ -579,12 +579,12 @@ static ssize_t  ehca_show_##name(struct device *dev,                       \
                                                                           \
        rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);                      \
        if (!rblock) {                                                     \
-               dev_err(dev, "Can't allocate rblock memory.");             \
+               dev_err(dev, "Can't allocate rblock memory.\n");           \
                return 0;                                                  \
        }                                                                  \
                                                                           \
        if (hipz_h_query_hca(shca->ipz_hca_handle, rblock) != H_SUCCESS) { \
-               dev_err(dev, "Can't query device properties");             \
+               dev_err(dev, "Can't query device properties\n");           \
                ehca_free_fw_ctrlblock(rblock);                            \
                return 0;                                                  \
        }                                                                  \
index 20896d5e5f0e640389161dbecde47c1d3b21992e..ec1b6cfefcd3274d9e645e7ee2e944dd0ded0d93 100644 (file)
@@ -448,9 +448,8 @@ static int gameport_thread(void *nothing)
        set_freezable();
        do {
                gameport_handle_event();
-               wait_event_interruptible(gameport_wait,
+               wait_event_freezable(gameport_wait,
                        kthread_should_stop() || !list_empty(&gameport_event_list));
-               try_to_freeze();
        } while (!kthread_should_stop());
 
        printk(KERN_DEBUG "gameport: kgameportd exiting\n");
index b3bc15acd3f5604979874f4311c5f56daf8fd1eb..7f5293828fbff2e5325c612a93f3ff449cdfa958 100644 (file)
@@ -387,9 +387,8 @@ static int serio_thread(void *nothing)
        set_freezable();
        do {
                serio_handle_event();
-               wait_event_interruptible(serio_wait,
+               wait_event_freezable(serio_wait,
                        kthread_should_stop() || !list_empty(&serio_event_list));
-               try_to_freeze();
        } while (!kthread_should_stop());
 
        printk(KERN_DEBUG "serio: kseriod exiting\n");
index 86aed64ec0fb9dd54c5ed3ec1b134f62a2615d6e..89373b01d8f5694148dab2f6ccf6d67839c65ee6 100644 (file)
@@ -333,10 +333,9 @@ static int ucb1400_ts_thread(void *_ucb)
                        timeout = msecs_to_jiffies(10);
                }
 
-               wait_event_interruptible_timeout(ucb->ts_wait,
+               wait_event_freezable_timeout(ucb->ts_wait,
                        ucb->irq_pending || ucb->ts_restart || kthread_should_stop(),
                        timeout);
-               try_to_freeze();
        }
 
        /* Send the "pen off" if we are stopping with the pen still active */
index 6df336bdd5716881766c7c9039272c1f2b3a1b89..acd417197d03dd6f46078bff2eff31fb05bf5414 100644 (file)
@@ -534,7 +534,8 @@ int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
                        n = RBUFSIZE - tail;
                if (!n) {
                        dev_err(inbuf->cs->dev,
-                               "buffer overflow (%u bytes lost)", bytesleft);
+                               "buffer overflow (%u bytes lost)\n",
+                               bytesleft);
                        break;
                }
                if (n > bytesleft)
index 7a69a18d07e245f4a15cc10631262a37c568d67c..4484a6417235ec3c87de9cbe36313a7b015bfac2 100644 (file)
@@ -321,12 +321,15 @@ void b1_reset_ctr(struct capi_ctr *ctrl)
        avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
        avmcard *card = cinfo->card;
        unsigned int port = card->port;
+       unsigned long flags;
 
        b1_reset(port);
        b1_reset(port);
 
        memset(cinfo->version, 0, sizeof(cinfo->version));
+       spin_lock_irqsave(&card->lock, flags);
        capilib_release(&cinfo->ncci_head);
+       spin_unlock_irqrestore(&card->lock, flags);
        capi_ctr_reseted(ctrl);
 }
 
@@ -361,9 +364,8 @@ void b1_release_appl(struct capi_ctr *ctrl, u16 appl)
        unsigned int port = card->port;
        unsigned long flags;
 
-       capilib_release_appl(&cinfo->ncci_head, appl);
-
        spin_lock_irqsave(&card->lock, flags);
+       capilib_release_appl(&cinfo->ncci_head, appl);
        b1_put_byte(port, SEND_RELEASE);
        b1_put_word(port, appl);
        spin_unlock_irqrestore(&card->lock, flags);
@@ -380,27 +382,27 @@ u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
        u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
        u16 dlen, retval;
 
+       spin_lock_irqsave(&card->lock, flags);
        if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
                retval = capilib_data_b3_req(&cinfo->ncci_head,
                                             CAPIMSG_APPID(skb->data),
                                             CAPIMSG_NCCI(skb->data),
                                             CAPIMSG_MSGID(skb->data));
-               if (retval != CAPI_NOERROR) 
+               if (retval != CAPI_NOERROR) {
+                       spin_unlock_irqrestore(&card->lock, flags);
                        return retval;
+               }
 
                dlen = CAPIMSG_DATALEN(skb->data);
 
-               spin_lock_irqsave(&card->lock, flags);
                b1_put_byte(port, SEND_DATA_B3_REQ);
                b1_put_slice(port, skb->data, len);
                b1_put_slice(port, skb->data + len, dlen);
-               spin_unlock_irqrestore(&card->lock, flags);
        } else {
-               spin_lock_irqsave(&card->lock, flags);
                b1_put_byte(port, SEND_MESSAGE);
                b1_put_slice(port, skb->data, len);
-               spin_unlock_irqrestore(&card->lock, flags);
        }
+       spin_unlock_irqrestore(&card->lock, flags);
 
        dev_kfree_skb_any(skb);
        return CAPI_NOERROR;
@@ -534,17 +536,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
 
                ApplId = (unsigned) b1_get_word(card->port);
                MsgLen = b1_get_slice(card->port, card->msgbuf);
-               spin_unlock_irqrestore(&card->lock, flags);
                if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
                        printk(KERN_ERR "%s: incoming packet dropped\n",
                                        card->name);
+                       spin_unlock_irqrestore(&card->lock, flags);
                } else {
                        memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
                        if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
                                capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
                                                     CAPIMSG_NCCI(skb->data),
                                                     CAPIMSG_MSGID(skb->data));
-
+                       spin_unlock_irqrestore(&card->lock, flags);
                        capi_ctr_handle_message(ctrl, ApplId, skb);
                }
                break;
@@ -554,21 +556,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
                ApplId = b1_get_word(card->port);
                NCCI = b1_get_word(card->port);
                WindowSize = b1_get_word(card->port);
-               spin_unlock_irqrestore(&card->lock, flags);
-
                capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize);
-
+               spin_unlock_irqrestore(&card->lock, flags);
                break;
 
        case RECEIVE_FREE_NCCI:
 
                ApplId = b1_get_word(card->port);
                NCCI = b1_get_word(card->port);
-               spin_unlock_irqrestore(&card->lock, flags);
-
                if (NCCI != 0xffffffff)
                        capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI);
-              
+               spin_unlock_irqrestore(&card->lock, flags);
                break;
 
        case RECEIVE_START:
index d58f927e766a4a95f9c942be039e6ae3071be210..8710cf6214d9fc9487841547a4139625948d51c1 100644 (file)
@@ -727,6 +727,7 @@ static void c4_send_init(avmcard *card)
 {
        struct sk_buff *skb;
        void *p;
+       unsigned long flags;
 
        skb = alloc_skb(15, GFP_ATOMIC);
        if (!skb) {
@@ -744,12 +745,15 @@ static void c4_send_init(avmcard *card)
        skb_put(skb, (u8 *)p - (u8 *)skb->data);
 
        skb_queue_tail(&card->dma->send_queue, skb);
+       spin_lock_irqsave(&card->lock, flags);
        c4_dispatch_tx(card);
+       spin_unlock_irqrestore(&card->lock, flags);
 }
 
 static int queue_sendconfigword(avmcard *card, u32 val)
 {
        struct sk_buff *skb;
+       unsigned long flags;
        void *p;
 
        skb = alloc_skb(3+4, GFP_ATOMIC);
@@ -766,7 +770,9 @@ static int queue_sendconfigword(avmcard *card, u32 val)
        skb_put(skb, (u8 *)p - (u8 *)skb->data);
 
        skb_queue_tail(&card->dma->send_queue, skb);
+       spin_lock_irqsave(&card->lock, flags);
        c4_dispatch_tx(card);
+       spin_unlock_irqrestore(&card->lock, flags);
        return 0;
 }
 
@@ -986,7 +992,9 @@ static void c4_release_appl(struct capi_ctr *ctrl, u16 appl)
        struct sk_buff *skb;
        void *p;
 
+       spin_lock_irqsave(&card->lock, flags);
        capilib_release_appl(&cinfo->ncci_head, appl);
+       spin_unlock_irqrestore(&card->lock, flags);
 
        if (ctrl->cnr == card->cardnr) {
                skb = alloc_skb(7, GFP_ATOMIC);
@@ -1019,7 +1027,8 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
        u16 retval = CAPI_NOERROR;
        unsigned long flags;
 
-       if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
+       spin_lock_irqsave(&card->lock, flags);
+       if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
                retval = capilib_data_b3_req(&cinfo->ncci_head,
                                             CAPIMSG_APPID(skb->data),
                                             CAPIMSG_NCCI(skb->data),
@@ -1027,10 +1036,9 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
        }
        if (retval == CAPI_NOERROR) {
                skb_queue_tail(&card->dma->send_queue, skb);
-               spin_lock_irqsave(&card->lock, flags);
                c4_dispatch_tx(card);
-               spin_unlock_irqrestore(&card->lock, flags);
        }
+       spin_unlock_irqrestore(&card->lock, flags);
        return retval;
 }
 
index b203640ef1c587e7c4f294a7b0be8f2bd9f923a8..445f0266557754f739b5b406abf8f5e5f55a63a0 100644 (file)
@@ -527,7 +527,8 @@ static int dvb_frontend_thread(void *data)
                up(&fepriv->sem);           /* is locked when we enter the thread... */
 restart:
                timeout = wait_event_interruptible_timeout(fepriv->wait_queue,
-                       dvb_frontend_should_wakeup(fe) || kthread_should_stop(),
+                       dvb_frontend_should_wakeup(fe) || kthread_should_stop()
+                               || freezing(current),
                        fepriv->delay);
 
                if (kthread_should_stop() || dvb_frontend_is_exiting(fe)) {
index 9eac65f34bff815515d36577872424f89dbcd692..dcf22a3b672aa65721994665c284aa99705bd887 100644 (file)
@@ -144,7 +144,7 @@ const static unsigned int palette2pixelformat[] = {
        [VIDEO_PALETTE_YUV422P] = V4L2_PIX_FMT_YUV422P,
 };
 
-static unsigned int __attribute_pure__
+static unsigned int __pure
 palette_to_pixelformat(unsigned int palette)
 {
        if (palette < ARRAY_SIZE(palette2pixelformat))
index b79a9cf2d162bfe775e02262de401a9429a786ce..21b921dd6aab63a04627a93fecd4ffbbf21284e6 100644 (file)
@@ -696,7 +696,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev,
 
        info->clk = clk_get(&pdev->dev, "nand");
        if (IS_ERR(info->clk)) {
-               dev_err(&pdev->dev, "failed to get clock");
+               dev_err(&pdev->dev, "failed to get clock\n");
                err = -ENOENT;
                goto exit_error;
        }
index 9fe0517cf89319e70340d952fd189e8365400d4b..7495a9ee8f4bff6dde5b7c7666398d35882059fd 100644 (file)
@@ -900,7 +900,7 @@ static int ax_probe(struct platform_device *pdev)
 
                ax->map2 = ioremap(res->start, size);
                if (ax->map2 == NULL) {
-                       dev_err(&pdev->dev, "cannot map reset register");
+                       dev_err(&pdev->dev, "cannot map reset register\n");
                        ret = -ENXIO;
                        goto exit_mem2;
                }
index 78ed633ceb829e121161a8a230a1350d9de06017..96cee4badd289c4f4d78515d7db2588bd6f2ba1c 100644 (file)
@@ -56,8 +56,8 @@
 
 #define DRV_MODULE_NAME                "bnx2"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "1.6.7"
-#define DRV_MODULE_RELDATE     "October 10, 2007"
+#define DRV_MODULE_VERSION     "1.6.8"
+#define DRV_MODULE_RELDATE     "October 17, 2007"
 
 #define RUN_AT(x) (jiffies + (x))
 
@@ -3079,14 +3079,18 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state)
                        autoneg = bp->autoneg;
                        advertising = bp->advertising;
 
-                       bp->autoneg = AUTONEG_SPEED;
-                       bp->advertising = ADVERTISED_10baseT_Half |
-                               ADVERTISED_10baseT_Full |
-                               ADVERTISED_100baseT_Half |
-                               ADVERTISED_100baseT_Full |
-                               ADVERTISED_Autoneg;
+                       if (bp->phy_port == PORT_TP) {
+                               bp->autoneg = AUTONEG_SPEED;
+                               bp->advertising = ADVERTISED_10baseT_Half |
+                                       ADVERTISED_10baseT_Full |
+                                       ADVERTISED_100baseT_Half |
+                                       ADVERTISED_100baseT_Full |
+                                       ADVERTISED_Autoneg;
+                       }
 
-                       bnx2_setup_copper_phy(bp);
+                       spin_lock_bh(&bp->phy_lock);
+                       bnx2_setup_phy(bp, bp->phy_port);
+                       spin_unlock_bh(&bp->phy_lock);
 
                        bp->autoneg = autoneg;
                        bp->advertising = advertising;
@@ -3097,10 +3101,16 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state)
 
                        /* Enable port mode. */
                        val &= ~BNX2_EMAC_MODE_PORT;
-                       val |= BNX2_EMAC_MODE_PORT_MII |
-                              BNX2_EMAC_MODE_MPKT_RCVD |
+                       val |= BNX2_EMAC_MODE_MPKT_RCVD |
                               BNX2_EMAC_MODE_ACPI_RCVD |
                               BNX2_EMAC_MODE_MPKT;
+                       if (bp->phy_port == PORT_TP)
+                               val |= BNX2_EMAC_MODE_PORT_MII;
+                       else {
+                               val |= BNX2_EMAC_MODE_PORT_GMII;
+                               if (bp->line_speed == SPEED_2500)
+                                       val |= BNX2_EMAC_MODE_25G_MODE;
+                       }
 
                        REG_WR(bp, BNX2_EMAC_MODE, val);
 
@@ -6428,7 +6438,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        /* enable device (incl. PCI PM wakeup), and bus-mastering */
        rc = pci_enable_device(pdev);
        if (rc) {
-               dev_err(&pdev->dev, "Cannot enable PCI device, aborting.");
+               dev_err(&pdev->dev, "Cannot enable PCI device, aborting.\n");
                goto err_out;
        }
 
index 5bd52bead9bf38b860b29412cfc6cfdda51c430d..4b129b7cbfad94eb58d1887062027c82c2ce77cf 100644 (file)
  */
 
 static u8 bnx2_COM_b09FwText[] = {
-/*     0x1f, 0x8b, 0x08, 0x00, 0x0e, 0x34, 0xe7, 0x45, 0x00, 0x03, */
-                                                                   0xdc, 0x5b,
-       0x6d, 0x70, 0x5c, 0xd5, 0x79, 0x7e, 0xef, 0xd9, 0xbb, 0xf2, 0x5a, 0x92,
-       0xe5, 0x6b, 0x79, 0x23, 0x16, 0x4b, 0xc0, 0xae, 0x75, 0x6d, 0x69, 0xb0,
-       0x43, 0x16, 0xa1, 0x80, 0x9a, 0xd9, 0xc0, 0xb2, 0x2b, 0x33, 0x9e, 0x0c,
-       0x69, 0x64, 0x50, 0x80, 0xb6, 0x4c, 0x46, 0xec, 0x1a, 0x9a, 0x4e, 0x87,
-       0xd6, 0xa6, 0x6e, 0x9b, 0xc9, 0x34, 0x78, 0x47, 0x1f, 0x8d, 0xa7, 0x15,
-       0xba, 0x06, 0x1b, 0xd9, 0xd3, 0xd0, 0xa0, 0x6a, 0x71, 0xf1, 0x8f, 0x8d,
-       0xaf, 0xf9, 0x48, 0xaa, 0x4c, 0x4d, 0xa5, 0x18, 0x48, 0x69, 0xa7, 0x4d,
-       0xfb, 0xa3, 0x9e, 0xa1, 0x5f, 0x84, 0x32, 0xfd, 0xc1, 0x74, 0xda, 0x4e,
-       0x3a, 0x24, 0x53, 0x08, 0x84, 0xed, 0xf3, 0x9c, 0x7b, 0xee, 0xea, 0x6a,
-       0x25, 0x7f, 0xf1, 0x91, 0x1f, 0xd5, 0xcc, 0xfa, 0xde, 0xf3, 0xfd, 0x9e,
-       0xf7, 0xbc, 0xef, 0xf3, 0x7e, 0xdc, 0xe3, 0x4f, 0x8a, 0xb4, 0x8a, 0xf9,
-       0xdb, 0x80, 0x5f, 0xfa, 0xc1, 0xdf, 0x2c, 0x5f, 0x37, 0x78, 0xdd, 0x0d,
-       0x78, 0xbd, 0x41, 0xc5, 0xec, 0x18, 0xeb, 0xf9, 0x4f, 0x12, 0xbf, 0x01,
-       0xf3, 0xbe, 0xd6, 0x9f, 0x83, 0xdf, 0x9b, 0x68, 0x1c, 0xfb, 0x0f, 0x11,
-       0xeb, 0x3c, 0x7d, 0xa2, 0x7f, 0xf5, 0xfa, 0x85, 0xdb, 0x15, 0x69, 0xb9,
-       0x40, 0x7b, 0x2c, 0x58, 0x52, 0xd3, 0xcc, 0x9f, 0x24, 0x54, 0x6e, 0xec,
-       0xe1, 0x82, 0x2b, 0x89, 0x58, 0x6e, 0xf7, 0xc1, 0xb2, 0x2b, 0x92, 0xaf,
-       0xed, 0x48, 0x17, 0xe5, 0x67, 0xf5, 0x4a, 0xd2, 0x16, 0xd6, 0x5f, 0x95,
-       0x7b, 0xef, 0xc9, 0x17, 0x6e, 0xca, 0xfc, 0x68, 0x2e, 0x26, 0x09, 0x27,
-       0xf7, 0xbc, 0x38, 0xdb, 0x25, 0xd1, 0x83, 0x31, 0x4f, 0xf4, 0xe5, 0x2d,
-       0xe9, 0x08, 0xe7, 0x7a, 0xb3, 0xfe, 0x42, 0x9f, 0x54, 0xb6, 0xe4, 0x12,
-       0xa2, 0x72, 0xdb, 0x5e, 0x2d, 0xc4, 0x9c, 0xb1, 0x58, 0xce, 0x91, 0x45,
-       0x5f, 0x46, 0xee, 0x9f, 0x96, 0x44, 0x22, 0xf7, 0xe5, 0xc4, 0xba, 0x6d,
-       0x92, 0xb0, 0x73, 0x4b, 0x0f, 0xff, 0xbe, 0x7b, 0xb0, 0xae, 0x5c, 0xb7,
-       0x7f, 0x5e, 0xda, 0x87, 0x4e, 0x0c, 0xa2, 0xbd, 0x96, 0xe9, 0x17, 0xb9,
-       0x49, 0x94, 0x5b, 0x69, 0x8f, 0xb9, 0x09, 0x29, 0xf8, 0xae, 0x14, 0x7d,
-       0x91, 0xbf, 0xac, 0x59, 0x72, 0xc2, 0xed, 0x92, 0xf9, 0x9d, 0xef, 0xd5,
-       0xf3, 0xa0, 0xe5, 0xfb, 0xee, 0xd2, 0xc3, 0x93, 0x2e, 0xe9, 0x3d, 0x90,
-       0x08, 0xe8, 0xdd, 0xbb, 0xae, 0xec, 0xda, 0x32, 0x5e, 0x63, 0xdd, 0xa8,
-       0x62, 0x5d, 0x3c, 0x97, 0x68, 0x3d, 0xe1, 0xb6, 0x9b, 0xba, 0x57, 0x6f,
-       0x29, 0x60, 0xbe, 0x89, 0x1a, 0xfb, 0xe6, 0xaf, 0x2f, 0xbb, 0x49, 0x53,
-       0xbf, 0x70, 0x63, 0xc1, 0x4d, 0xa1, 0xbe, 0xc7, 0xb4, 0x8d, 0x3d, 0x58,
-       0x76, 0x5d, 0xd3, 0xf6, 0x76, 0xac, 0xe0, 0xf6, 0x9b, 0xfa, 0xf7, 0x6e,
-       0x2e, 0xbb, 0x3b, 0x4d, 0x7d, 0x0f, 0xe6, 0xca, 0x9a, 0xfa, 0x85, 0x7b,
-       0xca, 0xee, 0xa0, 0xa9, 0xdf, 0x7d, 0x73, 0xc1, 0x1d, 0x32, 0xf5, 0x89,
-       0xa1, 0xb2, 0x9b, 0x43, 0xfd, 0x97, 0x13, 0x6a, 0x9b, 0x23, 0x53, 0xb5,
-       0x34, 0x7e, 0x79, 0xb4, 0x0d, 0xa3, 0x6e, 0x37, 0x7e, 0xb7, 0xe3, 0xf7,
-       0xc8, 0x46, 0xe9, 0x18, 0xc1, 0xf3, 0xbf, 0xba, 0x03, 0xde, 0x81, 0x47,
-       0x5e, 0x42, 0x5e, 0x8f, 0xa5, 0xe4, 0x85, 0xbe, 0xd7, 0xc1, 0x43, 0x47,
-       0x4e, 0xfb, 0x62, 0x8d, 0xf4, 0xa5, 0xc0, 0xbb, 0xa4, 0x3c, 0xe3, 0xb7,
-       0x49, 0xec, 0xb1, 0x18, 0x78, 0xf3, 0xcb, 0x52, 0x4a, 0x26, 0x64, 0xd3,
-       0xac, 0x25, 0x5b, 0x07, 0x12, 0x92, 0x77, 0xb8, 0x36, 0x4e, 0x7b, 0x26,
-       0x29, 0xb1, 0xd9, 0xfc, 0x66, 0x25, 0xdb, 0x9c, 0xa2, 0x54, 0xc0, 0xbb,
-       0x57, 0x29, 0x97, 0x68, 0x4b, 0x4b, 0x71, 0xfa, 0x5a, 0x19, 0x73, 0x48,
-       0xd7, 0x1f, 0x5c, 0x15, 0xac, 0x95, 0xb0, 0x0a, 0xc7, 0x46, 0x65, 0xca,
-       0x6b, 0xb7, 0x8a, 0xc7, 0x6e, 0x96, 0x42, 0x56, 0x92, 0x18, 0x97, 0x2a,
-       0xa1, 0xa5, 0x5a, 0x1b, 0x95, 0x49, 0x4f, 0xac, 0x82, 0x47, 0x7e, 0x76,
-       0xa1, 0xbd, 0x43, 0xf7, 0x45, 0x5d, 0x4f, 0x4c, 0xcf, 0x9d, 0x40, 0xbd,
-       0x83, 0xfa, 0x4e, 0x6b, 0x58, 0xcf, 0xa1, 0xeb, 0xd3, 0x13, 0xd2, 0x2e,
-       0x4f, 0xd5, 0x92, 0xa6, 0x6f, 0xbd, 0x5e, 0xc8, 0x3a, 0xe8, 0x37, 0x2a,
-       0x13, 0x5e, 0x52, 0xc6, 0xf0, 0x1c, 0xf7, 0xb8, 0x7e, 0x0a, 0x32, 0x75,
-       0xdd, 0xc1, 0xd2, 0x51, 0x3d, 0x5f, 0x3a, 0x96, 0xe3, 0x7c, 0x3d, 0xe8,
-       0xf7, 0x12, 0xe8, 0xb2, 0xc4, 0xd6, 0x67, 0x99, 0x97, 0xd2, 0xb4, 0x05,
-       0x79, 0xc3, 0x53, 0xf3, 0x75, 0x18, 0xf4, 0xdb, 0xe2, 0x0e, 0x58, 0x52,
-       0xc6, 0x59, 0x55, 0x1c, 0x94, 0x6b, 0x0b, 0xaa, 0xe0, 0xad, 0x93, 0xa2,
-       0x9d, 0x96, 0xd8, 0x0c, 0x65, 0x69, 0x4c, 0x26, 0x30, 0x46, 0xb9, 0xec,
-       0xf3, 0x0e, 0xf6, 0x3d, 0xa6, 0xcf, 0xa1, 0x25, 0x57, 0x51, 0x45, 0xbf,
-       0x4b, 0xd4, 0xec, 0xbd, 0xf2, 0xd2, 0xb4, 0x38, 0x38, 0xc7, 0x7a, 0xc1,
-       0x9d, 0x54, 0x85, 0xa7, 0x6d, 0x89, 0xcf, 0x58, 0x32, 0xe9, 0x66, 0xa0,
-       0x01, 0x87, 0xd4, 0x2e, 0x7f, 0x01, 0xfd, 0x38, 0x0e, 0xfd, 0x6a, 0x0a,
-       0x7c, 0xe5, 0xfb, 0x0e, 0x47, 0x69, 0x79, 0x66, 0x1f, 0x9c, 0x01, 0xf6,
-       0xf1, 0x8c, 0x87, 0x33, 0xd1, 0x67, 0x94, 0xc6, 0x19, 0x89, 0x35, 0xdc,
-       0x07, 0x99, 0x3a, 0x6a, 0x4b, 0x29, 0x8b, 0x7d, 0xa1, 0x77, 0x29, 0xbb,
-       0x4c, 0xd7, 0xc4, 0x74, 0x33, 0x5d, 0x1c, 0x47, 0xba, 0x02, 0x9a, 0xc6,
-       0x8f, 0x92, 0xbe, 0x65, 0x7a, 0xa6, 0xa6, 0x43, 0x1a, 0xb9, 0x1e, 0x69,
-       0x0b, 0xe9, 0xe2, 0x38, 0xd2, 0xb5, 0x99, 0x67, 0xcd, 0x3f, 0x6b, 0x18,
-       0x74, 0x4c, 0x78, 0x36, 0xce, 0xa8, 0x5d, 0x4a, 0x4e, 0xc5, 0x9a, 0x18,
-       0xda, 0x91, 0x82, 0x36, 0x5b, 0xe3, 0x43, 0xa4, 0xd9, 0xc5, 0x39, 0xb6,
-       0xe8, 0xf3, 0x56, 0xb9, 0x49, 0xf2, 0x0e, 0xfd, 0xb9, 0x3e, 0xde, 0x6b,
-       0x8e, 0x4c, 0xea, 0xf9, 0x48, 0xd3, 0x47, 0x31, 0x0f, 0x69, 0x7d, 0x05,
-       0xb2, 0x3a, 0x08, 0x19, 0xcd, 0xca, 0x5f, 0xf8, 0x3b, 0xe5, 0xcf, 0xfc,
-       0x7e, 0xf9, 0x0e, 0xf4, 0xf6, 0xdb, 0x7e, 0x5a, 0x9e, 0xf7, 0x7b, 0xe4,
-       0x39, 0x3f, 0x25, 0xcf, 0x6a, 0xf9, 0x1d, 0x16, 0xe9, 0xa0, 0x4c, 0xa7,
-       0xa5, 0x13, 0xfa, 0xb3, 0x09, 0xba, 0xf9, 0x38, 0xf8, 0x77, 0xb4, 0x4f,
-       0xf2, 0x9b, 0x73, 0x92, 0xb8, 0x1a, 0xbf, 0x2b, 0xf0, 0xeb, 0xca, 0xd9,
-       0x5a, 0x56, 0xec, 0x1c, 0x79, 0x68, 0x4b, 0x51, 0xef, 0xd9, 0x96, 0x09,
-       0xff, 0x91, 0xab, 0x03, 0xd9, 0x15, 0x19, 0x01, 0x8f, 0xd5, 0xc0, 0x4f,
-       0xea, 0x79, 0x07, 0xfb, 0x18, 0xd8, 0xa1, 0x79, 0xaf, 0x06, 0x28, 0xb3,
-       0x69, 0xc8, 0xbd, 0x6d, 0x15, 0xbd, 0x93, 0xc0, 0x8d, 0x36, 0xab, 0x70,
-       0xa4, 0x22, 0xe5, 0x23, 0x75, 0x29, 0x67, 0xe3, 0xf2, 0x90, 0x53, 0x97,
-       0xe1, 0x6c, 0x8b, 0xec, 0x77, 0xc0, 0xfb, 0x9d, 0xbf, 0x6d, 0x85, 0x98,
-       0xfd, 0xb8, 0xff, 0x3b, 0x78, 0x67, 0x9d, 0xc8, 0x51, 0xfd, 0x1e, 0xd4,
-       0x57, 0xfc, 0xb8, 0xe4, 0x93, 0x95, 0x94, 0x2d, 0x5b, 0x54, 0xb0, 0xee,
-       0x78, 0xd8, 0x06, 0x7e, 0x2c, 0x01, 0x27, 0x33, 0x5a, 0x5f, 0x4a, 0xd3,
-       0xeb, 0xdf, 0xce, 0xeb, 0x6a, 0xf4, 0x77, 0x06, 0xe5, 0xac, 0xe6, 0x67,
-       0x7a, 0xcc, 0xca, 0x25, 0x65, 0x6b, 0x8d, 0xe5, 0x21, 0xeb, 0x4e, 0x9f,
-       0xf2, 0x8c, 0x77, 0x9f, 0x74, 0x5e, 0x89, 0x7e, 0x36, 0x9e, 0x79, 0x43,
-       0x6f, 0x94, 0x46, 0xce, 0x43, 0x1a, 0xf9, 0xfc, 0x66, 0x84, 0xc6, 0x27,
-       0x1b, 0xef, 0x47, 0x23, 0xef, 0x15, 0xff, 0x8f, 0x5a, 0x03, 0xda, 0x86,
-       0xe4, 0x8d, 0x99, 0xaf, 0x98, 0x75, 0xf0, 0x7e, 0x8a, 0xf3, 0x7f, 0xab,
-       0x1e, 0xc8, 0x4b, 0xe5, 0x22, 0xeb, 0x2c, 0x44, 0xd6, 0xf9, 0x6e, 0x64,
-       0x9d, 0xef, 0x46, 0xd6, 0xa9, 0x80, 0xa7, 0xb2, 0x51, 0x41, 0x86, 0x4b,
-       0x34, 0x63, 0x72, 0x08, 0x73, 0xbe, 0x2e, 0xb1, 0x1c, 0xf5, 0x3c, 0xc4,
-       0x9b, 0x73, 0xe8, 0x9f, 0x93, 0xb3, 0x33, 0x15, 0x29, 0x1d, 0x89, 0xcb,
-       0x1d, 0xba, 0xdf, 0x26, 0x43, 0x5f, 0xb4, 0x2d, 0x21, 0x7b, 0x92, 0x7c,
-       0x0f, 0xdb, 0x6c, 0xf0, 0x99, 0xe5, 0x6f, 0x5d, 0x19, 0x94, 0xf9, 0xbe,
-       0x60, 0xf6, 0x32, 0x1a, 0x8c, 0x3b, 0xf5, 0xa6, 0xc6, 0xc3, 0x45, 0x9f,
-       0xb8, 0x25, 0xd9, 0x98, 0x2b, 0xfb, 0x86, 0xb3, 0x5d, 0x32, 0xe1, 0x58,
-       0xd9, 0xf1, 0xfe, 0x75, 0xd4, 0x8b, 0xbc, 0x72, 0xdb, 0x80, 0x0d, 0x92,
-       0x56, 0xc4, 0x7c, 0xbd, 0x2f, 0x4b, 0x05, 0xf4, 0x3b, 0x2c, 0x8f, 0x28,
-       0xb7, 0xb3, 0xa9, 0x9e, 0xba, 0x1d, 0xc3, 0x3b, 0x65, 0x78, 0x97, 0x39,
-       0x63, 0x1b, 0x65, 0xe2, 0xf0, 0x35, 0xa6, 0x1c, 0xb6, 0x6f, 0xb6, 0x57,
-       0x96, 0xcf, 0x76, 0xaf, 0x2c, 0x87, 0x38, 0x11, 0xc5, 0x70, 0xee, 0x15,
-       0xf8, 0xe4, 0x52, 0xee, 0xe2, 0xa0, 0x35, 0x0b, 0x9d, 0x5b, 0x67, 0x68,
-       0xb8, 0xc2, 0xd0, 0x00, 0x5a, 0xfb, 0x20, 0x59, 0x5a, 0x97, 0xb4, 0x68,
-       0x35, 0x95, 0xc9, 0xfb, 0xf0, 0x7d, 0x83, 0x6e, 0x0f, 0x74, 0x2e, 0x7c,
-       0x86, 0xf8, 0xfe, 0x66, 0xc4, 0x5e, 0xf4, 0x40, 0x67, 0x93, 0xe0, 0x55,
-       0x88, 0xf5, 0xc4, 0xe0, 0x14, 0xec, 0x03, 0x64, 0x55, 0x63, 0x7b, 0x3b,
-       0xf0, 0xd0, 0x36, 0xd8, 0x9c, 0x30, 0xd8, 0xdc, 0x0e, 0x5c, 0x66, 0xd9,
-       0x31, 0xe5, 0xa4, 0x29, 0xa7, 0x50, 0x86, 0x1d, 0x9f, 0x25, 0x2e, 0x5f,
-       0x77, 0x70, 0xef, 0x51, 0x8d, 0xf7, 0xb4, 0x15, 0x40, 0x61, 0xe2, 0x35,
-       0x71, 0xbb, 0x47, 0xe6, 0x6b, 0x58, 0xaf, 0x81, 0x8d, 0xdc, 0x7b, 0x94,
-       0x1e, 0xd2, 0xb2, 0x5e, 0x14, 0x6c, 0x57, 0x3e, 0x49, 0x7a, 0x1f, 0xc4,
-       0xde, 0x89, 0x3f, 0xa4, 0xfb, 0x2a, 0xd0, 0xca, 0x7d, 0xfc, 0x3c, 0x69,
-       0xe5, 0x7a, 0xcd, 0xf4, 0x7e, 0x58, 0x1c, 0x24, 0xed, 0x27, 0xb1, 0xe7,
-       0x3c, 0x30, 0x4f, 0xac, 0xd1, 0xbe, 0x51, 0xec, 0x79, 0x04, 0x78, 0x78,
-       0x3b, 0xf0, 0x70, 0x37, 0xf0, 0x70, 0x18, 0x78, 0x98, 0x03, 0x16, 0x0e,
-       0x01, 0x0b, 0x07, 0x81, 0x85, 0x59, 0xf0, 0x26, 0x29, 0x73, 0xc0, 0xc6,
-       0x39, 0x60, 0xe4, 0x1c, 0xe6, 0x18, 0x9f, 0x15, 0xeb, 0x4b, 0xd8, 0xc3,
-       0x63, 0x33, 0x99, 0x93, 0x90, 0xa5, 0x54, 0x45, 0x41, 0xfe, 0xb3, 0x43,
-       0x90, 0xed, 0x7e, 0xa9, 0xfa, 0xb6, 0x94, 0x69, 0x53, 0xb7, 0xf7, 0x42,
-       0xd7, 0x20, 0xef, 0x29, 0x31, 0x7f, 0x1b, 0xcc, 0xf3, 0x1f, 0x45, 0xdc,
-       0xbf, 0xa3, 0x2c, 0xa6, 0x45, 0xce, 0x48, 0xc9, 0xeb, 0x75, 0x0a, 0xaa,
-       0x1f, 0xfd, 0x58, 0xce, 0xaa, 0xfb, 0x8f, 0x5c, 0xaf, 0xf6, 0x1e, 0x21,
-       0x5f, 0xa6, 0x81, 0x57, 0x75, 0x99, 0xcc, 0x52, 0xb7, 0xea, 0x72, 0x22,
-       0x9b, 0x19, 0xaa, 0x48, 0x9b, 0x4c, 0x25, 0xa7, 0xb5, 0xad, 0xb5, 0x73,
-       0x87, 0xb5, 0xbd, 0x2a, 0xbb, 0x78, 0xd6, 0x06, 0x54, 0xe9, 0x08, 0xf7,
-       0xdf, 0x8b, 0x5f, 0x1c, 0xb4, 0x70, 0x7e, 0x5b, 0x86, 0x07, 0x1d, 0xf5,
-       0x40, 0x5f, 0x05, 0x08, 0x96, 0x71, 0xce, 0x62, 0xe5, 0xe2, 0x74, 0x6f,
-       0xaa, 0xa8, 0x6c, 0x19, 0xb3, 0x2d, 0x19, 0x87, 0x7c, 0x0f, 0x67, 0xdf,
-       0xa9, 0x4f, 0x25, 0xd9, 0xbe, 0x4e, 0xbe, 0xae, 0x7d, 0x0e, 0xac, 0x5d,
-       0x3d, 0x8a, 0x75, 0xe3, 0x38, 0x03, 0xae, 0xcb, 0x79, 0x50, 0xae, 0xd9,
-       0x28, 0x67, 0x4e, 0x56, 0xc4, 0x87, 0x9e, 0x6c, 0x94, 0xc2, 0xce, 0x16,
-       0xc9, 0x8f, 0xa4, 0x65, 0x7c, 0xc6, 0x07, 0x4e, 0xe1, 0x1c, 0xdd, 0x56,
-       0x29, 0x8d, 0xa6, 0xe5, 0xd1, 0x19, 0xd6, 0x9d, 0xc6, 0xfe, 0x33, 0x87,
-       0xf2, 0xc2, 0xfd, 0xc7, 0xf5, 0xbe, 0xd2, 0xea, 0xb4, 0xec, 0xf7, 0xde,
-       0x30, 0x7a, 0x14, 0x94, 0xef, 0xc7, 0x99, 0x9e, 0xf0, 0x17, 0xb0, 0x7f,
-       0x57, 0xe6, 0x81, 0xff, 0xc5, 0x23, 0xc0, 0x41, 0xb7, 0x03, 0x98, 0x95,
-       0x59, 0xa0, 0x4d, 0x8d, 0xc1, 0xef, 0xab, 0x6a, 0x5e, 0xf7, 0xc8, 0x91,
-       0x19, 0x25, 0xdf, 0xbe, 0x31, 0x8d, 0x32, 0xb0, 0x31, 0x9b, 0x39, 0x3d,
-       0xa6, 0x7a, 0xe4, 0x86, 0xce, 0x14, 0xc6, 0xe5, 0x54, 0xc9, 0xdb, 0x18,
-       0x03, 0x2f, 0x8f, 0xa7, 0x15, 0xfb, 0x2a, 0x29, 0x66, 0x63, 0x38, 0xff,
-       0x0a, 0xfa, 0xbf, 0x8f, 0xf5, 0x7a, 0x64, 0x16, 0xbe, 0xd6, 0xec, 0x4c,
-       0x1e, 0xe3, 0x88, 0x5d, 0x99, 0xe3, 0x4b, 0x0a, 0x18, 0x33, 0x0b, 0xf9,
-       0x1e, 0x85, 0x2f, 0x33, 0x03, 0xd1, 0x69, 0x4d, 0xe3, 0x4c, 0x7b, 0x9d,
-       0x71, 0xe0, 0x41, 0xbe, 0x87, 0xef, 0x9c, 0xd3, 0x95, 0x13, 0x1e, 0xe5,
-       0x30, 0x2d, 0x4f, 0xf9, 0x1c, 0xd7, 0xbb, 0xf0, 0x1c, 0x7c, 0x9f, 0xdf,
-       0xf5, 0xae, 0x44, 0xff, 0x77, 0xe1, 0x07, 0x3b, 0x52, 0xc5, 0xb9, 0x95,
-       0xc1, 0xcb, 0x7c, 0x2a, 0x28, 0x8f, 0xcf, 0x66, 0x16, 0xde, 0x50, 0x7c,
-       0x77, 0x2b, 0xf3, 0xea, 0x5a, 0x91, 0x4e, 0xf2, 0x33, 0x0b, 0x5e, 0xba,
-       0x8e, 0x52, 0xdb, 0x8d, 0xef, 0x47, 0x3d, 0x72, 0x41, 0x9f, 0x2d, 0xf3,
-       0x03, 0x51, 0x3d, 0xa2, 0x3d, 0x0c, 0xf5, 0x28, 0x93, 0x5a, 0x52, 0x0a,
-       0xed, 0xb6, 0x1c, 0xd6, 0x65, 0x0b, 0xb4, 0x66, 0x52, 0xdc, 0xdf, 0x44,
-       0xad, 0x5f, 0x9e, 0xf2, 0xd8, 0x1f, 0x7c, 0x9e, 0x6e, 0x37, 0xfd, 0x4f,
-       0x83, 0x87, 0xf4, 0xdf, 0xfa, 0x41, 0x73, 0xa0, 0x5b, 0xf3, 0xd3, 0x49,
-       0xdd, 0x36, 0xe5, 0x05, 0x7e, 0x9a, 0x82, 0x2f, 0x37, 0x07, 0x5f, 0xae,
-       0xa8, 0xf5, 0xcc, 0xc9, 0xc3, 0xd7, 0x87, 0x9e, 0x04, 0x3a, 0x56, 0xad,
-       0x91, 0x96, 0xbb, 0x40, 0x5f, 0xa6, 0x02, 0x62, 0x0e, 0xab, 0x1c, 0xce,
-       0x7d, 0x50, 0x2a, 0xf4, 0xf7, 0xce, 0xc6, 0x9e, 0x92, 0xb1, 0x2a, 0xed,
-       0x11, 0x7e, 0x9e, 0xeb, 0x30, 0xbe, 0xc8, 0x6b, 0x5b, 0xd1, 0x0d, 0x39,
-       0x80, 0x1d, 0xc9, 0x6e, 0x32, 0x7e, 0xce, 0x13, 0x38, 0xcf, 0x33, 0x38,
-       0xf7, 0x9a, 0xec, 0x3d, 0xf6, 0x0a, 0x65, 0xba, 0xbf, 0x2a, 0x99, 0xfe,
-       0x29, 0xd9, 0xe1, 0xcc, 0x43, 0x1f, 0xf3, 0xa3, 0xf5, 0x5b, 0x54, 0x8e,
-       0x63, 0x0e, 0x62, 0x0c, 0x9e, 0xd5, 0x57, 0xe4, 0x21, 0x9f, 0x75, 0x0f,
-       0x81, 0x9f, 0xd0, 0x95, 0xc1, 0x27, 0x8c, 0x1e, 0x60, 0x3e, 0x3b, 0x9c,
-       0xef, 0x15, 0x33, 0x1f, 0xfb, 0xb1, 0x0f, 0xc7, 0x2c, 0xcf, 0xbb, 0x8b,
-       0xb6, 0x08, 0x78, 0xb4, 0x4b, 0xd5, 0x6f, 0x89, 0xa3, 0xfd, 0xc4, 0x20,
-       0xdf, 0x31, 0x0f, 0x6c, 0x91, 0xe3, 0x9e, 0x41, 0x5f, 0xf8, 0x7a, 0xde,
-       0x7a, 0x29, 0x74, 0x85, 0xf4, 0x52, 0x06, 0xe8, 0x27, 0x68, 0x1b, 0xbc,
-       0x39, 0xe0, 0xfd, 0x1f, 0xc6, 0x02, 0x99, 0x3c, 0x80, 0x32, 0xf5, 0xef,
-       0x80, 0x14, 0xbd, 0x0c, 0xf6, 0x09, 0x1d, 0xf3, 0x3b, 0xac, 0x60, 0x8f,
-       0xe0, 0xff, 0xc8, 0x39, 0xf0, 0x41, 0x2a, 0x01, 0x6f, 0xc8, 0x17, 0xf2,
-       0xa4, 0x03, 0xb2, 0x0f, 0xb9, 0x87, 0xdc, 0x96, 0x34, 0x0f, 0xfe, 0xbd,
-       0x33, 0xf0, 0x8b, 0x33, 0x95, 0x3c, 0xe3, 0xb9, 0x4e, 0xe2, 0x26, 0x30,
-       0xcc, 0x87, 0x70, 0x60, 0xee, 0x25, 0xb5, 0x9e, 0xf4, 0xa6, 0x97, 0x62,
-       0x7d, 0x2c, 0xf7, 0x2f, 0x41, 0x86, 0xab, 0x38, 0x9f, 0xc2, 0xce, 0x5e,
-       0x83, 0x5b, 0xcf, 0xc6, 0x28, 0xaf, 0x55, 0x60, 0x4c, 0xc9, 0xdb, 0xe1,
-       0xdc, 0x4d, 0xbe, 0x39, 0x8e, 0x3c, 0xe7, 0x45, 0xb1, 0x03, 0xb6, 0xcf,
-       0xa5, 0x1c, 0x26, 0x21, 0x07, 0x36, 0x6c, 0x68, 0x0a, 0x67, 0xfe, 0x6f,
-       0x9d, 0xc1, 0x5e, 0xf8, 0x6e, 0xcb, 0x9c, 0x83, 0x35, 0xbd, 0xc5, 0x8d,
-       0x41, 0x1d, 0xdf, 0xb7, 0xf0, 0x8c, 0x0e, 0xaf, 0xa4, 0x9d, 0xe7, 0xdb,
-       0x7c, 0xa6, 0x27, 0xb0, 0x17, 0xd6, 0xe3, 0x59, 0x3d, 0x2e, 0x7b, 0x89,
-       0x9b, 0x83, 0xdb, 0x52, 0x2f, 0xa2, 0x7f, 0x11, 0x36, 0xa1, 0x62, 0xb3,
-       0xed, 0x6d, 0x6b, 0x79, 0x8c, 0xa2, 0x5f, 0x0a, 0x1f, 0x78, 0xc9, 0xfa,
-       0x92, 0xff, 0x92, 0x55, 0xa8, 0xbe, 0x6d, 0x15, 0x21, 0x27, 0x55, 0x8f,
-       0xf1, 0x0b, 0xf5, 0xc7, 0xc1, 0xda, 0x99, 0xd4, 0x5b, 0xaa, 0x37, 0x3d,
-       0x0f, 0x2c, 0xb8, 0x1f, 0x3a, 0x5d, 0xb4, 0x17, 0xa4, 0xec, 0xd7, 0xa4,
-       0x74, 0x6c, 0x07, 0xf4, 0x2d, 0x1d, 0xa1, 0x8b, 0x78, 0x56, 0xa1, 0x1f,
-       0x6e, 0xed, 0xf2, 0xa4, 0xd2, 0x92, 0x23, 0xae, 0x6d, 0x83, 0xec, 0xa0,
-       0xae, 0xb6, 0x2c, 0x7f, 0xb7, 0xad, 0xa2, 0x15, 0xb1, 0xee, 0xe0, 0x4a,
-       0x7a, 0xab, 0x72, 0x71, 0x7a, 0x77, 0x35, 0xe8, 0x25, 0x66, 0x00, 0xff,
-       0x3d, 0xe0, 0xbf, 0x07, 0xfc, 0xf7, 0x80, 0xff, 0x1e, 0xf0, 0xdf, 0x83,
-       0x6d, 0xf0, 0x60, 0x03, 0x3c, 0xd8, 0x00, 0x0f, 0x36, 0xc0, 0x83, 0x0d,
-       0xf0, 0x0a, 0x38, 0x27, 0xe2, 0x3c, 0x6d, 0xc8, 0x3d, 0x0d, 0xbb, 0x19,
-       0xf8, 0x39, 0x57, 0x1a, 0xdf, 0x01, 0xfa, 0xe7, 0x6c, 0x91, 0xf1, 0xfe,
-       0x2b, 0xb0, 0xb7, 0x56, 0x3c, 0xdb, 0xf0, 0xc4, 0x1a, 0xfd, 0x9f, 0x35,
-       0x7a, 0xf2, 0x55, 0xd0, 0xa5, 0x50, 0xfe, 0x05, 0xc8, 0x61, 0x0b, 0xe8,
-       0xf9, 0x94, 0xf1, 0x31, 0xbe, 0x61, 0x07, 0x72, 0xd8, 0x86, 0xba, 0xcf,
-       0xa0, 0xae, 0x0d, 0x7d, 0xf6, 0xa3, 0x0f, 0x7d, 0x94, 0x0e, 0x53, 0x17,
-       0xed, 0x47, 0x5f, 0xe5, 0x0b, 0x58, 0x2b, 0x83, 0x7e, 0x1d, 0x98, 0xbb,
-       0x07, 0x7d, 0x6e, 0x46, 0x9f, 0xab, 0x50, 0xa6, 0x6f, 0xdb, 0x8d, 0xf2,
-       0xa7, 0x9b, 0xc6, 0x5c, 0x83, 0xba, 0xcf, 0x36, 0xd5, 0x9d, 0x45, 0x1d,
-       0x62, 0x62, 0xe7, 0x45, 0x33, 0xae, 0x82, 0x72, 0x57, 0x53, 0x9f, 0x57,
-       0x50, 0x37, 0x84, 0xba, 0xbf, 0xc2, 0x13, 0xb1, 0xb0, 0x43, 0x9a, 0xc2,
-       0x36, 0xfa, 0xa9, 0x69, 0xd4, 0xc7, 0x8d, 0xaf, 0xf9, 0x24, 0x7d, 0x2f,
-       0xd8, 0xdc, 0x3f, 0xb6, 0x03, 0xdf, 0x0c, 0xde, 0xab, 0x96, 0xc3, 0xb0,
-       0xfc, 0xcd, 0xa6, 0x32, 0xfb, 0x7e, 0xbf, 0xa9, 0xae, 0x6d, 0xd3, 0xca,
-       0xf2, 0x4f, 0xe3, 0xab, 0xc7, 0xdc, 0xdb, 0xd4, 0xe7, 0xeb, 0x9d, 0x2b,
-       0xcb, 0xbb, 0x5b, 0x56, 0x8f, 0xd9, 0xbe, 0x71, 0x65, 0xdd, 0xad, 0x9b,
-       0x57, 0x96, 0xe9, 0x03, 0x26, 0x11, 0xc3, 0x84, 0xfd, 0x77, 0x7e, 0x22,
-       0x68, 0x27, 0x7f, 0x9b, 0x65, 0x49, 0x2b, 0x23, 0xca, 0x0a, 0xe7, 0xb0,
-       0x64, 0x41, 0x9f, 0x1c, 0x95, 0x7b, 0xc9, 0x2a, 0x42, 0xa6, 0x0a, 0x7e,
-       0x38, 0x1f, 0x75, 0xb6, 0x39, 0x4f, 0x10, 0xe6, 0x07, 0xe8, 0x6f, 0xb5,
-       0x43, 0x6e, 0xee, 0xa2, 0x4d, 0x3a, 0x54, 0x91, 0x65, 0xfd, 0xdc, 0xaa,
-       0xce, 0xa7, 0x9f, 0xf7, 0x19, 0x8c, 0x3a, 0x07, 0x3a, 0xeb, 0x32, 0x92,
-       0x5d, 0x47, 0x1b, 0x63, 0xb0, 0x8b, 0xb8, 0x53, 0xaf, 0xc7, 0xb6, 0xd7,
-       0x65, 0x5f, 0xf6, 0xdd, 0xba, 0x68, 0xcc, 0xbb, 0x57, 0xe3, 0x4e, 0x5a,
-       0x75, 0xe3, 0x8c, 0x1c, 0xc4, 0x12, 0x88, 0xed, 0x93, 0xb4, 0x49, 0xc7,
-       0xe9, 0x9f, 0x1c, 0x0c, 0x30, 0x95, 0xb8, 0x83, 0xb2, 0x3f, 0x85, 0x39,
-       0xb9, 0x3e, 0x9e, 0x55, 0xe2, 0xb8, 0xad, 0x6d, 0x4a, 0xc9, 0xe1, 0xbc,
-       0x6b, 0x61, 0xe3, 0xbf, 0xd8, 0xf4, 0x0b, 0x6d, 0xf7, 0x24, 0xec, 0x1b,
-       0xdb, 0xe8, 0x2b, 0x9c, 0xa4, 0x5f, 0x12, 0xc1, 0xaa, 0x9b, 0x62, 0xe2,
-       0x2e, 0x63, 0x66, 0xb0, 0xaf, 0x2d, 0xf4, 0xfb, 0x2f, 0x61, 0xaf, 0x6b,
-       0x63, 0x51, 0xaf, 0xba, 0xb8, 0x6e, 0xef, 0x69, 0xe8, 0x76, 0x28, 0x7b,
-       0x6b, 0xe5, 0x03, 0x5e, 0xd5, 0x67, 0xf1, 0xac, 0x9f, 0x39, 0x5c, 0x81,
-       0x2e, 0x2d, 0xea, 0xd8, 0x37, 0x3c, 0x17, 0xfa, 0x38, 0x99, 0xe3, 0x73,
-       0x90, 0xed, 0xbd, 0x3a, 0x26, 0x60, 0x3c, 0x50, 0x97, 0x5d, 0xd9, 0x4f,
-       0x25, 0xc9, 0x87, 0xbc, 0xfa, 0x71, 0x9c, 0x3e, 0xc3, 0xa2, 0x47, 0x9e,
-       0x65, 0xd1, 0x9e, 0x05, 0x26, 0xfc, 0xab, 0x14, 0x93, 0xac, 0x7b, 0xab,
-       0x3e, 0x0f, 0xbf, 0x4a, 0xfb, 0x47, 0xda, 0xde, 0xd3, 0xbf, 0x83, 0x5d,
-       0xf7, 0xc9, 0xd3, 0x25, 0xf0, 0x39, 0xf4, 0x01, 0x7e, 0x40, 0x1f, 0x55,
-       0x56, 0xfa, 0xd2, 0x22, 0x0f, 0xd5, 0xfe, 0x01, 0x36, 0x47, 0x05, 0xbe,
-       0x0a, 0xe3, 0x65, 0x97, 0xf5, 0x37, 0xc6, 0xe9, 0xcb, 0x05, 0xb6, 0x3e,
-       0x86, 0xf5, 0x10, 0x5f, 0xd7, 0xfe, 0xd3, 0x2a, 0x79, 0x3d, 0xf4, 0xb3,
-       0xb0, 0x7f, 0xf8, 0x50, 0x3e, 0xdb, 0x58, 0x97, 0x30, 0xfe, 0x77, 0xbb,
-       0xf1, 0xb7, 0x1d, 0xe3, 0x6f, 0x6b, 0x3a, 0x12, 0x4e, 0x2e, 0xf4, 0x0b,
-       0x78, 0x66, 0xe9, 0x83, 0x6a, 0x3b, 0xfd, 0x82, 0x0e, 0x59, 0xdb, 0x2f,
-       0x08, 0x69, 0x3a, 0x85, 0x7d, 0xd2, 0xcf, 0xd3, 0x79, 0xa0, 0xce, 0x20,
-       0xf7, 0x44, 0x1a, 0x42, 0xfb, 0xa8, 0xed, 0xf0, 0x21, 0x98, 0x3c, 0xe6,
-       0x24, 0x41, 0xeb, 0x6e, 0x29, 0x4c, 0x9f, 0x32, 0xf6, 0x96, 0x71, 0x04,
-       0x7d, 0xf8, 0x40, 0x66, 0x0b, 0xd9, 0x0e, 0xcb, 0xcc, 0xd3, 0x05, 0x0b,
-       0x19, 0xc9, 0x51, 0x71, 0x2d, 0xfa, 0x31, 0xa1, 0x4f, 0xb3, 0x60, 0x7c,
-       0x9a, 0x33, 0xb2, 0xcf, 0x0b, 0xe2, 0x86, 0x91, 0xda, 0x12, 0xea, 0x34,
-       0xed, 0x29, 0xfa, 0x96, 0x0a, 0x3e, 0x77, 0xfe, 0xde, 0x0c, 0x02, 0x90,
-       0x60, 0x2f, 0x5b, 0xb1, 0x97, 0x6a, 0x63, 0x2f, 0x6d, 0x4b, 0xcd, 0x3e,
-       0x0e, 0xc7, 0x4e, 0xae, 0x1a, 0x2b, 0xd8, 0xc7, 0xdc, 0x79, 0xda, 0xb8,
-       0x47, 0xfa, 0x0d, 0x8e, 0xd9, 0x63, 0x78, 0x4e, 0x8f, 0x63, 0x8f, 0x49,
-       0xab, 0xa4, 0x7d, 0x2d, 0xfa, 0x2d, 0x88, 0xb3, 0x6b, 0x2f, 0xe1, 0x49,
-       0xfd, 0xd0, 0xf3, 0x60, 0x4f, 0xed, 0x7a, 0x4f, 0x53, 0xde, 0x2b, 0x7a,
-       0x1f, 0xf3, 0xb5, 0xbf, 0x91, 0xf2, 0xb1, 0x1f, 0xc0, 0xee, 0x45, 0x73,
-       0x73, 0xcc, 0x6b, 0x92, 0x1f, 0x95, 0x08, 0x7e, 0x72, 0xaf, 0xcc, 0xbb,
-       0xbd, 0x1c, 0x0f, 0xe2, 0x83, 0x69, 0x9c, 0xb1, 0x15, 0xb4, 0xeb, 0xf5,
-       0x43, 0xbe, 0xb6, 0x44, 0xe8, 0xa9, 0xc3, 0xe7, 0x4c, 0x81, 0x86, 0xe8,
-       0x98, 0x03, 0x32, 0xec, 0xf1, 0x3c, 0x7a, 0x53, 0x7b, 0xc5, 0x75, 0x4a,
-       0x12, 0xfa, 0x19, 0x5c, 0x9f, 0x3a, 0x5f, 0x84, 0xe3, 0xcb, 0x5c, 0x6a,
-       0xc8, 0xbb, 0x90, 0x6f, 0xed, 0x4b, 0xcd, 0x32, 0x30, 0x89, 0x58, 0xab,
-       0xec, 0x91, 0x4f, 0xa1, 0x6c, 0x86, 0x6b, 0xbf, 0x6a, 0x71, 0x3f, 0x13,
-       0x3a, 0x7f, 0xf8, 0x4f, 0x0d, 0x19, 0x1d, 0x07, 0x76, 0x04, 0x32, 0xf7,
-       0xf7, 0x86, 0x37, 0xa1, 0x6c, 0xb6, 0x9b, 0x73, 0x66, 0x2c, 0x48, 0xdd,
-       0x09, 0xe5, 0x60, 0x9b, 0x73, 0xa7, 0xe6, 0x05, 0xdb, 0xb4, 0xcf, 0xad,
-       0xcf, 0x72, 0xac, 0x71, 0x96, 0x1b, 0x9a, 0xe4, 0xf2, 0xdd, 0x8d, 0x81,
-       0x1e, 0x52, 0xdf, 0xa0, 0xb7, 0xe0, 0xd7, 0xb3, 0x2b, 0xf4, 0xbb, 0xff,
-       0x3c, 0x39, 0xd9, 0x76, 0x89, 0xcd, 0x7e, 0x0f, 0xbc, 0xbc, 0x06, 0xb1,
-       0x8a, 0x88, 0x3d, 0x43, 0x1c, 0xa2, 0xbf, 0xb1, 0xec, 0xef, 0xce, 0xcb,
-       0x5a, 0xbe, 0xee, 0xc5, 0x7c, 0x8d, 0x4f, 0x5e, 0xa2, 0xaf, 0x31, 0xdc,
-       0x22, 0xad, 0xc4, 0xa2, 0x33, 0xf0, 0x6d, 0x2d, 0x69, 0x71, 0xbf, 0x01,
-       0x1b, 0x76, 0xda, 0x5e, 0xe7, 0x86, 0x98, 0xd0, 0x2e, 0x9b, 0x66, 0xb7,
-       0x68, 0x5c, 0x70, 0x66, 0x96, 0x71, 0x61, 0x1c, 0xbc, 0x1f, 0x09, 0xf2,
-       0xbc, 0xc9, 0x4d, 0x72, 0xa9, 0xf1, 0xf5, 0xb2, 0xdf, 0x3f, 0xd6, 0xf0,
-       0xfb, 0xaf, 0x6c, 0xe2, 0xe3, 0x5a, 0xb8, 0x78, 0x1a, 0x7c, 0xcb, 0x21,
-       0xfe, 0x65, 0x5c, 0x3b, 0x8c, 0x78, 0x98, 0xb1, 0x58, 0x1e, 0x31, 0x71,
-       0xe6, 0xb4, 0xc8, 0x6e, 0xc4, 0xc8, 0x99, 0x1f, 0x31, 0x7f, 0xf5, 0xbc,
-       0x9f, 0x99, 0x13, 0xb9, 0x1d, 0x7c, 0x1d, 0x04, 0x6e, 0x66, 0x81, 0xa3,
-       0x3b, 0xc1, 0xdf, 0x7e, 0x8d, 0x9d, 0xf7, 0x1f, 0x11, 0xeb, 0x0e, 0x9d,
-       0xab, 0xa6, 0x3e, 0x27, 0x61, 0x47, 0xeb, 0xf5, 0xfd, 0xd9, 0x5e, 0xc4,
-       0xf5, 0x69, 0xb9, 0xd5, 0x66, 0x1c, 0x6b, 0xd9, 0x5b, 0x07, 0xe6, 0x63,
-       0x51, 0x9f, 0xb4, 0x70, 0x51, 0x3b, 0xb0, 0x9a, 0xf7, 0x45, 0x6d, 0x0b,
-       0x0e, 0xc7, 0x2e, 0xc4, 0xfb, 0x3b, 0x1a, 0xbc, 0x6f, 0x69, 0x95, 0xd6,
-       0xdb, 0x75, 0x1e, 0x61, 0xeb, 0xc0, 0x7e, 0xe2, 0x55, 0x16, 0x76, 0x1d,
-       0xf6, 0xb7, 0x2e, 0xb7, 0x65, 0xdf, 0xae, 0xbf, 0xe8, 0x6e, 0x94, 0xd2,
-       0xce, 0xfb, 0x0c, 0x66, 0x2f, 0x7d, 0xad, 0xe0, 0x56, 0xa0, 0x1f, 0x41,
-       0xce, 0x70, 0xef, 0x74, 0x02, 0x96, 0x80, 0x7f, 0x9d, 0x32, 0x3f, 0xf4,
-       0x16, 0xce, 0x70, 0xc7, 0x49, 0x26, 0x9c, 0x14, 0x70, 0x78, 0x3e, 0xd9,
-       0xae, 0xf3, 0xc5, 0x9f, 0x70, 0x59, 0xef, 0xe0, 0x4c, 0x47, 0x65, 0x1e,
-       0xfe, 0x43, 0x75, 0x08, 0x34, 0xee, 0xec, 0x42, 0x7f, 0xea, 0x1d, 0x79,
-       0x3e, 0x0a, 0xdb, 0x4b, 0x9e, 0x26, 0xd1, 0x7f, 0x0f, 0xfa, 0x74, 0xe2,
-       0x79, 0x5f, 0x6c, 0xde, 0x61, 0xec, 0xfc, 0x79, 0x94, 0x39, 0x47, 0xd4,
-       0x76, 0x7e, 0x2e, 0x2e, 0x7a, 0x4e, 0x8e, 0xe9, 0xd2, 0xfa, 0xbf, 0xbc,
-       0x16, 0xd7, 0x61, 0xdb, 0xcf, 0xea, 0xd7, 0x0f, 0x0c, 0x45, 0xd6, 0xeb,
-       0x88, 0xac, 0x37, 0x14, 0x59, 0x8f, 0x74, 0x76, 0x46, 0xe8, 0xec, 0xc4,
-       0xf8, 0x22, 0xd6, 0x26, 0x3f, 0xa2, 0x6b, 0x3e, 0x18, 0x59, 0x33, 0xdc,
-       0x5f, 0x57, 0x64, 0xdc, 0xbb, 0x58, 0x8f, 0x75, 0xc9, 0x48, 0x1d, 0x69,
-       0xd8, 0x8c, 0x3a, 0x96, 0x3b, 0x23, 0x74, 0x91, 0xd6, 0x0d, 0xa8, 0xd7,
-       0xfe, 0x13, 0xf8, 0xdc, 0x0a, 0xbb, 0xa5, 0x60, 0x3b, 0x5a, 0xe0, 0x5f,
-       0x35, 0xef, 0xf5, 0x51, 0xac, 0x1b, 0xce, 0x97, 0xc4, 0x1c, 0xec, 0xcf,
-       0xbe, 0x31, 0x33, 0x9e, 0xf5, 0x6c, 0xff, 0xf3, 0xfa, 0x9f, 0x6a, 0xbe,
-       0x6d, 0x06, 0xed, 0x3a, 0xef, 0x22, 0x73, 0x9d, 0x36, 0xce, 0x93, 0xf1,
-       0xb1, 0x25, 0x57, 0xbb, 0xca, 0xea, 0x1d, 0xe0, 0xd9, 0x6f, 0x34, 0x58,
-       0xda, 0x6a, 0x15, 0x8e, 0x30, 0x5f, 0xd0, 0x66, 0x62, 0x3e, 0xc4, 0x1e,
-       0xda, 0xc6, 0xd8, 0xa6, 0x9d, 0x36, 0x86, 0x7e, 0x0b, 0xed, 0xe7, 0x69,
-       0xf3, 0x8e, 0x27, 0x64, 0xf8, 0x81, 0x6a, 0xa7, 0xbc, 0xa8, 0x79, 0xea,
-       0xc8, 0xd9, 0x06, 0x4f, 0xe3, 0xe6, 0xbb, 0xcc, 0x01, 0xf3, 0xcd, 0xa3,
-       0x0f, 0x7e, 0x11, 0xde, 0x6b, 0x79, 0xd0, 0x90, 0x96, 0xde, 0x01, 0xc6,
-       0x6e, 0x15, 0x3c, 0x99, 0xa7, 0xb0, 0xf0, 0x0c, 0xf2, 0x17, 0xbd, 0x03,
-       0xb0, 0x4b, 0xc0, 0xa1, 0xde, 0x81, 0x73, 0x3a, 0x9e, 0xab, 0xfa, 0x8e,
-       0x75, 0x9b, 0x17, 0xe4, 0x88, 0xce, 0xba, 0x17, 0xca, 0x11, 0xdd, 0xb3,
-       0x8e, 0x79, 0x8d, 0x30, 0x47, 0x74, 0x56, 0x74, 0x8e, 0xe8, 0xf8, 0x45,
-       0x72, 0x44, 0xf9, 0x4b, 0xcf, 0x11, 0x71, 0x7e, 0x5b, 0xee, 0x1c, 0x74,
-       0xd4, 0xaf, 0x9a, 0x1c, 0xd1, 0x1b, 0x12, 0xe4, 0x88, 0x5e, 0x94, 0xb5,
-       0x73, 0x44, 0x87, 0x9a, 0x72, 0x44, 0x9b, 0x75, 0x8e, 0x88, 0xf3, 0x04,
-       0x39, 0x22, 0x96, 0x4b, 0x03, 0x43, 0x91, 0x5c, 0x07, 0xf0, 0xd7, 0xbb,
-       0x01, 0x7c, 0x73, 0xac, 0x51, 0x2f, 0xc4, 0x34, 0x62, 0xff, 0x15, 0x0d,
-       0xfb, 0xb5, 0x8c, 0x6f, 0x96, 0x96, 0xb9, 0x8b, 0xe1, 0xdb, 0x68, 0xe0,
-       0x97, 0xac, 0xc0, 0xb6, 0xc9, 0x86, 0xef, 0xe2, 0xad, 0x63, 0x0c, 0x3d,
-       0x51, 0x5b, 0x9e, 0x77, 0x02, 0xbc, 0x1e, 0x6b, 0xe4, 0x49, 0xce, 0xe7,
-       0x1f, 0x25, 0xe5, 0xc0, 0x9a, 0xdf, 0xbd, 0x52, 0xf9, 0xd5, 0xdf, 0xbd,
-       0x2c, 0x49, 0x82, 0xce, 0xd2, 0x40, 0x49, 0xc7, 0x5d, 0xf3, 0xde, 0xaf,
-       0xc8, 0xd2, 0xdd, 0x0e, 0xf0, 0x27, 0xcc, 0x9f, 0xf0, 0x7c, 0x97, 0x6d,
-       0x4a, 0x41, 0x7d, 0x7c, 0x39, 0x94, 0x07, 0x74, 0x0e, 0xe5, 0xc5, 0x75,
-       0xd1, 0x1c, 0xca, 0x59, 0xb9, 0x70, 0x0e, 0xe5, 0x81, 0x35, 0x72, 0x28,
-       0x2f, 0xcb, 0x72, 0x0e, 0xe5, 0x65, 0x09, 0x73, 0x28, 0x31, 0x59, 0xda,
-       0x1c, 0x48, 0xe3, 0x03, 0xfe, 0x12, 0x7e, 0x67, 0xf0, 0x0b, 0x72, 0x2a,
-       0x67, 0x1b, 0xf4, 0xaf, 0x95, 0x53, 0x79, 0x7d, 0xdd, 0x07, 0xc9, 0xa9,
-       0x04, 0x36, 0x20, 0xcc, 0xa9, 0xe0, 0xe7, 0xc0, 0xe6, 0xa8, 0x68, 0x4e,
-       0xe5, 0x27, 0xd4, 0x07, 0xd4, 0xb1, 0xcc, 0x7a, 0xe8, 0x05, 0xec, 0x52,
-       0x5e, 0xe7, 0x38, 0x3e, 0x67, 0x78, 0x38, 0x87, 0x3d, 0xa7, 0x71, 0x16,
-       0xe4, 0x63, 0xaf, 0xf6, 0x2d, 0xf3, 0x76, 0xca, 0x2a, 0xf4, 0xc1, 0x9a,
-       0x4d, 0xf3, 0xbb, 0xb8, 0x6d, 0xed, 0xf5, 0x29, 0xe3, 0x09, 0xab, 0x8c,
-       0xbd, 0x0c, 0x4f, 0xcf, 0xc9, 0x5e, 0x3f, 0xf4, 0xa9, 0x06, 0x1a, 0x73,
-       0x50, 0x37, 0xe7, 0x81, 0xb3, 0xc0, 0x89, 0x4b, 0xb0, 0x51, 0xa7, 0x40,
-       0x73, 0x74, 0x1f, 0x88, 0x89, 0x07, 0x51, 0xa7, 0xcf, 0x9c, 0xbe, 0x65,
-       0x48, 0x4b, 0x9a, 0x7a, 0x7e, 0x09, 0xf3, 0xb1, 0xee, 0x94, 0x8e, 0xc7,
-       0xca, 0x83, 0xdc, 0x2b, 0x6d, 0xdd, 0x22, 0xe8, 0x43, 0x5d, 0x95, 0x31,
-       0x20, 0xed, 0x5e, 0x18, 0xa3, 0xb5, 0xeb, 0x18, 0xad, 0x4b, 0xf3, 0x83,
-       0xbc, 0xbe, 0x35, 0x41, 0xac, 0xec, 0x72, 0xb9, 0x87, 0x33, 0x06, 0xeb,
-       0x58, 0x0e, 0x62, 0xc1, 0xbc, 0xe2, 0xfb, 0xef, 0xe1, 0x5c, 0x99, 0xa7,
-       0x09, 0xcf, 0xef, 0x2b, 0x66, 0xdf, 0x43, 0x52, 0xe9, 0x92, 0xc4, 0x66,
-       0xd0, 0x53, 0x9a, 0xa1, 0xdf, 0xfd, 0x69, 0x1d, 0x83, 0x24, 0xdd, 0xf3,
-       0xeb, 0xed, 0x1d, 0x97, 0xa1, 0xb7, 0x23, 0x17, 0xd4, 0xdb, 0xaf, 0x25,
-       0xa2, 0x7a, 0x7b, 0xc7, 0x65, 0xe8, 0xed, 0xbe, 0xcb, 0xd2, 0x5b, 0xee,
-       0x8d, 0x98, 0x14, 0xe6, 0xc4, 0x56, 0xfb, 0x59, 0xe1, 0xba, 0xe3, 0x58,
-       0x33, 0x7f, 0x9e, 0x35, 0xc7, 0xce, 0x9b, 0x5b, 0x6d, 0xf6, 0xb1, 0x2e,
-       0xe5, 0xbc, 0x19, 0x5b, 0xd1, 0xde, 0xb6, 0x1b, 0xbb, 0x74, 0x9f, 0x89,
-       0xe7, 0xc3, 0xb8, 0x3e, 0xaa, 0x3f, 0x94, 0x0b, 0xca, 0xc2, 0x77, 0xc0,
-       0x2f, 0xca, 0x43, 0xa8, 0x73, 0xdd, 0x4d, 0x32, 0xb8, 0x88, 0x78, 0xbf,
-       0xdb, 0xc8, 0x20, 0xcf, 0xba, 0x4f, 0x7f, 0x67, 0xaa, 0x7a, 0x4f, 0x05,
-       0x71, 0xbe, 0x8b, 0x67, 0x35, 0xd4, 0x35, 0xf0, 0x24, 0x19, 0xb6, 0x91,
-       0x8f, 0x2e, 0x7c, 0x9e, 0x1d, 0xf0, 0xd7, 0xc0, 0x23, 0x5d, 0xbf, 0x32,
-       0x27, 0x7c, 0x61, 0x3c, 0x93, 0x4a, 0x1c, 0x7d, 0x4f, 0x0c, 0x42, 0xc7,
-       0x07, 0x89, 0x51, 0x35, 0xc4, 0x3d, 0x94, 0x43, 0xca, 0xe6, 0xb6, 0xfe,
-       0x5d, 0x8a, 0x3e, 0xd5, 0x13, 0x88, 0x83, 0x29, 0xaf, 0x69, 0xd9, 0xe5,
-       0x6f, 0x3b, 0x7d, 0x56, 0x71, 0x8d, 0x7a, 0xbd, 0xc4, 0x58, 0xd1, 0x11,
-       0xb5, 0x75, 0xe0, 0xbf, 0x13, 0xb4, 0x4b, 0x57, 0xb8, 0x31, 0x23, 0x6b,
-       0x79, 0xbc, 0x53, 0x6e, 0x7f, 0x08, 0x7b, 0xcf, 0xef, 0xfd, 0xaf, 0xa1,
-       0x3e, 0x05, 0x9d, 0xa7, 0x7d, 0x67, 0x3c, 0x72, 0x93, 0xe9, 0xd7, 0xad,
-       0xbf, 0x57, 0x16, 0xb2, 0x37, 0x98, 0x6f, 0x57, 0xb4, 0x3f, 0x19, 0xda,
-       0xec, 0x15, 0xe7, 0xcc, 0xfb, 0x12, 0x45, 0x1d, 0xcf, 0x70, 0xbc, 0x96,
-       0x49, 0xc4, 0x20, 0x76, 0x24, 0x97, 0x9e, 0x30, 0xb1, 0x1b, 0x75, 0xac,
-       0x1d, 0x67, 0xe8, 0x9b, 0x58, 0x85, 0xf1, 0xeb, 0xca, 0x7b, 0x12, 0x6b,
-       0xcb, 0xc0, 0x96, 0x0f, 0x20, 0x03, 0xcd, 0xe7, 0x97, 0x80, 0xee, 0x87,
-       0xe7, 0x17, 0xfa, 0x31, 0x73, 0x66, 0xdf, 0xdd, 0xc1, 0x19, 0xfe, 0xbf,
-       0xd8, 0xa7, 0x15, 0xd9, 0x67, 0x88, 0x47, 0x0f, 0x98, 0x7d, 0xde, 0xd4,
-       0x84, 0x47, 0x23, 0x4d, 0x3a, 0xfb, 0x71, 0xe2, 0xd1, 0x9f, 0xac, 0xff,
-       0xf8, 0xf1, 0x88, 0xfb, 0xea, 0x5e, 0x13, 0x87, 0x82, 0x7d, 0x3c, 0x22,
-       0x2a, 0xf7, 0x51, 0xc6, 0x7b, 0x1f, 0xe4, 0x7c, 0xa2, 0x38, 0xc2, 0x33,
-       0xe9, 0xd0, 0x3e, 0x6c, 0xa0, 0x7b, 0xb0, 0xe5, 0xd5, 0xb8, 0xbc, 0x7e,
-       0x57, 0x42, 0xfe, 0xf7, 0x46, 0x7e, 0x0f, 0xb3, 0x4d, 0x4e, 0x8b, 0xe5,
-       0xd7, 0xd6, 0x07, 0x76, 0xe8, 0xb5, 0x4d, 0x81, 0xdd, 0xe1, 0x98, 0x50,
-       0x9f, 0x1d, 0xb4, 0xb3, 0xad, 0x5b, 0x96, 0x3a, 0x2f, 0x27, 0x06, 0xdc,
-       0xe6, 0xbc, 0xa1, 0xd6, 0x8a, 0x01, 0x2f, 0x9c, 0x0f, 0x5c, 0x8e, 0x01,
-       0x89, 0xb3, 0x9d, 0x5a, 0x36, 0x4a, 0x49, 0xc6, 0x3e, 0x7d, 0x06, 0x3b,
-       0xf9, 0x8e, 0xd8, 0xd6, 0x43, 0xbc, 0xeb, 0x21, 0xd6, 0xf5, 0x10, 0xff,
-       0x7a, 0x88, 0x71, 0x3d, 0xc4, 0xb6, 0x1e, 0x62, 0x5b, 0x0f, 0xb1, 0xad,
-       0xd7, 0x6f, 0x62, 0xe4, 0x11, 0x93, 0xf7, 0xe7, 0x77, 0x72, 0xe6, 0x17,
-       0x2a, 0xb0, 0x25, 0x93, 0xbc, 0xe7, 0xa0, 0x0a, 0xd9, 0xf5, 0x66, 0x7f,
-       0x61, 0x4e, 0xbc, 0xc7, 0xe4, 0x6c, 0x5e, 0xd7, 0x79, 0x43, 0x51, 0xb3,
-       0xad, 0xc1, 0xb7, 0x74, 0xde, 0xc7, 0xf8, 0x2d, 0xf8, 0x25, 0xfa, 0x3e,
-       0x13, 0x75, 0xb4, 0xae, 0x72, 0xcc, 0xc9, 0x88, 0x52, 0xb9, 0xeb, 0x31,
-       0x66, 0x47, 0x10, 0x13, 0x24, 0x25, 0xa6, 0x72, 0x6d, 0xe4, 0xa9, 0xa5,
-       0x72, 0x1b, 0xcc, 0x5c, 0x47, 0x5b, 0x03, 0xdf, 0xaa, 0x8f, 0x65, 0x5b,
-       0xe5, 0x6e, 0xe6, 0x13, 0xe7, 0x1e, 0xd6, 0xf7, 0x74, 0xae, 0x5c, 0x6b,
-       0x4a, 0xe3, 0x7b, 0x21, 0x7b, 0x37, 0xe6, 0xd3, 0xf7, 0x88, 0x1a, 0xfc,
-       0x56, 0xe7, 0xe5, 0xf7, 0x94, 0xe1, 0x77, 0xc0, 0xe3, 0x18, 0xfb, 0xe9,
-       0xbc, 0x30, 0x79, 0x1d, 0xce, 0xa7, 0xf3, 0x7a, 0x58, 0x47, 0xdf, 0xa5,
-       0xc0, 0x53, 0xc5, 0xa5, 0x63, 0xf4, 0x9e, 0xb8, 0x1b, 0x5d, 0x37, 0xfc,
-       0x26, 0x7e, 0x29, 0x6b, 0x76, 0xeb, 0xef, 0x68, 0x81, 0xcd, 0x98, 0xd2,
-       0x32, 0x68, 0xe7, 0xb8, 0xaf, 0xf7, 0x21, 0x7f, 0x53, 0x5a, 0xfe, 0x8a,
-       0x88, 0x63, 0x26, 0x07, 0xb7, 0xa5, 0x6d, 0x75, 0xa0, 0x95, 0xf9, 0xd7,
-       0x61, 0x3f, 0xc4, 0x3d, 0xae, 0xd7, 0x6c, 0xc7, 0x99, 0x57, 0x0b, 0xf1,
-       0x4c, 0xb6, 0x04, 0xf9, 0xb6, 0x0f, 0xa3, 0x4b, 0xad, 0x4d, 0xba, 0x14,
-       0xee, 0x93, 0xfb, 0xe7, 0x73, 0xed, 0x3b, 0x15, 0x8b, 0x7e, 0xe4, 0xfb,
-       0x48, 0x43, 0x36, 0x78, 0xb7, 0xe4, 0x8b, 0x90, 0x41, 0xfd, 0x9d, 0x02,
-       0x7a, 0x54, 0xaf, 0x0f, 0x33, 0xc7, 0xbc, 0xf3, 0x0b, 0xe6, 0xde, 0x82,
-       0x3c, 0xcc, 0xfc, 0x83, 0xbd, 0x2a, 0xff, 0x30, 0x0c, 0x59, 0x81, 0x0f,
-       0xe0, 0x75, 0x68, 0x9f, 0x4e, 0xb9, 0xf4, 0x07, 0x9a, 0xbf, 0xbf, 0x3c,
-       0xda, 0x16, 0xf0, 0xe1, 0xed, 0xd6, 0xe0, 0x1b, 0xc4, 0xdf, 0x26, 0x57,
-       0x96, 0x39, 0xfe, 0x7f, 0x8c, 0xac, 0x1c, 0x86, 0x6d, 0x1e, 0x86, 0x2c,
-       0x22, 0x26, 0xd7, 0xf3, 0x1d, 0x96, 0xd2, 0xd3, 0x0b, 0x9d, 0x2b, 0xfb,
-       0xa3, 0xee, 0x58, 0xd8, 0xff, 0xb1, 0xa6, 0xfe, 0x8f, 0xa1, 0xff, 0x0b,
-       0x4d, 0xfd, 0x1f, 0x8b, 0xf4, 0x3f, 0xda, 0xd4, 0x1f, 0x31, 0xe2, 0xd3,
-       0xff, 0xdc, 0xd4, 0xff, 0x68, 0xa4, 0xff, 0x6c, 0x53, 0xff, 0x59, 0xf4,
-       0x7f, 0xad, 0xa9, 0x3f, 0xea, 0x8e, 0xb5, 0x98, 0xef, 0x62, 0xc4, 0xd8,
-       0x7d, 0x26, 0x16, 0xc7, 0xb3, 0xd6, 0xfc, 0xad, 0x85, 0x72, 0xd7, 0x83,
-       0x33, 0x08, 0xef, 0xb4, 0x51, 0x5f, 0xf3, 0xd0, 0xd7, 0x65, 0x5f, 0x26,
-       0x90, 0xc7, 0xa8, 0x2c, 0x12, 0x1f, 0x2a, 0x12, 0x73, 0x7d, 0xfa, 0x47,
-       0x56, 0xb9, 0x1a, 0xda, 0x24, 0xde, 0x5b, 0xe2, 0x7d, 0xd7, 0xc0, 0xf6,
-       0xc6, 0xdd, 0x45, 0x13, 0x83, 0x5d, 0xd1, 0x06, 0xda, 0x81, 0x97, 0x21,
-       0x66, 0xca, 0xe1, 0x40, 0x6f, 0x28, 0xbf, 0x9c, 0xdf, 0xe8, 0x0f, 0x65,
-       0xd5, 0xac, 0x33, 0xbc, 0x0a, 0xd7, 0xd2, 0xab, 0x72, 0x5b, 0xb1, 0x4b,
-       0xc0, 0xb5, 0x91, 0x06, 0xae, 0x7d, 0x51, 0xe6, 0x1a, 0xf1, 0xf6, 0x19,
-       0xd9, 0xef, 0xed, 0xe1, 0x3d, 0x9d, 0xc3, 0x79, 0xf9, 0x68, 0xe2, 0xed,
-       0x3d, 0x0d, 0x3b, 0xc9, 0x3b, 0x1d, 0xe9, 0x83, 0xbc, 0x83, 0x1b, 0xe6,
-       0x66, 0x27, 0xbd, 0x5f, 0xc7, 0xfe, 0x69, 0x33, 0x2f, 0x37, 0xde, 0xe6,
-       0x7c, 0x49, 0xd9, 0x1f, 0xdc, 0x77, 0x68, 0xcc, 0x5b, 0x69, 0xcc, 0x9b,
-       0x32, 0xfa, 0x46, 0x1b, 0xbc, 0x6c, 0x2f, 0x8b, 0xb0, 0x97, 0x63, 0x88,
-       0xb9, 0x17, 0xbd, 0xb5, 0xf2, 0xa3, 0x97, 0x6b, 0x2f, 0x9b, 0xf3, 0xcc,
-       0xcd, 0xf6, 0x92, 0xeb, 0x34, 0xe7, 0x96, 0xd3, 0x4d, 0xf8, 0x4f, 0x79,
-       0x3a, 0x67, 0x7c, 0x6a, 0x3c, 0xab, 0xe7, 0xa0, 0x8f, 0x4a, 0xc6, 0xb4,
-       0xfc, 0xb2, 0x1c, 0xc6, 0x96, 0xf7, 0x34, 0x62, 0xcb, 0xe5, 0x78, 0x10,
-       0xbe, 0x6b, 0xff, 0x67, 0x0c, 0x3e, 0xd2, 0x47, 0x76, 0xac, 0xb2, 0xb7,
-       0x5b, 0xed, 0xd5, 0x6d, 0xcc, 0x97, 0x5e, 0x2b, 0xb7, 0xea, 0x38, 0xfe,
-       0x8c, 0xc9, 0x4d, 0xcd, 0x69, 0xff, 0x9f, 0xdf, 0x0b, 0xca, 0xd9, 0x4d,
-       0xc6, 0xdf, 0xbb, 0x18, 0xae, 0xae, 0x8c, 0x4d, 0x95, 0x3a, 0x88, 0xb1,
-       0x8c, 0x4d, 0xfb, 0xdb, 0x89, 0xa1, 0x05, 0xff, 0x82, 0xe3, 0x31, 0x8e,
-       0xe3, 0xd9, 0x47, 0xc7, 0xa1, 0xe8, 0xb7, 0x68, 0xc6, 0x07, 0x71, 0x68,
-       0xc1, 0xff, 0x71, 0x5b, 0x80, 0x83, 0x17, 0x8a, 0x59, 0x3e, 0xdf, 0xce,
-       0xbc, 0xde, 0xa2, 0x77, 0x31, 0x5a, 0x57, 0xc7, 0xbd, 0xb1, 0x55, 0x71,
-       0xaf, 0x6d, 0xe2, 0xda, 0x5f, 0xd2, 0x71, 0x6f, 0xc0, 0x63, 0xee, 0x25,
-       0x1a, 0x47, 0xb9, 0xc0, 0x42, 0x7e, 0x53, 0x21, 0x3e, 0xd0, 0x47, 0x81,
-       0x9f, 0x35, 0xfd, 0x8b, 0xe0, 0x73, 0x72, 0x0d, 0xb9, 0xf9, 0xb8, 0xed,
-       0x44, 0xb8, 0xf7, 0x73, 0x12, 0xe4, 0xeb, 0x76, 0x83, 0x16, 0xc6, 0x56,
-       0x71, 0x23, 0x0f, 0x3f, 0x35, 0xf7, 0x2a, 0xc3, 0x7e, 0x61, 0x1c, 0xdf,
-       0xf8, 0xee, 0x5a, 0xc9, 0xaf, 0xc8, 0x9f, 0x74, 0x33, 0x0d, 0x8d, 0x73,
-       0xcf, 0x5f, 0xc6, 0x77, 0x8b, 0x0f, 0x73, 0x3f, 0xa2, 0xd9, 0xae, 0xf1,
-       0xbb, 0x29, 0xbf, 0x95, 0x8a, 0x75, 0x67, 0x9f, 0x0b, 0x1d, 0xe0, 0xbd,
-       0xe1, 0x28, 0xbe, 0x26, 0xa4, 0x34, 0x2b, 0x89, 0x64, 0x8e, 0xdf, 0x00,
-       0x68, 0xff, 0x7f, 0x68, 0xf6, 0x99, 0x92, 0x7d, 0x33, 0x41, 0xce, 0x53,
-       0x5d, 0xf0, 0x5e, 0xdc, 0xe3, 0xe0, 0x43, 0xe6, 0x50, 0x98, 0xf3, 0x54,
-       0xc1, 0xbd, 0xb8, 0x43, 0x1f, 0xdd, 0xbd, 0x38, 0xce, 0x6f, 0xcb, 0x9e,
-       0x35, 0xee, 0xc5, 0xc5, 0x2e, 0xf1, 0x5e, 0xdc, 0x26, 0x9d, 0xf3, 0xe4,
-       0x3c, 0x41, 0xce, 0x93, 0xe5, 0xad, 0x03, 0xcc, 0x95, 0xf0, 0xee, 0xdb,
-       0xa0, 0xbe, 0x2f, 0xbc, 0x75, 0xe0, 0xe7, 0x11, 0xa3, 0xfc, 0x75, 0xfb,
-       0xc7, 0x1f, 0xa3, 0x70, 0x2f, 0xbf, 0x11, 0x7c, 0xdf, 0x95, 0xcb, 0xc9,
-       0x03, 0x7c, 0xb8, 0xbc, 0xe6, 0x3e, 0x9d, 0xd7, 0x7c, 0xa7, 0x3d, 0x9a,
-       0xd7, 0x54, 0x17, 0xb9, 0x1b, 0xb6, 0x6f, 0x8d, 0xbc, 0x66, 0x3c, 0x72,
-       0x37, 0x2c, 0x6e, 0xee, 0x86, 0x6d, 0x72, 0x11, 0x4b, 0x9a, 0x3c, 0xa6,
-       0xba, 0xe0, 0xdd, 0xb0, 0xce, 0x0d, 0x1f, 0x3e, 0x8f, 0xb9, 0xea, 0x6e,
-       0x18, 0x6c, 0xdd, 0x16, 0x49, 0x5f, 0x56, 0xdc, 0xf3, 0x61, 0x62, 0x1e,
-       0xde, 0xab, 0x6f, 0xc1, 0x9e, 0xe3, 0xb2, 0x27, 0x49, 0xf9, 0xe4, 0xdd,
-       0xc6, 0x3e, 0xe8, 0x02, 0x9e, 0x3e, 0xcb, 0xfd, 0x3c, 0x23, 0x6b, 0xa4,
-       0x6f, 0xe5, 0x3d, 0x84, 0xe5, 0x3b, 0xbd, 0x89, 0xc6, 0x9d, 0xde, 0x29,
-       0xc8, 0x8d, 0x9a, 0x49, 0xc8, 0x7c, 0x44, 0xa6, 0x26, 0x3d, 0xf8, 0x4b,
-       0xb3, 0x8e, 0x69, 0xe7, 0xff, 0xef, 0x48, 0x02, 0xf3, 0x78, 0x0f, 0xb8,
-       0x43, 0x62, 0xb3, 0xc1, 0x37, 0xcb, 0xe0, 0xff, 0xb8, 0xa4, 0xd0, 0x87,
-       0x77, 0x3c, 0xe3, 0xb2, 0x5f, 0xe7, 0x2c, 0x42, 0x59, 0xfe, 0x35, 0xf0,
-       0x78, 0x73, 0x7e, 0xb9, 0x9c, 0x5c, 0xc3, 0xee, 0x27, 0xa5, 0x3c, 0x43,
-       0x79, 0xbe, 0xc1, 0xfc, 0xff, 0x82, 0xd3, 0x52, 0xf6, 0x4f, 0x99, 0xf8,
-       0x42, 0x7f, 0xdb, 0x01, 0x2f, 0xb7, 0x18, 0x1b, 0x8c, 0x67, 0x75, 0x0b,
-       0x6d, 0x1e, 0xd6, 0x38, 0x2e, 0xc3, 0xd3, 0x3b, 0x52, 0x7b, 0x81, 0x77,
-       0x63, 0x7a, 0xcd, 0xcb, 0xe1, 0xb9, 0x75, 0x9e, 0xef, 0x8d, 0x97, 0xca,
-       0xf7, 0xd0, 0x3f, 0xae, 0x62, 0x7f, 0x5b, 0x20, 0x1f, 0x5f, 0x95, 0xe2,
-       0xb1, 0x6b, 0x65, 0xf8, 0x68, 0x06, 0xf4, 0xbc, 0x5f, 0x2f, 0x67, 0xe1,
-       0x4b, 0x3f, 0xcd, 0x7b, 0x63, 0xc0, 0x50, 0xf0, 0xed, 0xf9, 0x55, 0xdf,
-       0xb1, 0xa3, 0x77, 0xcd, 0xfa, 0x1b, 0x77, 0x87, 0x9e, 0xf5, 0x25, 0xd1,
-       0x49, 0x9a, 0x67, 0x96, 0xef, 0x8f, 0x2f, 0xfa, 0xbb, 0xb4, 0x6d, 0x7b,
-       0xc6, 0x5f, 0x91, 0xfb, 0xd1, 0x67, 0x38, 0x5e, 0xfb, 0x1e, 0xec, 0xdb,
-       0x39, 0x8b, 0xf6, 0x6d, 0xca, 0x93, 0xab, 0x63, 0xc2, 0xf3, 0x10, 0x0b,
-       0x3c, 0xd0, 0x77, 0x38, 0x82, 0xef, 0xfb, 0x3d, 0xfa, 0x5c, 0x03, 0xac,
-       0x58, 0x88, 0xdc, 0xc1, 0x58, 0x3e, 0xdb, 0xe0, 0x6e, 0x46, 0x70, 0x16,
-       0xc1, 0xfd, 0x11, 0xed, 0x6f, 0x1e, 0xdc, 0xe3, 0x06, 0xf7, 0x47, 0x7a,
-       0x67, 0x59, 0xd7, 0xd5, 0x64, 0xfb, 0x12, 0x90, 0x01, 0xde, 0x3b, 0xe2,
-       0xbd, 0x71, 0xd2, 0xac, 0x73, 0x1d, 0xff, 0x47, 0xdd, 0xd5, 0xc7, 0xb6,
-       0x75, 0x5d, 0xf7, 0xc3, 0x47, 0xea, 0xc3, 0xb4, 0x2c, 0x53, 0x32, 0x25,
-       0xd3, 0x96, 0x2c, 0xbf, 0x27, 0x3d, 0x59, 0x72, 0xac, 0x14, 0xac, 0xab,
-       0xad, 0x02, 0x46, 0xa4, 0x0c, 0x49, 0x7f, 0xb4, 0x08, 0x06, 0xfa, 0xa3,
-       0x99, 0x8b, 0x66, 0xab, 0x4b, 0xd9, 0x4e, 0x0a, 0xf4, 0x0f, 0xb7, 0xc5,
-       0x80, 0x6c, 0x58, 0x60, 0x86, 0xb4, 0x12, 0x63, 0x56, 0x4c, 0xd6, 0x66,
-       0x85, 0x0c, 0xd8, 0x30, 0x4e, 0x54, 0x9c, 0x14, 0x50, 0xc6, 0x04, 0x69,
-       0x83, 0xa2, 0x58, 0x61, 0x45, 0x76, 0x36, 0x6c, 0x7f, 0x65, 0x43, 0xd0,
-       0x05, 0x9b, 0xb3, 0x38, 0x76, 0xb0, 0x06, 0x45, 0xd6, 0x7d, 0x62, 0x18,
-       0xd0, 0x0d, 0xdc, 0xf9, 0xdd, 0x0f, 0xf2, 0xf1, 0xf1, 0x51, 0x1f, 0x89,
-       0x33, 0x60, 0x02, 0x04, 0xbe, 0xf7, 0x78, 0xdf, 0x7b, 0xf7, 0x9e, 0x7b,
-       0xce, 0xb9, 0xbf, 0x73, 0xee, 0x39, 0x87, 0x9e, 0x7b, 0xdb, 0x9b, 0xf3,
-       0xb9, 0xca, 0x77, 0x8e, 0x8a, 0x77, 0x0e, 0x28, 0x9d, 0xa5, 0xe3, 0xc5,
-       0x63, 0xc6, 0x6c, 0x61, 0x22, 0xe2, 0x67, 0xfe, 0x9e, 0xad, 0xc2, 0xbe,
-       0x6e, 0x87, 0xe1, 0xd6, 0xa2, 0x67, 0xbc, 0x85, 0x9e, 0xcd, 0x32, 0xc1,
-       0xf6, 0x78, 0x5d, 0x77, 0x4b, 0xda, 0xc9, 0xeb, 0x88, 0x85, 0xd7, 0x31,
-       0x0e, 0x92, 0x76, 0x75, 0x19, 0xba, 0xe2, 0x8c, 0x6f, 0x68, 0xd0, 0xee,
-       0x74, 0x9d, 0x76, 0x3b, 0xff, 0x1f, 0xd1, 0xee, 0x1d, 0x81, 0x7f, 0x5f,
-       0xad, 0x22, 0x6e, 0x4d, 0x63, 0x00, 0x9d, 0x3b, 0x04, 0x3a, 0x42, 0x9f,
-       0x5a, 0xe5, 0x15, 0x82, 0x4e, 0x45, 0x5c, 0x71, 0xad, 0xf6, 0x5a, 0xb4,
-       0xee, 0xa7, 0x64, 0xbb, 0x04, 0xf6, 0x09, 0xfc, 0x79, 0xed, 0xd7, 0xc8,
-       0x63, 0x1f, 0x6b, 0x8d, 0x04, 0x56, 0x72, 0xdb, 0x27, 0x0c, 0x08, 0x1d,
-       0xf6, 0xc9, 0xb1, 0x4d, 0xda, 0x27, 0xe7, 0xa5, 0x7d, 0x92, 0xdd, 0xb8,
-       0x7d, 0xb2, 0xbb, 0x25, 0xae, 0xab, 0x31, 0x9e, 0xcd, 0xdb, 0x27, 0xc6,
-       0x9a, 0xf6, 0xc9, 0x90, 0xc3, 0x17, 0x83, 0xfe, 0xfe, 0x06, 0x65, 0x8f,
-       0x43, 0xc7, 0x69, 0x3a, 0x83, 0xc6, 0xc7, 0x5d, 0x7e, 0xe1, 0x4f, 0x93,
-       0xd6, 0xbf, 0xf8, 0x3f, 0xa6, 0xf5, 0x50, 0x8b, 0xcf, 0xbb, 0x31, 0x1e,
-       0x0a, 0xef, 0xd8, 0x14, 0x8e, 0x77, 0xd3, 0x7a, 0xa8, 0xad, 0xef, 0xb4,
-       0x7d, 0xcc, 0x62, 0xb3, 0xef, 0x74, 0xd4, 0x68, 0xa7, 0xdb, 0xff, 0xd8,
-       0xe1, 0x53, 0x75, 0xea, 0x77, 0xc8, 0x14, 0xf9, 0x8e, 0x4d, 0xe8, 0x77,
-       0x41, 0x96, 0xac, 0x6c, 0x96, 0x60, 0x33, 0xe1, 0x7d, 0x11, 0x21, 0x6b,
-       0x2e, 0xbc, 0xc5, 0xef, 0x63, 0x7a, 0xbe, 0xf8, 0x87, 0x62, 0x9d, 0x92,
-       0xfe, 0x07, 0xb4, 0x0f, 0xfb, 0xce, 0x88, 0xb6, 0x32, 0xbe, 0x49, 0xf9,
-       0x23, 0x14, 0xf6, 0x6f, 0xe7, 0x87, 0x68, 0x5d, 0xf3, 0x36, 0x67, 0x2b,
-       0x68, 0x19, 0xdf, 0xcb, 0xf3, 0x12, 0x69, 0xb2, 0xb5, 0xa0, 0x3f, 0xcf,
-       0x33, 0x2e, 0x18, 0xad, 0x63, 0x82, 0xe6, 0xb9, 0xb9, 0x28, 0x6c, 0x3a,
-       0xad, 0x3b, 0x57, 0x64, 0xec, 0xa9, 0xb8, 0x0e, 0x9c, 0xa6, 0x75, 0xa7,
-       0x1b, 0x07, 0xef, 0xf5, 0xe0, 0x0b, 0xcf, 0xdc, 0x4f, 0x3d, 0x77, 0x26,
-       0x62, 0xce, 0x53, 0x9e, 0x73, 0x57, 0xcf, 0xe1, 0xca, 0x36, 0xda, 0xca,
-       0xfb, 0x53, 0x62, 0x5c, 0xdf, 0xfc, 0x62, 0x02, 0xb9, 0x6a, 0xf5, 0xfc,
-       0x21, 0x77, 0xce, 0x14, 0xd6, 0x01, 0x2d, 0x87, 0x3a, 0x3f, 0x1b, 0xb4,
-       0x18, 0xf1, 0xc8, 0x99, 0x72, 0xae, 0x25, 0xb8, 0xcf, 0x4d, 0x8b, 0xc6,
-       0x3a, 0x32, 0xa7, 0xd6, 0x91, 0x45, 0x87, 0x1e, 0x6f, 0xc5, 0xed, 0xfd,
-       0x1e, 0xb8, 0xdd, 0x2b, 0x6f, 0x0a, 0x7d, 0x7a, 0x92, 0x71, 0xc8, 0x67,
-       0x80, 0x43, 0x42, 0xc8, 0x5b, 0x92, 0x58, 0x04, 0xdf, 0x17, 0x19, 0x8f,
-       0x44, 0x98, 0x57, 0x7e, 0x44, 0xe7, 0x18, 0x6b, 0x5f, 0xa7, 0xfd, 0xca,
-       0x3e, 0x83, 0xdc, 0xea, 0x38, 0x53, 0xc4, 0xf1, 0xfb, 0x28, 0xfb, 0x98,
-       0x35, 0x19, 0xa7, 0x1f, 0xd1, 0x59, 0x11, 0x33, 0x83, 0xfd, 0x3d, 0xc4,
-       0x1c, 0x3c, 0x20, 0xde, 0x2f, 0x7d, 0x19, 0xf7, 0x23, 0xa6, 0x6e, 0xe3,
-       0xf1, 0xfb, 0x2a, 0xb7, 0x8e, 0xdb, 0xe1, 0x9d, 0x4b, 0x4a, 0xa6, 0xc4,
-       0x35, 0xbe, 0xff, 0x49, 0xa3, 0xf5, 0xfe, 0xb8, 0x91, 0xaa, 0xa6, 0x8c,
-       0x44, 0x05, 0xed, 0x9e, 0x34, 0x92, 0x55, 0xd8, 0x90, 0x9a, 0x47, 0xac,
-       0x28, 0xe4, 0x6d, 0x95, 0xd6, 0xdf, 0x8b, 0x58, 0x24, 0x57, 0x9e, 0xc4,
-       0x06, 0xfa, 0x7d, 0xb8, 0xa9, 0xdf, 0x9a, 0xbe, 0x38, 0x86, 0xbf, 0xe7,
-       0x15, 0xa6, 0xa9, 0xc6, 0xb5, 0x41, 0xf8, 0xd7, 0x27, 0xb3, 0xb4, 0x16,
-       0xae, 0xb5, 0x5a, 0x70, 0xed, 0xe2, 0xba, 0xfd, 0xfe, 0xa4, 0x32, 0x2e,
-       0xf3, 0xa3, 0xfd, 0xb6, 0xc0, 0xaf, 0xdc, 0xef, 0x26, 0x6c, 0xeb, 0xe2,
-       0x29, 0xb4, 0xd1, 0x7e, 0x70, 0xed, 0x07, 0xeb, 0x55, 0xf1, 0xc0, 0x3a,
-       0x3e, 0x21, 0x88, 0x7c, 0xaf, 0x90, 0x8c, 0x6b, 0x85, 0x8d, 0xb5, 0xc2,
-       0xfd, 0x83, 0xbd, 0x05, 0x9f, 0x8f, 0xb0, 0xb7, 0xcc, 0x24, 0x49, 0x5f,
-       0xf7, 0x99, 0xaa, 0xd3, 0xbf, 0xeb, 0x95, 0x4b, 0x39, 0xea, 0x91, 0x4b,
-       0xe9, 0x94, 0xb5, 0x80, 0x43, 0xd6, 0x22, 0x0e, 0xdc, 0x36, 0xcc, 0x76,
-       0x4b, 0x0f, 0xeb, 0x90, 0x1e, 0xb1, 0x6d, 0xe2, 0xbf, 0xea, 0xb4, 0x5b,
-       0xdc, 0x79, 0xf1, 0x90, 0x3b, 0x60, 0x33, 0x69, 0xc3, 0xa4, 0x4a, 0xf5,
-       0x9c, 0x7a, 0x1e, 0x77, 0x23, 0x6f, 0xb1, 0xd2, 0x92, 0x63, 0xe9, 0xd5,
-       0xdf, 0x91, 0x96, 0xfe, 0x62, 0xfd, 0x8a, 0xb7, 0xc5, 0x74, 0x5e, 0x76,
-       0xd5, 0xfd, 0xea, 0x9f, 0x5b, 0x9f, 0xe1, 0x5d, 0xa3, 0xc2, 0xe7, 0x9d,
-       0xad, 0xeb, 0xb2, 0x19, 0xd9, 0xdf, 0x42, 0xb3, 0x9d, 0xe1, 0xbf, 0x42,
-       0x8a, 0x76, 0xde, 0xba, 0x7d, 0x73, 0xfe, 0xb3, 0xad, 0x6e, 0x1c, 0xdc,
-       0x27, 0xfd, 0x62, 0x73, 0x2a, 0x0e, 0x7b, 0x40, 0xd9, 0x7b, 0xeb, 0xf1,
-       0x3b, 0xae, 0xcd, 0x29, 0x5f, 0xa2, 0x65, 0x96, 0x09, 0x7c, 0x7e, 0xfc,
-       0x54, 0x87, 0x1d, 0x52, 0x7b, 0x59, 0xd8, 0xaf, 0x02, 0xdf, 0xeb, 0xe7,
-       0x43, 0x67, 0x6f, 0x64, 0xce, 0xcc, 0x96, 0x39, 0x93, 0x7c, 0x05, 0x5b,
-       0x0b, 0xf1, 0xc5, 0x53, 0xae, 0x18, 0xef, 0x4f, 0x42, 0x8b, 0x5e, 0x8f,
-       0xb8, 0x67, 0xc4, 0x2d, 0xb7, 0xeb, 0xe7, 0x1d, 0x07, 0x2e, 0x47, 0x7f,
-       0x6b, 0xb5, 0x57, 0xa2, 0xbb, 0xe5, 0x5a, 0x5c, 0xf5, 0xc6, 0x48, 0xa1,
-       0x0d, 0xf7, 0xcf, 0xbd, 0xf6, 0xee, 0xda, 0xe0, 0xda, 0x2b, 0xea, 0x8b,
-       0xf8, 0x0e, 0x09, 0x1d, 0xd0, 0x43, 0x95, 0x12, 0xe2, 0xaf, 0x3f, 0x0b,
-       0x99, 0x67, 0x3d, 0xeb, 0xc8, 0x49, 0xf3, 0x9e, 0xc7, 0xfa, 0x9e, 0x4a,
-       0x20, 0x86, 0xbd, 0x3f, 0xc4, 0x96, 0xf4, 0xb3, 0xee, 0x41, 0xfb, 0x71,
-       0xf3, 0x16, 0xfc, 0xbd, 0xca, 0xff, 0x94, 0x52, 0xeb, 0xcb, 0xa1, 0x0d,
-       0xec, 0xad, 0x6c, 0x4e, 0x4f, 0x5b, 0xe6, 0x0a, 0x61, 0xdf, 0x07, 0xf1,
-       0xc2, 0xc7, 0x7a, 0xa9, 0xf7, 0x2b, 0x5d, 0x5d, 0xf6, 0x1f, 0xf4, 0xc9,
-       0xbd, 0x28, 0x7c, 0xd7, 0x43, 0x2f, 0x94, 0x10, 0xcb, 0x8d, 0xef, 0x7e,
-       0x8b, 0xbf, 0xf3, 0xd2, 0x51, 0x3a, 0x16, 0x1d, 0x58, 0x4e, 0xce, 0x4f,
-       0x99, 0x60, 0x2b, 0xd5, 0xe8, 0x6f, 0xa2, 0x9f, 0x93, 0xfb, 0x19, 0xd5,
-       0xfb, 0xbd, 0x57, 0xe3, 0xe5, 0x2f, 0xfc, 0x69, 0xdf, 0xc7, 0x8d, 0x8d,
-       0xfc, 0xd6, 0x86, 0xfc, 0x85, 0xd8, 0xe7, 0xdf, 0xc8, 0x9e, 0x89, 0xde,
-       0x1b, 0x9e, 0x16, 0x39, 0xa7, 0x4e, 0x3e, 0xb8, 0x3f, 0xfb, 0xc3, 0xe0,
-       0x87, 0x91, 0x16, 0x5d, 0xf5, 0xc9, 0xfd, 0xfd, 0x6e, 0xba, 0x06, 0x3d,
-       0x7d, 0x55, 0xde, 0xfb, 0xc0, 0xd8, 0xf3, 0x87, 0x9f, 0xba, 0x4a, 0x67,
-       0xae, 0x81, 0x87, 0x0d, 0xe6, 0xb6, 0x31, 0xca, 0x87, 0x91, 0x57, 0x24,
-       0x72, 0x73, 0xf4, 0xbe, 0xa1, 0xc8, 0x15, 0x3a, 0x23, 0x72, 0x20, 0xc7,
-       0x23, 0xf7, 0x78, 0x3d, 0x3c, 0x53, 0x7d, 0x9b, 0xce, 0x56, 0x82, 0xfc,
-       0xdf, 0xc0, 0xee, 0xad, 0x79, 0x90, 0xcd, 0x3c, 0x7e, 0x4f, 0xf0, 0xf8,
-       0xf0, 0x9a, 0x3c, 0x7e, 0xa4, 0xce, 0xe3, 0x5f, 0xe9, 0x97, 0xfc, 0xdc,
-       0xcb, 0xcf, 0xea, 0xa5, 0x43, 0xe2, 0xb9, 0x6f, 0xf3, 0xf1, 0x56, 0x3a,
-       0x14, 0x92, 0xc7, 0x67, 0x2b, 0xac, 0xe3, 0x0b, 0x6f, 0xd3, 0xb9, 0x6b,
-       0x59, 0x5f, 0x4a, 0xe4, 0x2f, 0x38, 0x6b, 0x69, 0xe8, 0xfb, 0xd1, 0xae,
-       0x1d, 0xff, 0x6b, 0xbd, 0x24, 0x73, 0xae, 0xca, 0x52, 0x3f, 0xd1, 0x5b,
-       0xd1, 0x21, 0x17, 0xff, 0x37, 0xdb, 0x8e, 0xe7, 0xd5, 0x1a, 0x78, 0x7c,
-       0x0d, 0xbf, 0x46, 0x2b, 0x5f, 0xf6, 0x79, 0xe0, 0xe1, 0xa7, 0xfb, 0xe5,
-       0x3e, 0xd5, 0x5a, 0x7e, 0x8d, 0xa6, 0xb8, 0x0e, 0xe7, 0xbe, 0x3d, 0xeb,
-       0xfd, 0x3d, 0x2a, 0x17, 0xf0, 0x87, 0xfd, 0x72, 0xbd, 0x40, 0x7e, 0xe0,
-       0x0a, 0xd3, 0xe1, 0x22, 0x63, 0x95, 0x21, 0xea, 0xbc, 0xaa, 0xc7, 0x3a,
-       0x24, 0xf4, 0xad, 0xd3, 0x4f, 0x73, 0x51, 0xe5, 0x76, 0xe7, 0x1c, 0x63,
-       0xba, 0x28, 0x6c, 0x9c, 0xf6, 0xf2, 0xd6, 0x3e, 0xe6, 0x6a, 0xd8, 0xb5,
-       0x26, 0xb8, 0xf9, 0x0d, 0x75, 0x4a, 0x30, 0xbf, 0x64, 0x48, 0x1c, 0x3c,
-       0xc3, 0xf8, 0x76, 0xb3, 0xfb, 0x45, 0x9f, 0x14, 0x23, 0xba, 0x6b, 0x60,
-       0xb8, 0x8f, 0x31, 0x0f, 0xd2, 0xe6, 0xc8, 0xbc, 0x58, 0x15, 0xba, 0xe0,
-       0xe2, 0x54, 0x8d, 0x92, 0xd1, 0x6d, 0x94, 0x99, 0xe2, 0x77, 0xcf, 0xd8,
-       0x6c, 0x7b, 0xf9, 0x29, 0xcb, 0xf2, 0x9b, 0x99, 0xda, 0xa2, 0xf0, 0xa2,
-       0xf6, 0xa7, 0x77, 0xa9, 0x38, 0x87, 0x5e, 0xb1, 0x2f, 0x29, 0x6b, 0xf5,
-       0xf0, 0x71, 0x45, 0x3f, 0x1b, 0xd7, 0xc1, 0xbb, 0x9d, 0xaa, 0xdd, 0x65,
-       0x47, 0x3b, 0xb4, 0xb9, 0xac, 0xda, 0xe2, 0x99, 0x1a, 0x53, 0x74, 0x2b,
-       0x7d, 0x0b, 0x39, 0x5c, 0x51, 0xb9, 0x7a, 0xc2, 0x7e, 0xa0, 0xd9, 0xfa,
-       0x58, 0x2e, 0x73, 0xdb, 0xff, 0xae, 0xc5, 0x85, 0x2d, 0x77, 0x99, 0x31,
-       0x6f, 0x55, 0xc8, 0x8a, 0xbb, 0x4f, 0x18, 0x8b, 0x5f, 0xec, 0x0f, 0xf1,
-       0xb1, 0x7a, 0xcf, 0xe9, 0x7a, 0x9f, 0x10, 0xa3, 0x61, 0x45, 0xe4, 0xb3,
-       0x74, 0xbb, 0xcb, 0x8e, 0x76, 0x5a, 0x57, 0xe8, 0xfd, 0x87, 0x8f, 0x7c,
-       0xb3, 0x85, 0xdb, 0x3e, 0x19, 0xc3, 0x1b, 0x12, 0xfb, 0xa7, 0x32, 0x46,
-       0x43, 0x1f, 0xc3, 0xbf, 0x8c, 0x98, 0x0a, 0xc4, 0x49, 0x38, 0xf5, 0x8d,
-       0x1c, 0x6f, 0x00, 0x6b, 0x51, 0x15, 0xfb, 0xa6, 0xd8, 0xaf, 0x68, 0x87,
-       0x9d, 0x77, 0x21, 0x36, 0x7f, 0x13, 0x18, 0x74, 0x23, 0xf2, 0x67, 0x7a,
-       0xc8, 0x9f, 0xf3, 0xfd, 0xc8, 0x83, 0x43, 0x3e, 0x5c, 0x76, 0xd2, 0xa0,
-       0x1a, 0xdb, 0x0a, 0x06, 0x95, 0x43, 0x3e, 0x3a, 0x67, 0x5b, 0xd1, 0x8a,
-       0xc0, 0x9a, 0x8f, 0xc0, 0x7f, 0x35, 0xb9, 0x42, 0x07, 0x44, 0xce, 0x38,
-       0x6a, 0x1f, 0x94, 0x79, 0x0d, 0x3e, 0xcd, 0x3c, 0x78, 0x96, 0xed, 0x8f,
-       0xec, 0x49, 0xec, 0xb7, 0xe8, 0x79, 0x41, 0x0e, 0x3c, 0x3e, 0x4d, 0x9e,
-       0xbb, 0xdf, 0xdd, 0x41, 0xc1, 0x38, 0x3f, 0xd3, 0x84, 0x7e, 0xe2, 0xe7,
-       0xa4, 0x29, 0xc1, 0x76, 0x12, 0x6c, 0xd6, 0xd3, 0x27, 0xad, 0x50, 0x99,
-       0x0c, 0x6e, 0x0b, 0xdb, 0x15, 0xcf, 0xc1, 0xfd, 0xf1, 0x50, 0x07, 0xb9,
-       0x73, 0x72, 0x7b, 0x45, 0x9e, 0xe2, 0x5b, 0xd1, 0x07, 0xc9, 0x18, 0x84,
-       0xbe, 0xc2, 0xbc, 0x3d, 0xa0, 0xf6, 0x89, 0xb6, 0xf3, 0xf1, 0x84, 0x3a,
-       0x0e, 0x8a, 0xf9, 0x94, 0xc7, 0x9a, 0xbf, 0xf1, 0xf7, 0xf3, 0x2e, 0xb2,
-       0xfd, 0x6a, 0xfe, 0x9a, 0x62, 0x41, 0x22, 0x63, 0x46, 0x90, 0xce, 0x57,
-       0xd6, 0xf2, 0xbf, 0x78, 0xe5, 0xba, 0x6e, 0xdf, 0x60, 0xae, 0xeb, 0x4f,
-       0x76, 0xc8, 0xdc, 0x32, 0x67, 0x5f, 0xfe, 0x93, 0xfb, 0xe2, 0x85, 0xc9,
-       0x5a, 0x70, 0x22, 0x8f, 0xb7, 0x46, 0x3f, 0x8b, 0x7e, 0x9e, 0xee, 0x84,
-       0x23, 0x2a, 0x66, 0x09, 0x31, 0x4a, 0x0f, 0x2a, 0xbe, 0xd6, 0xba, 0x9f,
-       0x3c, 0x74, 0xff, 0xa3, 0x22, 0x56, 0x53, 0xae, 0x1d, 0x43, 0x8a, 0x1e,
-       0xa0, 0x59, 0xc4, 0x41, 0xb3, 0x01, 0x07, 0xcd, 0x0c, 0x75, 0xbc, 0x4d,
-       0x9c, 0x9f, 0xaf, 0x3c, 0xb5, 0x5d, 0xe6, 0x8b, 0x63, 0x2f, 0xf1, 0x92,
-       0x3a, 0x5e, 0x6f, 0xbc, 0x56, 0x98, 0x82, 0xc2, 0xdf, 0xe4, 0x18, 0xeb,
-       0xcb, 0x44, 0xf6, 0x81, 0x70, 0x2b, 0x0d, 0x5e, 0x73, 0x5c, 0x47, 0x1f,
-       0xc7, 0x1d, 0x7d, 0x1c, 0x75, 0xf4, 0x71, 0x6f, 0x9b, 0x3e, 0xb2, 0x8e,
-       0xe7, 0xf7, 0x9c, 0xad, 0x7e, 0xdc, 0xbe, 0xa2, 0x9f, 0xc8, 0x23, 0x06,
-       0x3d, 0xb7, 0x52, 0x2e, 0x1c, 0x51, 0x6b, 0xc7, 0x2f, 0x55, 0x2e, 0xba,
-       0x57, 0x9f, 0xff, 0x8e, 0xda, 0xcf, 0x9b, 0x93, 0x57, 0x9d, 0xf9, 0xc7,
-       0xdf, 0xa5, 0xa4, 0xcc, 0x23, 0x57, 0xb2, 0x7d, 0xb9, 0x8d, 0x1f, 0x1a,
-       0xf1, 0x1c, 0xc0, 0x20, 0xc2, 0x2e, 0xdc, 0x2d, 0x6b, 0xc1, 0x05, 0x68,
-       0xa9, 0x9e, 0xcb, 0xeb, 0x57, 0xb9, 0x3b, 0xc7, 0xc3, 0xf7, 0x37, 0x8f,
-       0x17, 0xd7, 0xff, 0x4c, 0xf8, 0xf2, 0xe4, 0xfe, 0xd1, 0x8a, 0xca, 0x47,
-       0xb6, 0x4c, 0xc4, 0x06, 0x2c, 0x2e, 0xc3, 0xff, 0xda, 0x2e, 0x77, 0x57,
-       0xea, 0xa2, 0x4c, 0xbd, 0x3e, 0x4a, 0x59, 0xe4, 0x35, 0x48, 0xff, 0x98,
-       0xcc, 0xbf, 0x5d, 0x5c, 0xbe, 0x25, 0x72, 0x5e, 0x13, 0x2a, 0x8f, 0x37,
-       0x43, 0x3d, 0x02, 0xe7, 0x7e, 0xfc, 0xfc, 0xdb, 0x17, 0xc2, 0x9b, 0xcf,
-       0xbf, 0x75, 0xde, 0xb3, 0xb9, 0xfc, 0xdb, 0x10, 0x8f, 0xdd, 0x58, 0x90,
-       0xf9, 0xb7, 0xcd, 0x7b, 0x32, 0x32, 0xff, 0x36, 0xe3, 0xc0, 0x0f, 0x12,
-       0xaf, 0xbf, 0xe5, 0x88, 0xdf, 0x96, 0xb9, 0xb5, 0x8b, 0x75, 0xcc, 0x2a,
-       0x73, 0x6b, 0x65, 0xbc, 0xb7, 0xb3, 0x0e, 0x8c, 0xdc, 0xfb, 0x91, 0xef,
-       0xd9, 0xe6, 0xda, 0xfb, 0x91, 0x39, 0xb5, 0xa6, 0xd1, 0xce, 0x86, 0xc3,
-       0x1a, 0x81, 0x7a, 0x08, 0x71, 0xe6, 0xdd, 0xad, 0x6d, 0xea, 0x21, 0xc4,
-       0xdb, 0xd4, 0x43, 0x70, 0xea, 0x7e, 0x27, 0xc6, 0x02, 0x26, 0xc6, 0xda,
-       0x08, 0x2c, 0x8c, 0x7a, 0x06, 0x51, 0x3a, 0x5f, 0xc7, 0x9e, 0x0f, 0x52,
-       0x5a, 0x61, 0xcf, 0xf3, 0x15, 0xad, 0x8f, 0x46, 0x5d, 0xfa, 0xc8, 0x0b,
-       0x8b, 0x5a, 0x2a, 0xce, 0x47, 0xcb, 0x6b, 0xd6, 0x21, 0xaf, 0x59, 0x0f,
-       0x79, 0xc5, 0x3d, 0xd9, 0x36, 0xfd, 0xfe, 0xa5, 0xba, 0x07, 0xff, 0x4f,
-       0x46, 0x50, 0xb3, 0x85, 0x68, 0xf7, 0x80, 0xc2, 0x7f, 0x0e, 0x79, 0x3d,
-       0xcb, 0xf2, 0xaa, 0xaf, 0xa3, 0xbf, 0xed, 0x6c, 0x00, 0x8d, 0x19, 0x87,
-       0x7c, 0x87, 0xaf, 0xbd, 0x21, 0xe2, 0xa4, 0x9a, 0xed, 0x45, 0x8d, 0x27,
-       0xf6, 0x09, 0x59, 0xba, 0xe3, 0x47, 0xdc, 0x8a, 0xbe, 0x16, 0x52, 0x7e,
-       0x32, 0x4d, 0x8b, 0xce, 0x26, 0xcc, 0xd1, 0xc0, 0x1b, 0x22, 0xc6, 0xd7,
-       0xd1, 0xb7, 0x7f, 0xe5, 0xbe, 0xe9, 0xeb, 0x7a, 0xcd, 0x7c, 0xa7, 0xc9,
-       0x9f, 0x71, 0xa3, 0xa9, 0xee, 0x1f, 0x7c, 0x47, 0xdb, 0xd2, 0x86, 0x9d,
-       0x12, 0x31, 0xa6, 0x7d, 0x36, 0xfc, 0x64, 0x09, 0x96, 0xfd, 0xbe, 0x34,
-       0xe2, 0x99, 0xfb, 0xae, 0x98, 0x74, 0xa2, 0x70, 0x7e, 0x8f, 0xe4, 0x95,
-       0x0b, 0xa2, 0xa6, 0x25, 0x6a, 0x20, 0x26, 0x79, 0x7d, 0x4e, 0x30, 0xe8,
-       0x9c, 0xab, 0x76, 0xd1, 0x22, 0xa3, 0x7b, 0xbf, 0x5d, 0x16, 0xbe, 0x3e,
-       0xd6, 0x49, 0x45, 0xd4, 0x36, 0x35, 0x16, 0x3a, 0xf9, 0xb9, 0x83, 0xb4,
-       0x54, 0x1a, 0x17, 0x35, 0xa1, 0x64, 0x7d, 0x11, 0xb4, 0xf5, 0x51, 0xbf,
-       0xfd, 0x0d, 0xa6, 0xdd, 0xd7, 0x44, 0x8c, 0xe5, 0x62, 0xf1, 0x82, 0xfc,
-       0x2c, 0x3f, 0xa5, 0xde, 0xc1, 0xef, 0xab, 0xfe, 0x98, 0xe2, 0xfd, 0xa6,
-       0xc3, 0x96, 0x73, 0xfe, 0x79, 0xe3, 0x95, 0x63, 0x9b, 0xc2, 0x2b, 0xd9,
-       0x74, 0x03, 0xaf, 0x38, 0x9f, 0xad, 0xb1, 0xcb, 0xe4, 0xa0, 0xac, 0xf7,
-       0x00, 0x1a, 0x6c, 0x05, 0x16, 0x4b, 0x83, 0x96, 0x46, 0xcc, 0x8a, 0x24,
-       0xfc, 0x33, 0x94, 0xaf, 0x5e, 0xa7, 0x4c, 0x11, 0x98, 0x99, 0x3f, 0xcb,
-       0xe7, 0x76, 0x4a, 0x1f, 0x8d, 0xbe, 0x07, 0x7a, 0x65, 0x07, 0xb7, 0xff,
-       0xeb, 0x41, 0x19, 0x97, 0xed, 0xbc, 0xde, 0xcb, 0xd7, 0xbf, 0x10, 0x69,
-       0xbe, 0xbe, 0x85, 0xaf, 0xf7, 0xa7, 0x31, 0x87, 0xc6, 0x15, 0xf8, 0x25,
-       0x27, 0x29, 0xc7, 0xf3, 0x93, 0xaf, 0xf2, 0xda, 0x7a, 0x95, 0xf5, 0x55,
-       0x45, 0xb7, 0x1b, 0x40, 0xce, 0x8e, 0x98, 0x13, 0x83, 0xdb, 0x5c, 0x2c,
-       0x4c, 0x71, 0xbb, 0x21, 0xf2, 0x5f, 0x35, 0x29, 0x5f, 0xd1, 0xbc, 0xaa,
-       0xe3, 0xed, 0xdf, 0x18, 0x90, 0x31, 0x55, 0xef, 0xec, 0x94, 0xf4, 0x9b,
-       0x14, 0x3e, 0x4f, 0xc4, 0x73, 0x3c, 0x23, 0xf8, 0xd0, 0x9a, 0x31, 0xeb,
-       0xef, 0xdf, 0x06, 0xbe, 0x42, 0xdd, 0x54, 0x1e, 0x03, 0xeb, 0xc5, 0x98,
-       0x1d, 0xca, 0xd5, 0x63, 0xd5, 0x9e, 0xdb, 0x2d, 0xef, 0xff, 0xe9, 0x80,
-       0xac, 0x55, 0x7a, 0x5b, 0x9d, 0xeb, 0x35, 0x07, 0xf1, 0xcb, 0x3e, 0x41,
-       0x1b, 0xff, 0x02, 0xf4, 0xa5, 0xc1, 0xc7, 0x3c, 0x9e, 0x34, 0xfa, 0xf8,
-       0xb3, 0x01, 0x5d, 0x9f, 0x50, 0x8e, 0xeb, 0x28, 0xf7, 0x37, 0xc5, 0xe3,
-       0xd2, 0xd7, 0xe3, 0x7c, 0xee, 0x35, 0xbf, 0x78, 0x56, 0x30, 0x2d, 0xeb,
-       0x8b, 0x05, 0xd3, 0x99, 0x49, 0x39, 0xcf, 0x0d, 0x9f, 0x6e, 0xa4, 0xee,
-       0xd3, 0x9d, 0x2b, 0xf4, 0x0f, 0xc2, 0xbf, 0x61, 0x5c, 0xe1, 0xf9, 0x0e,
-       0x3f, 0xc3, 0x6d, 0x91, 0xab, 0x90, 0xe3, 0xcf, 0x1e, 0x15, 0xd7, 0xd3,
-       0xca, 0x2b, 0x32, 0x4e, 0x42, 0xaf, 0x5b, 0xb8, 0x77, 0x80, 0x9f, 0x21,
-       0xd7, 0xae, 0xf6, 0xef, 0xa1, 0x96, 0x38, 0x98, 0x56, 0x1e, 0x5b, 0xcb,
-       0x0f, 0x2b, 0xf6, 0x13, 0x3d, 0xf8, 0x6c, 0xad, 0x7a, 0x06, 0xef, 0x08,
-       0x3f, 0x5a, 0xb2, 0x45, 0x5e, 0x21, 0xc7, 0x01, 0xfa, 0xce, 0x7c, 0x96,
-       0xb6, 0xf0, 0x5c, 0x7d, 0xc3, 0xf8, 0x35, 0xec, 0xb7, 0x93, 0x8c, 0x79,
-       0x62, 0x1a, 0x17, 0xec, 0xc9, 0xb3, 0x06, 0xd3, 0xb9, 0x90, 0xad, 0x05,
-       0xec, 0x1e, 0xea, 0x64, 0x59, 0xfd, 0x22, 0x8d, 0xb1, 0xfd, 0x07, 0x99,
-       0xb5, 0x23, 0x29, 0x82, 0xbc, 0x59, 0xa1, 0xc3, 0xcc, 0x13, 0xc9, 0x2a,
-       0xf8, 0xd9, 0xa0, 0x27, 0x4a, 0x44, 0x8f, 0x97, 0xc6, 0x42, 0xdf, 0x27,
-       0xdb, 0x6c, 0x7c, 0x6f, 0x85, 0x12, 0xdc, 0x8f, 0x54, 0xf5, 0x77, 0xe8,
-       0x43, 0x51, 0xe7, 0x04, 0x74, 0xd4, 0xf3, 0xfe, 0xdb, 0x74, 0x3a, 0x8d,
-       0x7e, 0x6f, 0x5c, 0x3e, 0x4f, 0x6c, 0x4a, 0x3e, 0x83, 0x1e, 0xf2, 0xf9,
-       0xea, 0xa0, 0xe4, 0x9b, 0x1a, 0xf3, 0x68, 0x90, 0x66, 0x8b, 0x88, 0x01,
-       0x7b, 0x18, 0x75, 0xa7, 0x8a, 0x19, 0xd6, 0x4b, 0x99, 0x86, 0x5e, 0xba,
-       0x94, 0xf0, 0xc7, 0x21, 0xe3, 0xa8, 0xcb, 0xa6, 0xe2, 0x7e, 0x30, 0x8e,
-       0xdd, 0x34, 0xb6, 0xb0, 0x95, 0xef, 0xa5, 0x95, 0xc4, 0x74, 0x5c, 0xe5,
-       0xfa, 0x5b, 0x66, 0x92, 0xf5, 0xe3, 0x1c, 0xcb, 0x72, 0xae, 0xf8, 0x00,
-       0x2d, 0x86, 0x87, 0x69, 0x74, 0x41, 0xd7, 0x37, 0xc1, 0x58, 0xff, 0x6d,
-       0x48, 0xea, 0x24, 0x3d, 0xee, 0x5f, 0x11, 0xbe, 0x0b, 0xf3, 0xfa, 0xa7,
-       0x35, 0xee, 0xad, 0xeb, 0xe8, 0xa5, 0xbf, 0x52, 0x32, 0x5b, 0xbb, 0x91,
-       0x88, 0x52, 0x36, 0x31, 0xfd, 0x97, 0x82, 0xff, 0x47, 0xaf, 0xc3, 0x0f,
-       0x07, 0x1d, 0x6d, 0x52, 0xba, 0xe0, 0xa6, 0xc5, 0x30, 0x8f, 0x1b, 0xdf,
-       0xd7, 0xfe, 0x79, 0x36, 0xfa, 0x94, 0x58, 0xfb, 0xc7, 0xae, 0x73, 0x3b,
-       0xb1, 0x36, 0x69, 0xbd, 0xe1, 0xc5, 0x87, 0xba, 0x8e, 0xa5, 0xe6, 0x45,
-       0x19, 0xeb, 0xc9, 0xf8, 0x2d, 0x94, 0xf6, 0xbb, 0x79, 0xf2, 0x23, 0x3a,
-       0x36, 0x6f, 0xd2, 0xf1, 0x82, 0xf5, 0x7c, 0x96, 0x66, 0x58, 0xae, 0x9d,
-       0xeb, 0x05, 0xb7, 0x27, 0xf0, 0x59, 0x8c, 0x65, 0x9f, 0xed, 0xe6, 0xa2,
-       0x29, 0xe3, 0xee, 0x44, 0xed, 0xb9, 0x2e, 0xa1, 0x47, 0x43, 0xf6, 0x3f,
-       0x0d, 0xea, 0xf5, 0x20, 0x53, 0x44, 0x1e, 0x21, 0x7f, 0x96, 0xb9, 0x7d,
-       0x61, 0x90, 0x32, 0x25, 0x3c, 0x07, 0xeb, 0x1d, 0xfa, 0xce, 0xe7, 0x4b,
-       0x72, 0x5e, 0x47, 0xf9, 0xd9, 0xc8, 0xbb, 0x3f, 0x5e, 0x9d, 0x12, 0xb1,
-       0x77, 0xd0, 0xcd, 0x72, 0x3e, 0x63, 0x74, 0xd1, 0x53, 0xaf, 0x28, 0x4c,
-       0xe9, 0x90, 0xef, 0x8c, 0x90, 0xef, 0x98, 0x98, 0x8f, 0x4c, 0xc9, 0x60,
-       0xbc, 0xa6, 0x7d, 0x0f, 0xfd, 0x7c, 0x1e, 0x50, 0x3a, 0x04, 0xdf, 0x0d,
-       0xec, 0x14, 0x71, 0x89, 0x36, 0xae, 0xe3, 0x33, 0x46, 0xcf, 0x30, 0xee,
-       0x7c, 0xb6, 0xd0, 0x45, 0xb7, 0x8a, 0x5d, 0xf4, 0x66, 0x71, 0x98, 0x6e,
-       0xce, 0x6f, 0xa7, 0x8b, 0x8c, 0x99, 0x2f, 0xda, 0x01, 0x33, 0xc7, 0xf6,
-       0xc5, 0x0b, 0x51, 0x11, 0x33, 0xc4, 0x72, 0x87, 0xf6, 0xc0, 0x7f, 0x89,
-       0x5d, 0xcc, 0x73, 0x8c, 0xbd, 0xbb, 0xe9, 0x03, 0x7e, 0x67, 0xae, 0xa0,
-       0x63, 0x1d, 0xe0, 0x93, 0x1f, 0xaf, 0xe3, 0xd7, 0xf5, 0x79, 0x24, 0xb4,
-       0x0e, 0x8f, 0xc4, 0x84, 0xae, 0xcf, 0xcf, 0xf3, 0xf7, 0xf3, 0xf0, 0x9f,
-       0x33, 0xbd, 0x59, 0x3f, 0x7f, 0x3d, 0x80, 0xf6, 0xb8, 0x66, 0xcb, 0x58,
-       0x49, 0x31, 0xb6, 0x08, 0x9f, 0x83, 0xb6, 0x11, 0x45, 0x87, 0x6e, 0x1e,
-       0x9f, 0x4f, 0xb4, 0xcf, 0x2c, 0x75, 0xd3, 0x99, 0x12, 0x63, 0x90, 0x92,
-       0x9f, 0x6d, 0x18, 0xb4, 0x0d, 0xec, 0xd5, 0xf5, 0x5f, 0x2f, 0x72, 0xdf,
-       0x73, 0x25, 0x89, 0x41, 0x72, 0x4b, 0xbd, 0x94, 0x2f, 0xf5, 0xa8, 0xf3,
-       0x07, 0x44, 0x8c, 0xbb, 0xac, 0x63, 0x84, 0xef, 0xd6, 0xd2, 0x6f, 0x6f,
-       0x31, 0x4f, 0x61, 0x4d, 0x95, 0x76, 0x29, 0x74, 0xcd, 0x8d, 0x96, 0xba,
-       0xc4, 0xe0, 0xb9, 0x19, 0xfa, 0x2e, 0xaf, 0xb7, 0xa3, 0x57, 0xe1, 0x3f,
-       0xfe, 0x2a, 0xf8, 0xa6, 0x0c, 0x1e, 0x1b, 0xbd, 0x8a, 0xba, 0x48, 0x7e,
-       0x91, 0xe7, 0x94, 0x0c, 0x4f, 0x8a, 0xdc, 0x10, 0x29, 0xa3, 0x27, 0x45,
-       0x2d, 0xba, 0x1f, 0x0a, 0xdd, 0x64, 0x65, 0x4d, 0x03, 0x78, 0x04, 0x3e,
-       0x18, 0x19, 0x83, 0x75, 0xc2, 0xee, 0x7b, 0x6b, 0x20, 0x36, 0x41, 0xf1,
-       0x41, 0xf0, 0xbd, 0x94, 0x59, 0x55, 0x5f, 0x40, 0xe8, 0xfb, 0xd0, 0x3e,
-       0x9d, 0x2f, 0xa9, 0xcf, 0xf5, 0x5a, 0xa1, 0xcf, 0x7b, 0x5c, 0xdf, 0x87,
-       0x5c, 0xdf, 0xd7, 0xe3, 0xe5, 0x78, 0xcd, 0xe3, 0x75, 0x9e, 0x64, 0x8d,
-       0xa2, 0xcc, 0x82, 0xe4, 0xbf, 0xd0, 0xbe, 0xf1, 0xd0, 0x97, 0x15, 0x06,
-       0xcf, 0x2c, 0x8f, 0x45, 0xfa, 0x8c, 0x1e, 0x7f, 0x66, 0xea, 0xef, 0x6b,
-       0xf1, 0x34, 0x70, 0xd1, 0xdc, 0x4e, 0xa9, 0xe3, 0xd0, 0xaf, 0x6c, 0x14,
-       0xd0, 0xed, 0xe4, 0x72, 0x0f, 0xad, 0x88, 0x9a, 0x5c, 0xc0, 0x18, 0xb8,
-       0x1f, 0xcf, 0xc9, 0x86, 0x3a, 0x08, 0x35, 0xd7, 0x21, 0xe3, 0x07, 0x22,
-       0xd7, 0x79, 0x3e, 0x53, 0xcb, 0xff, 0x55, 0x3b, 0x2d, 0x6a, 0xdc, 0xa0,
-       0x2d, 0x63, 0x48, 0x81, 0xf9, 0x19, 0xbf, 0x34, 0xd9, 0x55, 0x33, 0xe8,
-       0x67, 0x16, 0x7b, 0x2b, 0x86, 0xfd, 0x22, 0xcb, 0x98, 0xdc, 0x2b, 0x4f,
-       0xb9, 0xf6, 0xca, 0x4f, 0x8a, 0xbd, 0x72, 0xec, 0x93, 0x83, 0xae, 0xa0,
-       0xa5, 0x57, 0x4c, 0x0b, 0xe6, 0x31, 0xca, 0xf3, 0x68, 0xd2, 0xc5, 0x6b,
-       0x42, 0xdf, 0x44, 0x93, 0x7e, 0x19, 0x5f, 0x9d, 0xa2, 0xac, 0x88, 0xbf,
-       0x96, 0x9f, 0x71, 0x23, 0x61, 0x5b, 0x93, 0xab, 0x8c, 0x29, 0x2a, 0xc5,
-       0x2d, 0x74, 0xb3, 0xdc, 0xc1, 0x98, 0xef, 0x6f, 0x69, 0xb5, 0x4c, 0x8c,
-       0x0d, 0xb7, 0x53, 0x3e, 0xca, 0xbc, 0x36, 0x19, 0xe4, 0x79, 0x65, 0x7c,
-       0x3b, 0xc9, 0xf2, 0xc7, 0x63, 0xa8, 0x94, 0x6a, 0xef, 0xe7, 0xa2, 0x71,
-       0x33, 0x31, 0xdd, 0xc3, 0xf6, 0x4b, 0x88, 0xff, 0x6d, 0xfe, 0xff, 0x6c,
-       0x04, 0xb4, 0x59, 0x5c, 0xc2, 0xf7, 0x8c, 0x7d, 0x0a, 0xb5, 0xf7, 0x67,
-       0xb9, 0xcd, 0xec, 0x34, 0xec, 0x20, 0xd8, 0x7b, 0x36, 0xff, 0xcb, 0x36,
-       0x15, 0xe6, 0xbb, 0xdc, 0xb5, 0x6c, 0xc4, 0x10, 0x3a, 0x1e, 0x75, 0x5d,
-       0xc6, 0xd4, 0x67, 0xdc, 0x98, 0xe5, 0xbe, 0xdc, 0x24, 0x3c, 0xc3, 0xa4,
-       0x4c, 0x74, 0x1f, 0xcb, 0xc1, 0x76, 0xfe, 0x44, 0x3e, 0xd6, 0x56, 0xca,
-       0x4f, 0x8d, 0xab, 0x7c, 0xac, 0x48, 0x9b, 0x7c, 0x2c, 0xdc, 0xc7, 0x38,
-       0x60, 0xbe, 0x76, 0x6f, 0x36, 0xea, 0x7c, 0x2f, 0x19, 0x99, 0xe8, 0x36,
-       0x81, 0x99, 0x2a, 0x4b, 0xfb, 0xb9, 0x0f, 0x71, 0x33, 0x33, 0xcd, 0x7d,
-       0x2d, 0x39, 0xfb, 0x5f, 0xbb, 0x97, 0x8c, 0xa2, 0x9d, 0xdf, 0xd5, 0x2e,
-       0x4e, 0xa2, 0xed, 0x12, 0xda, 0xd7, 0xfe, 0x27, 0x11, 0xd5, 0xe3, 0x74,
-       0xde, 0x8b, 0xf1, 0x40, 0xbe, 0xf8, 0xb3, 0x72, 0x9b, 0x6e, 0x16, 0x61,
-       0x8f, 0x1b, 0xcc, 0xf7, 0xe8, 0x91, 0x49, 0xd9, 0x0a, 0x63, 0xc0, 0x6b,
-       0x7b, 0x7d, 0xab, 0xc5, 0x37, 0x6a, 0x99, 0xa6, 0xd8, 0x96, 0x66, 0x3f,
-       0xbc, 0xb4, 0xc1, 0x86, 0xc9, 0xbe, 0x82, 0x35, 0x14, 0xeb, 0x67, 0xb6,
-       0xe6, 0xb7, 0x81, 0xf7, 0x60, 0x1b, 0x5d, 0x60, 0xfd, 0x25, 0xe3, 0x93,
-       0x58, 0x97, 0xb2, 0x0e, 0x93, 0xf2, 0x93, 0x6a, 0xfa, 0x39, 0x04, 0xc9,
-       0xc3, 0xa3, 0x8d, 0xb8, 0x48, 0xc7, 0xfe, 0x7a, 0xc0, 0xb1, 0xbf, 0x1e,
-       0x72, 0xc4, 0x45, 0x86, 0x05, 0x3e, 0x6b, 0x60, 0xaa, 0xb0, 0xc2, 0x54,
-       0xc0, 0x5e, 0x52, 0xb7, 0x2d, 0xd6, 0x75, 0xdb, 0x8e, 0x75, 0x74, 0x9b,
-       0x97, 0xad, 0xba, 0xa2, 0xf4, 0x88, 0x15, 0xc5, 0x1a, 0x73, 0x83, 0xf5,
-       0xc5, 0xeb, 0xd5, 0x69, 0xd6, 0x23, 0x51, 0xd6, 0x23, 0x53, 0xac, 0x47,
-       0x26, 0x59, 0x8f, 0xd8, 0x4c, 0x03, 0x93, 0xc7, 0xfe, 0x11, 0xeb, 0x69,
-       0xac, 0x1f, 0x33, 0xf4, 0x4c, 0x15, 0x3a, 0x79, 0x8a, 0x31, 0xd0, 0x47,
-       0xb4, 0x3a, 0xdf, 0xcb, 0xfc, 0x2b, 0x71, 0x4f, 0xb3, 0x5d, 0x83, 0xda,
-       0x2b, 0xf0, 0x17, 0xff, 0x39, 0xf4, 0xce, 0x2b, 0x59, 0x1a, 0xf1, 0xdd,
-       0x2c, 0x82, 0xce, 0xab, 0xa8, 0x55, 0xf1, 0x12, 0x64, 0x1b, 0x35, 0x82,
-       0x7f, 0x30, 0x31, 0xc3, 0x7d, 0x1f, 0xf1, 0xe5, 0x79, 0x5e, 0xbe, 0x1d,
-       0xcd, 0x86, 0xfa, 0x59, 0x06, 0x8e, 0x2b, 0x19, 0x38, 0xde, 0x90, 0x81,
-       0x6c, 0x8e, 0x47, 0xd2, 0xb7, 0xb0, 0x9d, 0xc6, 0x0f, 0x26, 0x76, 0xf5,
-       0xb1, 0xfc, 0x22, 0x66, 0xa2, 0x51, 0xbf, 0xc7, 0x4f, 0xa7, 0xc3, 0x41,
-       0x55, 0xf7, 0xc7, 0x14, 0x39, 0xef, 0xf9, 0xe2, 0xbb, 0x8c, 0x4b, 0x58,
-       0x4e, 0x43, 0x38, 0xbf, 0x0c, 0xbf, 0x28, 0xdb, 0x0d, 0xdd, 0xc2, 0xaf,
-       0xb4, 0x28, 0xda, 0xe2, 0xdc, 0x9a, 0x64, 0x1d, 0x17, 0x5d, 0x31, 0xac,
-       0x99, 0xb8, 0xf1, 0x9b, 0xc3, 0xa8, 0xe1, 0xfe, 0x83, 0xea, 0xe7, 0x86,
-       0xe5, 0xde, 0x5c, 0x72, 0x97, 0xd4, 0x27, 0xcc, 0xa3, 0xe1, 0xb8, 0xb0,
-       0xdd, 0x3a, 0xae, 0xc8, 0xf5, 0x73, 0x91, 0xe7, 0xbb, 0x12, 0x9d, 0xe4,
-       0xf9, 0xee, 0x51, 0x6b, 0x67, 0x96, 0xbf, 0x17, 0xeb, 0x32, 0xaf, 0xa1,
-       0xc3, 0xa8, 0x7f, 0x1f, 0x12, 0x75, 0x22, 0x4e, 0xa2, 0x0e, 0x4f, 0x02,
-       0xcf, 0x63, 0xee, 0x85, 0xfe, 0xf8, 0x07, 0x5e, 0xa3, 0xf1, 0x5e, 0xf0,
-       0x23, 0x1f, 0x97, 0x67, 0xe8, 0x52, 0x41, 0xf7, 0xe1, 0x3d, 0x32, 0xbe,
-       0x8b, 0x7e, 0xf8, 0x68, 0x87, 0xfd, 0x9e, 0xc8, 0x05, 0x31, 0xfe, 0xc4,
-       0xdd, 0xa7, 0xa3, 0xaa, 0x4f, 0xa8, 0x75, 0xd9, 0x85, 0xda, 0x3e, 0x84,
-       0x9a, 0x48, 0x8b, 0xa2, 0x16, 0x65, 0xa7, 0xb0, 0x59, 0x17, 0x85, 0xed,
-       0xb1, 0x7f, 0x57, 0xa3, 0x3e, 0xe6, 0x7e, 0xd7, 0xb5, 0x3b, 0xbc, 0x6e,
-       0x1d, 0x12, 0x18, 0x6d, 0x14, 0xf5, 0xda, 0x45, 0x5e, 0xea, 0x8c, 0xf8,
-       0xce, 0x58, 0xc0, 0x77, 0x0f, 0xa9, 0xef, 0x3e, 0x2f, 0xb0, 0xb1, 0x11,
-       0xeb, 0x66, 0xbd, 0x28, 0xf8, 0x9d, 0xe7, 0xd9, 0x9e, 0x64, 0x7e, 0x8f,
-       0x54, 0xf8, 0xb9, 0xa7, 0x05, 0x3d, 0x35, 0x3d, 0x40, 0x0b, 0xc8, 0x40,
-       0x8f, 0xe2, 0x7f, 0xcb, 0x4c, 0xf9, 0xf5, 0xb8, 0xdb, 0xd1, 0x99, 0xb1,
-       0x4e, 0x01, 0x63, 0xc5, 0x98, 0x4c, 0x5f, 0xbc, 0x1c, 0xf1, 0xe5, 0xe6,
-       0x61, 0xeb, 0x20, 0xdf, 0x65, 0x0f, 0xe2, 0xa9, 0xb8, 0x0f, 0x3b, 0x29,
-       0x9e, 0x46, 0xbf, 0xd0, 0x4e, 0xd3, 0xc0, 0x76, 0xd1, 0xc2, 0x79, 0xdf,
-       0x76, 0x75, 0x5f, 0xb7, 0x98, 0x0b, 0x32, 0xf0, 0x1e, 0xfd, 0x6e, 0xbc,
-       0x17, 0xef, 0xc7, 0x7d, 0x78, 0x9e, 0x7c, 0xee, 0x00, 0xeb, 0xed, 0xc4,
-       0xb4, 0x7c, 0x96, 0x71, 0x5d, 0x7e, 0x37, 0x60, 0x7b, 0xf7, 0x57, 0xce,
-       0x9f, 0x4f, 0xd5, 0xf1, 0xc1, 0xfc, 0x6d, 0xa7, 0xb2, 0xf0, 0x7d, 0xe2,
-       0xbb, 0x11, 0x9f, 0xb0, 0x6b, 0x6d, 0xfe, 0xe4, 0x79, 0x9d, 0xe3, 0xf3,
-       0x33, 0xc5, 0xdb, 0xc2, 0x66, 0xcf, 0xa5, 0x47, 0x7c, 0xe5, 0x32, 0xc6,
-       0x3b, 0xe2, 0x4b, 0xb1, 0x0c, 0x24, 0x8b, 0x89, 0x5a, 0x5e, 0xe2, 0x02,
-       0x3a, 0xdd, 0x6f, 0x85, 0x4e, 0x1b, 0xef, 0x0f, 0xcb, 0x9a, 0xb7, 0x38,
-       0x66, 0x39, 0x2c, 0xb0, 0x1c, 0x16, 0x58, 0x0e, 0x0b, 0x2c, 0x87, 0x6c,
-       0xab, 0xbe, 0x56, 0x60, 0x39, 0xe4, 0xb5, 0xe4, 0x55, 0x5e, 0x4b, 0xa4,
-       0xec, 0xc6, 0x95, 0x7f, 0x53, 0xcb, 0xae, 0x3b, 0x6f, 0x53, 0xcb, 0x2a,
-       0xd6, 0x6f, 0xf2, 0x1d, 0x99, 0x68, 0x96, 0xd9, 0x5b, 0x2c, 0xb3, 0x1d,
-       0xb1, 0x41, 0xba, 0x5b, 0xc2, 0x9c, 0x59, 0xe6, 0x1c, 0xeb, 0xea, 0x94,
-       0x1f, 0x58, 0x2b, 0xc0, 0xf2, 0x04, 0xac, 0x69, 0x31, 0xdd, 0x07, 0xe9,
-       0x1e, 0xeb, 0xeb, 0xbb, 0x25, 0xc8, 0xf0, 0x1e, 0x75, 0x6e, 0xb1, 0x0c,
-       0x63, 0xfd, 0xb3, 0x7d, 0xb7, 0x8a, 0x06, 0x63, 0xb2, 0x40, 0x28, 0x43,
-       0xd0, 0xa7, 0x02, 0xa7, 0xf1, 0xbc, 0xaf, 0xb0, 0xde, 0x87, 0x0f, 0x0f,
-       0xeb, 0xc5, 0x19, 0x1f, 0xaf, 0x17, 0x91, 0x9b, 0xac, 0x4f, 0xcf, 0x97,
-       0x6c, 0x96, 0xfb, 0x7e, 0xfa, 0x56, 0x09, 0xeb, 0x34, 0x68, 0xc4, 0xe7,
-       0x65, 0x12, 0xbe, 0x31, 0x23, 0x86, 0xb1, 0x8f, 0x67, 0x0d, 0xc1, 0x27,
-       0x7f, 0x0a, 0x3a, 0x30, 0xed, 0x5f, 0xdc, 0x85, 0xda, 0xf3, 0x71, 0xa3,
-       0x53, 0xf9, 0x1a, 0x71, 0x8c, 0xf6, 0x68, 0x0b, 0xba, 0xe1, 0xbc, 0xdd,
-       0xbe, 0x24, 0x7e, 0xb3, 0x21, 0x0a, 0xff, 0x9b, 0x4b, 0x7f, 0x5d, 0xe2,
-       0xfb, 0x05, 0xbd, 0x66, 0x12, 0x7e, 0xe4, 0x90, 0xd3, 0xd3, 0xfe, 0xd8,
-       0x0c, 0x3d, 0x5b, 0x45, 0xbf, 0xaf, 0x52, 0x3e, 0x0c, 0x7d, 0x64, 0x45,
-       0xef, 0x90, 0xa4, 0x5d, 0x37, 0xe3, 0xce, 0x27, 0xbc, 0x75, 0x9c, 0x99,
-       0x10, 0x38, 0xb9, 0x8b, 0xf5, 0x0b, 0x68, 0xf3, 0x13, 0xe6, 0x35, 0x7e,
-       0x5f, 0x41, 0xeb, 0xb7, 0x1f, 0xb3, 0xce, 0xc1, 0x9c, 0xe1, 0x7c, 0x6d,
-       0x9d, 0xb6, 0xaa, 0x74, 0x9a, 0xed, 0xd0, 0x69, 0xb9, 0xba, 0x4e, 0x63,
-       0xde, 0x10, 0xba, 0x0c, 0xba, 0xea, 0x51, 0xc6, 0x91, 0xf2, 0x18, 0xf8,
-       0x70, 0x87, 0xd0, 0x5d, 0xac, 0xfb, 0xd9, 0xae, 0x58, 0xac, 0x66, 0x7d,
-       0x87, 0x85, 0x0e, 0xd1, 0xfc, 0xbd, 0x7f, 0xb7, 0x94, 0x8b, 0x6e, 0xa1,
-       0x0f, 0x72, 0x27, 0xa1, 0xb7, 0xbc, 0xda, 0x8f, 0x73, 0x3b, 0xb4, 0xb7,
-       0x23, 0x2f, 0xb1, 0x3e, 0x5b, 0x8c, 0xc2, 0xa6, 0xed, 0x51, 0xb6, 0x0f,
-       0xea, 0x72, 0x61, 0xaf, 0x0b, 0x63, 0xd5, 0xfa, 0x6c, 0x40, 0xf9, 0x35,
-       0xe0, 0x87, 0xc4, 0x9c, 0xb7, 0xc5, 0x08, 0x26, 0x30, 0x02, 0xdf, 0x13,
-       0x60, 0x7a, 0x89, 0x1a, 0xe2, 0x44, 0xef, 0xd2, 0xaa, 0x90, 0x8d, 0x77,
-       0x05, 0x76, 0xc9, 0xf3, 0x77, 0xb3, 0xd3, 0x07, 0x45, 0x3f, 0xf3, 0x4b,
-       0x0d, 0xfd, 0x38, 0x57, 0x78, 0x0f, 0xeb, 0x86, 0xe8, 0x6b, 0x65, 0x42,
-       0xea, 0xc0, 0xc5, 0x32, 0x6a, 0x80, 0x89, 0x3e, 0x73, 0x5f, 0xf5, 0x38,
-       0xd1, 0x0f, 0xad, 0x0f, 0x36, 0x22, 0x7b, 0x8c, 0x6b, 0xfb, 0x31, 0x47,
-       0x59, 0x07, 0x0f, 0x3d, 0xcb, 0xef, 0xc7, 0xb5, 0xf5, 0xc7, 0x73, 0xaf,
-       0x3e, 0x1e, 0xf8, 0xf6, 0x70, 0xcf, 0xbb, 0x74, 0x57, 0x8d, 0xe7, 0x6e,
-       0x7d, 0x3c, 0xcf, 0xa8, 0xf1, 0x50, 0xce, 0x88, 0x0d, 0x28, 0xdc, 0xbf,
-       0xe1, 0x67, 0x77, 0x27, 0x18, 0xc7, 0xe4, 0x96, 0x40, 0xe7, 0xfd, 0x8a,
-       0x9f, 0x9c, 0x7e, 0x54, 0x67, 0x5f, 0xad, 0xc9, 0x3b, 0xac, 0x7f, 0xef,
-       0x09, 0x1c, 0x33, 0xc2, 0x38, 0x06, 0xd7, 0x29, 0x0f, 0x3d, 0x9d, 0x0b,
-       0xa3, 0x4e, 0xed, 0x0c, 0x8f, 0x9b, 0xed, 0xb1, 0x69, 0xfe, 0x14, 0xfe,
-       0x35, 0x3c, 0x47, 0xdf, 0xff, 0x3c, 0xdd, 0x9b, 0x87, 0x2e, 0x07, 0x8e,
-       0x95, 0xb5, 0x6c, 0xef, 0x2d, 0x4b, 0xff, 0x6e, 0xca, 0xd3, 0xbf, 0x0b,
-       0xdf, 0xee, 0x34, 0x70, 0x7e, 0x08, 0x7e, 0xe0, 0xa4, 0xfa, 0xad, 0x8f,
-       0x5c, 0x15, 0xcf, 0xf2, 0xd2, 0x4b, 0x33, 0x8e, 0xd8, 0x38, 0xc4, 0xaa,
-       0x64, 0x59, 0xcf, 0xd8, 0xa1, 0x0e, 0x43, 0xe6, 0xdc, 0xdc, 0xa8, 0x6a,
-       0xec, 0x74, 0x94, 0xe7, 0xcc, 0x8e, 0x1a, 0x46, 0x4a, 0xf8, 0x1a, 0xba,
-       0xed, 0x1e, 0xea, 0xe2, 0x75, 0xf4, 0x2c, 0xa1, 0x96, 0x9a, 0x65, 0x62,
-       0x0f, 0xe0, 0x12, 0xf3, 0x64, 0x3e, 0x6a, 0x45, 0x1e, 0x17, 0x76, 0x29,
-       0xd6, 0x17, 0x03, 0x74, 0x62, 0x5a, 0xa3, 0x0f, 0x7c, 0xbc, 0x84, 0x3a,
-       0x9a, 0x51, 0x1e, 0x3f, 0xfc, 0xc7, 0x63, 0xe6, 0x9b, 0xbc, 0x2e, 0x5d,
-       0x12, 0x7e, 0x99, 0x0b, 0x94, 0x63, 0x39, 0x3d, 0x22, 0xe4, 0xd4, 0x18,
-       0x61, 0x29, 0x62, 0xb9, 0x42, 0x6c, 0xc2, 0xb8, 0xa8, 0xdb, 0x23, 0x6d,
-       0x1d, 0x1e, 0xe5, 0xb2, 0xaa, 0x87, 0x90, 0x86, 0xee, 0xd8, 0xb8, 0x4f,
-       0x22, 0xfd, 0x89, 0x7d, 0x31, 0x4e, 0x4c, 0xe6, 0xf6, 0x7d, 0xc3, 0xae,
-       0x33, 0x45, 0xbd, 0x48, 0xd0, 0x4e, 0xf8, 0x13, 0x8d, 0x29, 0xa6, 0x9b,
-       0xfe, 0xdd, 0x19, 0xa7, 0xdf, 0xe0, 0x9c, 0xc8, 0xeb, 0x7f, 0xa5, 0x2a,
-       0xd7, 0xe0, 0x1c, 0xdb, 0xf4, 0xf9, 0x83, 0x4e, 0x4c, 0x62, 0x15, 0x93,
-       0xc2, 0x97, 0xb3, 0x9b, 0x12, 0x0b, 0x53, 0xf4, 0x68, 0x01, 0x3a, 0x8c,
-       0xee, 0x24, 0x6c, 0xfc, 0xa2, 0x0c, 0x64, 0x7c, 0x8a, 0x52, 0x55, 0xd0,
-       0xc8, 0xc7, 0x58, 0x89, 0x79, 0xaf, 0x88, 0x3d, 0x7f, 0x3e, 0x2e, 0xe3,
-       0x77, 0x54, 0x7e, 0x5d, 0xf9, 0xcb, 0x87, 0x29, 0xb9, 0x40, 0xd9, 0x4c,
-       0xf4, 0x4b, 0xa2, 0xd6, 0x75, 0x26, 0x3a, 0xa1, 0x7c, 0x3b, 0x11, 0xbe,
-       0x0e, 0x7f, 0x99, 0x49, 0x5f, 0x2e, 0x58, 0xd9, 0x0c, 0x49, 0x9f, 0x05,
-       0x71, 0x1f, 0x0c, 0x5e, 0x7b, 0x77, 0xb0, 0x0e, 0x39, 0x21, 0xfc, 0x16,
-       0x8c, 0x54, 0xe6, 0xd1, 0x1e, 0x3e, 0x87, 0x7e, 0x82, 0x9d, 0x96, 0x29,
-       0x3e, 0xa5, 0xda, 0xd6, 0x28, 0xc4, 0xbc, 0x10, 0xfa, 0x55, 0x3b, 0x1b,
-       0x35, 0x1a, 0xf7, 0xc3, 0xe7, 0x71, 0x42, 0xe0, 0xc8, 0x11, 0xb6, 0x79,
-       0x44, 0xbb, 0xda, 0xac, 0xf0, 0x5f, 0xf0, 0x79, 0xf9, 0x81, 0x21, 0xfd,
-       0x9b, 0x08, 0xb8, 0x2e, 0xfd, 0x1a, 0xfc, 0xcc, 0x32, 0xf7, 0xa3, 0x29,
-       0x9e, 0x7e, 0x98, 0xe2, 0x9b, 0xf0, 0x33, 0x9d, 0xbc, 0xaf, 0x7e, 0x26,
-       0xa6, 0x35, 0xaf, 0x3d, 0x37, 0x58, 0x36, 0x5e, 0x5f, 0xd7, 0xfe, 0xfb,
-       0x50, 0xaf, 0xe1, 0x4c, 0xab, 0x90, 0xf8, 0xdd, 0x0c, 0x60, 0xf0, 0x7c,
-       0xf5, 0x71, 0xfc, 0x5e, 0x8c, 0x2f, 0x2d, 0xb0, 0x71, 0x84, 0xb1, 0x0d,
-       0x30, 0xce, 0x98, 0xd8, 0x17, 0x8b, 0x3f, 0x16, 0xf1, 0xe5, 0x97, 0x07,
-       0xc9, 0x0f, 0x7f, 0x9c, 0xad, 0x63, 0x29, 0xba, 0x45, 0xdc, 0xbb, 0xdc,
-       0x8f, 0xc4, 0xfa, 0x0c, 0x9d, 0x78, 0x87, 0xed, 0x86, 0x09, 0x15, 0x87,
-       0xd3, 0x21, 0x6a, 0x53, 0xc9, 0xbd, 0x54, 0xad, 0x53, 0x34, 0xef, 0xe9,
-       0xbd, 0x0e, 0xe7, 0x6f, 0x73, 0x41, 0x76, 0x9d, 0x98, 0x02, 0xfe, 0x29,
-       0x31, 0x47, 0x97, 0x88, 0xe4, 0x1c, 0x37, 0xf6, 0x31, 0xba, 0x78, 0x9e,
-       0x60, 0x0f, 0xc2, 0xef, 0xf7, 0x35, 0xfe, 0xc4, 0x7e, 0xc4, 0xd5, 0x21,
-       0xe0, 0xa8, 0x3e, 0x9b, 0x79, 0x66, 0x1a, 0xe7, 0x83, 0x6c, 0x9f, 0x69,
-       0xdc, 0x2b, 0x7d, 0x51, 0x6c, 0xb3, 0xa9, 0xf9, 0x82, 0x1f, 0x6a, 0x54,
-       0xd5, 0x29, 0xb0, 0xc8, 0xec, 0x07, 0x9d, 0x3e, 0x2d, 0x79, 0x5c, 0x6f,
-       0xef, 0x62, 0x23, 0xb1, 0x4e, 0xf8, 0xdd, 0x30, 0xd4, 0xeb, 0xdc, 0x0b,
-       0xda, 0xf3, 0x1c, 0x39, 0xf7, 0x36, 0x1e, 0xdf, 0xa5, 0x7f, 0xb3, 0xe8,
-       0xfe, 0xcc, 0xdb, 0x16, 0x8f, 0x79, 0xfb, 0xf9, 0x90, 0xdc, 0x3b, 0x7b,
-       0x58, 0xb5, 0xf1, 0x8a, 0x6f, 0x5d, 0xfe, 0x0e, 0xfc, 0x50, 0x8d, 0xfc,
-       0x8b, 0x77, 0x84, 0x5e, 0x69, 0xf5, 0x85, 0x47, 0x58, 0x9f, 0x4a, 0x39,
-       0x3e, 0xe1, 0x21, 0xc7, 0xfd, 0x31, 0xe0, 0x96, 0x8f, 0x2f, 0xc7, 0xc7,
-       0xdb, 0xca, 0xf1, 0x9e, 0x61, 0xe9, 0x8b, 0x6d, 0x95, 0x63, 0xe4, 0x00,
-       0x9d, 0xa8, 0xb6, 0xf3, 0x7b, 0x61, 0x1e, 0x90, 0xcb, 0xee, 0xf4, 0x95,
-       0x80, 0x66, 0xda, 0x5f, 0x82, 0x7d, 0x43, 0xf0, 0x25, 0xf6, 0x5e, 0x4e,
-       0x1a, 0xa9, 0x79, 0xf7, 0x5e, 0xea, 0x46, 0xee, 0xbd, 0xed, 0x71, 0x2f,
-       0xb0, 0x3b, 0x64, 0xc3, 0x8a, 0x48, 0x5f, 0x80, 0xa6, 0xdf, 0xb0, 0xef,
-       0x70, 0xc9, 0xca, 0x96, 0x09, 0xbe, 0xee, 0x30, 0x9d, 0xc3, 0xfe, 0xb4,
-       0xf2, 0x25, 0x1f, 0x2b, 0x48, 0x3a, 0x84, 0x0e, 0x0a, 0xfe, 0x00, 0xbe,
-       0x8d, 0xa4, 0xfd, 0x69, 0x9e, 0x63, 0xe9, 0x47, 0xce, 0x2c, 0x45, 0xd4,
-       0xbc, 0x71, 0x5b, 0x3c, 0xcf, 0x33, 0x5f, 0x10, 0xf3, 0x65, 0x3d, 0xbf,
-       0x52, 0x8f, 0x4f, 0xc6, 0xda, 0x50, 0xa3, 0xff, 0xe0, 0x75, 0xcf, 0x7f,
-       0x30, 0x24, 0x6a, 0x37, 0xdc, 0xa8, 0x1e, 0x64, 0xbc, 0x89, 0x39, 0x85,
-       0x0f, 0x52, 0xfb, 0x88, 0x1f, 0xda, 0x4b, 0xbd, 0x07, 0x18, 0x05, 0x18,
-       0x64, 0x33, 0xbe, 0x34, 0x0e, 0x22, 0xce, 0xdc, 0xe4, 0x7b, 0x50, 0x73,
-       0x6a, 0xdc, 0x4c, 0x51, 0x0f, 0xfc, 0x10, 0xa8, 0x25, 0x6d, 0xe6, 0x9a,
-       0x64, 0xec, 0x94, 0x90, 0xb1, 0xd4, 0xf2, 0x29, 0x25, 0x63, 0xa7, 0x94,
-       0x1f, 0xfe, 0x94, 0x92, 0xb1, 0x53, 0x4a, 0xc6, 0x4e, 0x29, 0x19, 0x3b,
-       0xc5, 0x7c, 0x3e, 0xc6, 0xf8, 0x16, 0x58, 0x44, 0xfb, 0x41, 0x7b, 0x29,
-       0x53, 0xc2, 0x75, 0xac, 0xcf, 0x6e, 0x39, 0x7b, 0x69, 0x44, 0xca, 0x19,
-       0x63, 0x13, 0x19, 0xaf, 0xc7, 0xef, 0xc2, 0x1c, 0xfc, 0x1e, 0xd3, 0xef,
-       0x23, 0x3a, 0x33, 0x8f, 0xbe, 0xfa, 0x28, 0x29, 0x6a, 0xc9, 0x76, 0x50,
-       0xc2, 0x89, 0x85, 0x43, 0xc8, 0x0f, 0x93, 0xb6, 0x5f, 0xb6, 0x6d, 0xae,
-       0x98, 0xe6, 0x93, 0x98, 0x9a, 0x2f, 0xb7, 0x5d, 0xd4, 0x45, 0xe9, 0x22,
-       0xe8, 0x8a, 0x98, 0x4a, 0x93, 0xe7, 0x46, 0xd0, 0x49, 0x86, 0x44, 0xb9,
-       0x68, 0x70, 0x4c, 0xd1, 0xe0, 0xdb, 0x62, 0x8c, 0x88, 0x49, 0x84, 0x2f,
-       0xb3, 0x3d, 0x1d, 0x72, 0x85, 0x31, 0x7e, 0x0e, 0xcb, 0xc2, 0xc1, 0x08,
-       0xeb, 0xa4, 0x8d, 0xd3, 0xa1, 0x31, 0xf6, 0x76, 0xba, 0x67, 0xa3, 0x79,
-       0x39, 0x77, 0x1c, 0x6b, 0x49, 0x44, 0xad, 0x23, 0x12, 0x17, 0x6f, 0xb1,
-       0x6b, 0x74, 0x34, 0xba, 0x97, 0x8f, 0xad, 0x74, 0x96, 0x0e, 0x90, 0xd1,
-       0x57, 0xa3, 0xbf, 0x60, 0x39, 0xe8, 0x66, 0x39, 0x38, 0xaa, 0xec, 0x92,
-       0xa3, 0x75, 0xbb, 0x64, 0xcf, 0x1e, 0xc4, 0x65, 0x64, 0xc4, 0xbe, 0xd7,
-       0x56, 0x55, 0x43, 0x00, 0xbe, 0x6f, 0x9c, 0x77, 0x51, 0x7c, 0x18, 0xe7,
-       0xf8, 0x2d, 0x22, 0x6b, 0x32, 0xee, 0x1b, 0xdf, 0x23, 0xb0, 0xbb, 0xcf,
-       0xc2, 0x3d, 0x47, 0xa5, 0xde, 0xf3, 0x91, 0x7f, 0xfc, 0x36, 0xe3, 0x89,
-       0x1a, 0x3d, 0xc1, 0xef, 0xcc, 0x17, 0xf7, 0xf1, 0xb3, 0x75, 0x4d, 0x09,
-       0x3b, 0x6e, 0xf8, 0xb6, 0x92, 0xbf, 0xaf, 0xdd, 0xbb, 0x2d, 0xc1, 0x8f,
-       0x8c, 0xa7, 0x8d, 0xd9, 0xe8, 0x7b, 0xb5, 0xd3, 0x27, 0xe1, 0x63, 0x87,
-       0x9c, 0x58, 0x21, 0xd3, 0xe7, 0x25, 0x1f, 0x12, 0x2b, 0x35, 0xe2, 0x63,
-       0x21, 0x2f, 0x35, 0xfa, 0x77, 0x1e, 0x5b, 0x88, 0xb0, 0x77, 0x22, 0x9f,
-       0x9f, 0xa6, 0x19, 0x91, 0x83, 0x8d, 0x38, 0xe9, 0x33, 0xf3, 0xfa, 0x5d,
-       0xb6, 0xe2, 0x8d, 0xcf, 0x20, 0xce, 0xad, 0xb8, 0x48, 0x6b, 0xaf, 0x39,
-       0xf0, 0xd7, 0x8d, 0x2d, 0xac, 0xf6, 0x85, 0x45, 0x4e, 0xf8, 0x76, 0xc6,
-       0x48, 0x3a, 0x1e, 0x7a, 0x9c, 0x9f, 0x0f, 0x3f, 0x5e, 0x80, 0x92, 0x57,
-       0xd0, 0xae, 0x93, 0x46, 0x17, 0x6a, 0x5f, 0xe0, 0xef, 0xc5, 0xfe, 0x65,
-       0x86, 0xba, 0xd5, 0xde, 0x44, 0x8f, 0xda, 0xcf, 0x8a, 0xb0, 0xec, 0x35,
-       0x72, 0x9d, 0x47, 0xeb, 0x3e, 0x3d, 0xc8, 0x84, 0xdb, 0xa7, 0xf7, 0xf4,
-       0x3a, 0xeb, 0xd5, 0x7a, 0x72, 0x80, 0x58, 0xd6, 0x2e, 0x52, 0xbe, 0x4a,
-       0x33, 0x4f, 0x1b, 0xcd, 0xe9, 0xdb, 0xf4, 0x3d, 0xdd, 0x9d, 0x31, 0xf3,
-       0xc2, 0x9b, 0x76, 0x50, 0xf1, 0x5f, 0x27, 0x9d, 0x29, 0x05, 0x79, 0xcd,
-       0x87, 0x6e, 0x05, 0xbd, 0xfc, 0xc3, 0xc8, 0x73, 0xf9, 0x7a, 0xa0, 0x93,
-       0x96, 0x96, 0x10, 0x6b, 0xf1, 0x47, 0x7b, 0x64, 0x7c, 0x71, 0x9a, 0xe9,
-       0x72, 0x80, 0xd7, 0x47, 0x43, 0xed, 0x1d, 0xe1, 0x1a, 0x74, 0x89, 0xa8,
-       0x37, 0x1a, 0xf8, 0xd2, 0x44, 0x90, 0xed, 0x02, 0xb9, 0xf7, 0x70, 0x88,
-       0x9f, 0xfd, 0xfd, 0x52, 0x1a, 0xfe, 0xb2, 0xd0, 0x11, 0x7e, 0x7e, 0x92,
-       0xf1, 0x44, 0x9c, 0x3a, 0xa9, 0xb2, 0xd4, 0xc9, 0x76, 0x41, 0x27, 0xe3,
-       0x89, 0xb1, 0xd0, 0xa8, 0x4f, 0xbc, 0x4b, 0xe4, 0xd4, 0x3c, 0x1c, 0x38,
-       0xc0, 0x7c, 0x85, 0x77, 0xbd, 0xae, 0xde, 0xe5, 0x7e, 0xc7, 0x2f, 0x6a,
-       0x38, 0x3f, 0xe2, 0x37, 0x2f, 0xdc, 0xc2, 0xef, 0x51, 0xcd, 0xcf, 0x30,
-       0x76, 0x0e, 0x53, 0x7e, 0xbe, 0x83, 0xc7, 0x10, 0x63, 0x3b, 0x22, 0xca,
-       0xe7, 0x8f, 0x50, 0xb6, 0x7a, 0x92, 0x7e, 0xbf, 0xea, 0xf4, 0x09, 0x3f,
-       0xc2, 0x7d, 0x96, 0x39, 0xfd, 0x5d, 0xdc, 0xaf, 0x0f, 0x6d, 0xb7, 0x8e,
-       0x09, 0x92, 0xff, 0x7b, 0x61, 0xea, 0x7c, 0x0e, 0xbe, 0x97, 0x1a, 0x15,
-       0xa3, 0xd6, 0xa5, 0x3b, 0x24, 0xfd, 0xcf, 0x2f, 0x88, 0xb8, 0x5a, 0xbe,
-       0x9f, 0x9f, 0x39, 0x87, 0x76, 0x2f, 0x98, 0x74, 0xd3, 0x96, 0xf4, 0x7e,
-       0x23, 0x10, 0x26, 0xff, 0xcb, 0x88, 0x7d, 0x02, 0x56, 0x33, 0x2f, 0xd8,
-       0xfb, 0x58, 0xbf, 0x3f, 0x87, 0xfb, 0xf8, 0xf3, 0x65, 0x9c, 0x07, 0x79,
-       0x9c, 0x58, 0xaf, 0x11, 0xef, 0x02, 0xbd, 0x78, 0x20, 0x12, 0x12, 0xfc,
-       0xf7, 0x08, 0xf3, 0x54, 0x87, 0xf0, 0x35, 0xf6, 0xa3, 0xad, 0x3d, 0xc4,
-       0xd8, 0xc2, 0xbc, 0x30, 0xb1, 0x0f, 0xe7, 0xf1, 0x3e, 0x3f, 0xd3, 0x48,
-       0xf2, 0x10, 0xc6, 0xd3, 0xc4, 0xdc, 0x81, 0x43, 0x13, 0xc4, 0xf3, 0x09,
-       0xfc, 0xc1, 0xf3, 0x19, 0x42, 0x7d, 0xa7, 0x20, 0xa5, 0xf8, 0x1d, 0xc9,
-       0x92, 0x1c, 0xf7, 0x5c, 0xd5, 0x4f, 0xd2, 0x4f, 0x75, 0x74, 0x44, 0xff,
-       0x9e, 0x21, 0x0d, 0xe2, 0xd9, 0x5a, 0x56, 0x70, 0xdc, 0x4b, 0x77, 0x4b,
-       0x3d, 0x74, 0x4f, 0xed, 0x69, 0xdd, 0x15, 0x76, 0x19, 0xeb, 0xf0, 0x74,
-       0x2f, 0xdd, 0x59, 0xea, 0x20, 0xea, 0x0f, 0x8a, 0x3d, 0xe7, 0xbb, 0xa5,
-       0x32, 0xbf, 0x3f, 0x31, 0x22, 0xfd, 0x3a, 0x0d, 0x1e, 0xb9, 0xeb, 0xc1,
-       0x23, 0x1f, 0x08, 0x1e, 0xd9, 0x37, 0xb2, 0x36, 0x8f, 0xec, 0x52, 0xb6,
-       0x48, 0x90, 0x3a, 0x15, 0x7f, 0xbc, 0xc4, 0xfc, 0xf1, 0x2c, 0xf3, 0xc7,
-       0xe1, 0x36, 0xfc, 0x61, 0xb8, 0xf8, 0xe3, 0x88, 0xe0, 0x8f, 0x87, 0x46,
-       0xd6, 0xe2, 0x8f, 0xc3, 0xfe, 0xb5, 0x7c, 0x4d, 0xe2, 0xb7, 0x3c, 0x2f,
-       0xcc, 0xd9, 0xbb, 0x99, 0xd7, 0x6d, 0xaa, 0xcc, 0x23, 0x67, 0x61, 0x25,
-       0x6a, 0xd0, 0xbf, 0x08, 0x9b, 0x6c, 0x55, 0xd8, 0xfc, 0x31, 0x11, 0xc3,
-       0xba, 0x28, 0xf8, 0x8b, 0xd7, 0xff, 0x18, 0x72, 0xaa, 0xdc, 0x73, 0xd1,
-       0x4d, 0x37, 0xa3, 0x98, 0x0b, 0x53, 0xcd, 0x05, 0xae, 0x75, 0xe9, 0xfa,
-       0x90, 0x01, 0xbe, 0x7e, 0xe1, 0x03, 0xf0, 0xe8, 0x72, 0x4f, 0x20, 0x59,
-       0xf8, 0xe6, 0x08, 0xf0, 0x5f, 0x7e, 0x99, 0x1c, 0xd7, 0x03, 0x7c, 0x3d,
-       0x2c, 0x7e, 0xfb, 0x09, 0xb2, 0xf2, 0x8f, 0x88, 0x71, 0x64, 0x9e, 0xbc,
-       0x59, 0x1a, 0xa6, 0x5b, 0xa5, 0xdd, 0xb4, 0x5a, 0x1a, 0xa1, 0x37, 0x45,
-       0x2d, 0x0d, 0x99, 0x1b, 0xb9, 0x2a, 0xe6, 0xc8, 0xa0, 0x43, 0x61, 0x6e,
-       0xb3, 0xb4, 0x9b, 0x56, 0x96, 0x34, 0x7f, 0x83, 0xb7, 0xc1, 0x2f, 0xf1,
-       0x3e, 0x99, 0x2f, 0xd7, 0xca, 0x33, 0xc9, 0x26, 0x9e, 0x91, 0xf7, 0x80,
-       0x57, 0xf2, 0xad, 0xb9, 0xbe, 0xdd, 0xa1, 0x18, 0x62, 0xf5, 0x82, 0xd4,
-       0x81, 0xb8, 0x45, 0xc3, 0x9a, 0x3c, 0xe4, 0x07, 0x86, 0xfe, 0x2a, 0xaf,
-       0xb9, 0x3c, 0x67, 0x36, 0xe2, 0x9c, 0x46, 0x18, 0x0f, 0x6f, 0x17, 0xf8,
-       0x37, 0x61, 0x07, 0x22, 0x49, 0xaa, 0x5d, 0x30, 0x6c, 0xd4, 0x73, 0x4c,
-       0xf3, 0xf3, 0x0c, 0xe5, 0x6f, 0xda, 0xe6, 0xe0, 0x3f, 0x37, 0xd6, 0xc5,
-       0x5e, 0xf2, 0x63, 0xdc, 0x67, 0xac, 0xc3, 0x8d, 0xfd, 0x1a, 0xaa, 0xef,
-       0xd7, 0x74, 0xf3, 0xb8, 0xa5, 0xec, 0xcd, 0xda, 0xdc, 0xae, 0xca, 0xed,
-       0xaa, 0xd8, 0xfb, 0xe3, 0xeb, 0x4b, 0xd8, 0x77, 0x1e, 0xa6, 0xd5, 0x79,
-       0xc8, 0x28, 0xfc, 0x21, 0x8d, 0xbd, 0xde, 0xd5, 0x65, 0x5c, 0x87, 0x4f,
-       0xa4, 0xb1, 0xd7, 0xbb, 0xaa, 0xf6, 0x7a, 0x57, 0x97, 0x63, 0x42, 0x6f,
-       0xe7, 0x4b, 0x4c, 0xf7, 0x92, 0x5f, 0xc5, 0x39, 0xee, 0x53, 0xbf, 0x2d,
-       0xf4, 0x98, 0xf0, 0x69, 0xf7, 0xd9, 0x6b, 0xd3, 0xf0, 0x50, 0x0b, 0x0d,
-       0x63, 0x02, 0x67, 0xa5, 0xf8, 0x99, 0xc9, 0xd2, 0x63, 0xff, 0x3b, 0x60,
-       0x78, 0x46, 0x00, 0xf3, 0x9e, 0x30, 0x34, 0xef, 0xc1, 0xe6, 0x8e, 0xf9,
-       0x19, 0x20, 0xf7, 0x14, 0xd9, 0x80, 0xfb, 0x16, 0x90, 0xf2, 0x4a, 0x06,
-       0xad, 0xbc, 0x02, 0xa6, 0x09, 0x75, 0x88, 0xfe, 0xa6, 0xf5, 0x9f, 0xe5,
-       0x60, 0xe3, 0x80, 0x4d, 0x40, 0x73, 0x9b, 0xa7, 0x90, 0x32, 0xf7, 0x0c,
-       0xac, 0x6f, 0xb1, 0xae, 0x6d, 0xb4, 0x01, 0xef, 0xb1, 0x5e, 0x34, 0x85,
-       0x85, 0x61, 0x49, 0x0f, 0x03, 0xb0, 0x7e, 0x00, 0xa5, 0x75, 0x50, 0x1d,
-       0x01, 0x4f, 0xef, 0x02, 0x4d, 0x40, 0xf7, 0x39, 0x01, 0xdb, 0xa2, 0xce,
-       0xfd, 0xca, 0xe0, 0xb5, 0xb2, 0x0d, 0xd0, 0x73, 0xab, 0x16, 0xf5, 0x88,
-       0xc9, 0x83, 0xf2, 0x99, 0x93, 0x0a, 0x03, 0x19, 0x79, 0x81, 0x0d, 0x9a,
-       0x17, 0xc0, 0xe1, 0x04, 0x4c, 0xeb, 0xc0, 0x32, 0x6a, 0x8d, 0x2e, 0xd0,
-       0x3c, 0x1e, 0x16, 0x97, 0x7e, 0x90, 0x18, 0x03, 0x54, 0x8c, 0x05, 0xc8,
-       0x97, 0x01, 0xb6, 0x29, 0x41, 0x7e, 0x05, 0xe5, 0x05, 0x90, 0xd9, 0x20,
-       0xbf, 0x83, 0xca, 0x4e, 0x50, 0x5e, 0x04, 0xb2, 0x97, 0x08, 0x41, 0xfd,
-       0x0c, 0xa4, 0x81, 0xec, 0xe6, 0x29, 0x22, 0x60, 0x7e, 0x52, 0x80, 0x10,
-       0x43, 0x03, 0x3c, 0x1f, 0x10, 0x1b, 0xc6, 0x30, 0xf5, 0x31, 0x64, 0xe4,
-       0x1b, 0x88, 0x19, 0x88, 0x7c, 0xc3, 0xce, 0x70, 0x40, 0x00, 0x16, 0x56,
-       0xff, 0xff, 0x1f, 0x53, 0x61, 0x01, 0xa6, 0x53, 0xd0, 0x3a, 0xd6, 0xdf,
-       0xff, 0x0f, 0x88, 0xb0, 0x30, 0xb4, 0xc0, 0xd7, 0x23, 0xe6, 0xc8, 0x83,
-       0xca, 0xd0, 0x05, 0x40, 0x56, 0x1b, 0xbc, 0x4d, 0xc0, 0x02, 0xbe, 0xef,
-       0x79, 0x01, 0xc3, 0x2f, 0x60, 0x99, 0xf5, 0xff, 0xff, 0x52, 0xb8, 0x5a,
-       0x10, 0x00, 0x00, 0x19, 0x3f, 0x16, 0x21, 0xc4, 0x7d, 0x00, 0x00, 0x00 };
+       0xdc, 0x5b, 0x6b, 0x6c, 0x1c, 0xd7, 0x75, 0x3e, 0x33, 0x3b, 0x4b, 0xae,
+       0xc8, 0x15, 0x35, 0x22, 0x57, 0xd4, 0x9a, 0xa2, 0xed, 0x5d, 0x72, 0x28,
+       0xb2, 0x96, 0xea, 0xae, 0x29, 0xa6, 0x62, 0xd3, 0x4d, 0xb4, 0xd9, 0xa5,
+       0x5c, 0xb5, 0x75, 0x5a, 0x4a, 0x26, 0xfc, 0x48, 0x55, 0x83, 0xde, 0xa5,
+       0x9c, 0xa0, 0xa8, 0x53, 0xc9, 0x76, 0x85, 0x20, 0x05, 0xaa, 0x05, 0x1f,
+       0x89, 0x52, 0xb0, 0x1c, 0xc5, 0x92, 0x29, 0xb5, 0x71, 0x6b, 0x96, 0xb4,
+       0x6c, 0x15, 0xd8, 0x6a, 0x65, 0xc7, 0x6d, 0x68, 0x54, 0x2e, 0x65, 0xca,
+       0x69, 0x95, 0x26, 0x48, 0x8d, 0xa0, 0x42, 0x95, 0x3f, 0x8e, 0xe1, 0xf4,
+       0x87, 0x5b, 0xf4, 0x87, 0xd1, 0x07, 0x22, 0xd7, 0x8f, 0xed, 0xf7, 0xdd,
+       0xb9, 0x43, 0x0e, 0x97, 0x14, 0x45, 0xf9, 0xf5, 0xa3, 0x04, 0x56, 0x33,
+       0xf7, 0x7d, 0xee, 0xb9, 0xe7, 0x7c, 0xe7, 0x31, 0x57, 0x3f, 0x2f, 0x52,
+       0x27, 0xfa, 0x6f, 0x3d, 0x7e, 0x89, 0x87, 0x7f, 0xaf, 0x70, 0xfb, 0xce,
+       0xdb, 0x77, 0xe0, 0xf5, 0x0e, 0xd3, 0xa8, 0x0d, 0xb1, 0x9e, 0xff, 0xc4,
+       0xf0, 0xeb, 0xd6, 0xef, 0x2b, 0xfd, 0xd9, 0xf8, 0xbd, 0x89, 0xc6, 0xc1,
+       0x7f, 0x17, 0x31, 0xae, 0xd1, 0x27, 0xf8, 0x57, 0xa9, 0xac, 0xde, 0x6e,
+       0x92, 0x96, 0x55, 0xda, 0x43, 0xde, 0x92, 0x8a, 0x66, 0xfe, 0x24, 0x62,
+       0xa6, 0x33, 0x47, 0xb2, 0x8e, 0x11, 0x09, 0xa5, 0xbb, 0x8a, 0x05, 0x47,
+       0x24, 0x53, 0xda, 0x96, 0xc8, 0xc9, 0x7b, 0x95, 0x62, 0xcc, 0x92, 0xac,
+       0x23, 0x91, 0x9b, 0xd3, 0xef, 0x3e, 0xf5, 0xd2, 0xce, 0xe4, 0x5b, 0x53,
+       0x21, 0x89, 0xd8, 0xe9, 0x17, 0xc4, 0xde, 0x2a, 0x91, 0x56, 0x8c, 0x79,
+       0xb2, 0x33, 0x63, 0x48, 0x83, 0x3f, 0xd7, 0x9b, 0x95, 0x97, 0x3a, 0xa5,
+       0xd8, 0x92, 0x8e, 0x88, 0x99, 0xee, 0xb8, 0x92, 0x0d, 0xd9, 0x83, 0xa1,
+       0xb4, 0x2d, 0x73, 0x65, 0xe9, 0x3f, 0x30, 0x2e, 0x91, 0x48, 0xfa, 0x4b,
+       0x91, 0xda, 0x0e, 0x89, 0x58, 0xe9, 0xa9, 0x23, 0x5f, 0x73, 0x8e, 0x54,
+       0x4c, 0xc7, 0xe9, 0x9a, 0x96, 0x68, 0xef, 0xe9, 0x1e, 0xb4, 0x97, 0x92,
+       0x5d, 0x22, 0x3b, 0xc5, 0x74, 0x8a, 0xd1, 0x90, 0x13, 0x91, 0x6c, 0xd9,
+       0x91, 0x5c, 0x59, 0xe4, 0x1f, 0x4a, 0x86, 0x9c, 0x76, 0x9a, 0x65, 0x7a,
+       0xfb, 0xbb, 0x95, 0x0c, 0x68, 0xf9, 0x7b, 0x67, 0xea, 0xc8, 0xa8, 0x43,
+       0x7a, 0x1f, 0x8b, 0x90, 0xae, 0x50, 0x7a, 0xa8, 0xb6, 0xe0, 0x58, 0x32,
+       0x5c, 0x62, 0xdd, 0x80, 0xc9, 0xba, 0x70, 0x3a, 0x52, 0x77, 0xda, 0x89,
+       0xea, 0xba, 0x52, 0x26, 0x8b, 0xf9, 0x46, 0x4a, 0xec, 0x1b, 0xe9, 0x2e,
+       0x38, 0x31, 0x5d, 0x3f, 0xba, 0x33, 0xeb, 0xc4, 0x51, 0xdf, 0xaa, 0xdb,
+       0x7a, 0xbe, 0x5c, 0x70, 0x1c, 0xdd, 0x76, 0x35, 0x94, 0x75, 0xba, 0x74,
+       0xfd, 0xab, 0xbb, 0x0a, 0xce, 0x76, 0x5d, 0xff, 0xd6, 0xae, 0xac, 0x93,
+       0xd2, 0xf5, 0xe3, 0xf7, 0x17, 0x9c, 0x1e, 0x5d, 0xdf, 0x8a, 0xfa, 0x5e,
+       0x5d, 0xff, 0x83, 0xde, 0x82, 0x93, 0x46, 0xfd, 0x97, 0x22, 0x66, 0x87,
+       0x2d, 0x63, 0xa5, 0x04, 0x7e, 0x19, 0xb4, 0xf5, 0xa1, 0x6e, 0x0f, 0x7e,
+       0x77, 0xe1, 0x37, 0xbf, 0x41, 0x1a, 0xfa, 0xf1, 0x6c, 0x6b, 0xf5, 0x78,
+       0x07, 0x1e, 0xb9, 0x11, 0x79, 0x3d, 0x14, 0x97, 0x97, 0x3a, 0x5f, 0x07,
+       0x0f, 0x6d, 0x39, 0x57, 0x16, 0xa3, 0xbf, 0x33, 0x0e, 0xde, 0xc5, 0xe4,
+       0xb9, 0x72, 0xbd, 0x84, 0x1e, 0x0f, 0x81, 0x37, 0x5f, 0x90, 0x7c, 0x2c,
+       0x22, 0x1b, 0x27, 0x0d, 0x69, 0xeb, 0x8e, 0x48, 0xc6, 0xe6, 0xda, 0x38,
+       0xed, 0x89, 0x98, 0x84, 0x26, 0x33, 0x4d, 0xa6, 0x74, 0xd8, 0x39, 0x29,
+       0x82, 0x77, 0x57, 0x28, 0x97, 0x68, 0x4b, 0x48, 0x6e, 0xfc, 0x36, 0x19,
+       0xb4, 0x49, 0xd7, 0xdc, 0xcd, 0xde, 0x5a, 0x11, 0x23, 0x7b, 0x72, 0x40,
+       0xc6, 0xdc, 0xa8, 0x91, 0x3b, 0xf9, 0x59, 0xc9, 0xa6, 0x24, 0x86, 0x71,
+       0xf1, 0x3c, 0x5a, 0x66, 0x4a, 0x03, 0x32, 0xea, 0x8a, 0x91, 0x75, 0xc9,
+       0xcf, 0x66, 0xb4, 0x37, 0xa8, 0xbe, 0xa8, 0x6b, 0x0d, 0xa9, 0xb9, 0x23,
+       0xa8, 0xb7, 0x51, 0xdf, 0x68, 0xf4, 0xa9, 0x39, 0x54, 0x7d, 0x62, 0x44,
+       0xa2, 0xf2, 0x74, 0x29, 0xa6, 0xfb, 0x56, 0x2a, 0xd9, 0x94, 0x8d, 0x7e,
+       0x03, 0x32, 0xe2, 0xc6, 0x64, 0x10, 0xcf, 0x61, 0x97, 0x72, 0x15, 0x87,
+       0x4c, 0x35, 0x14, 0xf3, 0x27, 0xd4, 0x7c, 0x89, 0x50, 0x9a, 0xf3, 0xb5,
+       0xa2, 0xdf, 0xdb, 0xa0, 0xcb, 0x10, 0x4b, 0x9d, 0x65, 0x46, 0xf2, 0xe3,
+       0x06, 0xe4, 0x0d, 0x4f, 0xc5, 0xd7, 0x3e, 0xd0, 0x6f, 0x89, 0xd3, 0x6d,
+       0x48, 0x01, 0x67, 0x55, 0xb4, 0x51, 0x2e, 0xcd, 0x9a, 0x59, 0xb7, 0x56,
+       0x72, 0x56, 0x42, 0x42, 0x13, 0x94, 0xa5, 0x41, 0x19, 0xc1, 0x18, 0xd3,
+       0x61, 0x9f, 0xb7, 0xb1, 0xef, 0x41, 0x75, 0x0e, 0x35, 0xe9, 0xa2, 0x99,
+       0x2b, 0x37, 0x8b, 0x39, 0xb9, 0x5f, 0x5e, 0x19, 0x17, 0x3b, 0x94, 0x7e,
+       0xb7, 0x92, 0x75, 0x46, 0xcd, 0xec, 0xb3, 0x96, 0x84, 0x27, 0x0c, 0x19,
+       0x75, 0x92, 0xd0, 0x80, 0xa3, 0xe6, 0xee, 0xf2, 0x2c, 0xfa, 0x71, 0x1c,
+       0xfa, 0x95, 0x4c, 0xf0, 0x95, 0xef, 0xdb, 0x6c, 0x53, 0xc9, 0x33, 0xfb,
+       0xe0, 0x0c, 0xb0, 0x8f, 0xe7, 0x5c, 0x9c, 0x89, 0x3a, 0xa3, 0x04, 0xce,
+       0x48, 0x8c, 0xbe, 0x4e, 0xc8, 0xd4, 0x09, 0x4b, 0xf2, 0x29, 0xec, 0x0b,
+       0xbd, 0xf3, 0xa9, 0x45, 0xba, 0x46, 0xc6, 0xab, 0xe9, 0xe2, 0x38, 0xd2,
+       0xe5, 0xd1, 0x34, 0x7c, 0x82, 0xf4, 0x2d, 0xd2, 0x33, 0x36, 0xee, 0xd3,
+       0xc8, 0xf5, 0x48, 0x9b, 0x4f, 0x17, 0xc7, 0x91, 0xae, 0x26, 0x9e, 0x35,
+       0xff, 0x8c, 0x3e, 0xd0, 0x31, 0xe2, 0x5a, 0x38, 0xa3, 0xa8, 0xe4, 0xed,
+       0xa2, 0x31, 0xd2, 0xbb, 0x2d, 0x0e, 0x6d, 0x36, 0x86, 0x7b, 0x49, 0xb3,
+       0x83, 0x73, 0xac, 0x51, 0xe7, 0x0d, 0xf9, 0x26, 0xef, 0xd0, 0x9f, 0xeb,
+       0xe3, 0xbd, 0x64, 0xcb, 0xa8, 0x9a, 0x8f, 0x34, 0x7d, 0x14, 0xf3, 0x90,
+       0xd6, 0x4b, 0x90, 0xd5, 0x1e, 0xc8, 0x68, 0x4a, 0xfe, 0xae, 0xbc, 0x5d,
+       0xbe, 0x53, 0xee, 0x92, 0xbf, 0x81, 0xde, 0xfe, 0x75, 0x39, 0x21, 0x2f,
+       0x94, 0x5b, 0xe5, 0xdb, 0xe5, 0xb8, 0x3c, 0xaf, 0xe4, 0xb7, 0x4f, 0xa4,
+       0x81, 0x32, 0x9d, 0x90, 0x46, 0xe8, 0xcf, 0x46, 0xe8, 0xe6, 0x13, 0xe0,
+       0xdf, 0x89, 0x4e, 0xc9, 0x34, 0xa5, 0x25, 0x72, 0x0b, 0x7e, 0x9b, 0xf1,
+       0x6b, 0x4e, 0x43, 0xee, 0x5c, 0xf2, 0x8e, 0x3c, 0xb4, 0x24, 0xa7, 0xf6,
+       0x6c, 0xc9, 0x48, 0x79, 0xfe, 0x16, 0x4f, 0x76, 0x45, 0xfa, 0xc1, 0x63,
+       0xb3, 0xfb, 0x7f, 0x2a, 0x19, 0x1b, 0xfb, 0xe8, 0xde, 0xa6, 0x78, 0x6f,
+       0x76, 0x53, 0x66, 0x13, 0x90, 0x7b, 0xcb, 0xc8, 0xb9, 0x67, 0x80, 0x1b,
+       0xf5, 0x46, 0xf6, 0x78, 0x51, 0x0a, 0xc7, 0x2b, 0x52, 0x48, 0x85, 0xe5,
+       0x11, 0xbb, 0x22, 0x7d, 0xa9, 0x1a, 0x39, 0x64, 0x83, 0xf7, 0xdb, 0x7f,
+       0xdf, 0xf0, 0x31, 0xfb, 0x89, 0xf2, 0x61, 0xbc, 0xb3, 0x4e, 0xe4, 0x84,
+       0x7a, 0xf7, 0xea, 0x8b, 0xe5, 0xb0, 0x64, 0x62, 0xc5, 0xb8, 0x25, 0x2d,
+       0xa6, 0xb7, 0xee, 0xb0, 0xdf, 0x06, 0x7e, 0x4c, 0x01, 0x27, 0x93, 0x4a,
+       0x5f, 0xf2, 0xe3, 0xeb, 0xae, 0x66, 0x54, 0x35, 0xfa, 0xdb, 0x3d, 0x32,
+       0xaf, 0xf8, 0x99, 0x18, 0x34, 0xd2, 0x31, 0x69, 0x2b, 0xb1, 0xdc, 0x6b,
+       0xdc, 0x5d, 0xa6, 0x3c, 0xe3, 0xbd, 0x4c, 0x3a, 0x6f, 0x42, 0x3f, 0x0b,
+       0xcf, 0x8c, 0xa6, 0x37, 0x48, 0x23, 0xe7, 0x21, 0x8d, 0x7c, 0xfe, 0x79,
+       0x80, 0xc6, 0xa7, 0x16, 0xde, 0x4f, 0x04, 0xde, 0x8b, 0xe5, 0x4b, 0x75,
+       0x1e, 0x6d, 0xbd, 0xf2, 0xc6, 0xc4, 0x57, 0xf4, 0x3a, 0x78, 0x3f, 0xcb,
+       0xf9, 0xff, 0xaa, 0xe2, 0xc9, 0x4b, 0xf1, 0x3a, 0xeb, 0xcc, 0x06, 0xd6,
+       0x79, 0x31, 0xb0, 0xce, 0x8b, 0x81, 0x75, 0x8a, 0xe0, 0xa9, 0x6c, 0x30,
+       0x21, 0xc3, 0x79, 0x9a, 0x31, 0x39, 0x8a, 0x39, 0x5f, 0x97, 0x50, 0x9a,
+       0x7a, 0xee, 0xe3, 0xcd, 0x65, 0xf4, 0x4f, 0xcb, 0xfc, 0x44, 0x51, 0xf2,
+       0xc7, 0xc3, 0xb2, 0x4f, 0xf5, 0xdb, 0xa5, 0xe9, 0x0b, 0xb6, 0x45, 0x64,
+       0x6f, 0x8c, 0xef, 0x7e, 0x9b, 0x05, 0x3e, 0xb3, 0xfc, 0xc6, 0x4d, 0x5e,
+       0x99, 0xef, 0xb3, 0x7a, 0x2f, 0x03, 0xde, 0xb8, 0xb3, 0x6f, 0x2a, 0x3c,
+       0x9c, 0x2b, 0x13, 0xb7, 0x24, 0x15, 0x72, 0xe4, 0x60, 0x5f, 0xaa, 0x59,
+       0x46, 0x6c, 0x23, 0x35, 0xdc, 0x55, 0x4b, 0xbd, 0xc8, 0x98, 0x4e, 0x3d,
+       0xb0, 0x41, 0x12, 0x26, 0x31, 0x5f, 0xed, 0xcb, 0x30, 0x3d, 0xfa, 0x6d,
+       0x96, 0xfb, 0x4d, 0xa7, 0xb1, 0xaa, 0x9e, 0xba, 0x1d, 0xc2, 0x3b, 0x65,
+       0x78, 0xb7, 0x3e, 0x63, 0x0b, 0x65, 0xe2, 0xf0, 0xad, 0xba, 0xec, 0xb7,
+       0xe3, 0xc0, 0x96, 0x94, 0x7f, 0xb6, 0x65, 0x69, 0xd9, 0xc7, 0x89, 0x20,
+       0x86, 0x73, 0xaf, 0xc0, 0x27, 0x87, 0x72, 0x17, 0x06, 0xad, 0x29, 0xe8,
+       0x5c, 0xad, 0xa6, 0x61, 0xb3, 0xa6, 0x01, 0xb4, 0x76, 0x42, 0xb2, 0x94,
+       0x2e, 0x29, 0xd1, 0xaa, 0x2a, 0x93, 0xf7, 0xfe, 0xfb, 0x7a, 0xd5, 0xee,
+       0xe9, 0x9c, 0xff, 0xf4, 0xf1, 0xfd, 0xcd, 0x80, 0xbd, 0x68, 0x85, 0xce,
+       0xc6, 0xc0, 0x2b, 0x1f, 0xeb, 0x89, 0xc1, 0x71, 0xd8, 0x07, 0xc8, 0xaa,
+       0xc2, 0xf6, 0x28, 0xf0, 0xd0, 0xd2, 0xd8, 0x1c, 0xd1, 0xd8, 0x1c, 0x05,
+       0x2e, 0xb3, 0x6c, 0xeb, 0x72, 0x4c, 0x97, 0xe3, 0x28, 0xc3, 0x8e, 0x4f,
+       0x12, 0xbb, 0x1b, 0x8a, 0x43, 0x27, 0x14, 0xde, 0xd3, 0x56, 0x00, 0x85,
+       0x89, 0xd7, 0xc4, 0xed, 0x56, 0x99, 0x2e, 0x61, 0xbd, 0x05, 0x6c, 0xe4,
+       0xde, 0x83, 0xf4, 0x90, 0x96, 0x75, 0x62, 0xc2, 0x76, 0x65, 0x62, 0xa4,
+       0xf7, 0x61, 0xec, 0x9d, 0xf8, 0x43, 0xba, 0x6f, 0x06, 0xad, 0xdc, 0xc7,
+       0x27, 0x49, 0x2b, 0xd7, 0xab, 0xa6, 0xf7, 0xc3, 0xe2, 0x20, 0x69, 0x3f,
+       0x83, 0x3d, 0x67, 0x80, 0x79, 0x62, 0x0c, 0x74, 0x0e, 0x60, 0xcf, 0xfd,
+       0xc0, 0xc3, 0xbb, 0x80, 0x87, 0x7b, 0x80, 0x87, 0x7d, 0xc0, 0xc3, 0x34,
+       0xb0, 0xb0, 0x17, 0x58, 0xd8, 0x03, 0x2c, 0x4c, 0x81, 0x37, 0x31, 0x99,
+       0x02, 0x36, 0x4e, 0x01, 0x23, 0xa7, 0x30, 0xc7, 0xf0, 0xa4, 0x18, 0x0f,
+       0x60, 0x0f, 0xdf, 0x9c, 0x48, 0x9e, 0x82, 0x2c, 0xc5, 0x8b, 0x26, 0xe4,
+       0x3f, 0xd5, 0x0b, 0xd9, 0xee, 0x92, 0x99, 0xb2, 0x25, 0x05, 0xd8, 0xd4,
+       0xb6, 0xad, 0xed, 0xd0, 0x35, 0xc8, 0x7b, 0x5c, 0xf4, 0xdf, 0x7a, 0xfd,
+       0xfc, 0xb1, 0x88, 0xf3, 0x4f, 0x94, 0xc5, 0x84, 0xc8, 0x79, 0xc9, 0xbb,
+       0xed, 0x76, 0x9b, 0xd9, 0x85, 0x7e, 0x2c, 0xa7, 0xcc, 0x03, 0xc7, 0xef,
+       0x30, 0x87, 0x8e, 0x2b, 0x7f, 0x05, 0x78, 0x55, 0x91, 0xd1, 0x14, 0x75,
+       0xab, 0x22, 0xa7, 0x53, 0xc9, 0xde, 0xa2, 0xd4, 0xcb, 0x58, 0x6c, 0x5c,
+       0xd9, 0x5a, 0x2b, 0x7d, 0x4c, 0xd9, 0xab, 0x82, 0x83, 0x67, 0xa9, 0xdb,
+       0xcc, 0x1f, 0xe7, 0xfe, 0xdb, 0xf1, 0x0b, 0x83, 0x16, 0xce, 0x6f, 0x49,
+       0x5f, 0x8f, 0x6d, 0x3e, 0xd4, 0x59, 0x84, 0x42, 0x24, 0xed, 0x79, 0xac,
+       0x9c, 0x1b, 0x6f, 0x8f, 0xb7, 0x9b, 0x96, 0x0c, 0x5a, 0x86, 0x0c, 0x43,
+       0xbe, 0xfb, 0x52, 0x6f, 0x57, 0xc6, 0x62, 0x6c, 0xaf, 0x95, 0xaf, 0x2b,
+       0x9f, 0x03, 0x6b, 0xcf, 0x9c, 0xc0, 0xba, 0x61, 0x9c, 0x01, 0xd7, 0xe5,
+       0x3c, 0x28, 0x97, 0x2c, 0x94, 0x93, 0xa7, 0x8a, 0x52, 0x86, 0x9e, 0x6c,
+       0x90, 0xec, 0xf6, 0x1a, 0xc9, 0xf4, 0x27, 0x64, 0x78, 0xa2, 0x0c, 0x9c,
+       0x8a, 0x28, 0x5d, 0xc9, 0x0f, 0x24, 0xe4, 0xf1, 0x09, 0xd6, 0x9d, 0xc3,
+       0xfe, 0x93, 0xc7, 0x32, 0xc2, 0xfd, 0x1b, 0x92, 0xd9, 0x7f, 0x4e, 0x1e,
+       0x71, 0xcf, 0xc9, 0x10, 0xce, 0xf0, 0xe9, 0xf2, 0xac, 0x1c, 0x70, 0x1d,
+       0x39, 0x0d, 0xbc, 0xcf, 0x1d, 0x07, 0xee, 0x39, 0xeb, 0x81, 0x51, 0xc9,
+       0x73, 0xb4, 0xa1, 0x26, 0xfc, 0xbc, 0x69, 0xf0, 0xf7, 0x89, 0x09, 0xf2,
+       0xd7, 0x94, 0x47, 0x7f, 0xd1, 0x80, 0x3e, 0x26, 0xc0, 0xcf, 0x56, 0x39,
+       0xec, 0x26, 0x67, 0x33, 0x26, 0x70, 0x31, 0x65, 0x87, 0xa4, 0x2e, 0x8e,
+       0x7e, 0x5e, 0x9f, 0x5c, 0x2a, 0x84, 0xb3, 0x2e, 0xa2, 0xef, 0xdb, 0xa0,
+       0x93, 0x63, 0x63, 0xf8, 0x65, 0xd0, 0x0f, 0xf2, 0x6b, 0x27, 0x67, 0xa7,
+       0x4c, 0xf6, 0x4f, 0xe0, 0xcc, 0x80, 0x2b, 0x93, 0x00, 0x1e, 0x9b, 0xef,
+       0x69, 0x33, 0x4f, 0x1a, 0x5c, 0xca, 0x59, 0x02, 0x34, 0x11, 0xd3, 0xda,
+       0xcf, 0x7d, 0x47, 0xb8, 0xce, 0x46, 0xf4, 0x7f, 0x07, 0x7e, 0xae, 0x2d,
+       0x33, 0x38, 0x97, 0x9f, 0x82, 0x57, 0x99, 0xb8, 0x57, 0x1e, 0x9e, 0x4c,
+       0x9e, 0x9b, 0x37, 0xf9, 0xee, 0x14, 0xf3, 0xe6, 0x6d, 0x22, 0x8d, 0xe4,
+       0x57, 0x0a, 0xbc, 0x72, 0x6c, 0xd3, 0xdc, 0xaa, 0x7d, 0x3b, 0xea, 0x89,
+       0x03, 0x9a, 0xe0, 0x67, 0x74, 0x07, 0xf5, 0x84, 0xf6, 0xce, 0xd7, 0x93,
+       0x64, 0x7c, 0xca, 0x84, 0xff, 0xd1, 0x6d, 0xc9, 0x31, 0x55, 0x06, 0x8f,
+       0x06, 0x92, 0xf1, 0x8c, 0x49, 0x9f, 0xb7, 0x4b, 0x9e, 0x76, 0xd9, 0x1f,
+       0x7c, 0x1c, 0x8f, 0xea, 0xfe, 0xe7, 0x20, 0x23, 0xf4, 0xcf, 0xba, 0x40,
+       0xb3, 0xa7, 0x3b, 0xd3, 0xe3, 0x31, 0xd5, 0x36, 0xa6, 0xf6, 0x60, 0x60,
+       0x5d, 0xc8, 0x26, 0x7c, 0xb5, 0x9c, 0xd2, 0x23, 0x3b, 0x03, 0x5f, 0x1e,
+       0x7a, 0xe0, 0xe9, 0xd0, 0x4c, 0x89, 0xb4, 0xdc, 0x43, 0x7e, 0x14, 0x41,
+       0xcc, 0x31, 0x33, 0x8d, 0x73, 0xed, 0x91, 0x22, 0xfd, 0xb9, 0xf9, 0xd0,
+       0xd3, 0x32, 0x38, 0x43, 0x7b, 0x83, 0x9f, 0xeb, 0xd8, 0x8c, 0x1f, 0x32,
+       0xca, 0x16, 0x6c, 0xc1, 0x39, 0xc3, 0x4e, 0xa4, 0x36, 0x6a, 0x3f, 0xe6,
+       0x49, 0x9c, 0xdb, 0x79, 0x9c, 0x6b, 0x49, 0x86, 0x4e, 0x5e, 0xa2, 0xcc,
+       0x76, 0xcd, 0x48, 0xb2, 0x6b, 0x4c, 0xb6, 0xd9, 0xd3, 0xd0, 0xb7, 0xcc,
+       0x40, 0x65, 0x97, 0x99, 0xe6, 0x98, 0x23, 0x18, 0x83, 0xe7, 0xcc, 0x25,
+       0x39, 0x54, 0x66, 0xdd, 0xef, 0x80, 0x9f, 0xb0, 0x3b, 0x3d, 0x4f, 0x6a,
+       0x39, 0xc7, 0x7c, 0x96, 0x3f, 0xdf, 0x25, 0x3d, 0x1f, 0xfb, 0xb1, 0x0f,
+       0xc7, 0x2c, 0xce, 0xbb, 0x9b, 0xb6, 0x06, 0x78, 0xd3, 0x61, 0x56, 0x76,
+       0x85, 0xd1, 0x7e, 0xba, 0x87, 0xef, 0x98, 0x07, 0xb6, 0xc6, 0x76, 0xce,
+       0xa3, 0x2f, 0xf6, 0xe5, 0xae, 0x93, 0xb6, 0x66, 0x9f, 0x5e, 0x9e, 0x3b,
+       0xfd, 0x00, 0x96, 0x1f, 0x6e, 0xf2, 0x78, 0x3f, 0x12, 0xf2, 0xb0, 0xfb,
+       0x2f, 0x51, 0xa6, 0x7e, 0x3d, 0x26, 0x39, 0x37, 0x89, 0x7d, 0x42, 0x87,
+       0xca, 0x0d, 0x86, 0xb7, 0x47, 0xf0, 0xbf, 0xff, 0x32, 0xf8, 0x20, 0x45,
+       0x8f, 0x37, 0xe4, 0x0b, 0x79, 0xd2, 0x00, 0xd9, 0xae, 0xc3, 0xbc, 0x58,
+       0x47, 0xf1, 0xe0, 0x96, 0x26, 0xcf, 0xef, 0x4d, 0x16, 0x33, 0x8c, 0xd7,
+       0x1a, 0x29, 0xb3, 0xc0, 0xa8, 0xf2, 0xfd, 0x36, 0xe7, 0x9e, 0x32, 0xd7,
+       0x91, 0xde, 0xc4, 0x85, 0xd0, 0x7e, 0x96, 0xbb, 0xa6, 0x4c, 0xf0, 0x1e,
+       0xe7, 0x93, 0xdd, 0xde, 0xae, 0x71, 0xe9, 0x99, 0x10, 0x65, 0x94, 0xf2,
+       0x9c, 0x77, 0xb7, 0xd9, 0xf7, 0x08, 0x65, 0x34, 0x86, 0xf3, 0x26, 0x2e,
+       0xf0, 0x69, 0xc1, 0x26, 0xc6, 0x71, 0xc6, 0x5b, 0x34, 0xed, 0x7c, 0xb7,
+       0x64, 0xca, 0xc6, 0x1a, 0xee, 0x7f, 0x6f, 0xf0, 0xea, 0xf8, 0xde, 0xc2,
+       0x33, 0x39, 0xb6, 0x94, 0x56, 0x9e, 0x67, 0xf5, 0x19, 0x9e, 0x06, 0xed,
+       0xac, 0xc7, 0x73, 0xe6, 0x14, 0xf4, 0x0f, 0x58, 0xd1, 0xd3, 0x11, 0xbf,
+       0x88, 0xfe, 0x39, 0x60, 0x7c, 0xd1, 0x62, 0xdb, 0x55, 0x63, 0x71, 0x8c,
+       0x49, 0x3f, 0x13, 0x3e, 0xed, 0x05, 0xe3, 0x81, 0xf2, 0x2b, 0x46, 0x76,
+       0xe6, 0xaa, 0x91, 0x83, 0x5c, 0xcc, 0xb8, 0x3b, 0x20, 0xcf, 0xd4, 0x17,
+       0x1b, 0x6b, 0x27, 0xe3, 0xff, 0x62, 0xb6, 0x27, 0xa6, 0xa1, 0xdb, 0x07,
+       0xc0, 0x58, 0xef, 0x2c, 0x5b, 0xd5, 0xd9, 0xce, 0x9b, 0x61, 0x8d, 0x75,
+       0x2c, 0x27, 0xed, 0x7b, 0xe5, 0x35, 0xec, 0x77, 0x16, 0x7c, 0x9e, 0x95,
+       0x42, 0xb9, 0x24, 0xf9, 0x93, 0xdb, 0xec, 0x61, 0xc4, 0xb8, 0x8b, 0xb4,
+       0x13, 0xc3, 0x8a, 0xf4, 0xbd, 0x8d, 0xdd, 0xae, 0x14, 0x6b, 0xd2, 0xc4,
+       0xb2, 0x0e, 0xc8, 0x13, 0xea, 0x4a, 0x8b, 0x32, 0x79, 0xe7, 0xb2, 0xfd,
+       0x20, 0xbe, 0xed, 0x59, 0xba, 0xa7, 0x19, 0xb9, 0xfe, 0x9e, 0x76, 0x2f,
+       0xec, 0x89, 0xd8, 0x01, 0xcc, 0x77, 0x81, 0xf9, 0x2e, 0x30, 0xdf, 0x05,
+       0xe6, 0xbb, 0xc0, 0x7c, 0x17, 0xf6, 0xc0, 0x05, 0xee, 0xbb, 0xc0, 0x7d,
+       0x17, 0xb8, 0xef, 0x02, 0xf7, 0xdd, 0x2c, 0xce, 0x8e, 0xd8, 0x4e, 0xbb,
+       0x71, 0xdf, 0x82, 0xad, 0xf4, 0x7c, 0x9b, 0x9b, 0xb4, 0xbf, 0x00, 0x9d,
+       0xb4, 0x5b, 0x64, 0xb8, 0x6b, 0x33, 0xf6, 0x56, 0x87, 0x67, 0x3d, 0x9e,
+       0x58, 0xa3, 0xeb, 0x33, 0x5a, 0x77, 0xbe, 0x0a, 0xba, 0x4c, 0x94, 0x7f,
+       0x09, 0xb2, 0x59, 0x03, 0x7a, 0x7e, 0x41, 0xfb, 0x15, 0xa7, 0x2c, 0x4f,
+       0x36, 0xeb, 0x51, 0xf7, 0x69, 0xd4, 0xd5, 0xa3, 0xcf, 0x21, 0xf4, 0xa1,
+       0x5f, 0xd2, 0xa0, 0xeb, 0x82, 0xfd, 0xe8, 0x9f, 0xfc, 0x26, 0xd6, 0x4a,
+       0xa2, 0x5f, 0x03, 0xe6, 0x6e, 0x45, 0x9f, 0xcf, 0xa2, 0xcf, 0xcd, 0x28,
+       0xd3, 0x9f, 0xdd, 0x82, 0xf2, 0xa7, 0xaa, 0xc6, 0xdc, 0x8a, 0xba, 0xcf,
+       0x54, 0xd5, 0xcd, 0xa3, 0x0e, 0x71, 0xb0, 0x7d, 0x51, 0x8f, 0x2b, 0xa2,
+       0xdc, 0x5c, 0xd5, 0xe7, 0x12, 0xea, 0x7a, 0x51, 0xf7, 0x3d, 0x3c, 0x11,
+       0xff, 0xda, 0xa4, 0xc9, 0x6f, 0xa3, 0x6f, 0x9a, 0x40, 0x7d, 0x58, 0xfb,
+       0x97, 0x4f, 0xd2, 0xdf, 0x82, 0x9d, 0xfd, 0x53, 0xcb, 0xf3, 0xc7, 0x9e,
+       0xb1, 0x3d, 0x59, 0xf5, 0xcb, 0x3f, 0xaa, 0x2a, 0xb3, 0xef, 0xff, 0x56,
+       0xd5, 0xed, 0xda, 0xb8, 0xb4, 0xfc, 0x7e, 0x78, 0xf9, 0x98, 0xe3, 0x55,
+       0x7d, 0x5e, 0x6e, 0x5c, 0x5a, 0xfe, 0x7c, 0xcd, 0xf2, 0x31, 0xbf, 0xb5,
+       0x61, 0x69, 0xdd, 0xe1, 0xa6, 0xa5, 0x65, 0xfa, 0x7d, 0x31, 0xc4, 0x2d,
+       0x7e, 0xff, 0x07, 0x37, 0x79, 0xed, 0xe4, 0x6f, 0xb5, 0x2c, 0x29, 0xe3,
+       0x8d, 0xb2, 0x89, 0x73, 0xb8, 0x60, 0x40, 0xe7, 0x6c, 0x33, 0xfd, 0x8a,
+       0x91, 0x83, 0x4c, 0x65, 0xcb, 0xfe, 0x7c, 0xd4, 0xe5, 0xea, 0xdc, 0x80,
+       0x9f, 0x13, 0xa0, 0x8f, 0x15, 0x85, 0xdc, 0x00, 0x8b, 0x63, 0xc9, 0xa3,
+       0x45, 0x59, 0xd4, 0xe1, 0x36, 0xf3, 0x5a, 0x3a, 0x3c, 0xa9, 0x71, 0xeb,
+       0x32, 0xe8, 0xac, 0x48, 0x7f, 0xaa, 0x96, 0x76, 0x47, 0xe3, 0x19, 0xb1,
+       0xa8, 0x52, 0x09, 0x6d, 0xad, 0xc8, 0xc1, 0xd4, 0x3b, 0x15, 0x51, 0x38,
+       0xf8, 0x4d, 0xcd, 0x57, 0xe2, 0xa1, 0x0d, 0xb9, 0x8d, 0x29, 0x3f, 0x2e,
+       0x94, 0x3e, 0x45, 0x9f, 0xe4, 0x88, 0x87, 0xb3, 0xc4, 0x22, 0x94, 0xcb,
+       0x63, 0xe8, 0xc3, 0xf5, 0xf1, 0x9c, 0x21, 0xb6, 0x5b, 0xca, 0xce, 0xe4,
+       0x6d, 0xce, 0xbb, 0x12, 0x5e, 0xfe, 0xd8, 0xa2, 0x2f, 0x68, 0x39, 0x67,
+       0x60, 0xf3, 0xd8, 0x46, 0xff, 0xe0, 0x0c, 0x7d, 0x91, 0x80, 0x6f, 0xd3,
+       0x11, 0x12, 0x67, 0x11, 0x47, 0xbd, 0x7d, 0xb5, 0xd0, 0xd7, 0x5f, 0xc3,
+       0x5e, 0x57, 0xc6, 0xab, 0x76, 0xf3, 0xfa, 0xba, 0xbd, 0x77, 0x41, 0xb7,
+       0x7d, 0xd9, 0x5b, 0x29, 0x07, 0x70, 0x45, 0x9d, 0xc5, 0xf3, 0xe5, 0xe4,
+       0xb1, 0x22, 0x74, 0x69, 0x4e, 0xc5, 0xbb, 0xfe, 0xb9, 0xd0, 0xaf, 0x49,
+       0x9e, 0x9a, 0x82, 0x6c, 0x0f, 0xa9, 0x38, 0x80, 0x31, 0x40, 0x45, 0x76,
+       0xa7, 0x86, 0x62, 0xe4, 0x43, 0xc6, 0xbc, 0x1a, 0xa6, 0x1f, 0x31, 0xe7,
+       0x92, 0x67, 0x29, 0xb4, 0xa7, 0xc0, 0xdb, 0x7f, 0x95, 0x5c, 0x8c, 0x75,
+       0xff, 0x55, 0x99, 0x86, 0xff, 0xa3, 0x7c, 0x22, 0xe5, 0x03, 0xd0, 0xa7,
+       0x83, 0xad, 0x2f, 0x93, 0xa7, 0x17, 0xc0, 0x67, 0xdf, 0x2f, 0xb8, 0x4c,
+       0xbf, 0x54, 0x96, 0xfa, 0xcf, 0x22, 0x8f, 0x94, 0xfe, 0x19, 0x76, 0xc8,
+       0xc4, 0x7c, 0xb4, 0x77, 0xb4, 0x29, 0xac, 0xdf, 0x11, 0xa6, 0xff, 0xe6,
+       0xd9, 0xff, 0x10, 0xd6, 0x43, 0x4c, 0x5d, 0xfa, 0x0f, 0x23, 0xef, 0xb6,
+       0xd2, 0xb7, 0xc2, 0xfe, 0x89, 0xab, 0x6c, 0x63, 0x5d, 0x44, 0xfb, 0xdc,
+       0x51, 0xed, 0x63, 0xdb, 0xda, 0xc7, 0x26, 0x1d, 0x46, 0xc4, 0x4e, 0xfb,
+       0xbe, 0x02, 0xcf, 0x0c, 0x67, 0xb3, 0x55, 0xf9, 0x0a, 0xb2, 0xb2, 0xaf,
+       0xe0, 0xd3, 0x74, 0x16, 0xfb, 0xa4, 0x6f, 0xa7, 0x72, 0x3f, 0x8d, 0x5e,
+       0xbe, 0x89, 0x34, 0xf8, 0x36, 0x53, 0xd9, 0xe6, 0xa3, 0x30, 0x83, 0xd8,
+       0xdb, 0x6f, 0x83, 0xd6, 0x3d, 0x92, 0x1d, 0x3f, 0xab, 0x6d, 0x30, 0x63,
+       0x07, 0xfa, 0xed, 0x9e, 0xcc, 0x66, 0x53, 0x0d, 0x86, 0x9e, 0xa7, 0x19,
+       0x56, 0x33, 0x90, 0x97, 0xe2, 0x5a, 0xf4, 0x6d, 0x7c, 0x3f, 0x67, 0x56,
+       0xfb, 0x39, 0xe7, 0xe5, 0xa0, 0xeb, 0xc5, 0x0a, 0xfd, 0xa5, 0x0b, 0xa8,
+       0x53, 0xb4, 0xc7, 0xe9, 0x4f, 0x9a, 0x26, 0xfd, 0xc9, 0x24, 0x82, 0x0e,
+       0x6f, 0x2f, 0x6d, 0xd8, 0xcb, 0xcc, 0xc2, 0x5e, 0xea, 0x2f, 0x2c, 0xdd,
+       0x0b, 0xe9, 0xb7, 0xc1, 0x4f, 0x4b, 0xe3, 0x14, 0xe7, 0xfc, 0x46, 0x98,
+       0x18, 0xd6, 0x4f, 0x9f, 0xc8, 0xf5, 0x7c, 0xb1, 0xa5, 0xf3, 0xc2, 0x63,
+       0x28, 0x4d, 0x5d, 0xa3, 0x8d, 0xfb, 0xf7, 0xf5, 0xca, 0xd2, 0xd8, 0xce,
+       0x3d, 0xfc, 0x09, 0xe6, 0x8c, 0x19, 0x79, 0xe5, 0x9b, 0xd1, 0xcf, 0x41,
+       0xdc, 0x5d, 0x7a, 0x05, 0x4f, 0xea, 0x8e, 0x9a, 0x07, 0xfb, 0x8d, 0xaa,
+       0xfd, 0x8e, 0xb9, 0x97, 0xd4, 0x1e, 0xa7, 0x4b, 0x3f, 0x90, 0xc2, 0xc9,
+       0x1f, 0xc2, 0x26, 0x06, 0x73, 0x75, 0xcc, 0x73, 0x92, 0x57, 0xc5, 0x00,
+       0xb6, 0x92, 0x66, 0xe6, 0xe1, 0xbe, 0x17, 0xf6, 0xe2, 0x85, 0x71, 0x9c,
+       0xbf, 0xe1, 0xb5, 0xab, 0xf5, 0x7d, 0x9e, 0xd7, 0x04, 0xe8, 0xa9, 0xc0,
+       0x47, 0x8d, 0x83, 0x86, 0xe0, 0x98, 0xc7, 0xa4, 0xcf, 0xe5, 0x59, 0xb5,
+       0xc7, 0x87, 0xc4, 0xb1, 0xf3, 0xe2, 0xfb, 0x25, 0x5c, 0x9f, 0x78, 0x90,
+       0x43, 0x0c, 0xc5, 0xdc, 0xaa, 0xcf, 0x57, 0x9f, 0xa7, 0xd1, 0x0b, 0xd5,
+       0xf2, 0x31, 0x8a, 0xd8, 0xab, 0xe0, 0x92, 0x4f, 0xbe, 0xdc, 0xfa, 0x6b,
+       0x5f, 0x31, 0xb8, 0x9f, 0x11, 0x95, 0x4f, 0x7c, 0x6d, 0x41, 0x7e, 0x87,
+       0x81, 0x2b, 0x9e, 0x3c, 0xbe, 0xaa, 0x79, 0xe3, 0xcb, 0x6d, 0x54, 0xcb,
+       0x00, 0x63, 0x43, 0xea, 0x95, 0x2f, 0x23, 0x1d, 0xf6, 0xdd, 0x8a, 0x17,
+       0x6c, 0x53, 0x79, 0x46, 0x75, 0xce, 0x83, 0x0b, 0xe7, 0xbc, 0xbe, 0x4a,
+       0x66, 0x53, 0xb6, 0xa7, 0xa3, 0xd4, 0x45, 0xe8, 0x34, 0xf8, 0xf5, 0xfc,
+       0x12, 0xdd, 0xef, 0xba, 0x46, 0x8e, 0x36, 0x2a, 0xa1, 0xc9, 0x97, 0xc1,
+       0xcb, 0x5b, 0x11, 0xbb, 0x88, 0x58, 0x13, 0xc4, 0x28, 0xfa, 0x22, 0x8b,
+       0xfe, 0xf1, 0xb4, 0xac, 0xe4, 0x1b, 0x5f, 0xcf, 0x0f, 0xb9, 0x7d, 0x8d,
+       0x7e, 0xc8, 0xaf, 0xd6, 0x30, 0x96, 0x99, 0x83, 0x9e, 0x1e, 0xc0, 0xf8,
+       0x1a, 0xe7, 0x47, 0xb0, 0x6f, 0xa7, 0xad, 0x5a, 0xc7, 0xc7, 0x8b, 0xa8,
+       0x6c, 0x9c, 0xdc, 0xa2, 0x30, 0xc3, 0x9e, 0x58, 0xc4, 0x8c, 0x61, 0x97,
+       0xf2, 0xab, 0xf4, 0x34, 0xb6, 0x51, 0x7c, 0x8c, 0x78, 0xd6, 0x62, 0xbe,
+       0x67, 0x65, 0x1c, 0xf0, 0x72, 0xba, 0x2b, 0xc7, 0x0a, 0x37, 0x55, 0xf1,
+       0x72, 0x25, 0xdc, 0x3c, 0x07, 0xde, 0xa5, 0x11, 0x13, 0x27, 0xcf, 0x88,
+       0xec, 0x41, 0x9c, 0x9c, 0x7c, 0x4b, 0xa4, 0x0f, 0xb1, 0x72, 0x72, 0x56,
+       0x24, 0x83, 0x78, 0x99, 0xf1, 0xdb, 0x5d, 0xe0, 0x69, 0x2f, 0xe2, 0xe9,
+       0x1e, 0x60, 0x6a, 0x0a, 0x18, 0xbb, 0x1d, 0xfc, 0xed, 0x02, 0xbf, 0x6d,
+       0xc4, 0x5b, 0x65, 0x39, 0x70, 0x5c, 0x8c, 0x7d, 0x2a, 0x7f, 0x4d, 0x7d,
+       0x8f, 0xc1, 0xce, 0x56, 0x2a, 0x87, 0x52, 0xed, 0x88, 0xf5, 0x13, 0xf2,
+       0x39, 0x8b, 0xb1, 0xad, 0x61, 0xb5, 0x75, 0x7f, 0x3f, 0x14, 0xf4, 0x6b,
+       0xb3, 0xd7, 0xb5, 0x13, 0xcb, 0xf9, 0x9f, 0x53, 0xb6, 0xe2, 0xc5, 0xd0,
+       0x6a, 0xfc, 0xdf, 0xb7, 0xc0, 0xff, 0x9e, 0x3a, 0xa9, 0xbb, 0x4b, 0xe5,
+       0x16, 0xda, 0xba, 0x0f, 0x11, 0xcf, 0x52, 0xb0, 0xfb, 0xb0, 0xcf, 0x15,
+       0xb9, 0x33, 0x75, 0xb5, 0x72, 0xd1, 0xd9, 0x20, 0xf9, 0xed, 0x0f, 0x6a,
+       0x4c, 0x3f, 0xf5, 0x87, 0x59, 0xa7, 0x08, 0x1d, 0xf1, 0xf2, 0x88, 0x43,
+       0xe3, 0x11, 0x58, 0x0a, 0xfe, 0x35, 0xca, 0x74, 0xef, 0x55, 0x9c, 0xe3,
+       0xb6, 0x33, 0x4c, 0x42, 0x11, 0x6b, 0xa6, 0x63, 0x51, 0x95, 0x43, 0xde,
+       0xe4, 0xb0, 0xde, 0xc6, 0xb9, 0x0e, 0xc8, 0x34, 0xfc, 0x8b, 0x99, 0x5e,
+       0xd0, 0xb8, 0xbd, 0x19, 0xfd, 0xa9, 0x7b, 0xe4, 0xf9, 0x80, 0x0c, 0xc6,
+       0xc8, 0xd3, 0x18, 0xfa, 0xef, 0x45, 0x9f, 0x46, 0x3c, 0xff, 0x28, 0x34,
+       0x6d, 0x33, 0x9e, 0xfe, 0x3c, 0xca, 0x9c, 0x23, 0x68, 0x5b, 0x77, 0x85,
+       0x45, 0xcd, 0xc9, 0x31, 0xcd, 0x0a, 0x03, 0x16, 0xd7, 0xe2, 0x3a, 0x6c,
+       0x7b, 0xaf, 0x72, 0x47, 0x77, 0x6f, 0x60, 0xbd, 0x86, 0xc0, 0x7a, 0xbd,
+       0x81, 0xf5, 0x48, 0x67, 0x63, 0x80, 0xce, 0x46, 0x8c, 0xff, 0x5d, 0xac,
+       0x4d, 0x7e, 0x04, 0xd7, 0xcc, 0x07, 0xd6, 0xf4, 0xf7, 0xd7, 0x1c, 0x18,
+       0xf7, 0x0e, 0xd6, 0x63, 0x5d, 0x2c, 0x50, 0x47, 0x1a, 0x9a, 0x50, 0xc7,
+       0x72, 0x63, 0x80, 0xae, 0xa8, 0x8a, 0xf7, 0xa7, 0xd5, 0x19, 0x92, 0xcf,
+       0x75, 0xb0, 0x6b, 0x26, 0x6c, 0x4b, 0x0d, 0xfc, 0xaf, 0xea, 0xbd, 0x7e,
+       0x0d, 0xeb, 0xfa, 0xf3, 0xc5, 0x30, 0x07, 0xfb, 0xb3, 0x6f, 0x48, 0x8f,
+       0x67, 0x3d, 0xdb, 0xff, 0xb6, 0xf2, 0x8c, 0xe2, 0x5b, 0x1a, 0xb4, 0x93,
+       0xc6, 0x36, 0x99, 0x6a, 0xb4, 0x70, 0x9e, 0xa6, 0xb6, 0xa5, 0xc0, 0xda,
+       0xb2, 0x69, 0xb4, 0x77, 0xf3, 0xfc, 0x37, 0x68, 0x4c, 0xad, 0x33, 0xb2,
+       0xc7, 0x99, 0x4b, 0xa8, 0xd7, 0xb1, 0x22, 0xe2, 0x13, 0x65, 0x87, 0x7c,
+       0x3b, 0x41, 0x3b, 0x44, 0xdf, 0x86, 0x36, 0xf6, 0x9c, 0x7e, 0xc7, 0x13,
+       0x72, 0xfc, 0xd0, 0x4c, 0xa3, 0x5c, 0x54, 0x7c, 0xb5, 0x65, 0x7e, 0x81,
+       0xaf, 0x61, 0xfd, 0xbd, 0xe6, 0x31, 0xfd, 0x2d, 0x64, 0x3f, 0x7c, 0x27,
+       0xbc, 0x97, 0x32, 0xa0, 0x23, 0x21, 0xed, 0xdd, 0xcc, 0x61, 0x14, 0xf1,
+       0x74, 0xf0, 0x34, 0xf0, 0x84, 0xcd, 0x42, 0x0c, 0xd2, 0xde, 0xcd, 0x58,
+       0x50, 0x40, 0xdb, 0x15, 0x15, 0x07, 0xce, 0x94, 0x6d, 0xe3, 0x4e, 0xd7,
+       0xcb, 0x1d, 0xcd, 0x3b, 0xab, 0xe5, 0x8e, 0x1e, 0xa8, 0xc5, 0x79, 0x9c,
+       0xf2, 0x73, 0x47, 0xf3, 0xa2, 0x72, 0x47, 0xa7, 0xae, 0x93, 0x3b, 0xca,
+       0xac, 0x3d, 0x77, 0xc4, 0xf9, 0x2d, 0xb9, 0xbb, 0xc7, 0x36, 0xbf, 0xa8,
+       0x73, 0x47, 0x6f, 0x88, 0x97, 0x3b, 0xba, 0x28, 0x2b, 0xe7, 0x8e, 0x8e,
+       0x56, 0xe5, 0x8e, 0x9a, 0x54, 0xee, 0x88, 0xf3, 0x78, 0xb9, 0x23, 0x96,
+       0xf3, 0xdd, 0xbf, 0xac, 0x72, 0xe9, 0xf9, 0x6e, 0x60, 0xb0, 0xeb, 0x63,
+       0x9c, 0x6d, 0x0c, 0xa8, 0xf8, 0xf2, 0x4a, 0xb8, 0xd9, 0xf1, 0x31, 0x8e,
+       0xb6, 0x60, 0xf3, 0x82, 0x3d, 0xf3, 0xf1, 0x6e, 0x54, 0xd9, 0xbd, 0xe5,
+       0xf9, 0xc5, 0x7b, 0xaa, 0xf2, 0x8b, 0x03, 0x9e, 0xdd, 0x50, 0x38, 0x37,
+       0xa8, 0x71, 0x6e, 0x74, 0xc1, 0xcf, 0x39, 0x59, 0xcb, 0x18, 0x7c, 0xa4,
+       0x14, 0xc4, 0x51, 0x4b, 0x8d, 0xf5, 0xf2, 0x2c, 0x8b, 0x18, 0x7a, 0xb8,
+       0x0a, 0x43, 0x1f, 0x5b, 0xf1, 0xbb, 0x58, 0x3c, 0xb3, 0xfc, 0xbb, 0x98,
+       0x21, 0xcd, 0xf4, 0x39, 0xba, 0xf3, 0xd8, 0x03, 0x63, 0xe6, 0xfd, 0x92,
+       0x19, 0xb0, 0x81, 0x45, 0x7e, 0xfe, 0x85, 0xe7, 0xbc, 0x68, 0x63, 0xb2,
+       0xe6, 0xc7, 0x97, 0x83, 0x79, 0x48, 0xe5, 0x60, 0xbe, 0x5f, 0x1b, 0xcc,
+       0xc1, 0xcc, 0x03, 0xb3, 0x32, 0x16, 0xf3, 0x5b, 0x2b, 0xe7, 0x60, 0x1e,
+       0x5a, 0x21, 0x07, 0xf3, 0x5d, 0x59, 0xcc, 0xc1, 0x7c, 0x57, 0xfc, 0x1c,
+       0x0c, 0xe7, 0x08, 0x69, 0x9f, 0x56, 0x30, 0xee, 0x02, 0x7e, 0xe7, 0xf1,
+       0xf3, 0xf2, 0x32, 0xf3, 0x0b, 0x7b, 0x58, 0x29, 0x2f, 0xf3, 0x6f, 0xb5,
+       0x1f, 0x24, 0x2f, 0xe3, 0xd9, 0x04, 0x3f, 0x2f, 0x83, 0x9f, 0x0d, 0x1b,
+       0x64, 0x06, 0xf3, 0x32, 0xef, 0x53, 0x37, 0x50, 0xc7, 0x32, 0xeb, 0xa1,
+       0x23, 0xb0, 0x53, 0x19, 0xd8, 0x99, 0x69, 0xf7, 0xd7, 0xd5, 0x79, 0xcc,
+       0xb8, 0x53, 0xd8, 0x77, 0x02, 0xe7, 0x41, 0x5e, 0xb6, 0x2b, 0x5f, 0x34,
+       0x63, 0xc5, 0x8d, 0x6c, 0x27, 0xac, 0xda, 0x38, 0xbf, 0x9d, 0x5b, 0xc6,
+       0x50, 0x99, 0xf2, 0x1e, 0x31, 0x0a, 0xd8, 0x4b, 0xdf, 0xf8, 0x94, 0x0c,
+       0x95, 0x7d, 0x3f, 0xab, 0x5b, 0x9f, 0xc5, 0x94, 0xd2, 0xd3, 0x69, 0xf0,
+       0x00, 0x98, 0xb1, 0x06, 0x9b, 0x75, 0x16, 0x34, 0x07, 0xf7, 0x81, 0x18,
+       0xba, 0x07, 0x75, 0xea, 0xdc, 0xe9, 0x6f, 0xfa, 0xb4, 0x24, 0xa8, 0xf3,
+       0x6b, 0x98, 0x8f, 0x75, 0x67, 0x55, 0xfc, 0x56, 0xe8, 0xe1, 0x5e, 0x69,
+       0xfb, 0xe6, 0x40, 0x1f, 0xea, 0x66, 0x18, 0x33, 0xd2, 0x0e, 0xfa, 0x31,
+       0x5d, 0x54, 0xc5, 0x74, 0x9b, 0x15, 0x3f, 0xc8, 0xeb, 0x5f, 0x8b, 0x10,
+       0x3b, 0x37, 0x3b, 0xdc, 0xc3, 0x79, 0x8d, 0x7b, 0x2c, 0xfb, 0xb1, 0x23,
+       0xdf, 0xc9, 0xa7, 0xa7, 0x54, 0xde, 0x67, 0xda, 0xf5, 0xcf, 0xf0, 0x5b,
+       0xd8, 0x3b, 0xcb, 0xbd, 0x72, 0xa1, 0x59, 0x22, 0xb1, 0x34, 0x73, 0xbd,
+       0xf4, 0xd5, 0x77, 0x30, 0xf7, 0x50, 0xd3, 0xb4, 0x8a, 0xfe, 0xee, 0x5b,
+       0x45, 0x7f, 0xef, 0xae, 0xd2, 0xdf, 0xfe, 0x55, 0xf5, 0xf7, 0xeb, 0x91,
+       0xa0, 0xfe, 0xee, 0x5b, 0x45, 0x7f, 0x1f, 0xad, 0xd2, 0xdf, 0x83, 0x37,
+       0xa4, 0xbf, 0x3a, 0x36, 0x4e, 0xdd, 0xaa, 0x72, 0xc6, 0xc3, 0x13, 0xc4,
+       0xac, 0x4f, 0xeb, 0xdc, 0xd5, 0x4a, 0xbe, 0x98, 0x4f, 0x43, 0x5b, 0xcd,
+       0x47, 0xe3, 0x87, 0xfd, 0x23, 0xf6, 0xe9, 0xf9, 0xa3, 0xfd, 0xf0, 0x69,
+       0xaf, 0xbd, 0xee, 0x1f, 0x8b, 0x99, 0xf6, 0x7d, 0xc0, 0xad, 0x1f, 0xd1,
+       0xda, 0x6b, 0x91, 0x3f, 0xc6, 0x56, 0xf4, 0x07, 0xa2, 0xda, 0x66, 0x4e,
+       0x6a, 0x1d, 0xf4, 0xf3, 0x12, 0x41, 0x7d, 0xa6, 0x9c, 0x52, 0x36, 0x7f,
+       0x8a, 0x3d, 0x51, 0x3e, 0x7d, 0x0c, 0xd8, 0x52, 0xa5, 0x13, 0x73, 0x52,
+       0x00, 0x6e, 0x79, 0x3a, 0x41, 0x39, 0xeb, 0xc4, 0xbe, 0x61, 0x2b, 0xdd,
+       0xa7, 0xbd, 0xb3, 0x70, 0xf0, 0x9c, 0xf1, 0x75, 0x3f, 0x81, 0x75, 0xfd,
+       0x36, 0xda, 0x1e, 0x07, 0x3e, 0xd9, 0x36, 0xf8, 0x93, 0x2d, 0xc0, 0x19,
+       0xd6, 0x2f, 0xcd, 0x73, 0xaf, 0x8e, 0xb1, 0x52, 0x0c, 0xa3, 0xef, 0xe9,
+       0x1e, 0x60, 0x4e, 0x0f, 0x71, 0xb3, 0x84, 0xd8, 0x8c, 0x7a, 0x41, 0x5d,
+       0xe9, 0xe8, 0xda, 0x6d, 0xd2, 0xe7, 0x7b, 0x12, 0x71, 0xfc, 0x2d, 0x4a,
+       0xaf, 0x76, 0x97, 0x3b, 0x66, 0xdf, 0x30, 0xb9, 0x46, 0xa5, 0x92, 0x57,
+       0xdf, 0x19, 0xc4, 0x6c, 0xeb, 0xde, 0xb2, 0x8e, 0x36, 0xf3, 0x16, 0x27,
+       0xa4, 0xe5, 0x3e, 0x83, 0x77, 0xea, 0xd1, 0xeb, 0xf0, 0x47, 0x78, 0x47,
+       0xe1, 0x27, 0x2a, 0x5f, 0x37, 0xed, 0xd2, 0xf7, 0x60, 0xcc, 0xb4, 0x53,
+       0xf7, 0xdb, 0xa2, 0xbe, 0xb1, 0x66, 0x53, 0x3b, 0xf4, 0xf7, 0x36, 0xda,
+       0xc4, 0x24, 0x31, 0x75, 0xc9, 0x79, 0xf3, 0x8e, 0x47, 0x4e, 0xc5, 0x5c,
+       0x1c, 0xaf, 0x7c, 0x7f, 0xc4, 0x49, 0x56, 0xe0, 0xfb, 0x40, 0x44, 0xc7,
+       0x97, 0xd4, 0xf9, 0xa8, 0x8a, 0x7d, 0xbd, 0x78, 0x8a, 0xf1, 0xf7, 0xd2,
+       0xbb, 0x1d, 0x2b, 0xcb, 0x40, 0xcb, 0x07, 0x90, 0x81, 0xea, 0xf3, 0x8b,
+       0x00, 0x8b, 0xfc, 0xf3, 0xf3, 0x7d, 0xac, 0xbf, 0xd0, 0xfb, 0xde, 0xa2,
+       0xf5, 0xe9, 0xff, 0xc3, 0x3e, 0x8d, 0xc0, 0x3e, 0x7d, 0x6c, 0xfc, 0xa2,
+       0xde, 0xe7, 0xce, 0x2a, 0x6c, 0xec, 0x41, 0xfd, 0xe1, 0x9a, 0x8d, 0x1f,
+       0x10, 0x1b, 0xf7, 0xde, 0x10, 0x36, 0xfe, 0x70, 0xdd, 0x5a, 0xb1, 0xf1,
+       0xd0, 0x07, 0xc6, 0x46, 0xee, 0x6b, 0x65, 0x3c, 0xda, 0xb7, 0x0c, 0x8f,
+       0xfe, 0xe0, 0x13, 0xc4, 0xa3, 0xd5, 0xb0, 0x84, 0xe7, 0xd2, 0xa0, 0x7c,
+       0x6c, 0x4f, 0xff, 0xe0, 0x5f, 0xcc, 0x84, 0xe5, 0xc2, 0xbd, 0x11, 0x79,
+       0x6d, 0x27, 0xfc, 0x6e, 0xf2, 0x48, 0x9d, 0x07, 0xcb, 0xd1, 0x3a, 0xcf,
+       0x36, 0xc6, 0x1b, 0xbd, 0x9c, 0x02, 0xc7, 0xf8, 0x3a, 0x6d, 0xa3, 0x9d,
+       0x6d, 0x5b, 0xe4, 0xf5, 0xc6, 0x1b, 0x89, 0x53, 0xf9, 0x8d, 0x66, 0xa5,
+       0x38, 0x75, 0xf5, 0x9c, 0xe6, 0x62, 0x9c, 0x4a, 0xac, 0x6d, 0xd4, 0x79,
+       0x2c, 0xc6, 0x67, 0xfb, 0x35, 0x7e, 0xf2, 0x1d, 0xf1, 0xb8, 0x8b, 0x58,
+       0xdc, 0x45, 0x1c, 0xee, 0x22, 0x46, 0x87, 0x6d, 0x7e, 0x01, 0x32, 0xf7,
+       0x6d, 0x17, 0x31, 0xb8, 0x8b, 0x18, 0xdc, 0xed, 0xd2, 0x71, 0x7c, 0xbf,
+       0xfe, 0x76, 0xc1, 0xef, 0xfb, 0xcc, 0x83, 0x14, 0x61, 0x57, 0x46, 0x79,
+       0x3f, 0xc3, 0xcc, 0xa6, 0xd6, 0xe9, 0xfd, 0xf9, 0x79, 0xfd, 0x56, 0x9d,
+       0x5b, 0xda, 0xb4, 0x49, 0xf9, 0x0b, 0xe6, 0x2b, 0x75, 0xde, 0x1d, 0x00,
+       0xde, 0x23, 0x79, 0x14, 0xbe, 0x92, 0xba, 0x87, 0x45, 0x3d, 0xad, 0x98,
+       0x69, 0xe6, 0x8e, 0xc4, 0x34, 0xd3, 0x77, 0x60, 0xcc, 0x36, 0x2f, 0x66,
+       0x89, 0x49, 0xc8, 0x4c, 0xd7, 0x93, 0xa7, 0x86, 0x99, 0x5e, 0xaf, 0xe7,
+       0x9a, 0xaf, 0xf3, 0xfc, 0xbd, 0x4e, 0x96, 0x2d, 0x33, 0xfd, 0x59, 0x3e,
+       0x71, 0xee, 0x7e, 0xfd, 0x3d, 0x8d, 0x4b, 0xd7, 0x1a, 0x53, 0x18, 0x9f,
+       0x4d, 0xdd, 0x8b, 0xf9, 0xd4, 0xfd, 0xa7, 0x05, 0x7e, 0x9b, 0xd7, 0xe4,
+       0xf7, 0x98, 0xe6, 0xb7, 0xc7, 0xe3, 0x10, 0xfb, 0xa9, 0xdc, 0x36, 0x79,
+       0xed, 0xcf, 0xa7, 0x72, 0x93, 0x58, 0x47, 0xdd, 0x01, 0xc1, 0xb3, 0x62,
+       0x49, 0xc3, 0xc0, 0x7d, 0x61, 0x27, 0xb8, 0xae, 0xff, 0x2d, 0x7f, 0x2d,
+       0x6b, 0x6e, 0x51, 0xdf, 0x07, 0x3d, 0xbb, 0x31, 0xa6, 0x64, 0xd0, 0x4a,
+       0x73, 0x5f, 0xef, 0x43, 0xfe, 0xc6, 0x94, 0xfc, 0xe5, 0x10, 0x67, 0x8d,
+       0xf6, 0x74, 0x24, 0x2c, 0x73, 0xba, 0x8e, 0x39, 0xe4, 0xbe, 0xb2, 0x8f,
+       0x7d, 0x5c, 0xaf, 0xda, 0xa6, 0x33, 0xff, 0xe7, 0x63, 0x9a, 0xb4, 0x78,
+       0x79, 0xc1, 0xb5, 0xde, 0xa9, 0x58, 0xd4, 0xa5, 0xc1, 0x05, 0x5d, 0xaa,
+       0xab, 0xd2, 0x25, 0x7f, 0x9f, 0xeb, 0xc5, 0xff, 0xe6, 0xbe, 0xd2, 0x5d,
+       0x90, 0xb9, 0x72, 0xe0, 0x1b, 0xcf, 0x82, 0x6c, 0xf0, 0x4e, 0xcc, 0x3d,
+       0x90, 0x41, 0x7e, 0xdf, 0xd8, 0x03, 0x3d, 0xaa, 0x54, 0xfa, 0x98, 0x27,
+       0xdf, 0xde, 0xaf, 0xef, 0x5b, 0x5c, 0x51, 0x39, 0x12, 0x6b, 0x59, 0x8e,
+       0xa4, 0x0f, 0xb2, 0x02, 0x3f, 0x00, 0x3a, 0x98, 0x57, 0x67, 0x49, 0x9f,
+       0xa0, 0xfa, 0x1b, 0xd2, 0xc5, 0x7a, 0x8f, 0x0f, 0x9d, 0xf5, 0xde, 0x77,
+       0x14, 0x73, 0xd3, 0xd2, 0x32, 0xc7, 0x27, 0xea, 0x3d, 0x59, 0x39, 0x06,
+       0xfb, 0xdc, 0x07, 0x59, 0xac, 0x91, 0x9c, 0x9a, 0xef, 0x98, 0xe4, 0x9f,
+       0xfd, 0xcf, 0xc6, 0xa5, 0xfd, 0x51, 0x77, 0xd2, 0xef, 0xff, 0x78, 0x55,
+       0xff, 0xc7, 0xd1, 0xff, 0x67, 0x55, 0xfd, 0x1f, 0x0f, 0xf4, 0x3f, 0xa1,
+       0xfb, 0xd7, 0xa2, 0xbf, 0xd2, 0x83, 0x26, 0xdf, 0x2f, 0x36, 0x1d, 0xc4,
+       0xb3, 0xcf, 0xfa, 0x63, 0x4e, 0x04, 0xc6, 0x4c, 0x56, 0xad, 0x31, 0x89,
+       0x7e, 0xf1, 0xa6, 0xa5, 0x6b, 0xa0, 0xee, 0x64, 0x8d, 0xfe, 0xbe, 0x47,
+       0x9f, 0xe5, 0xa0, 0xce, 0x17, 0xe0, 0x59, 0x0a, 0x7e, 0x33, 0xe2, 0x77,
+       0x0a, 0xca, 0x9e, 0xff, 0x8d, 0xc2, 0xbf, 0x93, 0x47, 0xbd, 0xcd, 0x40,
+       0x6f, 0x17, 0xfd, 0x1a, 0x4f, 0x2e, 0x83, 0x32, 0x49, 0x9c, 0x28, 0x4a,
+       0xc8, 0x29, 0xd3, 0x57, 0x32, 0x0a, 0x33, 0xbe, 0x7d, 0xe2, 0xbd, 0x2b,
+       0xde, 0xd7, 0xf5, 0xec, 0x70, 0xd8, 0x99, 0xd3, 0x31, 0xe2, 0xaf, 0x90,
+       0x7e, 0xe0, 0xa6, 0x8f, 0x9d, 0x72, 0xcc, 0xd3, 0x1f, 0xca, 0x31, 0xe7,
+       0xd7, 0x7a, 0x44, 0x99, 0xd5, 0xeb, 0xf4, 0x2d, 0xc3, 0xb7, 0xc4, 0xb2,
+       0x3c, 0x5c, 0x68, 0x0d, 0xf8, 0xd6, 0xbf, 0x80, 0x6f, 0xf7, 0xca, 0x94,
+       0x9d, 0x50, 0x79, 0xd0, 0x43, 0x0b, 0x79, 0x81, 0xc3, 0x91, 0x46, 0x87,
+       0x79, 0x81, 0xe4, 0xa9, 0x8c, 0x7c, 0xb0, 0xbc, 0xc0, 0xbe, 0x2a, 0x1d,
+       0xd9, 0xbb, 0xaa, 0xed, 0xfc, 0xb3, 0xfa, 0xb5, 0xe6, 0x05, 0x1e, 0xa9,
+       0xb2, 0x63, 0x87, 0x6e, 0xc0, 0x76, 0xe6, 0x95, 0xed, 0xe4, 0x5e, 0xaf,
+       0xe7, 0xcb, 0x7f, 0x25, 0xf2, 0xd1, 0xd8, 0xce, 0xd5, 0x72, 0xe2, 0x41,
+       0x7b, 0x40, 0xb9, 0xba, 0xac, 0xfd, 0x6c, 0x3c, 0x67, 0x2e, 0x43, 0x3f,
+       0x4d, 0x19, 0x54, 0xb2, 0xcc, 0xb2, 0x1f, 0xff, 0xde, 0xb7, 0x10, 0xff,
+       0x2e, 0xc6, 0xac, 0xf0, 0x67, 0xbb, 0xfc, 0xd8, 0x88, 0x7e, 0xb3, 0x6d,
+       0x14, 0xdc, 0x3d, 0xe6, 0x90, 0x6a, 0x63, 0x8e, 0xf7, 0x36, 0xf9, 0x9c,
+       0xba, 0x27, 0x70, 0x5e, 0xe7, 0xd2, 0xa6, 0x54, 0x4c, 0xc0, 0xef, 0x1c,
+       0x85, 0xd4, 0x46, 0xed, 0x03, 0x5e, 0x0f, 0x67, 0x97, 0xc6, 0xcf, 0xa6,
+       0x79, 0x04, 0x63, 0x19, 0x3f, 0x7f, 0x21, 0x4a, 0x4c, 0xcd, 0x96, 0x57,
+       0x1d, 0x8f, 0x71, 0x1c, 0xcf, 0x3e, 0x2a, 0x56, 0x46, 0xbf, 0x39, 0x3d,
+       0xde, 0x8b, 0x95, 0xb3, 0xe5, 0xad, 0x51, 0x0f, 0x17, 0x57, 0x8b, 0x63,
+       0x8e, 0x44, 0x99, 0x8b, 0x9c, 0x73, 0xaf, 0x47, 0xeb, 0xf2, 0xd8, 0x3c,
+       0xb4, 0x2c, 0x36, 0xb7, 0x74, 0xec, 0x7d, 0xbf, 0x8a, 0xcd, 0x3d, 0x1e,
+       0x73, 0x2f, 0xc1, 0xd8, 0xca, 0x01, 0x36, 0xf2, 0x5b, 0x10, 0xb1, 0x82,
+       0x3e, 0x0b, 0xe4, 0x67, 0xfc, 0x37, 0x94, 0x1f, 0xb3, 0x5c, 0x7e, 0x3e,
+       0x6e, 0xbb, 0xe1, 0xef, 0xfd, 0xb2, 0x78, 0xf9, 0xc5, 0x3d, 0xa0, 0x85,
+       0xf1, 0x56, 0x58, 0xcb, 0xc3, 0xcf, 0x69, 0xfc, 0xf6, 0xfb, 0xf9, 0xb9,
+       0x86, 0x85, 0x6f, 0xc9, 0xc5, 0xcc, 0x92, 0x1c, 0xcf, 0x16, 0xa6, 0xce,
+       0x71, 0xee, 0x99, 0x1b, 0xf8, 0xde, 0xf2, 0x61, 0xee, 0x7c, 0x54, 0xdb,
+       0xb9, 0x57, 0x21, 0xfb, 0x09, 0x7d, 0xff, 0xaf, 0x0b, 0x3a, 0xc0, 0x3b,
+       0xd0, 0xd5, 0x58, 0xab, 0xee, 0xf9, 0x45, 0x36, 0xa5, 0xf9, 0xed, 0x82,
+       0x3e, 0xc1, 0x4f, 0xf4, 0x5e, 0xe3, 0x72, 0x6c, 0xc2, 0xcb, 0xd3, 0x9a,
+       0xab, 0xde, 0xf1, 0xbb, 0x04, 0x5e, 0x24, 0x8f, 0xfa, 0x79, 0x5a, 0xd3,
+       0xbb, 0xe3, 0x77, 0xf4, 0xa3, 0xbb, 0xe3, 0xc7, 0xf9, 0x2d, 0xd9, 0xbb,
+       0xc2, 0x1d, 0xbf, 0xd0, 0x1a, 0xef, 0xf8, 0x6d, 0x54, 0x79, 0x5a, 0xce,
+       0xe3, 0xe5, 0x69, 0x59, 0x6e, 0xeb, 0xfe, 0x94, 0xc2, 0xa8, 0xe9, 0x09,
+       0xe6, 0x75, 0x1e, 0x5c, 0xf7, 0xc9, 0xe4, 0x75, 0xde, 0x8b, 0x7e, 0xfc,
+       0x79, 0x1d, 0x7e, 0x17, 0xf8, 0xb2, 0xf7, 0xdd, 0x5a, 0x6e, 0x24, 0x3f,
+       0xf0, 0xe1, 0x72, 0xb0, 0x07, 0x55, 0x0e, 0x76, 0xfb, 0xfa, 0x60, 0x0e,
+       0xd6, 0xbc, 0xce, 0x3d, 0xb8, 0x83, 0x2b, 0xe4, 0x60, 0xc3, 0x81, 0x7b,
+       0x70, 0x61, 0x7d, 0x0f, 0x6e, 0xa3, 0x83, 0x18, 0x53, 0xe7, 0x5b, 0xcd,
+       0x55, 0xef, 0xc1, 0xed, 0x5e, 0xff, 0xe1, 0xf3, 0xad, 0xcb, 0xee, 0xc1,
+       0x1d, 0xcd, 0x48, 0x8b, 0x24, 0x6e, 0x28, 0x16, 0xfa, 0x30, 0x71, 0x10,
+       0xff, 0x8f, 0x40, 0x0d, 0xf6, 0x0c, 0x99, 0x8f, 0x51, 0x3e, 0x29, 0x77,
+       0x69, 0x33, 0x5f, 0xe6, 0x7b, 0x17, 0xcf, 0xc7, 0xe8, 0xef, 0x5c, 0x7a,
+       0xb7, 0x62, 0xf1, 0x6e, 0x72, 0x64, 0xe1, 0x6e, 0xf2, 0x18, 0x64, 0xc6,
+       0x9c, 0x88, 0xc8, 0x74, 0xc0, 0xb6, 0x8e, 0xba, 0xf0, 0x9b, 0x26, 0x6d,
+       0xdd, 0xce, 0xff, 0xa7, 0x82, 0xb8, 0xb0, 0xc4, 0xfb, 0xcc, 0x0d, 0x12,
+       0x9a, 0x54, 0x98, 0x1a, 0xf3, 0xfe, 0xaf, 0x4e, 0x1c, 0x7d, 0x78, 0x77,
+       0x35, 0x2c, 0x87, 0x62, 0x94, 0x65, 0x5f, 0x8e, 0xbf, 0x05, 0xfe, 0x36,
+       0x65, 0x16, 0xcb, 0x31, 0x2d, 0xd7, 0x94, 0x69, 0x5f, 0xfe, 0x62, 0x32,
+       0x32, 0x41, 0x59, 0xde, 0xa1, 0xff, 0x9f, 0xc4, 0x39, 0x29, 0x94, 0xcf,
+       0xea, 0x78, 0x43, 0x7d, 0x8b, 0x02, 0x1f, 0x5b, 0xb4, 0x0d, 0xc6, 0x73,
+       0xa6, 0x85, 0x36, 0x8f, 0xdf, 0x1e, 0xa5, 0x6f, 0x7c, 0x5b, 0x7c, 0x08,
+       0x78, 0x37, 0xa8, 0x72, 0x27, 0x37, 0xc2, 0x6f, 0xe3, 0x1a, 0xdf, 0x48,
+       0xd7, 0xca, 0x73, 0xdf, 0x5f, 0xbe, 0x8c, 0xfd, 0xb5, 0x40, 0x36, 0xbe,
+       0x2a, 0xb9, 0x93, 0xb7, 0x49, 0xdf, 0x89, 0x24, 0xe8, 0x79, 0xbf, 0x52,
+       0x48, 0xc1, 0xb7, 0x7e, 0x96, 0x77, 0xe1, 0x80, 0xa1, 0x2e, 0x30, 0x14,
+       0xbc, 0x7b, 0x61, 0x99, 0xbf, 0x11, 0xbc, 0x43, 0x97, 0x5a, 0xb8, 0x13,
+       0xf5, 0x7c, 0x59, 0x22, 0x8d, 0xa4, 0x7b, 0x62, 0xf1, 0x2e, 0xfc, 0x5c,
+       0x39, 0xa7, 0xec, 0xdb, 0x73, 0xe5, 0x25, 0x39, 0x21, 0x75, 0x8e, 0xc3,
+       0xa5, 0x97, 0x61, 0xe3, 0x2e, 0x1b, 0xb4, 0x71, 0x63, 0xae, 0xdc, 0x12,
+       0x12, 0x9e, 0x89, 0x18, 0xe0, 0x83, 0xba, 0x9b, 0xe2, 0xdd, 0x4d, 0x68,
+       0x55, 0x67, 0xfb, 0x7f, 0xd4, 0x5d, 0x7d, 0x6c, 0x5b, 0xd7, 0x75, 0x3f,
+       0x7c, 0xa4, 0x3e, 0x4c, 0xcb, 0xd2, 0x93, 0x4c, 0xc9, 0xb4, 0x2d, 0xcb,
+       0x8f, 0xd2, 0x93, 0xa5, 0xc4, 0x4a, 0xc1, 0x79, 0xda, 0xaa, 0x01, 0x5a,
+       0xc7, 0x52, 0xf4, 0xc7, 0x82, 0x60, 0xa5, 0x65, 0x25, 0xf3, 0xd2, 0x2c,
+       0x51, 0x29, 0xdb, 0xc9, 0xfe, 0x18, 0xe0, 0x25, 0xd9, 0x9a, 0xfd, 0x51,
+       0xe4, 0x95, 0x94, 0x12, 0x63, 0x56, 0x4d, 0xc6, 0xe6, 0x84, 0x02, 0x0b,
+       0x36, 0x56, 0x92, 0x9d, 0x14, 0x50, 0xc0, 0x24, 0x6d, 0x87, 0x2c, 0x6d,
+       0x11, 0x55, 0x76, 0xda, 0x7f, 0x8d, 0x2d, 0xc0, 0xb2, 0x2e, 0x69, 0x14,
+       0x3b, 0xc8, 0x02, 0x2c, 0x58, 0xbb, 0x6e, 0x28, 0xf6, 0x4f, 0xc7, 0x9d,
+       0xdf, 0xfd, 0x20, 0x1f, 0xc9, 0x47, 0x7d, 0x24, 0x6e, 0x81, 0x09, 0x10,
+       0xc8, 0xf7, 0xde, 0x7d, 0xef, 0xdd, 0x7b, 0xee, 0xf9, 0xf8, 0x9d, 0x73,
+       0xcf, 0xb9, 0x94, 0xba, 0xe2, 0x35, 0x57, 0x6e, 0x49, 0x65, 0x7e, 0x65,
+       0xce, 0x89, 0x9c, 0x0f, 0x95, 0x43, 0x0b, 0x9a, 0x3a, 0x27, 0x6d, 0x99,
+       0x17, 0x33, 0xb0, 0x80, 0x73, 0x3d, 0x35, 0xf6, 0xaf, 0x95, 0xf9, 0xc0,
+       0x14, 0x31, 0x85, 0x69, 0x13, 0x7d, 0xde, 0x2b, 0xf4, 0x81, 0xf7, 0xba,
+       0x7c, 0x40, 0xe9, 0xbc, 0x56, 0xa5, 0xa3, 0x36, 0xc2, 0x6f, 0xf2, 0x9d,
+       0xfd, 0xe2, 0x9d, 0xdd, 0x4a, 0x67, 0xe9, 0xdc, 0xf7, 0x71, 0x63, 0xba,
+       0x08, 0x5f, 0x9b, 0xe9, 0x52, 0x87, 0xdf, 0xac, 0x4d, 0xe8, 0xf8, 0xb9,
+       0x3a, 0x3a, 0x56, 0xcb, 0x03, 0xfb, 0xe6, 0x65, 0x9d, 0x2d, 0x69, 0x26,
+       0xcf, 0x23, 0x9f, 0x5f, 0xe7, 0x65, 0x48, 0x9a, 0x95, 0xe5, 0xe7, 0x92,
+       0x3b, 0x27, 0xa3, 0x42, 0xb3, 0xe9, 0x32, 0xcd, 0xf6, 0xfc, 0x3f, 0xa0,
+       0xd9, 0x4d, 0x81, 0x79, 0x5f, 0x29, 0x22, 0xff, 0x6e, 0x58, 0xe4, 0x2e,
+       0xac, 0xd2, 0x88, 0xb2, 0xff, 0xee, 0x1a, 0x28, 0xd0, 0x12, 0xba, 0x34,
+       0x52, 0x58, 0xa7, 0x98, 0x8c, 0x43, 0x98, 0xa5, 0xd2, 0x77, 0xa2, 0x90,
+       0x3f, 0xf8, 0x24, 0xf0, 0x51, 0x10, 0xdf, 0x3b, 0xc9, 0x63, 0xfb, 0x97,
+       0x60, 0xd7, 0x06, 0x36, 0xf2, 0xe4, 0x36, 0x7c, 0x94, 0x8a, 0x8d, 0x04,
+       0x5e, 0x22, 0x27, 0x6e, 0x57, 0xf2, 0x5e, 0x66, 0xb3, 0x3f, 0x6c, 0x67,
+       0x3f, 0x92, 0x69, 0x5c, 0x79, 0xee, 0xd6, 0x7c, 0x14, 0x3c, 0x4f, 0xda,
+       0xc9, 0xd9, 0x6c, 0xe5, 0xb9, 0x4e, 0xf9, 0xb9, 0x61, 0x0f, 0x5d, 0x65,
+       0xd1, 0xcc, 0xa5, 0x7d, 0x75, 0xf9, 0x6a, 0x95, 0xf1, 0x48, 0x5f, 0x45,
+       0x8f, 0xe7, 0xc9, 0x4d, 0xf1, 0xa5, 0xcc, 0x3b, 0xab, 0xe4, 0xf0, 0xd4,
+       0xfa, 0x29, 0xfb, 0x5d, 0xf1, 0x19, 0xd0, 0xf8, 0x0f, 0x69, 0x75, 0x12,
+       0x7a, 0xae, 0x96, 0xd6, 0xef, 0xff, 0x9a, 0x68, 0x1d, 0xe9, 0xf8, 0xf5,
+       0xd2, 0x7a, 0x7f, 0x5d, 0x2c, 0xbc, 0x32, 0x1e, 0x0a, 0x75, 0x6f, 0x0b,
+       0xcb, 0xd7, 0xd2, 0x7a, 0x7f, 0xc3, 0x78, 0x6a, 0xe3, 0x5c, 0xcc, 0xea,
+       0x78, 0x6a, 0xbf, 0xc1, 0x32, 0x92, 0x65, 0x79, 0x69, 0xa8, 0xe3, 0xff,
+       0xce, 0x15, 0x6f, 0x75, 0xeb, 0x79, 0xc8, 0x1a, 0xf9, 0x4e, 0x0e, 0xe9,
+       0x77, 0x42, 0xae, 0x22, 0x8e, 0x43, 0xf0, 0x9f, 0xf0, 0x5e, 0xe4, 0x62,
+       0xd5, 0xe1, 0x2e, 0x7e, 0x2f, 0xcb, 0xff, 0x0b, 0xcf, 0x0b, 0x9b, 0x25,
+       0x63, 0x12, 0x68, 0x1f, 0xf2, 0x9d, 0x11, 0x6d, 0x65, 0x8e, 0x96, 0x8a,
+       0x51, 0x28, 0x3f, 0xa0, 0x51, 0x6c, 0xa2, 0xde, 0xfe, 0x6d, 0xcf, 0x6f,
+       0xd0, 0xf1, 0x88, 0x83, 0x3c, 0x3f, 0xe1, 0x2a, 0xbf, 0x0b, 0xfa, 0xf4,
+       0x3c, 0x63, 0x84, 0xfe, 0x32, 0x3e, 0xa8, 0x9e, 0xa3, 0x59, 0xe1, 0xdf,
+       0x69, 0x5d, 0xba, 0x2a, 0x73, 0x6b, 0xc5, 0x79, 0xe0, 0xb5, 0xb2, 0x2e,
+       0xad, 0xc1, 0xc3, 0x07, 0x3d, 0xf8, 0xc3, 0xb3, 0x9e, 0x55, 0xcf, 0xa1,
+       0x85, 0x9c, 0xfa, 0x84, 0xe7, 0x1c, 0x96, 0xeb, 0xd2, 0x9c, 0x4a, 0x5b,
+       0x79, 0x7f, 0x42, 0x8c, 0x6b, 0xea, 0xde, 0x38, 0xea, 0xef, 0xca, 0x35,
+       0x51, 0xb5, 0x75, 0x60, 0xb0, 0x0b, 0x5a, 0x1e, 0x75, 0xcd, 0x39, 0x68,
+       0xd1, 0xe7, 0x51, 0x07, 0xe6, 0xb6, 0x2d, 0xb8, 0xaf, 0x96, 0x16, 0x15,
+       0xbb, 0x32, 0xa7, 0xec, 0xca, 0xa2, 0x4b, 0xaf, 0xd7, 0xe3, 0xf7, 0x2e,
+       0x0f, 0xfc, 0xee, 0x55, 0x0b, 0x86, 0x3e, 0x3d, 0xc5, 0x98, 0xe4, 0x33,
+       0xc0, 0x24, 0x26, 0x6a, 0xb1, 0x24, 0x2e, 0xc1, 0xf5, 0x1c, 0x63, 0x93,
+       0x30, 0xf3, 0xca, 0x6b, 0x74, 0x8e, 0x31, 0xf7, 0x35, 0xba, 0x4b, 0xf9,
+       0x69, 0x90, 0x5f, 0x9d, 0x47, 0x8b, 0x5a, 0x06, 0x1f, 0x39, 0x0f, 0x45,
+       0x86, 0x63, 0xf4, 0x1a, 0x9d, 0x15, 0xf9, 0x3e, 0x58, 0xff, 0x43, 0x9e,
+       0xc4, 0xdd, 0xe2, 0xfd, 0x32, 0xae, 0x71, 0x27, 0xf2, 0x02, 0xb7, 0x5e,
+       0x9f, 0xa0, 0xea, 0x05, 0xb9, 0x1d, 0xde, 0xb9, 0xac, 0x64, 0x4a, 0x9c,
+       0xe3, 0xfb, 0x9f, 0x32, 0xea, 0xef, 0x8f, 0x19, 0x89, 0x62, 0xc2, 0x88,
+       0x2f, 0xa1, 0xdd, 0x53, 0xc6, 0x44, 0x11, 0xbe, 0xa4, 0xe6, 0x91, 0x48,
+       0x14, 0xf2, 0xb6, 0x46, 0x9b, 0xaf, 0x53, 0x2c, 0x52, 0x4d, 0xad, 0xc8,
+       0x16, 0xfa, 0x7d, 0xac, 0xaa, 0xdf, 0x9a, 0xbe, 0xf8, 0x8e, 0xd8, 0xcf,
+       0xcb, 0x4c, 0x53, 0x8d, 0x71, 0x83, 0x88, 0xbd, 0x0f, 0x3b, 0xb4, 0x11,
+       0xc6, 0x8d, 0xd4, 0x61, 0xdc, 0xc5, 0x4d, 0xfb, 0xfd, 0x69, 0x65, 0x5c,
+       0xd6, 0x7c, 0xfb, 0x6d, 0x81, 0x65, 0xb9, 0xdf, 0x55, 0x38, 0xb7, 0x86,
+       0xa7, 0xd0, 0x46, 0xc7, 0xc8, 0x75, 0x4c, 0xac, 0x5d, 0xc5, 0x74, 0x75,
+       0x3e, 0x45, 0x50, 0xc5, 0xb4, 0x71, 0x1d, 0xbe, 0xd6, 0x2a, 0xf7, 0x0f,
+       0x7e, 0x17, 0xe2, 0x3f, 0x6e, 0xbf, 0xcb, 0x1d, 0xf3, 0xf5, 0xaa, 0x0d,
+       0xed, 0xf7, 0xa8, 0x0d, 0x75, 0xcb, 0x59, 0xc0, 0x25, 0x67, 0x61, 0x17,
+       0x86, 0xeb, 0x65, 0xff, 0xa5, 0x8d, 0xf5, 0x07, 0xfc, 0x97, 0x20, 0xf9,
+       0x2f, 0xbb, 0xfd, 0x97, 0xda, 0x3a, 0x7f, 0xc8, 0x1c, 0x70, 0x9a, 0xf4,
+       0x65, 0x12, 0xf9, 0xf2, 0x1e, 0x01, 0x3c, 0xe6, 0x4a, 0x1d, 0xe6, 0x52,
+       0x5d, 0xcd, 0xa8, 0x57, 0x7f, 0xfb, 0xea, 0xfa, 0x0b, 0x1b, 0x16, 0x6b,
+       0x88, 0xef, 0xbc, 0xfc, 0xab, 0x3b, 0xd5, 0xbf, 0x5a, 0x5d, 0x86, 0x77,
+       0xf5, 0x8b, 0x18, 0xb8, 0x53, 0xd6, 0x63, 0x63, 0xb2, 0xbf, 0xd9, 0x6a,
+       0x5f, 0xc3, 0x7f, 0x89, 0x14, 0xed, 0xbc, 0xf5, 0xfa, 0xf6, 0xe2, 0x68,
+       0x3b, 0x6b, 0x6c, 0xef, 0x78, 0xa7, 0x8c, 0x8f, 0xcd, 0xa9, 0x3c, 0xf2,
+       0x6e, 0xe5, 0xf7, 0x6d, 0xc6, 0xeb, 0x38, 0x37, 0xa7, 0x62, 0x8a, 0x11,
+       0xab, 0x40, 0xe0, 0xf1, 0xc9, 0xd3, 0x4d, 0xb6, 0xa9, 0xd6, 0xb8, 0xb0,
+       0x8e, 0x05, 0x9e, 0xd7, 0xcf, 0x97, 0x35, 0x65, 0x9b, 0xcf, 0x99, 0x55,
+       0x37, 0x67, 0x92, 0xaf, 0xe0, 0x6f, 0x21, 0x3f, 0x7a, 0xa4, 0x26, 0x47,
+       0xfd, 0xd3, 0xd0, 0xa2, 0xdd, 0x23, 0x6f, 0x1b, 0x79, 0xd7, 0x8d, 0xfa,
+       0xb9, 0xee, 0xc2, 0xea, 0xb2, 0x6e, 0x63, 0x95, 0xd0, 0xef, 0x52, 0xe9,
+       0xe5, 0x28, 0xb0, 0x69, 0x6f, 0x1d, 0xaf, 0x69, 0xbc, 0x64, 0xba, 0xfa,
+       0xf9, 0xf8, 0xc6, 0xfd, 0xac, 0xb1, 0xbf, 0x7b, 0x3d, 0xec, 0x6f, 0x23,
+       0x5f, 0x42, 0xec, 0x9d, 0xe2, 0x3b, 0x2a, 0x74, 0x41, 0x1b, 0x2d, 0xe5,
+       0x91, 0x4b, 0xfe, 0x1b, 0xa8, 0x67, 0x65, 0x7d, 0xeb, 0xaa, 0xcf, 0xf3,
+       0x9e, 0xd3, 0xf2, 0x7a, 0x4b, 0x60, 0x1c, 0xeb, 0x83, 0xc8, 0x41, 0xe9,
+       0x62, 0x1d, 0x84, 0xf6, 0x83, 0xd6, 0x0d, 0xc4, 0x80, 0x55, 0x3c, 0x2a,
+       0xa1, 0xec, 0xcc, 0xd1, 0x2d, 0xac, 0xbb, 0x6c, 0x4f, 0x5f, 0x47, 0xac,
+       0x55, 0xc2, 0x9a, 0x10, 0xf2, 0x9e, 0x9d, 0x76, 0x6a, 0xbf, 0xbf, 0xa5,
+       0xc5, 0xbe, 0xd9, 0x29, 0xd7, 0xaa, 0x70, 0xad, 0x8d, 0xae, 0xe6, 0x91,
+       0x97, 0x8e, 0x6b, 0x0f, 0xf2, 0x35, 0x2f, 0x7d, 0xf5, 0xb6, 0xe2, 0x25,
+       0x60, 0x3a, 0x39, 0x47, 0x05, 0x92, 0x73, 0xb6, 0x4e, 0xf0, 0xa5, 0x4a,
+       0xf4, 0x4f, 0xd1, 0xdf, 0x14, 0xfe, 0x5f, 0x65, 0xae, 0xb6, 0xb7, 0x8e,
+       0x53, 0x9b, 0x03, 0x31, 0xb9, 0x61, 0x1c, 0xb1, 0xa3, 0x6b, 0xab, 0xeb,
+       0x38, 0xb5, 0x39, 0x10, 0x8f, 0x6f, 0x29, 0x8e, 0x18, 0xb1, 0xa6, 0x37,
+       0xac, 0x33, 0x70, 0xaf, 0xa9, 0xe8, 0xb5, 0xe4, 0x51, 0x51, 0x7b, 0xeb,
+       0xe6, 0x89, 0x3b, 0xb3, 0x9e, 0x0c, 0xde, 0xe8, 0xab, 0xd3, 0x61, 0x77,
+       0x60, 0x3d, 0xa0, 0x86, 0xb6, 0x41, 0xcf, 0x58, 0x96, 0xf7, 0xba, 0x31,
+       0x72, 0x04, 0x10, 0xc3, 0x2e, 0xd2, 0x99, 0x2b, 0xe0, 0x67, 0x83, 0x39,
+       0x6f, 0x80, 0x32, 0x21, 0xd4, 0x52, 0x89, 0xba, 0x28, 0xbd, 0xbe, 0x28,
+       0xea, 0xa3, 0xce, 0x88, 0xba, 0xcf, 0xc1, 0xf0, 0x6d, 0xb6, 0x91, 0x67,
+       0x8a, 0x6f, 0xd1, 0xd9, 0xa5, 0x20, 0xff, 0x57, 0xf0, 0x7c, 0x7d, 0xed,
+       0x67, 0x35, 0xbf, 0xdf, 0x16, 0xfc, 0xde, 0xbb, 0x21, 0xbf, 0x1f, 0x2f,
+       0xf3, 0x3b, 0x77, 0x28, 0x28, 0x6b, 0x2b, 0x53, 0x57, 0xda, 0xe9, 0xa8,
+       0x78, 0xee, 0x5b, 0xfc, 0x7d, 0x27, 0x1d, 0x35, 0xe5, 0xf7, 0xb3, 0x4b,
+       0xac, 0xfb, 0xb3, 0x6f, 0xd1, 0xb9, 0x2b, 0x8e, 0x2f, 0x21, 0xea, 0x32,
+       0xdc, 0x7b, 0x86, 0xe8, 0xfb, 0xd1, 0xce, 0x4b, 0x16, 0xea, 0xf5, 0x55,
+       0x41, 0xea, 0x2b, 0xba, 0x29, 0x62, 0x20, 0xde, 0xfa, 0x0a, 0xfc, 0x79,
+       0x5e, 0xd9, 0xc6, 0xc9, 0x0d, 0x62, 0x1f, 0xf5, 0xbc, 0xd9, 0xe9, 0x81,
+       0x91, 0xbf, 0xdb, 0x25, 0xd7, 0xb1, 0x36, 0x8a, 0x81, 0x54, 0xe5, 0x81,
+       0xb8, 0xd7, 0xf9, 0xd9, 0x1e, 0x4c, 0xaa, 0x75, 0xf7, 0x9f, 0x76, 0x49,
+       0x3b, 0x82, 0x9a, 0xc8, 0x55, 0xa6, 0xc3, 0x3f, 0x30, 0x7e, 0xd9, 0x4f,
+       0xcd, 0x97, 0xf5, 0x58, 0xf7, 0x0b, 0x7f, 0xc8, 0x1d, 0xcb, 0x99, 0x55,
+       0x35, 0xee, 0x69, 0xd7, 0x98, 0x66, 0x85, 0xdf, 0xf3, 0x49, 0xd6, 0x31,
+       0x7b, 0x6b, 0x6c, 0x45, 0x2d, 0xbf, 0x61, 0x3f, 0x16, 0xcc, 0x2f, 0x19,
+       0x12, 0x1b, 0x8f, 0x31, 0xe6, 0xdd, 0xee, 0x7a, 0xd2, 0xa7, 0xc5, 0x8d,
+       0xb5, 0x7b, 0x7d, 0xd4, 0x7e, 0xc7, 0x3c, 0x48, 0x3f, 0x24, 0xf5, 0x42,
+       0x51, 0xe8, 0x82, 0xd9, 0x91, 0x12, 0x4d, 0x44, 0x77, 0x51, 0x6a, 0x84,
+       0xdf, 0x3d, 0x66, 0xb3, 0x3f, 0xe6, 0x27, 0x87, 0xe5, 0x37, 0x35, 0xb2,
+       0x43, 0xd5, 0xcc, 0xe9, 0x58, 0x7b, 0x8b, 0xc2, 0x90, 0xed, 0x62, 0xdd,
+       0x52, 0xee, 0x49, 0xc4, 0xdf, 0x97, 0xf4, 0xb3, 0x71, 0x1e, 0xbc, 0xdb,
+       0xac, 0xda, 0x5d, 0x74, 0xb5, 0x43, 0x9b, 0x8b, 0xaa, 0x2d, 0x9e, 0xa9,
+       0xb1, 0x86, 0xae, 0xd3, 0x82, 0x1c, 0xae, 0xaa, 0xfa, 0x44, 0xf9, 0xbc,
+       0x99, 0xe2, 0x45, 0x6e, 0xd3, 0xa5, 0xae, 0x5f, 0x64, 0xfc, 0x5b, 0x14,
+       0x32, 0x22, 0xfb, 0xd2, 0x54, 0xee, 0x8b, 0xc4, 0xed, 0xb8, 0xa7, 0x5d,
+       0xe5, 0x62, 0xbe, 0x25, 0xd7, 0x05, 0x54, 0x1f, 0xe4, 0x75, 0xfe, 0x5c,
+       0xaa, 0xf6, 0x29, 0xdf, 0x28, 0xea, 0x75, 0x88, 0x8f, 0x7d, 0x33, 0xd9,
+       0x77, 0x7c, 0x32, 0xe7, 0xd8, 0x14, 0x6b, 0xa9, 0x32, 0x7f, 0x43, 0x7f,
+       0x47, 0xac, 0x19, 0x39, 0x16, 0xc8, 0x9f, 0x70, 0xeb, 0x16, 0x39, 0xb6,
+       0x00, 0x6c, 0x50, 0x11, 0x6b, 0xa8, 0x1b, 0xe1, 0xe7, 0xbd, 0xcc, 0x9b,
+       0xe6, 0x36, 0x70, 0xe8, 0x56, 0x64, 0xcd, 0xf2, 0x90, 0x35, 0xf7, 0xfb,
+       0x51, 0xcb, 0x87, 0x9a, 0x3e, 0x67, 0xd8, 0xa0, 0x12, 0xfb, 0x0a, 0x06,
+       0x15, 0x4c, 0x1f, 0x9d, 0xb3, 0x23, 0xd1, 0x25, 0x81, 0x37, 0xef, 0x43,
+       0xce, 0xcf, 0xf0, 0x2a, 0x1d, 0x36, 0xcf, 0x92, 0xdc, 0xef, 0xa1, 0xc0,
+       0xb6, 0x77, 0x9a, 0xf9, 0xed, 0x2c, 0xfb, 0x1f, 0xce, 0x14, 0xd6, 0x5d,
+       0x34, 0xcd, 0xb0, 0x0f, 0x00, 0x3e, 0x2d, 0x9e, 0xa7, 0xe2, 0x6e, 0x0a,
+       0xc6, 0xf8, 0x99, 0x16, 0x74, 0x11, 0x3f, 0x27, 0x49, 0x71, 0xf6, 0x93,
+       0xe0, 0xb3, 0x4e, 0x4f, 0x45, 0xcc, 0x02, 0x19, 0xdc, 0x16, 0xbe, 0x2b,
+       0x9e, 0x83, 0xfb, 0x63, 0x66, 0x13, 0xd5, 0xd6, 0x1c, 0xb7, 0x8b, 0x3a,
+       0xcc, 0x9b, 0xd1, 0x7b, 0xc8, 0xe8, 0x81, 0x6e, 0xc2, 0x9c, 0xdd, 0xad,
+       0xd6, 0x8b, 0x3a, 0xf8, 0xfb, 0x90, 0xfa, 0x2e, 0xe7, 0x5a, 0x7e, 0xd7,
+       0xbc, 0x8c, 0xbf, 0x0f, 0x5b, 0xc8, 0xfe, 0x5d, 0x35, 0x7f, 0xd5, 0xeb,
+       0x66, 0xfd, 0x46, 0x90, 0xce, 0x7b, 0xae, 0x9b, 0x6d, 0x54, 0xcb, 0xdb,
+       0xb1, 0xc5, 0x5a, 0xde, 0x9f, 0xef, 0x96, 0xf5, 0x71, 0xee, 0xbe, 0xfc,
+       0x9c, 0xfb, 0xe2, 0x15, 0x0f, 0x71, 0xeb, 0x5e, 0xad, 0x73, 0x4b, 0xf4,
+       0x6f, 0xd1, 0xcf, 0xd2, 0x7a, 0x28, 0xac, 0xf2, 0x99, 0x90, 0xbf, 0x74,
+       0x8f, 0xe2, 0x55, 0xad, 0xe7, 0xc9, 0x43, 0xcf, 0x3f, 0x20, 0xf2, 0x8e,
+       0xa5, 0x9d, 0xd8, 0xaf, 0xe8, 0x01, 0x9a, 0x85, 0x5d, 0x34, 0xeb, 0x76,
+       0xd1, 0xcc, 0x50, 0xdf, 0x77, 0x89, 0xe3, 0xf3, 0x4b, 0xaf, 0x76, 0xc8,
+       0x7a, 0x78, 0xac, 0x29, 0x7e, 0x5f, 0x7d, 0xdf, 0x6c, 0xbc, 0x0f, 0x84,
+       0x28, 0x28, 0xe2, 0x4d, 0xae, 0xb1, 0xbe, 0x44, 0x64, 0xb3, 0x37, 0x5c,
+       0x47, 0x83, 0x6f, 0xb9, 0xce, 0xa3, 0x8f, 0x83, 0xae, 0x3e, 0xf6, 0xbb,
+       0xfa, 0x78, 0xb0, 0x41, 0x1f, 0x59, 0x9f, 0xf3, 0x7b, 0xce, 0x16, 0x3f,
+       0x69, 0x5f, 0xd1, 0x4f, 0xd4, 0x49, 0x83, 0x9e, 0x3b, 0x29, 0x1d, 0x0a,
+       0x2b, 0x3b, 0x11, 0x55, 0xf5, 0x03, 0x5e, 0x7d, 0xfe, 0x31, 0x35, 0x9e,
+       0x37, 0x37, 0xaf, 0xba, 0xeb, 0xab, 0x9f, 0xa3, 0x09, 0x59, 0x27, 0xaf,
+       0x64, 0xfb, 0x62, 0x83, 0x78, 0x34, 0x72, 0x3b, 0x80, 0x37, 0x84, 0x6f,
+       0xb8, 0x4f, 0xee, 0x6f, 0x17, 0xa0, 0xe5, 0x72, 0xad, 0xb2, 0x5f, 0xd5,
+       0xf0, 0x3d, 0x1b, 0xba, 0xb3, 0x75, 0xca, 0x38, 0xff, 0x3d, 0x11, 0xcb,
+       0x93, 0xeb, 0x48, 0xab, 0xaa, 0xde, 0x3a, 0x62, 0x21, 0x47, 0x60, 0x71,
+       0x05, 0x71, 0xd8, 0x46, 0xb5, 0xc9, 0x52, 0x17, 0xa5, 0xca, 0x7b, 0xc2,
+       0x14, 0x44, 0x1d, 0x86, 0x8c, 0x8f, 0xc9, 0x1a, 0xe2, 0xc5, 0x95, 0x1b,
+       0xa2, 0x6e, 0x37, 0xae, 0x6a, 0x91, 0x53, 0xd4, 0x26, 0x70, 0xed, 0x27,
+       0xaf, 0x21, 0xfe, 0x71, 0x68, 0xfb, 0x35, 0xc4, 0xee, 0x7b, 0xb6, 0x57,
+       0x43, 0x6c, 0xf2, 0xd8, 0x8d, 0x05, 0x59, 0x43, 0x5c, 0xbd, 0x46, 0x23,
+       0x6b, 0x88, 0x53, 0x2e, 0xac, 0x20, 0xf1, 0xf9, 0x4d, 0x57, 0x7e, 0xb7,
+       0xac, 0x0f, 0x5e, 0x2c, 0xe3, 0x53, 0x59, 0x1f, 0x2c, 0xf3, 0xc1, 0xdd,
+       0x7b, 0xdf, 0xc8, 0xb5, 0x20, 0xf9, 0x9e, 0x5d, 0x35, 0x6b, 0x41, 0xb2,
+       0x2e, 0xd8, 0x32, 0xbc, 0xf8, 0x4e, 0xdb, 0x25, 0xec, 0xf7, 0x10, 0x63,
+       0xde, 0xdd, 0xd9, 0x60, 0xbf, 0x87, 0x58, 0x83, 0xfd, 0x1e, 0xdc, 0xba,
+       0xdf, 0x8d, 0xa7, 0x80, 0x7f, 0x61, 0x17, 0x81, 0x7b, 0xb1, 0x5f, 0x43,
+       0x94, 0xce, 0x97, 0x71, 0xe6, 0x3d, 0x94, 0x54, 0x38, 0xf3, 0xfc, 0x92,
+       0xd6, 0x47, 0xfd, 0x35, 0xfa, 0xc8, 0x0b, 0x77, 0x46, 0x54, 0xce, 0x8f,
+       0x96, 0x57, 0xc7, 0x25, 0xaf, 0x8e, 0x87, 0xbc, 0xe2, 0x1e, 0xa7, 0x41,
+       0xbf, 0x41, 0x13, 0xdc, 0x83, 0xff, 0x97, 0xc2, 0xd8, 0xa7, 0x86, 0xe8,
+       0x0b, 0xdd, 0x0a, 0xeb, 0xb9, 0xe4, 0xf5, 0x2c, 0xcb, 0xab, 0x3e, 0x8f,
+       0xfe, 0x36, 0xc2, 0xfb, 0x1a, 0x1f, 0xee, 0xf7, 0x1d, 0xbb, 0xf2, 0x0b,
+       0x91, 0x17, 0x50, 0xed, 0x27, 0x6a, 0x0c, 0x71, 0x48, 0xc8, 0xd2, 0xba,
+       0x1f, 0xf9, 0x2b, 0xfa, 0x1c, 0x6a, 0xa7, 0x20, 0x7f, 0x9a, 0x16, 0xcd,
+       0x35, 0x38, 0xa3, 0x5d, 0xe1, 0x08, 0x91, 0xff, 0xeb, 0xea, 0xdb, 0x7f,
+       0x72, 0xdf, 0xf4, 0x79, 0x6d, 0x33, 0xdf, 0xae, 0x8a, 0x69, 0x54, 0xe7,
+       0x4d, 0x22, 0x7e, 0xb4, 0x2b, 0x69, 0xd8, 0x09, 0x91, 0x7f, 0xda, 0x69,
+       0x23, 0x56, 0x16, 0x67, 0xd9, 0xef, 0x4c, 0x22, 0xd7, 0xb9, 0xf3, 0x92,
+       0x45, 0xa7, 0xb2, 0x57, 0x0f, 0x48, 0x5e, 0x79, 0x5a, 0xec, 0xd3, 0x89,
+       0x7d, 0x1d, 0x27, 0xd8, 0x3e, 0xc7, 0x19, 0x60, 0xce, 0x15, 0x5b, 0x68,
+       0x91, 0x91, 0xbc, 0xdf, 0x2e, 0x88, 0x58, 0x1f, 0xeb, 0xa4, 0x1c, 0xf6,
+       0x6b, 0x35, 0x16, 0x9a, 0xf9, 0xb9, 0x3d, 0xb4, 0x9c, 0x07, 0xcf, 0x35,
+       0xa9, 0xfd, 0x53, 0xd0, 0xd6, 0x47, 0x5d, 0xf6, 0xdf, 0x32, 0xed, 0x1e,
+       0x11, 0x79, 0x97, 0x8b, 0xb9, 0xa7, 0xe5, 0x67, 0xe1, 0x55, 0xf5, 0x0e,
+       0x7e, 0x5f, 0xf1, 0x75, 0x8a, 0x75, 0xb9, 0xf3, 0x00, 0xdd, 0x7f, 0xde,
+       0x78, 0xe5, 0xe4, 0xb6, 0xf0, 0x8a, 0x93, 0xac, 0xe0, 0x15, 0xf7, 0xb3,
+       0x35, 0x76, 0xf9, 0xe3, 0x1e, 0xb9, 0x9f, 0x05, 0x68, 0xb0, 0x13, 0x58,
+       0x2c, 0x09, 0x5a, 0x1a, 0xe3, 0x91, 0x70, 0xdc, 0x3f, 0x46, 0x99, 0xe2,
+       0x35, 0x4a, 0xe5, 0x60, 0xe7, 0xf9, 0xb3, 0xf0, 0x37, 0x7b, 0x64, 0x9c,
+       0x46, 0xdf, 0x03, 0xbd, 0xb2, 0x9b, 0xdb, 0x37, 0xef, 0x91, 0x39, 0xdb,
+       0xee, 0xf3, 0xed, 0x7c, 0xfe, 0xc9, 0x70, 0xf5, 0xf9, 0x1d, 0x7c, 0xbe,
+       0x2b, 0x89, 0x39, 0x34, 0x2e, 0x21, 0x36, 0x39, 0x4c, 0x69, 0x9e, 0x9f,
+       0x4c, 0x91, 0x6d, 0xeb, 0x65, 0xd6, 0x57, 0x4b, 0xba, 0x5d, 0x37, 0xb7,
+       0x0b, 0x89, 0x39, 0x31, 0xb8, 0xcd, 0x6c, 0x76, 0x84, 0xdb, 0xed, 0x27,
+       0xff, 0x65, 0x8b, 0x32, 0x4b, 0x9a, 0x57, 0x75, 0x2e, 0xfe, 0x2f, 0xba,
+       0x65, 0x6e, 0xd5, 0xae, 0xb0, 0xa4, 0xdf, 0xb0, 0x88, 0x7b, 0x22, 0xb7,
+       0xe3, 0x19, 0xc1, 0x87, 0x91, 0x31, 0xab, 0xfc, 0x7e, 0xec, 0x31, 0x26,
+       0xf6, 0x7c, 0xe5, 0x31, 0xb0, 0x5e, 0x1c, 0xb7, 0xcd, 0x74, 0x39, 0x6f,
+       0x6d, 0x6d, 0x9f, 0xbc, 0x7f, 0x67, 0x8f, 0xdc, 0x7f, 0xb5, 0x53, 0xed,
+       0x15, 0xa8, 0x6d, 0xce, 0x17, 0x90, 0xa7, 0x2d, 0x68, 0xe3, 0x5f, 0x80,
+       0xbe, 0x34, 0xf8, 0x3b, 0x8f, 0x27, 0x89, 0x3e, 0xf6, 0xf6, 0xe8, 0x3d,
+       0x17, 0xe5, 0xb8, 0x4e, 0x70, 0x7f, 0x13, 0x3c, 0x2e, 0x7d, 0x3e, 0xc6,
+       0xc7, 0x5e, 0xf3, 0x8b, 0x67, 0x05, 0xf9, 0x39, 0x2c, 0x03, 0x53, 0xc1,
+       0x64, 0x6a, 0x58, 0xce, 0x73, 0x25, 0xae, 0x1b, 0x2e, 0xc7, 0x75, 0xe7,
+       0xb2, 0xc7, 0x7b, 0x10, 0xcf, 0x30, 0x2e, 0xf1, 0x7c, 0x87, 0x9e, 0xe1,
+       0xb6, 0xa8, 0x63, 0x48, 0xf3, 0x67, 0x9b, 0xca, 0xef, 0xa9, 0xe7, 0x15,
+       0x99, 0x2f, 0xa1, 0xed, 0x16, 0xee, 0xbd, 0x97, 0x9f, 0x21, 0x6d, 0x57,
+       0xe3, 0xf7, 0x50, 0x5d, 0x4e, 0x4c, 0x3d, 0x8f, 0x6d, 0x14, 0x8b, 0x15,
+       0xeb, 0x8a, 0x1e, 0x7c, 0xb6, 0x51, 0xac, 0x44, 0xe4, 0x39, 0xfb, 0x26,
+       0xea, 0xe4, 0x15, 0x72, 0x1c, 0xa0, 0x27, 0xe6, 0x1d, 0xda, 0xc1, 0x73,
+       0xf5, 0x27, 0x06, 0xea, 0x86, 0x4b, 0x24, 0x73, 0x9f, 0x98, 0xc6, 0x59,
+       0x7b, 0xf8, 0xac, 0xc1, 0x74, 0xce, 0x3a, 0xa5, 0x80, 0xdd, 0x46, 0xcd,
+       0x2c, 0xab, 0xbf, 0x4f, 0x03, 0xec, 0xeb, 0x41, 0x66, 0xed, 0x70, 0x82,
+       0x20, 0x6f, 0x11, 0xf3, 0x18, 0xf3, 0xc4, 0x44, 0x11, 0xfc, 0x6c, 0xd0,
+       0x63, 0x79, 0xa2, 0x47, 0xf3, 0x03, 0xe6, 0x37, 0xc9, 0xb6, 0x2a, 0xd7,
+       0x23, 0x66, 0x9c, 0xfb, 0x91, 0x28, 0xfe, 0x25, 0x7d, 0x24, 0xf6, 0x71,
+       0x01, 0x1d, 0xf5, 0xbc, 0xff, 0x39, 0x4d, 0x27, 0xd1, 0xef, 0xad, 0xcb,
+       0xe7, 0xa9, 0x6d, 0xc9, 0x67, 0xd0, 0x43, 0x3e, 0x3f, 0x54, 0x7c, 0x53,
+       0x62, 0x1e, 0x0d, 0xd2, 0x4c, 0x0e, 0xb9, 0x60, 0x9f, 0x47, 0x0d, 0x66,
+       0x2e, 0xc5, 0x7a, 0x29, 0x55, 0xd1, 0x4b, 0x17, 0xe2, 0xfe, 0x18, 0x64,
+       0x1c, 0x7b, 0xd1, 0xa9, 0x1c, 0x20, 0x8c, 0x63, 0x1f, 0x0d, 0x2c, 0xec,
+       0xe4, 0x7b, 0x69, 0x35, 0x3e, 0x1a, 0x53, 0x7b, 0x15, 0x44, 0xac, 0x09,
+       0xd6, 0x8f, 0x73, 0x2c, 0xcb, 0xe9, 0xdc, 0xdd, 0xb4, 0x18, 0xea, 0xa5,
+       0xfe, 0x05, 0xbd, 0x7f, 0x0b, 0xc6, 0x3a, 0xd4, 0x2b, 0x75, 0x92, 0x1e,
+       0xf7, 0x6f, 0x89, 0x38, 0x85, 0x75, 0xed, 0x57, 0x35, 0xee, 0x9d, 0x9b,
+       0xe8, 0xa5, 0x92, 0x92, 0xd9, 0xd2, 0x1b, 0xf1, 0x28, 0x39, 0xf1, 0xd1,
+       0xff, 0x15, 0xfc, 0xdf, 0x7f, 0x0d, 0xb5, 0x38, 0xd0, 0xd1, 0x16, 0x25,
+       0xb3, 0xb5, 0xb4, 0xe8, 0xe5, 0x71, 0xe3, 0x7a, 0xe9, 0xa7, 0x33, 0xd1,
+       0x57, 0x85, 0xed, 0x1f, 0xb8, 0xc6, 0xed, 0x84, 0x6d, 0xd2, 0x7a, 0xc3,
+       0x8b, 0x0f, 0xf5, 0xde, 0x9c, 0x9a, 0x17, 0x65, 0xce, 0x27, 0xe3, 0x37,
+       0x33, 0xe9, 0xaf, 0xe5, 0xc9, 0x8f, 0xe9, 0xe4, 0xbc, 0x45, 0x93, 0x59,
+       0xec, 0x81, 0x38, 0xc6, 0x72, 0xed, 0xb6, 0x17, 0xdc, 0x9e, 0xc0, 0x67,
+       0xe3, 0x2c, 0xfb, 0xec, 0xb7, 0xe7, 0x2c, 0x99, 0x7f, 0x27, 0xf6, 0xdb,
+       0x6b, 0x11, 0x7a, 0xd4, 0xb4, 0xfb, 0xf7, 0x68, 0x7b, 0x90, 0xca, 0xa1,
+       0xce, 0x90, 0x3f, 0x0b, 0xdc, 0x3e, 0xdb, 0x43, 0xa9, 0x3c, 0x9e, 0x03,
+       0x7b, 0x87, 0xbe, 0xf3, 0xf1, 0xb2, 0x9c, 0xd7, 0x7e, 0x7e, 0x36, 0xf6,
+       0x0e, 0x98, 0x2c, 0x8e, 0x88, 0x1c, 0x3c, 0xe8, 0x66, 0x39, 0x9f, 0xe3,
+       0x34, 0xeb, 0xa9, 0x57, 0x14, 0xa6, 0x74, 0xc9, 0x77, 0x4a, 0xc8, 0xf7,
+       0xb8, 0x98, 0x8f, 0x54, 0xde, 0x60, 0xbc, 0xa6, 0xe3, 0x0c, 0x5d, 0x7c,
+       0x1c, 0x50, 0x3a, 0x04, 0xd7, 0xee, 0xdd, 0x23, 0xf2, 0x13, 0x6d, 0x9c,
+       0xc7, 0xe7, 0x38, 0x3d, 0xc3, 0xb8, 0xf3, 0xd9, 0x6c, 0x0b, 0xdd, 0xc8,
+       0xb5, 0xd0, 0x9b, 0xb9, 0x5e, 0xba, 0x3e, 0xdf, 0x41, 0xb3, 0x8c, 0x99,
+       0x67, 0xed, 0x80, 0x95, 0x66, 0xff, 0xe2, 0x6a, 0x54, 0xe4, 0x10, 0xb1,
+       0xdc, 0xa1, 0x3d, 0xf0, 0x5f, 0x7c, 0x2f, 0xf3, 0x1c, 0x63, 0xef, 0x56,
+       0xfa, 0x80, 0xdf, 0x99, 0xce, 0xea, 0x9c, 0x07, 0xc4, 0xe3, 0x07, 0xcb,
+       0xf8, 0x75, 0x73, 0x1e, 0x31, 0x37, 0xe1, 0x91, 0x71, 0xa1, 0xeb, 0x33,
+       0xf3, 0x7c, 0x7d, 0x1e, 0x71, 0x73, 0x4b, 0xc4, 0x24, 0xbe, 0x14, 0x40,
+       0x7b, 0x9c, 0xb3, 0x65, 0xce, 0xa4, 0x18, 0x5b, 0x98, 0x8f, 0x41, 0xdb,
+       0xb0, 0xa2, 0x43, 0x2b, 0x8f, 0x4f, 0xc6, 0x30, 0x52, 0xcb, 0xad, 0x74,
+       0x26, 0xcf, 0x18, 0x24, 0xef, 0x67, 0x1f, 0x06, 0x6d, 0x7f, 0xe7, 0xa0,
+       0xde, 0xd3, 0x76, 0x96, 0xfb, 0x9e, 0xce, 0x4b, 0x0c, 0x92, 0x5e, 0x6e,
+       0xa7, 0x4c, 0xbe, 0x4d, 0x1d, 0xdf, 0x2d, 0xf2, 0xdd, 0xe5, 0xde, 0x12,
+       0xb8, 0xb6, 0x91, 0x7e, 0x43, 0xae, 0x11, 0x6c, 0xaa, 0xf4, 0x4b, 0xa1,
+       0x6b, 0xbc, 0xf3, 0x8c, 0xc6, 0xe8, 0x39, 0xb6, 0xb7, 0xfd, 0x97, 0x11,
+       0x2b, 0xfe, 0x22, 0xf8, 0xa6, 0x00, 0x1e, 0xeb, 0xbf, 0x8c, 0x7d, 0x9f,
+       0xfc, 0x22, 0xf7, 0x68, 0x22, 0x34, 0x2c, 0x6a, 0x46, 0xa4, 0x8c, 0x4e,
+       0x89, 0xba, 0xec, 0xef, 0x08, 0xdd, 0x14, 0x71, 0x2c, 0x03, 0x78, 0x24,
+       0x12, 0x26, 0x92, 0x39, 0x59, 0xa7, 0xec, 0xce, 0x9b, 0xdd, 0xe3, 0x43,
+       0x14, 0xeb, 0x01, 0xdf, 0x4b, 0x99, 0x95, 0x7b, 0x22, 0x90, 0xd0, 0xf7,
+       0xe6, 0x21, 0x5d, 0x63, 0xa0, 0x8f, 0xb5, 0xad, 0xd0, 0xc7, 0x6d, 0x35,
+       0xd7, 0xcd, 0x9a, 0xeb, 0x1a, 0x7f, 0x63, 0xad, 0x8c, 0xed, 0x3c, 0xc9,
+       0x3d, 0x98, 0x52, 0x0b, 0x92, 0xff, 0xcc, 0x43, 0x83, 0xe6, 0xfd, 0x0a,
+       0x83, 0xa7, 0x56, 0x06, 0xc2, 0x9d, 0x46, 0x9b, 0x3f, 0x35, 0xf2, 0xaf,
+       0xa5, 0x58, 0x12, 0xb8, 0xe8, 0xf5, 0x3d, 0x52, 0xc7, 0xa1, 0x5f, 0x4e,
+       0x14, 0xd0, 0x6d, 0x6a, 0xa5, 0x8d, 0x56, 0xc5, 0x9e, 0x63, 0xc0, 0x18,
+       0xb8, 0x1f, 0xcf, 0x71, 0xcc, 0x26, 0xc2, 0x3e, 0xf2, 0x90, 0xf1, 0xc3,
+       0xe1, 0x6b, 0x3c, 0x9f, 0x89, 0x95, 0xff, 0x29, 0x4d, 0x8b, 0x7d, 0x7a,
+       0xd0, 0x96, 0x31, 0xa4, 0xc0, 0xfc, 0x8c, 0x5f, 0xaa, 0xfc, 0xaa, 0x31,
+       0xf4, 0xd3, 0xc1, 0x9a, 0x8a, 0x61, 0xbf, 0xc0, 0x32, 0x26, 0xd7, 0xca,
+       0x13, 0x35, 0x6b, 0xe5, 0x53, 0x62, 0xad, 0x1c, 0xeb, 0xe4, 0x1b, 0xe5,
+       0x2d, 0xea, 0x3c, 0x16, 0x8b, 0x66, 0xaf, 0x08, 0x7d, 0x13, 0x9d, 0xf0,
+       0xcb, 0x3c, 0xeb, 0x04, 0xbb, 0x37, 0x86, 0xa8, 0x6d, 0xc0, 0x67, 0xcc,
+       0x88, 0xdb, 0x91, 0xe1, 0x35, 0xc6, 0x14, 0x4b, 0xb9, 0x1d, 0x74, 0xbd,
+       0xd0, 0xc4, 0x98, 0xef, 0x9f, 0x69, 0xad, 0x40, 0x8c, 0x0d, 0x3b, 0x28,
+       0x13, 0x65, 0x5e, 0x1b, 0x0e, 0xf2, 0xbc, 0x32, 0xbe, 0x1d, 0x66, 0xf9,
+       0xe3, 0x31, 0x2c, 0xe5, 0x4b, 0xef, 0xa7, 0xa3, 0x31, 0x2b, 0x3e, 0xda,
+       0xc6, 0xfe, 0x8b, 0xc9, 0xff, 0x36, 0xff, 0x9f, 0x0b, 0x83, 0x36, 0x8b,
+       0xcb, 0xb8, 0xce, 0xd8, 0x27, 0x5b, 0x7a, 0x7f, 0x86, 0xdb, 0xcc, 0x8c,
+       0xc2, 0x0f, 0x82, 0xbf, 0x67, 0xf3, 0xbf, 0x6c, 0xb3, 0xc4, 0x7c, 0x97,
+       0xbe, 0xe2, 0x84, 0x0d, 0xa1, 0xe3, 0xb1, 0x2f, 0xcd, 0x80, 0xfa, 0x8c,
+       0x19, 0x33, 0xdc, 0x97, 0xeb, 0x84, 0x67, 0x58, 0x94, 0x8a, 0x1e, 0x62,
+       0x39, 0xe8, 0xe0, 0x4f, 0xd4, 0x6a, 0xed, 0xa4, 0xcc, 0xc8, 0xa0, 0xaa,
+       0xd5, 0xfa, 0x59, 0x83, 0x5a, 0x2d, 0xdc, 0xc7, 0x38, 0x60, 0xbe, 0x74,
+       0x7b, 0x26, 0xea, 0x7e, 0x2f, 0x19, 0xa9, 0xe8, 0x2e, 0x81, 0x99, 0x96,
+       0x96, 0x1f, 0xe6, 0x3e, 0xc4, 0xac, 0xd4, 0x28, 0xf7, 0x35, 0xef, 0xee,
+       0x7f, 0xe9, 0xf6, 0x44, 0x14, 0xed, 0xfc, 0x35, 0xed, 0x62, 0x24, 0xda,
+       0x2e, 0xa3, 0x7d, 0xe9, 0x97, 0xf1, 0xa8, 0x1e, 0xa7, 0xfb, 0x5e, 0x8c,
+       0x07, 0xf2, 0xc5, 0x9f, 0x4b, 0xef, 0xd0, 0xf5, 0x1c, 0xfc, 0x71, 0x43,
+       0xd5, 0x5f, 0x59, 0xe4, 0x2c, 0x31, 0x06, 0xbc, 0x72, 0xd0, 0xb7, 0x96,
+       0xfb, 0x41, 0x29, 0x55, 0x95, 0xdb, 0x52, 0x1d, 0x73, 0x97, 0x3e, 0x58,
+       0x2f, 0xd9, 0x97, 0x60, 0x43, 0x61, 0x3f, 0x9d, 0x92, 0xdf, 0x06, 0xde,
+       0x83, 0x6f, 0xf4, 0x34, 0xeb, 0x2f, 0x99, 0x9f, 0xc4, 0xba, 0x94, 0x75,
+       0x98, 0x94, 0x9f, 0x44, 0xd5, 0x4f, 0x3c, 0x48, 0x1e, 0xee, 0xaf, 0xe4,
+       0x49, 0xba, 0xd6, 0xd8, 0x03, 0xae, 0x35, 0x76, 0xd3, 0x95, 0x27, 0x19,
+       0x12, 0xf8, 0xac, 0x82, 0xa9, 0x42, 0x0a, 0x53, 0x01, 0x7b, 0x49, 0xdd,
+       0xb6, 0x58, 0xd6, 0x6d, 0xbb, 0x37, 0xd1, 0x6d, 0x5e, 0xbe, 0xea, 0xaa,
+       0xd2, 0x23, 0x91, 0x28, 0x6c, 0x0c, 0xf6, 0x59, 0xfa, 0xfb, 0xe2, 0x28,
+       0xeb, 0x91, 0x28, 0xeb, 0x91, 0x11, 0xd6, 0x23, 0xc3, 0xac, 0x47, 0x6c,
+       0xa6, 0x81, 0xc5, 0x63, 0xff, 0x98, 0xf5, 0x34, 0xec, 0xc7, 0x18, 0x3d,
+       0x53, 0x84, 0x4e, 0x1e, 0x61, 0x0c, 0xf4, 0x31, 0xad, 0xcd, 0xb7, 0x33,
+       0xff, 0x4a, 0xdc, 0x53, 0xed, 0xd7, 0x60, 0xdf, 0x18, 0xc4, 0x86, 0x7f,
+       0x08, 0xbd, 0xf3, 0xb2, 0x43, 0x7d, 0xbe, 0xeb, 0x39, 0xd0, 0x79, 0x0d,
+       0x7b, 0x6b, 0xbc, 0x08, 0xd9, 0xc6, 0xbe, 0xc7, 0xdf, 0x1e, 0x1a, 0xe3,
+       0xbe, 0xf7, 0xf9, 0x32, 0x3c, 0x2f, 0x8f, 0x47, 0x1d, 0xb3, 0x8b, 0x65,
+       0x60, 0x52, 0xc9, 0xc0, 0x64, 0x45, 0x06, 0x9c, 0x34, 0x8f, 0xa4, 0x73,
+       0xa1, 0x83, 0x06, 0x8f, 0xc4, 0xf7, 0x76, 0xb2, 0xfc, 0x22, 0x67, 0xa2,
+       0xb2, 0xff, 0x90, 0x9f, 0xa6, 0x43, 0x41, 0xb5, 0x6f, 0x91, 0xc5, 0x76,
+       0xf3, 0x27, 0x94, 0xc9, 0xbd, 0xcb, 0xb8, 0x84, 0xe5, 0xd4, 0xc4, 0xf1,
+       0x45, 0xc4, 0x45, 0xd9, 0x6f, 0x68, 0x15, 0x71, 0xa5, 0x45, 0xd1, 0x16,
+       0xc7, 0x91, 0x61, 0xd6, 0x71, 0xd1, 0x55, 0x23, 0x32, 0x16, 0x33, 0x2e,
+       0xf7, 0x62, 0x5f, 0xfa, 0x6f, 0x17, 0x1f, 0xeb, 0x95, 0xf5, 0xb9, 0x4f,
+       0xed, 0x95, 0xfa, 0x84, 0x79, 0x34, 0x14, 0x13, 0xbe, 0x5b, 0xd3, 0x25,
+       0x69, 0x3f, 0x17, 0x79, 0xbe, 0x97, 0xa2, 0xc3, 0x3c, 0xdf, 0x6d, 0xca,
+       0x76, 0x3a, 0x7c, 0x5d, 0xd8, 0x65, 0xb6, 0xa1, 0xbd, 0xd8, 0xd3, 0xdf,
+       0x8c, 0x47, 0x9f, 0xe2, 0x77, 0x62, 0x1f, 0xa1, 0x2f, 0xe3, 0x79, 0xcc,
+       0xbd, 0xd0, 0x1f, 0x3f, 0x61, 0x1b, 0x8d, 0xf7, 0x82, 0x1f, 0xf9, 0x7b,
+       0x61, 0x8c, 0x2e, 0x64, 0x75, 0x1f, 0xde, 0x23, 0xe3, 0x39, 0xf4, 0xc3,
+       0x47, 0xbb, 0xed, 0xf7, 0x44, 0x4d, 0x88, 0xf1, 0x8d, 0xda, 0x3e, 0x7d,
+       0x45, 0xf5, 0x09, 0x7b, 0x79, 0xb6, 0xf0, 0x18, 0x76, 0x13, 0xf6, 0x74,
+       0x5a, 0x14, 0x7b, 0x6d, 0x36, 0x0b, 0x9f, 0x75, 0x51, 0xf8, 0x1e, 0x0f,
+       0xef, 0xad, 0xec, 0xff, 0x79, 0x57, 0xcd, 0xb9, 0x75, 0xb6, 0x5b, 0x47,
+       0x05, 0x46, 0xeb, 0xc7, 0x1e, 0xf4, 0xa2, 0x66, 0xf5, 0x4f, 0xc5, 0x35,
+       0x63, 0x01, 0xd7, 0x3e, 0xa7, 0xae, 0x7d, 0x56, 0x60, 0x63, 0x63, 0xbc,
+       0x95, 0xf5, 0xa2, 0xe0, 0x77, 0x9e, 0x67, 0x7b, 0x98, 0xf9, 0x3d, 0xbc,
+       0xc4, 0xcf, 0x9d, 0x16, 0xf4, 0xd4, 0xf4, 0x00, 0x2d, 0x20, 0x03, 0x6d,
+       0x8a, 0xff, 0x23, 0x56, 0xc2, 0xaf, 0xc7, 0xdd, 0x88, 0xce, 0x63, 0xb0,
+       0xcf, 0x3c, 0x56, 0x8c, 0xc9, 0xf2, 0xc5, 0x0a, 0x61, 0x5f, 0x7a, 0x1e,
+       0xbe, 0x0e, 0xea, 0x5e, 0x0e, 0x20, 0x9f, 0x8a, 0xfb, 0xb0, 0x87, 0x62,
+       0x49, 0xf4, 0x0b, 0xed, 0x34, 0x0d, 0xfe, 0xa8, 0x86, 0x16, 0xee, 0xfb,
+       0x3a, 0xd4, 0x7d, 0xad, 0x62, 0x2e, 0xc8, 0xc0, 0x7b, 0xf4, 0xbb, 0xf1,
+       0x5e, 0xbc, 0x1f, 0xf7, 0xe1, 0x79, 0xf2, 0xb9, 0xdd, 0xac, 0xb7, 0xe3,
+       0xa3, 0xf2, 0x59, 0xc6, 0x35, 0x79, 0xad, 0xdb, 0xf6, 0xee, 0xaf, 0x9c,
+       0x3f, 0x9f, 0xda, 0x83, 0x08, 0xf3, 0xd7, 0x41, 0x05, 0x11, 0xfb, 0xc4,
+       0xb5, 0x3e, 0x9f, 0xf0, 0x6b, 0x6d, 0xfe, 0xe4, 0x79, 0x9d, 0xe3, 0xe3,
+       0x33, 0xb9, 0x77, 0x84, 0xcf, 0x9e, 0x4e, 0xf6, 0xf9, 0x0a, 0x05, 0x8c,
+       0xb7, 0xcf, 0x97, 0x60, 0x19, 0x98, 0xc8, 0xc5, 0x4b, 0x19, 0xa1, 0x6b,
+       0x18, 0xeb, 0x76, 0x45, 0xcc, 0x69, 0xa3, 0x47, 0x60, 0x3e, 0x7e, 0x1f,
+       0x7f, 0x67, 0x39, 0xcc, 0xb2, 0x1c, 0x66, 0x59, 0x0e, 0xb3, 0x2c, 0x87,
+       0xec, 0xab, 0x7e, 0x2b, 0xcb, 0x72, 0xc8, 0xb6, 0xe4, 0x15, 0xb6, 0x25,
+       0x52, 0x76, 0x63, 0x2a, 0xbe, 0xa9, 0x65, 0x17, 0xeb, 0x7f, 0x6e, 0x1f,
+       0x47, 0xcb, 0x2a, 0xec, 0x37, 0xf9, 0x8e, 0x0f, 0x55, 0xcb, 0xec, 0x0d,
+       0x96, 0xd9, 0xa6, 0xf1, 0x1e, 0xba, 0x95, 0xc7, 0x9c, 0x45, 0xac, 0x39,
+       0xd6, 0xd5, 0x09, 0x3f, 0xb0, 0x56, 0x80, 0xe5, 0x09, 0x58, 0x33, 0xc2,
+       0x74, 0xef, 0xa1, 0xdb, 0xac, 0xaf, 0x6f, 0xe5, 0x21, 0xc3, 0x07, 0xd4,
+       0x71, 0x84, 0x65, 0x18, 0xf6, 0xcf, 0xf6, 0xdd, 0xc8, 0x19, 0x8c, 0xc9,
+       0x02, 0x66, 0x8a, 0xa0, 0x4f, 0x05, 0x4e, 0xe3, 0x79, 0x5f, 0x65, 0xbd,
+       0x8f, 0x18, 0x1e, 0xec, 0xc5, 0x19, 0x1f, 0xdb, 0x8b, 0xf0, 0x75, 0xd6,
+       0xa7, 0xe7, 0xf3, 0x36, 0xcb, 0x7d, 0x17, 0xfd, 0x59, 0x1e, 0x76, 0x1a,
+       0x34, 0xe2, 0xe3, 0x02, 0x89, 0xd8, 0x98, 0x31, 0x8e, 0xb1, 0x0f, 0x3a,
+       0x86, 0xe0, 0x93, 0xdb, 0x98, 0x23, 0xa6, 0xfd, 0x3b, 0x7b, 0xb1, 0x9f,
+       0x7e, 0xcc, 0x68, 0x56, 0xb1, 0x46, 0x7c, 0x47, 0xfb, 0x1e, 0x85, 0x4d,
+       0x71, 0xdc, 0x68, 0x0d, 0x12, 0xbf, 0x43, 0x11, 0x65, 0x7a, 0xd4, 0xea,
+       0xaf, 0x0b, 0x7c, 0xbf, 0xa0, 0xd7, 0x58, 0xdc, 0x8f, 0xfa, 0x72, 0xfa,
+       0xaa, 0x7f, 0x7c, 0x8c, 0x9e, 0x2d, 0xa2, 0xdf, 0x97, 0x29, 0x13, 0x82,
+       0x3e, 0x8a, 0x44, 0xd7, 0x49, 0xd2, 0xae, 0x95, 0x71, 0xe7, 0x63, 0xde,
+       0x3a, 0xce, 0x8a, 0x0b, 0x9c, 0xdc, 0xc2, 0xfa, 0x05, 0xb4, 0xf9, 0x3e,
+       0xf3, 0x5a, 0x14, 0x75, 0x69, 0x4a, 0xbf, 0xbd, 0xce, 0x3a, 0x07, 0x73,
+       0x86, 0xe3, 0x8d, 0x75, 0xda, 0x9a, 0xd2, 0x69, 0xb6, 0x4b, 0xa7, 0xa5,
+       0xcb, 0x3a, 0x8d, 0x79, 0x43, 0xe8, 0xb2, 0xa0, 0xa8, 0x8d, 0x4e, 0xab,
+       0xef, 0xc0, 0x87, 0xbb, 0x85, 0xee, 0x62, 0xdd, 0x3f, 0x84, 0x3d, 0xc8,
+       0x1c, 0xdf, 0x31, 0xa1, 0x43, 0x34, 0x7f, 0x3f, 0xbc, 0x4f, 0xca, 0x45,
+       0xab, 0xd0, 0x07, 0xe9, 0x29, 0xe8, 0x2d, 0xaf, 0xf6, 0x0f, 0x72, 0x3b,
+       0xb4, 0xb7, 0xc3, 0x2f, 0xb2, 0x3e, 0x5b, 0x8c, 0xc2, 0xa7, 0x6d, 0x53,
+       0xbe, 0x0f, 0xf6, 0x14, 0xc3, 0x5a, 0x17, 0xc6, 0xaa, 0xf5, 0x59, 0xb7,
+       0x8a, 0x6b, 0x20, 0x0e, 0x89, 0x39, 0x6f, 0x88, 0x11, 0x2c, 0x60, 0x04,
+       0xbe, 0x27, 0xc0, 0xf4, 0x82, 0x7e, 0x61, 0x3b, 0xf0, 0x2e, 0xad, 0x09,
+       0xd9, 0x78, 0x57, 0x60, 0x97, 0x0c, 0x5f, 0x9b, 0x19, 0x7d, 0x54, 0xf4,
+       0x33, 0xb3, 0x5c, 0xd1, 0x8f, 0x73, 0xd9, 0xf7, 0x60, 0x37, 0x44, 0x5f,
+       0x97, 0x86, 0xa4, 0x0e, 0x5c, 0x2c, 0x98, 0xd8, 0xe3, 0x0c, 0x7d, 0xe6,
+       0xbe, 0xea, 0x71, 0xa2, 0x1f, 0x5a, 0x1f, 0x6c, 0x45, 0xf6, 0x18, 0xd7,
+       0x76, 0x61, 0x8e, 0x1c, 0x17, 0x0f, 0x7d, 0x8f, 0xdf, 0x8f, 0x73, 0x9b,
+       0x8f, 0xe7, 0x76, 0x79, 0x3c, 0x88, 0xed, 0xe1, 0x9e, 0x77, 0xe9, 0x96,
+       0x1a, 0xcf, 0xad, 0xf2, 0x78, 0xbe, 0xab, 0xc6, 0x43, 0x69, 0x63, 0xbc,
+       0x5b, 0xe1, 0xfe, 0x2d, 0x3f, 0xbb, 0x35, 0xce, 0x38, 0x26, 0xbd, 0x0c,
+       0x3a, 0xdf, 0xa5, 0xf8, 0xc9, 0x1d, 0x47, 0x75, 0xf7, 0x35, 0x32, 0xbc,
+       0xce, 0xfa, 0xf7, 0xb6, 0xc0, 0x31, 0x7d, 0x8c, 0x63, 0x70, 0x9e, 0x32,
+       0xd0, 0xd3, 0xe9, 0x10, 0xf6, 0xe1, 0x1d, 0xe3, 0x71, 0xb3, 0x3f, 0x36,
+       0xca, 0x9f, 0x22, 0xbe, 0x26, 0xe2, 0xbe, 0xea, 0xfe, 0xaf, 0xd3, 0xed,
+       0x79, 0xe8, 0x72, 0xe0, 0x58, 0xb9, 0x57, 0xef, 0xed, 0x15, 0x19, 0xdf,
+       0x4d, 0x78, 0xc6, 0x77, 0x11, 0xdb, 0x1d, 0x05, 0xce, 0x37, 0x11, 0x07,
+       0x9e, 0x50, 0xbf, 0x5f, 0x92, 0x2e, 0xe2, 0x59, 0x5e, 0x7a, 0x69, 0xcc,
+       0x95, 0x1f, 0x87, 0xbc, 0x14, 0x87, 0xf5, 0x8c, 0x6d, 0x36, 0x19, 0x47,
+       0x65, 0x9c, 0xb9, 0xa8, 0xb1, 0xd3, 0x09, 0x9e, 0x33, 0x3b, 0x6a, 0x18,
+       0x09, 0x11, 0x6b, 0x68, 0xb5, 0xdb, 0xa8, 0x85, 0xed, 0xe8, 0x59, 0xc2,
+       0x3e, 0x70, 0x11, 0x0b, 0x6b, 0x00, 0x17, 0x98, 0x27, 0x33, 0xd1, 0x48,
+       0xf8, 0x51, 0xe1, 0x97, 0xc2, 0xbe, 0x18, 0xa0, 0x13, 0xd3, 0x1a, 0x7d,
+       0xe0, 0xef, 0xcb, 0xd8, 0x0b, 0x34, 0xca, 0xe3, 0x47, 0xfc, 0x78, 0xc0,
+       0x7a, 0x93, 0xed, 0xd2, 0x05, 0x11, 0x97, 0x79, 0x9a, 0xd2, 0x2c, 0xa7,
+       0xc7, 0x85, 0x9c, 0x1a, 0x7d, 0x2c, 0x45, 0x2c, 0x57, 0xc8, 0x43, 0x18,
+       0x44, 0x0c, 0x50, 0xf9, 0x3a, 0x3c, 0xca, 0x15, 0xb5, 0x57, 0x42, 0x12,
+       0xba, 0x63, 0xeb, 0x31, 0x89, 0xe4, 0xa7, 0x8e, 0xc5, 0xb8, 0x31, 0x59,
+       0xa3, 0xda, 0x51, 0xf8, 0x69, 0x2a, 0x9e, 0x88, 0xfc, 0xf8, 0xf2, 0x6f,
+       0xe9, 0xb8, 0xe3, 0x06, 0xe7, 0x44, 0x6e, 0xe8, 0xcb, 0x45, 0x69, 0x83,
+       0xd3, 0xec, 0xd3, 0x67, 0x8e, 0xb8, 0x31, 0x49, 0x24, 0x37, 0x21, 0x62,
+       0x39, 0xfb, 0x28, 0xbe, 0x30, 0x42, 0x0f, 0x64, 0xa1, 0xc3, 0x68, 0x3d,
+       0x6e, 0xe3, 0x57, 0x72, 0x20, 0xe3, 0x23, 0x94, 0x28, 0x82, 0x46, 0x3e,
+       0xc6, 0x4a, 0xcc, 0x7b, 0x39, 0xac, 0xef, 0xf3, 0xf7, 0x02, 0x7e, 0x1b,
+       0xe6, 0x0f, 0x54, 0xbc, 0xbc, 0x97, 0x26, 0x16, 0xc8, 0x49, 0x45, 0xef,
+       0x15, 0x7b, 0x79, 0xa7, 0xa2, 0x43, 0x2a, 0xb6, 0x13, 0xe6, 0xf3, 0x88,
+       0x97, 0x59, 0x74, 0x7f, 0x36, 0xe2, 0xa4, 0x48, 0xc6, 0x2c, 0x88, 0xfb,
+       0x60, 0xb0, 0xed, 0xdd, 0xcd, 0x3a, 0xe4, 0x94, 0x88, 0x5b, 0x30, 0x52,
+       0x99, 0x47, 0x7b, 0xc4, 0x1c, 0xba, 0x08, 0x7e, 0x5a, 0x2a, 0xf7, 0xaa,
+       0x6a, 0x5b, 0x22, 0x93, 0x79, 0xc1, 0xfc, 0x6d, 0xdb, 0x89, 0x1a, 0x95,
+       0xfb, 0x11, 0xf3, 0x38, 0x25, 0x70, 0x64, 0x1f, 0xfb, 0x3c, 0xa2, 0x5d,
+       0x69, 0x46, 0xc4, 0x2f, 0xf8, 0xb8, 0xf0, 0xc8, 0x7e, 0xa9, 0xdb, 0xe4,
+       0x79, 0x19, 0xd7, 0xe0, 0x67, 0x16, 0xb8, 0x1f, 0x55, 0xf9, 0xf4, 0xbd,
+       0x14, 0xdb, 0x46, 0x9c, 0x69, 0xea, 0x8e, 0xc6, 0x99, 0x98, 0xd6, 0xc5,
+       0xcd, 0x6a, 0x1a, 0xb4, 0xff, 0xf7, 0x91, 0xb6, 0xe1, 0x4c, 0x2b, 0x53,
+       0xfc, 0x16, 0x08, 0x30, 0x78, 0xa6, 0xf8, 0x3c, 0x7e, 0x03, 0xc7, 0x97,
+       0x14, 0xd8, 0x38, 0xcc, 0xd8, 0x06, 0x18, 0x67, 0x40, 0xac, 0x8b, 0xc5,
+       0x1e, 0x0a, 0xfb, 0x32, 0x2b, 0x3d, 0xe4, 0x47, 0x3c, 0xce, 0xd6, 0xb9,
+       0x1c, 0xad, 0x22, 0xef, 0x5d, 0xae, 0x47, 0xc2, 0x3e, 0x43, 0x27, 0xae,
+       0xb3, 0xdf, 0xf0, 0x90, 0xca, 0xb9, 0x41, 0xcd, 0xa6, 0xce, 0xb9, 0xd1,
+       0x3a, 0x45, 0xf3, 0x9e, 0x5e, 0xeb, 0x70, 0xff, 0xde, 0x18, 0x64, 0xd7,
+       0x8d, 0x29, 0x10, 0x9f, 0x12, 0x73, 0x74, 0x81, 0x48, 0xce, 0x71, 0x65,
+       0x1d, 0xa3, 0x85, 0xe7, 0x09, 0xfe, 0x20, 0xe2, 0x7e, 0x8f, 0xf0, 0x27,
+       0xd6, 0x23, 0x7e, 0xb4, 0x1f, 0x38, 0xaa, 0xd3, 0x66, 0x9e, 0x19, 0xc5,
+       0x71, 0x0f, 0xfb, 0x67, 0x1a, 0xf7, 0xca, 0x58, 0x14, 0xfb, 0x6c, 0x6a,
+       0xbe, 0x10, 0x87, 0xea, 0x97, 0x39, 0x4c, 0xd9, 0x08, 0x59, 0x5d, 0xa0,
+       0xd3, 0xaf, 0x4a, 0x1e, 0x37, 0x5b, 0xbb, 0xd8, 0x4a, 0x5e, 0x13, 0x7e,
+       0x0b, 0x0d, 0xfb, 0x8d, 0x1e, 0x04, 0xed, 0x79, 0x8e, 0xdc, 0x6b, 0x1b,
+       0xcf, 0xef, 0xd5, 0xbf, 0xc3, 0x74, 0x67, 0xe6, 0x6d, 0x87, 0xc7, 0xbc,
+       0x1d, 0xec, 0x95, 0x6b, 0x67, 0x7f, 0xa1, 0xda, 0x78, 0xe5, 0xb8, 0x3a,
+       0x4f, 0x22, 0x0e, 0x55, 0xa9, 0xbf, 0x78, 0x5b, 0xe8, 0x95, 0xfa, 0x58,
+       0x78, 0x98, 0xf5, 0xa9, 0x94, 0xe3, 0x53, 0x1e, 0x72, 0xdc, 0x35, 0x0e,
+       0xdc, 0xf2, 0xc9, 0xe5, 0x78, 0xb2, 0xa1, 0x1c, 0x4f, 0xf6, 0xca, 0x58,
+       0x6c, 0xbd, 0x1c, 0xbf, 0x81, 0xbe, 0x14, 0x37, 0xca, 0x81, 0x44, 0x4d,
+       0xbb, 0x3b, 0x56, 0x02, 0x9a, 0xe9, 0x78, 0x09, 0xd6, 0x0d, 0xc1, 0x97,
+       0x58, 0x7b, 0x99, 0x32, 0x12, 0xf3, 0xb5, 0x6b, 0xa9, 0x5b, 0xb9, 0x17,
+       0xeb, 0x34, 0xb5, 0xf7, 0x02, 0xbb, 0x43, 0x36, 0x22, 0x61, 0x19, 0x0b,
+       0xd0, 0xf4, 0xeb, 0xf5, 0x1d, 0xcb, 0x47, 0x9c, 0x02, 0x21, 0xd6, 0x1d,
+       0xa2, 0x73, 0x58, 0x9f, 0x56, 0xb1, 0xe4, 0x93, 0x59, 0x49, 0x07, 0xf3,
+       0x88, 0xe0, 0x0f, 0xe0, 0xdb, 0x70, 0xd2, 0x9f, 0xe4, 0x39, 0x96, 0x71,
+       0xe4, 0xd4, 0x72, 0x58, 0xcd, 0x1b, 0xb7, 0xc5, 0xf3, 0xaa, 0xf6, 0x92,
+       0xd7, 0x71, 0x07, 0xcc, 0x57, 0xe4, 0xeb, 0x95, 0xdc, 0x64, 0xd8, 0x86,
+       0x12, 0xfd, 0x37, 0xdb, 0x3d, 0xff, 0x11, 0x53, 0xec, 0xe3, 0xf0, 0x46,
+       0xf1, 0x08, 0xe3, 0x4d, 0xcc, 0x29, 0x62, 0x90, 0x3a, 0x46, 0xfc, 0xc4,
+       0x41, 0x6a, 0x3f, 0xcc, 0x28, 0xc0, 0x20, 0x9b, 0xf1, 0xa5, 0x71, 0x04,
+       0xb9, 0xe6, 0x16, 0xdf, 0x83, 0xfd, 0xa8, 0x06, 0xad, 0x04, 0xb5, 0x21,
+       0x0e, 0x81, 0xfd, 0xb0, 0xad, 0x74, 0x95, 0x8c, 0x9d, 0x16, 0x32, 0x96,
+       0x58, 0x39, 0xad, 0x64, 0xec, 0xb4, 0x8a, 0xc3, 0x9f, 0x56, 0x32, 0x76,
+       0x5a, 0xc9, 0xd8, 0x69, 0x25, 0x63, 0xa7, 0x99, 0xcf, 0x07, 0x18, 0xdf,
+       0x02, 0x8b, 0xe8, 0x38, 0x68, 0x3b, 0xa5, 0xf2, 0x38, 0x0f, 0xfb, 0x5c,
+       0x2b, 0x67, 0xef, 0xf6, 0x49, 0x39, 0x63, 0x6c, 0x22, 0xeb, 0xc9, 0xf8,
+       0x5d, 0x98, 0x83, 0x57, 0x98, 0xe6, 0x1f, 0xd3, 0x99, 0x79, 0xf4, 0xd5,
+       0x47, 0x13, 0x62, 0x1f, 0xdc, 0x26, 0x8a, 0xbb, 0xb1, 0xb0, 0xc9, 0x63,
+       0xcd, 0x4a, 0xdf, 0xcf, 0x31, 0x6c, 0xc1, 0x27, 0xde, 0x7a, 0x15, 0x7c,
+       0x32, 0xae, 0xe6, 0xab, 0xd6, 0x2f, 0x6a, 0xa1, 0x64, 0x0e, 0x74, 0x45,
+       0xfe, 0xa4, 0xc5, 0x73, 0x23, 0xe8, 0xe4, 0x98, 0x1e, 0x34, 0x38, 0xa9,
+       0x68, 0xf0, 0xb8, 0x18, 0x23, 0xf2, 0x0f, 0x11, 0xcb, 0x6c, 0x4c, 0x87,
+       0x74, 0x76, 0x80, 0x9f, 0xc3, 0xb2, 0x70, 0x24, 0xcc, 0x3a, 0x69, 0xeb,
+       0x74, 0xa8, 0x8c, 0xbd, 0x91, 0xee, 0xd9, 0x6a, 0x5d, 0xce, 0xba, 0xcb,
+       0x96, 0x84, 0x95, 0x1d, 0x91, 0xb8, 0x78, 0x87, 0x5d, 0xa2, 0x13, 0xd1,
+       0x83, 0xfc, 0x3d, 0x92, 0x74, 0xe8, 0x30, 0x19, 0x9d, 0x25, 0xfa, 0x11,
+       0xcb, 0x41, 0x2b, 0xcb, 0xc1, 0x09, 0xe5, 0x97, 0x9c, 0x28, 0xfb, 0x25,
+       0x93, 0x07, 0x90, 0x97, 0x91, 0x12, 0xeb, 0x5e, 0x3b, 0xcb, 0xbf, 0xc3,
+       0x02, 0x3d, 0xb6, 0x88, 0xfd, 0x28, 0x7a, 0x71, 0x6c, 0xd2, 0x55, 0xf6,
+       0xab, 0x63, 0xbe, 0x07, 0x0f, 0x08, 0xec, 0xee, 0x7b, 0x00, 0xf7, 0x9c,
+       0x90, 0x7a, 0xcf, 0x47, 0xfe, 0xc1, 0x77, 0x18, 0x4f, 0x94, 0xe8, 0x31,
+       0x7e, 0x67, 0x26, 0x77, 0x88, 0x9f, 0xad, 0xf7, 0x96, 0xb0, 0x63, 0x86,
+       0x6f, 0x27, 0xf9, 0x3b, 0x1b, 0xbd, 0x3b, 0x22, 0xf8, 0x91, 0xf1, 0xb4,
+       0x31, 0x13, 0x7d, 0xaf, 0x34, 0x3d, 0x85, 0x18, 0x3b, 0xe4, 0x24, 0x62,
+       0x5a, 0x3e, 0x2f, 0xf9, 0x90, 0x58, 0xa9, 0x92, 0x0b, 0x2b, 0xf3, 0xc2,
+       0xff, 0x8b, 0xc7, 0x66, 0x12, 0xd6, 0x4e, 0xe4, 0xf3, 0x93, 0x04, 0x9f,
+       0x00, 0xfb, 0x53, 0x58, 0x4c, 0x67, 0xfd, 0x2e, 0x5b, 0xf1, 0xc6, 0x67,
+       0x90, 0xe7, 0x96, 0x5b, 0xa4, 0x8d, 0x6d, 0x0e, 0xe2, 0x75, 0x03, 0x0b,
+       0x6b, 0x9d, 0x21, 0x51, 0x1b, 0xde, 0xc1, 0x18, 0x49, 0xe7, 0x3e, 0x0f,
+       0xf2, 0xf3, 0x11, 0xc7, 0x0b, 0xd0, 0xc4, 0x25, 0xb4, 0x6b, 0xa6, 0xfe,
+       0x85, 0xd2, 0xef, 0xf1, 0x75, 0xb1, 0x7e, 0x99, 0xa2, 0x56, 0xb5, 0x36,
+       0xa1, 0xf7, 0xad, 0x08, 0xb3, 0xec, 0x55, 0x6a, 0x9f, 0xfb, 0xcb, 0x31,
+       0x3d, 0x21, 0x13, 0x35, 0x31, 0xbd, 0xaf, 0x6e, 0x62, 0xaf, 0x36, 0x93,
+       0x03, 0xe4, 0xd4, 0xb5, 0x90, 0x8a, 0x55, 0x5a, 0x19, 0xda, 0x6a, 0x4d,
+       0xdf, 0x76, 0xef, 0xf1, 0xb5, 0x36, 0x8f, 0x93, 0xf3, 0xa6, 0x1d, 0x54,
+       0xfc, 0xd7, 0x4c, 0x67, 0xf2, 0x41, 0xb6, 0xf9, 0xd0, 0xad, 0xa0, 0x97,
+       0xbf, 0x17, 0xb5, 0x2e, 0x5f, 0x0a, 0x34, 0xd3, 0xf2, 0x32, 0x72, 0x2d,
+       0xfe, 0xf1, 0x80, 0xcc, 0x25, 0x4e, 0x32, 0x5d, 0x0e, 0xb3, 0x7d, 0x34,
+       0xd4, 0xda, 0x11, 0xce, 0x41, 0x97, 0x88, 0xdf, 0x21, 0x0a, 0xdc, 0x3b,
+       0x14, 0x64, 0xbf, 0x40, 0xae, 0x3d, 0x1c, 0xe5, 0x67, 0x7f, 0x33, 0x9f,
+       0x44, 0xbc, 0xcc, 0x3c, 0xce, 0xcf, 0x9f, 0x60, 0x3c, 0x11, 0xa3, 0x66,
+       0x5a, 0x5a, 0x6e, 0x66, 0xbf, 0xa0, 0x99, 0xf1, 0xc4, 0x80, 0xd9, 0xef,
+       0x13, 0xef, 0x12, 0x75, 0x35, 0x9f, 0x0f, 0x1c, 0x66, 0xbe, 0xc2, 0xbb,
+       0xfe, 0x5d, 0xbd, 0xab, 0xf6, 0x1d, 0xff, 0x51, 0xc2, 0xf1, 0x71, 0x3f,
+       0x39, 0x37, 0xf0, 0x1b, 0x5c, 0xf3, 0x63, 0x8c, 0x9d, 0x43, 0x94, 0x99,
+       0x6f, 0xe2, 0x31, 0x8c, 0xb3, 0x1f, 0x11, 0xe5, 0xe3, 0xfb, 0xc8, 0x29,
+       0x4e, 0xd1, 0x5f, 0x15, 0xdd, 0x31, 0xe1, 0xfb, 0xb8, 0xcf, 0xb2, 0xb6,
+       0xbf, 0x85, 0xfb, 0xf5, 0x91, 0x5d, 0xab, 0x63, 0x82, 0xe4, 0xff, 0xeb,
+       0x10, 0x35, 0x7f, 0x0d, 0xb1, 0x97, 0x12, 0xe5, 0xa2, 0xa8, 0x57, 0x90,
+       0xf1, 0xe7, 0xab, 0x22, 0x87, 0x96, 0xef, 0xe7, 0x67, 0xce, 0xa1, 0xdd,
+       0x55, 0x8b, 0xae, 0xdb, 0x92, 0xde, 0x3f, 0x08, 0x84, 0xc8, 0xff, 0x12,
+       0x72, 0x9f, 0xc4, 0xfe, 0x1a, 0x8e, 0x7d, 0x88, 0xf5, 0xfb, 0xd7, 0x70,
+       0x1f, 0x7f, 0xbe, 0x84, 0xe3, 0x20, 0x8f, 0x13, 0xf6, 0x1a, 0xf9, 0x2e,
+       0xd0, 0x8b, 0x87, 0xc3, 0xa6, 0xe0, 0xbf, 0xfb, 0x98, 0xa7, 0x9a, 0x44,
+       0xac, 0xb1, 0x0b, 0x6d, 0xed, 0xfd, 0xc0, 0x16, 0xce, 0xd0, 0x21, 0x1c,
+       0xc7, 0x3a, 0xfd, 0x4c, 0x23, 0xc9, 0x43, 0x18, 0x4f, 0x15, 0x73, 0x07,
+       0x8e, 0x0e, 0x11, 0xcf, 0x27, 0xf0, 0xc7, 0x2f, 0xf1, 0x1b, 0x91, 0x4e,
+       0x3f, 0xbf, 0x23, 0xc1, 0xef, 0x98, 0xc8, 0xcb, 0x71, 0xcf, 0x15, 0xfd,
+       0x24, 0xe3, 0x54, 0x5f, 0xe9, 0xd3, 0xbf, 0xd1, 0x48, 0x3d, 0x78, 0x76,
+       0x59, 0x56, 0xf8, 0x7b, 0x3b, 0xdd, 0xca, 0xb7, 0xd1, 0x6d, 0xb5, 0xa6,
+       0x75, 0x4b, 0xf8, 0x65, 0xac, 0xc3, 0x93, 0xed, 0xb4, 0xbe, 0xdc, 0x44,
+       0xd4, 0x15, 0x14, 0x6b, 0xce, 0xb7, 0xf2, 0x05, 0x7e, 0xff, 0x97, 0xfb,
+       0x64, 0x5c, 0xa7, 0xc2, 0x23, 0xb7, 0x3c, 0x78, 0xe4, 0x03, 0xc1, 0x23,
+       0x5f, 0xec, 0xdb, 0x98, 0x47, 0x50, 0xf3, 0x0f, 0xde, 0x08, 0x52, 0xb3,
+       0xe2, 0x8f, 0x17, 0x99, 0x3f, 0x9e, 0x65, 0xfe, 0x38, 0xd6, 0x80, 0x3f,
+       0x8c, 0x1a, 0xfe, 0x38, 0x2e, 0xf8, 0xe3, 0x89, 0xbe, 0x8d, 0xf8, 0xe3,
+       0x98, 0x7f, 0xa3, 0x58, 0x93, 0xaf, 0x35, 0xc0, 0xef, 0x9e, 0xb3, 0xf7,
+       0x31, 0xaf, 0xdb, 0xb4, 0x34, 0x8f, 0xfa, 0x84, 0xd5, 0xa8, 0x41, 0x3f,
+       0x13, 0x3e, 0xd9, 0x9a, 0xf0, 0xf9, 0xc7, 0x45, 0xcd, 0xc1, 0xa2, 0xe0,
+       0x2f, 0xb6, 0xff, 0xe3, 0xa8, 0xab, 0xaa, 0x9d, 0x8b, 0x56, 0xba, 0x1e,
+       0xc5, 0x5c, 0x58, 0x7a, 0x2e, 0x08, 0xeb, 0xbb, 0x6a, 0xef, 0xc8, 0x40,
+       0x3c, 0x4b, 0xce, 0x07, 0xe0, 0xd1, 0x95, 0xb6, 0xc0, 0x44, 0xf6, 0x1b,
+       0x7d, 0xc0, 0x7f, 0x99, 0x15, 0x72, 0x9d, 0x0f, 0xf0, 0xf9, 0x90, 0xf8,
+       0x6d, 0x2b, 0xc8, 0xca, 0x87, 0xc8, 0x71, 0x64, 0x9e, 0xbc, 0x9e, 0xef,
+       0xa5, 0x1b, 0xf9, 0x7d, 0xb4, 0x96, 0xef, 0xa3, 0x37, 0xc5, 0xbe, 0x1a,
+       0xb2, 0x36, 0x72, 0x4d, 0xcc, 0x91, 0x41, 0x47, 0x43, 0xdc, 0x66, 0x79,
+       0x1f, 0xad, 0x2e, 0x6b, 0xfe, 0x06, 0x6f, 0x83, 0x5f, 0x62, 0x9d, 0xb2,
+       0x66, 0xae, 0x9e, 0x67, 0x26, 0xaa, 0x79, 0x46, 0xdc, 0x03, 0x5e, 0xc9,
+       0xd4, 0xd5, 0xfa, 0x22, 0x5f, 0x11, 0xb9, 0x7a, 0x41, 0x6a, 0x42, 0xde,
+       0xa2, 0x11, 0x19, 0x3e, 0xea, 0x07, 0x86, 0xce, 0xb1, 0xcd, 0xe5, 0x39,
+       0xb3, 0x91, 0xe7, 0xd4, 0xc7, 0x78, 0xb8, 0x43, 0xe0, 0xdf, 0xb8, 0x1d,
+       0x08, 0x4f, 0x50, 0xe9, 0x69, 0xc3, 0xc6, 0x5e, 0x8f, 0x49, 0x7e, 0x9e,
+       0xa1, 0xe2, 0x4d, 0xbb, 0x5c, 0xfc, 0x57, 0x8b, 0x75, 0xb1, 0x96, 0xfc,
+       0x10, 0xf7, 0x19, 0x76, 0xb8, 0xb2, 0x5e, 0x43, 0xe5, 0xf5, 0x9a, 0x56,
+       0x1e, 0xb7, 0x94, 0xbd, 0x19, 0x9b, 0xdb, 0x15, 0xff, 0x6f, 0x40, 0x75,
+       0xeb, 0x41, 0x73, 0x7f, 0x40, 0xf1, 0x25, 0xa0, 0x79, 0x67, 0x19, 0x86,
+       0x43, 0x3d, 0xa0, 0x3c, 0x0a, 0x1a, 0x0f, 0x41, 0xcc, 0xf5, 0x1e, 0x5a,
+       0x03, 0x12, 0x07, 0x8d, 0x89, 0x20, 0xe6, 0x7a, 0x0f, 0x41, 0xe7, 0x7a,
+       0x0f, 0xad, 0xb1, 0x01, 0x97, 0xdb, 0xcd, 0x53, 0x80, 0xe1, 0x3e, 0x85,
+       0x19, 0xba, 0xce, 0x51, 0x0d, 0x7a, 0x77, 0x52, 0x0c, 0x78, 0x4c, 0x5b,
+       0x50, 0x05, 0x7f, 0x18, 0xba, 0x62, 0x84, 0xa1, 0x0d, 0xb8, 0x9d, 0xe5,
+       0x02, 0x34, 0xd3, 0x79, 0x4a, 0x0c, 0x30, 0x3c, 0x23, 0x80, 0x79, 0x4f,
+       0x18, 0x9a, 0xf7, 0x60, 0x73, 0xc7, 0xfc, 0x0c, 0x90, 0x7b, 0x98, 0x6c,
+       0xc0, 0x7d, 0x0b, 0x48, 0x79, 0x25, 0x83, 0x56, 0x5e, 0x01, 0xd3, 0x84,
+       0x3a, 0x44, 0x7f, 0xd3, 0x7a, 0x0d, 0x79, 0xd8, 0x38, 0x60, 0x13, 0xd0,
+       0xdc, 0xe6, 0x29, 0xa4, 0xcc, 0x3d, 0x03, 0xeb, 0x5b, 0xac, 0x6b, 0x1b,
+       0x6d, 0xc0, 0x7b, 0xac, 0x17, 0x4d, 0x61, 0x61, 0x58, 0xd2, 0xc3, 0x00,
+       0xac, 0x1f, 0x40, 0x69, 0x1d, 0x54, 0x47, 0xc0, 0xd3, 0xbb, 0x40, 0x13,
+       0xd0, 0x7d, 0x4e, 0xc0, 0xb6, 0xa8, 0x73, 0xbf, 0x32, 0x78, 0xad, 0x6c,
+       0x03, 0xf4, 0xfc, 0xaa, 0x45, 0x3d, 0xde, 0xf2, 0xa0, 0x7c, 0xe6, 0xa4,
+       0xc2, 0x40, 0x46, 0x5e, 0x60, 0x83, 0xe6, 0x05, 0x70, 0x38, 0x01, 0xd3,
+       0x3a, 0xb0, 0x8c, 0x5a, 0x93, 0x04, 0x34, 0x8f, 0x87, 0xc5, 0xa5, 0x1f,
+       0x24, 0xc6, 0x00, 0x15, 0x63, 0x01, 0xf2, 0x65, 0x80, 0x6d, 0x4a, 0x90,
+       0x5f, 0x41, 0x79, 0x01, 0x64, 0x36, 0xc8, 0xef, 0xa0, 0xb2, 0x13, 0x94,
+       0x17, 0x81, 0xec, 0x25, 0x42, 0x50, 0x3f, 0x03, 0x69, 0x20, 0xbb, 0x79,
+       0x8a, 0x08, 0x98, 0x9f, 0x14, 0x20, 0xc4, 0xd0, 0x00, 0xcf, 0x07, 0xc4,
+       0x86, 0x31, 0x4c, 0x7d, 0x0c, 0x19, 0xf9, 0x06, 0x62, 0x06, 0x22, 0xdf,
+       0xb0, 0x33, 0x1c, 0x10, 0x80, 0x85, 0xd5, 0xff, 0xff, 0xc7, 0x54, 0x58,
+       0x80, 0xe9, 0x14, 0xb4, 0x8e, 0xf5, 0xf7, 0xff, 0x03, 0x22, 0x2c, 0x0c,
+       0x2d, 0xf0, 0xf5, 0x88, 0x0b, 0xe5, 0x41, 0x65, 0xe8, 0x02, 0x20, 0xab,
+       0x0d, 0xde, 0x26, 0x60, 0x01, 0xdf, 0x61, 0xbd, 0x80, 0xe1, 0x17, 0xb0,
+       0xcc, 0xfa, 0xff, 0x7f, 0x29, 0x5c, 0x2d, 0x08, 0x00, 0x00, 0xff, 0x88,
+       0x78, 0xb5, 0x98, 0x7e, 0x00, 0x00, 0x00 };
 
 static const u32 bnx2_COM_b09FwData[(0x0/4) + 1] = { 0x0 };
 static const u32 bnx2_COM_b09FwRodata[(0x88/4) + 1] = {
-       0x08001b68, 0x08001ba4, 0x08001ba4, 0x08001ba4, 0x08001ba4, 0x08001ba4,
-       0x08001ab4, 0x08001ba4, 0x08001b28, 0x08001ba4, 0x08001a3c, 0x08001ba4,
-       0x08001ba4, 0x08001ba4, 0x08001a48, 0x00000000, 0x08002abc, 0x08002b0c,
-       0x08002b3c, 0x08002b6c, 0x08002b9c, 0x00000000, 0x0800604c, 0x0800604c,
-       0x0800604c, 0x0800604c, 0x0800604c, 0x08006078, 0x08006078, 0x080060b8,
-       0x080060c4, 0x080060c4, 0x0800604c, 0x00000000, 0x00000000 };
+       0x08001b7c, 0x08001bb8, 0x08001bb8, 0x08001bb8, 0x08001bb8, 0x08001bb8,
+       0x08001ac8, 0x08001bb8, 0x08001b3c, 0x08001bb8, 0x08001a50, 0x08001bb8,
+       0x08001bb8, 0x08001bb8, 0x08001a5c, 0x00000000, 0x08002b74, 0x08002bc4,
+       0x08002bf4, 0x08002c24, 0x08002c58, 0x00000000, 0x08006120, 0x08006120,
+       0x08006120, 0x08006120, 0x08006120, 0x0800614c, 0x0800614c, 0x0800618c,
+       0x08006198, 0x08006198, 0x08006120, 0x00000000, 0x00000000 };
 
 static struct fw_info bnx2_com_fw_09 = {
+       /* Firmware version:  3.7.1 */
        .ver_major                      = 0x3,
-       .ver_minor                      = 0x4,
-       .ver_fix                        = 0x3,
+       .ver_minor                      = 0x7,
+       .ver_fix                        = 0x1,
 
        .start_addr                     = 0x080000b4,
 
        .text_addr                      = 0x08000000,
-       .text_len                       = 0x7dc0,
+       .text_len                       = 0x7e94,
        .text_index                     = 0x0,
        .gz_text                        = bnx2_COM_b09FwText,
        .gz_text_len                    = sizeof(bnx2_COM_b09FwText),
 
-       .data_addr                      = 0x08007e60,
+       .data_addr                      = 0x08007f40,
        .data_len                       = 0x0,
        .data_index                     = 0x0,
        .data                           = bnx2_COM_b09FwData,
 
-       .sbss_addr                      = 0x08007e60,
+       .sbss_addr                      = 0x08007f40,
        .sbss_len                       = 0x60,
        .sbss_index                     = 0x0,
 
-       .bss_addr                       = 0x08007ec0,
+       .bss_addr                       = 0x08007fa0,
        .bss_len                        = 0x88,
        .bss_index                      = 0x0,
 
-       .rodata_addr                    = 0x08007dc0,
+       .rodata_addr                    = 0x08007e98,
        .rodata_len                     = 0x88,
        .rodata_index                   = 0x0,
        .rodata                         = bnx2_COM_b09FwRodata,
 };
 
 static u8 bnx2_CP_b09FwText[] = {
-/*     0x1f, 0x8b, 0x08, 0x00, 0x0f, 0x34, 0xe7, 0x45, 0x00, 0x03, */
-                                                                   0xbd, 0x7d,
-       0x0d, 0x74, 0x5c, 0x57, 0x7d, 0xe7, 0xff, 0xdd, 0x19, 0x49, 0x63, 0x59,
-       0x96, 0x9f, 0xe5, 0x89, 0x32, 0x51, 0x84, 0x3d, 0x23, 0x3d, 0xd9, 0x22,
-       0x12, 0xe1, 0xc5, 0x11, 0xac, 0xda, 0x2a, 0xe9, 0x30, 0x92, 0x3f, 0x12,
-       0x02, 0xab, 0x10, 0x43, 0xb3, 0x1c, 0x4a, 0xc5, 0x48, 0x4e, 0x02, 0x04,
-       0xea, 0x40, 0xe8, 0x86, 0xdd, 0xec, 0x66, 0x32, 0x92, 0x3f, 0x9a, 0x8e,
-       0x3d, 0x93, 0x44, 0x89, 0xbd, 0xdd, 0x9c, 0xad, 0x90, 0x14, 0x3b, 0x74,
-       0x07, 0x4f, 0xe2, 0x98, 0x96, 0x73, 0x0a, 0x8d, 0x50, 0x8c, 0x9b, 0xe6,
-       0xb0, 0xdd, 0xd0, 0xa6, 0x34, 0xdb, 0x86, 0x22, 0x8c, 0x81, 0xf4, 0x2c,
-       0xdd, 0x86, 0x42, 0x77, 0xd3, 0x36, 0xe5, 0xed, 0xef, 0x77, 0xef, 0x7d,
-       0x9a, 0x91, 0x34, 0xce, 0x07, 0xdd, 0xad, 0xcf, 0x79, 0x7e, 0xf3, 0xee,
-       0xbb, 0x1f, 0xff, 0xfb, 0xbf, 0xff, 0xef, 0xfb, 0xbf, 0x4f, 0x97, 0x8b,
-       0x34, 0x8b, 0xfd, 0xb7, 0x01, 0xd7, 0xd5, 0xc9, 0xfd, 0xe3, 0x57, 0x5f,
-       0x39, 0x70, 0x25, 0x9f, 0xa3, 0x91, 0x68, 0x44, 0xde, 0xc4, 0xbf, 0xe4,
-       0x1b, 0xa8, 0x83, 0x0e, 0xdd, 0x70, 0x2c, 0x5e, 0x12, 0x53, 0x43, 0xde,
-       0xfe, 0x8c, 0x27, 0xb1, 0xc8, 0x50, 0xee, 0xce, 0x71, 0x4f, 0x24, 0x5d,
-       0xee, 0x4b, 0x0e, 0xcb, 0x3f, 0x05, 0xb9, 0x78, 0x54, 0x58, 0xfe, 0x96,
-       0xa1, 0x57, 0x7f, 0xeb, 0x2b, 0xff, 0x2a, 0xf5, 0xf2, 0x4c, 0x44, 0x62,
-       0xee, 0xd0, 0xed, 0xe2, 0x6e, 0x93, 0x58, 0xe7, 0x50, 0x72, 0xff, 0x23,
-       0xdb, 0x97, 0x44, 0x5a, 0xc3, 0xbe, 0x5e, 0x0a, 0xbe, 0xb2, 0x5d, 0x72,
-       0x1d, 0x43, 0x89, 0xb1, 0x86, 0x21, 0x57, 0x9e, 0xaa, 0xc8, 0xe8, 0x89,
-       0xc2, 0xcb, 0x41, 0x74, 0x28, 0x88, 0x4c, 0x0d, 0x38, 0x12, 0x19, 0x92,
-       0xb3, 0xe3, 0x03, 0xf7, 0x04, 0xca, 0xf3, 0xfc, 0x45, 0x69, 0x19, 0x3c,
-       0x37, 0x80, 0xf7, 0x65, 0x41, 0xdd, 0xbd, 0xd7, 0x9c, 0x28, 0xc4, 0x44,
-       0x0d, 0xf5, 0xbc, 0x90, 0x89, 0x5c, 0x25, 0x7c, 0x7f, 0x56, 0x7a, 0xfc,
-       0xa7, 0x05, 0xe5, 0xe5, 0x98, 0x64, 0x2a, 0xd2, 0x82, 0x32, 0xdc, 0x9b,
-       0x51, 0x27, 0xe5, 0x66, 0x22, 0xae, 0xe4, 0x2b, 0x3f, 0x5e, 0x67, 0xc6,
-       0x9d, 0xb3, 0xf7, 0xbf, 0x8e, 0x99, 0x3b, 0xc6, 0x2d, 0xc6, 0x64, 0x29,
-       0x92, 0x10, 0xc0, 0x82, 0x79, 0x25, 0x64, 0xb2, 0x98, 0x94, 0x4c, 0x81,
-       0xb0, 0x45, 0x25, 0xeb, 0x12, 0xae, 0x04, 0xda, 0xb7, 0x39, 0xf5, 0xeb,
-       0xb3, 0xee, 0x0b, 0xa8, 0x9b, 0x44, 0xbd, 0x4e, 0x79, 0x12, 0x75, 0x4f,
-       0x57, 0xe2, 0xf2, 0x44, 0xe5, 0x57, 0x25, 0x8d, 0xb6, 0x8f, 0x57, 0x30,
-       0x76, 0xb1, 0x51, 0x86, 0xa7, 0x9b, 0x25, 0x33, 0xdd, 0x9d, 0xc8, 0x4a,
-       0x10, 0x7c, 0xda, 0xff, 0xa8, 0x8c, 0xb5, 0xa1, 0x7e, 0x91, 0xef, 0x12,
-       0x2b, 0xde, 0x65, 0xfd, 0x3e, 0x37, 0xab, 0x1c, 0x49, 0xef, 0x4d, 0x25,
-       0xc6, 0x14, 0x9f, 0x1b, 0x24, 0xd3, 0x8f, 0xe7, 0xd1, 0xa8, 0x44, 0xbc,
-       0x20, 0xb8, 0xc3, 0xbf, 0x0c, 0x70, 0xa4, 0x92, 0x49, 0xc5, 0xb6, 0x6c,
-       0x97, 0xca, 0x25, 0x55, 0x5c, 0x72, 0x95, 0x2b, 0x25, 0xd9, 0x16, 0x04,
-       0xef, 0xf3, 0x3b, 0x51, 0x2e, 0x32, 0x5c, 0x90, 0xfd, 0x58, 0x23, 0xf4,
-       0x29, 0xbe, 0x1a, 0xda, 0x8c, 0x79, 0xf4, 0xb9, 0xc3, 0xd2, 0x28, 0xe9,
-       0xb8, 0xa4, 0xd5, 0x90, 0x24, 0xd5, 0xd0, 0x3a, 0x94, 0x39, 0xd2, 0xe0,
-       0x7d, 0xc1, 0xd2, 0xd2, 0x46, 0x3c, 0xcb, 0xa8, 0x1a, 0x6a, 0x5b, 0x55,
-       0x9e, 0x4a, 0x8a, 0x5a, 0x07, 0x5c, 0xa5, 0x7a, 0xd3, 0x8a, 0x65, 0xb8,
-       0xeb, 0xb2, 0x0f, 0x36, 0xad, 0x2d, 0xdb, 0xef, 0xac, 0x2c, 0xbb, 0xbd,
-       0x85, 0xb0, 0x8a, 0xe2, 0xef, 0xb8, 0x9e, 0x6b, 0x3a, 0xde, 0xed, 0x36,
-       0x60, 0x5e, 0xa3, 0x7e, 0xca, 0xdd, 0xa9, 0x9e, 0x0f, 0xa4, 0x9d, 0x30,
-       0xf3, 0x9d, 0xc2, 0x3b, 0x54, 0x1d, 0xf2, 0xb1, 0x6e, 0xae, 0x1c, 0xc2,
-       0xdc, 0xce, 0x4f, 0xa7, 0xdc, 0x2e, 0x85, 0xfb, 0x3c, 0x7f, 0x07, 0x41,
-       0xc6, 0xcf, 0xe9, 0x35, 0xfd, 0xee, 0x74, 0x02, 0xcf, 0x80, 0x3f, 0x9e,
-       0x4e, 0x6d, 0x92, 0xab, 0xed, 0xba, 0x7c, 0x13, 0x63, 0x76, 0xbb, 0x77,
-       0xa8, 0x6e, 0xd7, 0x57, 0x29, 0x77, 0x56, 0xce, 0xe0, 0x39, 0x08, 0x6e,
-       0xf4, 0x53, 0x89, 0x1c, 0xd6, 0xec, 0x42, 0x21, 0x2e, 0xdf, 0x2b, 0xa4,
-       0x40, 0xc5, 0xa9, 0xde, 0x39, 0xe9, 0xf3, 0xe7, 0x00, 0x6f, 0x1e, 0xd7,
-       0x41, 0xbe, 0x2b, 0xe3, 0x5d, 0x99, 0x6d, 0x83, 0xe0, 0x26, 0xff, 0x37,
-       0x83, 0xb1, 0x76, 0xc3, 0x17, 0x4f, 0x15, 0xb1, 0x9e, 0x80, 0xf9, 0x74,
-       0x11, 0xeb, 0x89, 0xb5, 0x7a, 0x5c, 0xaf, 0x7b, 0x2f, 0xd6, 0x9d, 0xb4,
-       0x41, 0xba, 0xd8, 0x61, 0x69, 0xf9, 0x03, 0xf6, 0x2e, 0x92, 0x29, 0x3a,
-       0x92, 0xf1, 0xff, 0x31, 0x48, 0x6b, 0x7e, 0x11, 0x67, 0xb8, 0x48, 0x5a,
-       0x6c, 0x00, 0xac, 0x7c, 0xcc, 0xda, 0x7a, 0x1b, 0x1d, 0xe0, 0x96, 0xeb,
-       0xc0, 0xf7, 0x31, 0xe5, 0x35, 0xd9, 0xf7, 0x21, 0x5f, 0xf0, 0xdf, 0x26,
-       0x47, 0xbc, 0x6a, 0xbd, 0x0c, 0x69, 0xb2, 0x92, 0x93, 0xec, 0x83, 0x81,
-       0x0c, 0xfb, 0xc0, 0x13, 0xfb, 0x74, 0x7d, 0xd1, 0x6d, 0x5d, 0xd6, 0xd1,
-       0x75, 0xf1, 0x6f, 0x7d, 0x23, 0xc6, 0x70, 0x46, 0x8a, 0xd5, 0xb6, 0x23,
-       0xc5, 0xfc, 0x66, 0x0b, 0x1f, 0x9e, 0x07, 0x9d, 0x4c, 0xe5, 0x82, 0x5d,
-       0xdb, 0x70, 0x1e, 0x57, 0xd7, 0xa1, 0x6d, 0x17, 0x7c, 0xe0, 0x4a, 0xb6,
-       0x30, 0x88, 0x71, 0xe3, 0xb8, 0x07, 0xc1, 0x94, 0x9f, 0x4e, 0x45, 0x65,
-       0x08, 0xcf, 0xa3, 0xe4, 0x3d, 0xe0, 0x4f, 0xa2, 0x99, 0xed, 0xbe, 0x8c,
-       0x80, 0xee, 0xf3, 0x95, 0xd7, 0x97, 0x22, 0x7a, 0x0e, 0xfe, 0x3f, 0x59,
-       0xdc, 0x70, 0x1c, 0x33, 0xe6, 0x54, 0xb1, 0x43, 0xf2, 0xd3, 0x9e, 0x4c,
-       0x16, 0x16, 0x7a, 0x95, 0xbc, 0x4c, 0x7e, 0xc7, 0xfa, 0xa5, 0x40, 0xbb,
-       0x43, 0x32, 0x5c, 0xf1, 0x24, 0x5f, 0xc0, 0xbd, 0xd8, 0x0d, 0xfa, 0x8d,
-       0x4a, 0x3a, 0x61, 0xd6, 0x26, 0x5f, 0x18, 0xc1, 0xfc, 0x80, 0x6b, 0x8f,
-       0xbf, 0x07, 0x2d, 0x4c, 0xae, 0x64, 0x06, 0x48, 0x3f, 0x6f, 0x06, 0x96,
-       0x98, 0xcc, 0xfa, 0xe0, 0x0b, 0xd7, 0xc0, 0x92, 0x2f, 0xc6, 0xa2, 0xc3,
-       0x98, 0xf7, 0x70, 0xf9, 0x57, 0xd0, 0x7f, 0x8b, 0xfe, 0x0d, 0x7e, 0xb2,
-       0x65, 0x51, 0xdc, 0xe3, 0xb8, 0x13, 0xe6, 0x90, 0x56, 0x21, 0x1b, 0xa6,
-       0x3b, 0x65, 0x12, 0xb4, 0x3a, 0x2c, 0xf8, 0x3d, 0xcf, 0xb9, 0x10, 0xae,
-       0x0e, 0xfd, 0x7b, 0x72, 0x7a, 0x8b, 0x7e, 0xce, 0x8e, 0x76, 0x48, 0x6e,
-       0x3e, 0x9c, 0x33, 0xe5, 0x05, 0x65, 0x44, 0xea, 0xb0, 0x08, 0x65, 0x46,
-       0x10, 0x3c, 0xe8, 0x53, 0x6e, 0x04, 0xc1, 0x69, 0x9f, 0x72, 0xe4, 0x0c,
-       0xe4, 0x03, 0x65, 0x07, 0x79, 0xd9, 0x53, 0x5c, 0xab, 0x4c, 0xa1, 0x17,
-       0xeb, 0xd1, 0x28, 0xd9, 0xfe, 0xe3, 0x84, 0x15, 0x72, 0xe7, 0xa5, 0x4f,
-       0x66, 0xbc, 0x5c, 0x22, 0xa2, 0xf1, 0x04, 0xca, 0x82, 0x3c, 0x4c, 0xeb,
-       0x99, 0x75, 0x49, 0xbe, 0xbf, 0x64, 0xeb, 0xc8, 0xaf, 0xb2, 0x4e, 0x74,
-       0x4d, 0x9d, 0x7f, 0xa7, 0x0c, 0x5f, 0xf6, 0x62, 0xdd, 0x3a, 0x14, 0xf1,
-       0xd8, 0xb5, 0x8d, 0xcf, 0x12, 0x6b, 0x18, 0xfa, 0x3d, 0xbc, 0x7b, 0xee,
-       0x53, 0x8f, 0x7a, 0xf5, 0xde, 0xfd, 0x28, 0xba, 0xf6, 0xdd, 0x94, 0x44,
-       0xbd, 0x54, 0xef, 0x8d, 0xea, 0x4f, 0x1a, 0xa4, 0x35, 0x08, 0x1e, 0xf5,
-       0xc3, 0xf2, 0xc6, 0x86, 0xb5, 0x63, 0x5c, 0x55, 0xa7, 0xec, 0x68, 0x9d,
-       0xb2, 0xcf, 0xd7, 0x29, 0x7b, 0x7b, 0xe3, 0xda, 0xb2, 0xdb, 0xeb, 0x94,
-       0xcd, 0xd6, 0x29, 0xfb, 0x69, 0x9d, 0x32, 0x69, 0x5a, 0x5b, 0x16, 0xa9,
-       0x53, 0xd6, 0x57, 0xa7, 0x2c, 0x0a, 0xbe, 0xdb, 0x26, 0xf9, 0xf8, 0xbd,
-       0x9c, 0xbb, 0xc5, 0x4d, 0x29, 0xb2, 0x16, 0x37, 0x0d, 0xa8, 0xd7, 0xb9,
-       0xaa, 0xde, 0x17, 0xeb, 0xd4, 0x6b, 0x44, 0xbd, 0xb6, 0x55, 0xf5, 0x76,
-       0xd4, 0xc1, 0x75, 0x13, 0xea, 0xc5, 0x56, 0xd5, 0x7b, 0xb0, 0x4e, 0x3d,
-       0x96, 0x7f, 0xc6, 0x8e, 0xd3, 0x07, 0x2d, 0xf4, 0x5a, 0xeb, 0xd5, 0x28,
-       0xd2, 0xce, 0xf2, 0x5e, 0xe8, 0x90, 0x0e, 0x65, 0xe4, 0x02, 0x65, 0x10,
-       0xcb, 0x3a, 0x41, 0xe7, 0x71, 0xd0, 0x1d, 0xe5, 0x28, 0xf8, 0x8c, 0x73,
-       0xa9, 0x6c, 0x90, 0xb1, 0x78, 0x9f, 0x7b, 0xb5, 0x6a, 0x01, 0x8d, 0xa5,
-       0xdc, 0xa4, 0x22, 0xff, 0x49, 0x2e, 0x32, 0xe4, 0xe5, 0x86, 0x45, 0xc5,
-       0x95, 0x04, 0x32, 0xe2, 0xab, 0x36, 0x25, 0xf7, 0x80, 0xbf, 0xd2, 0xd0,
-       0x59, 0x37, 0x06, 0xc3, 0x9a, 0xb7, 0x4c, 0xdd, 0x8b, 0xcb, 0x54, 0x5f,
-       0x0e, 0x52, 0x16, 0x0e, 0x8d, 0x7e, 0x2a, 0xe3, 0x2d, 0x0c, 0x36, 0x82,
-       0x66, 0xcf, 0xa3, 0xcd, 0x6e, 0xb4, 0xdc, 0x57, 0x8e, 0xca, 0x48, 0x79,
-       0x00, 0xbc, 0xe0, 0xc8, 0x39, 0x6f, 0xa3, 0x9c, 0xf3, 0x51, 0xb7, 0x12,
-       0x91, 0xc5, 0xb8, 0x23, 0x8b, 0x78, 0xce, 0xf8, 0x78, 0x57, 0x09, 0x79,
-       0x6b, 0x40, 0x0e, 0x14, 0x7d, 0x39, 0x5c, 0xbc, 0x41, 0x85, 0x7a, 0x6d,
-       0xa7, 0xbf, 0x5e, 0x1e, 0x73, 0x4d, 0xdf, 0xbb, 0xbd, 0x05, 0x68, 0xd4,
-       0xa8, 0x9c, 0xf7, 0x52, 0x89, 0x45, 0xcd, 0x13, 0xff, 0x27, 0x18, 0x41,
-       0x3f, 0xb3, 0x5e, 0xca, 0xfd, 0x03, 0x3c, 0x8f, 0x95, 0x69, 0xcb, 0x54,
-       0xfb, 0x9a, 0x44, 0x5f, 0x87, 0x8a, 0x1b, 0xe4, 0x56, 0xdb, 0x7e, 0x97,
-       0xb7, 0xd0, 0x0b, 0x9e, 0x73, 0x4f, 0x50, 0x86, 0x14, 0x00, 0xd7, 0x5e,
-       0xf0, 0x36, 0xda, 0x7e, 0x4d, 0xcb, 0x33, 0xd8, 0x3e, 0x85, 0x8d, 0x90,
-       0xcf, 0x7f, 0x17, 0xdc, 0x1a, 0x67, 0x7d, 0x96, 0x51, 0xe7, 0x48, 0x49,
-       0x0d, 0x41, 0x26, 0x0c, 0x50, 0x66, 0x26, 0x21, 0x2f, 0x21, 0x7b, 0x8a,
-       0x3f, 0x0d, 0xd2, 0xd1, 0x5a, 0x39, 0x28, 0xb9, 0x6a, 0x1d, 0x96, 0x25,
-       0x8d, 0x5c, 0x2d, 0x2e, 0x2d, 0xcb, 0x8a, 0x1c, 0xe4, 0xcb, 0x53, 0x15,
-       0xca, 0x85, 0x0f, 0x82, 0x47, 0x3b, 0x65, 0xa4, 0x90, 0xca, 0xa5, 0x65,
-       0x1b, 0xd6, 0xef, 0xd7, 0xb1, 0xa6, 0x51, 0x5c, 0x0f, 0xad, 0x97, 0x56,
-       0x1f, 0xba, 0x9b, 0xe5, 0xe8, 0xb4, 0x9d, 0x36, 0xd2, 0x6f, 0x03, 0x0f,
-       0x93, 0x5c, 0xf3, 0x44, 0x26, 0xe2, 0x8c, 0xd2, 0x5e, 0x19, 0x85, 0x7c,
-       0xcc, 0x96, 0xd9, 0x37, 0xe1, 0x4d, 0xd8, 0xdf, 0xb0, 0x9b, 0x0a, 0x9d,
-       0xf6, 0x77, 0x0b, 0x7e, 0x27, 0xed, 0x6f, 0xc8, 0xd4, 0x82, 0x67, 0x7f,
-       0xc7, 0xb5, 0x1c, 0x32, 0xbf, 0x13, 0xf8, 0xdd, 0xaf, 0x7f, 0x4f, 0x15,
-       0x77, 0xed, 0x52, 0xde, 0x95, 0x92, 0x9d, 0xef, 0x94, 0x03, 0x85, 0x77,
-       0x58, 0xd9, 0x82, 0x4b, 0xbe, 0xe4, 0x98, 0x79, 0x26, 0xf4, 0xba, 0xe7,
-       0x8b, 0x39, 0x67, 0x94, 0xf0, 0xe3, 0xf7, 0x70, 0xa1, 0xcf, 0xdd, 0x24,
-       0xa4, 0x81, 0x29, 0x67, 0xb8, 0xe2, 0xa4, 0x23, 0x43, 0x3d, 0x89, 0x49,
-       0x39, 0x8c, 0xdf, 0xe2, 0x46, 0x86, 0xbe, 0x84, 0xbb, 0xc1, 0xc1, 0x57,
-       0xb6, 0x43, 0xb6, 0x16, 0x29, 0x2f, 0x3d, 0xcc, 0x3d, 0x29, 0x67, 0x56,
-       0xd8, 0x58, 0xc4, 0x85, 0x92, 0xec, 0x74, 0xea, 0x78, 0x4e, 0x52, 0xb9,
-       0x19, 0x30, 0xc4, 0x8d, 0x7e, 0x54, 0xde, 0xe7, 0x83, 0x76, 0xaf, 0x74,
-       0x64, 0xd7, 0x95, 0x51, 0xd8, 0x44, 0xde, 0xcc, 0x2e, 0xc8, 0x58, 0xc8,
-       0xbe, 0x08, 0xe9, 0x41, 0x9d, 0x92, 0xb1, 0xe8, 0x10, 0xb0, 0x7d, 0xaa,
-       0x7f, 0x64, 0xb2, 0x90, 0xbd, 0x5d, 0x0d, 0xed, 0xff, 0x6c, 0x66, 0xe0,
-       0xad, 0x92, 0xdd, 0xab, 0x80, 0xa3, 0xf6, 0x31, 0xc8, 0x4c, 0xcc, 0x2b,
-       0x08, 0x40, 0xcf, 0x90, 0xe7, 0x37, 0xdd, 0x14, 0x19, 0x6a, 0x90, 0xe1,
-       0xbd, 0xed, 0x68, 0xc3, 0x77, 0xc4, 0xd7, 0x79, 0xe0, 0x33, 0x95, 0x1c,
-       0x11, 0xb9, 0x7b, 0x6a, 0x60, 0xc9, 0x99, 0x2c, 0x7d, 0x10, 0x3c, 0x79,
-       0x15, 0xda, 0x3f, 0x80, 0xf6, 0x2f, 0x3b, 0xf9, 0xe9, 0x57, 0x9c, 0xc9,
-       0xe9, 0xbf, 0x75, 0xa6, 0xa6, 0xb7, 0x6c, 0xd9, 0x39, 0xb8, 0x65, 0xcb,
-       0xf8, 0x60, 0xd4, 0xea, 0x97, 0x2d, 0x5b, 0xa6, 0x06, 0x07, 0x81, 0x83,
-       0x3e, 0x77, 0x44, 0x3c, 0x77, 0x97, 0x80, 0x7f, 0xe2, 0x1c, 0x93, 0xfa,
-       0x27, 0x85, 0xf7, 0x6c, 0xef, 0xe9, 0xf7, 0xc3, 0xd2, 0x97, 0x68, 0x13,
-       0x8e, 0x1f, 0xb1, 0x75, 0xda, 0x01, 0xfb, 0x03, 0x76, 0x7d, 0x0b, 0xaa,
-       0xc1, 0x63, 0x39, 0xe7, 0xc2, 0x72, 0xae, 0xed, 0x8f, 0xac, 0x2d, 0xbb,
-       0x11, 0xe5, 0x7c, 0x26, 0xce, 0x88, 0x17, 0xda, 0x22, 0x0d, 0xda, 0x76,
-       0xcc, 0x16, 0x48, 0x33, 0x51, 0x99, 0x28, 0xb4, 0xa1, 0x0d, 0xe8, 0xe2,
-       0x94, 0xbd, 0x8e, 0x02, 0xb6, 0xbd, 0xe8, 0xeb, 0xe8, 0x21, 0xb4, 0xa3,
-       0xcc, 0x48, 0xf5, 0x8a, 0xfa, 0x04, 0xea, 0xf4, 0xb9, 0x9b, 0x85, 0x36,
-       0xc7, 0x71, 0xc9, 0x16, 0xc9, 0xdf, 0x3d, 0x80, 0x27, 0x26, 0xc9, 0x76,
-       0x3c, 0x57, 0x0e, 0xc0, 0x0e, 0x69, 0xb0, 0x3a, 0x33, 0x94, 0x17, 0xfc,
-       0x77, 0x87, 0x12, 0xef, 0x80, 0x8c, 0xcd, 0x5d, 0x8e, 0x7a, 0x0e, 0xf0,
-       0x42, 0x3b, 0x05, 0x36, 0xcb, 0x5c, 0x5a, 0x32, 0xdb, 0xee, 0xc5, 0xdd,
-       0xc5, 0x73, 0x1e, 0xf7, 0xb7, 0xe0, 0x3e, 0x89, 0x7b, 0x08, 0x27, 0xf0,
-       0xea, 0x47, 0xac, 0xce, 0xba, 0x06, 0x63, 0xff, 0x6b, 0xc9, 0x94, 0x12,
-       0xb4, 0x39, 0x36, 0x66, 0xbc, 0xb4, 0xab, 0x44, 0x6d, 0x56, 0x32, 0x85,
-       0xfa, 0xf0, 0x09, 0xbc, 0x83, 0x32, 0x7e, 0x12, 0xbf, 0x1f, 0xa4, 0x4d,
-       0x3c, 0x25, 0xe3, 0x73, 0x1c, 0xa7, 0x00, 0x98, 0x4a, 0x92, 0x3d, 0xf9,
-       0x00, 0xae, 0x69, 0x5c, 0x0f, 0xe3, 0xe2, 0xdc, 0xd8, 0xff, 0xe2, 0x26,
-       0x05, 0x5c, 0xf3, 0x39, 0x4b, 0x3a, 0xae, 0xe0, 0x37, 0x69, 0xb8, 0x42,
-       0xdb, 0x06, 0xf4, 0x5b, 0x09, 0xe9, 0xda, 0xb7, 0xbf, 0x13, 0x9a, 0xaf,
-       0x73, 0x6d, 0xa0, 0x99, 0xca, 0xa0, 0x96, 0x39, 0x19, 0x0f, 0xf7, 0x0a,
-       0x6c, 0x8f, 0x36, 0xce, 0xd1, 0xb3, 0x65, 0x9e, 0x2e, 0x4b, 0xea, 0xb2,
-       0x7e, 0x5b, 0x86, 0x7b, 0xa5, 0x41, 0xc6, 0xda, 0x01, 0x31, 0xe5, 0xb3,
-       0x84, 0xf8, 0xa4, 0x0c, 0x00, 0xfd, 0xc2, 0x66, 0x38, 0x73, 0x51, 0xf9,
-       0xb7, 0xa4, 0x6d, 0xb1, 0xc7, 0x2b, 0xa4, 0x63, 0xd2, 0x76, 0x10, 0xdc,
-       0xef, 0x37, 0xa1, 0x7f, 0xf2, 0xbc, 0x48, 0xc3, 0xd1, 0xa8, 0xcc, 0xb8,
-       0xa4, 0x85, 0x77, 0xb4, 0x90, 0x06, 0x1a, 0x3d, 0xd2, 0x70, 0x2d, 0x7f,
-       0x71, 0x0d, 0xd9, 0x5f, 0x0e, 0xf6, 0x1d, 0xed, 0xbc, 0x1e, 0xd8, 0xce,
-       0x1c, 0xe3, 0x30, 0x9f, 0x5d, 0x05, 0x9e, 0xca, 0x2c, 0xf3, 0x94, 0xc8,
-       0x6c, 0x81, 0xb8, 0x09, 0xed, 0x3f, 0xae, 0x33, 0xf1, 0xf3, 0x38, 0xe6,
-       0xcc, 0xfb, 0x19, 0x8b, 0xa7, 0x2f, 0x59, 0x3c, 0x7d, 0xd9, 0xde, 0x5d,
-       0x27, 0xab, 0x6d, 0xc1, 0x05, 0x3c, 0x73, 0x7d, 0xa2, 0x1a, 0x67, 0xd9,
-       0xc2, 0x0c, 0xee, 0xa8, 0x5b, 0x7c, 0x5c, 0xc6, 0xb5, 0x9d, 0x16, 0x91,
-       0x77, 0x69, 0xd9, 0x06, 0x21, 0xdd, 0x5c, 0x00, 0xcc, 0x0d, 0x92, 0x8b,
-       0x47, 0xf4, 0xda, 0x47, 0xbd, 0x03, 0x51, 0x43, 0xab, 0xc4, 0xc9, 0x0a,
-       0x5f, 0xaa, 0x06, 0xa6, 0xb8, 0x95, 0x73, 0x84, 0x8b, 0xb4, 0xfb, 0x88,
-       0x86, 0xeb, 0x16, 0xc8, 0xbb, 0x9c, 0xa8, 0xf6, 0x46, 0xb9, 0x0c, 0xb4,
-       0xa0, 0xe2, 0xd0, 0x5c, 0xc1, 0xd3, 0xb0, 0x9b, 0xb2, 0x73, 0xb4, 0xa1,
-       0xbb, 0xe8, 0xb7, 0xc4, 0xb2, 0xfd, 0xad, 0xa4, 0x23, 0xa5, 0x60, 0x7f,
-       0xe1, 0x59, 0x65, 0xfb, 0x35, 0x9d, 0x3a, 0xca, 0x8b, 0x6b, 0x3b, 0x19,
-       0xbc, 0x12, 0xb1, 0xbe, 0x73, 0x54, 0x79, 0x9b, 0x57, 0x97, 0x25, 0xa9,
-       0x87, 0xd1, 0x2e, 0x99, 0xed, 0x6f, 0x27, 0x8f, 0xb9, 0xca, 0x03, 0x2e,
-       0x3d, 0xed, 0x1b, 0xe5, 0xd4, 0xc0, 0xc6, 0x55, 0xf5, 0xf5, 0xdd, 0xb1,
-       0xcf, 0x51, 0x7b, 0x77, 0xed, 0x3d, 0x69, 0xef, 0xb9, 0xe8, 0x00, 0xef,
-       0x8e, 0x44, 0x87, 0x78, 0xc7, 0x1a, 0x0e, 0xb1, 0x0f, 0xcd, 0x57, 0x56,
-       0xce, 0xf4, 0xb8, 0x79, 0x21, 0x5f, 0xfd, 0xa9, 0xdc, 0x32, 0x67, 0xe4,
-       0xef, 0x2e, 0xc8, 0x20, 0xf8, 0x6f, 0xee, 0xa2, 0x00, 0xfe, 0xbd, 0x65,
-       0xb9, 0xa5, 0x42, 0xbc, 0xfd, 0x06, 0xf0, 0xb7, 0x35, 0x4a, 0xde, 0x74,
-       0x85, 0x72, 0xf7, 0x4e, 0xd1, 0xf6, 0x69, 0x81, 0x38, 0x3f, 0x2b, 0x5c,
-       0x9b, 0x7c, 0xe1, 0x19, 0xbd, 0x36, 0x07, 0x0b, 0x8b, 0xc0, 0xcf, 0xd7,
-       0x41, 0xf7, 0x41, 0xb0, 0xe8, 0xe7, 0x41, 0x39, 0x7f, 0x84, 0xdf, 0xe8,
-       0xbb, 0xf0, 0x1c, 0xde, 0xb7, 0x4a, 0xbe, 0x44, 0x9e, 0x8b, 0x5a, 0x1e,
-       0x3e, 0x05, 0x7e, 0xba, 0x0c, 0xfd, 0xa2, 0x6c, 0x80, 0xbf, 0xff, 0x11,
-       0xef, 0x70, 0x9f, 0xc3, 0x22, 0xb6, 0xd3, 0xd6, 0xe1, 0xd8, 0x5c, 0x3b,
-       0xae, 0x59, 0x5c, 0xfb, 0xad, 0x8f, 0x2f, 0xaf, 0x1b, 0xd7, 0x2b, 0xd5,
-       0x9b, 0x93, 0x70, 0xcd, 0x44, 0x1e, 0x2f, 0xb0, 0x3e, 0xe9, 0xff, 0x1f,
-       0x62, 0x46, 0x17, 0xfc, 0xc9, 0x3a, 0x73, 0x5f, 0xdd, 0x96, 0x6b, 0x5e,
-       0x4b, 0x83, 0xf4, 0x6f, 0x52, 0x83, 0x39, 0xc8, 0x9d, 0xa8, 0xd7, 0x2a,
-       0x23, 0xda, 0x27, 0x22, 0x4d, 0x90, 0x06, 0x6e, 0x56, 0x86, 0x36, 0x3f,
-       0xa4, 0x0c, 0x6d, 0x3e, 0x03, 0x5a, 0xc4, 0x55, 0x5c, 0x72, 0x0c, 0x6d,
-       0x7e, 0x1d, 0x77, 0x5c, 0xc5, 0x0b, 0x4e, 0xc8, 0xc7, 0xc3, 0xf0, 0xf9,
-       0x76, 0x15, 0xa2, 0xce, 0x78, 0x05, 0xf4, 0x5b, 0x8c, 0xa1, 0x7c, 0x81,
-       0x38, 0xc7, 0xfc, 0x39, 0xce, 0x56, 0xdb, 0xff, 0xe3, 0x32, 0x51, 0x0c,
-       0xb4, 0x5d, 0x95, 0x9d, 0xbb, 0x17, 0xf7, 0xf5, 0x5a, 0xce, 0x28, 0x2f,
-       0xad, 0x8c, 0xbc, 0x7a, 0x17, 0xee, 0xdd, 0x89, 0x83, 0xd2, 0xed, 0x46,
-       0xe4, 0x39, 0xf4, 0xf5, 0x43, 0x67, 0xa2, 0xf2, 0x32, 0xae, 0x9f, 0xe0,
-       0x7a, 0x15, 0xd7, 0x2b, 0xe8, 0xf7, 0x45, 0x94, 0xaf, 0x97, 0x05, 0xb7,
-       0x19, 0xf5, 0x45, 0x8d, 0x57, 0x5e, 0x70, 0xc6, 0x4e, 0xbe, 0x84, 0x2b,
-       0xaa, 0x26, 0x2a, 0xcf, 0x3b, 0xd9, 0xb9, 0x60, 0xe3, 0xa2, 0x47, 0x19,
-       0xf6, 0xa7, 0x8e, 0xe9, 0x7b, 0x08, 0x73, 0x00, 0x4d, 0x17, 0x17, 0x30,
-       0xf6, 0x33, 0x9a, 0x67, 0x46, 0x20, 0xf3, 0xb3, 0xb0, 0x4b, 0xc6, 0x34,
-       0x4c, 0x97, 0x03, 0x3e, 0xf8, 0xba, 0x03, 0xb8, 0xcf, 0x35, 0xca, 0x52,
-       0x9c, 0x76, 0xe4, 0x97, 0x75, 0xfd, 0x6c, 0xb1, 0x5b, 0xe3, 0x76, 0x66,
-       0x0d, 0xff, 0xd0, 0x3f, 0x0b, 0xe5, 0x81, 0x91, 0xc6, 0xb3, 0x05, 0xca,
-       0x02, 0xe8, 0x9f, 0xc2, 0x14, 0xee, 0x8d, 0x5a, 0x26, 0xe4, 0x25, 0x94,
-       0x07, 0x6c, 0x47, 0x99, 0x50, 0x2b, 0x77, 0x28, 0x6b, 0x28, 0x7b, 0x28,
-       0x4b, 0xcc, 0x7a, 0x8c, 0x3f, 0x48, 0x19, 0x7e, 0x2d, 0xfc, 0x53, 0xda,
-       0x1f, 0x9d, 0xc6, 0x07, 0x99, 0xce, 0x28, 0x23, 0x4f, 0xf7, 0xe8, 0xb5,
-       0x98, 0x28, 0xa8, 0x38, 0x20, 0x47, 0x19, 0xae, 0x63, 0x7b, 0x71, 0xcf,
-       0xaa, 0x09, 0x5c, 0xd9, 0x63, 0x1f, 0xc0, 0x6f, 0xae, 0xcd, 0x04, 0xea,
-       0xe1, 0x2a, 0x8e, 0xe2, 0x8e, 0x0b, 0xb6, 0x99, 0x91, 0x23, 0x5c, 0xd3,
-       0x84, 0x5d, 0xd3, 0x2f, 0x03, 0x0f, 0x9c, 0x9f, 0xd2, 0xf1, 0x07, 0xe5,
-       0xed, 0x00, 0xde, 0x2b, 0xd6, 0xdf, 0x6d, 0x15, 0xc3, 0x83, 0xb8, 0x7a,
-       0xc9, 0xcf, 0x2d, 0x66, 0xbd, 0x34, 0xed, 0x7e, 0x37, 0x6a, 0x78, 0x31,
-       0x8e, 0xb2, 0x08, 0xca, 0xda, 0x45, 0xf3, 0xfe, 0x32, 0x1e, 0xd3, 0x16,
-       0x8f, 0xfc, 0xad, 0xec, 0x6f, 0xd0, 0x13, 0x6c, 0xda, 0x8c, 0x37, 0x80,
-       0x71, 0x31, 0x97, 0x63, 0x7b, 0xd4, 0x38, 0xe4, 0xf7, 0xb8, 0x47, 0x19,
-       0xce, 0x38, 0x03, 0xe7, 0xc7, 0x7e, 0x51, 0xae, 0x71, 0xe0, 0x4b, 0xd5,
-       0x87, 0xff, 0x32, 0xd6, 0xec, 0x71, 0xd9, 0x57, 0xbc, 0x5a, 0xfb, 0xd4,
-       0x8d, 0x47, 0xcd, 0x7a, 0x88, 0x0a, 0xeb, 0xa1, 0xef, 0x38, 0x6d, 0x9b,
-       0x31, 0xfd, 0x3e, 0x7a, 0x94, 0xbf, 0x29, 0x9f, 0x6b, 0xe5, 0xbd, 0xb1,
-       0x6b, 0xf2, 0x2b, 0x64, 0x1d, 0x6d, 0x0b, 0xac, 0x59, 0xb9, 0x16, 0xef,
-       0xf4, 0xf1, 0x29, 0xf3, 0xc8, 0x4f, 0x07, 0xc1, 0x13, 0xaa, 0xc1, 0xf0,
-       0x3e, 0x7d, 0x8d, 0x7a, 0xfc, 0x04, 0xfb, 0x0b, 0xbc, 0x72, 0x02, 0xb6,
-       0xdb, 0xae, 0xe5, 0x3e, 0x20, 0x2b, 0xe3, 0x31, 0x39, 0x59, 0x68, 0x91,
-       0xb9, 0x82, 0x82, 0xc1, 0x60, 0x64, 0x67, 0x44, 0x12, 0x5a, 0xff, 0xd2,
-       0xbe, 0x1b, 0x9e, 0x8e, 0x58, 0xba, 0x83, 0xc3, 0xd2, 0xfc, 0x1b, 0xd0,
-       0xb1, 0x65, 0xe8, 0xd8, 0x56, 0xe8, 0xe0, 0xd5, 0x32, 0xa2, 0xab, 0x61,
-       0xad, 0x8c, 0x60, 0x9b, 0x14, 0xbc, 0xf2, 0x83, 0x68, 0x17, 0xd2, 0x5f,
-       0x4c, 0xd3, 0x5a, 0x56, 0x72, 0xce, 0xae, 0xca, 0x94, 0xb3, 0xbb, 0xb2,
-       0x5a, 0x07, 0xf5, 0xb9, 0x51, 0x31, 0xb0, 0x9e, 0xd4, 0x71, 0xbc, 0x94,
-       0x9f, 0x01, 0x4e, 0x76, 0x83, 0xee, 0x9e, 0x2e, 0xc1, 0x8f, 0xa7, 0x5c,
-       0x06, 0xcc, 0x8f, 0x01, 0xe6, 0xd9, 0x92, 0x13, 0xda, 0x06, 0xc2, 0xe0,
-       0xc9, 0xec, 0x74, 0xbf, 0x2c, 0xce, 0x93, 0x0e, 0x21, 0x03, 0x4a, 0x58,
-       0x4f, 0x7f, 0x1d, 0xec, 0x00, 0x8e, 0x0f, 0xb9, 0x3d, 0xdd, 0xa1, 0xdf,
-       0x19, 0x7d, 0xde, 0x29, 0x8b, 0xe5, 0xf7, 0x58, 0xd8, 0x0e, 0xd7, 0xc0,
-       0xb6, 0x6e, 0x19, 0xb6, 0xdd, 0x80, 0x6d, 0x4f, 0x5d, 0xd8, 0xea, 0xe9,
-       0xe2, 0x2e, 0xd8, 0x34, 0xe4, 0x8f, 0x10, 0xaf, 0xed, 0x96, 0x1e, 0x6e,
-       0xb7, 0xf6, 0x2e, 0x6d, 0xa2, 0x9f, 0x02, 0x1e, 0xd2, 0x18, 0x7e, 0xcf,
-       0x3d, 0x4a, 0x59, 0x86, 0x72, 0x3e, 0x7f, 0x06, 0x75, 0xf0, 0x3c, 0xf7,
-       0xe7, 0x56, 0x0e, 0xde, 0x65, 0x61, 0xa1, 0x9d, 0x90, 0x86, 0x4d, 0x3c,
-       0xe2, 0x64, 0xe6, 0x08, 0x43, 0x0e, 0xf0, 0xe2, 0x5d, 0xa5, 0xb6, 0x4f,
-       0xde, 0xd9, 0xef, 0x15, 0xb6, 0x1f, 0xf6, 0x1d, 0xce, 0x65, 0xbd, 0xd5,
-       0xf3, 0x21, 0x7d, 0x85, 0xf6, 0xf5, 0x94, 0x93, 0x5e, 0x33, 0xaf, 0x5a,
-       0x9a, 0xa3, 0xbc, 0x8d, 0xca, 0x4e, 0xd0, 0xc9, 0xce, 0x15, 0xb4, 0xa6,
-       0xdd, 0x10, 0x4b, 0xc7, 0xeb, 0xec, 0xfc, 0x0e, 0x18, 0xbe, 0xf1, 0x63,
-       0xd0, 0x87, 0x94, 0x37, 0x37, 0x1b, 0xdf, 0x5c, 0x4e, 0x00, 0xd6, 0xf0,
-       0x99, 0xb4, 0xc9, 0xdf, 0x94, 0x49, 0x55, 0x5a, 0x34, 0xbe, 0x4b, 0xa7,
-       0x8e, 0x9f, 0x56, 0xed, 0xf5, 0xa8, 0x8c, 0x9a, 0x35, 0x3f, 0xcc, 0x35,
-       0xa7, 0x2f, 0xd2, 0xfd, 0xc0, 0xa8, 0xe5, 0xaf, 0x54, 0x29, 0x27, 0xbb,
-       0xed, 0xdc, 0xbf, 0x5c, 0x67, 0xed, 0x5a, 0x97, 0xd7, 0x6e, 0xb4, 0xb2,
-       0x7a, 0x8e, 0x22, 0x5d, 0x0f, 0x44, 0xb5, 0x6f, 0x2b, 0xca, 0x97, 0x46,
-       0x8f, 0xf2, 0x93, 0xb6, 0x12, 0xca, 0x67, 0xfb, 0xdc, 0x36, 0xd0, 0xdb,
-       0x53, 0x6b, 0xec, 0xae, 0xa4, 0x95, 0x9b, 0xf4, 0x83, 0xc3, 0x31, 0x72,
-       0x56, 0x4e, 0xe6, 0xd0, 0xff, 0x94, 0xb3, 0xb3, 0x52, 0x4f, 0x5e, 0x86,
-       0x72, 0x92, 0xf3, 0xb9, 0x57, 0xee, 0x78, 0x90, 0x3c, 0x7a, 0xbb, 0xb6,
-       0xaf, 0xaf, 0xda, 0x71, 0x00, 0xf8, 0x23, 0xfc, 0x8b, 0x9b, 0x60, 0x32,
-       0x40, 0xe7, 0xa6, 0x65, 0xdc, 0xae, 0xdb, 0xf8, 0xf2, 0xfa, 0xf3, 0x6a,
-       0xc7, 0x6f, 0xc6, 0x59, 0x95, 0x85, 0x59, 0xdb, 0xb1, 0xb0, 0xeb, 0x56,
-       0xdb, 0xb2, 0x9c, 0x03, 0xed, 0xd9, 0x46, 0x63, 0x0b, 0x16, 0x69, 0x7f,
-       0x52, 0x76, 0xd1, 0xfe, 0x8c, 0x35, 0x4a, 0x33, 0xe7, 0x33, 0x68, 0xcb,
-       0x68, 0xa7, 0xae, 0x9e, 0xdf, 0x6a, 0xff, 0x91, 0x70, 0x12, 0x6e, 0x43,
-       0x5b, 0x49, 0x45, 0xd8, 0x02, 0x19, 0xf5, 0xaf, 0xd5, 0x6b, 0xa0, 0x68,
-       0xbb, 0xee, 0xf8, 0x76, 0x83, 0x89, 0x31, 0x27, 0xd1, 0x3f, 0xc7, 0x24,
-       0xff, 0xf1, 0x4e, 0x3b, 0xbf, 0x9e, 0x2c, 0xab, 0xd5, 0x3d, 0x97, 0x2d,
-       0xe3, 0x6f, 0xe7, 0x8a, 0x35, 0x0a, 0xf1, 0x17, 0xd2, 0x45, 0x2d, 0x0e,
-       0x49, 0x13, 0xa4, 0x85, 0x90, 0x16, 0xb7, 0x5a, 0x7d, 0x13, 0xd2, 0xde,
-       0xa5, 0xa0, 0xbd, 0xfb, 0x80, 0x27, 0xca, 0x70, 0xc6, 0xed, 0x36, 0xe3,
-       0xf9, 0x08, 0x9e, 0x43, 0x3e, 0xb9, 0x98, 0x0c, 0xa7, 0xfc, 0x66, 0x9b,
-       0x8c, 0x95, 0xfb, 0xa1, 0x9f, 0xcb, 0x36, 0x9c, 0x37, 0xe5, 0xff, 0x57,
-       0xe9, 0x77, 0x35, 0x1a, 0x3b, 0xfd, 0x43, 0x8d, 0x94, 0xaf, 0x9b, 0xe4,
-       0x60, 0x4d, 0xd9, 0xc5, 0xe4, 0x77, 0xed, 0x9c, 0x2f, 0xff, 0x7f, 0x30,
-       0xe7, 0xc4, 0xaa, 0x39, 0xbb, 0x76, 0xce, 0x15, 0xbc, 0x6f, 0xc3, 0xfb,
-       0x16, 0xea, 0x82, 0x64, 0x55, 0xde, 0x58, 0x5c, 0xe8, 0x79, 0xd5, 0xca,
-       0x89, 0x50, 0x46, 0x70, 0x5e, 0x1f, 0xb1, 0x73, 0x78, 0xa0, 0x66, 0x5e,
-       0x1f, 0x79, 0x13, 0xf3, 0xea, 0x5c, 0x31, 0xaf, 0x5d, 0x17, 0x9d, 0x57,
-       0x3d, 0x1e, 0x27, 0x2f, 0x87, 0xf3, 0x8b, 0xc9, 0x8d, 0x05, 0xce, 0x71,
-       0x27, 0xe6, 0x48, 0x18, 0xc2, 0x39, 0x0e, 0xd9, 0x39, 0x8a, 0xea, 0xda,
-       0xf1, 0x73, 0xf8, 0x5d, 0x3b, 0x3f, 0xea, 0xfe, 0x1f, 0x83, 0xa6, 0x9b,
-       0x24, 0xd3, 0xdf, 0x64, 0xe5, 0xff, 0x97, 0xe5, 0xd6, 0x22, 0xd7, 0x3a,
-       0x95, 0x16, 0xd9, 0xa3, 0xf6, 0x15, 0x9f, 0x6d, 0x64, 0x8c, 0x7f, 0x97,
-       0x6f, 0xf5, 0x18, 0xf4, 0xc5, 0x6e, 0xd8, 0x7c, 0x3b, 0x0b, 0x6a, 0x20,
-       0x22, 0x41, 0x70, 0x9b, 0xdf, 0x8c, 0xb1, 0x37, 0x6a, 0x5f, 0x75, 0x6d,
-       0x7c, 0xfd, 0x99, 0x46, 0xf1, 0x68, 0x6f, 0x50, 0x9f, 0x43, 0xdf, 0x1d,
-       0xa3, 0x0d, 0x96, 0x81, 0x9d, 0x9c, 0x4e, 0x44, 0xb4, 0x2d, 0x46, 0x9d,
-       0x98, 0x4a, 0xa4, 0xa5, 0x2c, 0xd9, 0x63, 0xe9, 0x84, 0x12, 0x8e, 0x01,
-       0x5b, 0x0d, 0x36, 0xe4, 0xad, 0x90, 0x35, 0xb7, 0x56, 0xf6, 0xaa, 0x5b,
-       0x60, 0xef, 0xdc, 0x72, 0xf2, 0x03, 0xea, 0x36, 0xd8, 0x3a, 0xb7, 0x9d,
-       0xbc, 0x41, 0xed, 0x83, 0x6d, 0xb3, 0x0f, 0x76, 0xce, 0xbe, 0x0a, 0x6d,
-       0xcf, 0x9b, 0x41, 0x7b, 0x9d, 0x35, 0xb4, 0x46, 0x1b, 0x87, 0xf3, 0x23,
-       0xee, 0x8f, 0x71, 0x0d, 0xfc, 0xa4, 0x7a, 0x45, 0xaf, 0x4b, 0xdb, 0x8a,
-       0xb2, 0xd7, 0x92, 0x55, 0xa1, 0x7e, 0xda, 0x60, 0xe3, 0x46, 0x94, 0xb7,
-       0xaf, 0x45, 0x5b, 0xa4, 0x11, 0x17, 0x78, 0x26, 0xfe, 0x48, 0x5b, 0xb5,
-       0xf3, 0xdf, 0xd4, 0x24, 0x5e, 0x67, 0x93, 0x34, 0xdf, 0x0b, 0xf9, 0x5a,
-       0x4b, 0x53, 0xbc, 0xbb, 0x56, 0xd7, 0x90, 0xb6, 0x28, 0x83, 0x43, 0x7a,
-       0xd8, 0xfa, 0x1a, 0xf2, 0xf7, 0xa2, 0xf4, 0x74, 0x4f, 0x64, 0x28, 0x08,
-       0xc6, 0x07, 0x64, 0x23, 0xe3, 0x01, 0x99, 0x4a, 0x35, 0x26, 0xa0, 0xbc,
-       0xda, 0x98, 0x00, 0xfd, 0xac, 0x47, 0x80, 0xdf, 0x19, 0x5c, 0x22, 0x63,
-       0x8c, 0x3b, 0x54, 0x42, 0xbb, 0xfc, 0x1b, 0xd6, 0x2e, 0x0f, 0xe1, 0x48,
-       0x02, 0x0e, 0x23, 0x9f, 0xd7, 0xea, 0xb9, 0x95, 0xfa, 0x3b, 0xb7, 0x6c,
-       0xd3, 0x26, 0xe5, 0xc6, 0x22, 0xe7, 0x4d, 0x19, 0x4c, 0xdc, 0xd4, 0xca,
-       0xe0, 0x84, 0xb5, 0xa3, 0x50, 0x47, 0xcb, 0xcf, 0xb5, 0xb2, 0x93, 0x72,
-       0x8f, 0xf1, 0xf9, 0x07, 0x7c, 0xd2, 0xfa, 0x7b, 0x24, 0xbd, 0x1c, 0x9f,
-       0x17, 0xd0, 0x9b, 0xf8, 0x91, 0x21, 0xbd, 0xdf, 0xe6, 0xce, 0xca, 0x6e,
-       0x19, 0x8e, 0x33, 0xd6, 0xc9, 0x78, 0x9e, 0x97, 0x9b, 0x05, 0x0f, 0x4c,
-       0x16, 0x15, 0x2c, 0xf8, 0x46, 0x19, 0x73, 0x03, 0xd9, 0xe5, 0x3b, 0x3a,
-       0x76, 0x6c, 0x74, 0xed, 0x4c, 0x93, 0xb1, 0x5d, 0x1d, 0x1d, 0xff, 0x5d,
-       0x04, 0xf5, 0x2d, 0x6a, 0xfb, 0x56, 0x69, 0xfd, 0xbb, 0xa0, 0xeb, 0x7c,
-       0xae, 0x29, 0x8c, 0x63, 0x2e, 0xba, 0x11, 0x5b, 0xaf, 0xb6, 0xfc, 0x8b,
-       0x36, 0x3e, 0x9d, 0x84, 0xec, 0x0f, 0xcb, 0xfe, 0xb0, 0x4e, 0xd9, 0xb7,
-       0xea, 0x94, 0xfd, 0xcf, 0x3a, 0x65, 0x26, 0x2e, 0xb8, 0xb3, 0xf0, 0xf7,
-       0x78, 0x37, 0xa5, 0x7d, 0x77, 0xb1, 0xfb, 0x61, 0xb9, 0xe5, 0x3a, 0x1b,
-       0xac, 0x5f, 0xc6, 0x18, 0xb1, 0x89, 0x0d, 0x67, 0x75, 0x6c, 0xb8, 0xcf,
-       0xdd, 0xa1, 0xf4, 0x5e, 0xca, 0x7e, 0xc6, 0x19, 0xf7, 0x69, 0xbc, 0x10,
-       0x27, 0x5f, 0x61, 0x0c, 0x38, 0xc7, 0xbd, 0xd8, 0xa4, 0xba, 0x18, 0x6d,
-       0x57, 0x6d, 0x13, 0xb3, 0x6e, 0xb4, 0x8b, 0x5b, 0x64, 0x04, 0xb6, 0xc2,
-       0xce, 0x42, 0x9b, 0xec, 0x9a, 0x1e, 0x58, 0x47, 0xbd, 0xb5, 0x7b, 0xda,
-       0xf8, 0x83, 0xfb, 0xc0, 0x57, 0x69, 0x21, 0x8c, 0x29, 0x5f, 0x84, 0x36,
-       0xf1, 0x5a, 0x5b, 0xf8, 0xb5, 0xfb, 0xfb, 0xa5, 0x8b, 0xf4, 0xe7, 0xc0,
-       0x76, 0x78, 0xa3, 0xfd, 0x35, 0xcb, 0xc8, 0x74, 0x88, 0x2b, 0xf5, 0x33,
-       0xb6, 0x8b, 0x5c, 0xa4, 0x9d, 0xb6, 0x4b, 0xe4, 0xe9, 0x65, 0x59, 0xbc,
-       0x15, 0x36, 0x93, 0x04, 0x99, 0x01, 0xe9, 0x8c, 0x88, 0x8e, 0xf1, 0xf8,
-       0x46, 0x36, 0xf7, 0x70, 0x6f, 0x07, 0xf4, 0x6f, 0x6c, 0x15, 0x13, 0x37,
-       0x0d, 0xed, 0x94, 0x7a, 0xb4, 0x7b, 0x9d, 0xa5, 0x5d, 0xee, 0xb9, 0xee,
-       0xa6, 0xcc, 0xd5, 0x6b, 0x42, 0x3a, 0xde, 0x55, 0x90, 0x64, 0x48, 0xc7,
-       0x8b, 0x92, 0x5e, 0x41, 0xc7, 0x8b, 0x32, 0xa4, 0xe9, 0xb8, 0x71, 0x05,
-       0x1d, 0x77, 0x5a, 0x3a, 0xde, 0x13, 0x33, 0x74, 0xa1, 0xb4, 0x9e, 0x22,
-       0x9d, 0x1a, 0x3a, 0x76, 0x34, 0x1d, 0x2f, 0xe2, 0x1e, 0xf5, 0xae, 0xb3,
-       0x75, 0x22, 0xb6, 0x8c, 0xbf, 0xc3, 0x32, 0xca, 0xc5, 0x4f, 0xc6, 0x8c,
-       0x5e, 0x1a, 0x02, 0x1d, 0x85, 0xe5, 0xfb, 0x6d, 0xfc, 0xa0, 0xb6, 0xcc,
-       0xc4, 0x47, 0x76, 0x16, 0xc6, 0x62, 0x2b, 0xe9, 0x73, 0x08, 0xf4, 0x19,
-       0xd6, 0x79, 0x2d, 0xfa, 0x6c, 0xb6, 0xfb, 0x16, 0x71, 0xbd, 0x2f, 0x9f,
-       0x8e, 0x1b, 0x5a, 0xbd, 0x45, 0xcf, 0x9d, 0xf3, 0x3e, 0xfb, 0x06, 0x68,
-       0xd5, 0xac, 0xcd, 0xb9, 0xaa, 0xbf, 0xcd, 0x58, 0x54, 0xd2, 0xc4, 0xb0,
-       0x19, 0x27, 0xbd, 0x98, 0xed, 0x68, 0xe4, 0x53, 0x83, 0x96, 0x4f, 0xad,
-       0x63, 0xcc, 0x35, 0xa8, 0xca, 0xec, 0x01, 0xe8, 0x0a, 0xda, 0xd8, 0x5a,
-       0x4e, 0xe3, 0x5d, 0x67, 0x32, 0x53, 0x78, 0x35, 0x88, 0x78, 0x8c, 0x0f,
-       0x71, 0x5f, 0x40, 0xc6, 0x1c, 0x94, 0x75, 0x95, 0xcd, 0xbc, 0x94, 0xd7,
-       0x8a, 0xe7, 0x01, 0xe9, 0x2a, 0x2b, 0xf9, 0xe8, 0x74, 0x8b, 0xec, 0x2f,
-       0x44, 0xe5, 0xe3, 0x68, 0xff, 0xb1, 0x82, 0x0b, 0x7f, 0xfc, 0x4c, 0x8c,
-       0x76, 0xe1, 0xbe, 0x02, 0xf7, 0x27, 0x59, 0x37, 0xbe, 0x6a, 0x7f, 0x36,
-       0x22, 0x5d, 0x3d, 0x79, 0x78, 0x2a, 0x12, 0xdd, 0x03, 0x38, 0x9a, 0x86,
-       0x86, 0xe4, 0x07, 0x03, 0x1b, 0x51, 0xf6, 0xb2, 0x1d, 0x6f, 0xd4, 0x31,
-       0xf1, 0xde, 0x41, 0x79, 0x77, 0x65, 0x48, 0xae, 0xaf, 0x98, 0x3d, 0xd5,
-       0xea, 0x9e, 0x69, 0xca, 0x5d, 0x80, 0xfe, 0x49, 0xbb, 0x41, 0x70, 0xce,
-       0xc3, 0xaa, 0x1f, 0x89, 0x4a, 0xac, 0x27, 0x95, 0x58, 0x10, 0xf3, 0x7c,
-       0xbe, 0xfc, 0x0f, 0xc1, 0x58, 0x3c, 0x2a, 0x3f, 0xf0, 0x38, 0xc7, 0x41,
-       0xb9, 0xae, 0x5c, 0x3b, 0x36, 0x97, 0xf3, 0x0f, 0x63, 0xdc, 0xa7, 0xc8,
-       0x54, 0x16, 0x62, 0x8c, 0xa5, 0xd3, 0xe7, 0xe8, 0x7a, 0x1b, 0xfc, 0x38,
-       0x48, 0xee, 0xae, 0xb7, 0x81, 0x6e, 0xe2, 0xd0, 0xf9, 0x57, 0x01, 0xc6,
-       0xab, 0x18, 0xfb, 0x62, 0xcc, 0x8b, 0xcf, 0x5f, 0xc7, 0xb8, 0x6c, 0xfb,
-       0x1b, 0xd6, 0x5e, 0xe6, 0xfa, 0x1b, 0xde, 0xa9, 0xaf, 0x77, 0x5a, 0xc7,
-       0x62, 0x43, 0xe2, 0xc4, 0xde, 0x91, 0x90, 0x75, 0x5e, 0xed, 0xf8, 0xdc,
-       0x27, 0x86, 0xc5, 0x38, 0x20, 0xd1, 0xdd, 0xdb, 0x07, 0x65, 0x04, 0xf3,
-       0xdb, 0xb9, 0x66, 0x7e, 0xf7, 0x08, 0xe3, 0xab, 0xe7, 0x0b, 0x9c, 0x43,
-       0x75, 0x5e, 0xea, 0x0b, 0x66, 0x5e, 0xb1, 0x9e, 0xd5, 0xf3, 0xd1, 0xed,
-       0xd5, 0x09, 0xc0, 0xf2, 0x35, 0x9d, 0x57, 0x10, 0x04, 0x6f, 0xed, 0x39,
-       0x1f, 0x24, 0x2f, 0x49, 0xf5, 0x2e, 0x54, 0xf7, 0x77, 0xc6, 0x22, 0x43,
-       0x69, 0xad, 0xcf, 0xf0, 0x9c, 0xcc, 0x96, 0xd3, 0x58, 0x47, 0x89, 0x66,
-       0xfb, 0xa3, 0x9a, 0x4f, 0xb2, 0x5e, 0xda, 0xee, 0x61, 0x85, 0x3e, 0x54,
-       0x10, 0x28, 0x6f, 0xb5, 0xdc, 0xa0, 0xbe, 0xc2, 0xdc, 0xe5, 0xdf, 0xda,
-       0x1c, 0x96, 0x5e, 0xc6, 0xb3, 0xc6, 0xa2, 0x43, 0xb1, 0x64, 0xbe, 0xec,
-       0xe1, 0x77, 0x0b, 0xee, 0x3b, 0x60, 0xaf, 0xf8, 0xb0, 0x67, 0x24, 0xae,
-       0x8c, 0x6c, 0x00, 0x2d, 0xf7, 0xe4, 0x94, 0x22, 0x6f, 0xba, 0xc9, 0xc9,
-       0x72, 0x3c, 0x59, 0x2a, 0x7f, 0x96, 0xed, 0x51, 0xb7, 0x5e, 0x2c, 0xcf,
-       0xc8, 0x86, 0xa7, 0x2a, 0x1c, 0x83, 0xfe, 0xef, 0x1b, 0x19, 0x23, 0x6a,
-       0xfb, 0x66, 0x9f, 0x21, 0x5e, 0xa2, 0x74, 0xc9, 0xf1, 0x2f, 0x6d, 0x7d,
-       0x13, 0xce, 0xef, 0xb3, 0x16, 0xee, 0xd5, 0xe3, 0xbe, 0xa0, 0xed, 0x97,
-       0xd3, 0x15, 0xda, 0x8c, 0xdc, 0xdf, 0x49, 0x1d, 0x9f, 0x11, 0xc2, 0x11,
-       0x04, 0xcf, 0xf9, 0x46, 0x77, 0x3f, 0x55, 0xe1, 0x1e, 0x47, 0x10, 0xfc,
-       0x88, 0x76, 0xf1, 0xde, 0x22, 0xc6, 0x0b, 0x71, 0xb0, 0x35, 0x17, 0x85,
-       0x5c, 0x9c, 0x1a, 0x20, 0x7e, 0x05, 0x1e, 0x6a, 0x8f, 0x7b, 0xa3, 0xc4,
-       0x92, 0x9f, 0x2a, 0xb7, 0x24, 0x3f, 0x5d, 0x76, 0x81, 0x67, 0xce, 0x3b,
-       0x9e, 0x9c, 0xb0, 0x73, 0xce, 0x96, 0x89, 0xdf, 0xd7, 0xda, 0x87, 0x7c,
-       0x61, 0x85, 0xbf, 0x44, 0x98, 0xaa, 0xb0, 0x10, 0xb6, 0xa4, 0xc5, 0x4d,
-       0x10, 0xfc, 0xd8, 0x37, 0x6b, 0x3a, 0x55, 0x94, 0x29, 0x8c, 0x9b, 0xdb,
-       0xac, 0x88, 0x87, 0x58, 0xf2, 0x0e, 0x8c, 0xfd, 0x29, 0x8c, 0xbd, 0xbf,
-       0xcc, 0xf1, 0x20, 0x2b, 0x30, 0xf7, 0xa9, 0x4a, 0x08, 0x6f, 0xbd, 0xb1,
-       0xc3, 0x35, 0xef, 0xb5, 0x36, 0x5e, 0xf8, 0xac, 0x11, 0xd9, 0xae, 0xbc,
-       0x7e, 0xd0, 0xd7, 0xe2, 0xa6, 0xa8, 0xfc, 0x22, 0xe4, 0x6e, 0x20, 0x8f,
-       0x42, 0x9e, 0x2d, 0x6a, 0xba, 0xc9, 0x5c, 0xce, 0xff, 0x23, 0xf2, 0xeb,
-       0xeb, 0x18, 0x5f, 0x1e, 0xf6, 0x68, 0xbb, 0x2e, 0x05, 0x8b, 0x1e, 0xe5,
-       0xf3, 0x06, 0x99, 0x71, 0x73, 0xbd, 0xd0, 0x15, 0x28, 0x6b, 0xa5, 0xbf,
-       0x9d, 0xcc, 0x44, 0x52, 0xc9, 0x49, 0x61, 0x3e, 0x14, 0x73, 0x15, 0x98,
-       0x23, 0x44, 0xd9, 0x10, 0x85, 0xcc, 0xe3, 0x1a, 0x9a, 0xf1, 0x26, 0xcb,
-       0xd5, 0xba, 0x07, 0x84, 0x7b, 0x86, 0xa9, 0xc4, 0x3e, 0x6d, 0x9f, 0x88,
-       0x8c, 0x17, 0x58, 0x77, 0x3b, 0xac, 0x13, 0xaf, 0xa6, 0xbe, 0xce, 0xe1,
-       0x02, 0x9f, 0x87, 0x71, 0xac, 0x58, 0x2c, 0x53, 0x90, 0x97, 0x23, 0x03,
-       0xf2, 0x32, 0xed, 0xce, 0x61, 0xd0, 0xb6, 0xeb, 0xf1, 0xbd, 0x29, 0xcf,
-       0xf8, 0xb2, 0x94, 0x19, 0xec, 0xa3, 0x9d, 0x9d, 0x53, 0x9a, 0x27, 0x44,
-       0xa1, 0x6d, 0x2c, 0x5b, 0x96, 0x91, 0x6c, 0xc1, 0xc6, 0x7a, 0x46, 0x39,
-       0xe7, 0x0d, 0x35, 0x73, 0x6f, 0x95, 0x28, 0x60, 0x1a, 0x89, 0x24, 0x9d,
-       0x06, 0xef, 0x23, 0x2d, 0x46, 0xe7, 0x43, 0xee, 0xb7, 0xdd, 0xdf, 0xce,
-       0x3d, 0x53, 0x05, 0x1f, 0x5a, 0xb5, 0xdf, 0x7e, 0x8d, 0x1a, 0xfa, 0xf3,
-       0x04, 0xf4, 0xa0, 0x95, 0x95, 0xb1, 0x91, 0xae, 0x65, 0xfa, 0xe6, 0xf8,
-       0xd2, 0x1e, 0xf1, 0x92, 0x23, 0xc3, 0x65, 0x51, 0x91, 0x21, 0x37, 0x36,
-       0x5c, 0x5e, 0x49, 0xf3, 0x4f, 0x55, 0xfe, 0xbd, 0xb5, 0x05, 0x6b, 0x63,
-       0xaa, 0xb5, 0xef, 0xc8, 0x77, 0x2b, 0xf6, 0x2b, 0x92, 0x26, 0x07, 0x86,
-       0xfb, 0xb4, 0x5c, 0x93, 0xf4, 0x5b, 0x1b, 0xa0, 0x7c, 0x66, 0xb4, 0x8f,
-       0xc6, 0x9c, 0x8b, 0x98, 0xcd, 0x3d, 0x33, 0xb8, 0x4e, 0x97, 0x1d, 0x99,
-       0x82, 0x7c, 0x38, 0x20, 0x7f, 0x1f, 0xa4, 0xe3, 0xe6, 0xbd, 0x59, 0x5f,
-       0xd6, 0xe7, 0x5e, 0x44, 0xb3, 0xe4, 0x4f, 0x46, 0x25, 0x77, 0x92, 0x7b,
-       0x60, 0xcf, 0xed, 0xaf, 0xe6, 0x6d, 0x50, 0x0e, 0x70, 0xbf, 0xd6, 0x91,
-       0x3c, 0xfc, 0xda, 0x11, 0xee, 0xc3, 0xf7, 0xff, 0x1f, 0xf4, 0xc1, 0x7a,
-       0x61, 0xdb, 0x16, 0xb4, 0x6d, 0xb4, 0x6d, 0x47, 0xef, 0x78, 0x73, 0x6d,
-       0x5b, 0xd1, 0x36, 0x16, 0x8e, 0xfb, 0x06, 0xdb, 0x6a, 0x7c, 0x5e, 0x33,
-       0x5c, 0x28, 0x2e, 0xc1, 0x4f, 0x4e, 0x4c, 0x48, 0xda, 0x19, 0x1f, 0xd0,
-       0xf3, 0xb9, 0x66, 0xb8, 0x0c, 0x38, 0xe2, 0x41, 0x90, 0xf7, 0x43, 0x3d,
-       0xcc, 0x7f, 0xc7, 0x44, 0x3c, 0x96, 0x71, 0xdf, 0x92, 0xfe, 0x04, 0xa3,
-       0xa4, 0x2e, 0xf3, 0xd9, 0x24, 0xcf, 0xfd, 0xc9, 0xf8, 0x46, 0xdc, 0x55,
-       0x17, 0x71, 0x92, 0xf5, 0x18, 0xef, 0xdd, 0x68, 0xcb, 0x23, 0x2c, 0x4f,
-       0x45, 0x21, 0x4b, 0x4c, 0x79, 0xc4, 0x96, 0x03, 0x26, 0x3f, 0x9f, 0x04,
-       0xb7, 0xd9, 0x72, 0x3e, 0x2b, 0x5d, 0x6e, 0x9e, 0x0d, 0x0f, 0x8d, 0x09,
-       0xe3, 0x3a, 0x99, 0xeb, 0x1a, 0x64, 0x2b, 0xd6, 0x87, 0x3e, 0xa3, 0x23,
-       0xcd, 0x80, 0xe3, 0x9c, 0xff, 0x76, 0xd8, 0xd6, 0x81, 0xfc, 0xc0, 0x37,
-       0xf4, 0x3f, 0x2b, 0x3d, 0x69, 0xe5, 0x30, 0x07, 0x20, 0x90, 0x9d, 0xfe,
-       0xb6, 0xc4, 0x2e, 0xfc, 0x1e, 0xef, 0x4f, 0xca, 0xec, 0x20, 0xe8, 0xb1,
-       0x9f, 0xbc, 0xb1, 0x15, 0x36, 0x0f, 0x7e, 0xf7, 0xb4, 0xc8, 0x92, 0x9b,
-       0x73, 0xd7, 0xc1, 0x5f, 0x1b, 0xc1, 0xac, 0xe6, 0x0a, 0x9e, 0x7b, 0x1b,
-       0x84, 0x5c, 0xda, 0xed, 0xc1, 0xbd, 0x76, 0xbe, 0xdf, 0xc2, 0x7c, 0x7f,
-       0xad, 0x59, 0x9a, 0x59, 0x5e, 0x5b, 0xb7, 0x51, 0xf6, 0xb8, 0xdb, 0xdd,
-       0xd8, 0x8a, 0xba, 0xe7, 0x51, 0x97, 0x65, 0x9e, 0xcb, 0x1c, 0x9d, 0xd9,
-       0x32, 0xe9, 0xcc, 0xc0, 0xda, 0xd5, 0x13, 0x04, 0xd7, 0xf9, 0x1c, 0x37,
-       0x08, 0xae, 0xf7, 0xfb, 0xdc, 0x67, 0xe5, 0xf9, 0xc0, 0xd8, 0x54, 0x21,
-       0xed, 0x3c, 0x67, 0xe5, 0x75, 0x10, 0xbc, 0xec, 0xf7, 0xca, 0xef, 0x54,
-       0x52, 0x8f, 0xd3, 0xe7, 0x3e, 0x83, 0xe7, 0x33, 0xbe, 0xc9, 0x2b, 0xfa,
-       0x13, 0xb4, 0x8b, 0xab, 0x7e, 0xd0, 0xb0, 0x27, 0x5f, 0xd4, 0x3e, 0x3a,
-       0xf1, 0x67, 0x62, 0xfc, 0x55, 0x18, 0x30, 0x61, 0x2f, 0xb3, 0xc9, 0x65,
-       0x7e, 0xa0, 0xa6, 0xdf, 0xda, 0x77, 0x0a, 0xef, 0x58, 0x16, 0x04, 0x97,
-       0x0c, 0xfc, 0x31, 0xe6, 0x94, 0x2a, 0x71, 0xef, 0xee, 0x03, 0x9a, 0xff,
-       0x04, 0x7e, 0x3d, 0xe9, 0x24, 0xea, 0x2a, 0xe5, 0x1d, 0xee, 0x52, 0xa9,
-       0x9c, 0xc8, 0x5b, 0xb0, 0xfe, 0x5c, 0x63, 0x30, 0x48, 0x1b, 0x60, 0xdf,
-       0xb6, 0xbd, 0xd9, 0xc4, 0x92, 0xe8, 0x4b, 0xa7, 0x37, 0xc1, 0xd7, 0xd5,
-       0xf6, 0x4c, 0x14, 0x7c, 0x3d, 0xd1, 0x16, 0x04, 0xef, 0xf7, 0xc3, 0x35,
-       0xb3, 0xb1, 0x6a, 0xe8, 0xf8, 0x6c, 0xff, 0xb9, 0x66, 0x63, 0xc7, 0x31,
-       0x4f, 0x30, 0xa9, 0xe3, 0xfa, 0xaa, 0x1d, 0x3a, 0x64, 0xdb, 0x57, 0x39,
-       0x7e, 0x8e, 0xe5, 0xef, 0xf3, 0x43, 0x98, 0xaa, 0xed, 0xb3, 0xfd, 0xeb,
-       0xac, 0xcd, 0x19, 0x05, 0x2e, 0x3d, 0xb7, 0x4b, 0xfd, 0x4d, 0x60, 0x74,
-       0x6b, 0x48, 0xc3, 0x7f, 0x17, 0x3c, 0x18, 0x37, 0xcf, 0x99, 0x6d, 0xec,
-       0x63, 0xab, 0x4c, 0x6e, 0xc3, 0x73, 0xf4, 0x5a, 0xdc, 0x87, 0x2f, 0x8b,
-       0xc8, 0x15, 0x89, 0x61, 0xb5, 0xcd, 0x7d, 0x50, 0xfa, 0xac, 0x8c, 0xfb,
-       0x1a, 0xf4, 0x7d, 0x0e, 0xfe, 0x78, 0x93, 0x3c, 0x08, 0x9a, 0x56, 0x03,
-       0xa9, 0xe4, 0x82, 0x4a, 0xf5, 0xce, 0xa8, 0x94, 0x3f, 0xa6, 0xae, 0xe7,
-       0xbc, 0x06, 0x89, 0x8b, 0x19, 0xe2, 0xb7, 0x08, 0xfc, 0x17, 0x81, 0xe3,
-       0x8b, 0xee, 0xf1, 0xfa, 0x56, 0xb7, 0x18, 0xfd, 0x96, 0xd3, 0xb4, 0x69,
-       0xec, 0xf2, 0x3f, 0xf6, 0xc3, 0x35, 0x84, 0x6d, 0xc8, 0x1c, 0x99, 0xba,
-       0x6b, 0x94, 0xe5, 0x1a, 0x41, 0x31, 0xe4, 0x40, 0xf7, 0xa9, 0xe4, 0x84,
-       0x5a, 0x0a, 0x36, 0xed, 0xe8, 0xee, 0x7d, 0x42, 0xf7, 0x93, 0xf2, 0xd3,
-       0x2a, 0x0f, 0x78, 0xb6, 0x4a, 0xd3, 0x0e, 0xe2, 0x99, 0xb0, 0xc6, 0x18,
-       0x4f, 0x72, 0xef, 0x40, 0xdd, 0x31, 0xa5, 0xf7, 0xa0, 0x6d, 0x1d, 0xc2,
-       0x1c, 0x5f, 0x2f, 0xcd, 0xd4, 0x43, 0x8c, 0x93, 0xbd, 0x96, 0x2e, 0x84,
-       0x4c, 0x3a, 0x46, 0x19, 0x18, 0x31, 0xb1, 0xdf, 0xca, 0xcf, 0xa1, 0x9d,
-       0xce, 0x67, 0x89, 0x45, 0x21, 0xa3, 0xa6, 0xc0, 0xc5, 0x87, 0x8e, 0x49,
-       0xb4, 0xc1, 0xfb, 0x5f, 0xcd, 0xc6, 0x6f, 0xa2, 0x0f, 0xc5, 0xb1, 0x1b,
-       0x24, 0xbf, 0x26, 0xde, 0x52, 0x02, 0xfc, 0xcd, 0x32, 0x79, 0x8c, 0x6b,
-       0x11, 0x85, 0xcc, 0xe1, 0xd8, 0x12, 0xcd, 0xf4, 0x07, 0xc1, 0x38, 0xcb,
-       0x4f, 0x92, 0x7f, 0x25, 0xc5, 0x77, 0xb9, 0x93, 0x0b, 0x9b, 0xd4, 0x0a,
-       0x59, 0xdb, 0x62, 0xe1, 0xd0, 0x78, 0x92, 0x92, 0x96, 0x23, 0xd4, 0x37,
-       0xb7, 0xd5, 0xc0, 0x33, 0x7a, 0xc7, 0x94, 0xd7, 0xf8, 0x26, 0xe0, 0xf9,
-       0x3d, 0xc0, 0xd3, 0x62, 0xe1, 0x69, 0x5c, 0x05, 0x4f, 0x4b, 0x08, 0x0f,
-       0xe4, 0x1c, 0xe5, 0x6a, 0xec, 0x9a, 0x74, 0x59, 0x9c, 0xbc, 0x27, 0x9d,
-       0x4a, 0xfb, 0x2f, 0xd4, 0x37, 0x8d, 0xee, 0xf8, 0x80, 0x2b, 0xe3, 0x5a,
-       0xd7, 0x44, 0xaf, 0xe9, 0x2e, 0x2f, 0xc0, 0x7a, 0x15, 0x27, 0xe3, 0x11,
-       0xf6, 0x7a, 0x76, 0xd5, 0x3d, 0x90, 0xff, 0x8b, 0xa9, 0xa8, 0xb5, 0x25,
-       0x4a, 0x3e, 0xfd, 0x96, 0xb8, 0xde, 0xdb, 0xaf, 0xc2, 0xf4, 0x12, 0x60,
-       0x82, 0x3c, 0x3e, 0xd6, 0xe7, 0x8e, 0xca, 0xa5, 0xda, 0x37, 0xb3, 0xb8,
-       0xc6, 0xdc, 0x62, 0x35, 0x73, 0x83, 0xfe, 0x53, 0xe1, 0xdc, 0x20, 0x13,
-       0x51, 0xaf, 0x24, 0xf7, 0x5b, 0x5c, 0xb4, 0x62, 0x4e, 0xb1, 0x9a, 0xf9,
-       0x74, 0x27, 0xf6, 0xb3, 0xcc, 0xcc, 0xa7, 0x27, 0xef, 0xc5, 0x2c, 0x7e,
-       0x57, 0xc3, 0x58, 0xf5, 0x17, 0x67, 0x24, 0x90, 0x29, 0x1f, 0x6b, 0xd4,
-       0x4b, 0xff, 0x24, 0x66, 0xf3, 0x98, 0x15, 0x9e, 0x37, 0x58, 0xfe, 0x72,
-       0x25, 0xaf, 0xfd, 0xb7, 0x2f, 0xad, 0x37, 0x7c, 0x1a, 0xb5, 0xf9, 0x6b,
-       0xfc, 0xdd, 0xb1, 0xde, 0xee, 0xef, 0xe7, 0xd2, 0xf2, 0xfb, 0xeb, 0x69,
-       0x97, 0x34, 0x78, 0x43, 0xab, 0xca, 0x62, 0x28, 0xbb, 0x7d, 0xbd, 0x95,
-       0x0b, 0x28, 0xbb, 0x07, 0x7e, 0x1a, 0xf3, 0x34, 0xf8, 0x8e, 0x32, 0xb8,
-       0x16, 0x27, 0x7d, 0x60, 0x45, 0xf2, 0x3c, 0xe5, 0x22, 0x6d, 0x4a, 0xcc,
-       0x51, 0x7d, 0x27, 0x8c, 0xa3, 0xe3, 0x77, 0x3d, 0xdb, 0x9f, 0xf8, 0x26,
-       0xae, 0xe5, 0xdb, 0x53, 0xe0, 0xfb, 0x03, 0xbe, 0x13, 0x9d, 0x65, 0x1e,
-       0x80, 0xa6, 0xe1, 0xda, 0xbe, 0xaf, 0x47, 0xdf, 0x21, 0x2d, 0x93, 0x5e,
-       0xae, 0xd7, 0x74, 0xd3, 0x44, 0x5d, 0x7c, 0x8c, 0xf4, 0xc7, 0x58, 0x72,
-       0xb3, 0xd6, 0x8f, 0xd5, 0x75, 0x6c, 0x82, 0xae, 0x89, 0x1b, 0x1e, 0x75,
-       0xcd, 0x7e, 0x77, 0xb5, 0xbf, 0x31, 0xf4, 0x47, 0x3b, 0x0d, 0x7e, 0xba,
-       0xc7, 0x68, 0x0e, 0xe5, 0x97, 0x13, 0x55, 0x57, 0x6a, 0x3f, 0x33, 0xa6,
-       0xf3, 0x8e, 0x96, 0xeb, 0x4e, 0xd8, 0xb1, 0x49, 0xb7, 0x26, 0xfe, 0x5f,
-       0x1d, 0x5f, 0x1c, 0xb5, 0x4d, 0x40, 0x65, 0x8d, 0x32, 0x35, 0x40, 0x1a,
-       0xe5, 0xdc, 0xb5, 0x0d, 0x75, 0x0d, 0xed, 0x08, 0x43, 0x9f, 0xb4, 0x9d,
-       0xa2, 0xd7, 0x64, 0x0b, 0x8d, 0xc6, 0x67, 0x89, 0xcb, 0xe6, 0x06, 0x9d,
-       0x47, 0x80, 0xb2, 0x72, 0xa8, 0xcb, 0xa2, 0x32, 0xdb, 0xff, 0xbf, 0x83,
-       0xf4, 0x5e, 0xd6, 0xad, 0xbb, 0x6f, 0x9f, 0x98, 0x11, 0x8d, 0xa7, 0xbf,
-       0xa8, 0xe2, 0xc9, 0xce, 0x2d, 0xbe, 0x7a, 0x6e, 0x05, 0xc0, 0x7b, 0x0f,
-       0x64, 0x27, 0xd7, 0xc9, 0xe4, 0x6f, 0x3f, 0x2e, 0x4e, 0x34, 0xd3, 0x5b,
-       0x6f, 0x6e, 0xa5, 0x10, 0xaf, 0x9c, 0x1b, 0x68, 0x35, 0x9c, 0x17, 0x69,
-       0x3b, 0xae, 0xf7, 0x89, 0x94, 0x22, 0x2c, 0xad, 0xab, 0x70, 0x1b, 0xd2,
-       0x9d, 0xa1, 0xb9, 0xa7, 0x34, 0xcd, 0xb5, 0x58, 0x9a, 0x43, 0x5d, 0x97,
-       0xfb, 0xde, 0xa3, 0x2d, 0x55, 0x9a, 0xdb, 0x60, 0x69, 0xee, 0x99, 0xf5,
-       0x66, 0x4f, 0xfc, 0xfd, 0x2d, 0x66, 0x4f, 0xea, 0x2f, 0x57, 0x3d, 0x6f,
-       0xa2, 0xcd, 0x08, 0x5f, 0x2c, 0x7c, 0xae, 0x85, 0xf5, 0x0c, 0x60, 0xad,
-       0x95, 0x35, 0x4d, 0x36, 0xee, 0xc6, 0xfd, 0x73, 0xfa, 0x7d, 0x51, 0x79,
-       0x14, 0x76, 0x50, 0xbe, 0xfc, 0x8f, 0xc1, 0x02, 0x7c, 0xbf, 0xa9, 0x65,
-       0xdd, 0x7b, 0x5b, 0x0b, 0xf9, 0x6d, 0x06, 0xbf, 0x0e, 0xd6, 0xf8, 0x3c,
-       0x98, 0x2f, 0xca, 0xfe, 0x01, 0xeb, 0x01, 0xb9, 0xbc, 0x5c, 0x97, 0x31,
-       0x0b, 0xe3, 0xe3, 0x30, 0x66, 0x68, 0xf6, 0x13, 0x29, 0xe7, 0xef, 0x84,
-       0x4f, 0x74, 0x0f, 0xf4, 0x24, 0xe9, 0xfb, 0xa5, 0x16, 0x93, 0xe7, 0x1b,
-       0x87, 0x1e, 0xfb, 0x65, 0x9b, 0x0b, 0x75, 0xf8, 0x57, 0xeb, 0xe7, 0xf8,
-       0x82, 0xf6, 0x1d, 0xd2, 0xcc, 0xdf, 0xb7, 0x98, 0x98, 0xf1, 0xb7, 0x5a,
-       0xc8, 0x67, 0x6a, 0xdb, 0x0f, 0x37, 0x68, 0xbe, 0x70, 0xc2, 0xe7, 0xcf,
-       0xb4, 0xae, 0x7c, 0x0e, 0xdb, 0x3d, 0xd9, 0xba, 0xb2, 0x5d, 0x58, 0xfe,
-       0x73, 0x1b, 0x57, 0x96, 0x5f, 0xe3, 0xae, 0x6c, 0xff, 0xf5, 0x55, 0xcf,
-       0x2d, 0x9b, 0x56, 0x3e, 0x5f, 0xbd, 0xea, 0x79, 0x6a, 0xd5, 0xf3, 0x85,
-       0x55, 0xcf, 0x57, 0xb5, 0xad, 0x7c, 0xbe, 0xbd, 0xad, 0x3e, 0xbc, 0x87,
-       0xdb, 0x56, 0xc2, 0x75, 0xa7, 0x8e, 0xf7, 0xcf, 0x54, 0xa2, 0xb2, 0xab,
-       0x80, 0xf7, 0x4e, 0xe7, 0x66, 0xa3, 0xd7, 0x6a, 0xdf, 0x33, 0xbe, 0xf6,
-       0xd7, 0xab, 0xfa, 0xab, 0xb6, 0xdb, 0x5d, 0x6d, 0xe7, 0x57, 0xdb, 0x19,
-       0xd9, 0x36, 0x5b, 0xe1, 0x3b, 0x96, 0x87, 0xfd, 0x9a, 0xb6, 0x53, 0xc5,
-       0x4e, 0x9d, 0x0b, 0x3b, 0xaa, 0x73, 0x61, 0x93, 0xe0, 0xc3, 0x3b, 0x75,
-       0x4c, 0x69, 0x93, 0x42, 0x79, 0xa5, 0x55, 0xc7, 0x95, 0x74, 0x2c, 0xb5,
-       0x30, 0x0a, 0xdb, 0x96, 0x39, 0xb0, 0x81, 0xec, 0xf1, 0xcd, 0xdd, 0xe4,
-       0xc4, 0x1e, 0x0e, 0x86, 0xdd, 0x20, 0x98, 0xf4, 0x6e, 0xb3, 0xf9, 0x62,
-       0xb8, 0x57, 0x4c, 0x1b, 0xea, 0xe0, 0x27, 0xa0, 0x83, 0xab, 0xba, 0xf7,
-       0x4e, 0x8c, 0xb5, 0x00, 0x9a, 0x19, 0x90, 0xdf, 0xad, 0xa4, 0xbe, 0x24,
-       0xfa, 0xcc, 0x4d, 0x3f, 0x6c, 0xb8, 0xa5, 0x4f, 0xbd, 0xdf, 0xf3, 0x61,
-       0xeb, 0x05, 0xf2, 0xb0, 0x3f, 0x08, 0x1a, 0xea, 0x85, 0xbd, 0xe7, 0x69,
-       0xbf, 0xf4, 0xb4, 0xa6, 0x2d, 0xd2, 0x58, 0x8b, 0xce, 0xd7, 0x7f, 0xd4,
-       0x77, 0x62, 0x99, 0xfe, 0x3f, 0x32, 0x71, 0x1a, 0xbf, 0xdb, 0xfd, 0x1a,
-       0xf8, 0x76, 0xa7, 0xb7, 0x05, 0x3e, 0x0a, 0x69, 0x88, 0xf1, 0xaf, 0xcb,
-       0x75, 0x1e, 0x21, 0x03, 0x68, 0x33, 0x51, 0xc6, 0x09, 0x53, 0x83, 0x63,
-       0xc2, 0x79, 0xa7, 0x12, 0x49, 0xa5, 0xed, 0xaa, 0xe0, 0x46, 0x9f, 0x39,
-       0xb6, 0xdc, 0x63, 0x21, 0x3f, 0xef, 0xff, 0xf4, 0x94, 0x97, 0x73, 0x23,
-       0x36, 0x2f, 0x37, 0x53, 0x30, 0xb4, 0x39, 0x41, 0xda, 0x84, 0x3f, 0xb5,
-       0xd8, 0xff, 0xb7, 0x01, 0xed, 0xfb, 0xa4, 0x22, 0xed, 0xff, 0x4d, 0x30,
-       0x17, 0x65, 0x5f, 0x84, 0x7b, 0xff, 0xa7, 0x33, 0x1a, 0x57, 0x77, 0xca,
-       0x81, 0x22, 0x6d, 0xe1, 0x98, 0xce, 0xe7, 0x18, 0xf7, 0x69, 0xa7, 0xc5,
-       0x80, 0xc7, 0x0f, 0x01, 0x7f, 0x2d, 0xb0, 0xb9, 0x47, 0x50, 0x27, 0x22,
-       0x63, 0x60, 0xf1, 0xd9, 0x02, 0xf9, 0x93, 0xf7, 0x28, 0xea, 0xbb, 0x32,
-       0x5f, 0xb8, 0x59, 0xe7, 0xdb, 0x9d, 0x46, 0xdb, 0x27, 0x71, 0xcd, 0x16,
-       0x26, 0xd0, 0x66, 0xaf, 0xae, 0x3f, 0x5b, 0x62, 0x8e, 0xb2, 0x40, 0x2e,
-       0xed, 0x97, 0xfc, 0x5c, 0x97, 0x8c, 0xc5, 0x17, 0x66, 0xa2, 0xcb, 0x71,
-       0x99, 0x8f, 0x6f, 0xe0, 0x1e, 0x47, 0xfe, 0x4a, 0xee, 0x07, 0x4b, 0x74,
-       0x74, 0xbb, 0xea, 0x6d, 0xd3, 0x3e, 0xd7, 0xa0, 0xec, 0xac, 0x0c, 0xc9,
-       0x4d, 0x95, 0xcf, 0x6e, 0x36, 0xb1, 0xa8, 0x15, 0xf1, 0xad, 0xc3, 0xc4,
-       0x8a, 0x3a, 0x1a, 0xe5, 0xb9, 0x25, 0x99, 0x3d, 0x25, 0x12, 0x39, 0x1a,
-       0xc6, 0x12, 0x59, 0xe6, 0x4a, 0xd7, 0x95, 0x80, 0xeb, 0x14, 0x64, 0x6b,
-       0x3c, 0x26, 0x5f, 0xdc, 0x16, 0x8e, 0x95, 0x0b, 0xa6, 0xb7, 0xe5, 0xe4,
-       0xd3, 0xb8, 0xb2, 0x57, 0xa6, 0x4a, 0x19, 0xc5, 0x71, 0xbf, 0x13, 0x50,
-       0x96, 0xa9, 0x21, 0x4f, 0x72, 0x6d, 0xe1, 0xd8, 0xf0, 0x6f, 0x76, 0x84,
-       0xe3, 0xd3, 0xe6, 0x36, 0x67, 0x1e, 0xf2, 0xdc, 0x77, 0x01, 0xfd, 0x45,
-       0x86, 0xee, 0xde, 0x40, 0xdf, 0x61, 0x58, 0xd8, 0x0e, 0x32, 0x5d, 0xb1,
-       0x6f, 0xc2, 0x49, 0xf8, 0x6b, 0xe1, 0x5c, 0x4c, 0xc6, 0x81, 0xa3, 0xdc,
-       0xeb, 0xc2, 0xdb, 0xe7, 0x7a, 0xaa, 0x1e, 0xbc, 0xa3, 0x36, 0x96, 0xc8,
-       0xf8, 0xe0, 0x3a, 0xe0, 0xad, 0x05, 0xe5, 0x1f, 0x94, 0xa9, 0x63, 0x6f,
-       0xdb, 0xcc, 0xbd, 0xec, 0x06, 0xcf, 0xb1, 0x39, 0xa7, 0x3c, 0xbf, 0x73,
-       0x37, 0xea, 0xf0, 0xfd, 0xcd, 0x68, 0x93, 0xca, 0x65, 0x22, 0x9b, 0xe1,
-       0x13, 0x71, 0xdc, 0x20, 0xd2, 0xb5, 0xa3, 0x59, 0xe7, 0x90, 0xca, 0x29,
-       0xea, 0xf3, 0xb0, 0xed, 0xdd, 0x3a, 0x47, 0x03, 0x7e, 0x7b, 0x6e, 0x24,
-       0x42, 0xf9, 0xd5, 0x2b, 0xc3, 0xd4, 0x27, 0xa7, 0x6e, 0xd6, 0xb4, 0xdf,
-       0xbd, 0x8d, 0x67, 0x99, 0xfa, 0x8c, 0x8d, 0x1e, 0x27, 0x8c, 0xa3, 0x28,
-       0x87, 0xfd, 0xfe, 0x9a, 0x30, 0xdc, 0xf5, 0x26, 0x61, 0xb8, 0xeb, 0x4d,
-       0xc2, 0x40, 0x5c, 0x00, 0x8e, 0xca, 0x5f, 0x6c, 0x08, 0x63, 0xd5, 0x97,
-       0x62, 0x1e, 0x07, 0x8b, 0x77, 0xc9, 0xa1, 0xa2, 0xa3, 0xe3, 0x8e, 0x0b,
-       0x8a, 0x32, 0xc1, 0x05, 0x4f, 0x82, 0xf7, 0x8a, 0xe0, 0xcd, 0x22, 0x78,
-       0xb1, 0x08, 0xbe, 0x84, 0xfd, 0x7f, 0x06, 0xf6, 0xff, 0x93, 0x58, 0x9b,
-       0xd3, 0x2b, 0x78, 0x39, 0xad, 0x79, 0x39, 0x5f, 0xa4, 0xaf, 0xd6, 0x7f,
-       0x11, 0x7e, 0x8d, 0xca, 0x70, 0x21, 0x05, 0x55, 0xe2, 0x44, 0xb3, 0xfd,
-       0x9f, 0x24, 0xbf, 0xca, 0x83, 0xfe, 0x0d, 0x68, 0x73, 0x18, 0x34, 0x9e,
-       0xa2, 0x1d, 0x48, 0xfb, 0x27, 0x07, 0xde, 0x3c, 0x4c, 0x5f, 0x4d, 0x5d,
-       0xb9, 0x49, 0xa8, 0x5f, 0xa2, 0x3b, 0x98, 0x7b, 0xc8, 0xb9, 0x26, 0x57,
-       0xe1, 0xc9, 0xf0, 0xef, 0x84, 0x47, 0x3d, 0x43, 0xbe, 0x7d, 0x99, 0x7c,
-       0x5b, 0xc3, 0xab, 0x01, 0xe7, 0x17, 0xb8, 0xdb, 0xea, 0xb5, 0xad, 0xd6,
-       0xdf, 0xb4, 0x5c, 0x5f, 0x8f, 0x5f, 0x22, 0x3f, 0x42, 0x27, 0x11, 0xf7,
-       0xc9, 0x4c, 0x64, 0x8b, 0xc5, 0x3d, 0x6c, 0xb7, 0x1d, 0x97, 0x00, 0xf7,
-       0x9d, 0x92, 0x9b, 0x0f, 0xc4, 0xdb, 0x11, 0xf6, 0x59, 0xed, 0xc7, 0xb5,
-       0xfd, 0x8c, 0x17, 0x1c, 0x19, 0xd9, 0xc6, 0x7d, 0x08, 0x07, 0x7a, 0x3e,
-       0x5c, 0x0f, 0xd8, 0xfb, 0x7a, 0xcd, 0x29, 0x63, 0x29, 0x5b, 0x5b, 0x6c,
-       0xfc, 0x89, 0xfd, 0x1d, 0x5e, 0xb5, 0x4e, 0x17, 0x02, 0x9e, 0x11, 0x9b,
-       0xf2, 0x6e, 0xa8, 0xa1, 0x95, 0xfb, 0x2c, 0xad, 0xa8, 0x55, 0xf3, 0xb8,
-       0xdd, 0xd2, 0x4a, 0x08, 0x6f, 0x3c, 0xa4, 0x95, 0xa6, 0x90, 0x56, 0x72,
-       0x33, 0x21, 0xad, 0xb0, 0xed, 0xed, 0x21, 0xad, 0x24, 0x6b, 0x69, 0x25,
-       0x37, 0xe3, 0xe0, 0x5a, 0x0d, 0x07, 0xe9, 0x85, 0xfd, 0x90, 0x5e, 0x00,
-       0x4b, 0xe5, 0xd6, 0xd6, 0x90, 0x5e, 0xe2, 0xe8, 0xe7, 0x50, 0xd1, 0xe4,
-       0x74, 0xc0, 0xef, 0xb2, 0x3a, 0xc4, 0xc5, 0x9a, 0x1b, 0x1f, 0xb1, 0x3e,
-       0x8d, 0xf8, 0x96, 0x46, 0xaa, 0x79, 0xee, 0xab, 0x68, 0x03, 0xb8, 0x67,
-       0x2e, 0xeb, 0x76, 0x4d, 0x1b, 0xf7, 0xfb, 0x53, 0xa8, 0xbb, 0x07, 0xb4,
-       0x11, 0xe2, 0xe0, 0x7a, 0x8b, 0x83, 0xd5, 0x6b, 0x39, 0x66, 0x71, 0xb0,
-       0xc7, 0xe2, 0x40, 0xf3, 0x4b, 0x8e, 0x6b, 0xa6, 0x34, 0x0e, 0x9a, 0x34,
-       0x0e, 0x44, 0x85, 0x6d, 0xc7, 0xea, 0xe0, 0x80, 0x75, 0xf6, 0xe8, 0xf9,
-       0x47, 0x30, 0xff, 0xfd, 0x98, 0xbf, 0xd2, 0xf3, 0xe7, 0x3a, 0x70, 0xfe,
-       0x80, 0xa5, 0x72, 0x72, 0x79, 0xfe, 0x6d, 0xe8, 0xe3, 0x60, 0x31, 0xa2,
-       0xe7, 0x0f, 0xdb, 0x7e, 0x30, 0x9c, 0xff, 0xe9, 0x8a, 0xc9, 0x7f, 0x3e,
-       0xbd, 0x46, 0xcf, 0x4d, 0x59, 0xde, 0xf0, 0xb4, 0x5f, 0xcc, 0x98, 0xf6,
-       0x19, 0xe8, 0xb6, 0x69, 0x3f, 0x69, 0xcf, 0x43, 0x19, 0x7b, 0xe9, 0x1b,
-       0x3e, 0x79, 0xe7, 0xe3, 0x3a, 0x0f, 0xe5, 0x71, 0xda, 0x4d, 0xc5, 0x36,
-       0x19, 0x99, 0xae, 0x85, 0x9b, 0xf0, 0xe6, 0xb4, 0x1c, 0xcd, 0x62, 0x7e,
-       0xe3, 0x7e, 0x2f, 0xe4, 0x9b, 0xa6, 0x25, 0x94, 0xa7, 0x72, 0xc3, 0x91,
-       0x26, 0x51, 0x0f, 0x7c, 0x08, 0x73, 0x8e, 0xca, 0x66, 0xaf, 0xdb, 0xdd,
-       0xa1, 0xa8, 0x0b, 0x2f, 0xab, 0xd1, 0x85, 0xed, 0x56, 0x17, 0x6e, 0xa2,
-       0x2e, 0x04, 0xdc, 0x77, 0xca, 0xe1, 0x22, 0xd7, 0x2f, 0x97, 0x6c, 0x82,
-       0xfe, 0xff, 0x81, 0xc7, 0xb3, 0x27, 0x3a, 0x6e, 0x96, 0x38, 0xac, 0x69,
-       0x99, 0x3a, 0x2d, 0xa5, 0xcf, 0x6a, 0x2c, 0xd2, 0xc6, 0x8e, 0x33, 0x16,
-       0x4a, 0xbd, 0xf7, 0xe3, 0xe0, 0x73, 0x75, 0xf4, 0xde, 0x64, 0xd1, 0xd8,
-       0x6f, 0x0d, 0xb0, 0x09, 0xe5, 0x44, 0x3b, 0xae, 0x8d, 0x3c, 0xab, 0xd0,
-       0xdb, 0xa3, 0x9a, 0xa5, 0xe1, 0x44, 0xab, 0x4c, 0x4c, 0x1b, 0x1b, 0x57,
-       0x9d, 0x00, 0xfe, 0x4f, 0x30, 0xdf, 0x55, 0x74, 0x7e, 0x7e, 0xb6, 0x04,
-       0x3b, 0x77, 0xf6, 0x4e, 0x93, 0xb7, 0x32, 0xdd, 0xa0, 0x7f, 0xd3, 0x06,
-       0xc9, 0xfb, 0x69, 0xe8, 0xbb, 0x98, 0x4c, 0xa0, 0xcf, 0xee, 0x6d, 0x8d,
-       0x98, 0x73, 0x1c, 0x6d, 0xe9, 0xf3, 0x31, 0x8e, 0xd6, 0x28, 0xd1, 0xd9,
-       0xb8, 0xce, 0xad, 0xe7, 0xd9, 0xd1, 0xcc, 0x60, 0x1b, 0xde, 0x31, 0x9f,
-       0xc1, 0xc5, 0x58, 0xa1, 0xec, 0x47, 0xbf, 0x47, 0xc5, 0xee, 0xf7, 0x0c,
-       0x69, 0xfd, 0x17, 0x39, 0xea, 0xda, 0x33, 0x74, 0x83, 0x58, 0xf7, 0x7a,
-       0x7a, 0xd1, 0x18, 0xb9, 0x19, 0xac, 0x9f, 0x3a, 0x15, 0xc5, 0xbd, 0x13,
-       0xf7, 0xb0, 0xbf, 0x50, 0x8f, 0x40, 0x37, 0xbe, 0xb3, 0x6f, 0xa3, 0x34,
-       0x03, 0xdf, 0xb3, 0x0a, 0xb8, 0x36, 0x39, 0x59, 0x39, 0xcd, 0x0b, 0x55,
-       0x7a, 0x78, 0xf2, 0x75, 0xf9, 0x81, 0x34, 0x41, 0x5a, 0xa0, 0x5c, 0x24,
-       0x6d, 0x50, 0x26, 0x3a, 0xfa, 0x6c, 0x03, 0xe9, 0xe1, 0x09, 0xdf, 0x8b,
-       0x70, 0xdf, 0xde, 0xc4, 0xe5, 0x49, 0x1b, 0xa4, 0xf9, 0xa4, 0x8e, 0xd7,
-       0xa7, 0xe5, 0x7b, 0x92, 0x6e, 0xeb, 0x86, 0x5d, 0xf6, 0x2f, 0xbb, 0xc6,
-       0xe6, 0xdc, 0xad, 0xa6, 0x39, 0xe8, 0x26, 0xe6, 0xd0, 0xf5, 0xca, 0xfb,
-       0x2a, 0x39, 0xe0, 0xe1, 0x5e, 0x28, 0xe5, 0x3b, 0x75, 0x5e, 0xe2, 0xee,
-       0xc2, 0x46, 0xb9, 0xc5, 0x8f, 0xd9, 0xb8, 0xfb, 0x41, 0xd0, 0xc1, 0xa2,
-       0x23, 0x27, 0xce, 0xe2, 0x3a, 0xe7, 0x70, 0xfd, 0xce, 0xfb, 0xe9, 0x94,
-       0x22, 0xb3, 0x7b, 0xd1, 0xc4, 0xa2, 0xf4, 0xb9, 0x13, 0xfa, 0x0c, 0xc8,
-       0x82, 0xd3, 0x74, 0xe2, 0xd0, 0x46, 0xe3, 0x4b, 0x03, 0x16, 0xaf, 0xd1,
-       0x1d, 0xa1, 0x2d, 0xe7, 0x07, 0x41, 0x96, 0x76, 0x83, 0x28, 0xed, 0x23,
-       0xc1, 0xe7, 0x43, 0x19, 0xe3, 0x13, 0x5b, 0x9d, 0xc6, 0x53, 0x2f, 0x5a,
-       0x5a, 0x91, 0x88, 0x1a, 0x7a, 0xc6, 0x69, 0x38, 0x71, 0x9c, 0x6b, 0xa6,
-       0xf3, 0xa4, 0x0d, 0x5d, 0x3d, 0xe7, 0x54, 0xe9, 0xea, 0x1b, 0xf6, 0xb7,
-       0x1a, 0x6a, 0x92, 0x74, 0xaa, 0x09, 0xf3, 0x1d, 0x2e, 0x84, 0x30, 0x7e,
-       0x1f, 0x70, 0x11, 0x1e, 0xd0, 0xed, 0xec, 0x9f, 0xe1, 0x5a, 0x02, 0x2c,
-       0xf7, 0x01, 0xee, 0xf3, 0x80, 0xf9, 0x02, 0x2e, 0xd5, 0x11, 0x91, 0x3f,
-       0x76, 0x22, 0xb3, 0xb5, 0xf0, 0x12, 0xc6, 0xd3, 0x16, 0xde, 0xd7, 0x82,
-       0xd5, 0x95, 0xc5, 0x81, 0x2e, 0xc0, 0x43, 0x38, 0x5f, 0x02, 0x8c, 0xb4,
-       0x5b, 0x9f, 0xc7, 0xb3, 0x0b, 0xf8, 0x5e, 0xb0, 0x30, 0x81, 0x1e, 0xa7,
-       0xff, 0x47, 0xf5, 0x77, 0x81, 0x76, 0xf4, 0x9f, 0xdb, 0xe7, 0xce, 0x55,
-       0x32, 0xa0, 0xc7, 0x21, 0x9e, 0xa7, 0x8a, 0x4b, 0xb4, 0x03, 0xc0, 0xf7,
-       0x3f, 0x94, 0xc8, 0xa9, 0x84, 0x1c, 0x2a, 0x70, 0x0f, 0xe8, 0x24, 0xf0,
-       0xa1, 0xcf, 0xa4, 0xa0, 0xce, 0x15, 0xb8, 0xa0, 0xec, 0x67, 0xb7, 0xe3,
-       0xea, 0xc5, 0xf5, 0x56, 0x5c, 0x20, 0x87, 0xd9, 0x13, 0xb8, 0xfa, 0xd0,
-       0xb7, 0x8a, 0x37, 0x09, 0x73, 0xa9, 0xbe, 0x8d, 0x36, 0xda, 0xb6, 0xcc,
-       0xa9, 0xa1, 0x01, 0xe0, 0x6f, 0x00, 0xb0, 0x25, 0x70, 0x31, 0xff, 0xf8,
-       0x87, 0x8e, 0x9c, 0x7a, 0x19, 0x17, 0x18, 0xec, 0x14, 0x08, 0xf3, 0xd4,
-       0x20, 0x2e, 0x28, 0xb1, 0x53, 0x69, 0x5c, 0x23, 0xb8, 0xfe, 0xd2, 0x31,
-       0x3c, 0xd7, 0x09, 0x7c, 0x85, 0x3c, 0x02, 0x9c, 0xaf, 0xe0, 0xb9, 0xaf,
-       0x3b, 0x6f, 0x9c, 0xe7, 0x7e, 0xe2, 0x18, 0x9e, 0x7b, 0xc5, 0xa9, 0xf2,
-       0xdc, 0x59, 0x47, 0x3d, 0xfc, 0x8c, 0x13, 0x79, 0x98, 0xbe, 0xc4, 0x59,
-       0xc7, 0xf0, 0x7f, 0x44, 0x86, 0xf7, 0x82, 0x96, 0x1e, 0x5e, 0xc0, 0x45,
-       0xba, 0x7a, 0x16, 0xe5, 0x2f, 0xac, 0x1a, 0xf7, 0xf9, 0x37, 0x31, 0xee,
-       0xab, 0x76, 0x5c, 0x51, 0xd5, 0x71, 0x2f, 0xa0, 0xef, 0x97, 0xec, 0xb8,
-       0x17, 0x6a, 0xc6, 0x05, 0xad, 0x3c, 0xbc, 0x84, 0x8b, 0x74, 0xf1, 0x22,
-       0xca, 0x43, 0x99, 0x80, 0x85, 0x6e, 0x6e, 0xd0, 0x67, 0x9d, 0xe2, 0x5e,
-       0xc3, 0xb2, 0x6e, 0x4c, 0xd7, 0xe8, 0x87, 0x37, 0xa2, 0x1f, 0x27, 0x8b,
-       0xb4, 0x11, 0x17, 0x6a, 0xe4, 0x02, 0x7d, 0xa3, 0x40, 0x8e, 0x69, 0x3f,
-       0x88, 0x3e, 0x11, 0xfd, 0xa3, 0xd5, 0xb6, 0xd5, 0x27, 0x75, 0xee, 0xd8,
-       0xaf, 0x15, 0x3a, 0xe5, 0xd3, 0x05, 0xda, 0x84, 0xa4, 0x97, 0x20, 0x98,
-       0xd8, 0x41, 0xfb, 0x34, 0x17, 0x5c, 0xe2, 0x91, 0x4e, 0x3c, 0xf7, 0x33,
-       0x6b, 0x75, 0x46, 0x69, 0x18, 0xbe, 0x7b, 0xe6, 0xe8, 0xaf, 0x40, 0x67,
-       0x34, 0x00, 0x6e, 0xd2, 0x5b, 0x87, 0xdc, 0x58, 0x52, 0x53, 0x9b, 0x25,
-       0x21, 0x37, 0x15, 0x1a, 0x61, 0xf7, 0x30, 0xaf, 0xaa, 0x59, 0xba, 0x77,
-       0xc4, 0x4c, 0xde, 0xb7, 0x1b, 0xc7, 0x6f, 0xd7, 0xe4, 0xa1, 0xc7, 0x13,
-       0x78, 0xff, 0x7b, 0x2e, 0xe5, 0x60, 0xdc, 0xbb, 0x56, 0xe7, 0xf4, 0x74,
-       0xed, 0xa0, 0xdd, 0x72, 0xbd, 0xd6, 0xe1, 0xd1, 0x35, 0x76, 0x92, 0xea,
-       0x70, 0xa5, 0x6a, 0xa3, 0x8d, 0x17, 0x52, 0x49, 0xc2, 0xf5, 0x90, 0x70,
-       0xff, 0xeb, 0x1e, 0xc9, 0xfb, 0xad, 0xf0, 0x0b, 0x18, 0x3b, 0x4f, 0xf5,
-       0xd2, 0x36, 0x9a, 0x9d, 0x76, 0x6d, 0x5e, 0xf4, 0x46, 0x79, 0x4e, 0x8f,
-       0xd3, 0xa8, 0x61, 0x34, 0x67, 0x25, 0xb8, 0x8f, 0x10, 0xd3, 0xe7, 0x73,
-       0x66, 0xcb, 0x2d, 0x5a, 0xef, 0xcc, 0x96, 0x99, 0x87, 0x0f, 0x7f, 0xaa,
-       0xcc, 0xbc, 0x7b, 0x5f, 0xdc, 0x77, 0xc2, 0xcf, 0x2d, 0x6f, 0x91, 0xf1,
-       0xe9, 0x75, 0xd2, 0xe8, 0xa9, 0xf8, 0x66, 0xc8, 0x47, 0xb6, 0xe9, 0xda,
-       0x01, 0xff, 0x70, 0x66, 0xab, 0x3c, 0x39, 0xc3, 0xbe, 0x3b, 0x64, 0x6e,
-       0x5e, 0x1c, 0xf7, 0x9d, 0xeb, 0x51, 0x07, 0x72, 0x7d, 0x07, 0xcb, 0x92,
-       0xb8, 0x8b, 0x72, 0xdf, 0x19, 0x95, 0x73, 0x03, 0x7c, 0x66, 0xee, 0xbf,
-       0x44, 0xd9, 0xdf, 0xb9, 0x81, 0x4e, 0x79, 0x7c, 0x1e, 0x34, 0x01, 0xb9,
-       0x3f, 0x72, 0x82, 0x30, 0x89, 0xec, 0x9a, 0x65, 0x2c, 0xbd, 0xdb, 0x65,
-       0xdc, 0x94, 0xfb, 0x34, 0xb7, 0x0c, 0x70, 0x2c, 0xe8, 0x25, 0xe8, 0xb8,
-       0xae, 0x1d, 0x46, 0x16, 0xa4, 0x67, 0x1b, 0x50, 0xce, 0x7e, 0xe1, 0x3f,
-       0xee, 0x65, 0x3f, 0x61, 0x5b, 0x85, 0x39, 0x35, 0x6a, 0x7a, 0x59, 0x5a,
-       0xa5, 0x3f, 0xce, 0xfc, 0x4c, 0xf6, 0x37, 0xfb, 0xe8, 0xd5, 0x7b, 0x21,
-       0xdc, 0x53, 0x36, 0xb6, 0x15, 0xd7, 0x44, 0xef, 0x29, 0xc0, 0xae, 0xba,
-       0x42, 0xdb, 0x17, 0x73, 0x15, 0xae, 0x20, 0x63, 0x51, 0xe1, 0x1a, 0x25,
-       0xe4, 0xd1, 0xe2, 0xf2, 0x3a, 0x6d, 0x69, 0x58, 0xb9, 0x4e, 0xa4, 0x15,
-       0x7f, 0xcc, 0xda, 0x1e, 0x8b, 0x92, 0x83, 0x5d, 0xd6, 0xab, 0xd7, 0x6c,
-       0x11, 0xb6, 0xac, 0x5d, 0x33, 0x6d, 0xcf, 0xe6, 0xc3, 0x35, 0x1b, 0x85,
-       0xc6, 0x29, 0xab, 0x4d, 0x5c, 0x33, 0x97, 0xf1, 0x6e, 0xe0, 0x3d, 0x87,
-       0x75, 0xca, 0x61, 0x8d, 0x72, 0xe5, 0x0e, 0x99, 0x3d, 0xa6, 0x3a, 0x1b,
-       0x44, 0x92, 0xe3, 0x5e, 0x87, 0x4c, 0xce, 0x33, 0x96, 0xb0, 0x05, 0x36,
-       0xd8, 0x56, 0x5c, 0x9d, 0x78, 0x66, 0x3b, 0xf0, 0x54, 0x59, 0xa1, 0x6d,
-       0xd3, 0x1a, 0x3b, 0xeb, 0x71, 0x8c, 0xcd, 0x1c, 0xe1, 0x27, 0x80, 0x87,
-       0x2a, 0xef, 0x4c, 0xd5, 0xc4, 0x9f, 0x38, 0x57, 0xad, 0x43, 0x31, 0xdf,
-       0xb8, 0x5e, 0x4f, 0x1d, 0x87, 0x2a, 0x36, 0xbe, 0x19, 0x7b, 0x2a, 0x41,
-       0x7b, 0x2a, 0x5b, 0x72, 0xcd, 0xf9, 0x80, 0x51, 0xf8, 0x4e, 0x5e, 0xef,
-       0x26, 0xd2, 0xfa, 0xd8, 0x0c, 0xe1, 0x8a, 0x85, 0x70, 0xad, 0x58, 0x33,
-       0x9e, 0xe7, 0x5a, 0x1b, 0xe7, 0x98, 0x5a, 0xce, 0x5f, 0x34, 0xb1, 0x7d,
-       0xc6, 0x51, 0x3a, 0xeb, 0xc0, 0x74, 0xa7, 0xb6, 0x61, 0x45, 0x8d, 0xc9,
-       0x81, 0x22, 0xcf, 0x82, 0x31, 0x9e, 0x78, 0x23, 0xe3, 0x49, 0xbd, 0xb3,
-       0xf2, 0x5e, 0x8c, 0xcd, 0x5c, 0x1d, 0x65, 0xe3, 0x37, 0x1b, 0x6c, 0x8e,
-       0x48, 0x6d, 0x0c, 0xc7, 0xe4, 0xf2, 0xac, 0xcc, 0x8b, 0x4e, 0x8d, 0x2e,
-       0x61, 0x9d, 0x7f, 0x5d, 0xef, 0x0d, 0x4a, 0x29, 0x02, 0xed, 0x37, 0x3e,
-       0x90, 0x1a, 0x34, 0xe7, 0x60, 0x92, 0xb2, 0xb3, 0x68, 0xe6, 0x7f, 0x5e,
-       0xe7, 0xf4, 0x98, 0xdc, 0x45, 0x93, 0xef, 0x73, 0x8f, 0x9c, 0x87, 0x0e,
-       0xaf, 0xae, 0x6d, 0x93, 0x4c, 0x02, 0x17, 0x59, 0xbd, 0x2f, 0x91, 0x94,
-       0xec, 0xc0, 0xc7, 0x37, 0xf1, 0x9c, 0x44, 0x0c, 0xeb, 0x93, 0x9f, 0xe1,
-       0xd9, 0x49, 0xf6, 0x7b, 0xb1, 0xbe, 0x28, 0x66, 0x99, 0x87, 0x0f, 0x59,
-       0xf9, 0xb6, 0xbe, 0x44, 0xb3, 0x7e, 0xbf, 0xce, 0xe6, 0x5b, 0x3b, 0x22,
-       0x37, 0x06, 0xf2, 0x87, 0x10, 0x9f, 0x8f, 0xd9, 0x39, 0x25, 0x75, 0xcc,
-       0x4a, 0x82, 0x73, 0x7e, 0xc2, 0xc6, 0x2c, 0x39, 0x97, 0x1b, 0x2c, 0x7d,
-       0x1b, 0xfb, 0xa7, 0x6a, 0x43, 0x9b, 0x7d, 0xbf, 0x27, 0xb5, 0x2c, 0xec,
-       0xb7, 0xb6, 0xb3, 0x8e, 0xf3, 0x1c, 0x17, 0x9d, 0x13, 0x10, 0xfa, 0x46,
-       0x3d, 0x35, 0x7e, 0x81, 0xf1, 0xe5, 0xf2, 0xd3, 0xf5, 0x64, 0x54, 0xd5,
-       0x27, 0xa4, 0x2f, 0x37, 0xb1, 0x8d, 0xdf, 0x2d, 0x08, 0x7d, 0xb9, 0x7e,
-       0xeb, 0xcb, 0xb5, 0x6a, 0x5f, 0xce, 0xc4, 0x1e, 0x5a, 0x97, 0x7d, 0xb9,
-       0xfc, 0x74, 0x0e, 0xb4, 0x12, 0x7e, 0x67, 0xc1, 0xd8, 0x42, 0x93, 0x05,
-       0x9e, 0x79, 0x69, 0x94, 0xec, 0xa8, 0x82, 0xdf, 0x60, 0x7c, 0x2c, 0xc6,
-       0x2a, 0x94, 0xfa, 0x96, 0xf5, 0x2f, 0x3a, 0x25, 0xdd, 0xbe, 0x0e, 0xf3,
-       0xbe, 0x53, 0xaf, 0xf9, 0x5c, 0xc1, 0xec, 0x7d, 0x66, 0xf7, 0x32, 0x26,
-       0xc4, 0x73, 0x4d, 0x9a, 0xbf, 0x92, 0xc3, 0x91, 0x5e, 0x63, 0xcf, 0x7a,
-       0xdf, 0x04, 0xde, 0x4f, 0x02, 0xe7, 0x31, 0x3b, 0x6e, 0x12, 0x30, 0x1d,
-       0xc0, 0xda, 0x5c, 0x6b, 0x65, 0x32, 0xc7, 0xde, 0xd3, 0xc4, 0xd8, 0xc0,
-       0x7c, 0x21, 0x8c, 0x11, 0x46, 0xec, 0x99, 0x4a, 0x2f, 0xd2, 0xe8, 0xad,
-       0xab, 0x6b, 0xab, 0x9e, 0x7e, 0x5d, 0xdd, 0x44, 0x5a, 0xba, 0x53, 0xe7,
-       0xb9, 0xac, 0x1f, 0x48, 0xed, 0xd1, 0x39, 0xf2, 0x3a, 0xc6, 0x98, 0x13,
-       0xe6, 0x94, 0x7d, 0x57, 0xde, 0xa1, 0x65, 0xfe, 0x01, 0x9f, 0xfa, 0x6b,
-       0x87, 0xfe, 0xdd, 0x38, 0x14, 0x04, 0xe7, 0x06, 0xee, 0x86, 0xad, 0xe2,
-       0xb9, 0xdf, 0x97, 0xee, 0xc4, 0xb0, 0xb6, 0x9d, 0xb0, 0x46, 0x7b, 0x9b,
-       0x65, 0x9d, 0x77, 0xb3, 0xcd, 0x99, 0xc9, 0x41, 0x6e, 0xa6, 0x60, 0x33,
-       0xf1, 0x4c, 0x70, 0x8f, 0x7d, 0x97, 0x0b, 0x9a, 0x41, 0x47, 0x1f, 0x13,
-       0x23, 0x63, 0xb2, 0x55, 0x19, 0xc3, 0x5c, 0x83, 0x34, 0x09, 0x39, 0x7a,
-       0x44, 0x52, 0xfc, 0xee, 0x07, 0xc7, 0xce, 0xcb, 0xa5, 0xd0, 0xcb, 0x6c,
-       0xa7, 0xbf, 0xd9, 0x83, 0x67, 0xee, 0xe1, 0x78, 0xee, 0x41, 0xe8, 0x96,
-       0xeb, 0xd7, 0xea, 0x96, 0x04, 0xfd, 0xfa, 0x6c, 0x89, 0xbe, 0xe1, 0x7a,
-       0xb4, 0xe9, 0x90, 0x8f, 0x4f, 0x77, 0xb7, 0x91, 0xb7, 0xc6, 0x20, 0xd7,
-       0xd5, 0xfd, 0xe1, 0x59, 0x20, 0x96, 0xf1, 0x3d, 0xfb, 0x6d, 0x92, 0xe4,
-       0xfb, 0x5d, 0xf9, 0x7c, 0x25, 0x95, 0x5c, 0x82, 0x6e, 0x1a, 0x73, 0x7e,
-       0xf1, 0x72, 0x13, 0x53, 0x7d, 0x7b, 0x9b, 0x39, 0x3b, 0xd0, 0x4c, 0x9b,
-       0xdd, 0xc6, 0x59, 0x6b, 0x69, 0x76, 0xc9, 0xca, 0xe3, 0x20, 0x68, 0x1e,
-       0xd0, 0x32, 0x78, 0x0f, 0x65, 0xf0, 0x01, 0xbf, 0xc7, 0xd0, 0xbe, 0xf6,
-       0x99, 0x02, 0xac, 0x23, 0xf0, 0x30, 0x10, 0x65, 0x7e, 0x9e, 0xe5, 0x4f,
-       0x2f, 0xbd, 0x68, 0xe5, 0x92, 0x72, 0xd6, 0xf2, 0xa5, 0xba, 0x2a, 0xb6,
-       0x42, 0xe6, 0x1e, 0x9a, 0xa6, 0x3e, 0xf6, 0x17, 0xbe, 0x0b, 0x39, 0x95,
-       0xd5, 0x78, 0xe8, 0x90, 0xfb, 0xa6, 0x25, 0x7d, 0x1e, 0xba, 0x2a, 0x3f,
-       0xbf, 0x92, 0x37, 0xd7, 0xf6, 0xc7, 0xb9, 0x7e, 0xb8, 0xcd, 0xf8, 0xb6,
-       0x2b, 0xe7, 0xba, 0x80, 0xb9, 0xa6, 0xf5, 0x5c, 0xb9, 0x6f, 0xf3, 0x31,
-       0x3b, 0xd7, 0xf5, 0xe1, 0x5c, 0x07, 0x57, 0xce, 0x35, 0xf4, 0xed, 0x43,
-       0xb9, 0x9b, 0xd4, 0xf9, 0xf2, 0x3a, 0x4f, 0x7b, 0x7a, 0xbd, 0x0c, 0x97,
-       0x5a, 0xad, 0xbc, 0x74, 0xa1, 0x7b, 0x98, 0xc3, 0xbe, 0x70, 0xaf, 0x2b,
-       0x16, 0x67, 0x8a, 0x78, 0xa0, 0xac, 0x6d, 0xd3, 0x67, 0x6c, 0x66, 0xe1,
-       0x5f, 0xdd, 0x5a, 0x60, 0xdd, 0xf0, 0xfd, 0xc5, 0x62, 0xc7, 0xa1, 0x4f,
-       0x4d, 0xbf, 0xa9, 0x77, 0x4d, 0x4c, 0xc1, 0xc4, 0x87, 0x19, 0x17, 0x36,
-       0x67, 0x7f, 0x99, 0x8b, 0x78, 0x07, 0x78, 0xea, 0x53, 0x85, 0xd4, 0x60,
-       0x26, 0x42, 0x39, 0x7a, 0x5c, 0x0e, 0x55, 0x46, 0xa4, 0x4b, 0x9f, 0xff,
-       0x7c, 0xdd, 0xd8, 0x71, 0xba, 0x36, 0x76, 0xcc, 0x74, 0x02, 0xc6, 0x8e,
-       0xf7, 0xfc, 0x0c, 0xb1, 0x63, 0x71, 0x4c, 0xec, 0xb8, 0x9e, 0x7f, 0x35,
-       0x55, 0x3c, 0x8e, 0x79, 0x35, 0x43, 0x96, 0x2c, 0x3a, 0xd9, 0xf9, 0x16,
-       0xdc, 0xcf, 0xe2, 0x1e, 0xc3, 0xfd, 0x3c, 0xee, 0x2e, 0xee, 0x17, 0x70,
-       0x8f, 0xcb, 0xd4, 0xb2, 0xce, 0x38, 0x0e, 0xb9, 0x41, 0x5d, 0xc6, 0xb6,
-       0xc6, 0x1f, 0x98, 0x2b, 0xb7, 0xf3, 0x7b, 0x2d, 0xce, 0xec, 0x3c, 0xe7,
-       0xd0, 0x2a, 0x93, 0xd3, 0x94, 0xd9, 0x6d, 0x52, 0x9a, 0x0e, 0x6d, 0xdb,
-       0x9f, 0xef, 0xe0, 0x9e, 0xc1, 0x98, 0x84, 0xb6, 0xeb, 0x3d, 0x1d, 0x66,
-       0xaf, 0xf1, 0x3b, 0x58, 0xe3, 0x8d, 0x58, 0x83, 0x93, 0x72, 0x7e, 0x66,
-       0xe3, 0x0a, 0x1b, 0x36, 0x69, 0x63, 0x82, 0x33, 0x56, 0xf7, 0xd6, 0x97,
-       0x11, 0xb5, 0xeb, 0x9f, 0xb0, 0x67, 0xcb, 0xc2, 0x1c, 0xa1, 0xa4, 0x5e,
-       0x9f, 0xd1, 0xca, 0x71, 0x8c, 0x37, 0x28, 0xe9, 0x19, 0xce, 0x73, 0xf9,
-       0x9b, 0x11, 0x90, 0x87, 0x27, 0xa0, 0x57, 0x57, 0xd0, 0x25, 0xe8, 0x96,
-       0x73, 0x73, 0x40, 0xbb, 0x8f, 0xca, 0x6c, 0x89, 0xf0, 0xf5, 0x24, 0x22,
-       0xfa, 0xac, 0x19, 0x9e, 0x67, 0x4c, 0x8e, 0xfb, 0x70, 0x25, 0x3c, 0x67,
-       0xb6, 0x89, 0x67, 0x07, 0x57, 0x9d, 0x35, 0xb3, 0xfa, 0x59, 0xdb, 0x0e,
-       0x3c, 0x73, 0x16, 0xce, 0xa1, 0x1e, 0x3d, 0x05, 0x32, 0xa9, 0xf3, 0xce,
-       0x36, 0xcb, 0x63, 0x0f, 0x2e, 0xe7, 0xbc, 0xb6, 0xc1, 0x46, 0xe9, 0x84,
-       0x89, 0x3c, 0x1a, 0x1d, 0xea, 0x81, 0x8f, 0xc7, 0x3c, 0x99, 0x9e, 0xc4,
-       0x6d, 0x3a, 0x17, 0xb9, 0x7a, 0xee, 0xaf, 0x9a, 0x8f, 0x1c, 0x9e, 0xb3,
-       0x4a, 0xe8, 0xef, 0x5a, 0xec, 0xd4, 0xe5, 0x71, 0xcc, 0x87, 0xfb, 0x7e,
-       0x1a, 0x0f, 0x09, 0x7e, 0xa7, 0xeb, 0x29, 0xe0, 0x60, 0xb2, 0xf2, 0x6d,
-       0xd0, 0xbb, 0x63, 0xcf, 0x9c, 0x91, 0xc6, 0x06, 0x64, 0xa2, 0x9c, 0x70,
-       0x26, 0xca, 0x03, 0xce, 0xbe, 0xb2, 0x7d, 0x37, 0xb0, 0x67, 0xb3, 0x34,
-       0xe3, 0xf7, 0x4c, 0x97, 0x33, 0x06, 0x7c, 0xe5, 0x8b, 0xdd, 0x4e, 0x5a,
-       0xdf, 0x3d, 0x7b, 0x87, 0x1c, 0xc0, 0x5a, 0x0d, 0xcf, 0xc4, 0xb5, 0x9c,
-       0xaf, 0x7e, 0x5b, 0x2a, 0x5c, 0x57, 0x7e, 0x13, 0x89, 0x7c, 0x7c, 0x5c,
-       0x7f, 0xe7, 0xc8, 0xd8, 0x0e, 0x27, 0xd1, 0xdf, 0x71, 0x1b, 0x13, 0xef,
-       0x73, 0xb2, 0xba, 0x1f, 0xb3, 0x1e, 0xf9, 0xe2, 0x09, 0xdc, 0x57, 0x9f,
-       0x79, 0x0e, 0xf5, 0x8c, 0x85, 0xbb, 0x10, 0xdc, 0x63, 0xe4, 0xd5, 0x71,
-       0x99, 0xaa, 0x30, 0x7f, 0xc4, 0xd1, 0x7c, 0x34, 0x59, 0x3e, 0x00, 0x9d,
-       0xb4, 0xf2, 0xcc, 0xdf, 0xce, 0xea, 0x3a, 0x24, 0x67, 0x84, 0xb0, 0x70,
-       0x0d, 0x56, 0x9e, 0x87, 0xbf, 0xf8, 0xbf, 0x70, 0x5f, 0xd1, 0xc8, 0x50,
-       0x0b, 0x47, 0x9a, 0xf2, 0xce, 0xc8, 0x95, 0x69, 0x39, 0x08, 0x78, 0x0e,
-       0xe3, 0x52, 0xf7, 0xf3, 0x3b, 0x2c, 0xf3, 0x92, 0x9f, 0xbb, 0x4f, 0xd4,
-       0x43, 0xe7, 0x9d, 0xe8, 0x43, 0x07, 0x25, 0xf2, 0xd0, 0xa2, 0xd3, 0xf0,
-       0x50, 0xb7, 0xf6, 0xcb, 0x77, 0xfb, 0xdd, 0x89, 0x7d, 0x72, 0x52, 0xa2,
-       0xf7, 0x2b, 0x7d, 0xfe, 0x2b, 0xef, 0x32, 0xc6, 0x77, 0x52, 0x22, 0xf7,
-       0xc7, 0xec, 0xd9, 0x51, 0x13, 0xd7, 0x5b, 0xd2, 0x7c, 0xff, 0x9b, 0x71,
-       0xe2, 0x6c, 0x49, 0x8e, 0x6b, 0xde, 0x19, 0x86, 0x9e, 0xc8, 0x94, 0x92,
-       0xcb, 0x75, 0x4c, 0xbe, 0xe7, 0xf3, 0x9b, 0x0d, 0xbf, 0xb0, 0x4e, 0x8f,
-       0xc3, 0xef, 0x38, 0x18, 0x9d, 0x91, 0xb9, 0x2c, 0xcc, 0xfd, 0x34, 0x6b,
-       0xca, 0xf7, 0x67, 0xb1, 0x86, 0x3d, 0x58, 0x2f, 0x8e, 0xe7, 0xe8, 0xfd,
-       0x5c, 0x9e, 0x9d, 0x75, 0xa5, 0x2f, 0xd1, 0xb4, 0x6c, 0x07, 0xb1, 0xee,
-       0x7d, 0xd2, 0x04, 0xb8, 0xd5, 0x43, 0x79, 0x63, 0xd7, 0x09, 0xe9, 0x54,
-       0x20, 0xb9, 0x49, 0xb3, 0x3d, 0x83, 0xbb, 0xf5, 0x1a, 0xde, 0x6b, 0x69,
-       0x66, 0x9d, 0xb1, 0x1f, 0xf1, 0x6c, 0xe8, 0x22, 0x2f, 0xbb, 0xa6, 0x7f,
-       0x08, 0x3d, 0xcf, 0x7d, 0x17, 0x6d, 0x2f, 0xd6, 0xb1, 0x05, 0xc9, 0x4b,
-       0xcf, 0x58, 0xbf, 0x32, 0x08, 0xa6, 0x7d, 0x1f, 0x78, 0xac, 0xe7, 0x4b,
-       0x6e, 0x71, 0xe6, 0x4a, 0x5b, 0x9d, 0xd9, 0x52, 0x20, 0x13, 0x3e, 0xbf,
-       0xe3, 0xc1, 0x1c, 0x00, 0xda, 0x5b, 0x2c, 0xeb, 0x86, 0x6e, 0xfd, 0xeb,
-       0xcd, 0x3c, 0x8f, 0x74, 0x93, 0xf7, 0xa2, 0x98, 0x7a, 0xc4, 0x31, 0x7d,
-       0xe4, 0xee, 0xe3, 0x59, 0xe1, 0xf7, 0x34, 0xfa, 0x12, 0x71, 0xfd, 0x5d,
-       0x8f, 0xcf, 0xa1, 0x1d, 0xc6, 0x28, 0x72, 0xdc, 0x67, 0x9d, 0x59, 0xc8,
-       0xb3, 0xb9, 0x69, 0x9e, 0xe1, 0x67, 0x3e, 0x6d, 0xa4, 0x53, 0xc9, 0x15,
-       0xee, 0xa4, 0xfd, 0x06, 0x5c, 0x0e, 0x2e, 0x50, 0x44, 0x97, 0xf5, 0xb9,
-       0xe3, 0xcb, 0xdf, 0x85, 0x0b, 0xcb, 0xc2, 0xef, 0xc3, 0x29, 0x9d, 0x3b,
-       0x0d, 0x5f, 0xf6, 0xb1, 0x31, 0xf9, 0x89, 0x33, 0x5f, 0x78, 0xc5, 0x79,
-       0xb4, 0x90, 0xbe, 0xea, 0x12, 0xd0, 0xc7, 0x39, 0xbf, 0x97, 0xf2, 0x0b,
-       0x36, 0x5f, 0x41, 0x72, 0x95, 0x09, 0x99, 0xe9, 0xe8, 0x76, 0xef, 0xd7,
-       0x6b, 0x33, 0x03, 0x9c, 0x7d, 0x1b, 0xeb, 0xf7, 0xc9, 0x38, 0xf5, 0xdb,
-       0x78, 0x41, 0x81, 0x97, 0xd5, 0xcf, 0xe3, 0x82, 0x6d, 0xdb, 0xa8, 0x6d,
-       0x94, 0x7d, 0x3e, 0xeb, 0x6d, 0x75, 0x86, 0x4b, 0x5b, 0xb0, 0x8e, 0x7b,
-       0xa1, 0x3f, 0x1d, 0xd8, 0x69, 0xa0, 0x6d, 0x94, 0x4d, 0x02, 0x07, 0xe3,
-       0xbe, 0x91, 0xe7, 0xc3, 0x92, 0xd3, 0x3e, 0x9e, 0xb9, 0xa7, 0x95, 0x89,
-       0x99, 0x05, 0xc1, 0x1c, 0xec, 0x83, 0x6c, 0x7f, 0x09, 0xbc, 0xf0, 0x08,
-       0xae, 0xb7, 0xdb, 0x3d, 0xed, 0x17, 0x2e, 0xb2, 0xa7, 0xed, 0xca, 0xc9,
-       0x8a, 0x3e, 0xd7, 0xae, 0xf3, 0xab, 0x92, 0xea, 0xbf, 0x5f, 0xa2, 0xd7,
-       0x4a, 0xf5, 0xe8, 0x9c, 0xb4, 0xb4, 0x7c, 0x38, 0x6e, 0xf4, 0x30, 0x61,
-       0x4a, 0x02, 0x9e, 0xad, 0xc0, 0x05, 0xe1, 0x31, 0x6d, 0x44, 0x6d, 0xba,
-       0x94, 0xfa, 0x70, 0x49, 0x3e, 0x12, 0x0f, 0xcf, 0x14, 0xa0, 0x1f, 0xc8,
-       0xb8, 0x8f, 0x5d, 0x6a, 0xf4, 0xe4, 0xe6, 0x3a, 0xfd, 0x84, 0x73, 0x73,
-       0xec, 0xdc, 0x48, 0xb7, 0x7f, 0x96, 0xa0, 0x4f, 0xb1, 0x24, 0x4d, 0xab,
-       0xea, 0x33, 0xa6, 0xbf, 0xe1, 0x72, 0x73, 0x46, 0x81, 0x75, 0x5d, 0xd8,
-       0xa6, 0xb4, 0x73, 0x89, 0x47, 0xbd, 0x6e, 0x05, 0x25, 0x3c, 0x67, 0x00,
-       0x6e, 0xae, 0x5c, 0xe1, 0xbe, 0x43, 0x91, 0x0e, 0x43, 0x5c, 0x7f, 0x5b,
-       0xf3, 0xc9, 0x78, 0x81, 0xb1, 0x95, 0x47, 0x83, 0xf4, 0x28, 0x79, 0x8c,
-       0x7d, 0xf0, 0x7d, 0x41, 0xc7, 0x73, 0xf7, 0xfa, 0x8c, 0x15, 0x75, 0x1f,
-       0xbf, 0x43, 0x85, 0x72, 0x0a, 0xfa, 0xb7, 0xb8, 0xe8, 0xf0, 0x1b, 0x78,
-       0x37, 0x0a, 0xee, 0xf3, 0x8b, 0xce, 0x77, 0xa7, 0x9f, 0xc5, 0x73, 0x83,
-       0xfd, 0xee, 0x9d, 0xd1, 0x53, 0x22, 0xc5, 0x70, 0xbe, 0x89, 0x1c, 0xd6,
-       0xfe, 0x02, 0xd6, 0xbe, 0xfe, 0x77, 0xee, 0xf0, 0xae, 0x8c, 0x77, 0xe5,
-       0x0f, 0x07, 0xe9, 0x36, 0xd2, 0x22, 0xe9, 0xef, 0xb5, 0xfc, 0xe6, 0x41,
-       0xcd, 0x17, 0x93, 0xc5, 0xc7, 0xc1, 0x17, 0x69, 0xee, 0x37, 0x07, 0x0f,
-       0xfb, 0x37, 0x80, 0x2f, 0xf6, 0xc8, 0xef, 0xc3, 0x2e, 0xf8, 0xdd, 0xca,
-       0x10, 0xf8, 0x63, 0x10, 0xfc, 0x32, 0x00, 0x1e, 0xf1, 0xb5, 0x8d, 0xfc,
-       0x04, 0xf4, 0x1f, 0xf4, 0x9a, 0xb3, 0xaf, 0xd4, 0xe5, 0x64, 0x4b, 0x9e,
-       0x33, 0x51, 0xe2, 0xf7, 0x5a, 0xd4, 0x5b, 0x1b, 0x24, 0x9a, 0x98, 0x13,
-       0xf2, 0x42, 0x37, 0x73, 0x1c, 0xdb, 0x81, 0xab, 0x53, 0xc4, 0xd5, 0x5c,
-       0xa5, 0xcf, 0xbd, 0x04, 0x3c, 0xd1, 0xae, 0x79, 0xa2, 0xd5, 0x49, 0xbb,
-       0x37, 0x58, 0x9e, 0x78, 0x11, 0x3c, 0x71, 0x7e, 0x0d, 0x4f, 0x3c, 0x6d,
-       0xe9, 0x7f, 0xa1, 0x86, 0x27, 0xe6, 0x6c, 0xd9, 0xcc, 0x45, 0x78, 0xe2,
-       0x52, 0x2f, 0xf5, 0xa5, 0x31, 0x79, 0x15, 0x3c, 0x21, 0x8a, 0x3c, 0x71,
-       0xa9, 0xe6, 0x09, 0xc6, 0x8e, 0xc8, 0x17, 0x9d, 0x90, 0x23, 0xe4, 0x8b,
-       0xb3, 0xb2, 0x04, 0xbe, 0x78, 0x5e, 0x71, 0xec, 0x19, 0xda, 0x0a, 0x25,
-       0xfa, 0x64, 0x27, 0x8a, 0x5d, 0xe0, 0x77, 0x25, 0xff, 0x65, 0x3a, 0x08,
-       0x16, 0xe1, 0xa7, 0x3f, 0x08, 0x7b, 0x3e, 0xaa, 0xbf, 0xa9, 0xb8, 0x00,
-       0xba, 0x0f, 0xe9, 0x7d, 0xc2, 0x01, 0xbd, 0x1f, 0x9e, 0xc5, 0x1c, 0x26,
-       0xd4, 0x7f, 0x86, 0x2f, 0xec, 0x62, 0x5d, 0x69, 0xe7, 0x1f, 0xd3, 0x3c,
-       0xd4, 0x00, 0x7d, 0xf0, 0xe8, 0x00, 0x63, 0x4d, 0x9e, 0xbb, 0x4f, 0x75,
-       0xe7, 0x46, 0x00, 0x73, 0x44, 0xdd, 0x2f, 0x8c, 0x73, 0xb4, 0xad, 0xb2,
-       0xf3, 0x29, 0x23, 0x46, 0x21, 0xeb, 0xcc, 0xbb, 0x5c, 0xd0, 0x04, 0x9b,
-       0xb4, 0x49, 0x19, 0x1b, 0x5d, 0xed, 0x48, 0xb9, 0x1f, 0x84, 0x00, 0x6d,
-       0x84, 0xbd, 0xb0, 0x0b, 0xab, 0x3d, 0x52, 0xa8, 0xb5, 0xf1, 0xff, 0x03,
-       0x6c, 0x7c, 0xb6, 0x91, 0xa8, 0xb1, 0xf1, 0x7f, 0xcd, 0xf2, 0x1a, 0x7f,
-       0xbb, 0xda, 0xde, 0x3f, 0x00, 0xf8, 0x76, 0x2f, 0xdb, 0xfb, 0xec, 0x83,
-       0x76, 0x87, 0xc8, 0xf5, 0xb0, 0xf9, 0xde, 0x0d, 0x1e, 0xbc, 0x01, 0xbe,
-       0xd4, 0x7b, 0x0a, 0xae, 0xec, 0x29, 0xb4, 0xc3, 0xe7, 0xee, 0x94, 0xf7,
-       0x4e, 0x6f, 0x95, 0x9d, 0x25, 0xff, 0x12, 0x69, 0xee, 0x80, 0x8d, 0x5a,
-       0x00, 0x9c, 0x11, 0x2b, 0xb7, 0xcf, 0x02, 0x6f, 0xdd, 0xc9, 0x9f, 0xa8,
-       0x17, 0xad, 0x5d, 0xc4, 0xb3, 0x8e, 0xf5, 0xfa, 0x89, 0xa3, 0x3d, 0x63,
-       0x29, 0x1d, 0x72, 0xea, 0x18, 0xbd, 0xaf, 0x24, 0xec, 0x72, 0x1f, 0x36,
-       0xc9, 0x16, 0xf4, 0xc7, 0x78, 0xf2, 0x46, 0x79, 0xfa, 0xaa, 0xe8, 0x5d,
-       0x59, 0xcd, 0x87, 0x9d, 0x4e, 0x66, 0x1a, 0x3e, 0xc0, 0xde, 0x18, 0xe6,
-       0xa0, 0xda, 0x37, 0xcb, 0x75, 0xb2, 0x53, 0xcf, 0x67, 0x46, 0x0e, 0x42,
-       0x37, 0xff, 0x41, 0x61, 0xa7, 0x2c, 0x8d, 0xb6, 0xe1, 0x39, 0x26, 0x4f,
-       0x17, 0xfa, 0xe0, 0xfb, 0xbc, 0x0b, 0x38, 0x6a, 0xc4, 0x73, 0xa3, 0x0c,
-       0x5f, 0x42, 0x5e, 0x6d, 0x91, 0x45, 0x94, 0xbf, 0x5b, 0x7e, 0xc1, 0x96,
-       0xb3, 0x8c, 0xbc, 0xd1, 0x82, 0xb6, 0x31, 0x39, 0x57, 0xa0, 0x5d, 0xa9,
-       0x79, 0x62, 0xf0, 0x7b, 0xd2, 0x97, 0xfe, 0x1e, 0xec, 0xd4, 0xb3, 0xb8,
-       0x9e, 0x91, 0xd4, 0x9e, 0x71, 0xa7, 0x2f, 0xd9, 0xed, 0x40, 0x77, 0xe2,
-       0x8a, 0x3a, 0x7d, 0x6e, 0xa3, 0x73, 0x85, 0xed, 0xa3, 0x41, 0x9e, 0xd9,
-       0xab, 0x12, 0x2d, 0x58, 0x93, 0xed, 0x4e, 0x8f, 0x2d, 0xe3, 0x73, 0xca,
-       0x78, 0x40, 0xa7, 0xd4, 0x96, 0x0d, 0x22, 0x5d, 0x2d, 0xb0, 0x79, 0x26,
-       0x44, 0xb5, 0xb7, 0x48, 0x54, 0xba, 0x67, 0x55, 0x27, 0xca, 0x3c, 0x5b,
-       0x16, 0x6f, 0x81, 0x7e, 0x40, 0x59, 0x07, 0xca, 0xb6, 0xd9, 0xb2, 0xb6,
-       0x16, 0x69, 0x44, 0xd9, 0x8c, 0xe6, 0xf9, 0xf3, 0x3d, 0x9e, 0x9b, 0x75,
-       0x9a, 0xa5, 0xeb, 0x44, 0x0b, 0x64, 0xc3, 0x46, 0x59, 0xbc, 0xaa, 0x49,
-       0xba, 0xf0, 0x8e, 0x71, 0x6e, 0xff, 0x44, 0x4c, 0xae, 0x3d, 0xd1, 0x9d,
-       0xf8, 0x38, 0xe6, 0xd0, 0x7d, 0x8a, 0x71, 0xef, 0xfc, 0x25, 0x8c, 0xfb,
-       0x74, 0x9d, 0xe2, 0xbd, 0x49, 0xcb, 0x1f, 0xe2, 0xc3, 0x7c, 0x93, 0x88,
-       0x32, 0xf9, 0x24, 0xfc, 0x5c, 0xea, 0xf0, 0x6e, 0xfb, 0xfd, 0x8c, 0xe3,
-       0x97, 0xd0, 0x6f, 0x9b, 0xa5, 0x5d, 0x52, 0x24, 0x3f, 0x52, 0x0f, 0xe1,
-       0x3e, 0xe3, 0x48, 0xbe, 0x2a, 0xb3, 0xe6, 0xc9, 0x57, 0xc7, 0x14, 0x73,
-       0x59, 0x50, 0x56, 0xf9, 0xc5, 0xc0, 0xac, 0x31, 0x79, 0xc1, 0xc8, 0xa5,
-       0x0f, 0x18, 0xb9, 0xf4, 0xd8, 0x99, 0x15, 0x72, 0xe9, 0xbc, 0x96, 0x4b,
-       0x7b, 0x05, 0xf7, 0xf9, 0xf3, 0x90, 0x4b, 0x2f, 0xe2, 0xd9, 0xd5, 0x72,
-       0x29, 0x2e, 0xd6, 0x5e, 0x96, 0xaf, 0xea, 0xf1, 0xe7, 0x8a, 0x51, 0x6d,
-       0x57, 0xe5, 0x67, 0x60, 0x93, 0x14, 0xa7, 0xac, 0xfe, 0x96, 0xa1, 0x36,
-       0xe9, 0x19, 0xfc, 0xa9, 0x84, 0x36, 0xe7, 0x7f, 0xba, 0x84, 0xdf, 0xee,
-       0x7c, 0x5e, 0x51, 0x86, 0xbd, 0x0a, 0x19, 0x26, 0xaa, 0xbe, 0x0c, 0xc3,
-       0xbb, 0x32, 0xde, 0x95, 0xd9, 0xef, 0x8f, 0x7e, 0x3a, 0xe6, 0x52, 0x7e,
-       0x50, 0x66, 0x40, 0x26, 0x15, 0x21, 0x93, 0x8a, 0x90, 0x53, 0x45, 0xc8,
-       0x25, 0xd8, 0x6c, 0x67, 0x8a, 0x90, 0x4b, 0x45, 0xc8, 0x25, 0xc8, 0xb8,
-       0x27, 0x20, 0xe3, 0x8c, 0x4c, 0x1b, 0x85, 0x4c, 0x9b, 0x91, 0xfb, 0xac,
-       0xae, 0x37, 0xb1, 0x92, 0x7e, 0xeb, 0x23, 0x0d, 0xe8, 0x18, 0xf2, 0x99,
-       0x9a, 0xd8, 0xe0, 0x8d, 0x47, 0x34, 0xbf, 0xbb, 0x9e, 0xba, 0xc2, 0x61,
-       0x0e, 0xcd, 0x4f, 0xb4, 0xff, 0xbe, 0x9d, 0xbf, 0xa5, 0x09, 0x7c, 0xfd,
-       0x03, 0xcb, 0xd7, 0xdb, 0x97, 0xf9, 0x3a, 0xe5, 0x30, 0x56, 0x5c, 0x9f,
-       0xaf, 0x3b, 0xec, 0xbb, 0x5c, 0xb0, 0x0e, 0x7c, 0xbd, 0x6e, 0x15, 0x5f,
-       0xc7, 0xc0, 0xd7, 0x7b, 0xd6, 0xf0, 0xf5, 0x06, 0x67, 0x58, 0xb7, 0xe1,
-       0x19, 0x09, 0x3e, 0x37, 0x3a, 0x55, 0xbe, 0xbe, 0x47, 0xf3, 0xf5, 0x21,
-       0xf0, 0xf5, 0x75, 0x35, 0x7c, 0xbd, 0x47, 0x52, 0x37, 0x67, 0x22, 0x5b,
-       0x65, 0xfc, 0x7e, 0xd5, 0xbe, 0x49, 0xfe, 0x49, 0x4c, 0x7b, 0xc3, 0x63,
-       0xc3, 0xd3, 0xed, 0x92, 0x7d, 0xe8, 0x15, 0x94, 0x91, 0xcf, 0x52, 0x63,
-       0x69, 0xc7, 0x95, 0x83, 0x47, 0x7e, 0x22, 0x0b, 0x9a, 0xb7, 0x44, 0x26,
-       0x8e, 0xc4, 0x64, 0xf2, 0x08, 0xe3, 0x10, 0x7f, 0x63, 0xe9, 0xbd, 0x49,
-       0x26, 0xf7, 0x32, 0x6f, 0x2e, 0x2a, 0xe3, 0x47, 0xe0, 0x6f, 0x1d, 0x61,
-       0x1c, 0xe2, 0xa5, 0x65, 0x1e, 0x5b, 0x80, 0x6c, 0x19, 0x3f, 0xc2, 0xb5,
-       0x8e, 0xa1, 0x9f, 0x16, 0x39, 0x74, 0x44, 0xe4, 0xb6, 0x23, 0x51, 0xf9,
-       0xe8, 0x91, 0x65, 0x5e, 0x1b, 0x0d, 0x79, 0xed, 0x59, 0xf0, 0x5a, 0xb7,
-       0xe5, 0x35, 0xb5, 0xcc, 0x6b, 0x7f, 0x5a, 0xc3, 0x6b, 0x6c, 0x4f, 0x5e,
-       0x7b, 0xce, 0x96, 0xf1, 0x39, 0x2a, 0xfb, 0x8e, 0x74, 0xca, 0xf8, 0x43,
-       0x6f, 0x91, 0x89, 0xfb, 0x09, 0xab, 0xf9, 0x8e, 0x13, 0x6d, 0xb1, 0x99,
-       0x4a, 0x37, 0xfa, 0x0f, 0x73, 0x88, 0xf4, 0xf7, 0x10, 0x7a, 0x67, 0x25,
-       0x95, 0xe3, 0x78, 0x8d, 0xf0, 0xa3, 0x4f, 0xc0, 0xbf, 0xd8, 0x07, 0x98,
-       0x6e, 0x39, 0x22, 0xa9, 0xa8, 0xbc, 0x2c, 0x53, 0xfe, 0x27, 0x2e, 0x37,
-       0xf6, 0x04, 0x6c, 0x11, 0x6d, 0xfb, 0xa4, 0x25, 0xfb, 0xce, 0x40, 0xfb,
-       0x18, 0xa5, 0xb2, 0x30, 0x16, 0xc0, 0xb8, 0xb9, 0x63, 0xbe, 0xc7, 0xc4,
-       0xfc, 0xc7, 0x06, 0x7d, 0xe6, 0x45, 0xc7, 0x6c, 0x07, 0xf8, 0x9e, 0xcf,
-       0xb0, 0x67, 0xf4, 0x59, 0x43, 0xb6, 0x7f, 0x44, 0x7f, 0x1b, 0x91, 0x31,
-       0xf5, 0x7c, 0x99, 0xdf, 0xb0, 0x81, 0xff, 0x59, 0xe6, 0xb7, 0xb0, 0xf6,
-       0xb7, 0x9b, 0xf8, 0x2c, 0xf9, 0xee, 0x87, 0x0e, 0xbf, 0x5d, 0x35, 0xa5,
-       0x73, 0xbd, 0xf0, 0xbb, 0xcc, 0x67, 0xd6, 0x7f, 0x84, 0xf1, 0x8e, 0x64,
-       0x52, 0xbd, 0xf7, 0x72, 0xe6, 0x1e, 0xec, 0x9d, 0x67, 0xdd, 0xad, 0x96,
-       0x47, 0xb7, 0x6a, 0xbf, 0x83, 0x36, 0xd6, 0x78, 0xe9, 0x45, 0xc9, 0xd3,
-       0x36, 0x19, 0xdd, 0xea, 0xe4, 0x66, 0x92, 0x97, 0x1b, 0xfb, 0x79, 0xdd,
-       0xa5, 0xcc, 0x3b, 0x4c, 0xab, 0xb5, 0x32, 0xf9, 0x84, 0x84, 0x32, 0x39,
-       0x75, 0x33, 0xbf, 0xb7, 0x9b, 0x3d, 0xa2, 0xbf, 0x2f, 0x95, 0xec, 0x56,
-       0x9c, 0xd3, 0xa7, 0x21, 0x5f, 0x43, 0x5a, 0x48, 0xc8, 0x27, 0x8f, 0x90,
-       0x1e, 0x54, 0xbc, 0x55, 0x3e, 0x61, 0xe9, 0x61, 0x46, 0x0a, 0x90, 0x3b,
-       0x47, 0x8e, 0x7c, 0x54, 0x66, 0x6e, 0x5c, 0x4d, 0x0f, 0x13, 0x55, 0x7a,
-       0x88, 0xc3, 0x3e, 0x73, 0x6a, 0xe9, 0xe1, 0x97, 0x97, 0xe9, 0x61, 0xc6,
-       0xf9, 0xe7, 0xd2, 0xc3, 0xf5, 0x2b, 0xe8, 0x61, 0x4a, 0xd3, 0xc3, 0xce,
-       0x65, 0x7a, 0x98, 0x3a, 0xc2, 0x71, 0xf5, 0xde, 0xa8, 0xbb, 0xe8, 0x70,
-       0xcd, 0x97, 0x69, 0x21, 0x39, 0xa9, 0xf3, 0xf5, 0x53, 0x39, 0x9e, 0x6f,
-       0xda, 0xa0, 0x18, 0x27, 0xa9, 0xae, 0x7f, 0xeb, 0xbf, 0xe8, 0xfa, 0xbf,
-       0xfc, 0xff, 0x79, 0xfd, 0xd5, 0xa5, 0xcc, 0xdd, 0xe7, 0x99, 0x55, 0x23,
-       0x8f, 0x43, 0x7a, 0x88, 0x5d, 0x6a, 0xf4, 0x02, 0xd7, 0x98, 0xcf, 0x90,
-       0x67, 0x90, 0x7f, 0x67, 0x20, 0xff, 0x9e, 0x84, 0xfc, 0x3b, 0xbd, 0x62,
-       0x4f, 0x60, 0xd0, 0xc6, 0x23, 0x02, 0x39, 0xe8, 0x57, 0xf1, 0xb1, 0x38,
-       0x40, 0x7c, 0x98, 0xfc, 0x13, 0xe6, 0xfe, 0xae, 0xc4, 0x49, 0x54, 0xe7,
-       0x1c, 0x3d, 0xea, 0xd7, 0xe2, 0x84, 0x70, 0xbf, 0x5c, 0x33, 0x47, 0xfc,
-       0x2e, 0xf3, 0x79, 0x46, 0xe7, 0x91, 0xe4, 0xf5, 0x1e, 0x14, 0xf1, 0xc2,
-       0x3d, 0x28, 0xe2, 0x24, 0xaa, 0xed, 0xfd, 0x7c, 0xb9, 0x49, 0xe7, 0xd0,
-       0x1f, 0x98, 0x8f, 0xcb, 0x62, 0x9c, 0x31, 0x3e, 0x7e, 0x97, 0x90, 0x7e,
-       0xb3, 0x97, 0xc8, 0x4b, 0x8e, 0xb9, 0x72, 0xe0, 0xe9, 0x0d, 0x96, 0xb6,
-       0x19, 0x1b, 0xe4, 0x99, 0xdd, 0x70, 0x2f, 0xa2, 0xd7, 0xca, 0xba, 0x96,
-       0x9a, 0x98, 0x25, 0xf0, 0x3e, 0x2d, 0xc9, 0xcc, 0x00, 0xee, 0xf3, 0x1c,
-       0x7b, 0xbf, 0x4c, 0x3d, 0x38, 0x01, 0x5b, 0x6e, 0x2f, 0x74, 0x0e, 0xcf,
-       0x9f, 0x99, 0xef, 0x70, 0x13, 0x86, 0x59, 0xfd, 0xdd, 0x29, 0xfa, 0x80,
-       0xa4, 0x87, 0x04, 0x9e, 0x67, 0x6c, 0x5c, 0x29, 0x21, 0xf9, 0xc2, 0x05,
-       0xf3, 0x6d, 0xcb, 0xc2, 0x4b, 0xb8, 0xbf, 0xde, 0x7a, 0x18, 0x3f, 0x64,
-       0xd4, 0xdc, 0xd1, 0xd7, 0x92, 0xa4, 0xcb, 0x26, 0xc7, 0xa5, 0x1a, 0x37,
-       0x99, 0x91, 0xc3, 0xda, 0x7e, 0x1e, 0xb2, 0xb9, 0x2d, 0xa9, 0xd1, 0x9c,
-       0x18, 0x1b, 0xfa, 0x77, 0x60, 0x43, 0x7f, 0xb1, 0x92, 0xd6, 0xfb, 0x58,
-       0xa7, 0x61, 0x43, 0x3f, 0x01, 0xdd, 0x43, 0x9d, 0x13, 0xb7, 0x3a, 0x67,
-       0x4a, 0xdd, 0xa8, 0x75, 0xce, 0x37, 0xb5, 0xce, 0x79, 0xef, 0x1a, 0x9d,
-       0x73, 0x48, 0x75, 0x97, 0xa8, 0x73, 0x86, 0xd5, 0x1e, 0x87, 0xf6, 0xe2,
-       0xe6, 0x3a, 0x3a, 0xe7, 0x7d, 0xf2, 0x2e, 0xfb, 0xee, 0x1e, 0x79, 0xff,
-       0x0e, 0xbd, 0x77, 0xe3, 0xce, 0x2a, 0x7e, 0x6b, 0xc9, 0xe8, 0xa0, 0xeb,
-       0x54, 0xaf, 0xde, 0xf3, 0xfd, 0x46, 0x8d, 0xce, 0xe9, 0x52, 0x03, 0xce,
-       0xb0, 0x6e, 0xc3, 0xd8, 0x04, 0x9f, 0x7d, 0x27, 0x3d, 0xda, 0x84, 0xe7,
-       0x84, 0x44, 0x8e, 0x60, 0xee, 0xe6, 0x7b, 0x50, 0xca, 0xbc, 0x7b, 0xab,
-       0x7d, 0xa7, 0xc2, 0xf2, 0xa8, 0x29, 0xef, 0xb6, 0xe5, 0x46, 0x57, 0x75,
-       0xa9, 0x4e, 0xad, 0xab, 0xb6, 0x83, 0xa1, 0x66, 0xa1, 0x5f, 0x67, 0x8b,
-       0xa1, 0xce, 0xe2, 0x6f, 0xc6, 0x9e, 0x19, 0xa3, 0x08, 0x63, 0xd8, 0x49,
-       0xd4, 0xc1, 0x55, 0x0c, 0x6d, 0x4a, 0xfe, 0x86, 0xaf, 0x80, 0x6b, 0x1e,
-       0x78, 0xbd, 0x19, 0xfc, 0xf3, 0x6f, 0x0a, 0x8c, 0x81, 0xb6, 0xcb, 0xd1,
-       0xe9, 0xda, 0x77, 0x9d, 0xf2, 0x9e, 0xe9, 0x2d, 0xb2, 0xbf, 0xf4, 0x2d,
-       0xf0, 0xc1, 0x56, 0x99, 0x2a, 0x15, 0xf4, 0x79, 0xf5, 0x4d, 0xfa, 0x3b,
-       0x1e, 0xfc, 0xbe, 0x8d, 0x91, 0x91, 0x3b, 0x1d, 0x23, 0x23, 0xd3, 0xaa,
-       0x6a, 0xb3, 0x86, 0x7d, 0xf2, 0xdb, 0x21, 0x23, 0xa5, 0x84, 0xfe, 0xc6,
-       0xe9, 0x6c, 0xe5, 0x0a, 0xf9, 0xc2, 0x31, 0x75, 0xa7, 0xaa, 0x9e, 0xef,
-       0xd5, 0x36, 0xeb, 0xdc, 0x0a, 0x9b, 0xf5, 0xaf, 0x64, 0xf1, 0xfd, 0x31,
-       0xcc, 0x13, 0x34, 0x7c, 0xe5, 0xf7, 0xb8, 0x17, 0xda, 0x1e, 0x97, 0x0b,
-       0x32, 0xa2, 0xf1, 0x47, 0x79, 0xda, 0x02, 0x39, 0xb8, 0xa4, 0xf5, 0xeb,
-       0x66, 0xd0, 0x20, 0x65, 0xe9, 0xc7, 0xe4, 0x45, 0x2d, 0xcf, 0x36, 0x5b,
-       0xdb, 0x75, 0x81, 0xb1, 0xd4, 0x23, 0xb4, 0x5d, 0xbf, 0x69, 0xcb, 0x59,
-       0x96, 0x4a, 0x2c, 0x09, 0xf5, 0x5d, 0x1c, 0x32, 0x94, 0xf2, 0xf4, 0x8d,
-       0xda, 0xae, 0x5f, 0xb3, 0x7d, 0x50, 0x7e, 0x1a, 0xd9, 0xbd, 0xdd, 0x59,
-       0xb0, 0x65, 0x7c, 0x0e, 0xe3, 0xe9, 0x5e, 0x3a, 0x6b, 0xf9, 0x4c, 0x39,
-       0x5f, 0xc2, 0xfb, 0x4d, 0x78, 0x4f, 0x3e, 0x3b, 0xad, 0xf9, 0x4c, 0xdb,
-       0x27, 0x4e, 0xbf, 0xdd, 0x5f, 0x58, 0xde, 0x1b, 0xc8, 0x91, 0xcf, 0xd4,
-       0x51, 0x77, 0xc1, 0xc8, 0x03, 0xe6, 0xa9, 0x7e, 0x1e, 0xba, 0x83, 0x6d,
-       0x51, 0xfe, 0x70, 0x9a, 0xbe, 0x2d, 0xfc, 0x9f, 0x56, 0x3c, 0xb7, 0xe3,
-       0x79, 0x56, 0xde, 0xbb, 0x37, 0xa6, 0xe7, 0x3d, 0x85, 0x79, 0x1c, 0x38,
-       0x82, 0x39, 0x39, 0xc6, 0x76, 0x8e, 0x9e, 0x8a, 0x4a, 0xc3, 0x29, 0xf2,
-       0x1d, 0xcf, 0xda, 0x04, 0xc1, 0xbe, 0x7e, 0xd2, 0x6d, 0xca, 0xdd, 0xa9,
-       0xcf, 0x96, 0x6e, 0x4f, 0x44, 0x80, 0x93, 0x03, 0x58, 0x8f, 0xa9, 0x82,
-       0xe7, 0x66, 0x1c, 0x2f, 0x81, 0x79, 0xc2, 0x06, 0xec, 0x86, 0x2d, 0xd8,
-       0x0d, 0x3b, 0xb0, 0x1b, 0x76, 0xe0, 0x46, 0x39, 0x71, 0x15, 0x73, 0x4c,
-       0x72, 0xd7, 0xc2, 0x2b, 0x97, 0xef, 0xe8, 0x38, 0x7d, 0xe3, 0xcd, 0x23,
-       0xf0, 0xd9, 0xc5, 0x4d, 0x8d, 0x32, 0x0f, 0x7f, 0xc9, 0x6d, 0xbc, 0x79,
-       0xa7, 0x74, 0x0f, 0xe2, 0xfd, 0xe0, 0x05, 0xe9, 0xb9, 0xf9, 0x56, 0xa7,
-       0x71, 0x74, 0x04, 0x78, 0x4c, 0x3b, 0xa9, 0xc4, 0x98, 0xb3, 0x80, 0x71,
-       0x32, 0xdb, 0x23, 0xc2, 0xb8, 0xe5, 0x02, 0x63, 0x11, 0x37, 0x77, 0x47,
-       0xfa, 0x92, 0xe3, 0x4e, 0x6a, 0x54, 0x45, 0x52, 0xa3, 0x23, 0x4e, 0x58,
-       0x8f, 0xdf, 0x48, 0x85, 0x9c, 0x01, 0xac, 0x07, 0x8a, 0xd3, 0xa0, 0xa7,
-       0xff, 0x28, 0xf9, 0x63, 0x2d, 0x32, 0x5f, 0xe8, 0x76, 0x33, 0x2a, 0xae,
-       0x73, 0x4b, 0xd4, 0x09, 0x10, 0xfd, 0xa9, 0x98, 0xcc, 0x96, 0xb6, 0x8a,
-       0xd2, 0xb6, 0x7b, 0x87, 0x64, 0xa6, 0x4b, 0x72, 0x6e, 0x40, 0xda, 0x14,
-       0xfa, 0xe7, 0xb7, 0x67, 0xd5, 0x09, 0xee, 0x25, 0x86, 0xbc, 0x70, 0x39,
-       0xf9, 0xa4, 0x04, 0x1c, 0x82, 0x6e, 0x19, 0xe3, 0x6d, 0x12, 0xca, 0xbd,
-       0x8f, 0xea, 0xf8, 0x29, 0x63, 0xb6, 0xb5, 0x7b, 0x0f, 0xe4, 0x8f, 0x58,
-       0x5d, 0xfe, 0x98, 0x2b, 0x72, 0x9f, 0x46, 0x72, 0x51, 0xc6, 0x88, 0x3d,
-       0xfc, 0x9e, 0x61, 0xdd, 0x26, 0x99, 0x1a, 0xc8, 0xd9, 0x3c, 0x8f, 0x47,
-       0x12, 0xcc, 0x21, 0x26, 0x4e, 0xc6, 0x07, 0xc8, 0xeb, 0xab, 0xf7, 0x36,
-       0x62, 0x35, 0xf2, 0xc0, 0x91, 0xc5, 0x52, 0xb8, 0x17, 0xc2, 0xfe, 0xf0,
-       0x3c, 0x63, 0xe4, 0x6d, 0x66, 0x4d, 0x3b, 0xc2, 0xc5, 0xfd, 0xca, 0x95,
-       0x32, 0x56, 0x79, 0x94, 0xa9, 0xae, 0x96, 0xaf, 0x8f, 0x55, 0x8c, 0x6c,
-       0x9d, 0xa9, 0x84, 0xba, 0x25, 0x66, 0x74, 0xe9, 0x1a, 0x7d, 0x62, 0xa2,
-       0x99, 0x55, 0x7d, 0x42, 0xbd, 0xa8, 0xe4, 0x03, 0xf3, 0x1d, 0x12, 0x7d,
-       0x58, 0x96, 0xa6, 0xbc, 0xec, 0xe5, 0xcc, 0xd5, 0x98, 0xf2, 0xdf, 0x8c,
-       0x7e, 0xfc, 0x6f, 0x09, 0xea, 0xc3, 0x31, 0xf5, 0x75, 0xdc, 0x37, 0x69,
-       0xfa, 0x03, 0x4f, 0xe1, 0xd9, 0xf8, 0x09, 0xbf, 0x03, 0x3f, 0xe1, 0x8b,
-       0xd0, 0x75, 0x67, 0xe0, 0x27, 0x3c, 0x09, 0x3f, 0xe1, 0x34, 0xfc, 0x84,
-       0x27, 0xa0, 0x27, 0x6b, 0xfd, 0x83, 0xc9, 0x15, 0xfe, 0x41, 0xa0, 0xf9,
-       0x9f, 0xf1, 0xc0, 0x27, 0x6b, 0x7c, 0x83, 0x7d, 0x46, 0x5f, 0xc1, 0xef,
-       0x37, 0x7c, 0xd4, 0xa5, 0x6e, 0xd2, 0xfa, 0xd1, 0xe4, 0xed, 0x8e, 0x2e,
-       0xeb, 0xab, 0x2e, 0x65, 0xf4, 0xd5, 0x6c, 0x55, 0x5f, 0x19, 0x3e, 0x7a,
-       0xb8, 0x24, 0x11, 0xaf, 0xb4, 0x90, 0xf1, 0x77, 0x69, 0x1e, 0x6a, 0xf3,
-       0xb6, 0x4a, 0xe4, 0x01, 0xd5, 0xde, 0x20, 0x19, 0xfb, 0x0c, 0xfa, 0x3a,
-       0x3a, 0x8d, 0xbe, 0xae, 0x95, 0xac, 0xb6, 0xcf, 0x2e, 0x8e, 0xef, 0x27,
-       0x56, 0xe1, 0x3b, 0x5f, 0xbc, 0x5b, 0xe3, 0xfc, 0xfe, 0x32, 0xf7, 0x59,
-       0x5a, 0x64, 0xb2, 0x1c, 0xe2, 0x9c, 0xe7, 0x59, 0x99, 0x8b, 0xd1, 0x29,
-       0x91, 0x87, 0x3b, 0x78, 0xce, 0x4a, 0x65, 0xfd, 0xf5, 0x3a, 0x87, 0xe5,
-       0xc4, 0x80, 0x24, 0xb2, 0x03, 0xa4, 0xd5, 0xfb, 0x64, 0x56, 0xaf, 0x45,
-       0x87, 0x34, 0x3c, 0x4c, 0x1b, 0x25, 0xdc, 0xcf, 0xeb, 0xba, 0xcc, 0x7e,
-       0x23, 0x35, 0x66, 0xea, 0x89, 0x1c, 0xd4, 0xeb, 0x75, 0x5c, 0xe7, 0x19,
-       0xde, 0x34, 0xcf, 0xb8, 0x3c, 0xbf, 0x47, 0xc5, 0x98, 0xfc, 0x3f, 0x67,
-       0xfd, 0x7e, 0xe1, 0x32, 0x63, 0xcf, 0x6c, 0xb2, 0x76, 0x8c, 0x89, 0x53,
-       0xd5, 0xb7, 0x61, 0xd8, 0x4f, 0xed, 0x37, 0x14, 0xb7, 0x38, 0x93, 0xa5,
-       0xad, 0x4e, 0xbe, 0xc4, 0xbd, 0x6c, 0xfb, 0xf7, 0x2e, 0xdc, 0x3d, 0xce,
-       0x01, 0x6f, 0x0b, 0xca, 0x18, 0xb3, 0x64, 0xcc, 0xe6, 0x97, 0x2e, 0x63,
-       0x8c, 0x36, 0xe3, 0x71, 0x6c, 0x96, 0x6d, 0x71, 0xa6, 0x4a, 0xdd, 0xf0,
-       0xcd, 0x79, 0xae, 0x8a, 0xef, 0x77, 0x72, 0xed, 0xa0, 0x83, 0x5d, 0x7d,
-       0x66, 0x77, 0x42, 0xae, 0xb0, 0x31, 0x68, 0xea, 0xe1, 0x9f, 0x5f, 0xb1,
-       0x77, 0x7b, 0x08, 0x7a, 0xec, 0x16, 0xc8, 0x23, 0xea, 0xe1, 0x43, 0x72,
-       0xb5, 0xa5, 0xe7, 0x95, 0x7a, 0xf8, 0xbc, 0x30, 0x4e, 0xdc, 0x8f, 0x77,
-       0xb9, 0x20, 0x06, 0x7a, 0x38, 0x5c, 0xe3, 0xab, 0xd1, 0xef, 0x6b, 0x1a,
-       0x32, 0xfb, 0x61, 0x2b, 0xfd, 0x3e, 0xc8, 0x81, 0x78, 0xe8, 0xe7, 0x35,
-       0x2e, 0xef, 0xd7, 0xee, 0xb1, 0x6d, 0xa7, 0xfc, 0xfb, 0x89, 0xa3, 0xe4,
-       0x21, 0xe9, 0x81, 0x2e, 0x63, 0x0e, 0xc8, 0x6f, 0x69, 0x9c, 0x89, 0x22,
-       0xed, 0x6d, 0xd2, 0x30, 0x5a, 0x39, 0x9f, 0x0c, 0x73, 0x38, 0xf2, 0xb6,
-       0xed, 0x84, 0xdd, 0x93, 0xcf, 0xcb, 0xdc, 0x65, 0xd4, 0x83, 0x23, 0x91,
-       0xf5, 0xfc, 0x7e, 0x22, 0xda, 0xf6, 0x18, 0xbd, 0x28, 0x61, 0x5f, 0x7c,
-       0x6e, 0xa8, 0xe9, 0x9b, 0x76, 0x14, 0xef, 0xab, 0xcf, 0x91, 0x3d, 0xa3,
-       0xf7, 0x19, 0xcd, 0xf7, 0x12, 0x42, 0x3e, 0x21, 0xef, 0x24, 0xf5, 0x59,
-       0x27, 0xef, 0x61, 0xda, 0x3d, 0xdc, 0x83, 0x75, 0x17, 0x26, 0xfd, 0x4f,
-       0xe8, 0x6f, 0xfc, 0xcd, 0x88, 0x38, 0x79, 0xff, 0x36, 0x9d, 0x7b, 0x92,
-       0xd7, 0xb1, 0xe6, 0x1c, 0xee, 0x55, 0x1f, 0xb5, 0xeb, 0x61, 0xfe, 0x4d,
-       0x0b, 0x96, 0x65, 0x01, 0x1b, 0x75, 0x08, 0x65, 0x6f, 0x5c, 0xba, 0x8e,
-       0x7e, 0x58, 0xf3, 0xc2, 0x66, 0xf8, 0x02, 0xc3, 0x47, 0xa1, 0xab, 0x8f,
-       0x26, 0x64, 0xe7, 0x51, 0xad, 0x1b, 0xd3, 0x6b, 0x63, 0x05, 0x7d, 0x6e,
-       0xd4, 0x79, 0x8f, 0x3e, 0xc7, 0xf6, 0xd6, 0xa3, 0x11, 0x39, 0x1c, 0xef,
-       0x73, 0x7b, 0x9c, 0xf7, 0x5a, 0x5d, 0x18, 0xc6, 0xb0, 0x5b, 0xd0, 0xfe,
-       0xf5, 0xe2, 0xd8, 0x61, 0xfc, 0x3a, 0x22, 0x33, 0x7b, 0x3b, 0x01, 0xdb,
-       0x5f, 0x5d, 0x66, 0xce, 0x20, 0x63, 0xad, 0xf4, 0xb7, 0xe7, 0xa3, 0x09,
-       0xca, 0xb2, 0x2e, 0xc0, 0x32, 0x72, 0x94, 0xfa, 0xcc, 0xd3, 0x3c, 0x0e,
-       0x18, 0xdc, 0x06, 0xed, 0x87, 0x90, 0x2f, 0xdf, 0x22, 0xde, 0x03, 0x90,
-       0x71, 0x47, 0x63, 0xd2, 0x73, 0xb4, 0x45, 0xb6, 0x1d, 0xa5, 0x1f, 0x52,
-       0xeb, 0x97, 0xd2, 0x2e, 0x7d, 0x04, 0x73, 0x7c, 0xb7, 0x96, 0x93, 0xdc,
-       0xd3, 0xdc, 0x4f, 0xde, 0x45, 0xdd, 0x2c, 0x6c, 0xe6, 0xcc, 0x51, 0x57,
-       0xef, 0x91, 0x66, 0x30, 0xe7, 0x6c, 0xd9, 0xc5, 0x38, 0x46, 0xe6, 0xe4,
-       0xe9, 0xa7, 0x8c, 0x76, 0x00, 0xc7, 0xef, 0xb5, 0xbc, 0xb3, 0xbe, 0xc3,
-       0xf2, 0xe8, 0xcf, 0xc8, 0x7b, 0x5b, 0x3a, 0x8c, 0xec, 0x7c, 0x4b, 0x07,
-       0x73, 0x93, 0x36, 0x7b, 0xbc, 0x37, 0x69, 0x7b, 0xc2, 0xc8, 0xd0, 0xd7,
-       0xe2, 0x45, 0x01, 0x8e, 0xc2, 0x7d, 0x29, 0x7d, 0x96, 0x2f, 0x38, 0xe7,
-       0xeb, 0xf3, 0x2b, 0xfe, 0xa2, 0xfe, 0x3b, 0x21, 0xdc, 0x23, 0xab, 0x7e,
-       0x6f, 0x65, 0x57, 0x85, 0x71, 0xf2, 0xcf, 0x86, 0x7f, 0x97, 0xa4, 0x26,
-       0xef, 0xb0, 0x76, 0x0f, 0x8c, 0xb1, 0xa6, 0xe5, 0xdc, 0xa0, 0xa0, 0xa4,
-       0xbf, 0x5f, 0xf4, 0x9c, 0x73, 0xbe, 0x70, 0xd6, 0xf9, 0xee, 0xb4, 0x04,
-       0x51, 0xef, 0x27, 0xce, 0xf7, 0x3d, 0xee, 0x99, 0x7f, 0xdd, 0xf9, 0x5e,
-       0xc1, 0x03, 0x1f, 0xde, 0x87, 0x79, 0xbc, 0xe2, 0xfc, 0x00, 0xeb, 0x7b,
-       0xb0, 0x98, 0x4e, 0xb9, 0x36, 0x26, 0x7e, 0xb6, 0xf0, 0x8a, 0xf3, 0xb5,
-       0x6a, 0x3c, 0x69, 0x30, 0xa4, 0x91, 0x43, 0x7c, 0x57, 0xc6, 0xbb, 0xb2,
-       0xde, 0xff, 0x71, 0xe6, 0xa6, 0x6d, 0x7e, 0x89, 0xe6, 0xe3, 0x85, 0xe5,
-       0x7d, 0x99, 0x51, 0xbd, 0x57, 0xf1, 0xac, 0x33, 0x37, 0x7f, 0x77, 0x87,
-       0xc9, 0x33, 0x3a, 0x8b, 0x77, 0x26, 0xe7, 0x72, 0x76, 0xfe, 0x2c, 0xea,
-       0x3c, 0xe3, 0xcc, 0xea, 0xf8, 0x97, 0xf6, 0xc5, 0x9d, 0x99, 0xf9, 0x67,
-       0x9c, 0x79, 0xbd, 0x07, 0x7d, 0xce, 0x79, 0x74, 0x9a, 0x7d, 0x9f, 0x43,
-       0x9d, 0x05, 0xe7, 0x04, 0xfa, 0x9b, 0x9f, 0xe6, 0x79, 0xdc, 0x6e, 0xd8,
-       0x05, 0xfc, 0x7b, 0x3f, 0xfc, 0x1e, 0xc7, 0xb3, 0xce, 0xfc, 0x72, 0xbf,
-       0x8b, 0xe8, 0x87, 0x75, 0x49, 0x8b, 0x1c, 0xf7, 0x59, 0xf4, 0xbf, 0x76,
-       0xaf, 0x6a, 0x2d, 0x4e, 0x5e, 0x00, 0x4e, 0x2e, 0x58, 0x9c, 0xbc, 0x6a,
-       0x71, 0xf2, 0x7c, 0x0d, 0x4e, 0x44, 0xad, 0xc4, 0xc9, 0xab, 0xc0, 0x89,
-       0xa8, 0xfa, 0x38, 0xc1, 0xbb, 0x32, 0xde, 0x69, 0x9c, 0xbc, 0xb4, 0x0a,
-       0x27, 0x4b, 0xcb, 0x71, 0x79, 0x83, 0x93, 0x17, 0x81, 0x93, 0xaf, 0x5a,
-       0xd8, 0x2f, 0x58, 0x9c, 0xe0, 0x3e, 0x7f, 0x01, 0x75, 0x5e, 0xaa, 0xc1,
-       0xc9, 0x05, 0xe0, 0xe4, 0x25, 0x8b, 0x93, 0xef, 0x5b, 0x9c, 0x7c, 0x1f,
-       0x75, 0x96, 0x80, 0x93, 0xf3, 0x75, 0x70, 0xf2, 0x22, 0x70, 0x12, 0xf6,
-       0x7b, 0x1e, 0xfd, 0x7c, 0xbf, 0x06, 0x27, 0x2f, 0xd6, 0xc1, 0x09, 0xf7,
-       0x62, 0xc3, 0x9c, 0xee, 0x99, 0xd7, 0xc9, 0xe9, 0x96, 0x3b, 0x5f, 0x3f,
-       0xa7, 0x9b, 0x75, 0x66, 0xa4, 0xfa, 0x37, 0x25, 0xee, 0xb6, 0x39, 0x6a,
-       0x26, 0x17, 0xb0, 0xfa, 0xcd, 0xa6, 0x6e, 0xf0, 0x79, 0x3e, 0xe7, 0x8a,
-       0xc9, 0x29, 0x8d, 0xee, 0xf8, 0x10, 0x78, 0x6d, 0x97, 0x1c, 0x38, 0xd6,
-       0x78, 0x38, 0x6b, 0xcb, 0xbc, 0x1d, 0xdd, 0x39, 0xa5, 0xf8, 0x2e, 0xcc,
-       0x49, 0xa0, 0x5f, 0xd2, 0xc0, 0x6f, 0x0b, 0xf6, 0xa6, 0xa5, 0x76, 0x4f,
-       0xba, 0xc0, 0x6f, 0x34, 0x61, 0xec, 0x25, 0xfe, 0xfd, 0x8b, 0x24, 0xf3,
-       0xac, 0xf2, 0x1a, 0xde, 0x14, 0xf4, 0xc7, 0xa0, 0xce, 0xad, 0xca, 0x14,
-       0x68, 0x73, 0x27, 0x99, 0xa3, 0x06, 0x5b, 0x79, 0xc8, 0x9e, 0x09, 0xf3,
-       0xf5, 0x39, 0x95, 0x2a, 0xff, 0xd4, 0x9e, 0x87, 0x26, 0xdf, 0x55, 0xe9,
-       0xe6, 0xe0, 0xf2, 0x77, 0x02, 0x4f, 0xca, 0xd3, 0x3a, 0x56, 0xdc, 0x8c,
-       0xf5, 0x09, 0x82, 0xc7, 0x7c, 0x13, 0xa3, 0x5d, 0xd4, 0x31, 0x5a, 0x81,
-       0x37, 0x3e, 0x69, 0xe3, 0xb4, 0x3d, 0x83, 0x2f, 0x2d, 0xc7, 0x68, 0x6b,
-       0xf3, 0x59, 0xcc, 0xfe, 0x7a, 0xa6, 0xf4, 0x88, 0xce, 0xd1, 0x19, 0xe1,
-       0xf7, 0x37, 0x20, 0x23, 0x26, 0x66, 0xe6, 0x65, 0xf2, 0x41, 0x3e, 0x53,
-       0xbf, 0x45, 0xa0, 0xc3, 0x28, 0xc3, 0x73, 0x92, 0x19, 0x64, 0x99, 0x69,
-       0x33, 0xa2, 0xfd, 0xe5, 0x93, 0x32, 0xbc, 0x3c, 0x3e, 0xf1, 0x7b, 0x57,
-       0xcd, 0x77, 0xab, 0x69, 0xf3, 0xa4, 0x9d, 0x4c, 0x85, 0xef, 0xc3, 0x3d,
-       0xf2, 0xbb, 0xec, 0xb7, 0xb3, 0xf8, 0xbe, 0xf6, 0x5b, 0xad, 0x5a, 0x74,
-       0xe0, 0x37, 0xbf, 0x87, 0x36, 0xe5, 0x8c, 0xa0, 0xcd, 0x82, 0xdb, 0x32,
-       0xaa, 0x86, 0x6e, 0x18, 0xe5, 0xb9, 0xb9, 0xd9, 0x35, 0xdf, 0xba, 0xae,
-       0xea, 0xc5, 0xbc, 0x5e, 0x53, 0xe6, 0x67, 0xdd, 0x05, 0x5a, 0xd4, 0xb4,
-       0xa5, 0xe9, 0xff, 0xc0, 0xb2, 0xbe, 0xa4, 0x9e, 0x35, 0xdf, 0x9e, 0x31,
-       0xfa, 0x32, 0x95, 0x18, 0xc1, 0xf8, 0xfa, 0x6f, 0x2a, 0xd8, 0x73, 0xbd,
-       0xd9, 0xf9, 0xdb, 0xb5, 0xae, 0x9f, 0xf2, 0xd3, 0xc9, 0xa8, 0xd4, 0xa9,
-       0x5b, 0xaa, 0xa9, 0xab, 0xe7, 0xed, 0xca, 0x7f, 0xc5, 0xda, 0x7c, 0xbe,
-       0x58, 0x96, 0xe1, 0xe9, 0xbf, 0x84, 0xff, 0x98, 0x90, 0xdf, 0x2e, 0x96,
-       0x40, 0xaf, 0xb9, 0xcd, 0xf6, 0x5b, 0x4d, 0x19, 0xc0, 0xcd, 0x6f, 0xaf,
-       0xe8, 0x7c, 0xe2, 0xc8, 0x17, 0x40, 0x17, 0x9f, 0x2b, 0x71, 0x0c, 0xc0,
-       0x12, 0x81, 0x6d, 0x0f, 0x3b, 0x61, 0xa6, 0xa4, 0x73, 0xe7, 0xae, 0x2b,
-       0x97, 0x74, 0xcc, 0x62, 0x67, 0xb9, 0x53, 0x76, 0x95, 0x5b, 0x64, 0x37,
-       0xf4, 0xc2, 0xee, 0xb2, 0x87, 0x2b, 0x26, 0xef, 0x2e, 0x9b, 0x75, 0xfa,
-       0x58, 0x99, 0xeb, 0xbd, 0x43, 0x66, 0x8f, 0xad, 0xfe, 0x3e, 0xe7, 0x42,
-       0x2e, 0xfc, 0x3b, 0x4b, 0x4a, 0x31, 0xbf, 0x8c, 0xb4, 0x84, 0xab, 0x98,
-       0x3a, 0xbc, 0xa0, 0xf1, 0xc0, 0x0c, 0xd7, 0x54, 0x69, 0x49, 0x98, 0xa7,
-       0xcf, 0xbf, 0xad, 0x34, 0x73, 0x39, 0xcf, 0x4d, 0xf3, 0x5b, 0x5e, 0x3b,
-       0x2b, 0x61, 0xde, 0x78, 0xbd, 0x9c, 0x71, 0xd8, 0xf9, 0x3b, 0xc2, 0x1c,
-       0xbf, 0x18, 0x73, 0xc6, 0xa5, 0xeb, 0x54, 0x0b, 0xee, 0xa7, 0x2f, 0xd7,
-       0x67, 0x9b, 0x4f, 0x89, 0x2d, 0xd3, 0xf9, 0xe4, 0x78, 0x5e, 0xfd, 0x7d,
-       0xb5, 0x90, 0x1f, 0xaa, 0x7f, 0xa7, 0x40, 0xe4, 0xff, 0x02, 0xfb, 0x2e,
-       0x88, 0x71, 0xec, 0x6e, 0x00, 0x00, 0x00 };
+       0xbd, 0x7d, 0x0d, 0x74, 0x5c, 0xd7, 0x5d, 0xe7, 0xff, 0xdd, 0x79, 0x92,
+       0xc6, 0xb2, 0x6c, 0x3f, 0xcb, 0x13, 0x79, 0x62, 0xab, 0xf6, 0x8c, 0xf4,
+       0x64, 0xab, 0x91, 0x08, 0x2f, 0xae, 0x28, 0x82, 0x9d, 0x84, 0xe9, 0x48,
+       0xb2, 0x9d, 0x34, 0xed, 0xca, 0x8d, 0x5b, 0xb2, 0x9c, 0x02, 0x62, 0x24,
+       0x27, 0xe9, 0x77, 0xd2, 0x04, 0xb6, 0xec, 0xc9, 0x6e, 0x26, 0x23, 0xf9,
+       0x83, 0x74, 0xec, 0x51, 0x12, 0x25, 0xce, 0xa1, 0x3d, 0xbb, 0xaa, 0xa4,
+       0xd8, 0x06, 0x06, 0x8f, 0x93, 0xb8, 0xa5, 0xec, 0xa6, 0x54, 0x28, 0xae,
+       0x09, 0xa1, 0x07, 0x52, 0x48, 0xd9, 0x40, 0x53, 0x2a, 0xdc, 0xb4, 0xcd,
+       0x9e, 0x53, 0xb6, 0x01, 0xca, 0x12, 0x68, 0xe8, 0xdb, 0xdf, 0xef, 0xde,
+       0xfb, 0x34, 0xa3, 0x0f, 0xe7, 0xa3, 0xec, 0xe2, 0x73, 0x9e, 0xdf, 0xbc,
+       0xfb, 0xee, 0xc7, 0xff, 0xfe, 0xef, 0xff, 0xfb, 0xfe, 0xef, 0xd3, 0x76,
+       0x91, 0x66, 0xb1, 0xff, 0x36, 0xe0, 0x7a, 0x5b, 0xea, 0xf6, 0xd1, 0x6b,
+       0xae, 0xfe, 0xc9, 0xab, 0xf9, 0xec, 0x3a, 0x4d, 0x31, 0x79, 0x13, 0xff,
+       0x52, 0x6f, 0xa0, 0x0e, 0x3a, 0xf4, 0xa2, 0xb1, 0x78, 0x49, 0x5c, 0x65,
+       0xdc, 0x3b, 0x72, 0xbe, 0xc4, 0x63, 0x99, 0x91, 0x5f, 0x1e, 0xf5, 0x45,
+       0xb2, 0x95, 0x9e, 0xd4, 0x80, 0xfc, 0x4b, 0x58, 0x48, 0xb8, 0xc2, 0xf2,
+       0xb7, 0x64, 0x5e, 0xfd, 0x6f, 0x5f, 0xf8, 0xc9, 0xf4, 0xcb, 0xd3, 0x31,
+       0x89, 0x7b, 0x99, 0x0f, 0x8b, 0xb7, 0x4b, 0xe2, 0xed, 0x19, 0xb9, 0xe3,
+       0xd3, 0xbb, 0xff, 0x46, 0x64, 0x63, 0xd4, 0xd7, 0x4b, 0xe1, 0x17, 0x76,
+       0x4b, 0x61, 0x5b, 0x26, 0x39, 0xd2, 0x90, 0x49, 0xc8, 0x17, 0xab, 0x9e,
+       0x9c, 0xab, 0xca, 0xf0, 0xa9, 0xd2, 0xcb, 0xa1, 0x9b, 0x09, 0x63, 0x13,
+       0x7d, 0x8e, 0xc4, 0x32, 0x72, 0x61, 0xb4, 0xef, 0x9e, 0x50, 0xf9, 0x32,
+       0xe2, 0x65, 0xfc, 0x60, 0x41, 0x5a, 0xfa, 0x2f, 0xf6, 0xa1, 0x4e, 0xe5,
+       0xe0, 0xb5, 0x8d, 0x27, 0xe2, 0xa2, 0x32, 0x5d, 0xcf, 0xe7, 0x62, 0xd7,
+       0x88, 0xf2, 0xfd, 0xe0, 0x82, 0x74, 0x05, 0x4f, 0x09, 0xca, 0xcf, 0xc6,
+       0x25, 0x57, 0x95, 0x16, 0x94, 0xe1, 0xde, 0x8c, 0x3a, 0x69, 0x2f, 0x17,
+       0x4b, 0x48, 0xb1, 0xfa, 0x63, 0xcd, 0x66, 0xec, 0xaf, 0xaf, 0x33, 0xf7,
+       0xdd, 0xf6, 0xbe, 0xee, 0x67, 0xdd, 0x4c, 0x3c, 0xae, 0x4e, 0xc8, 0xcb,
+       0x13, 0x7d, 0x2f, 0x87, 0x31, 0xdf, 0xf7, 0x06, 0xa4, 0x41, 0x06, 0x13,
+       0x80, 0xa9, 0xec, 0xa0, 0xef, 0x14, 0xda, 0xfe, 0x12, 0x70, 0x0e, 0xf8,
+       0xca, 0x29, 0x29, 0x10, 0xce, 0x72, 0x5c, 0x16, 0x63, 0x49, 0x01, 0xfc,
+       0xc0, 0x45, 0xbb, 0x8c, 0xa3, 0x3c, 0x57, 0xe2, 0x7c, 0x5c, 0xc9, 0x7b,
+       0x1e, 0xe6, 0xd2, 0x8e, 0x36, 0x3b, 0x1d, 0xd3, 0x3f, 0x9e, 0x97, 0xd5,
+       0x67, 0xdd, 0xe7, 0x51, 0x37, 0xa5, 0xeb, 0x3d, 0x51, 0x4d, 0xca, 0xe3,
+       0xd5, 0x84, 0x3c, 0x56, 0xfd, 0x98, 0x64, 0x3d, 0xe2, 0x00, 0xb0, 0x96,
+       0x1b, 0x65, 0x60, 0xaa, 0x59, 0x72, 0x53, 0x9d, 0xc9, 0xbc, 0x84, 0xe1,
+       0x9d, 0xc1, 0x07, 0x64, 0xa4, 0x15, 0xf5, 0xcb, 0x7c, 0x97, 0x5c, 0xf6,
+       0x2e, 0x1f, 0xf4, 0x78, 0x79, 0xe5, 0x48, 0xf6, 0x60, 0x3a, 0x39, 0xa2,
+       0xf8, 0xdc, 0x20, 0xb9, 0x5e, 0x3c, 0x0f, 0xbb, 0x12, 0xf3, 0xc3, 0xf0,
+       0x8e, 0x60, 0x17, 0xe0, 0x48, 0xa7, 0x52, 0x8a, 0x6d, 0xd9, 0x2e, 0x5d,
+       0x48, 0xa9, 0x24, 0xe6, 0x71, 0xb5, 0xa4, 0x5a, 0xc3, 0xf0, 0x3d, 0x81,
+       0x8f, 0x72, 0x91, 0x81, 0x92, 0xdc, 0xae, 0x32, 0x3e, 0xfa, 0x94, 0x40,
+       0x65, 0xb6, 0x60, 0x1e, 0x3d, 0xc0, 0x43, 0xa3, 0x64, 0x13, 0x92, 0x55,
+       0x19, 0x49, 0xa9, 0xcc, 0x3a, 0x94, 0x39, 0xd2, 0xe0, 0xff, 0x77, 0x4b,
+       0x7f, 0x9b, 0xf0, 0x2c, 0xc3, 0x2a, 0xd3, 0xba, 0xa2, 0x3c, 0x9d, 0x12,
+       0xf5, 0xe3, 0x71, 0x8c, 0xd9, 0x9d, 0x55, 0x2c, 0xc3, 0x5d, 0x97, 0x15,
+       0x9a, 0x56, 0x97, 0x4d, 0x3a, 0xcb, 0xcb, 0x4e, 0xb5, 0x10, 0x56, 0x51,
+       0xfc, 0x9d, 0xd4, 0x73, 0xcd, 0x26, 0x3a, 0xbd, 0x06, 0xcc, 0x6b, 0x38,
+       0x48, 0x7b, 0x43, 0xea, 0xb9, 0x50, 0xda, 0x08, 0x33, 0xdf, 0x29, 0xbc,
+       0x43, 0xd5, 0x4c, 0x80, 0x75, 0x4e, 0xc8, 0x51, 0xcc, 0xed, 0xd2, 0x54,
+       0xda, 0xeb, 0x50, 0xb8, 0xcf, 0xf1, 0x77, 0x18, 0xe6, 0x82, 0x82, 0xa6,
+       0x81, 0x6f, 0x4e, 0x25, 0xf1, 0x0c, 0xf8, 0x13, 0xd9, 0xf4, 0x66, 0xb9,
+       0xc9, 0xae, 0xcb, 0x37, 0x31, 0x66, 0xa7, 0x77, 0x87, 0xea, 0xf4, 0x02,
+       0x95, 0xf6, 0x66, 0xe4, 0xf7, 0xf1, 0x1c, 0x86, 0x07, 0x82, 0x74, 0xb2,
+       0x80, 0x35, 0x7b, 0xb1, 0x94, 0x90, 0x6f, 0x95, 0xd2, 0xa0, 0xfc, 0x74,
+       0xf7, 0xac, 0xf4, 0x04, 0xb3, 0x80, 0xb7, 0x88, 0xeb, 0x08, 0xdf, 0x55,
+       0xf0, 0xae, 0xc2, 0xb6, 0x61, 0x78, 0x53, 0xf0, 0xeb, 0xe1, 0x48, 0x9b,
+       0xe1, 0xa5, 0x2f, 0x96, 0xb1, 0x9e, 0x80, 0xf9, 0x71, 0xac, 0xd3, 0x63,
+       0xe5, 0x88, 0x4e, 0xba, 0xb1, 0xee, 0xa4, 0x0d, 0xd2, 0xc5, 0x1e, 0x4b,
+       0xff, 0xa3, 0xf6, 0x2e, 0x92, 0x03, 0x8d, 0xe5, 0x82, 0x1f, 0x84, 0x59,
+       0xcd, 0x63, 0xe2, 0x0c, 0x94, 0x49, 0xbb, 0x0d, 0x80, 0x95, 0x8f, 0x1f,
+       0xb3, 0xf5, 0xda, 0x1d, 0xe0, 0x96, 0xeb, 0xc0, 0xf7, 0x71, 0xe5, 0x37,
+       0xd9, 0xf7, 0x11, 0x2f, 0xf1, 0x1f, 0xe8, 0xcd, 0xaf, 0xd5, 0xcb, 0x91,
+       0x26, 0xab, 0x05, 0xc9, 0x3f, 0x18, 0xca, 0x40, 0x00, 0x3c, 0xb1, 0x4f,
+       0x2f, 0x10, 0xdd, 0xd6, 0x63, 0x1d, 0x5d, 0x17, 0xff, 0xae, 0x69, 0xc4,
+       0x18, 0xce, 0x60, 0xb9, 0xd6, 0x76, 0xb0, 0xfc, 0xe4, 0x16, 0x0b, 0x1f,
+       0x9e, 0xfb, 0x9d, 0x5c, 0xf5, 0x6f, 0xed, 0xda, 0x46, 0xf3, 0xb8, 0x69,
+       0x0d, 0xda, 0x0e, 0xc3, 0x89, 0x40, 0x46, 0x54, 0x66, 0x31, 0x9e, 0x2b,
+       0x89, 0xd3, 0x90, 0xf1, 0xbd, 0x21, 0x59, 0x27, 0x76, 0x5e, 0xb6, 0xdc,
+       0x03, 0xaf, 0x74, 0xa1, 0xdc, 0x11, 0xc8, 0x8d, 0x11, 0x07, 0x65, 0x1d,
+       0x15, 0x94, 0x61, 0xfd, 0xc6, 0x81, 0xaf, 0x7c, 0xa9, 0x5f, 0xaf, 0x65,
+       0xbe, 0x34, 0x0c, 0xde, 0xcf, 0xe0, 0x77, 0x76, 0xb3, 0x2b, 0x5d, 0xa0,
+       0x43, 0xae, 0xb1, 0xb8, 0xb9, 0xdd, 0xa0, 0xd5, 0xea, 0xeb, 0x4b, 0x2c,
+       0x3d, 0xf7, 0xe0, 0x5f, 0x88, 0xd3, 0x25, 0x78, 0x62, 0x19, 0xf2, 0xf5,
+       0xf3, 0x21, 0xe8, 0x19, 0x65, 0x84, 0x99, 0x35, 0x13, 0x32, 0x51, 0xde,
+       0x26, 0xc5, 0x29, 0x5f, 0xc6, 0x4b, 0xf3, 0xdd, 0x4a, 0x5e, 0x86, 0xac,
+       0xf1, 0x41, 0x0b, 0x69, 0xf0, 0x41, 0x46, 0x06, 0xaa, 0x18, 0xaf, 0x84,
+       0x7b, 0xb9, 0x13, 0x6d, 0x5d, 0xc9, 0x26, 0xcd, 0x3a, 0x17, 0x4b, 0x63,
+       0xc0, 0x15, 0xd6, 0x8d, 0xb2, 0x41, 0xc3, 0x3c, 0x0c, 0x3a, 0xf4, 0x24,
+       0xd7, 0xa7, 0xe1, 0x7c, 0x13, 0xf0, 0xc5, 0x65, 0x26, 0x68, 0xb4, 0x38,
+       0x22, 0x7f, 0xc6, 0xdd, 0x01, 0xe0, 0x61, 0xa0, 0x72, 0x0f, 0xfa, 0x6f,
+       0xc1, 0x6f, 0x96, 0x89, 0x2d, 0x73, 0xf5, 0xf3, 0x40, 0x85, 0x30, 0x47,
+       0x74, 0x0f, 0x3e, 0x98, 0x82, 0xfc, 0x01, 0xdd, 0x0f, 0x90, 0x5f, 0xe6,
+       0x38, 0x17, 0xc2, 0xb5, 0x4d, 0xff, 0x1e, 0x9f, 0xda, 0xa1, 0x9f, 0xf3,
+       0xc3, 0xdb, 0xa4, 0x30, 0x17, 0xcd, 0x99, 0xb2, 0x87, 0xf2, 0x26, 0x7d,
+       0x0c, 0x74, 0x05, 0xf9, 0x13, 0x86, 0x0f, 0x06, 0x94, 0x41, 0x61, 0xf8,
+       0x78, 0x40, 0x99, 0x74, 0x1e, 0xb2, 0x86, 0x72, 0x88, 0x72, 0x61, 0x50,
+       0x71, 0xdd, 0x73, 0xa5, 0x00, 0xeb, 0xd3, 0x28, 0xf9, 0xde, 0x47, 0x08,
+       0x2b, 0x64, 0xd8, 0xb3, 0x1f, 0xcb, 0xf9, 0x85, 0x64, 0x4c, 0xe3, 0x49,
+       0xb0, 0x5e, 0x71, 0xc9, 0xea, 0x99, 0x75, 0x48, 0xb1, 0x77, 0xd2, 0xd6,
+       0x79, 0x49, 0xd7, 0x71, 0x57, 0xd5, 0xf9, 0x75, 0x65, 0x78, 0x3c, 0xc0,
+       0x5a, 0xfe, 0xb4, 0x22, 0x1e, 0x3b, 0x76, 0xf1, 0x59, 0xe2, 0x0d, 0x99,
+       0xaf, 0xe1, 0xdd, 0xb9, 0x3b, 0x1f, 0xf5, 0xd7, 0x7a, 0xb7, 0xb5, 0x61,
+       0xf5, 0xbb, 0x09, 0x71, 0xfd, 0x74, 0xf7, 0x01, 0xf5, 0x4f, 0x78, 0x17,
+       0x86, 0x8f, 0x06, 0x51, 0x79, 0x6f, 0xc3, 0xea, 0x31, 0x7e, 0x76, 0x8d,
+       0xb2, 0xf3, 0x6b, 0x94, 0xfd, 0xc9, 0x1a, 0x65, 0xef, 0x6d, 0x5c, 0x5d,
+       0xf6, 0xc0, 0x1a, 0x65, 0x4f, 0xaf, 0x51, 0xe6, 0x37, 0xad, 0x2e, 0xdb,
+       0xb5, 0x46, 0xd9, 0x5b, 0xd7, 0x28, 0x3b, 0xb0, 0x46, 0x99, 0x0b, 0x1e,
+       0xde, 0x25, 0xc5, 0xc4, 0xbd, 0x9c, 0xbb, 0xc5, 0xcd, 0xe7, 0x62, 0xab,
+       0x71, 0xd3, 0x80, 0x7a, 0xed, 0x2b, 0xea, 0x7d, 0x6d, 0x8d, 0x7a, 0x8d,
+       0xa8, 0xd7, 0xba, 0xa2, 0xde, 0xcd, 0xee, 0xea, 0x7a, 0x4d, 0xa8, 0x17,
+       0x5f, 0x51, 0xef, 0x77, 0xd7, 0xa8, 0xc7, 0xf2, 0x4f, 0xd9, 0x71, 0x7a,
+       0xa0, 0xd1, 0x5e, 0x6b, 0xbd, 0x1a, 0x45, 0xda, 0x58, 0x1e, 0x40, 0x1f,
+       0xfd, 0xb4, 0x32, 0x32, 0x86, 0xf2, 0x4c, 0xe3, 0x0d, 0x74, 0x9e, 0x04,
+       0xdd, 0x51, 0x26, 0x83, 0xcf, 0x7c, 0xf2, 0xfe, 0x06, 0x19, 0x49, 0xf4,
+       0x78, 0x6f, 0x53, 0x2d, 0xa0, 0xb1, 0xb4, 0x97, 0x52, 0xe4, 0x3f, 0x29,
+       0x80, 0xb7, 0x0b, 0x03, 0xa2, 0x12, 0x4a, 0x42, 0x19, 0x0c, 0x54, 0xab,
+       0x92, 0x7b, 0xc0, 0x5f, 0x59, 0xe8, 0xbf, 0x03, 0xe1, 0x80, 0xe6, 0x2d,
+       0x53, 0xf7, 0xf2, 0xf2, 0xb9, 0x5f, 0x8e, 0x50, 0xae, 0x66, 0x82, 0x3b,
+       0x73, 0xfe, 0x7c, 0x7f, 0x23, 0x68, 0xf6, 0x12, 0xda, 0xec, 0x43, 0xcb,
+       0x43, 0x15, 0x57, 0x06, 0x2b, 0x19, 0xf0, 0x82, 0x23, 0x17, 0xfd, 0x4d,
+       0x72, 0x31, 0x40, 0xdd, 0x6a, 0x4c, 0x16, 0x12, 0x8e, 0x2c, 0xe0, 0x39,
+       0x17, 0xe0, 0x5d, 0x35, 0xe2, 0xad, 0x8c, 0x1c, 0x2e, 0xf7, 0xcb, 0xb1,
+       0xf2, 0x87, 0x55, 0xa4, 0x23, 0x87, 0x82, 0xf5, 0x72, 0xc6, 0x33, 0x7d,
+       0xef, 0xf3, 0xe7, 0xa1, 0x9d, 0x5d, 0xb9, 0xe4, 0xa7, 0x93, 0x0b, 0x9a,
+       0x27, 0xfe, 0x31, 0x1c, 0x44, 0x3f, 0x33, 0x7e, 0xda, 0xfb, 0x03, 0x0a,
+       0xc9, 0x0a, 0x6d, 0xa9, 0x5a, 0x5f, 0xe3, 0xe8, 0xeb, 0x68, 0x79, 0x83,
+       0xdc, 0x6a, 0xdb, 0xef, 0xf5, 0xe7, 0xbb, 0xc1, 0x73, 0xde, 0x29, 0xca,
+       0x90, 0x12, 0xe0, 0x3a, 0x08, 0xde, 0x46, 0xdb, 0x2f, 0x09, 0xdb, 0xc0,
+       0xf6, 0x2a, 0x6d, 0x82, 0xac, 0xff, 0x87, 0xf0, 0xd6, 0x04, 0xeb, 0xb3,
+       0x8c, 0xfa, 0x4b, 0x26, 0x55, 0x06, 0x32, 0xa1, 0xaf, 0x0b, 0xfa, 0x2b,
+       0x25, 0x83, 0x55, 0xc8, 0x9e, 0xf2, 0x0f, 0xc3, 0xac, 0xcb, 0x31, 0xa2,
+       0xb1, 0xa4, 0x50, 0xab, 0xc3, 0x32, 0xd6, 0x23, 0xff, 0x2f, 0x2e, 0xc9,
+       0x8a, 0x02, 0xe4, 0x8b, 0xb1, 0xd1, 0xfe, 0x13, 0x78, 0xb4, 0x5d, 0x06,
+       0x4b, 0xe9, 0x42, 0x56, 0x76, 0x61, 0xfd, 0x7e, 0x0d, 0x6b, 0xea, 0xe2,
+       0xfa, 0x93, 0xf5, 0xb2, 0x31, 0x80, 0x1d, 0xc0, 0x72, 0x74, 0xda, 0x46,
+       0xfb, 0xec, 0x19, 0xe0, 0x61, 0x9c, 0x6b, 0x9e, 0xcc, 0xc5, 0x9c, 0x61,
+       0xda, 0x3e, 0xc3, 0x90, 0x8f, 0xf9, 0x0a, 0xfb, 0x26, 0xbc, 0x49, 0xfb,
+       0x1b, 0x36, 0x5b, 0xa9, 0xdd, 0xfe, 0x6e, 0xc1, 0xef, 0x94, 0xfd, 0x0d,
+       0x99, 0x5a, 0xf2, 0xed, 0xef, 0x04, 0x7e, 0x77, 0xdb, 0xdf, 0x49, 0xfc,
+       0xee, 0xd5, 0xbf, 0x27, 0xca, 0x7b, 0xf7, 0x2a, 0xff, 0x6a, 0xc9, 0xcf,
+       0xb5, 0xcb, 0xe1, 0xd2, 0x7b, 0xad, 0x6c, 0xc1, 0x25, 0x9f, 0x77, 0xcc,
+       0x3c, 0x01, 0x77, 0x99, 0x6d, 0x0a, 0xce, 0xb0, 0xb6, 0xdd, 0xda, 0x61,
+       0xeb, 0xf4, 0x78, 0x9b, 0x85, 0x34, 0x30, 0xe1, 0x0c, 0x54, 0x9d, 0x6c,
+       0x2c, 0xd3, 0x95, 0x1c, 0x97, 0x63, 0xf8, 0x2d, 0x5e, 0x2c, 0xf3, 0x79,
+       0xdc, 0x0d, 0x0e, 0xbe, 0x00, 0x7d, 0x33, 0x5e, 0xa6, 0xbc, 0xf4, 0x31,
+       0xf7, 0x94, 0x9c, 0x5f, 0x66, 0xaf, 0x11, 0x17, 0x4a, 0xf2, 0x53, 0xe9,
+       0x47, 0x0a, 0x92, 0x2e, 0x4c, 0x83, 0x21, 0x0e, 0x04, 0xae, 0xbc, 0x27,
+       0x00, 0xed, 0x5e, 0xed, 0xc8, 0xde, 0xab, 0x5d, 0xd8, 0x57, 0xfe, 0xf4,
+       0x5e, 0xc8, 0xd8, 0x7c, 0xe9, 0xea, 0x18, 0xe9, 0x41, 0x9d, 0x95, 0x11,
+       0x37, 0x03, 0x6c, 0x9f, 0xed, 0x1d, 0x1c, 0x2f, 0xe5, 0x3f, 0xac, 0x32,
+       0xb7, 0xff, 0x6a, 0xae, 0x6f, 0x17, 0x74, 0x79, 0x18, 0xc6, 0x32, 0x6d,
+       0xd0, 0x4b, 0x5c, 0x57, 0xea, 0xa9, 0x9b, 0x6e, 0x8a, 0x65, 0x1a, 0x64,
+       0xe0, 0x60, 0x1b, 0xea, 0xb3, 0x9c, 0xb8, 0x72, 0xd0, 0x47, 0x3a, 0x35,
+       0x28, 0x72, 0xf7, 0x44, 0xdf, 0xa2, 0x33, 0x3e, 0xf9, 0x73, 0xe0, 0xc7,
+       0x7e, 0xc9, 0x1f, 0x7c, 0x00, 0xf8, 0x7d, 0xd9, 0x29, 0x4e, 0xbd, 0xe2,
+       0x8c, 0x4f, 0xfd, 0x9d, 0x33, 0x31, 0xb5, 0x63, 0xc7, 0x50, 0xff, 0x8e,
+       0x1d, 0xa3, 0xfd, 0xae, 0xd5, 0x2d, 0x3b, 0x76, 0x4c, 0xf4, 0x67, 0x31,
+       0xff, 0x1e, 0x6f, 0x50, 0x7c, 0x6f, 0x2f, 0x95, 0x7c, 0xc2, 0xac, 0xfd,
+       0x4c, 0xd0, 0x8d, 0xf7, 0x6c, 0xdf, 0xab, 0xdf, 0x0f, 0x48, 0x4f, 0xb2,
+       0x55, 0x38, 0x7e, 0x87, 0xd5, 0x49, 0x6c, 0x07, 0x7a, 0xe9, 0xa5, 0x1d,
+       0xa8, 0x50, 0x2f, 0x05, 0x7c, 0xd0, 0x26, 0xde, 0x06, 0x1b, 0x82, 0xed,
+       0x94, 0x5d, 0xf7, 0x92, 0x6a, 0xf0, 0x63, 0xba, 0x5f, 0x75, 0x36, 0x13,
+       0x33, 0x6b, 0xde, 0x63, 0xed, 0xeb, 0x4d, 0x28, 0xe7, 0x33, 0x71, 0x49,
+       0x7c, 0xd1, 0xde, 0x69, 0xd0, 0xf6, 0x69, 0xbe, 0x44, 0x5a, 0x72, 0x65,
+       0xac, 0xd4, 0x8f, 0x36, 0xa0, 0x97, 0xb3, 0xf6, 0x3a, 0x81, 0xf1, 0x0e,
+       0xa2, 0xaf, 0x13, 0x47, 0xd1, 0x8e, 0xb2, 0x24, 0xdd, 0x2d, 0xea, 0x41,
+       0xd4, 0xe9, 0xf1, 0xb6, 0x08, 0xed, 0x9a, 0x47, 0x24, 0x5f, 0x26, 0xdf,
+       0xd3, 0x36, 0x88, 0x4b, 0xaa, 0x0d, 0xcf, 0xd5, 0xc3, 0xb0, 0x75, 0x1a,
+       0x22, 0x7b, 0x43, 0x6a, 0x76, 0xd1, 0xaf, 0x2a, 0xf1, 0x0f, 0xcb, 0xc8,
+       0xec, 0x76, 0xd4, 0x33, 0xf6, 0xbc, 0xf2, 0x61, 0x17, 0xcd, 0x66, 0x25,
+       0xb7, 0xeb, 0x5e, 0xdc, 0x3d, 0x3c, 0x17, 0x71, 0x7f, 0x0b, 0xee, 0xe3,
+       0xb8, 0x47, 0x70, 0x02, 0xe7, 0x41, 0xcc, 0xea, 0xb2, 0x51, 0x8c, 0xfd,
+       0xef, 0x25, 0x37, 0x09, 0x7a, 0x2d, 0x85, 0x9b, 0x72, 0x7e, 0xd6, 0x53,
+       0xa2, 0xb6, 0x28, 0x99, 0x40, 0x7d, 0xf8, 0x29, 0xfe, 0x11, 0x19, 0x3d,
+       0x8d, 0xdf, 0x0f, 0xd2, 0xee, 0x9e, 0x90, 0xd1, 0x59, 0x8e, 0x53, 0x02,
+       0x4c, 0x93, 0x92, 0x3f, 0xfd, 0x00, 0xae, 0x29, 0x5c, 0x0f, 0xe3, 0xe2,
+       0xdc, 0xd8, 0xff, 0xc2, 0x66, 0x25, 0x2d, 0xfa, 0x39, 0x4f, 0xfa, 0xae,
+       0xe2, 0x37, 0x69, 0xbb, 0x4a, 0x1b, 0x08, 0x74, 0x5d, 0x8d, 0xe8, 0x3d,
+       0xb0, 0xbf, 0x93, 0x9a, 0xdf, 0x0b, 0xad, 0xa0, 0xa5, 0x6a, 0x56, 0xcb,
+       0x22, 0xc0, 0x00, 0xb9, 0x03, 0x9b, 0xa4, 0x95, 0x73, 0xec, 0xb5, 0x65,
+       0xbd, 0xba, 0x2c, 0xa5, 0xcb, 0xfa, 0x6c, 0x19, 0xee, 0xd5, 0x06, 0x19,
+       0x69, 0x03, 0xc4, 0x94, 0xdb, 0x12, 0xe1, 0x93, 0xb2, 0x01, 0x74, 0x8d,
+       0xf5, 0x3d, 0x7f, 0x59, 0xb9, 0xb8, 0xa8, 0xed, 0xbd, 0x73, 0x55, 0xd2,
+       0x37, 0x69, 0x3e, 0x0c, 0xef, 0x0f, 0x9a, 0xd0, 0x3f, 0x65, 0x81, 0x48,
+       0xc3, 0x09, 0x57, 0xa6, 0x3d, 0xd2, 0xc0, 0xc7, 0x5a, 0x48, 0x03, 0x8d,
+       0x3e, 0x69, 0xbb, 0x9e, 0xef, 0xb8, 0x86, 0xec, 0xaf, 0x00, 0x1b, 0x92,
+       0xb6, 0x64, 0x17, 0xec, 0x73, 0x8e, 0x71, 0x8c, 0xcf, 0x9e, 0x02, 0xaf,
+       0xe5, 0x96, 0x78, 0x4d, 0x64, 0xa6, 0x44, 0xdc, 0x44, 0x36, 0x26, 0xd7,
+       0x99, 0xf8, 0x39, 0x87, 0x39, 0xf3, 0x7e, 0xde, 0xe2, 0xe9, 0xf3, 0x16,
+       0x4f, 0x4f, 0xda, 0xbb, 0xe7, 0xe4, 0xb5, 0xcd, 0x38, 0x8f, 0x67, 0xae,
+       0x0f, 0xe8, 0xaa, 0x4a, 0x9e, 0x9b, 0xc6, 0x1d, 0x75, 0xcb, 0xe7, 0x64,
+       0x54, 0xdb, 0x6f, 0x31, 0x79, 0x87, 0x96, 0x79, 0x5f, 0xc5, 0x5a, 0x96,
+       0x00, 0x73, 0x83, 0x14, 0x12, 0x31, 0xbd, 0xf6, 0xae, 0xff, 0x5b, 0xae,
+       0xa1, 0x55, 0xe2, 0x64, 0x99, 0xbf, 0x56, 0x07, 0x53, 0xe4, 0xa3, 0x12,
+       0x2e, 0xd2, 0xee, 0xa7, 0x35, 0x5c, 0xb7, 0x40, 0x0e, 0x16, 0x44, 0xb5,
+       0x35, 0xca, 0x95, 0xa0, 0x05, 0x95, 0x80, 0x46, 0x0b, 0x9f, 0x82, 0x3d,
+       0x95, 0x9f, 0xa5, 0x9d, 0xde, 0x41, 0xdf, 0x28, 0x9e, 0xef, 0xdd, 0x48,
+       0x3a, 0x52, 0x86, 0x6f, 0x1c, 0x95, 0xef, 0xd5, 0x74, 0xea, 0x28, 0x3f,
+       0xa1, 0x6d, 0x71, 0xd7, 0xdf, 0xea, 0x5a, 0x9f, 0xde, 0x55, 0xfe, 0x96,
+       0x95, 0x65, 0x29, 0xea, 0x67, 0xb4, 0x4b, 0xe5, 0x7b, 0xdb, 0xc8, 0x63,
+       0x1e, 0xfc, 0xe1, 0xac, 0xf2, 0xb5, 0xff, 0x55, 0x50, 0x7d, 0x9b, 0x56,
+       0xd4, 0xd7, 0x77, 0xc7, 0x3e, 0xbb, 0xf6, 0xee, 0xd9, 0x7b, 0xca, 0xde,
+       0x0b, 0x6e, 0x1f, 0xef, 0x8e, 0xb8, 0x19, 0xde, 0xb1, 0x86, 0x19, 0xf6,
+       0xa1, 0xf9, 0x2a, 0x34, 0xb6, 0x72, 0x97, 0x57, 0x14, 0xf2, 0xd5, 0x57,
+       0xe5, 0x96, 0x59, 0x23, 0x97, 0xf7, 0x96, 0xc2, 0x10, 0x3e, 0xa2, 0xb7,
+       0x00, 0xff, 0x38, 0x7b, 0xb0, 0x22, 0xb7, 0x54, 0x89, 0xb7, 0x4f, 0x02,
+       0x7f, 0x43, 0x2e, 0x79, 0xd3, 0x13, 0xca, 0xe3, 0xbb, 0x84, 0xf6, 0x6a,
+       0xb1, 0x44, 0x9c, 0x5f, 0x10, 0xae, 0x4d, 0xb1, 0xf4, 0xb4, 0x5e, 0x9b,
+       0x23, 0xa5, 0x05, 0xe0, 0xe7, 0xcb, 0xa0, 0xfb, 0x30, 0x5c, 0x08, 0x8a,
+       0xa0, 0x9c, 0x3f, 0xc6, 0x6f, 0xd8, 0x28, 0xa5, 0x67, 0xf1, 0x7e, 0xa3,
+       0x14, 0x27, 0xc9, 0x73, 0xae, 0xe5, 0xe1, 0xb3, 0xe0, 0xa7, 0x9f, 0x41,
+       0xbf, 0x28, 0xeb, 0xe3, 0xef, 0x1f, 0xe0, 0x1d, 0xee, 0xb3, 0x58, 0xc4,
+       0x36, 0xda, 0x40, 0x1c, 0x9b, 0x6b, 0xc7, 0x35, 0xa3, 0xaf, 0x5e, 0xef,
+       0x97, 0x73, 0xbd, 0xd2, 0xdd, 0x05, 0x59, 0x8a, 0x2b, 0xc8, 0xb9, 0x12,
+       0xeb, 0x93, 0xfe, 0xfb, 0xd6, 0x19, 0x1d, 0xb1, 0xa1, 0xd9, 0xdc, 0x57,
+       0xb6, 0xe5, 0x9a, 0xd7, 0xd3, 0x20, 0x7d, 0xa8, 0x74, 0x7f, 0x01, 0x72,
+       0xc7, 0xf5, 0x37, 0xca, 0xa0, 0x96, 0x9d, 0xa4, 0x09, 0xd2, 0xc0, 0xcd,
+       0xca, 0xd0, 0xe6, 0xfb, 0x95, 0xa1, 0xcd, 0xa7, 0x41, 0x8b, 0xb8, 0xca,
+       0x8b, 0x8e, 0xa1, 0xcd, 0x2f, 0xe3, 0x8e, 0xab, 0xfc, 0xa2, 0x13, 0xf1,
+       0xf1, 0x00, 0xfc, 0xca, 0xbd, 0x25, 0xd7, 0x19, 0xad, 0x82, 0x7e, 0xcb,
+       0x71, 0x94, 0xcf, 0x13, 0xe7, 0x98, 0x3f, 0xc7, 0xd9, 0x69, 0xfb, 0x3f,
+       0x27, 0x63, 0xe5, 0x50, 0xdb, 0x5b, 0xf9, 0xd9, 0x7b, 0x71, 0x5f, 0xaf,
+       0xe5, 0x8c, 0xf2, 0xb3, 0xca, 0xc8, 0xab, 0x77, 0xe0, 0xde, 0x99, 0x3c,
+       0x22, 0x9d, 0x5e, 0x4c, 0x9e, 0x45, 0x5f, 0xdf, 0x75, 0xc6, 0xaa, 0x2f,
+       0xe3, 0xfa, 0x3e, 0xae, 0x57, 0x71, 0xbd, 0x82, 0x7e, 0x5f, 0x40, 0xf9,
+       0x7a, 0x99, 0xf7, 0x9a, 0x51, 0x5f, 0xd4, 0x68, 0xf5, 0x79, 0x67, 0xe4,
+       0xf4, 0x4b, 0xb8, 0x5c, 0x35, 0x56, 0x7d, 0xce, 0xc9, 0xcf, 0x86, 0x9b,
+       0x16, 0x7c, 0xca, 0xb0, 0xaf, 0x3a, 0xa6, 0xef, 0x0c, 0xe6, 0x00, 0x9a,
+       0x2e, 0xcf, 0x63, 0xec, 0xa7, 0x35, 0xcf, 0x0c, 0x42, 0x1f, 0xe4, 0x61,
+       0xaf, 0x8c, 0x68, 0x98, 0xb6, 0x03, 0x3e, 0xf8, 0xd3, 0x7d, 0xb8, 0xcf,
+       0x36, 0xca, 0x62, 0x82, 0xf6, 0xe5, 0x93, 0xba, 0x7e, 0xbe, 0x7c, 0xbd,
+       0xc6, 0xed, 0xf4, 0x2a, 0xfe, 0xa1, 0x4f, 0x18, 0xc9, 0x03, 0x23, 0x8d,
+       0x67, 0x4a, 0x94, 0x05, 0xd0, 0x4d, 0xa5, 0x09, 0xdc, 0x1b, 0xb5, 0x4c,
+       0x28, 0x4a, 0x24, 0x0f, 0xd8, 0x8e, 0x32, 0xa1, 0x5e, 0xee, 0x50, 0xd6,
+       0x50, 0xf6, 0x50, 0x96, 0x98, 0xf5, 0x18, 0x7d, 0x90, 0x32, 0xfc, 0x3a,
+       0xe8, 0x4d, 0xda, 0x25, 0xbe, 0xf1, 0x4d, 0xa6, 0x72, 0xca, 0xc8, 0xd3,
+       0xfd, 0x7a, 0x2d, 0xc6, 0x4a, 0x2a, 0x01, 0xc8, 0x51, 0x86, 0xeb, 0xe4,
+       0x41, 0xdc, 0xf3, 0x6a, 0x0c, 0x57, 0xfe, 0xe4, 0xfb, 0xf0, 0x9b, 0x6b,
+       0x33, 0x86, 0x7a, 0xb8, 0xca, 0xc3, 0xb8, 0xe3, 0x2a, 0xdf, 0xa8, 0x8c,
+       0x1c, 0xe1, 0x9a, 0x26, 0xed, 0x9a, 0x3e, 0x09, 0x3c, 0x70, 0x7e, 0x4a,
+       0xc7, 0x38, 0x94, 0xbf, 0x07, 0x78, 0xaf, 0x5a, 0x9f, 0x7a, 0xa3, 0x18,
+       0x1e, 0xc4, 0xd5, 0x4d, 0x7e, 0x6e, 0x31, 0xeb, 0xa5, 0x69, 0x77, 0x5d,
+       0x83, 0xe1, 0xc5, 0x04, 0xca, 0x62, 0x28, 0x6b, 0x33, 0x3a, 0x73, 0x09,
+       0x8f, 0x59, 0x8b, 0x47, 0xfe, 0x56, 0xf6, 0x37, 0xe8, 0x09, 0xb6, 0x2e,
+       0xe4, 0x35, 0xc6, 0xc5, 0x5c, 0x4e, 0xee, 0x57, 0xa3, 0x65, 0xfa, 0xc9,
+       0x94, 0xe1, 0x8c, 0x65, 0x70, 0x7e, 0xec, 0x17, 0xe5, 0x1a, 0x07, 0x81,
+       0xd4, 0xe2, 0x04, 0x4f, 0x62, 0xcd, 0xce, 0xc9, 0xa1, 0xf2, 0x47, 0xb4,
+       0xdf, 0xde, 0x78, 0xc2, 0xac, 0x87, 0xa8, 0xa8, 0x1e, 0xfa, 0x4e, 0xd0,
+       0xe6, 0xf9, 0x75, 0xfd, 0xde, 0x3d, 0xc1, 0xdf, 0x49, 0x1d, 0x4f, 0xaa,
+       0xc9, 0x7b, 0x63, 0xef, 0x14, 0x97, 0xc9, 0x3a, 0xda, 0x1d, 0x58, 0xb3,
+       0x4a, 0x3d, 0xde, 0x19, 0x47, 0xa0, 0xcc, 0x23, 0x3f, 0x1d, 0x01, 0x4f,
+       0x60, 0xf2, 0x9a, 0xf7, 0xe9, 0x83, 0xac, 0xc5, 0x4f, 0x3e, 0x6c, 0x62,
+       0x57, 0x4e, 0xc1, 0xa6, 0xdb, 0xbb, 0xd4, 0x07, 0x64, 0x65, 0x22, 0x2e,
+       0xa7, 0x4b, 0x2d, 0x32, 0x5b, 0x52, 0x6d, 0x31, 0x2b, 0x3b, 0x63, 0x92,
+       0xd4, 0xfa, 0x97, 0x76, 0xdf, 0xc0, 0x54, 0xcc, 0xd2, 0xdd, 0x8d, 0xe8,
+       0xff, 0x93, 0xd0, 0xb1, 0x15, 0xe8, 0xd8, 0x8d, 0xd0, 0xc1, 0x2b, 0x65,
+       0xc4, 0xfe, 0x86, 0xd5, 0x32, 0x82, 0x6d, 0xd2, 0xf0, 0xd6, 0x8f, 0xa0,
+       0x5d, 0x44, 0x7f, 0x71, 0x4d, 0x6b, 0x79, 0x29, 0x38, 0x7b, 0xab, 0x13,
+       0xce, 0xbe, 0xea, 0x4a, 0x1d, 0xd4, 0xe3, 0xb9, 0x62, 0x60, 0x3d, 0x5d,
+       0xa2, 0xed, 0x9a, 0x0e, 0x72, 0xc0, 0xc9, 0x3e, 0xd0, 0xdd, 0x53, 0x93,
+       0xf0, 0xef, 0x29, 0x97, 0x01, 0xf3, 0x19, 0xc0, 0x3c, 0x33, 0xe9, 0x44,
+       0xb6, 0x81, 0x30, 0x40, 0x33, 0x33, 0xd5, 0x2b, 0x0b, 0x73, 0xa4, 0x43,
+       0xc8, 0x80, 0x49, 0xac, 0x67, 0xb0, 0x0e, 0x76, 0x00, 0xc7, 0x87, 0xdc,
+       0x9e, 0xda, 0xa6, 0xdf, 0x19, 0x7d, 0xde, 0x2e, 0x0b, 0x95, 0x3b, 0x2d,
+       0x6c, 0xc7, 0xea, 0x60, 0x5b, 0xb7, 0x04, 0xdb, 0x3e, 0xc0, 0xb6, 0x7f,
+       0x4d, 0xd8, 0xd6, 0xd2, 0xc5, 0x1d, 0xb0, 0x69, 0xc8, 0x1f, 0x11, 0x5e,
+       0xdb, 0x2c, 0x3d, 0x94, 0xac, 0x1d, 0x4c, 0x9b, 0xe8, 0x87, 0x80, 0x87,
+       0x34, 0x86, 0xdf, 0xb3, 0x8f, 0x52, 0x96, 0xa1, 0x9c, 0xcf, 0x0f, 0xa1,
+       0x0e, 0x9e, 0x67, 0x13, 0x56, 0x0e, 0x7e, 0xc2, 0xc2, 0x42, 0x3b, 0x21,
+       0x0b, 0x5b, 0x79, 0xd0, 0xc9, 0xcd, 0x12, 0x86, 0x53, 0x80, 0x17, 0xef,
+       0xaa, 0xf5, 0x7d, 0xf2, 0xce, 0x7e, 0xaf, 0xb2, 0xfd, 0xb0, 0xef, 0x68,
+       0x2e, 0xeb, 0xad, 0x9e, 0x8f, 0xe8, 0x2b, 0xb2, 0xbb, 0x27, 0x9c, 0xec,
+       0xaa, 0x79, 0xd5, 0xd3, 0x1c, 0xe5, 0xad, 0x2b, 0x43, 0xa0, 0x93, 0xa1,
+       0x65, 0xb4, 0xa6, 0xdd, 0x13, 0x4b, 0xc7, 0xeb, 0xec, 0xfc, 0x0e, 0x1b,
+       0xbe, 0x09, 0xe2, 0xd0, 0x87, 0x94, 0x37, 0xff, 0xc5, 0xf8, 0xec, 0xf2,
+       0xe5, 0x06, 0xc6, 0x69, 0xcd, 0x33, 0x69, 0x93, 0xbf, 0x29, 0x93, 0x6a,
+       0xb4, 0x68, 0x7c, 0x9a, 0x76, 0x8c, 0x55, 0x6f, 0xc7, 0xbb, 0x32, 0x6c,
+       0xd6, 0xfc, 0x18, 0xd7, 0x9c, 0x3e, 0x4a, 0xe7, 0x03, 0xc3, 0x96, 0xbf,
+       0xd2, 0x93, 0x05, 0xb9, 0xd5, 0xce, 0xfd, 0xd2, 0x1a, 0x6b, 0xb7, 0x71,
+       0x69, 0xed, 0x86, 0xab, 0x2b, 0xe7, 0x28, 0xd2, 0xf1, 0x80, 0xab, 0x7d,
+       0x5e, 0xfa, 0xf0, 0x8d, 0x3e, 0xe5, 0x27, 0x6d, 0x25, 0x94, 0xcf, 0xf4,
+       0x78, 0xad, 0xf0, 0x0d, 0xbe, 0xb8, 0xca, 0xee, 0x4a, 0x59, 0xb9, 0x49,
+       0xff, 0x38, 0x1a, 0xa3, 0x60, 0xe5, 0x64, 0x01, 0xfd, 0x4f, 0x38, 0x43,
+       0xd5, 0xb5, 0xe4, 0x65, 0x24, 0x27, 0x39, 0x9f, 0x7b, 0xe5, 0x8e, 0x07,
+       0xc9, 0xa3, 0x25, 0x6d, 0x5f, 0x5f, 0xb3, 0xe7, 0x30, 0xf0, 0x47, 0xf8,
+       0x17, 0x36, 0xc3, 0x64, 0x80, 0xce, 0xcd, 0xca, 0xa8, 0x5d, 0xb7, 0xd1,
+       0xa5, 0xf5, 0xe7, 0x35, 0x0c, 0xdd, 0xc8, 0x58, 0xae, 0xb2, 0x30, 0x6b,
+       0x3b, 0x16, 0x76, 0xdd, 0x4a, 0x5b, 0x96, 0x73, 0xa0, 0x3d, 0xdb, 0x68,
+       0x6c, 0xc1, 0x32, 0xed, 0x4f, 0xca, 0x2e, 0xda, 0x9f, 0x57, 0x37, 0x4a,
+       0x33, 0xe7, 0x93, 0xb5, 0x65, 0xb4, 0x53, 0x57, 0xce, 0x6f, 0xa5, 0x5f,
+       0x49, 0x38, 0x09, 0xb7, 0xa1, 0xad, 0x94, 0x22, 0x6c, 0xa1, 0x0c, 0x07,
+       0xd7, 0xe9, 0x35, 0x50, 0xb4, 0x5d, 0xf7, 0x34, 0x34, 0x9a, 0x38, 0xf6,
+       0x5e, 0xf4, 0xcf, 0x31, 0xc9, 0x7f, 0xbc, 0xd3, 0xce, 0x5f, 0x4b, 0x96,
+       0xd5, 0xeb, 0x9e, 0x2b, 0x97, 0xf0, 0x37, 0xb4, 0x6c, 0x8d, 0x22, 0xfc,
+       0x45, 0x74, 0x51, 0x8f, 0x43, 0xd2, 0x04, 0x69, 0x21, 0xa2, 0xc5, 0x9d,
+       0x56, 0xdf, 0x44, 0xb4, 0xb7, 0x15, 0xb4, 0x77, 0x1f, 0xf0, 0x44, 0x19,
+       0xce, 0x78, 0xde, 0x16, 0x3c, 0x1f, 0xc7, 0x73, 0xc4, 0x27, 0x91, 0x0c,
+       0xa7, 0x4d, 0xb4, 0x52, 0x8e, 0x53, 0x86, 0xc7, 0x61, 0xf7, 0x50, 0xd6,
+       0x6f, 0xb7, 0xfc, 0x94, 0xb3, 0xbc, 0x44, 0x5d, 0xf0, 0xfb, 0xe8, 0xe7,
+       0x86, 0x46, 0x63, 0xa7, 0x17, 0x1b, 0x29, 0x5f, 0x37, 0xcb, 0x91, 0xba,
+       0xb2, 0xcb, 0xc9, 0xef, 0xfa, 0x39, 0x6f, 0xff, 0x7f, 0x30, 0xe7, 0xe4,
+       0x8a, 0x39, 0x7b, 0x76, 0xce, 0x55, 0xbc, 0x6f, 0xc5, 0xfb, 0x16, 0xea,
+       0x82, 0x54, 0x4d, 0xde, 0x58, 0x5c, 0x68, 0x7d, 0x56, 0x2f, 0x27, 0x22,
+       0x19, 0xc1, 0x79, 0x1d, 0xb5, 0x73, 0xf8, 0x7c, 0xdd, 0xbc, 0x8e, 0xbe,
+       0x89, 0x79, 0xb5, 0x2f, 0x9b, 0xd7, 0xde, 0xcb, 0xce, 0x6b, 0x2d, 0x1e,
+       0x27, 0x2f, 0x47, 0xf3, 0x8b, 0xcb, 0x81, 0x12, 0xe7, 0x38, 0x84, 0x39,
+       0x12, 0x86, 0x68, 0x8e, 0x19, 0x3b, 0x47, 0x51, 0x1d, 0x7b, 0x7e, 0x0a,
+       0xbf, 0xeb, 0xe7, 0x47, 0xdd, 0xff, 0xf7, 0xa0, 0xe9, 0x26, 0xf8, 0xc4,
+       0x4d, 0x56, 0xfe, 0x3f, 0x29, 0xb7, 0x96, 0xb9, 0xd6, 0xe9, 0xac, 0xc8,
+       0x7e, 0x75, 0xa8, 0xfc, 0x72, 0x23, 0xf7, 0x11, 0xf6, 0x06, 0x56, 0x8f,
+       0x41, 0x5f, 0xec, 0x83, 0xcd, 0x37, 0x54, 0x52, 0x7d, 0x31, 0x09, 0xc3,
+       0xdb, 0x82, 0x66, 0x8c, 0xbd, 0x49, 0xfb, 0xaa, 0xab, 0x63, 0xf8, 0xcf,
+       0x36, 0x8a, 0x4f, 0x7b, 0x83, 0xfa, 0x1c, 0xfa, 0xee, 0x24, 0x6d, 0xb0,
+       0x1c, 0xec, 0xe4, 0x6c, 0x32, 0xa6, 0x6d, 0x31, 0xea, 0xc4, 0x74, 0x32,
+       0x2b, 0x15, 0xc9, 0x9f, 0xcc, 0x26, 0xe1, 0xd8, 0x62, 0x0c, 0xd8, 0x6a,
+       0xb0, 0x21, 0x6f, 0x85, 0xac, 0xb9, 0xb5, 0x7a, 0x50, 0xdd, 0x02, 0x7b,
+       0xe7, 0x96, 0xd3, 0xef, 0x53, 0xb7, 0xc1, 0xd6, 0xb9, 0xed, 0xf4, 0x8d,
+       0xea, 0x10, 0x6c, 0x9b, 0x43, 0xb0, 0x73, 0x0e, 0x55, 0x69, 0x7b, 0xde,
+       0x0c, 0xba, 0x6b, 0x87, 0x1e, 0xe2, 0x5c, 0xb8, 0x26, 0xb4, 0x71, 0x38,
+       0x3f, 0xe2, 0xfe, 0x0b, 0x5c, 0x83, 0x20, 0xa5, 0x76, 0x34, 0x71, 0x5d,
+       0x5a, 0x97, 0x95, 0xbd, 0x96, 0xac, 0x8a, 0xf4, 0xd3, 0x06, 0x1b, 0x4f,
+       0x32, 0x7e, 0xe5, 0xe5, 0x69, 0x8b, 0x34, 0xe2, 0x01, 0xcf, 0xc4, 0x1f,
+       0x69, 0xab, 0x7e, 0xfe, 0x57, 0x36, 0x89, 0x9f, 0xc3, 0xf8, 0xf7, 0x42,
+       0xbe, 0xd6, 0xd3, 0x14, 0xef, 0x5e, 0x1d, 0x7f, 0x50, 0x06, 0x47, 0xf4,
+       0xb0, 0xf3, 0x35, 0xe4, 0xef, 0x65, 0xe9, 0xe9, 0x9e, 0x58, 0x26, 0x0c,
+       0x47, 0xfb, 0x64, 0x13, 0xe3, 0x01, 0xb9, 0x6a, 0x2d, 0x26, 0xa0, 0xfc,
+       0xfa, 0x98, 0x00, 0xfd, 0xac, 0x4f, 0x03, 0xbf, 0xd3, 0xb8, 0x44, 0x46,
+       0x18, 0x77, 0xa8, 0x46, 0x76, 0xf9, 0x57, 0xac, 0x5d, 0x1e, 0xc1, 0x91,
+       0x02, 0x1c, 0x46, 0x3e, 0xaf, 0xd6, 0x73, 0xcb, 0xf5, 0x77, 0x61, 0xc9,
+       0xa6, 0x4d, 0xc9, 0x81, 0xb2, 0xb6, 0x13, 0x21, 0x83, 0x89, 0x9b, 0x7a,
+       0x19, 0x9c, 0xb4, 0x76, 0x14, 0xea, 0x68, 0xf9, 0xb9, 0x5a, 0x76, 0x52,
+       0xee, 0x31, 0x6e, 0xff, 0x40, 0x40, 0x5a, 0x7f, 0x97, 0x64, 0x97, 0xe2,
+       0xf6, 0x02, 0x7a, 0x93, 0x20, 0x96, 0xd1, 0x7b, 0x7a, 0xde, 0x8c, 0xec,
+       0x93, 0x81, 0x04, 0x63, 0xa0, 0x8c, 0xf3, 0xf9, 0x85, 0x19, 0xe9, 0x66,
+       0x8c, 0x03, 0x16, 0x7c, 0xa3, 0x8c, 0x78, 0xa1, 0xec, 0x0d, 0x1c, 0x1d,
+       0x53, 0x36, 0xba, 0xf6, 0x62, 0x93, 0xb1, 0x5d, 0x1d, 0x1d, 0x17, 0x5e,
+       0x00, 0xf5, 0x2d, 0x68, 0xfb, 0x56, 0x69, 0xfd, 0x3b, 0xaf, 0xeb, 0xfc,
+       0x41, 0x53, 0x14, 0xdf, 0x5c, 0xf0, 0x62, 0xb6, 0x5e, 0x7d, 0xf9, 0xd7,
+       0x6c, 0xdc, 0xba, 0x1b, 0xb2, 0x3f, 0x2a, 0xfb, 0xde, 0x1a, 0x65, 0xb1,
+       0xf8, 0xea, 0xb2, 0xcd, 0x6b, 0x94, 0x99, 0x78, 0xe1, 0x50, 0x69, 0x27,
+       0xde, 0x4d, 0x68, 0xdf, 0x5d, 0xf4, 0x9e, 0x5b, 0xb7, 0x14, 0x96, 0xea,
+       0x6c, 0xb0, 0x7e, 0x19, 0x63, 0xc7, 0x26, 0x66, 0x9c, 0xd7, 0x31, 0xe3,
+       0x1e, 0x6f, 0x8f, 0xd2, 0x7b, 0x2c, 0xb7, 0x33, 0xfe, 0x78, 0x48, 0xe3,
+       0x85, 0x38, 0xf9, 0x02, 0x63, 0xc3, 0x05, 0xee, 0x0f, 0xa7, 0xd4, 0xe5,
+       0x68, 0xbb, 0x66, 0x9b, 0x98, 0x75, 0xa3, 0x5d, 0xdc, 0x22, 0x83, 0xb0,
+       0x15, 0x86, 0x4a, 0xad, 0xb2, 0x77, 0xea, 0xa3, 0xeb, 0xa8, 0xb7, 0xf6,
+       0x4d, 0x19, 0x7f, 0xf0, 0x10, 0xf8, 0x2a, 0x2b, 0x84, 0x31, 0x1d, 0x88,
+       0xd0, 0x26, 0x5e, 0x6d, 0x0b, 0xbf, 0x76, 0x7f, 0xf7, 0x5f, 0xa6, 0x3f,
+       0x07, 0xb6, 0xc3, 0x1b, 0xed, 0xaf, 0x59, 0x06, 0xa7, 0x22, 0x5c, 0xa9,
+       0x1f, 0xb1, 0x5d, 0xec, 0x32, 0xed, 0xb4, 0x5d, 0x22, 0x4f, 0x2d, 0xc9,
+       0xe2, 0x9d, 0xb0, 0x99, 0x24, 0xcc, 0xf5, 0x49, 0x7b, 0x4c, 0x74, 0x8c,
+       0x27, 0x30, 0xb2, 0xb9, 0x8b, 0x7b, 0x3e, 0xa0, 0x7f, 0x63, 0xab, 0x98,
+       0x78, 0x6a, 0x64, 0xa7, 0xac, 0x45, 0xbb, 0xd7, 0x5b, 0xda, 0xe5, 0xbe,
+       0xee, 0x3e, 0xca, 0x5c, 0xac, 0x89, 0xa1, 0xe3, 0xbd, 0x25, 0x49, 0x45,
+       0x74, 0xbc, 0x20, 0xd9, 0x65, 0x74, 0xbc, 0x20, 0x83, 0x9a, 0x8e, 0x1b,
+       0x97, 0xd1, 0x71, 0xbb, 0xa5, 0xe3, 0x8f, 0xc6, 0x0d, 0x5d, 0x28, 0xad,
+       0xa7, 0x48, 0xa7, 0x86, 0x8e, 0x1d, 0x4d, 0xc7, 0x0b, 0xb8, 0xbb, 0xfe,
+       0xc7, 0x6c, 0x9d, 0x98, 0x2d, 0xe3, 0xef, 0xa8, 0x8c, 0x72, 0x71, 0x2a,
+       0x6e, 0xf4, 0xd2, 0x20, 0xe8, 0x28, 0x2a, 0xff, 0x4d, 0x4b, 0x9f, 0xf5,
+       0x65, 0x26, 0x3e, 0x32, 0x54, 0x3a, 0xb2, 0x82, 0x3e, 0x07, 0x41, 0x9f,
+       0x51, 0x9d, 0xd7, 0xa2, 0xcf, 0x66, 0xbb, 0x9f, 0x91, 0xd4, 0x7b, 0xff,
+       0xd9, 0x84, 0xa1, 0xd5, 0x5b, 0xf4, 0xdc, 0x39, 0xef, 0x0b, 0x6f, 0x80,
+       0x56, 0xcd, 0xda, 0x5c, 0xac, 0xf9, 0xdb, 0x8c, 0x45, 0xa5, 0x4c, 0x6c,
+       0x9b, 0x71, 0xd2, 0xcb, 0xd9, 0x8e, 0x2f, 0xd5, 0xf9, 0x15, 0x1b, 0xa4,
+       0xc0, 0xbc, 0x87, 0xea, 0x46, 0xc6, 0xa2, 0x47, 0xdc, 0x4c, 0x9f, 0x64,
+       0x2b, 0xed, 0xa9, 0x62, 0x89, 0x7e, 0xd1, 0xab, 0x36, 0x37, 0x02, 0xcf,
+       0x95, 0x16, 0x79, 0xb4, 0x44, 0xda, 0x3a, 0x62, 0x70, 0xb1, 0x26, 0xad,
+       0x73, 0xad, 0xd9, 0x4f, 0xbd, 0x0e, 0xe8, 0x83, 0xee, 0xa1, 0xcd, 0xae,
+       0xe5, 0x3e, 0xde, 0xb5, 0xa7, 0x72, 0xa5, 0xa8, 0x5f, 0xee, 0x3f, 0x70,
+       0x4f, 0xb8, 0x3d, 0xd5, 0x51, 0xf1, 0x6d, 0x9c, 0x79, 0x23, 0x9e, 0xfb,
+       0xa4, 0xa3, 0xa2, 0xe4, 0x03, 0x53, 0x2d, 0x72, 0x7b, 0xc9, 0x95, 0x0f,
+       0xa1, 0xfd, 0x07, 0x4b, 0x1e, 0xfc, 0xfb, 0xff, 0x1d, 0xa7, 0x9d, 0x79,
+       0xa8, 0xc4, 0x7d, 0x50, 0x47, 0xdb, 0x2a, 0xcb, 0xf7, 0x86, 0x63, 0xd2,
+       0xd1, 0x55, 0x84, 0xe7, 0x23, 0xee, 0x7e, 0xc0, 0xd1, 0x94, 0xc9, 0xc8,
+       0x77, 0xfa, 0x36, 0xa1, 0x2c, 0xca, 0xf1, 0x18, 0x76, 0x4c, 0xfc, 0xb8,
+       0x5f, 0xde, 0x59, 0xcd, 0xc8, 0x0d, 0x55, 0xb3, 0x77, 0x5b, 0xdb, 0x9b,
+       0x4d, 0x7b, 0xf3, 0xd0, 0x67, 0x59, 0x2f, 0x0c, 0x2f, 0xfa, 0xa0, 0xa2,
+       0xe3, 0xae, 0xc4, 0xbb, 0xd2, 0xc9, 0x79, 0x31, 0xcf, 0x97, 0x2a, 0xff,
+       0x1c, 0x8e, 0x24, 0x5c, 0xf9, 0x8e, 0xcf, 0x39, 0xf6, 0xcb, 0xf5, 0x95,
+       0xfa, 0xb1, 0xb9, 0x3f, 0x1b, 0x5b, 0xc7, 0xfd, 0x90, 0x5c, 0xf5, 0x9f,
+       0xe3, 0x8c, 0xdb, 0xd3, 0x87, 0xe9, 0xf8, 0x31, 0xee, 0x87, 0xbb, 0xb8,
+       0x83, 0x0e, 0x13, 0xb0, 0x21, 0xae, 0x01, 0x8c, 0xd7, 0x30, 0x96, 0xc6,
+       0x18, 0x1a, 0x9f, 0xbf, 0x8c, 0x71, 0xd9, 0xf6, 0x93, 0xd6, 0xfe, 0x3e,
+       0xb2, 0xc4, 0x8b, 0x6b, 0xeb, 0xb1, 0x8d, 0x23, 0xf1, 0x8c, 0x38, 0xf1,
+       0x9f, 0x48, 0xca, 0x3a, 0xbf, 0x7e, 0x7c, 0xee, 0x47, 0xc3, 0xa2, 0xec,
+       0x13, 0x77, 0xdf, 0xee, 0x7e, 0x19, 0xc4, 0xfc, 0x86, 0x56, 0xcd, 0xef,
+       0x1e, 0x61, 0xbc, 0xf6, 0x52, 0x89, 0x73, 0xa8, 0xcd, 0x4b, 0xfd, 0xb6,
+       0x99, 0x57, 0xbc, 0x6b, 0xe5, 0x7c, 0x74, 0x7b, 0x75, 0x0a, 0xb0, 0x7c,
+       0x49, 0xe7, 0x42, 0x84, 0xe1, 0x5b, 0xbb, 0x2e, 0x85, 0xa9, 0x2b, 0xd2,
+       0xdd, 0xf3, 0xb5, 0x7d, 0xa4, 0x91, 0x58, 0x26, 0xab, 0xf5, 0x23, 0x9e,
+       0x53, 0xf9, 0xca, 0x7e, 0xac, 0xa3, 0xb8, 0xf9, 0x5e, 0x57, 0xf3, 0x5d,
+       0xde, 0xdf, 0x6f, 0xf7, 0xca, 0x22, 0x9f, 0x2c, 0x0c, 0x95, 0xbf, 0x52,
+       0x0e, 0x51, 0xff, 0x61, 0xee, 0xf2, 0x98, 0xdd, 0x3f, 0xe8, 0x66, 0x7c,
+       0x0c, 0xb4, 0x18, 0x07, 0xdd, 0xf9, 0xf8, 0xdd, 0x82, 0xfb, 0x1e, 0xd8,
+       0x3f, 0x01, 0xec, 0x23, 0x49, 0x28, 0x23, 0x6b, 0xc0, 0x1b, 0x5d, 0x05,
+       0xa5, 0xc8, 0xeb, 0x5e, 0x6a, 0xbc, 0x92, 0x48, 0x4d, 0x56, 0x9e, 0x60,
+       0x7b, 0xd4, 0x5d, 0x2b, 0x36, 0x68, 0xf2, 0x6c, 0xbe, 0x58, 0xe5, 0x18,
+       0xa4, 0xfb, 0x37, 0x32, 0x86, 0x6b, 0xfb, 0x66, 0x9f, 0x11, 0x5e, 0x5c,
+       0xba, 0xf8, 0xf8, 0xb7, 0xdf, 0xfa, 0x3a, 0x9c, 0xdf, 0x13, 0x16, 0xee,
+       0x95, 0xe3, 0x3e, 0xaf, 0xed, 0xa1, 0xc7, 0xab, 0xb4, 0x41, 0xb9, 0x8f,
+       0x94, 0x7e, 0x64, 0x5a, 0x08, 0x47, 0x18, 0x3e, 0x1b, 0x18, 0x5b, 0xe0,
+       0x8b, 0x55, 0xee, 0x99, 0x84, 0xe1, 0xdf, 0xd2, 0xce, 0x3e, 0x58, 0xc6,
+       0x78, 0x11, 0x0e, 0x76, 0x16, 0x5c, 0xc8, 0xd9, 0x89, 0x3e, 0xe2, 0x57,
+       0xe0, 0xf1, 0x76, 0x79, 0x07, 0x24, 0x9e, 0xfa, 0x78, 0xa5, 0x25, 0x75,
+       0x67, 0xc5, 0x03, 0x9e, 0x39, 0xef, 0x44, 0x6a, 0xcc, 0xce, 0x39, 0x5f,
+       0x21, 0x7e, 0x5f, 0x6b, 0xbf, 0xf3, 0xf9, 0x65, 0xfe, 0x17, 0x61, 0xaa,
+       0xc1, 0x42, 0xd8, 0x52, 0x16, 0x37, 0x61, 0xf8, 0xf7, 0x01, 0xc7, 0xdc,
+       0x0f, 0x1f, 0x46, 0x26, 0x30, 0x6e, 0x61, 0x8b, 0x22, 0x1e, 0xe2, 0xa9,
+       0x3b, 0x30, 0xf6, 0xc7, 0x31, 0xf6, 0xed, 0x15, 0x8e, 0x07, 0xd9, 0x83,
+       0xb9, 0x4f, 0x54, 0x23, 0x78, 0xd7, 0x1a, 0x3b, 0x5a, 0xf3, 0x6e, 0x6b,
+       0x33, 0x46, 0xcf, 0x1a, 0x91, 0x6d, 0x0a, 0xbe, 0x63, 0xae, 0xba, 0xb0,
+       0xd9, 0x95, 0x9f, 0x81, 0x1c, 0x0f, 0xe5, 0x51, 0xc8, 0xc7, 0x05, 0x4d,
+       0x37, 0xb9, 0xed, 0xfc, 0x3f, 0x26, 0x4f, 0xad, 0x63, 0xbc, 0x7a, 0xc0,
+       0xa7, 0x2d, 0xbc, 0x18, 0x2e, 0xf8, 0x94, 0xf7, 0x1b, 0x64, 0xda, 0x2b,
+       0x74, 0x43, 0xf7, 0xa0, 0x6c, 0x23, 0xfd, 0xf7, 0x54, 0x2e, 0x96, 0x4e,
+       0x8d, 0x0b, 0x73, 0xbe, 0x98, 0x13, 0xc1, 0xbc, 0x26, 0xca, 0x06, 0x17,
+       0x32, 0x94, 0x6b, 0x68, 0xc6, 0x1b, 0xaf, 0xd4, 0xea, 0x1e, 0x16, 0xee,
+       0x4d, 0xa6, 0x93, 0x87, 0xb4, 0xbd, 0x23, 0x32, 0x5a, 0x62, 0xdd, 0xdd,
+       0xb0, 0x76, 0xfc, 0xba, 0xfa, 0x3a, 0x57, 0x0d, 0x7c, 0x1e, 0xc5, 0xc5,
+       0xe2, 0xcc, 0x29, 0x79, 0x39, 0xd6, 0x27, 0x2f, 0xd3, 0x8e, 0x1d, 0x00,
+       0x6d, 0x7b, 0xbe, 0xce, 0x2b, 0xd1, 0xe5, 0xb9, 0x40, 0x16, 0x73, 0xfd,
+       0x3d, 0xb4, 0xdb, 0x0b, 0x4a, 0xf3, 0x84, 0x28, 0xb4, 0x8d, 0xe7, 0x2b,
+       0x32, 0x98, 0x2f, 0xd9, 0xd8, 0xd1, 0x30, 0xe7, 0xbc, 0xa1, 0x6e, 0xee,
+       0x1b, 0xc5, 0x05, 0x4c, 0x83, 0xb1, 0x94, 0xd3, 0xe0, 0x7f, 0xaa, 0xc5,
+       0xd8, 0x10, 0xd0, 0x23, 0xad, 0xf7, 0xb7, 0x71, 0x6f, 0x56, 0xc1, 0x27,
+       0x57, 0x6d, 0x1f, 0xbe, 0x56, 0x65, 0xfe, 0x32, 0x09, 0xbd, 0x6a, 0x65,
+       0x65, 0x7c, 0xb0, 0x63, 0x89, 0xbe, 0x39, 0xbe, 0xb4, 0xc5, 0xfc, 0xd4,
+       0xe0, 0x40, 0x45, 0x54, 0x2c, 0xe3, 0xc5, 0x07, 0x2a, 0xcb, 0x69, 0xfe,
+       0x8b, 0xd5, 0xcf, 0x5a, 0xdb, 0xb2, 0x3e, 0x46, 0x5b, 0xff, 0x8e, 0x7c,
+       0xb7, 0x6c, 0xff, 0x23, 0x05, 0xbe, 0xb2, 0xfb, 0xc6, 0x5c, 0x93, 0xec,
+       0x5b, 0x19, 0xd8, 0x9c, 0xd6, 0x3e, 0x1f, 0x73, 0x3b, 0xe2, 0x36, 0xbf,
+       0xce, 0xe0, 0x3a, 0x5b, 0x71, 0x64, 0x02, 0xf2, 0xe1, 0xb0, 0xfc, 0x53,
+       0x98, 0x4d, 0x98, 0xf7, 0x66, 0x7d, 0x59, 0x9f, 0x7b, 0x1b, 0xcd, 0x52,
+       0x3c, 0xed, 0x4a, 0xe1, 0x34, 0xf7, 0xd4, 0xce, 0xdd, 0x51, 0xcb, 0x0f,
+       0xa1, 0x1c, 0xe0, 0xbe, 0xb0, 0x23, 0x45, 0xf8, 0xc8, 0x83, 0xdc, 0xef,
+       0xef, 0xfd, 0x47, 0xe6, 0xea, 0xc4, 0xb9, 0x4e, 0xa6, 0x6d, 0x0b, 0xda,
+       0x36, 0xda, 0xb6, 0xc1, 0xc7, 0xdf, 0x5c, 0xdb, 0x8d, 0x68, 0x1b, 0x8f,
+       0xc6, 0x7d, 0x83, 0x6d, 0x35, 0x3e, 0xaf, 0x1d, 0x28, 0x95, 0x17, 0x5d,
+       0xdf, 0x4f, 0x8e, 0x49, 0xd6, 0x19, 0xed, 0xd3, 0xf3, 0xb9, 0x76, 0xa0,
+       0x02, 0x38, 0x12, 0x61, 0x58, 0x0c, 0x22, 0xbd, 0xce, 0x7f, 0x27, 0xa1,
+       0xde, 0x59, 0xc6, 0x7d, 0x50, 0xfa, 0x27, 0x8c, 0xba, 0x7a, 0xcc, 0xc1,
+       0x93, 0x22, 0xf7, 0x3b, 0x13, 0x9b, 0x70, 0x57, 0x1d, 0xc4, 0x49, 0xde,
+       0x67, 0xfc, 0x78, 0x93, 0x2d, 0x8f, 0xb1, 0x3c, 0xed, 0x42, 0x96, 0x98,
+       0xf2, 0x98, 0x2d, 0x07, 0x4c, 0x41, 0x31, 0x05, 0x6e, 0xb3, 0xe5, 0x7c,
+       0x56, 0xba, 0xdc, 0x3c, 0x1b, 0x1e, 0x1a, 0x11, 0xc6, 0x89, 0x72, 0xd7,
+       0x37, 0xc8, 0x4e, 0xac, 0x0f, 0x7d, 0x50, 0x47, 0x9a, 0x01, 0xc7, 0xc5,
+       0xe0, 0xc7, 0x61, 0xab, 0x87, 0xf2, 0x9d, 0xc0, 0xd0, 0xff, 0x8c, 0x74,
+       0x65, 0x95, 0xc3, 0x5c, 0x83, 0x50, 0x86, 0x82, 0x5d, 0xc9, 0xbd, 0xf8,
+       0x3d, 0xda, 0x9b, 0x92, 0x99, 0x7e, 0xd0, 0x63, 0x2f, 0x79, 0x63, 0x27,
+       0x6c, 0x28, 0xfc, 0xee, 0x6a, 0x91, 0x45, 0xaf, 0xe0, 0xad, 0x83, 0xff,
+       0x37, 0x88, 0x59, 0xcd, 0x96, 0x7c, 0xef, 0x36, 0x08, 0xb9, 0xac, 0xd7,
+       0x85, 0x7b, 0xfd, 0x7c, 0xbf, 0x8e, 0xf9, 0x9e, 0x6b, 0x96, 0x66, 0x96,
+       0xd7, 0xd7, 0x6d, 0x94, 0xfd, 0xde, 0x6e, 0x2f, 0xbe, 0xac, 0xee, 0x25,
+       0xd4, 0x65, 0x99, 0xef, 0x31, 0x17, 0x68, 0xa6, 0x42, 0x3a, 0x33, 0xb0,
+       0x76, 0x74, 0x85, 0xe1, 0xf5, 0x01, 0xc7, 0x0d, 0xc3, 0x1b, 0x82, 0x1e,
+       0xef, 0x19, 0x79, 0x2e, 0x34, 0x36, 0x5a, 0x44, 0x3b, 0xcf, 0x5a, 0x79,
+       0x1d, 0x86, 0x2f, 0x07, 0xdd, 0xf2, 0xb9, 0x6a, 0xfa, 0x1c, 0x7d, 0xf8,
+       0xf3, 0x78, 0x3e, 0x1f, 0x98, 0xfc, 0xa5, 0x3f, 0x43, 0xbb, 0x84, 0xea,
+       0x05, 0x0d, 0xfb, 0xf2, 0x59, 0xed, 0xf3, 0x13, 0x7f, 0x66, 0xcf, 0xa0,
+       0x06, 0x03, 0x26, 0xec, 0xe7, 0x36, 0x7b, 0xcc, 0x69, 0xd4, 0xf4, 0x5b,
+       0xff, 0x4e, 0xe1, 0x1d, 0xcb, 0xc2, 0xf0, 0x8a, 0xbe, 0x96, 0xf5, 0xd0,
+       0xd7, 0x93, 0xdc, 0x0b, 0x7c, 0x9f, 0xe6, 0x3f, 0x91, 0x03, 0xdc, 0xf7,
+       0x02, 0x0e, 0x95, 0xf2, 0x8f, 0x75, 0xa8, 0x74, 0x41, 0xe4, 0x2d, 0x58,
+       0x7f, 0xae, 0x31, 0x18, 0xa4, 0x15, 0xb0, 0xef, 0xfa, 0xa5, 0x66, 0x13,
+       0x9b, 0xa2, 0x6f, 0x9e, 0xdd, 0x0c, 0xdf, 0x59, 0xdb, 0x33, 0xdc, 0x57,
+       0x1f, 0x6b, 0x0d, 0xc3, 0xf7, 0x06, 0xd1, 0x9a, 0xd9, 0xd8, 0x37, 0x74,
+       0x7c, 0xbe, 0x57, 0xd6, 0x1b, 0xbb, 0x90, 0xb9, 0x8d, 0x29, 0xbd, 0x4f,
+       0xa0, 0xda, 0xa0, 0x43, 0x76, 0xfd, 0x00, 0x38, 0xe5, 0x18, 0xcc, 0x73,
+       0x8c, 0x60, 0xaa, 0xb5, 0xcf, 0xf7, 0xae, 0xb3, 0x36, 0xac, 0x0b, 0x5c,
+       0xfa, 0x5e, 0x87, 0xfa, 0x5e, 0x68, 0x74, 0x6b, 0x44, 0xc3, 0xff, 0x10,
+       0x3e, 0x98, 0x30, 0xcf, 0xb9, 0x5d, 0xec, 0x63, 0xa7, 0x8c, 0xef, 0xc2,
+       0xb3, 0x7b, 0x1d, 0xee, 0x03, 0x57, 0xc6, 0xe4, 0xaa, 0xe4, 0x80, 0xda,
+       0xe5, 0x3d, 0x28, 0x3d, 0x56, 0xc6, 0x7d, 0x09, 0xfa, 0xbe, 0x00, 0xff,
+       0xbe, 0x49, 0x1e, 0x04, 0x4d, 0xab, 0xbe, 0x74, 0x6a, 0x5e, 0xa5, 0xbb,
+       0xa7, 0x55, 0x3a, 0x18, 0x51, 0x13, 0x9c, 0x57, 0x3f, 0x71, 0x31, 0x4d,
+       0xfc, 0x96, 0x81, 0xff, 0x32, 0x70, 0x7c, 0xd9, 0x3d, 0xe3, 0xc0, 0xea,
+       0x16, 0xa3, 0xdf, 0x0a, 0x9a, 0x36, 0x8d, 0x9d, 0xff, 0xa7, 0x41, 0xb4,
+       0x86, 0x3d, 0x5e, 0x03, 0x73, 0x71, 0xd6, 0x5c, 0xa3, 0x3c, 0xd7, 0x08,
+       0x8a, 0xa1, 0x00, 0xba, 0x4f, 0xa7, 0xc6, 0xd4, 0x62, 0xb8, 0x79, 0x4f,
+       0x67, 0xf7, 0x63, 0xba, 0x9f, 0x74, 0x90, 0x55, 0x4f, 0x02, 0x9e, 0x9d,
+       0xd2, 0xb4, 0x87, 0x78, 0x26, 0xac, 0x71, 0xc6, 0xa7, 0xbc, 0x3b, 0x50,
+       0x77, 0x44, 0xe9, 0x3d, 0x6d, 0x5b, 0x87, 0x30, 0xbf, 0x1b, 0xf8, 0xa5,
+       0x1e, 0x62, 0xcc, 0xed, 0xb5, 0x74, 0x21, 0x64, 0xd2, 0x49, 0xca, 0xc0,
+       0x98, 0x89, 0x25, 0x57, 0xef, 0xe4, 0xfa, 0xd3, 0x13, 0x88, 0xbb, 0x90,
+       0x51, 0x13, 0xe0, 0xe2, 0xa3, 0x27, 0xc5, 0x6d, 0xf0, 0xbb, 0xd7, 0x1b,
+       0x3f, 0x8c, 0x3e, 0x19, 0xc7, 0x6e, 0x90, 0xe2, 0xaa, 0xf8, 0xcd, 0x24,
+       0xe0, 0x6f, 0x96, 0xf1, 0x93, 0x5c, 0x0b, 0x17, 0x32, 0x87, 0x63, 0x8b,
+       0x9b, 0xeb, 0x0d, 0xc3, 0x51, 0x96, 0x9f, 0x26, 0xff, 0x4a, 0x9a, 0xef,
+       0x0a, 0xa7, 0xe7, 0x37, 0xab, 0x65, 0xb2, 0xb6, 0xc5, 0xc2, 0xa1, 0xf1,
+       0x24, 0x93, 0x5a, 0x8e, 0x50, 0xdf, 0xcc, 0xd4, 0xc1, 0x13, 0x7c, 0x7c,
+       0xc2, 0x6f, 0x7c, 0x13, 0xf0, 0xfc, 0x0f, 0xc0, 0xd3, 0x62, 0xe1, 0x69,
+       0x5c, 0x01, 0x4f, 0x4b, 0x04, 0x0f, 0xe4, 0x1c, 0xe5, 0x6a, 0xfc, 0xda,
+       0x6c, 0x45, 0x9c, 0xa2, 0x2f, 0xed, 0x4a, 0xfb, 0x43, 0xd4, 0x37, 0x8d,
+       0xde, 0x68, 0x9f, 0x27, 0xa3, 0x5a, 0xd7, 0xb8, 0xd7, 0x76, 0x56, 0xe6,
+       0x61, 0xbd, 0x8a, 0x93, 0xf3, 0x09, 0xfb, 0x5a, 0x76, 0xd5, 0x3d, 0x90,
+       0xff, 0x0b, 0x69, 0xd7, 0xda, 0x12, 0x93, 0x01, 0xfd, 0xa0, 0x84, 0xce,
+       0x15, 0xa8, 0xc1, 0xf4, 0x12, 0x60, 0x82, 0x3c, 0x3e, 0xd9, 0xe3, 0x0d,
+       0xcb, 0x56, 0xed, 0xeb, 0x59, 0x5c, 0x63, 0x6e, 0xf1, 0xba, 0xb9, 0x41,
+       0xff, 0xa9, 0x68, 0x6e, 0x90, 0x89, 0xa8, 0x37, 0x29, 0x7f, 0x64, 0x71,
+       0xb1, 0x11, 0x73, 0x8a, 0xd7, 0xcd, 0xa7, 0x33, 0x79, 0x3b, 0xcb, 0xcc,
+       0x7c, 0xba, 0x8a, 0x7e, 0xdc, 0xe2, 0x77, 0x2d, 0x9f, 0xc4, 0xd8, 0x3d,
+       0xd3, 0x12, 0xca, 0x44, 0x80, 0x35, 0xea, 0xa6, 0x7f, 0x12, 0xb7, 0xb9,
+       0xd7, 0x0a, 0xcf, 0x1b, 0x2c, 0x7f, 0x79, 0x52, 0xd4, 0xfe, 0xe0, 0xdf,
+       0x59, 0x3e, 0x75, 0x6d, 0x9e, 0x1c, 0x7f, 0x1f, 0x5c, 0x6f, 0xf3, 0x05,
+       0x0a, 0x59, 0x79, 0x65, 0x3d, 0xed, 0x92, 0x06, 0xff, 0x57, 0x56, 0x94,
+       0xc5, 0x51, 0x76, 0x6a, 0xbd, 0x95, 0x0b, 0x28, 0xbb, 0x07, 0x7e, 0x1f,
+       0xf3, 0x3e, 0xf8, 0x8e, 0x32, 0xb8, 0x1e, 0x27, 0x3d, 0x60, 0x45, 0xf2,
+       0x3c, 0xe5, 0x22, 0x6d, 0x4a, 0xcc, 0x51, 0x6d, 0x8f, 0xe2, 0xf2, 0xf8,
+       0xbd, 0x96, 0xed, 0x4f, 0x7c, 0x13, 0xd7, 0xf2, 0x8d, 0x09, 0xf0, 0xfd,
+       0xe1, 0xc0, 0x71, 0x67, 0x98, 0x57, 0xa0, 0x69, 0xb8, 0xbe, 0xef, 0x1b,
+       0x18, 0x26, 0xb4, 0xb4, 0x4c, 0x7a, 0x21, 0x4f, 0x3b, 0xd2, 0x44, 0x5d,
+       0x7c, 0xd2, 0xd3, 0x39, 0xee, 0x39, 0xad, 0x97, 0xeb, 0xd7, 0xb1, 0x09,
+       0xba, 0x26, 0x61, 0x78, 0xd4, 0x33, 0xfb, 0xe7, 0xb5, 0xfe, 0x46, 0xd0,
+       0x1f, 0xed, 0x34, 0xf8, 0xfd, 0x3e, 0xa3, 0x43, 0x94, 0x5f, 0x8e, 0xab,
+       0xae, 0xd6, 0x7e, 0x6b, 0x5c, 0xe7, 0x37, 0x2d, 0xd5, 0x1d, 0xb3, 0x63,
+       0x93, 0x6e, 0xcd, 0x7e, 0x42, 0x6d, 0x7c, 0x71, 0xd4, 0x2e, 0x01, 0x95,
+       0x35, 0xca, 0x44, 0x1f, 0x69, 0x94, 0x73, 0xd7, 0x36, 0xd4, 0xb5, 0xb4,
+       0x23, 0x0c, 0x7d, 0xd2, 0x76, 0x72, 0xaf, 0xcd, 0x97, 0x1a, 0x8d, 0xcf,
+       0x92, 0x90, 0x2d, 0x0d, 0x3a, 0x2f, 0x01, 0x65, 0x95, 0x48, 0x97, 0xb9,
+       0x32, 0xd3, 0xfb, 0x7f, 0xc2, 0xec, 0x41, 0xd6, 0x5d, 0x33, 0x0f, 0x20,
+       0x39, 0x2d, 0x1a, 0x4f, 0x5f, 0xab, 0xe1, 0xc9, 0xce, 0x2d, 0xb1, 0x72,
+       0x6e, 0x70, 0x6a, 0xfd, 0x7b, 0x20, 0x3b, 0xb9, 0x4e, 0x26, 0xe7, 0xfc,
+       0x9c, 0x38, 0x6e, 0xae, 0x7b, 0xad, 0xb9, 0x4d, 0x46, 0x78, 0xe5, 0xdc,
+       0x40, 0xab, 0xd1, 0xbc, 0x48, 0xdb, 0x09, 0xbd, 0xef, 0xa4, 0x14, 0x61,
+       0xd9, 0xb8, 0x02, 0xb7, 0x11, 0xdd, 0x19, 0x9a, 0xfb, 0xa2, 0xa6, 0xb9,
+       0x16, 0x4b, 0x73, 0xa8, 0xeb, 0x71, 0x1f, 0xfd, 0xbe, 0x96, 0x1a, 0xcd,
+       0x6d, 0xb0, 0x34, 0xa7, 0x5a, 0xcc, 0x1e, 0x7b, 0xb9, 0xc5, 0xec, 0x71,
+       0x25, 0x57, 0x3c, 0xbf, 0x93, 0xcf, 0xf0, 0xc5, 0xa2, 0xe7, 0x7a, 0x58,
+       0xcf, 0x03, 0xd6, 0x7a, 0x59, 0xd3, 0x64, 0xe3, 0x78, 0xdc, 0x8f, 0xa7,
+       0xdf, 0xe7, 0xca, 0xa3, 0xb0, 0x83, 0x8a, 0x95, 0x1f, 0x84, 0xf3, 0xf0,
+       0xfd, 0x26, 0x96, 0x74, 0xef, 0x4c, 0x0b, 0xf9, 0x6d, 0x1a, 0xbf, 0x8e,
+       0xd4, 0xf9, 0x3c, 0x98, 0x2f, 0xca, 0xfe, 0x19, 0xeb, 0x01, 0xb9, 0xbc,
+       0x54, 0x97, 0x31, 0x10, 0xe3, 0xe3, 0x9c, 0xab, 0xb6, 0xdb, 0xfd, 0x49,
+       0xca, 0xf9, 0xbb, 0xe1, 0x13, 0xdd, 0x03, 0x3d, 0x49, 0xfa, 0xee, 0xd8,
+       0x60, 0xf2, 0x89, 0x13, 0xd0, 0x63, 0x3f, 0x6f, 0x73, 0xab, 0x6e, 0xbf,
+       0x7d, 0xed, 0x5c, 0x62, 0xd0, 0xbe, 0x43, 0x9a, 0x79, 0xdb, 0x06, 0x13,
+       0x83, 0xde, 0xba, 0x81, 0x7c, 0xa6, 0x76, 0xed, 0xda, 0xa8, 0xf9, 0xc2,
+       0x89, 0x9e, 0xab, 0x2b, 0x9e, 0xa3, 0x76, 0x7f, 0xb3, 0x71, 0x79, 0xbb,
+       0xa8, 0xfc, 0xce, 0x4d, 0xcb, 0xcb, 0xff, 0xa3, 0xb7, 0xbc, 0x7d, 0xe3,
+       0xe6, 0xe5, 0xcf, 0x7b, 0x57, 0x3c, 0x7f, 0x64, 0xc5, 0xf3, 0xef, 0xad,
+       0x78, 0xde, 0xd1, 0xba, 0xfc, 0xf9, 0x43, 0x2b, 0x9e, 0x4f, 0xb5, 0xae,
+       0x0d, 0xef, 0x42, 0xeb, 0x72, 0xb8, 0xee, 0xd6, 0xfb, 0x07, 0xd3, 0x55,
+       0x57, 0xf6, 0x96, 0xf0, 0xde, 0x79, 0xdf, 0x16, 0xa3, 0xd7, 0xea, 0xdf,
+       0x33, 0x5e, 0xb7, 0x7b, 0xcb, 0xf2, 0xfe, 0x6a, 0xed, 0xf6, 0xd5, 0xda,
+       0x05, 0xb5, 0x76, 0x46, 0xb6, 0xcd, 0x54, 0xf9, 0x8e, 0xe5, 0x51, 0xbf,
+       0xa6, 0xed, 0x44, 0xd9, 0xd7, 0x39, 0xb7, 0xc3, 0x3a, 0xe7, 0x36, 0x05,
+       0x3e, 0xbc, 0x5b, 0xc7, 0xa8, 0x36, 0xc3, 0x50, 0x1e, 0xaf, 0x6e, 0xd4,
+       0x71, 0x2a, 0xd1, 0x79, 0xb7, 0xc3, 0xb0, 0x6d, 0x99, 0x6b, 0x1b, 0xca,
+       0xfe, 0xc0, 0xdc, 0x4d, 0xee, 0xed, 0xb1, 0x70, 0xc0, 0x0b, 0xc3, 0x71,
+       0xff, 0x76, 0x9b, 0x7f, 0x86, 0x7b, 0xd5, 0xb4, 0xa1, 0x0e, 0x7e, 0x0c,
+       0x3a, 0xb8, 0xa6, 0x7b, 0xef, 0xc6, 0x58, 0xf3, 0xa0, 0x99, 0x3e, 0xf9,
+       0x9d, 0x6a, 0xfa, 0xf3, 0xa2, 0xcf, 0x16, 0xf5, 0xc2, 0x86, 0x9b, 0xbf,
+       0xf3, 0xbd, 0x7e, 0x00, 0x5b, 0x2f, 0x94, 0x87, 0x83, 0x7e, 0xd0, 0x50,
+       0x37, 0xec, 0x3d, 0x5f, 0xfb, 0xa5, 0x8f, 0x6b, 0xda, 0x22, 0x8d, 0x31,
+       0xdf, 0x86, 0x76, 0x81, 0x13, 0xcf, 0xf5, 0xfe, 0xb1, 0x89, 0xd3, 0x04,
+       0x9d, 0xde, 0x97, 0xc0, 0xb7, 0x43, 0xfe, 0x0e, 0xf8, 0x28, 0xa4, 0x21,
+       0xc6, 0xd3, 0xb6, 0xdb, 0x7c, 0xc7, 0x36, 0x99, 0x76, 0x19, 0x77, 0x4c,
+       0xf7, 0x8f, 0x08, 0xe7, 0x9d, 0x4e, 0xa6, 0x94, 0xb6, 0xab, 0xc2, 0x03,
+       0x01, 0x73, 0x79, 0xb9, 0x67, 0x43, 0x7e, 0x1e, 0xbe, 0x6b, 0xc2, 0x2f,
+       0x78, 0x31, 0x9b, 0xff, 0x9b, 0x2b, 0x19, 0xda, 0x1c, 0x23, 0x6d, 0xc2,
+       0x9f, 0x5a, 0xe8, 0xfd, 0xbb, 0x90, 0xf6, 0x7d, 0x4a, 0x91, 0xf6, 0xbf,
+       0x17, 0xce, 0xba, 0xec, 0x8b, 0x70, 0x0f, 0xdf, 0x95, 0xd3, 0xb8, 0xba,
+       0x5b, 0x0e, 0x97, 0x69, 0x0b, 0xc7, 0x75, 0x7e, 0xc8, 0x68, 0x40, 0x3b,
+       0x2d, 0x0e, 0x3c, 0x8e, 0x01, 0x7f, 0x2d, 0xb0, 0xb9, 0x6f, 0x44, 0x9d,
+       0x98, 0x8c, 0x0c, 0xb7, 0x80, 0xf7, 0xc8, 0x9f, 0xbc, 0xbb, 0xa8, 0xef,
+       0xc9, 0x5c, 0x69, 0x44, 0xe7, 0xef, 0x3d, 0x8e, 0xb6, 0x4f, 0xe0, 0x9a,
+       0x29, 0x7d, 0x18, 0x6d, 0xde, 0xaf, 0xeb, 0xcf, 0x4c, 0x32, 0x17, 0x5a,
+       0x20, 0x97, 0x3e, 0x21, 0xc5, 0xd9, 0x0e, 0x19, 0x49, 0xcc, 0x4f, 0xbb,
+       0x4b, 0x71, 0x99, 0x47, 0x37, 0x70, 0xcf, 0xa4, 0x78, 0x35, 0xf7, 0x97,
+       0xc5, 0x1d, 0xde, 0xad, 0xba, 0x5b, 0xb5, 0xcf, 0xd5, 0x2f, 0x43, 0xd5,
+       0x8c, 0xdc, 0x54, 0x7d, 0x62, 0x8b, 0x89, 0x45, 0x2d, 0x8b, 0x6f, 0x1d,
+       0xd3, 0x52, 0xe5, 0x84, 0xcb, 0xf3, 0x59, 0x32, 0x73, 0x56, 0x24, 0x76,
+       0x22, 0x8a, 0x4d, 0xb2, 0xcc, 0x93, 0x8e, 0xab, 0x01, 0xd7, 0x59, 0xc8,
+       0xd6, 0x44, 0x5c, 0x3e, 0xbb, 0x2b, 0x1a, 0xab, 0x10, 0x4e, 0xed, 0x2a,
+       0xc8, 0x9d, 0xb8, 0xf2, 0x57, 0xa7, 0x27, 0x73, 0x8a, 0xe3, 0xfe, 0x75,
+       0x48, 0x59, 0xa6, 0x32, 0xbe, 0x14, 0x5a, 0xa3, 0xb1, 0xe1, 0xdf, 0xec,
+       0x89, 0xc6, 0xa7, 0xcd, 0x6d, 0xce, 0x56, 0x14, 0xb9, 0x8f, 0x03, 0xfa,
+       0x8b, 0x65, 0x3e, 0xb7, 0x81, 0xbe, 0xc3, 0x80, 0xb0, 0x1d, 0x64, 0xba,
+       0x62, 0xdf, 0x84, 0x93, 0xf0, 0xd7, 0xc3, 0xb9, 0x90, 0x4a, 0x00, 0x47,
+       0x85, 0xd7, 0x85, 0xb7, 0xc7, 0xf3, 0xd5, 0x5a, 0xf0, 0xde, 0x6c, 0x63,
+       0x89, 0x8c, 0x0f, 0xae, 0x03, 0xde, 0x5a, 0x50, 0x9e, 0x97, 0x89, 0x93,
+       0xb7, 0x6e, 0xe1, 0xde, 0x78, 0x83, 0xef, 0xd8, 0x1c, 0x56, 0x9e, 0x39,
+       0x9a, 0x40, 0x1d, 0xbe, 0x1f, 0x41, 0x9b, 0x74, 0x21, 0x17, 0xdb, 0x02,
+       0x9f, 0x88, 0xe3, 0x86, 0xb1, 0x8e, 0x3d, 0xcd, 0x3a, 0x27, 0x55, 0xce,
+       0x52, 0x9f, 0x47, 0x6d, 0x27, 0x74, 0xce, 0x07, 0xfc, 0xf6, 0xc2, 0x60,
+       0x8c, 0xf2, 0xab, 0x5b, 0x06, 0xa8, 0x4f, 0xce, 0x8e, 0x68, 0xda, 0xef,
+       0xdc, 0xc5, 0xf3, 0x57, 0x3d, 0xc6, 0x46, 0x4f, 0x10, 0xc6, 0x9b, 0x51,
+       0x0e, 0xfb, 0xfd, 0x35, 0x61, 0x28, 0xbc, 0x49, 0x18, 0x0a, 0x6f, 0x12,
+       0x06, 0xe2, 0x02, 0x70, 0x54, 0xaf, 0xd8, 0x18, 0xc5, 0xbe, 0xb7, 0x62,
+       0x1e, 0x47, 0xca, 0x05, 0x39, 0x5a, 0x76, 0x74, 0xdc, 0x71, 0x5e, 0x51,
+       0x26, 0x78, 0xe0, 0x49, 0xf0, 0x5e, 0x19, 0xbc, 0x59, 0x06, 0x2f, 0x96,
+       0xc1, 0x97, 0xb0, 0xff, 0xcf, 0x43, 0x3e, 0x3c, 0x81, 0xb5, 0x79, 0x7c,
+       0x19, 0x2f, 0x67, 0x35, 0x2f, 0x17, 0xcb, 0xf4, 0xd5, 0x7a, 0x2f, 0xc3,
+       0xaf, 0xae, 0x0c, 0x94, 0xd2, 0x50, 0x25, 0x8e, 0x9b, 0xef, 0xfd, 0x28,
+       0xf9, 0x55, 0x1e, 0x0c, 0x0e, 0xa2, 0xcd, 0x24, 0x68, 0x3c, 0x4d, 0x3b,
+       0x90, 0xf6, 0x4f, 0x01, 0xbc, 0x79, 0x8c, 0xbe, 0x9a, 0xba, 0x7a, 0xb3,
+       0x50, 0xbf, 0xb8, 0x7b, 0x98, 0xcb, 0xc8, 0xb9, 0xa6, 0x56, 0xe0, 0xc9,
+       0xf0, 0xef, 0x98, 0x4f, 0x3d, 0x43, 0xbe, 0x7d, 0x96, 0x7c, 0x5b, 0xc7,
+       0xab, 0x3f, 0xc5, 0xf9, 0x85, 0xde, 0xae, 0xb5, 0xda, 0xd6, 0xea, 0x6f,
+       0x5e, 0xaa, 0xaf, 0xc7, 0x9f, 0x24, 0x3f, 0xaa, 0xcc, 0x24, 0x71, 0x9f,
+       0xca, 0xc5, 0x76, 0x58, 0xdc, 0xc3, 0x76, 0xdb, 0x73, 0x05, 0x70, 0xdf,
+       0x2e, 0x85, 0xb9, 0x50, 0xfc, 0x3d, 0x51, 0x9f, 0xb5, 0x7e, 0x3c, 0xdb,
+       0xcf, 0x68, 0xc9, 0x91, 0xc1, 0x5d, 0xdc, 0xd7, 0x70, 0xa0, 0xe7, 0xa3,
+       0xf5, 0x80, 0xbd, 0xaf, 0xd7, 0x9c, 0x32, 0x96, 0xb2, 0xb5, 0xc5, 0xc6,
+       0x9f, 0xd8, 0xdf, 0xe4, 0x8a, 0x75, 0x7a, 0x31, 0xe4, 0xb9, 0xb6, 0x09,
+       0xff, 0x60, 0x1d, 0xad, 0x3c, 0x60, 0x69, 0x45, 0xad, 0x98, 0xc7, 0x5d,
+       0x96, 0x56, 0x22, 0x78, 0x13, 0x11, 0xad, 0x34, 0x45, 0xb4, 0x52, 0x98,
+       0x8e, 0x68, 0x85, 0x6d, 0xef, 0x8a, 0x68, 0x25, 0x55, 0x4f, 0x2b, 0x85,
+       0x69, 0x07, 0xd7, 0x4a, 0x38, 0x48, 0x2f, 0xec, 0x87, 0xf4, 0x02, 0x58,
+       0xaa, 0x9f, 0x59, 0xa2, 0x97, 0x04, 0xfa, 0x39, 0x5a, 0x36, 0x39, 0x22,
+       0xf0, 0xbb, 0xac, 0x0e, 0xf1, 0xb0, 0xe6, 0xc6, 0x47, 0x5c, 0x9b, 0x46,
+       0x02, 0x4b, 0x23, 0xb5, 0x7c, 0xfa, 0x15, 0xb4, 0x01, 0xdc, 0x33, 0x37,
+       0x76, 0xb7, 0xa6, 0x8d, 0xfb, 0x83, 0x12, 0xea, 0x0e, 0x83, 0x36, 0x22,
+       0x1c, 0xbc, 0xc7, 0xe2, 0x60, 0xe5, 0x5a, 0xde, 0x66, 0x71, 0x30, 0x6c,
+       0x71, 0xa0, 0xf9, 0xa5, 0xc0, 0x35, 0x53, 0x1a, 0x07, 0x4d, 0x1a, 0x07,
+       0xa2, 0xa2, 0xb6, 0xb7, 0xad, 0x81, 0x03, 0xd6, 0x19, 0xd6, 0xf3, 0x8f,
+       0x61, 0xfe, 0xb7, 0x63, 0xfe, 0x4a, 0xcf, 0x9f, 0xeb, 0x60, 0x72, 0xb9,
+       0x8b, 0xd5, 0xbf, 0x5e, 0x9a, 0x7f, 0x2b, 0xfa, 0x38, 0x52, 0x8e, 0xe9,
+       0xf9, 0xc3, 0xb6, 0xef, 0x8f, 0xe6, 0xff, 0x78, 0xd5, 0xe4, 0x53, 0x3f,
+       0xbe, 0x4a, 0xcf, 0x95, 0x2c, 0x6f, 0xf8, 0xda, 0x2f, 0x66, 0x4c, 0xfb,
+       0x3c, 0x74, 0xdb, 0x54, 0x90, 0xb2, 0xe7, 0xae, 0x8c, 0xbd, 0xf4, 0x95,
+       0x80, 0xbc, 0xf3, 0x21, 0x9d, 0xd7, 0x72, 0x8e, 0x76, 0x53, 0xb9, 0x55,
+       0x06, 0xa7, 0xea, 0xe1, 0x26, 0xbc, 0x05, 0x2d, 0x47, 0xf3, 0x98, 0xdf,
+       0x68, 0xd0, 0x0d, 0xf9, 0xa6, 0x69, 0x09, 0xe5, 0xe9, 0xc2, 0x40, 0xac,
+       0x49, 0xd4, 0x03, 0xef, 0xc7, 0x9c, 0x5d, 0xd9, 0xe2, 0x77, 0x7a, 0x7b,
+       0x14, 0x75, 0xe1, 0x95, 0x75, 0xba, 0xb0, 0xcd, 0xea, 0xc2, 0xcd, 0xd4,
+       0x85, 0x80, 0xfb, 0x6e, 0x39, 0x56, 0xe6, 0xfa, 0x15, 0x52, 0x4d, 0xd0,
+       0xff, 0xdf, 0xf1, 0x79, 0xc6, 0x45, 0xc7, 0xcd, 0x92, 0xc7, 0x34, 0x2d,
+       0x53, 0xa7, 0xa5, 0xf5, 0x99, 0x90, 0x05, 0xda, 0xd8, 0x09, 0xc6, 0x42,
+       0xa9, 0xf7, 0xfe, 0x3e, 0xfc, 0xcc, 0x1a, 0x7a, 0x6f, 0xbc, 0x6c, 0xec,
+       0xb7, 0x06, 0xd8, 0x84, 0x72, 0xaa, 0x0d, 0xd7, 0x26, 0x9e, 0x89, 0xe8,
+       0xee, 0x52, 0xcd, 0xd2, 0x70, 0x6a, 0xa3, 0x8c, 0x4d, 0x19, 0x1b, 0x57,
+       0x9d, 0x02, 0xfe, 0x4f, 0x31, 0x7f, 0x56, 0x74, 0xbe, 0x7f, 0x7e, 0x12,
+       0x76, 0xee, 0xcc, 0xdd, 0xe6, 0x1c, 0xc8, 0x54, 0x83, 0xfe, 0x4d, 0x1b,
+       0xa4, 0x18, 0x64, 0xa1, 0xef, 0xe2, 0x32, 0x86, 0x3e, 0x3b, 0x77, 0x35,
+       0x62, 0xce, 0x09, 0xb4, 0xa5, 0xcf, 0xc7, 0x38, 0x5a, 0xa3, 0xb8, 0x33,
+       0x49, 0x9d, 0xab, 0xcf, 0xf3, 0xae, 0xb9, 0xfe, 0x56, 0xbc, 0x63, 0x7e,
+       0x84, 0x87, 0xb1, 0x22, 0xd9, 0x8f, 0x7e, 0x4f, 0x88, 0xdd, 0xef, 0xc9,
+       0x68, 0xfd, 0x17, 0x3b, 0xe1, 0xd9, 0xb3, 0x7a, 0xfd, 0x58, 0xf7, 0xb5,
+       0xf4, 0xa2, 0x31, 0x72, 0x73, 0x58, 0x3f, 0x75, 0xd6, 0xc5, 0xbd, 0x1d,
+       0xf7, 0xa8, 0xbf, 0x48, 0x8f, 0x40, 0x37, 0xbe, 0xfd, 0xd0, 0x26, 0x69,
+       0x06, 0xbe, 0x67, 0x14, 0x70, 0x6d, 0x72, 0xbc, 0x0a, 0x9a, 0x17, 0x6a,
+       0xf4, 0xf0, 0xc4, 0xeb, 0xf2, 0x03, 0x69, 0x82, 0xb4, 0x40, 0xb9, 0x48,
+       0xda, 0xa0, 0x4c, 0x24, 0x6d, 0x1b, 0x7a, 0x78, 0x2c, 0xf0, 0x63, 0xcc,
+       0x03, 0x30, 0x71, 0x79, 0xd2, 0x06, 0x69, 0x3e, 0xa5, 0xe3, 0xf5, 0x59,
+       0xf9, 0x96, 0x64, 0x5b, 0x3b, 0x61, 0x97, 0xfd, 0xdb, 0xae, 0xb1, 0x39,
+       0x2b, 0xac, 0x69, 0x0e, 0xba, 0x89, 0x39, 0x79, 0xdd, 0xf2, 0x9e, 0x6a,
+       0x01, 0x78, 0xb8, 0x17, 0x4a, 0xf9, 0x6e, 0x9d, 0xe7, 0xb8, 0xaf, 0xb4,
+       0x49, 0x6e, 0x09, 0xe2, 0x36, 0xee, 0x7e, 0x04, 0x74, 0xb0, 0xe0, 0xc8,
+       0xa9, 0x0b, 0xb8, 0x2e, 0x3a, 0x5c, 0xbf, 0x4b, 0x41, 0x36, 0xad, 0xc8,
+       0xec, 0xbe, 0x9b, 0x5c, 0x90, 0x1e, 0x6f, 0x4c, 0x18, 0xeb, 0x98, 0x77,
+       0x9a, 0x4e, 0xfd, 0xfe, 0x26, 0xe3, 0x4b, 0x03, 0x16, 0xbf, 0xd1, 0x1b,
+       0xa4, 0x2d, 0x17, 0x84, 0x61, 0x9e, 0x76, 0x83, 0x28, 0xed, 0x23, 0xc1,
+       0xe7, 0x43, 0x19, 0xe3, 0x13, 0x3b, 0x9d, 0xc6, 0xb3, 0x2f, 0x58, 0x5a,
+       0x91, 0x98, 0xca, 0x3c, 0xed, 0x34, 0x9c, 0x7a, 0x84, 0x6b, 0xa6, 0xf3,
+       0xae, 0x0d, 0x5d, 0x3d, 0xeb, 0xd4, 0xe8, 0xea, 0x2b, 0xf6, 0xb7, 0xca,
+       0x34, 0x49, 0x36, 0xdd, 0x84, 0xf9, 0x0e, 0x94, 0x22, 0x18, 0xbf, 0x0d,
+       0xb8, 0x08, 0x0f, 0xe8, 0x76, 0xe6, 0x7f, 0xe2, 0x5a, 0x04, 0x2c, 0xf7,
+       0x01, 0xee, 0x4b, 0x80, 0xf9, 0x45, 0x5c, 0x6a, 0x5b, 0x4c, 0xfe, 0xd4,
+       0x89, 0xcd, 0xd4, 0xc3, 0x4b, 0x18, 0xbf, 0x6b, 0xe1, 0x7d, 0x2d, 0x58,
+       0x3d, 0x59, 0xe8, 0xeb, 0x00, 0x3c, 0x84, 0xf3, 0x25, 0xc0, 0x48, 0xbb,
+       0xf5, 0x39, 0x3c, 0x7b, 0x80, 0xef, 0x79, 0x0b, 0x13, 0xe8, 0x71, 0xea,
+       0x2f, 0x6a, 0xbf, 0x4b, 0xb4, 0xa3, 0xff, 0xd2, 0x3e, 0xb7, 0xaf, 0x90,
+       0x01, 0x5d, 0x0e, 0xf1, 0x3c, 0x51, 0x5e, 0xa4, 0x1d, 0x00, 0xbe, 0xff,
+       0xae, 0xc4, 0xce, 0x26, 0xe5, 0x68, 0x89, 0x7b, 0x40, 0xa7, 0x81, 0x0f,
+       0x7d, 0xc6, 0x05, 0x75, 0xae, 0xc2, 0x05, 0x65, 0x3f, 0xb3, 0x1b, 0x57,
+       0x37, 0xae, 0xb7, 0xe2, 0x02, 0x39, 0xcc, 0x9c, 0xc2, 0xd5, 0x83, 0xbe,
+       0x55, 0xa2, 0x49, 0x98, 0x9b, 0xf5, 0x0d, 0xb4, 0xd1, 0xb6, 0x65, 0x41,
+       0x65, 0xfa, 0x80, 0xbf, 0x3e, 0xc0, 0x96, 0xc4, 0xc5, 0x7c, 0xe6, 0xef,
+       0x3a, 0x72, 0xf6, 0x65, 0x5c, 0x60, 0xb0, 0xb3, 0x20, 0xcc, 0xb3, 0xfd,
+       0xb8, 0xa0, 0xc4, 0xce, 0x66, 0x71, 0x0d, 0xe2, 0xfa, 0x2b, 0xc7, 0xf0,
+       0x5c, 0x3b, 0xf0, 0x15, 0xf1, 0x08, 0x70, 0xbe, 0x8c, 0xe7, 0xbe, 0xec,
+       0xbc, 0x71, 0x9e, 0xfb, 0xbe, 0x63, 0x78, 0xee, 0x15, 0xa7, 0xc6, 0x73,
+       0x17, 0x1c, 0xf5, 0xf0, 0xd3, 0x4e, 0xec, 0x61, 0xfa, 0x12, 0x17, 0x1c,
+       0xc3, 0xff, 0x31, 0x19, 0x38, 0x08, 0x5a, 0x7a, 0x78, 0x1e, 0x17, 0xe9,
+       0xea, 0x19, 0x94, 0x3f, 0xbf, 0x62, 0xdc, 0xe7, 0xde, 0xc4, 0xb8, 0xaf,
+       0xda, 0x71, 0x45, 0xd5, 0xc6, 0x7d, 0x11, 0x7d, 0xbf, 0x64, 0xc7, 0x7d,
+       0xb1, 0x6e, 0x5c, 0xd0, 0xca, 0xc3, 0x8b, 0xb8, 0x48, 0x17, 0x2f, 0xa0,
+       0x3c, 0x92, 0x09, 0x1f, 0xf4, 0xa4, 0xb9, 0x01, 0xbc, 0x1b, 0x87, 0x7e,
+       0x6c, 0x58, 0xd2, 0x8d, 0xd9, 0x3a, 0xfd, 0xf0, 0x46, 0xf4, 0xe3, 0x78,
+       0x99, 0x36, 0xe2, 0x7c, 0x9d, 0x5c, 0xa0, 0x6f, 0x14, 0xca, 0x49, 0xed,
+       0x07, 0xd1, 0x27, 0xa2, 0x7f, 0xb4, 0xd2, 0xb6, 0xfa, 0xa8, 0xce, 0x45,
+       0xfb, 0x95, 0x52, 0xbb, 0xdc, 0x59, 0xa2, 0x4d, 0x48, 0x7a, 0x09, 0xc3,
+       0xb1, 0x3d, 0xb4, 0x4f, 0x0b, 0xe1, 0x15, 0x3e, 0xe9, 0xc4, 0xf7, 0x7e,
+       0x79, 0xb5, 0xce, 0x98, 0x1c, 0x80, 0xef, 0x9e, 0x3b, 0xf1, 0x8b, 0xd0,
+       0x19, 0x0d, 0x80, 0x9b, 0xf4, 0xb6, 0x4d, 0x0e, 0x4c, 0xaa, 0x89, 0x2d,
+       0x90, 0x25, 0x37, 0x95, 0x1a, 0x61, 0xf7, 0x30, 0x4f, 0xab, 0x59, 0x3a,
+       0xf7, 0xc4, 0x4d, 0x1e, 0xb9, 0x97, 0xc0, 0x6f, 0xcf, 0xe4, 0xb5, 0x27,
+       0x92, 0x78, 0xff, 0x0f, 0x1e, 0xe5, 0x60, 0xc2, 0xbf, 0x4e, 0xe7, 0x08,
+       0x75, 0xec, 0xa1, 0xdd, 0x72, 0x83, 0xd6, 0xe1, 0xee, 0x2a, 0x3b, 0x49,
+       0x6d, 0xf3, 0xa4, 0x66, 0xa3, 0x8d, 0x96, 0xd2, 0x29, 0xc2, 0xf5, 0x90,
+       0x70, 0xff, 0xeb, 0x1e, 0x29, 0x06, 0x1b, 0xe1, 0x17, 0x30, 0x76, 0x9e,
+       0xee, 0xa6, 0x6d, 0x34, 0x33, 0xe5, 0xd9, 0x3c, 0xeb, 0x4d, 0xf2, 0xac,
+       0x1e, 0xa7, 0x51, 0xc3, 0x68, 0xce, 0x5e, 0x70, 0x1f, 0x21, 0xae, 0xcf,
+       0xfb, 0xcc, 0x54, 0x5a, 0xb4, 0xde, 0x99, 0xa9, 0x30, 0xaf, 0x1f, 0xfe,
+       0x54, 0x85, 0x79, 0xfc, 0x81, 0x78, 0x6f, 0x87, 0x9f, 0x5b, 0xd9, 0x21,
+       0xa3, 0x53, 0xeb, 0xa4, 0xd1, 0x57, 0x89, 0x2d, 0xd0, 0x1f, 0x6c, 0xd3,
+       0xb1, 0x07, 0xfe, 0xe1, 0xf4, 0x4e, 0x79, 0x62, 0x9a, 0x7d, 0x6f, 0x93,
+       0xd9, 0x39, 0x71, 0xbc, 0xb7, 0xaf, 0x47, 0x1d, 0xc8, 0xf5, 0x3d, 0x2c,
+       0x4b, 0xe1, 0x2e, 0xca, 0x7b, 0xbb, 0x2b, 0x17, 0xfb, 0xf8, 0xcc, 0xb3,
+       0x04, 0xe2, 0xb2, 0xbf, 0x8b, 0x7d, 0xed, 0x72, 0x6e, 0x0e, 0x34, 0x01,
+       0xb9, 0x3f, 0x78, 0x8a, 0x30, 0x89, 0xec, 0x9d, 0x61, 0x2c, 0xbd, 0xd3,
+       0x63, 0xdc, 0x94, 0xfb, 0x34, 0xb7, 0xf4, 0x71, 0x2c, 0xe8, 0x25, 0xe8,
+       0xb8, 0x8e, 0x3d, 0x46, 0x16, 0x64, 0x67, 0x1a, 0x50, 0xce, 0x7e, 0xe1,
+       0x3f, 0x1e, 0x64, 0x3f, 0x51, 0x5b, 0x85, 0x39, 0x35, 0x6a, 0x7a, 0x59,
+       0x5c, 0xa1, 0x3f, 0xce, 0xff, 0x48, 0xf6, 0x37, 0xfb, 0xe8, 0xd6, 0x7b,
+       0x21, 0xdc, 0x53, 0x36, 0xb6, 0x15, 0xd7, 0x44, 0xef, 0x29, 0xc0, 0xae,
+       0xba, 0x4a, 0xdb, 0x17, 0xb3, 0x55, 0xae, 0x20, 0x63, 0x51, 0xd1, 0x1a,
+       0x25, 0xe5, 0xd1, 0xf2, 0xd2, 0x3a, 0xed, 0x68, 0x58, 0xbe, 0x4e, 0xa4,
+       0x95, 0x60, 0xc4, 0xda, 0x1e, 0x0b, 0x72, 0x0c, 0x76, 0x59, 0xb7, 0x5e,
+       0xb3, 0x05, 0xd8, 0xb2, 0x76, 0xcd, 0xb4, 0x3d, 0x5b, 0x8c, 0xd6, 0x6c,
+       0x18, 0x1a, 0xa7, 0x92, 0xd9, 0xcc, 0x35, 0xf3, 0x18, 0xef, 0x06, 0xde,
+       0x0b, 0x58, 0xa7, 0x02, 0xd6, 0xa8, 0x50, 0xd9, 0x26, 0x33, 0x27, 0x55,
+       0x7b, 0x83, 0x48, 0x6a, 0xd4, 0xdf, 0x26, 0xe3, 0x73, 0x8c, 0x25, 0xec,
+       0x80, 0x0d, 0xb6, 0x13, 0x57, 0x3b, 0x9e, 0xd9, 0x2e, 0x21, 0xc5, 0x8a,
+       0x42, 0xdb, 0xa6, 0x55, 0x76, 0xd6, 0x39, 0x8c, 0xcd, 0x33, 0x9d, 0x8f,
+       0x01, 0x0f, 0x35, 0xde, 0x29, 0xd5, 0xc5, 0x9f, 0x38, 0x57, 0xad, 0x43,
+       0x31, 0xdf, 0x84, 0x5e, 0x4f, 0x1d, 0x87, 0x2a, 0x37, 0xbe, 0x19, 0x7b,
+       0x2a, 0x49, 0x7b, 0x2a, 0x3f, 0xe9, 0x99, 0xf3, 0x06, 0xc3, 0xf0, 0x9d,
+       0xfc, 0xfc, 0x66, 0xd2, 0xfa, 0xc8, 0x34, 0xe1, 0x8a, 0x47, 0x70, 0x2d,
+       0x5b, 0x33, 0x9e, 0x0f, 0x5b, 0x1d, 0xe7, 0x28, 0x2d, 0xe5, 0x43, 0x9a,
+       0xd8, 0x3e, 0xe3, 0x28, 0xed, 0x6b, 0xc0, 0x74, 0xb7, 0xb6, 0x61, 0x45,
+       0xdd, 0x26, 0x87, 0xcb, 0x3c, 0x5b, 0xc6, 0x78, 0xe2, 0x27, 0x19, 0x5f,
+       0xea, 0x9e, 0x91, 0x63, 0x18, 0x9b, 0xb9, 0x3f, 0xca, 0xc6, 0x6f, 0x36,
+       0xd8, 0x1c, 0x91, 0xfa, 0x18, 0x8e, 0xc9, 0x0d, 0x5a, 0x9e, 0x67, 0x9d,
+       0x1e, 0x5e, 0xc4, 0x3a, 0xff, 0x9a, 0xde, 0x1b, 0x94, 0xc9, 0x18, 0xb4,
+       0xdf, 0x68, 0x5f, 0xba, 0xdf, 0x9c, 0xab, 0x49, 0xc9, 0x50, 0xd9, 0xcc,
+       0xff, 0x92, 0xce, 0x11, 0x32, 0xb9, 0x90, 0x26, 0x7f, 0xe8, 0x1e, 0xb9,
+       0x04, 0x1d, 0x5e, 0x5b, 0xdb, 0x26, 0x19, 0x07, 0x2e, 0xf2, 0x7a, 0x5f,
+       0x22, 0x25, 0xf9, 0xbe, 0x47, 0x37, 0xf3, 0xdc, 0x45, 0x1c, 0xeb, 0x53,
+       0x9c, 0xe6, 0x59, 0x4c, 0xf6, 0x7b, 0xb9, 0xbe, 0x28, 0x66, 0x99, 0xd7,
+       0x0f, 0x59, 0xf9, 0x63, 0x3d, 0xc9, 0x66, 0xfd, 0x7e, 0x9d, 0xcd, 0xdf,
+       0x76, 0x44, 0x0e, 0x84, 0xf2, 0x87, 0xd0, 0x93, 0x67, 0xec, 0x9c, 0x52,
+       0x3a, 0x66, 0x25, 0xe1, 0xc5, 0x20, 0x69, 0x63, 0x96, 0x9c, 0xcb, 0x41,
+       0x4b, 0xdf, 0xc6, 0xfe, 0xa9, 0xd9, 0xd0, 0x66, 0xdf, 0xef, 0x09, 0x2d,
+       0x0b, 0x7b, 0xad, 0xed, 0xac, 0xe3, 0x3c, 0x8f, 0x88, 0xce, 0x09, 0x88,
+       0x7c, 0xa3, 0xae, 0x3a, 0xbf, 0xc0, 0xf8, 0x72, 0xc5, 0xa9, 0xb5, 0x64,
+       0x54, 0xcd, 0x27, 0xa4, 0x2f, 0x37, 0xb6, 0x8b, 0xdf, 0x47, 0x88, 0x7c,
+       0xb9, 0x5e, 0xeb, 0xcb, 0x6d, 0xd4, 0xbe, 0x9c, 0x89, 0x3d, 0x6c, 0x5c,
+       0xf2, 0xe5, 0x8a, 0x53, 0x05, 0xd0, 0x4a, 0xf4, 0x3d, 0x07, 0x63, 0x0b,
+       0x8d, 0x97, 0x78, 0x86, 0xa6, 0x51, 0xf2, 0xc3, 0x0a, 0x7e, 0x83, 0xf1,
+       0xb1, 0x18, 0xab, 0x50, 0xea, 0xeb, 0xd6, 0xbf, 0x68, 0x97, 0x6c, 0xdb,
+       0x3a, 0xcc, 0xfb, 0x6e, 0xbd, 0xe6, 0xb3, 0x25, 0xb3, 0xf7, 0x99, 0x3f,
+       0xc8, 0x98, 0x10, 0xcf, 0x49, 0x69, 0xfe, 0x4a, 0x0d, 0xc4, 0xba, 0x8d,
+       0x3d, 0xeb, 0x7b, 0xad, 0xd2, 0x7c, 0x1a, 0x38, 0x8f, 0xdb, 0x71, 0x53,
+       0x80, 0xe9, 0x30, 0xd6, 0xe6, 0x3a, 0x2b, 0x93, 0x39, 0xf6, 0x47, 0x9b,
+       0x18, 0x1b, 0x98, 0x2b, 0x45, 0x31, 0xc2, 0x98, 0x3d, 0xa3, 0xe9, 0xc7,
+       0x1a, 0xfd, 0x75, 0x6b, 0xda, 0xaa, 0x8f, 0xbf, 0xae, 0x6e, 0x22, 0x2d,
+       0xdd, 0xad, 0xf3, 0x5c, 0xd6, 0xf7, 0xa5, 0xf7, 0xeb, 0x9c, 0x7b, 0x1d,
+       0x63, 0x2c, 0x08, 0x73, 0xd4, 0xbe, 0x29, 0x3f, 0xa1, 0x65, 0xfe, 0xe1,
+       0x80, 0xfa, 0x6b, 0x8f, 0xfe, 0xdd, 0x98, 0x09, 0xc3, 0x8b, 0x7d, 0x13,
+       0x8c, 0x29, 0x7a, 0xdf, 0x96, 0xce, 0xe4, 0x80, 0xb6, 0x9d, 0xb0, 0x46,
+       0x07, 0x9b, 0x65, 0x9d, 0x3f, 0x62, 0x73, 0x66, 0x0a, 0x90, 0x9b, 0x69,
+       0xd8, 0x4c, 0x3c, 0x7f, 0xdc, 0x65, 0xdf, 0x15, 0xc2, 0x66, 0xd0, 0xd1,
+       0x07, 0xc5, 0xc8, 0x98, 0x7c, 0x4d, 0xc6, 0x30, 0xd7, 0x20, 0x4b, 0x42,
+       0x76, 0x8f, 0x4b, 0x9a, 0xdf, 0x2a, 0xe1, 0xd8, 0x45, 0xd9, 0x0a, 0xbd,
+       0xcc, 0x76, 0xb4, 0x55, 0xf9, 0xcc, 0x3d, 0x1c, 0xdf, 0x3b, 0x02, 0xdd,
+       0x72, 0xc3, 0x6a, 0xdd, 0x92, 0xa4, 0x5f, 0x9f, 0x9f, 0xa4, 0x6f, 0xb8,
+       0x1e, 0x6d, 0xb6, 0xc9, 0x87, 0xa6, 0x7e, 0xbe, 0x95, 0xbc, 0x35, 0x02,
+       0xb9, 0xae, 0xee, 0x8f, 0xce, 0x16, 0xb1, 0x8c, 0xef, 0xd9, 0x6f, 0x93,
+       0xa4, 0xde, 0xeb, 0xc9, 0x6f, 0x54, 0xd3, 0xa9, 0x45, 0xe8, 0xa6, 0x11,
+       0xe7, 0x57, 0xb7, 0x9b, 0x98, 0xea, 0x07, 0x5a, 0xcd, 0x59, 0x84, 0x66,
+       0xe0, 0x34, 0x8a, 0xb3, 0xd6, 0xd3, 0xec, 0xa2, 0x95, 0xc7, 0x61, 0xd8,
+       0xdc, 0xa7, 0x65, 0xf0, 0x7e, 0xca, 0xe0, 0xc3, 0x41, 0x97, 0xa1, 0x7d,
+       0xed, 0x33, 0x85, 0x58, 0x47, 0xe0, 0xa1, 0xcf, 0x65, 0xbe, 0x9f, 0xe5,
+       0x4f, 0x3f, 0xbb, 0x60, 0xe5, 0x92, 0x72, 0x56, 0xf3, 0xa5, 0xba, 0x26,
+       0xbe, 0x4c, 0xe6, 0x1e, 0x9d, 0xa2, 0x3e, 0x0e, 0xe6, 0xbf, 0x09, 0x39,
+       0x95, 0xd7, 0x78, 0xd8, 0x26, 0xf7, 0x4d, 0x49, 0xf6, 0x12, 0x74, 0x55,
+       0x71, 0x6e, 0x39, 0x6f, 0xae, 0xee, 0x8f, 0x73, 0x7d, 0xa4, 0xd5, 0xf8,
+       0xb6, 0xcb, 0xe7, 0x3a, 0x8f, 0xb9, 0x66, 0xf5, 0x5c, 0xb9, 0x6f, 0x33,
+       0x67, 0xe7, 0xba, 0x3e, 0x9a, 0x6b, 0xff, 0xf2, 0xb9, 0x46, 0xbe, 0x7d,
+       0x24, 0x77, 0x53, 0x3a, 0xff, 0x5e, 0xe7, 0x7d, 0x4f, 0xad, 0x97, 0x81,
+       0xc9, 0x8d, 0x56, 0x5e, 0x7a, 0xd0, 0x3d, 0xcc, 0x89, 0x9f, 0xbf, 0xd7,
+       0x13, 0x8b, 0x33, 0x45, 0x3c, 0x50, 0xd6, 0xb6, 0xea, 0x33, 0x3b, 0x33,
+       0xf0, 0xaf, 0x6e, 0x2d, 0xb1, 0x6e, 0xf4, 0xfe, 0x72, 0xb1, 0xe3, 0xc8,
+       0xa7, 0xa6, 0xdf, 0xd4, 0xbd, 0x2a, 0xa6, 0x60, 0xe2, 0xc3, 0x8c, 0x0b,
+       0x9b, 0xb3, 0xc4, 0xcc, 0x45, 0xbc, 0x03, 0x3c, 0xf5, 0xf1, 0x52, 0xba,
+       0x3f, 0x17, 0xa3, 0x1c, 0x9d, 0x96, 0xa3, 0xd5, 0x41, 0xe9, 0xd0, 0xe7,
+       0x49, 0x5f, 0x37, 0x76, 0x9c, 0xad, 0x8f, 0x1d, 0x33, 0x9d, 0x80, 0xb1,
+       0xe3, 0xfd, 0x3f, 0x42, 0xec, 0x58, 0x1c, 0x13, 0x3b, 0x5e, 0xcb, 0xbf,
+       0x9a, 0x28, 0x4f, 0x63, 0x5e, 0xcd, 0x90, 0x25, 0x0b, 0x4e, 0x7e, 0xae,
+       0x05, 0xf7, 0x0b, 0xb8, 0xc7, 0x71, 0xbf, 0x84, 0xbb, 0x87, 0xfb, 0x8b,
+       0xb8, 0x27, 0x64, 0x62, 0x49, 0x67, 0x4c, 0x43, 0x6e, 0x50, 0x97, 0xb1,
+       0xad, 0xf1, 0x07, 0x66, 0x2b, 0x6d, 0xfc, 0x2e, 0x8c, 0x33, 0x33, 0xc7,
+       0x39, 0x6c, 0x94, 0xf1, 0x29, 0xca, 0xec, 0x56, 0x99, 0x9c, 0x8a, 0x6c,
+       0xdb, 0xbb, 0xb6, 0x71, 0xcf, 0x60, 0x44, 0x22, 0xdb, 0xf5, 0x77, 0xb7,
+       0xd9, 0x5c, 0xfb, 0x2d, 0xd2, 0xbc, 0x09, 0x6b, 0x70, 0x5a, 0x2e, 0x4d,
+       0x6f, 0x5a, 0x66, 0xc3, 0xa6, 0x6c, 0x4c, 0x70, 0xda, 0xea, 0xde, 0xb5,
+       0x65, 0x44, 0xfd, 0xfa, 0x27, 0x6d, 0x4e, 0x69, 0x94, 0x23, 0x94, 0xd2,
+       0xeb, 0x33, 0x5c, 0x9d, 0xc6, 0x78, 0xfd, 0x92, 0x9d, 0xe6, 0x3c, 0x97,
+       0xbe, 0x4d, 0x01, 0x79, 0x78, 0x0a, 0x7a, 0x75, 0x19, 0x5d, 0x82, 0x6e,
+       0x39, 0x37, 0x07, 0xb4, 0xfb, 0xa8, 0xcc, 0x4c, 0x12, 0xbe, 0xae, 0x64,
+       0x4c, 0x9f, 0x5d, 0xc3, 0xf3, 0xb4, 0xc9, 0x99, 0x1f, 0xa8, 0x46, 0xe7,
+       0xd6, 0x36, 0xeb, 0xef, 0x11, 0x2c, 0x3f, 0xbb, 0x66, 0xf5, 0xb3, 0xb6,
+       0x1d, 0x78, 0x86, 0x2d, 0x9a, 0xc3, 0x5a, 0xf4, 0x14, 0xca, 0xb8, 0xce,
+       0x3b, 0xdb, 0x22, 0x67, 0x1e, 0x5c, 0xca, 0xa1, 0x6d, 0x85, 0x8d, 0xd2,
+       0x0e, 0x13, 0x79, 0xd8, 0xcd, 0x74, 0xc1, 0xc7, 0x63, 0x9e, 0x4c, 0x57,
+       0xf2, 0x36, 0x9d, 0xdb, 0x5c, 0x3b, 0x47, 0x58, 0xcb, 0x6f, 0x8e, 0xce,
+       0x6d, 0x25, 0x65, 0x10, 0x74, 0x38, 0xa4, 0xcb, 0x13, 0x98, 0x0f, 0xf7,
+       0xfd, 0x34, 0x1e, 0x20, 0x7b, 0xb8, 0xe7, 0x87, 0xb9, 0x57, 0xbf, 0x01,
+       0x7a, 0x77, 0xec, 0x19, 0x36, 0xd2, 0x58, 0x9f, 0x8c, 0x55, 0x92, 0xce,
+       0x58, 0xa5, 0xcf, 0x39, 0x54, 0xb1, 0xef, 0xfa, 0x8a, 0x58, 0x0f, 0xfc,
+       0x9e, 0xee, 0x70, 0x46, 0x80, 0xaf, 0x62, 0xb9, 0xd3, 0xc9, 0xea, 0xbb,
+       0x6f, 0xef, 0x90, 0x03, 0x58, 0xab, 0x81, 0xe9, 0xa4, 0x96, 0xf3, 0xb5,
+       0xef, 0x61, 0x45, 0xeb, 0xfa, 0xa4, 0xde, 0x1b, 0x9a, 0x97, 0x69, 0xfd,
+       0x7d, 0x25, 0x63, 0x3b, 0x9c, 0x46, 0x7f, 0xd3, 0x36, 0x26, 0xde, 0xe3,
+       0xe4, 0x75, 0x3f, 0x66, 0x3d, 0x8a, 0xe5, 0x53, 0xb8, 0xaf, 0x3c, 0x43,
+       0x1d, 0xe9, 0x19, 0xc2, 0xfd, 0x08, 0xf4, 0x59, 0x78, 0x8f, 0x91, 0x57,
+       0xd3, 0x32, 0x51, 0x65, 0xfe, 0x08, 0xfb, 0x41, 0x79, 0xe5, 0x30, 0x74,
+       0xd2, 0xf2, 0x33, 0x84, 0x43, 0xb5, 0x75, 0x48, 0x4d, 0x0b, 0x61, 0xe1,
+       0x1a, 0x2c, 0x3f, 0x5f, 0x7f, 0xf9, 0x7f, 0xd1, 0xbe, 0xa2, 0x91, 0xa1,
+       0x16, 0x8e, 0x2c, 0xe5, 0x9d, 0x91, 0x2b, 0x9f, 0x96, 0x23, 0xc0, 0xe3,
+       0x31, 0xc0, 0xa4, 0xee, 0xe7, 0xf7, 0x5e, 0x2a, 0x52, 0x9c, 0xbd, 0x4f,
+       0xd4, 0x43, 0x97, 0x1c, 0xf7, 0xa1, 0x23, 0x12, 0x7b, 0x68, 0xc1, 0x69,
+       0x78, 0xa8, 0x53, 0xfb, 0xe5, 0xfb, 0x82, 0xce, 0xe4, 0x21, 0x39, 0x2d,
+       0xee, 0xfd, 0x4a, 0x9f, 0x27, 0x2b, 0x7a, 0x8c, 0xf1, 0x9d, 0x96, 0xd8,
+       0xfd, 0x71, 0x7b, 0x16, 0xd5, 0xc4, 0xf5, 0x16, 0x35, 0xdf, 0x3f, 0x97,
+       0x20, 0xce, 0x16, 0x65, 0x5a, 0xf3, 0xce, 0x00, 0xf4, 0x44, 0x6e, 0x32,
+       0xb5, 0x54, 0xc7, 0xe4, 0x7b, 0x6e, 0x4c, 0x18, 0x7e, 0x61, 0x9d, 0x2e,
+       0x87, 0xdf, 0x85, 0xb0, 0x3a, 0xff, 0xca, 0x28, 0xf7, 0xd3, 0xac, 0x29,
+       0xdf, 0xff, 0x10, 0x6b, 0xd8, 0x85, 0xf5, 0xe2, 0x78, 0x8e, 0xde, 0xcf,
+       0xe5, 0x59, 0x5c, 0x4f, 0x7a, 0x92, 0x4d, 0x4b, 0x76, 0x10, 0xeb, 0xde,
+       0x27, 0x4d, 0x80, 0x5b, 0x3d, 0x54, 0x34, 0x76, 0x9d, 0x90, 0x4e, 0x05,
+       0x92, 0x9b, 0x34, 0xdb, 0xd5, 0xbf, 0x4f, 0xaf, 0xe1, 0xbd, 0x96, 0x66,
+       0xd6, 0x19, 0xfb, 0x11, 0xcf, 0x86, 0x2e, 0x8a, 0xb2, 0x77, 0xea, 0xbb,
+       0xd0, 0xf3, 0xdc, 0x77, 0xd1, 0xf6, 0xe2, 0x1a, 0xb6, 0x20, 0x79, 0xe9,
+       0x69, 0xeb, 0x57, 0x86, 0xe1, 0x54, 0x10, 0x00, 0x8f, 0x6b, 0xf9, 0x92,
+       0x3b, 0x9c, 0xd9, 0xc9, 0x9d, 0xce, 0xcc, 0x64, 0x28, 0x63, 0x01, 0xbf,
+       0x19, 0xc2, 0x1c, 0x00, 0xda, 0x5b, 0x2c, 0xeb, 0x84, 0x6e, 0xdd, 0x9d,
+       0xe0, 0xf9, 0xa6, 0x9b, 0xfc, 0x17, 0xc4, 0xd4, 0x23, 0x8e, 0xe9, 0x23,
+       0x77, 0x3e, 0x92, 0x17, 0x7e, 0x9f, 0xa3, 0x27, 0x99, 0xd0, 0xdf, 0x10,
+       0xf9, 0x0c, 0xda, 0x61, 0x8c, 0x32, 0xc7, 0x7d, 0xc6, 0x99, 0x81, 0x3c,
+       0x9b, 0x9d, 0xe2, 0x37, 0x01, 0x98, 0x4f, 0x1b, 0x6b, 0x57, 0x72, 0x95,
+       0x37, 0x6e, 0xbf, 0x5b, 0x57, 0x80, 0x0b, 0x14, 0xd3, 0x65, 0x3d, 0xde,
+       0xe8, 0xd2, 0xb7, 0xec, 0xa2, 0xb2, 0xe8, 0x9b, 0x76, 0x4a, 0xe7, 0x4e,
+       0xc3, 0x97, 0x3d, 0x33, 0x22, 0xdf, 0x77, 0xe6, 0x4a, 0xaf, 0x38, 0x8f,
+       0x96, 0xb2, 0xd7, 0x5c, 0x01, 0xfa, 0xb8, 0x18, 0xe4, 0x29, 0xbf, 0x60,
+       0xf3, 0x4d, 0x49, 0xa1, 0x3a, 0x26, 0xd3, 0xdb, 0x3a, 0xbd, 0xfb, 0xf5,
+       0xda, 0x9c, 0x01, 0xce, 0xbe, 0x81, 0xf5, 0x3b, 0x93, 0xa0, 0x7e, 0x1b,
+       0x2d, 0x29, 0xf0, 0xb2, 0xfa, 0x69, 0x5c, 0xb0, 0x6d, 0x1b, 0xb5, 0x8d,
+       0x72, 0x28, 0x60, 0xbd, 0x9d, 0xce, 0xc0, 0xe4, 0x0e, 0xac, 0xe3, 0x41,
+       0xe8, 0x4f, 0x07, 0x76, 0x1a, 0x68, 0x1b, 0x65, 0xe3, 0xc0, 0xc1, 0x68,
+       0x60, 0xe4, 0xf9, 0x80, 0x14, 0xb4, 0x8f, 0x67, 0xee, 0x59, 0x65, 0x62,
+       0x66, 0x61, 0x38, 0x0b, 0xfb, 0x80, 0xdf, 0xc5, 0x9a, 0xa8, 0xce, 0xe1,
+       0xfa, 0x71, 0xbb, 0xa7, 0x3d, 0x7f, 0x99, 0x3d, 0x6d, 0x4f, 0x4e, 0x57,
+       0xf5, 0x39, 0x79, 0x9d, 0x5f, 0x95, 0x52, 0xeb, 0xda, 0xf4, 0x5a, 0xa9,
+       0x2e, 0x9d, 0x93, 0x96, 0x95, 0x47, 0x12, 0x46, 0x0f, 0x13, 0xa6, 0x14,
+       0xe0, 0xd9, 0x09, 0x5c, 0x10, 0x1e, 0xd3, 0x46, 0xd4, 0x3b, 0xb7, 0x52,
+       0x1f, 0x2e, 0xca, 0xa7, 0x12, 0xd1, 0x19, 0x05, 0xf4, 0x03, 0x19, 0x37,
+       0xb7, 0xd5, 0xe8, 0xc9, 0x2d, 0x6b, 0xf4, 0x13, 0xcd, 0xcd, 0xb1, 0x73,
+       0x23, 0xdd, 0x6e, 0xbe, 0x92, 0x3e, 0xc5, 0xa2, 0x34, 0xad, 0xa8, 0xcf,
+       0x98, 0xfe, 0xbe, 0xed, 0xe6, 0xcc, 0x03, 0xeb, 0x7a, 0xb0, 0x4d, 0x69,
+       0xe7, 0x12, 0x8f, 0x7a, 0xdd, 0x4a, 0x4a, 0x78, 0x6e, 0xe1, 0x0c, 0x64,
+       0xcb, 0x55, 0xde, 0x4f, 0x28, 0xd2, 0x61, 0x84, 0xeb, 0x6f, 0x68, 0x3e,
+       0x19, 0x2d, 0x31, 0xb6, 0xf2, 0x68, 0x98, 0x1d, 0x26, 0x8f, 0xb1, 0x0f,
+       0xbe, 0x9f, 0xd2, 0xf1, 0xdc, 0x83, 0x01, 0x63, 0x45, 0x9d, 0x8f, 0xdc,
+       0xa1, 0x22, 0x39, 0x05, 0xfd, 0x5b, 0x5e, 0x70, 0xf8, 0xdd, 0xbe, 0x03,
+       0x82, 0xfb, 0xdc, 0x82, 0xf3, 0xcd, 0xa9, 0x67, 0xf0, 0xdc, 0x60, 0xbf,
+       0xd5, 0x67, 0xf4, 0x94, 0xc8, 0x1f, 0x46, 0xf3, 0x4d, 0x16, 0xb0, 0xf6,
+       0x2f, 0x62, 0xed, 0xd7, 0xfe, 0x36, 0x1f, 0xde, 0x55, 0xf0, 0xae, 0xf2,
+       0x0b, 0x61, 0xb6, 0x95, 0xb4, 0x18, 0xe8, 0xb3, 0xa9, 0x97, 0xf7, 0x9b,
+       0xfb, 0x35, 0x5f, 0x8c, 0x97, 0xcf, 0x81, 0x2f, 0xb2, 0xdc, 0x6f, 0x0e,
+       0x1f, 0x0e, 0x6e, 0x04, 0x5f, 0xec, 0x97, 0xdf, 0x83, 0x5d, 0xf0, 0x3b,
+       0xd5, 0x0c, 0xf8, 0xa3, 0x1f, 0xfc, 0xd2, 0x07, 0x1e, 0x09, 0xb4, 0x8d,
+       0xfc, 0x18, 0xf4, 0x1f, 0xf4, 0x9a, 0x73, 0x68, 0xb2, 0xc3, 0xc9, 0x4f,
+       0xfa, 0xce, 0xd8, 0x24, 0xbf, 0xff, 0xa2, 0xde, 0xda, 0x20, 0x6e, 0x72,
+       0x56, 0xc8, 0x0b, 0x9d, 0xcc, 0x71, 0x6c, 0x03, 0xae, 0xce, 0x12, 0x57,
+       0xb3, 0xd5, 0x1e, 0xef, 0x0a, 0xf0, 0x44, 0x9b, 0xe6, 0x89, 0x8d, 0x4e,
+       0xd6, 0xbb, 0xd1, 0xf2, 0xc4, 0x0b, 0xe0, 0x89, 0x4b, 0xab, 0x78, 0xe2,
+       0x29, 0x4b, 0xff, 0xf3, 0x75, 0x3c, 0x31, 0x6b, 0xcb, 0xa6, 0x2f, 0xc3,
+       0x13, 0x5b, 0xfd, 0xf4, 0xe7, 0x47, 0xe4, 0x55, 0xf0, 0x84, 0x28, 0xf2,
+       0xc4, 0x56, 0xcd, 0x13, 0x8c, 0x1d, 0x91, 0x2f, 0xda, 0x21, 0x47, 0xc8,
+       0x17, 0x17, 0x64, 0x11, 0x7c, 0xf1, 0x9c, 0xe2, 0xd8, 0x67, 0x68, 0x2b,
+       0x4c, 0xd2, 0x27, 0x3b, 0x55, 0xee, 0x00, 0xbf, 0x2b, 0xf9, 0xaf, 0x53,
+       0x61, 0xb8, 0x00, 0x3f, 0xfd, 0x41, 0xd8, 0xf3, 0xae, 0xfe, 0x0e, 0xe4,
+       0x3c, 0xe8, 0x3e, 0xa2, 0xf7, 0x31, 0x07, 0xf4, 0x7e, 0x6c, 0x06, 0x73,
+       0x18, 0x53, 0x9f, 0x82, 0x2f, 0xec, 0x61, 0x5d, 0x69, 0xe7, 0x9f, 0xd4,
+       0x3c, 0xd4, 0x00, 0x7d, 0xf0, 0x68, 0x1f, 0x63, 0x4d, 0xbe, 0x77, 0x48,
+       0x75, 0x16, 0x06, 0x01, 0x73, 0x4c, 0xdd, 0x2f, 0x8c, 0x73, 0xb4, 0xae,
+       0xb0, 0xf3, 0x29, 0x23, 0x86, 0x21, 0xeb, 0xcc, 0xbb, 0x42, 0xd8, 0x04,
+       0x9b, 0xb4, 0x49, 0x19, 0x1b, 0x5d, 0xed, 0x49, 0x7b, 0x3f, 0x07, 0x01,
+       0xda, 0x08, 0x7b, 0x61, 0x2f, 0x56, 0x7b, 0xb0, 0x54, 0x6f, 0xe3, 0xff,
+       0x67, 0xd8, 0xf8, 0x6c, 0x23, 0xae, 0xb1, 0xf1, 0x7f, 0xc5, 0xf2, 0x1a,
+       0x7f, 0x7b, 0xda, 0xde, 0x3f, 0x0c, 0xf8, 0xf6, 0x2d, 0xd9, 0xfb, 0xec,
+       0x83, 0x76, 0x87, 0xc8, 0x0d, 0xb0, 0xf9, 0xde, 0x09, 0x1e, 0xbc, 0x11,
+       0xbe, 0xd4, 0xbb, 0x4a, 0x9e, 0xec, 0x2f, 0xb5, 0xc1, 0xe7, 0x6e, 0x97,
+       0x77, 0x4f, 0xed, 0x94, 0xa1, 0xc9, 0x0f, 0x5e, 0x21, 0xcd, 0xdb, 0x60,
+       0xa3, 0x4e, 0x01, 0xce, 0x98, 0x95, 0xdb, 0x3f, 0x04, 0xde, 0x3a, 0x53,
+       0xdf, 0x57, 0x6d, 0xdb, 0x8d, 0x9c, 0xe7, 0xd9, 0xc9, 0xb5, 0xfa, 0x49,
+       0xa0, 0x3d, 0x63, 0x29, 0xdb, 0xe4, 0xec, 0x49, 0x7a, 0x5f, 0x29, 0xd8,
+       0xe5, 0x01, 0x6c, 0x92, 0x1d, 0xe8, 0x8f, 0xf1, 0xe4, 0x4d, 0xf2, 0xd4,
+       0x35, 0xee, 0x27, 0xf2, 0x9a, 0x0f, 0xdb, 0x9d, 0xdc, 0xd4, 0x8d, 0x52,
+       0x3c, 0x18, 0xc7, 0x1c, 0x54, 0xdb, 0x16, 0xb9, 0x5e, 0x86, 0xf4, 0x7c,
+       0xce, 0xc8, 0x11, 0xe8, 0xe6, 0x3f, 0x28, 0x0d, 0xc9, 0xe2, 0x70, 0x2b,
+       0x9e, 0xe3, 0xf2, 0x54, 0xa9, 0x07, 0xbe, 0xcf, 0x3b, 0x80, 0xa3, 0x46,
+       0x3c, 0x37, 0xca, 0xc0, 0x15, 0xe4, 0xd5, 0x16, 0x59, 0x40, 0xf9, 0x3b,
+       0xe5, 0xdf, 0xd9, 0x72, 0x96, 0x91, 0x37, 0x5a, 0xd0, 0x36, 0x2e, 0x17,
+       0x4b, 0xb4, 0x2b, 0x35, 0x4f, 0xf4, 0x7f, 0x4b, 0x7a, 0xb2, 0xdf, 0x82,
+       0x9d, 0x7a, 0x01, 0xd7, 0xd3, 0x92, 0xde, 0x3f, 0xea, 0xf4, 0xa4, 0x3a,
+       0x1d, 0xe8, 0x4e, 0x5c, 0xae, 0xd3, 0xe3, 0x35, 0x3a, 0x57, 0xd9, 0x3e,
+       0x1a, 0xe4, 0xe9, 0x83, 0x2a, 0xd9, 0x82, 0x35, 0xd9, 0xed, 0x74, 0xd9,
+       0x32, 0x3e, 0xeb, 0x9c, 0x3c, 0xe9, 0x3c, 0xab, 0x76, 0x6c, 0x10, 0xe9,
+       0x68, 0x81, 0xcd, 0x33, 0x26, 0xaa, 0xad, 0x45, 0x5c, 0xe9, 0x9c, 0x51,
+       0xed, 0x28, 0xf3, 0x6d, 0x59, 0xa2, 0x05, 0xfa, 0x01, 0x65, 0xdb, 0x50,
+       0xb6, 0xcb, 0x96, 0xb5, 0xb6, 0x48, 0x23, 0xca, 0xce, 0x68, 0x9e, 0xbf,
+       0xd4, 0xe5, 0x7b, 0x79, 0xa7, 0x59, 0x3a, 0x4e, 0xb5, 0x40, 0x36, 0x6c,
+       0x92, 0x85, 0x6b, 0x9a, 0xa4, 0x03, 0xef, 0x18, 0xe7, 0x0e, 0x4e, 0xc5,
+       0xe5, 0xba, 0x53, 0x9d, 0xc9, 0x0f, 0x61, 0x0e, 0x9d, 0x67, 0x19, 0xf7,
+       0x7e, 0xf2, 0x0a, 0xc6, 0x7d, 0x3a, 0xce, 0xf2, 0xde, 0xa4, 0xe5, 0x0f,
+       0xf1, 0x61, 0xbe, 0x71, 0x44, 0x99, 0x7c, 0x1a, 0x7e, 0x2e, 0x75, 0x78,
+       0xa7, 0xfd, 0x1e, 0xc7, 0x9f, 0x5e, 0x41, 0xbf, 0x6d, 0x86, 0xf6, 0x54,
+       0x99, 0xfc, 0x48, 0x3d, 0x84, 0xfb, 0xb4, 0x23, 0xc5, 0x9a, 0xcc, 0x9a,
+       0x23, 0x5f, 0x9d, 0x54, 0xcc, 0x65, 0x41, 0x59, 0xf5, 0x67, 0x42, 0xb3,
+       0xc6, 0xe4, 0x05, 0x23, 0x97, 0xde, 0x67, 0xe4, 0xd2, 0x99, 0xf3, 0xcb,
+       0xe4, 0xd2, 0x25, 0x2d, 0x97, 0x0e, 0x0a, 0xee, 0x73, 0x97, 0x20, 0x97,
+       0x5e, 0xc0, 0xb3, 0xa7, 0xe5, 0x52, 0x42, 0xac, 0xbd, 0x2c, 0x3f, 0xd0,
+       0xe3, 0xcf, 0x96, 0x5d, 0x6d, 0x57, 0x15, 0xa7, 0x61, 0x93, 0x94, 0x27,
+       0xac, 0xfe, 0x96, 0x4c, 0xab, 0x74, 0xf5, 0xff, 0x50, 0x22, 0x9b, 0xf3,
+       0xcf, 0xae, 0xe0, 0xf7, 0x46, 0x9f, 0x53, 0x94, 0x61, 0xaf, 0x42, 0x86,
+       0x89, 0x5a, 0x5b, 0x86, 0xe1, 0x5d, 0x05, 0xef, 0x2a, 0xec, 0xf7, 0x6f,
+       0x7f, 0x38, 0xe2, 0x51, 0x7e, 0x50, 0x66, 0x40, 0x26, 0x95, 0x21, 0x93,
+       0xca, 0x90, 0x53, 0x65, 0xc8, 0x25, 0xd8, 0x6c, 0xe7, 0xcb, 0x90, 0x4b,
+       0x65, 0xc8, 0x25, 0xc8, 0xb8, 0xc7, 0x20, 0xe3, 0x8c, 0x4c, 0x1b, 0x86,
+       0x4c, 0x3b, 0x23, 0xf7, 0x59, 0x5d, 0x6f, 0x62, 0x25, 0xbd, 0xd6, 0x47,
+       0xea, 0xd3, 0x31, 0xe4, 0xf3, 0x75, 0xb1, 0xc1, 0x03, 0xc7, 0x35, 0xbf,
+       0x7b, 0xbe, 0xba, 0xca, 0x61, 0x0e, 0xcd, 0xf7, 0xb5, 0xff, 0xbe, 0x9b,
+       0xbf, 0xa5, 0x09, 0x7c, 0xfd, 0x1d, 0xcb, 0xd7, 0xbb, 0x97, 0xf8, 0x3a,
+       0xed, 0x30, 0x56, 0xbc, 0x36, 0x5f, 0x6f, 0xb3, 0xef, 0x0a, 0xe1, 0x3a,
+       0xf0, 0xf5, 0xba, 0x15, 0x7c, 0x1d, 0x07, 0x5f, 0xef, 0x5f, 0xc5, 0xd7,
+       0x1b, 0x9c, 0x01, 0xdd, 0x86, 0x67, 0x24, 0xf8, 0xdc, 0xe8, 0xd4, 0xf8,
+       0xfa, 0x1e, 0xcd, 0xd7, 0x47, 0xc1, 0xd7, 0xd7, 0xd7, 0xf1, 0xf5, 0x7e,
+       0x49, 0xdf, 0x9c, 0x8b, 0xed, 0x94, 0xd1, 0xfb, 0x55, 0xdb, 0x66, 0xf9,
+       0x17, 0x31, 0xed, 0x0d, 0x8f, 0x0d, 0x4c, 0xb5, 0x49, 0xfe, 0xa1, 0x57,
+       0x50, 0x46, 0x3e, 0x4b, 0x8f, 0x64, 0x1d, 0x4f, 0x8e, 0x1c, 0xff, 0xbe,
+       0xcc, 0x6b, 0xde, 0x12, 0x19, 0x3b, 0x1e, 0x97, 0xf1, 0xe3, 0x8c, 0x43,
+       0x7c, 0xcf, 0xd2, 0x7b, 0x93, 0x8c, 0x1f, 0x64, 0xde, 0x9c, 0x2b, 0xa3,
+       0xc7, 0xe1, 0x6f, 0x1d, 0x67, 0x1c, 0xe2, 0xa5, 0x25, 0x1e, 0x9b, 0x87,
+       0x6c, 0x19, 0x3d, 0xce, 0xb5, 0x8e, 0xa3, 0x9f, 0x16, 0x39, 0x7a, 0x5c,
+       0xe4, 0xb6, 0xe3, 0xae, 0x7c, 0xe0, 0xf8, 0x12, 0xaf, 0x0d, 0x47, 0xbc,
+       0xf6, 0x0c, 0x78, 0xad, 0xd3, 0xf2, 0x9a, 0x5a, 0xe2, 0xb5, 0xaf, 0xd6,
+       0xf1, 0x1a, 0xdb, 0x93, 0xd7, 0x9e, 0xb5, 0x65, 0x7c, 0x76, 0xe5, 0xd0,
+       0xf1, 0x76, 0x19, 0x7d, 0xe8, 0x2d, 0x32, 0x76, 0x3f, 0x61, 0x35, 0xdf,
+       0x85, 0xa2, 0x2d, 0x36, 0x5d, 0xed, 0x44, 0xff, 0x51, 0x0e, 0x11, 0x71,
+       0xed, 0x77, 0xcf, 0x48, 0xba, 0xc0, 0xf1, 0x1a, 0xe1, 0x47, 0x9f, 0x82,
+       0x7f, 0x71, 0x08, 0x30, 0xdd, 0x72, 0x5c, 0xd2, 0xae, 0xbc, 0x2c, 0x13,
+       0xc1, 0xe9, 0xed, 0xc6, 0x9e, 0x80, 0x2d, 0xa2, 0x6d, 0x9f, 0xac, 0xe4,
+       0xdf, 0x1e, 0x6a, 0x1f, 0x63, 0xb2, 0x22, 0x8c, 0x05, 0x30, 0x6e, 0x6e,
+       0xbf, 0x85, 0xca, 0xfc, 0xc7, 0x06, 0x7d, 0xe6, 0x45, 0xc7, 0x6c, 0xfb,
+       0xf8, 0x9e, 0xcf, 0xb0, 0x67, 0xf4, 0xd9, 0x45, 0xb6, 0x67, 0x3f, 0x09,
+       0x1d, 0x53, 0x2f, 0x56, 0xf8, 0x4d, 0x1c, 0xf8, 0x9f, 0x15, 0x7e, 0x5b,
+       0xeb, 0x37, 0xdb, 0x4c, 0x7c, 0x96, 0x7c, 0xf7, 0x5d, 0x27, 0x5f, 0x9a,
+       0xd3, 0xdf, 0x38, 0xc8, 0xf9, 0xf8, 0x5d, 0xe1, 0x33, 0xeb, 0xcf, 0x31,
+       0xde, 0x91, 0x4a, 0xa9, 0x63, 0xdb, 0x99, 0x7b, 0x70, 0x70, 0x8e, 0x75,
+       0x77, 0x5a, 0x1e, 0xdd, 0xa9, 0xfd, 0x0e, 0xda, 0x58, 0xa3, 0x93, 0x2f,
+       0x48, 0x91, 0xb6, 0xc9, 0xf0, 0x4e, 0xa7, 0x30, 0xfd, 0x73, 0xdb, 0x8d,
+       0xfd, 0x3c, 0xb0, 0x95, 0x79, 0x87, 0x59, 0xb5, 0x5a, 0x26, 0x9f, 0x92,
+       0x48, 0x26, 0xa7, 0x6f, 0xce, 0xc2, 0xce, 0xce, 0x1f, 0xd7, 0xdf, 0xab,
+       0x4a, 0x75, 0x2a, 0xce, 0xe9, 0x4e, 0xc8, 0xd7, 0x88, 0x16, 0x92, 0xf2,
+       0xd1, 0xe3, 0xa4, 0x07, 0x95, 0xd8, 0x28, 0x1f, 0xb1, 0xf4, 0x70, 0x46,
+       0x4a, 0x90, 0x3b, 0xc7, 0x8f, 0x7f, 0x40, 0xa6, 0x0f, 0xac, 0xa4, 0x87,
+       0xb1, 0x1a, 0x3d, 0x24, 0x60, 0x9f, 0x39, 0xf5, 0xf4, 0xf0, 0xf3, 0x4b,
+       0xf4, 0x30, 0xed, 0xfc, 0x6b, 0xe9, 0xe1, 0x86, 0x65, 0xf4, 0x30, 0xa1,
+       0xe9, 0x61, 0x68, 0x89, 0x1e, 0x26, 0x8e, 0x73, 0x5c, 0xbd, 0x37, 0xea,
+       0x2d, 0x38, 0x5c, 0xf3, 0x25, 0x5a, 0x48, 0x8d, 0xeb, 0x7c, 0xfd, 0x74,
+       0x81, 0xe7, 0x9b, 0x36, 0x28, 0xc6, 0x49, 0x6a, 0xeb, 0xbf, 0xf1, 0xdf,
+       0x74, 0xfd, 0xaf, 0xda, 0xfa, 0xff, 0x77, 0xfd, 0x33, 0x5b, 0x99, 0xbb,
+       0xcf, 0x33, 0xb0, 0x46, 0x1e, 0x47, 0xf4, 0x90, 0xdb, 0x6a, 0xf4, 0x02,
+       0xd7, 0x98, 0xcf, 0x90, 0x67, 0x90, 0x7f, 0xe7, 0x21, 0xff, 0x9e, 0x80,
+       0xfc, 0x7b, 0x7c, 0xd9, 0x9e, 0x40, 0xbf, 0x8d, 0x47, 0x84, 0x72, 0x24,
+       0xa8, 0xe1, 0x63, 0xa1, 0x8f, 0xf8, 0x30, 0xf9, 0x27, 0xcc, 0xfd, 0x5d,
+       0x8e, 0x13, 0x57, 0xe7, 0x1c, 0x3d, 0x1a, 0xd4, 0xe3, 0x84, 0x70, 0xbf,
+       0x5c, 0x37, 0x47, 0xfc, 0xae, 0xf0, 0xf9, 0x8c, 0xce, 0x23, 0x29, 0xea,
+       0x3d, 0x28, 0xe2, 0x85, 0x7b, 0x50, 0xc4, 0x89, 0xab, 0xed, 0xfd, 0x62,
+       0xa5, 0x49, 0xe7, 0xd0, 0x1f, 0x9e, 0x4b, 0xc8, 0x42, 0x82, 0x31, 0x3e,
+       0x7e, 0xe7, 0x90, 0x7e, 0xb3, 0x9f, 0x2c, 0x4a, 0x81, 0xb9, 0x72, 0xe0,
+       0xe9, 0x0d, 0x96, 0xb6, 0x19, 0x1b, 0xe4, 0x19, 0xe0, 0x68, 0x2f, 0xa2,
+       0xdb, 0xca, 0xba, 0x96, 0xba, 0x98, 0x25, 0xf0, 0x3e, 0x25, 0xa9, 0x5c,
+       0x1f, 0xee, 0x73, 0x1c, 0xfb, 0x13, 0x32, 0xf1, 0xe0, 0x87, 0x61, 0xcb,
+       0xbd, 0x1f, 0x3a, 0x87, 0xe7, 0xcf, 0xb8, 0xf7, 0xe0, 0x69, 0x18, 0x66,
+       0xf4, 0x77, 0xac, 0xe8, 0x03, 0x92, 0x1e, 0x92, 0x78, 0x3e, 0x63, 0xe3,
+       0x4a, 0x49, 0x29, 0x96, 0x5e, 0x94, 0x7c, 0x85, 0xdf, 0x5c, 0x7b, 0x09,
+       0xf7, 0xd7, 0x5b, 0x0f, 0xe3, 0x87, 0x0c, 0xeb, 0x3b, 0xd7, 0x66, 0x51,
+       0xb2, 0x15, 0x93, 0xe3, 0x52, 0x8b, 0x9b, 0x9c, 0x91, 0x63, 0xda, 0x7e,
+       0xce, 0xd8, 0xdc, 0x96, 0xf4, 0x70, 0x41, 0x8c, 0x0d, 0xfd, 0x39, 0xd8,
+       0xd0, 0x9f, 0xad, 0x66, 0xf5, 0x3e, 0xd6, 0xe3, 0xb0, 0xa1, 0x1f, 0x83,
+       0xee, 0xa1, 0xce, 0x49, 0x58, 0x9d, 0x33, 0xa1, 0x0e, 0x68, 0x9d, 0xf3,
+       0xe7, 0x5a, 0xe7, 0xbc, 0x7b, 0x95, 0xce, 0x39, 0xaa, 0x3a, 0x27, 0xa9,
+       0x73, 0x06, 0xd4, 0x7e, 0x87, 0xf6, 0xe2, 0x96, 0x35, 0x74, 0xce, 0x7b,
+       0xe4, 0x1d, 0xf6, 0xdd, 0x3d, 0xf2, 0xde, 0x3d, 0x7a, 0xef, 0xc6, 0x9b,
+       0x51, 0xfc, 0x76, 0x93, 0xd1, 0x41, 0xd7, 0xab, 0x6e, 0xbd, 0xe7, 0xfb,
+       0x95, 0x3a, 0x9d, 0xd3, 0xa1, 0xfa, 0x9c, 0x01, 0xdd, 0x86, 0xb1, 0x09,
+       0x3e, 0x07, 0x4e, 0x76, 0xb8, 0x09, 0xcf, 0x49, 0x89, 0x1d, 0xc7, 0xdc,
+       0xcd, 0xf7, 0xa5, 0x94, 0x79, 0xf7, 0x56, 0xfb, 0x4e, 0x45, 0xe5, 0xae,
+       0x29, 0xef, 0xb4, 0xe5, 0x46, 0x57, 0x75, 0xa8, 0x76, 0xad, 0xab, 0x76,
+       0x83, 0xa1, 0x66, 0xa0, 0x5f, 0x67, 0xca, 0x91, 0xce, 0xe2, 0x6f, 0xc6,
+       0x9e, 0x19, 0xa3, 0x88, 0x62, 0xd8, 0x29, 0xd4, 0xc1, 0x55, 0x8e, 0x6c,
+       0x4a, 0xfe, 0x86, 0xaf, 0x80, 0x6b, 0x0e, 0x78, 0xbd, 0x19, 0xfc, 0xf3,
+       0x1f, 0x4a, 0x8c, 0x81, 0xb6, 0xc9, 0x89, 0xa9, 0xfa, 0x77, 0xed, 0xf2,
+       0xae, 0xa9, 0x1d, 0x72, 0xfb, 0xe4, 0xd6, 0xa4, 0x34, 0xef, 0x94, 0x89,
+       0xc9, 0x29, 0x7d, 0xfe, 0x7d, 0xb3, 0xfe, 0x2e, 0x08, 0xbf, 0x97, 0x63,
+       0x64, 0xe4, 0x90, 0x63, 0x64, 0x64, 0x56, 0xd5, 0x6c, 0xd6, 0xa8, 0x4f,
+       0x7e, 0x8b, 0x64, 0x70, 0x32, 0xa9, 0xbf, 0xa5, 0x3a, 0x53, 0xbd, 0x4a,
+       0x7e, 0xfb, 0xa4, 0xba, 0x4b, 0xd5, 0xce, 0xf7, 0x6a, 0x9b, 0x75, 0x76,
+       0x99, 0xcd, 0xfa, 0xbf, 0x64, 0xe1, 0xbd, 0x71, 0xcc, 0x13, 0x34, 0x7c,
+       0xf5, 0xb7, 0xb8, 0x17, 0xda, 0x96, 0x90, 0x17, 0x65, 0x50, 0xe3, 0x8f,
+       0xf2, 0xb4, 0x05, 0x72, 0x70, 0x51, 0xeb, 0xd7, 0x2d, 0xa0, 0x41, 0xca,
+       0xd2, 0x0f, 0xca, 0x0b, 0x5a, 0x9e, 0x6d, 0xb1, 0xb6, 0xeb, 0x3c, 0xbf,
+       0x6d, 0x7d, 0x9c, 0xb6, 0xeb, 0x9f, 0xdb, 0x72, 0x96, 0xa5, 0x93, 0x8b,
+       0x42, 0x7d, 0x97, 0x80, 0x0c, 0xa5, 0x3c, 0x7d, 0xa3, 0xb6, 0xeb, 0x97,
+       0x6c, 0x1f, 0x94, 0x9f, 0x46, 0x76, 0xef, 0x76, 0xe6, 0x6d, 0x19, 0x9f,
+       0xa3, 0x78, 0xba, 0x9f, 0xcd, 0x5b, 0x3e, 0x53, 0xce, 0xe7, 0xf1, 0x7e,
+       0x33, 0xde, 0x93, 0xcf, 0x1e, 0xd7, 0x7c, 0xa6, 0xed, 0x13, 0xa7, 0xd7,
+       0xee, 0x2f, 0x2c, 0xed, 0x0d, 0x14, 0xc8, 0x67, 0xea, 0x84, 0x37, 0x6f,
+       0xe4, 0x01, 0xf3, 0x54, 0x7f, 0x03, 0xba, 0x83, 0x6d, 0x51, 0xfe, 0x70,
+       0x96, 0xbe, 0x2d, 0xfc, 0x9f, 0x8d, 0x78, 0x6e, 0xc3, 0xf3, 0x8c, 0xbc,
+       0xfb, 0x60, 0x5c, 0xcf, 0x7b, 0x02, 0xf3, 0x38, 0x7c, 0x1c, 0x73, 0x72,
+       0x8c, 0xed, 0xec, 0x9e, 0x75, 0xa5, 0xe1, 0x2c, 0xf9, 0x8e, 0x67, 0x6d,
+       0xc2, 0xf0, 0x50, 0x2f, 0xe9, 0x36, 0xed, 0x0d, 0xe9, 0xb3, 0xa5, 0xbb,
+       0x93, 0x31, 0xe0, 0xe4, 0x30, 0xd6, 0x63, 0xa2, 0xe4, 0x7b, 0x39, 0xc7,
+       0x4f, 0x62, 0x9e, 0xb0, 0x01, 0x3b, 0x61, 0x0b, 0x76, 0xc2, 0x0e, 0xec,
+       0x84, 0x1d, 0xb8, 0x49, 0x4e, 0x5d, 0xc3, 0x1c, 0x93, 0xc2, 0x75, 0xf0,
+       0xca, 0xe5, 0xaf, 0x75, 0x9c, 0xbe, 0xf1, 0xe6, 0x41, 0xf8, 0xec, 0xe2,
+       0xa5, 0x87, 0x99, 0x87, 0xbf, 0xe8, 0x35, 0xde, 0x3c, 0x24, 0x9d, 0xfd,
+       0x78, 0xdf, 0xff, 0xa2, 0x74, 0xdd, 0x7c, 0xab, 0xd3, 0x38, 0x3c, 0x08,
+       0x3c, 0x66, 0x9d, 0x74, 0x72, 0xc4, 0x99, 0xc7, 0x38, 0xb9, 0xdd, 0x31,
+       0x61, 0xdc, 0x72, 0x9e, 0xb1, 0x88, 0x9b, 0x3b, 0x63, 0x3d, 0xa9, 0x51,
+       0x27, 0x3d, 0xac, 0x62, 0xe9, 0xe1, 0x41, 0x27, 0xaa, 0xc7, 0x6f, 0xae,
+       0x42, 0xce, 0x00, 0xd6, 0xc3, 0xe5, 0x4f, 0x83, 0x9e, 0x8e, 0x48, 0xf1,
+       0x64, 0x8b, 0xcc, 0x95, 0x3a, 0xbd, 0x9c, 0x4a, 0xe8, 0xdc, 0x12, 0x75,
+       0x0a, 0x44, 0x7f, 0x36, 0x2e, 0x33, 0x93, 0x3b, 0x45, 0x69, 0xdb, 0x7d,
+       0x9b, 0xe4, 0xa6, 0x26, 0xe5, 0x62, 0x9f, 0xb4, 0x2a, 0xf4, 0xcf, 0x6f,
+       0xdc, 0xaa, 0x53, 0xdc, 0x4b, 0x8c, 0x78, 0x61, 0x3b, 0xf9, 0x64, 0x12,
+       0x38, 0x04, 0xdd, 0x32, 0xc6, 0xdb, 0x24, 0x94, 0x7b, 0x1f, 0xd0, 0xf1,
+       0x53, 0xc6, 0x6c, 0xeb, 0xf7, 0x1e, 0xc8, 0x1f, 0xf1, 0x35, 0xf9, 0x63,
+       0xb6, 0xcc, 0x7d, 0x1a, 0x29, 0xb8, 0x8c, 0x11, 0xfb, 0xf8, 0x3d, 0xcd,
+       0xba, 0x4d, 0x32, 0xd1, 0x57, 0xb0, 0x79, 0x1e, 0x7f, 0x9e, 0x64, 0x0e,
+       0x31, 0x71, 0x32, 0xda, 0x47, 0x5e, 0x5f, 0xb9, 0xb7, 0x11, 0xaf, 0x93,
+       0x07, 0x8e, 0x2c, 0x4c, 0x46, 0x7b, 0x21, 0xec, 0x0f, 0xcf, 0xd3, 0x46,
+       0xde, 0xe6, 0x56, 0xb5, 0x23, 0x5c, 0xdc, 0xaf, 0x5c, 0x2e, 0x63, 0x95,
+       0x4f, 0x99, 0xea, 0x69, 0xf9, 0x7a, 0xa6, 0x6a, 0x64, 0xeb, 0x74, 0x35,
+       0xd2, 0x2d, 0x71, 0xa3, 0x4b, 0x57, 0xe9, 0x13, 0x13, 0xcd, 0xac, 0xe9,
+       0x13, 0xea, 0x45, 0x25, 0xef, 0x9b, 0xdb, 0x26, 0xee, 0xc3, 0xb2, 0x38,
+       0xe1, 0x7f, 0x7a, 0x3b, 0x73, 0x35, 0x26, 0x82, 0x37, 0xa3, 0x1f, 0x9b,
+       0xae, 0xa4, 0x3e, 0x1c, 0x51, 0x8d, 0xb8, 0x6f, 0xd6, 0xf4, 0x07, 0x9e,
+       0xc2, 0xb3, 0xf1, 0x13, 0x3e, 0x07, 0x3f, 0xe1, 0xb3, 0xd0, 0x75, 0xe7,
+       0xe1, 0x27, 0x3c, 0x01, 0x3f, 0xe1, 0x71, 0xf8, 0x09, 0x8f, 0x41, 0x4f,
+       0xd6, 0xfb, 0x07, 0xe3, 0xcb, 0xfc, 0x83, 0x50, 0xf3, 0x3f, 0xe3, 0x81,
+       0x4f, 0xd4, 0xf9, 0x06, 0x87, 0x8c, 0xbe, 0x82, 0xdf, 0x6f, 0xf8, 0xa8,
+       0x43, 0xdd, 0xa4, 0xf5, 0xa3, 0xc9, 0xdb, 0x1d, 0x5e, 0xd2, 0x57, 0x1d,
+       0xca, 0xe8, 0xab, 0x99, 0x9a, 0xbe, 0x32, 0x7c, 0xf4, 0xf0, 0xa4, 0xc4,
+       0xfc, 0xc9, 0xf9, 0x5c, 0xb0, 0x57, 0xf3, 0x50, 0xab, 0xbf, 0x53, 0x62,
+       0x0f, 0xa8, 0xb6, 0x06, 0xc9, 0xd9, 0x67, 0xd0, 0xd7, 0x89, 0x4f, 0xa3,
+       0xaf, 0xeb, 0x24, 0xaf, 0xed, 0xb3, 0xcb, 0xe3, 0xfb, 0xb1, 0x15, 0xf8,
+       0x2e, 0x96, 0x27, 0x34, 0xce, 0xef, 0xaf, 0x70, 0x9f, 0xa5, 0x45, 0xc6,
+       0x2b, 0x11, 0xce, 0x79, 0x9e, 0x95, 0xb9, 0x18, 0xed, 0x12, 0x7b, 0x78,
+       0x1b, 0xcf, 0x59, 0xa9, 0x7c, 0xb0, 0x5e, 0xe7, 0xb0, 0x9c, 0xea, 0x93,
+       0x64, 0xbe, 0x8f, 0xb4, 0x7a, 0x9f, 0xcc, 0xe8, 0xb5, 0xd8, 0x26, 0x0d,
+       0x0f, 0xd3, 0x46, 0x89, 0xf6, 0xf3, 0xde, 0x7f, 0xa5, 0xfd, 0xe6, 0x6a,
+       0xdc, 0xd4, 0x13, 0x39, 0xa2, 0xd7, 0x6b, 0x5a, 0xe7, 0x19, 0xde, 0x34,
+       0xc7, 0xb8, 0x3c, 0xbf, 0x6f, 0xc5, 0x98, 0xfc, 0xbf, 0x66, 0xfd, 0x7e,
+       0xf9, 0x4a, 0x63, 0xcf, 0x6c, 0xb6, 0x76, 0x8c, 0x89, 0x53, 0xad, 0x6d,
+       0xc3, 0xb0, 0x9f, 0xfa, 0x6f, 0x32, 0xee, 0x70, 0xc6, 0x27, 0x77, 0x3a,
+       0xc5, 0x49, 0xee, 0x65, 0xdb, 0xbf, 0xd1, 0xe1, 0xed, 0x77, 0x0e, 0xfb,
+       0x3b, 0x50, 0xc6, 0x98, 0x25, 0x63, 0x36, 0xf7, 0x5f, 0xc9, 0x18, 0x6d,
+       0xce, 0xe7, 0xd8, 0x2c, 0xdb, 0xe1, 0x4c, 0x4c, 0x76, 0xc2, 0x37, 0xe7,
+       0xb9, 0x2a, 0xbe, 0x1f, 0xe2, 0xda, 0x41, 0x07, 0x7b, 0xfa, 0xcc, 0xee,
+       0x98, 0x5c, 0x65, 0x63, 0xd0, 0xd4, 0xc3, 0x3f, 0xbd, 0x6c, 0xef, 0xf6,
+       0x28, 0xf4, 0xd8, 0x2d, 0x90, 0x47, 0xd4, 0xc3, 0x47, 0xe5, 0x6d, 0x96,
+       0x9e, 0x97, 0xeb, 0xe1, 0x4b, 0xc2, 0x38, 0x71, 0x2f, 0xde, 0x15, 0xc2,
+       0x38, 0xe8, 0xe1, 0x58, 0x9d, 0xaf, 0x46, 0xbf, 0xaf, 0x29, 0x63, 0xf6,
+       0xc3, 0x96, 0xfb, 0x7d, 0x90, 0x03, 0x89, 0xc8, 0xcf, 0x6b, 0x5c, 0xda,
+       0xaf, 0xdd, 0x6f, 0xdb, 0x4e, 0x04, 0x7f, 0x44, 0x1c, 0xa5, 0x8e, 0xca,
+       0x2f, 0x42, 0xa7, 0x31, 0x07, 0xe4, 0x2f, 0x34, 0xce, 0x44, 0x91, 0xf6,
+       0x36, 0x6b, 0x18, 0xad, 0x9c, 0x4f, 0x45, 0x39, 0x1c, 0x45, 0xdb, 0x76,
+       0xcc, 0xee, 0xc9, 0x17, 0xe5, 0xeb, 0x8c, 0x73, 0xa6, 0x06, 0x63, 0xeb,
+       0xf9, 0x3d, 0x46, 0xb4, 0xfd, 0x45, 0xed, 0xb7, 0x67, 0x25, 0xea, 0x8b,
+       0xcf, 0x0d, 0x75, 0x7d, 0xd3, 0x8e, 0xe2, 0x7d, 0xe5, 0x39, 0xb2, 0xa7,
+       0xf5, 0x3e, 0xa3, 0xf9, 0x5e, 0x42, 0xc4, 0x27, 0xe4, 0x9d, 0x94, 0x3e,
+       0xeb, 0xe4, 0x3f, 0x4c, 0xbb, 0x87, 0x7b, 0xb0, 0xde, 0xfc, 0x78, 0xf0,
+       0x11, 0xfd, 0xcd, 0xc0, 0x69, 0x11, 0xa7, 0x18, 0xdc, 0xa6, 0x73, 0x4f,
+       0x8a, 0x3a, 0xd6, 0x5c, 0xc0, 0xbd, 0xe6, 0xa3, 0x76, 0x3c, 0xcc, 0xbf,
+       0xc3, 0xc1, 0xb2, 0x3c, 0x60, 0xa3, 0x0e, 0xa1, 0xec, 0x4d, 0x48, 0xc7,
+       0x89, 0x5f, 0xd0, 0xbc, 0xb0, 0x05, 0xbe, 0xc0, 0xc0, 0x09, 0xe8, 0xea,
+       0x13, 0x49, 0x19, 0x3a, 0xa1, 0x75, 0x63, 0x76, 0x75, 0xac, 0xa0, 0xc7,
+       0x73, 0x9d, 0x77, 0xe9, 0x73, 0x6c, 0x6f, 0x3d, 0x11, 0x93, 0x63, 0x89,
+       0x1e, 0xaf, 0xcb, 0x79, 0xb7, 0xd5, 0x85, 0x51, 0x0c, 0xbb, 0x05, 0xed,
+       0x5f, 0x2f, 0x8e, 0x1d, 0xc5, 0xaf, 0x63, 0x32, 0x7d, 0xb0, 0x1d, 0xb0,
+       0x75, 0x6e, 0x33, 0x67, 0x90, 0xb1, 0x56, 0xfa, 0x1b, 0xf7, 0x6e, 0x92,
+       0xb2, 0xac, 0x03, 0xb0, 0x0c, 0x9e, 0xa0, 0x3e, 0xf3, 0x35, 0x8f, 0x03,
+       0x06, 0xaf, 0x41, 0xfb, 0x21, 0xe4, 0xcb, 0xb7, 0x88, 0xff, 0x00, 0x64,
+       0xdc, 0x89, 0xb8, 0x74, 0x9d, 0x68, 0x91, 0x5d, 0x27, 0xe8, 0x87, 0xd4,
+       0xfb, 0xa5, 0xb4, 0x4b, 0xe7, 0x30, 0xc7, 0x77, 0x6a, 0x39, 0xc9, 0x3d,
+       0xcd, 0xdb, 0xc9, 0xbb, 0xa8, 0x9b, 0x87, 0xcd, 0x9c, 0x3b, 0xe1, 0xe9,
+       0x3d, 0xd2, 0x1c, 0xe6, 0x9c, 0xaf, 0x78, 0x18, 0xc7, 0xc8, 0x9c, 0x22,
+       0xfd, 0x94, 0xe1, 0x6d, 0xc0, 0xf1, 0x31, 0xcb, 0x3b, 0x43, 0xdb, 0x2c,
+       0x8f, 0xfe, 0x88, 0xbc, 0x77, 0xf3, 0x36, 0x23, 0x3b, 0x7f, 0x76, 0x1b,
+       0x73, 0x93, 0xb6, 0xf8, 0xbc, 0x37, 0x69, 0x7b, 0xc2, 0xc8, 0xd0, 0xd7,
+       0xe2, 0x45, 0x01, 0x8e, 0xa2, 0x7d, 0x29, 0x7d, 0x96, 0x2f, 0xbc, 0x18,
+       0xe8, 0xf3, 0x2b, 0xc1, 0x02, 0xf3, 0x08, 0xf5, 0x77, 0x14, 0x6a, 0xdf,
+       0x5b, 0xd9, 0x5b, 0x65, 0x9c, 0xfc, 0x89, 0xe8, 0x6f, 0xa9, 0xd4, 0xe5,
+       0x1d, 0xd6, 0xef, 0x81, 0x31, 0xd6, 0xb4, 0x94, 0x1b, 0x14, 0x4e, 0xea,
+       0xef, 0x21, 0x3d, 0xeb, 0x5c, 0x2a, 0x5d, 0x70, 0xbe, 0x39, 0x25, 0xa1,
+       0xeb, 0x7f, 0xdf, 0xf9, 0xb6, 0xcf, 0x3d, 0xf3, 0x2f, 0x3b, 0xdf, 0x2a,
+       0xf9, 0xe0, 0xc3, 0x0b, 0x98, 0xc7, 0x2b, 0xce, 0x77, 0xb0, 0xbe, 0x47,
+       0xca, 0xd9, 0xb4, 0x67, 0x63, 0xe2, 0x17, 0x4a, 0xaf, 0x38, 0x5f, 0xaa,
+       0xc5, 0x93, 0xfa, 0x23, 0x1a, 0x39, 0xca, 0x77, 0x15, 0xbc, 0xab, 0xe8,
+       0xfd, 0x1f, 0x67, 0x76, 0xca, 0xe6, 0x97, 0x68, 0x3e, 0x9e, 0x5f, 0xda,
+       0x97, 0x19, 0xd6, 0x7b, 0x15, 0xcf, 0x38, 0xb3, 0x73, 0x9f, 0xdb, 0x66,
+       0xf2, 0x8c, 0x2e, 0xe0, 0x9d, 0xc9, 0xb9, 0x9c, 0x99, 0xbb, 0x80, 0x3a,
+       0x4f, 0x3b, 0x33, 0x3a, 0xfe, 0xc5, 0x76, 0x17, 0x9c, 0xe9, 0xb9, 0xa7,
+       0x9d, 0x39, 0xbd, 0x07, 0x7d, 0xd1, 0x79, 0x74, 0x8a, 0x7d, 0x5f, 0x44,
+       0x9d, 0x79, 0xe7, 0x14, 0xfa, 0x9b, 0x9b, 0xe2, 0x79, 0xdc, 0x4e, 0xd8,
+       0x05, 0xfc, 0x1b, 0x45, 0xfc, 0x1e, 0xc7, 0x33, 0xce, 0xdc, 0x52, 0xbf,
+       0x0b, 0xe8, 0x87, 0x75, 0x49, 0x8b, 0x1c, 0xf7, 0x19, 0xf4, 0xbf, 0x7a,
+       0xaf, 0x6a, 0x35, 0x4e, 0x9e, 0x07, 0x4e, 0x5e, 0xb4, 0x38, 0x79, 0xd5,
+       0xe2, 0xe4, 0xb9, 0x3a, 0x9c, 0x88, 0x5a, 0x8e, 0x93, 0x57, 0x81, 0x13,
+       0x51, 0x6b, 0xe3, 0x04, 0xef, 0x2a, 0x78, 0xa7, 0x71, 0xf2, 0xd2, 0x0a,
+       0x9c, 0x2c, 0x2e, 0xc5, 0xe5, 0x0d, 0x4e, 0x5e, 0x00, 0x4e, 0x7e, 0x60,
+       0x61, 0x7f, 0xd1, 0xe2, 0x04, 0xf7, 0xb9, 0x17, 0x51, 0xe7, 0xa5, 0x3a,
+       0x9c, 0xbc, 0x08, 0x9c, 0xbc, 0x64, 0x71, 0xf2, 0x6d, 0x8b, 0x93, 0x6f,
+       0xa3, 0xce, 0x22, 0x70, 0x72, 0x69, 0x0d, 0x9c, 0xbc, 0x00, 0x9c, 0x44,
+       0xfd, 0x5e, 0x42, 0x3f, 0xdf, 0xae, 0xc3, 0xc9, 0x0b, 0x6b, 0xe0, 0x84,
+       0x7b, 0xb1, 0x51, 0x4e, 0xf7, 0x99, 0xd7, 0xc9, 0xe9, 0x5e, 0x7c, 0x03,
+       0x39, 0xdd, 0xac, 0x73, 0x46, 0x6a, 0x7f, 0xbb, 0x62, 0xc2, 0xe6, 0xa8,
+       0x99, 0x5c, 0xc0, 0xda, 0x37, 0x9b, 0x3a, 0xc1, 0xe7, 0xc5, 0x02, 0xbc,
+       0x11, 0x9d, 0x53, 0xea, 0xee, 0x19, 0x03, 0xaf, 0xbd, 0x5b, 0x0e, 0x9f,
+       0x6c, 0x3c, 0x96, 0xb7, 0x65, 0xfe, 0x9e, 0xce, 0x82, 0x52, 0x7c, 0x17,
+       0xe5, 0x24, 0xd0, 0x2f, 0x69, 0xe0, 0xb7, 0x0a, 0xbb, 0xb3, 0x52, 0xbf,
+       0x27, 0x3d, 0xc5, 0x6f, 0x34, 0x71, 0x7f, 0x8c, 0x7f, 0x67, 0x23, 0xc5,
+       0x3c, 0xab, 0xa2, 0x86, 0x37, 0x0d, 0xfd, 0xd1, 0xaf, 0x73, 0xab, 0xf8,
+       0x37, 0x82, 0x62, 0xf0, 0xfb, 0x47, 0xfb, 0x68, 0x2b, 0x67, 0xec, 0x99,
+       0xb0, 0x40, 0x9f, 0x53, 0xa9, 0xf1, 0x4f, 0xfd, 0x79, 0x68, 0xf2, 0x5d,
+       0x8d, 0x6e, 0x8e, 0x2c, 0x7d, 0x77, 0xf0, 0xb4, 0x3c, 0xa5, 0x63, 0xc5,
+       0xcd, 0xfa, 0xef, 0x2b, 0x9c, 0x09, 0x4c, 0x8c, 0x76, 0x41, 0xc7, 0x68,
+       0x05, 0xde, 0xf8, 0xb8, 0x8d, 0xd3, 0x76, 0xf5, 0xbf, 0xb4, 0x14, 0xa3,
+       0xad, 0xcf, 0x67, 0x31, 0xfb, 0xeb, 0xb9, 0xc9, 0x39, 0x9d, 0xa3, 0x33,
+       0xc8, 0xef, 0x6f, 0x40, 0x46, 0x8c, 0x4d, 0x57, 0x64, 0xfc, 0x41, 0x3e,
+       0x53, 0xbf, 0xc5, 0xa0, 0xc3, 0x28, 0xc3, 0x0b, 0x92, 0xeb, 0x67, 0x99,
+       0x69, 0x33, 0xa8, 0xfd, 0xe5, 0xd3, 0x32, 0xb0, 0x34, 0x3e, 0xf1, 0xfb,
+       0x89, 0xba, 0xef, 0x60, 0xd3, 0xe6, 0xc9, 0x3a, 0xb9, 0x2a, 0xdf, 0x47,
+       0x7b, 0xe4, 0x9f, 0xb0, 0xdf, 0x0a, 0xe4, 0xfb, 0xfa, 0x6f, 0xbf, 0x6a,
+       0xd1, 0x81, 0xdf, 0xfc, 0xbe, 0xda, 0x84, 0x33, 0x88, 0x36, 0xf3, 0x5e,
+       0xcb, 0xb0, 0xca, 0xdc, 0x38, 0xcc, 0x73, 0x73, 0x33, 0xab, 0xbe, 0x9d,
+       0x5d, 0xd3, 0x8b, 0x45, 0xbd, 0xa6, 0xcc, 0xcf, 0x2a, 0x80, 0x16, 0x35,
+       0x6d, 0x69, 0xfa, 0x3f, 0xbc, 0xa4, 0x2f, 0xa9, 0x67, 0xcd, 0xb7, 0x67,
+       0x8c, 0xbe, 0x4c, 0x27, 0x07, 0x31, 0xbe, 0xfe, 0x1b, 0x0d, 0xf6, 0x5c,
+       0x6f, 0x7e, 0xee, 0x2e, 0xad, 0xeb, 0x27, 0x82, 0x6c, 0xca, 0x95, 0x35,
+       0xea, 0x4e, 0xd6, 0xd5, 0xd5, 0xf3, 0xf6, 0xe4, 0xb7, 0xb0, 0x36, 0xbf,
+       0x51, 0xae, 0xc8, 0xc0, 0xd4, 0x5f, 0xc1, 0x7f, 0x4c, 0xca, 0x6f, 0x96,
+       0x1f, 0x01, 0xbd, 0x16, 0xb6, 0xd8, 0x6f, 0x35, 0xe5, 0x00, 0x37, 0xbf,
+       0xbd, 0xa2, 0xf3, 0x89, 0x63, 0xbf, 0x0d, 0xba, 0xf8, 0xcc, 0x23, 0x1c,
+       0x03, 0xb0, 0xc4, 0x60, 0xdb, 0xc3, 0x4e, 0x98, 0x7e, 0x44, 0xe7, 0xce,
+       0x5d, 0x5f, 0x79, 0x44, 0xc7, 0x2c, 0x86, 0x2a, 0xed, 0xb2, 0xb7, 0xd2,
+       0x22, 0xfb, 0xa0, 0x17, 0xf6, 0x55, 0x7c, 0x5c, 0x71, 0x79, 0x67, 0xc5,
+       0xac, 0xd3, 0x07, 0x2b, 0x5c, 0xef, 0x3d, 0x32, 0x73, 0x72, 0xe5, 0xf7,
+       0x3e, 0xe7, 0x0b, 0xd1, 0xdf, 0x73, 0x52, 0x8a, 0xf9, 0x65, 0xa4, 0x25,
+       0x5c, 0xe5, 0xf4, 0xb1, 0x79, 0x8d, 0x07, 0x66, 0xb8, 0xa6, 0x27, 0x17,
+       0x85, 0x79, 0xfa, 0xfc, 0x1b, 0x4e, 0x7f, 0xb9, 0x9d, 0xe7, 0xa6, 0xf9,
+       0x2d, 0xaf, 0xa1, 0x6a, 0x94, 0x37, 0xbe, 0x56, 0xce, 0x38, 0xec, 0xfc,
+       0x3d, 0x51, 0x8e, 0x5f, 0x9c, 0x39, 0xe3, 0xd2, 0x71, 0xb6, 0x05, 0xf7,
+       0xef, 0x6e, 0xd7, 0x67, 0x9b, 0xcf, 0x8a, 0x2d, 0xd3, 0xf9, 0xe4, 0x78,
+       0x5e, 0xf9, 0xbd, 0xb6, 0x88, 0x1f, 0x6a, 0x7f, 0xf7, 0x40, 0xe4, 0xff,
+       0x02, 0x06, 0x86, 0xe5, 0x0a, 0xd4, 0x6f, 0x00, 0x00, 0x00 };
 
 static const u32 bnx2_CP_b09FwData[(0x0/4) + 1] = { 0x0 };
 static const u32 bnx2_CP_b09FwRodata[(0x118/4) + 1] = {
-       0x0800061c, 0x0800083c, 0x08000780, 0x080007a8, 0x080007d0, 0x080007f8,
-       0x08000654, 0x08000640, 0x08000864, 0x08000864, 0x08000670, 0x0800068c,
-       0x0800068c, 0x08000864, 0x080006a4, 0x080006b8, 0x08000864, 0x080006cc,
-       0x08000864, 0x08000864, 0x080006e0, 0x08000864, 0x08000864, 0x08000864,
-       0x08000864, 0x08000864, 0x08000864, 0x08000864, 0x08000864, 0x08000864,
-       0x08000864, 0x080006f4, 0x08000864, 0x08000708, 0x0800071c, 0x08000730,
-       0x08000864, 0x08000744, 0x08000758, 0x0800076c, 0x08003200, 0x08003218,
-       0x08003228, 0x08003238, 0x08003250, 0x08003268, 0x08003278, 0x08003288,
-       0x080032a8, 0x080032b8, 0x080032c8, 0x08003358, 0x08003298, 0x080032d8,
-       0x080032e8, 0x08003300, 0x08003320, 0x08003358, 0x08003338, 0x08003338,
-       0x080050d4, 0x080050d4, 0x080050d4, 0x080050d4, 0x080050d4, 0x080050fc,
-       0x080050fc, 0x08005124, 0x08005174, 0x08005144, 0x00000000 };
+       0x0800069c, 0x080008bc, 0x08000800, 0x08000828, 0x08000850, 0x08000878,
+       0x080006d4, 0x080006c0, 0x080008e4, 0x080008e4, 0x080006f0, 0x0800070c,
+       0x0800070c, 0x080008e4, 0x08000724, 0x08000738, 0x080008e4, 0x0800074c,
+       0x080008e4, 0x080008e4, 0x08000760, 0x080008e4, 0x080008e4, 0x080008e4,
+       0x080008e4, 0x080008e4, 0x080008e4, 0x080008e4, 0x080008e4, 0x080008e4,
+       0x080008e4, 0x08000774, 0x080008e4, 0x08000788, 0x0800079c, 0x080007b0,
+       0x080008e4, 0x080007c4, 0x080007d8, 0x080007ec, 0x080032e8, 0x08003300,
+       0x08003310, 0x08003320, 0x08003338, 0x08003350, 0x08003360, 0x08003370,
+       0x08003390, 0x080033a0, 0x080033b0, 0x08003440, 0x08003380, 0x080033c0,
+       0x080033d0, 0x080033e8, 0x08003408, 0x08003440, 0x08003420, 0x08003420,
+       0x080051bc, 0x080051bc, 0x080051bc, 0x080051bc, 0x080051bc, 0x080051e4,
+       0x080051e4, 0x0800520c, 0x0800525c, 0x0800522c, 0x00000000 };
 
 static struct fw_info bnx2_cp_fw_09 = {
+       /* Firmware version:  3.7.1 */
        .ver_major                      = 0x3,
-       .ver_minor                      = 0x4,
-       .ver_fix                        = 0x3,
+       .ver_minor                      = 0x7,
+       .ver_fix                        = 0x1,
 
        .start_addr                     = 0x0800006c,
 
        .text_addr                      = 0x08000000,
-       .text_len                       = 0x6ee8,
+       .text_len                       = 0x6fd0,
        .text_index                     = 0x0,
        .gz_text                        = bnx2_CP_b09FwText,
        .gz_text_len                    = sizeof(bnx2_CP_b09FwText),
 
-       .data_addr                      = 0x08007020,
+       .data_addr                      = 0x08007100,
        .data_len                       = 0x0,
        .data_index                     = 0x0,
        .data                           = bnx2_CP_b09FwData,
 
-       .sbss_addr                      = 0x08007024,
-       .sbss_len                       = 0xa1,
+       .sbss_addr                      = 0x08007104,
+       .sbss_len                       = 0xa9,
        .sbss_index                     = 0x0,
 
-       .bss_addr                       = 0x080070d0,
+       .bss_addr                       = 0x080071b0,
        .bss_len                        = 0x3b0,
        .bss_index                      = 0x0,
 
-       .rodata_addr                    = 0x08006ee8,
+       .rodata_addr                    = 0x08006fd0,
        .rodata_len                     = 0x118,
        .rodata_index                   = 0x0,
        .rodata                         = bnx2_CP_b09FwRodata,
 };
 
 static u8 bnx2_RXP_b09FwText[] = {
-/*     0x1f, 0x8b, 0x08, 0x00, 0x0e, 0x34, 0xe7, 0x45, 0x00, 0x03, */
-                                                                   0xec, 0x5c,
-       0x5d, 0x6c, 0x1c, 0xd7, 0x75, 0x3e, 0xf3, 0x43, 0x6a, 0x49, 0xf1, 0x67,
-       0xb8, 0x5c, 0xb1, 0x2b, 0x99, 0x96, 0x77, 0xc9, 0x91, 0xc8, 0x58, 0x8a,
-       0x31, 0xa2, 0x09, 0x5b, 0x48, 0x17, 0xf6, 0x76, 0x76, 0x25, 0xb1, 0xb1,
-       0x03, 0x53, 0xb6, 0x62, 0x07, 0x45, 0x6a, 0xb0, 0x4b, 0xb9, 0x0e, 0x8c,
-       0x06, 0x90, 0xff, 0x52, 0xbf, 0xb0, 0xde, 0x2c, 0xa9, 0x58, 0x4d, 0x17,
-       0x9c, 0xb5, 0x4d, 0x9b, 0x0e, 0x60, 0xb7, 0x0b, 0x92, 0x12, 0xf5, 0xb0,
-       0xd0, 0xb2, 0xa9, 0xdb, 0xea, 0xc1, 0x8e, 0x09, 0x56, 0xb1, 0x53, 0xa0,
-       0x2d, 0x5c, 0x27, 0x69, 0xfc, 0x10, 0x14, 0xaa, 0xec, 0xc4, 0x42, 0xd1,
-       0xa2, 0x02, 0x12, 0xd8, 0x29, 0x22, 0x7b, 0xfa, 0x7d, 0x77, 0x66, 0xc8,
-       0x25, 0x2d, 0xdb, 0x41, 0x1f, 0xfa, 0xd2, 0xbd, 0xc0, 0x62, 0xee, 0xbd,
-       0x73, 0xee, 0xb9, 0xe7, 0x9e, 0xff, 0x73, 0x87, 0xd2, 0x1f, 0x74, 0x48,
-       0xbb, 0x84, 0xad, 0x13, 0xbf, 0xd4, 0x89, 0x27, 0x1e, 0xb9, 0x69, 0xf4,
-       0xa6, 0x9b, 0xd1, 0xbd, 0xd9, 0x30, 0x4c, 0x23, 0x9a, 0x6f, 0xb6, 0x66,
-       0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66,
-       0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66,
-       0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66,
-       0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66,
-       0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66,
-       0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0x6b, 0xb6, 0x66, 0xfb, 0xff, 0xde,
-       0x0c, 0x11, 0x8b, 0xcf, 0xce, 0xf0, 0x27, 0x31, 0x3d, 0x23, 0x0f, 0xb9,
-       0xb6, 0xc4, 0x8c, 0xcc, 0xd5, 0xa9, 0x49, 0x5b, 0x24, 0x5b, 0xdb, 0x97,
-       0xca, 0xc9, 0x87, 0x7e, 0x31, 0x61, 0x0a, 0xe7, 0xaf, 0xcf, 0x5c, 0xfd,
-       0x8b, 0x57, 0x6f, 0x4d, 0x5f, 0xa9, 0x1a, 0x12, 0xb3, 0x32, 0x33, 0x07,
-       0xac, 0xbd, 0x12, 0xeb, 0xc7, 0x9a, 0x17, 0x87, 0xfe, 0xa9, 0x4b, 0xba,
-       0x22, 0x5c, 0x22, 0x0b, 0xe5, 0xb4, 0x73, 0x18, 0xcf, 0x33, 0xb5, 0x7d,
-       0xce, 0x9a, 0x98, 0xb2, 0x6a, 0x05, 0x3b, 0x96, 0xca, 0x1a, 0xf1, 0x48,
-       0xa9, 0x16, 0x93, 0x8b, 0xea, 0xdf, 0x79, 0x60, 0x4f, 0x9b, 0xfd, 0xf3,
-       0x9a, 0x5b, 0xf7, 0xfd, 0xd3, 0x8e, 0xef, 0xbf, 0x8e, 0xdf, 0x7b, 0x0e,
-       0xc6, 0xde, 0x47, 0x7e, 0xd6, 0x34, 0x44, 0xb7, 0xff, 0x4c, 0x73, 0x17,
-       0x5b, 0xa5, 0x34, 0x2f, 0x32, 0xed, 0xc5, 0xe4, 0x94, 0x57, 0xd4, 0xf2,
-       0xf5, 0xb2, 0x76, 0x68, 0x79, 0x56, 0x3b, 0xbc, 0x7c, 0x4a, 0x3b, 0xb2,
-       0x5c, 0xd1, 0xdc, 0x65, 0x29, 0xea, 0x07, 0x3a, 0x24, 0x6b, 0x9d, 0xd5,
-       0x72, 0xf5, 0x3e, 0xcd, 0x9d, 0xbf, 0xea, 0xbb, 0x4e, 0xda, 0xfa, 0x3d,
-       0x31, 0xb3, 0xdc, 0xcf, 0x2d, 0xfb, 0x18, 0x9b, 0x92, 0x4d, 0xf8, 0xbe,
-       0x9e, 0xf1, 0x9f, 0x74, 0x47, 0x6d, 0x4b, 0xd7, 0x62, 0x52, 0xaa, 0xb7,
-       0x03, 0x6f, 0x87, 0x96, 0x9b, 0x37, 0xb5, 0xbc, 0xe7, 0xbf, 0xe6, 0x3a,
-       0xd2, 0x6f, 0x88, 0xef, 0xcf, 0x38, 0x7b, 0x92, 0xc7, 0xe5, 0x0c, 0xf0,
-       0xd6, 0x80, 0x4f, 0x2c, 0x3d, 0x43, 0xfa, 0x22, 0x9a, 0x8b, 0x5a, 0x6e,
-       0x28, 0xa2, 0x4f, 0x52, 0xa4, 0xbf, 0xb0, 0xa4, 0x83, 0xce, 0xed, 0x52,
-       0xa8, 0x5a, 0x32, 0xb1, 0xb4, 0x15, 0xfe, 0xa2, 0xff, 0xea, 0x50, 0x42,
-       0xfe, 0xb2, 0x9e, 0x3e, 0x55, 0x04, 0x2f, 0x66, 0xbc, 0x94, 0x80, 0xcf,
-       0x59, 0x77, 0xb4, 0x5f, 0x5e, 0xab, 0x27, 0xe5, 0xbb, 0x75, 0x3b, 0x59,
-       0x92, 0x6d, 0x52, 0x48, 0x58, 0xb2, 0x82, 0x35, 0xd3, 0xa0, 0x43, 0xb7,
-       0x6d, 0xab, 0x04, 0xd8, 0x52, 0xfd, 0x27, 0xfc, 0xb7, 0x32, 0xd6, 0xe4,
-       0xa8, 0x5a, 0x53, 0x04, 0xdd, 0x21, 0x2c, 0xcf, 0xa1, 0x60, 0xd5, 0x59,
-       0x02, 0x58, 0x29, 0x4e, 0x8e, 0x62, 0xae, 0xfe, 0x85, 0x50, 0x16, 0xad,
-       0x38, 0x2f, 0x9f, 0xbb, 0x71, 0xbe, 0xdd, 0xe0, 0x89, 0x24, 0x74, 0xd9,
-       0x93, 0x2c, 0x60, 0x66, 0xba, 0xde, 0x81, 0x31, 0x69, 0xf1, 0xfd, 0x23,
-       0x8e, 0x58, 0x25, 0xa7, 0x1b, 0xbc, 0x4b, 0x49, 0xc9, 0xe9, 0xc2, 0x9a,
-       0x16, 0xb1, 0x6c, 0x9e, 0x81, 0x78, 0xdb, 0x30, 0xef, 0x77, 0x1a, 0x19,
-       0xdf, 0x9f, 0x1c, 0x95, 0xae, 0x60, 0x6e, 0x1f, 0x70, 0x98, 0x32, 0x31,
-       0xae, 0x01, 0xee, 0x03, 0xd2, 0x17, 0x8b, 0x67, 0xd8, 0xe7, 0x73, 0x54,
-       0xdc, 0xd9, 0x54, 0xb8, 0x6f, 0x87, 0x94, 0xbc, 0xeb, 0xc3, 0x3e, 0x78,
-       0xed, 0xe1, 0xcc, 0xce, 0x4e, 0x8c, 0xb5, 0x1b, 0x80, 0xc7, 0x29, 0x09,
-       0xf7, 0xd8, 0x21, 0x6b, 0x09, 0xd1, 0x2f, 0x39, 0xbd, 0x21, 0x5c, 0x17,
-       0x68, 0x8d, 0x64, 0xde, 0x2e, 0x33, 0xf3, 0xad, 0x72, 0x72, 0x9e, 0xbc,
-       0x2d, 0x43, 0x16, 0x78, 0xde, 0x52, 0xd4, 0xb2, 0xf5, 0x53, 0xe8, 0x9b,
-       0x32, 0x69, 0xfb, 0xaf, 0xcd, 0x38, 0xb3, 0x5a, 0x6e, 0xf9, 0x8c, 0x96,
-       0x87, 0x0e, 0x1c, 0x5a, 0x3e, 0xaf, 0x1d, 0xae, 0xaf, 0x76, 0x4a, 0x7b,
-       0x1a, 0xda, 0x66, 0xca, 0x49, 0x4f, 0x13, 0xd2, 0xbb, 0x00, 0x7e, 0x65,
-       0x2d, 0x70, 0xde, 0xee, 0xd2, 0x0e, 0x03, 0x57, 0x8b, 0xfd, 0xad, 0x0e,
-       0xe9, 0x32, 0x64, 0x9b, 0x1d, 0xc1, 0xc6, 0xe4, 0x5b, 0xa0, 0x6d, 0xcd,
-       0x49, 0x00, 0x4e, 0xba, 0x83, 0x35, 0x3d, 0x21, 0x3d, 0xd4, 0x25, 0xea,
-       0x91, 0x9e, 0xcd, 0xcf, 0xfd, 0x69, 0x6f, 0x69, 0xff, 0x76, 0xc2, 0xc0,
-       0x3e, 0x52, 0x0f, 0x4d, 0xda, 0x6e, 0x8f, 0x29, 0x45, 0x4b, 0x97, 0xb4,
-       0x95, 0x93, 0x1b, 0x64, 0xc6, 0x11, 0xc9, 0x41, 0xbf, 0x75, 0xdb, 0x04,
-       0x8f, 0x6c, 0xf0, 0x68, 0xcf, 0xa9, 0x41, 0xfd, 0x0e, 0x49, 0xf5, 0x15,
-       0x35, 0x33, 0xe4, 0xe7, 0x82, 0xdc, 0xa6, 0xd6, 0xeb, 0x19, 0x07, 0x3a,
-       0xd9, 0xce, 0x3e, 0xf6, 0x8d, 0xa9, 0x7d, 0x8d, 0x8c, 0x9d, 0x5c, 0x14,
-       0xd1, 0xf4, 0xcc, 0x3e, 0xe0, 0xa3, 0xae, 0x12, 0xee, 0x29, 0xd0, 0x48,
-       0xda, 0xd9, 0xb7, 0xb1, 0x26, 0x26, 0xae, 0xd3, 0xd9, 0x40, 0x27, 0xe8,
-       0x49, 0x90, 0xe7, 0xe4, 0xa1, 0x3a, 0xa7, 0xb6, 0x71, 0xce, 0x5f, 0xfb,
-       0xdb, 0x46, 0x4c, 0x79, 0x5d, 0x9d, 0x97, 0x76, 0x45, 0x38, 0x75, 0x46,
-       0x21, 0x7f, 0xa6, 0x3d, 0xd1, 0x0a, 0x8e, 0xb5, 0x8e, 0x0b, 0x7a, 0xa1,
-       0x1b, 0x99, 0x0e, 0xc9, 0x29, 0xfa, 0x0e, 0x62, 0x2f, 0xda, 0x1b, 0xec,
-       0xc6, 0xe6, 0x59, 0x38, 0x97, 0x81, 0xed, 0xa6, 0x95, 0xfe, 0x14, 0x2a,
-       0xf4, 0x07, 0xa4, 0x6d, 0x35, 0xad, 0x4b, 0x80, 0xaf, 0xf4, 0x6c, 0x37,
-       0x68, 0xe3, 0x18, 0xb6, 0x67, 0xe3, 0xfd, 0x7e, 0xd8, 0xfa, 0xc1, 0x41,
-       0xf0, 0x87, 0x70, 0x76, 0x0a, 0xf2, 0xce, 0xba, 0xd8, 0xd3, 0x75, 0x6e,
-       0x56, 0x3c, 0xe8, 0xc1, 0x79, 0x06, 0x67, 0xc9, 0xaf, 0x76, 0xe8, 0xb3,
-       0x26, 0x05, 0x27, 0x9d, 0xa2, 0xfc, 0x03, 0xda, 0x75, 0xd9, 0x76, 0x4b,
-       0x23, 0xed, 0x91, 0xac, 0xa8, 0x8f, 0xa6, 0xc4, 0x47, 0x08, 0x4b, 0x38,
-       0xc2, 0xa7, 0x0f, 0x8a, 0xfe, 0x6b, 0xdf, 0xda, 0x74, 0x56, 0x5b, 0x06,
-       0x66, 0x41, 0x43, 0xc0, 0x5b, 0xf0, 0xe4, 0xb3, 0x60, 0xc9, 0xd7, 0xad,
-       0xfc, 0x23, 0x6c, 0x23, 0x1c, 0x74, 0xa2, 0x8f, 0x34, 0xac, 0x74, 0x04,
-       0xf6, 0x15, 0xd1, 0x14, 0xc9, 0x46, 0x0b, 0x71, 0x7c, 0xda, 0x39, 0x08,
-       0x0f, 0xbb, 0xf7, 0x60, 0xf7, 0x1e, 0x7c, 0x82, 0x07, 0x9b, 0xf7, 0xe8,
-       0x27, 0x52, 0xf2, 0xea, 0x10, 0xfc, 0xda, 0x86, 0x5f, 0x41, 0x1b, 0x43,
-       0x5f, 0x17, 0x03, 0x7e, 0x65, 0xba, 0xaa, 0xc3, 0x76, 0x61, 0x43, 0x4b,
-       0x9c, 0xb3, 0xf0, 0xcc, 0xe3, 0x69, 0xc3, 0x8f, 0x52, 0xaf, 0x22, 0xff,
-       0x49, 0x3f, 0x93, 0x84, 0x4f, 0xa1, 0xaf, 0xa1, 0x2f, 0x21, 0xac, 0xef,
-       0xe7, 0x1d, 0xae, 0xf5, 0x65, 0xdc, 0xa1, 0x1d, 0x75, 0x88, 0x1e, 0x2f,
-       0x6a, 0x47, 0x87, 0x60, 0x63, 0x37, 0xb6, 0x80, 0x56, 0xda, 0xda, 0x75,
-       0x74, 0x15, 0x68, 0xbf, 0xe8, 0x0c, 0xfe, 0x5d, 0xde, 0x36, 0xc0, 0x28,
-       0xa1, 0x76, 0x05, 0xe3, 0xb6, 0xd0, 0x9f, 0xf0, 0x7d, 0x3a, 0x95, 0x95,
-       0xdd, 0xe1, 0x98, 0xfd, 0x75, 0x7a, 0x1d, 0xfd, 0x96, 0x98, 0x0c, 0x9c,
-       0x09, 0xfc, 0xe0, 0xc0, 0x82, 0x25, 0xf6, 0x99, 0x80, 0xc6, 0x81, 0x73,
-       0x91, 0x3f, 0x6c, 0x01, 0x3e, 0xd0, 0xe7, 0x6d, 0xc4, 0x09, 0x91, 0xf7,
-       0x34, 0x98, 0x0a, 0xe6, 0xb6, 0xf2, 0x82, 0x3e, 0x98, 0xf6, 0x66, 0x35,
-       0xda, 0xdb, 0x01, 0xd8, 0x9b, 0xd3, 0x2a, 0x69, 0xe7, 0xef, 0x60, 0x6f,
-       0x4f, 0x39, 0x1a, 0x78, 0x23, 0x72, 0xa1, 0xdc, 0x01, 0x5b, 0x37, 0x93,
-       0xef, 0xc8, 0x9e, 0xd4, 0xb4, 0x68, 0x72, 0x9a, 0x73, 0x35, 0xcc, 0x29,
-       0xff, 0x1b, 0xd8, 0xf7, 0x45, 0xe3, 0x69, 0xd0, 0xe5, 0xfb, 0xd3, 0xc0,
-       0x59, 0xd8, 0x6f, 0x84, 0xb6, 0x15, 0xcd, 0xa7, 0x10, 0xf3, 0xdc, 0xcf,
-       0x19, 0x52, 0x1c, 0x6e, 0x91, 0xf4, 0xf0, 0x02, 0x70, 0x4f, 0x3a, 0x81,
-       0x1d, 0x53, 0xd7, 0x17, 0x81, 0x7f, 0xc6, 0x1b, 0x82, 0x1e, 0xd3, 0x0e,
-       0x40, 0x17, 0xf0, 0x2f, 0x02, 0xff, 0x4c, 0xbd, 0x45, 0xbe, 0x69, 0x46,
-       0xb1, 0x34, 0x3a, 0x4f, 0x1b, 0xc0, 0xa2, 0x7d, 0x4f, 0xc8, 0x17, 0xbd,
-       0xb8, 0xe6, 0x3e, 0x4b, 0x3f, 0x5b, 0x1a, 0x86, 0x9d, 0x68, 0x25, 0x87,
-       0x7b, 0x1b, 0xb2, 0xb8, 0x0e, 0x23, 0xd9, 0x52, 0x60, 0x83, 0x59, 0x77,
-       0xa8, 0x98, 0x34, 0x94, 0x2f, 0x11, 0x39, 0x5c, 0x36, 0x01, 0xc3, 0x31,
-       0xe7, 0x83, 0xb9, 0xb1, 0x72, 0x1f, 0x7c, 0x23, 0xc7, 0x57, 0xfd, 0x49,
-       0x27, 0x98, 0xfb, 0xdd, 0x72, 0x81, 0x32, 0x62, 0xdc, 0x4e, 0x95, 0x9c,
-       0x7f, 0xf7, 0xa1, 0xbf, 0x9b, 0xd6, 0x5c, 0x1b, 0x4f, 0x7a, 0x2c, 0x8c,
-       0xf5, 0xda, 0x11, 0x5b, 0xef, 0x6b, 0x0d, 0x7d, 0xd8, 0x11, 0x4c, 0x1e,
-       0x2a, 0x97, 0x7a, 0x5b, 0xe5, 0xaa, 0xc1, 0xd8, 0x79, 0x09, 0x46, 0xed,
-       0x96, 0xf7, 0x82, 0x1f, 0xa5, 0x9e, 0x86, 0xb9, 0x58, 0xbe, 0xec, 0xcb,
-       0x9a, 0x13, 0xac, 0xc1, 0xb8, 0x23, 0x57, 0xd6, 0xfb, 0x62, 0xb2, 0x3e,
-       0xb6, 0xb8, 0x66, 0x49, 0xf6, 0x0e, 0x2f, 0x8a, 0x5a, 0xdb, 0x1b, 0xdb,
-       0x58, 0x9b, 0xc8, 0x97, 0x4b, 0x3d, 0x0d, 0xe3, 0x64, 0x0e, 0xb8, 0xf4,
-       0x03, 0xeb, 0x6b, 0xfb, 0x37, 0xd6, 0xee, 0x90, 0x54, 0x0f, 0xd7, 0xeb,
-       0x7d, 0x6d, 0x1b, 0xb8, 0x53, 0x21, 0x3d, 0xbd, 0x6d, 0x1b, 0x38, 0x6c,
-       0xe2, 0x6c, 0x18, 0x0f, 0x13, 0xe7, 0xc0, 0x06, 0xce, 0xfd, 0x9b, 0xe9,
-       0x39, 0x21, 0xf0, 0x41, 0xb1, 0xd6, 0x8c, 0x1c, 0xb8, 0x50, 0x1e, 0x1c,
-       0xff, 0xa2, 0x20, 0xe6, 0xed, 0xdf, 0x16, 0xfa, 0x64, 0xf3, 0x80, 0x0b,
-       0x5e, 0x99, 0x42, 0x1f, 0xa7, 0x49, 0x09, 0x72, 0x7e, 0xa8, 0x26, 0x07,
-       0xd6, 0x6a, 0x12, 0xea, 0x12, 0x75, 0xe2, 0x32, 0x6c, 0x4c, 0x8a, 0xbb,
-       0x32, 0x1d, 0x13, 0x66, 0xc6, 0x82, 0xad, 0xc9, 0x78, 0x09, 0x3e, 0xd9,
-       0xc8, 0xec, 0x79, 0x3b, 0x67, 0x3c, 0xe9, 0x1b, 0x88, 0xdb, 0x39, 0xe9,
-       0x38, 0xe8, 0x8e, 0x62, 0xbe, 0x46, 0xdb, 0x82, 0x5f, 0xa9, 0x13, 0xf7,
-       0x7c, 0xb7, 0x74, 0x21, 0x2e, 0xd6, 0x5e, 0xda, 0x11, 0xd8, 0x8e, 0x98,
-       0x26, 0x7c, 0xed, 0xcc, 0x28, 0xe3, 0x78, 0x6b, 0x0c, 0xf0, 0x13, 0x46,
-       0x66, 0x6c, 0xe7, 0xf1, 0xda, 0x9d, 0x3b, 0x0b, 0xb5, 0xe2, 0xce, 0x42,
-       0xd9, 0xa2, 0x9d, 0xe8, 0xee, 0x28, 0xfa, 0x2a, 0x57, 0x4a, 0xc2, 0x26,
-       0x2e, 0xab, 0x3c, 0xe2, 0xb5, 0x7a, 0x1d, 0xf6, 0x47, 0xfb, 0x16, 0x19,
-       0xf7, 0xb0, 0xc7, 0xc8, 0x87, 0x90, 0x3b, 0x68, 0x83, 0x4f, 0xcb, 0xe2,
-       0xd4, 0xfa, 0xc8, 0xbf, 0x85, 0xf6, 0xc9, 0xfe, 0xfb, 0x7e, 0xe0, 0xef,
-       0xef, 0xe8, 0x0e, 0xe6, 0xde, 0x0a, 0x6d, 0x3a, 0xc2, 0x45, 0x3c, 0xc3,
-       0xda, 0x38, 0x72, 0x92, 0xf1, 0xba, 0xa9, 0xd1, 0x3f, 0xe7, 0x3c, 0xe6,
-       0x12, 0xcc, 0x23, 0xa6, 0x43, 0x3f, 0x27, 0xd9, 0x1c, 0xfc, 0x88, 0x8e,
-       0xdc, 0xa2, 0x00, 0xbb, 0x31, 0x33, 0x57, 0x64, 0x46, 0xf9, 0x48, 0x89,
-       0xb5, 0x64, 0x9e, 0x00, 0xcc, 0x7f, 0xc0, 0xe6, 0xda, 0xba, 0x43, 0x3d,
-       0x0c, 0x7d, 0xbc, 0xf2, 0xbb, 0x80, 0xbd, 0xbc, 0x05, 0xf6, 0xdd, 0x46,
-       0x58, 0xbc, 0xbf, 0xb8, 0xe5, 0xfd, 0x4f, 0x69, 0xbf, 0x78, 0xb7, 0x0a,
-       0x7f, 0xda, 0x1a, 0xda, 0xfe, 0x05, 0x29, 0xc0, 0xb7, 0x9a, 0x36, 0x73,
-       0xc7, 0xdb, 0xb0, 0x16, 0xe3, 0x1a, 0x68, 0x84, 0xbf, 0x40, 0xcc, 0x04,
-       0xbf, 0x11, 0x13, 0x12, 0x37, 0x30, 0x3f, 0xa2, 0x9f, 0x00, 0x2c, 0xfd,
-       0x2f, 0x61, 0x5f, 0xe9, 0x20, 0xcf, 0x0b, 0x35, 0xae, 0xa1, 0xaf, 0x12,
-       0xdf, 0x1d, 0x6d, 0x83, 0x46, 0xf9, 0xaf, 0x19, 0x76, 0x04, 0x1b, 0xe1,
-       0xdd, 0x0a, 0xcb, 0x7c, 0x85, 0xb8, 0xbb, 0xc3, 0x3c, 0x60, 0x4c, 0xb2,
-       0xf5, 0x2c, 0x7e, 0x45, 0x99, 0x7c, 0x16, 0xb9, 0x98, 0xdd, 0x42, 0x5e,
-       0x90, 0x35, 0x56, 0xc0, 0xa3, 0x68, 0xdd, 0x13, 0xbd, 0x9b, 0xc7, 0xf7,
-       0xc5, 0x37, 0x7c, 0x25, 0x2d, 0x4d, 0xb2, 0x88, 0x15, 0xe0, 0x71, 0x6a,
-       0x42, 0xcf, 0x24, 0x24, 0x57, 0x0b, 0xf8, 0x8b, 0x78, 0x0b, 0xff, 0xc8,
-       0x2e, 0x64, 0xb2, 0xee, 0x07, 0x23, 0x99, 0x53, 0xcf, 0xb2, 0x90, 0x4d,
-       0x0a, 0xba, 0x34, 0x86, 0xb5, 0x72, 0x02, 0x38, 0x18, 0x87, 0x1d, 0x3d,
-       0x13, 0x97, 0x82, 0xc5, 0x7c, 0x41, 0xe5, 0x7a, 0x59, 0xfa, 0x01, 0x3d,
-       0xd3, 0x86, 0x39, 0xf6, 0x1f, 0xee, 0x0e, 0x64, 0xdd, 0xc9, 0xf1, 0xb8,
-       0x9e, 0xe9, 0xde, 0x32, 0xff, 0x7a, 0x67, 0x40, 0x9b, 0x1a, 0x63, 0xfe,
-       0x5f, 0xb6, 0x8c, 0xbf, 0x1e, 0xdf, 0x3c, 0x7e, 0x60, 0x67, 0xa4, 0x0f,
-       0x7a, 0xe6, 0x89, 0x90, 0x5e, 0xea, 0xe9, 0x56, 0x5a, 0x7f, 0x13, 0x7d,
-       0x79, 0x0e, 0x38, 0x95, 0x8e, 0xff, 0x06, 0xfa, 0xb2, 0x0e, 0xfb, 0x09,
-       0xfa, 0xd2, 0x48, 0xc3, 0x7a, 0x5d, 0x51, 0xd1, 0x91, 0x93, 0xba, 0xa3,
-       0x7b, 0x90, 0x77, 0xa4, 0x24, 0x5f, 0x07, 0xef, 0xd6, 0xe3, 0xea, 0x3a,
-       0x4c, 0x71, 0x03, 0x26, 0x88, 0x3b, 0xf9, 0xba, 0x8f, 0x3c, 0xae, 0x31,
-       0x06, 0x0f, 0xa3, 0x5f, 0xc4, 0x59, 0x57, 0x64, 0xd2, 0x5b, 0xcb, 0xea,
-       0xf6, 0xa9, 0x20, 0x0f, 0xb5, 0xbf, 0xad, 0xe5, 0x17, 0x99, 0xa3, 0xc6,
-       0xd0, 0x57, 0xf5, 0x07, 0x62, 0xdc, 0x33, 0x5a, 0x76, 0x79, 0x0e, 0xf9,
-       0xe9, 0x12, 0x7e, 0x67, 0xf1, 0xab, 0xe1, 0x17, 0xd5, 0x01, 0x2f, 0xa0,
-       0x8e, 0x50, 0xfe, 0x1e, 0xb1, 0x29, 0xd8, 0xff, 0x67, 0x4b, 0xc8, 0x8f,
-       0xe7, 0x12, 0xf2, 0x94, 0xad, 0xf7, 0xea, 0x81, 0x8f, 0xcb, 0x22, 0xb7,
-       0xb6, 0x2e, 0xcb, 0x97, 0xc2, 0x1c, 0x4d, 0xe4, 0x9d, 0x0a, 0x64, 0xb9,
-       0xff, 0x48, 0xe8, 0x9f, 0xbe, 0xf6, 0xa0, 0xab, 0x7c, 0x79, 0x98, 0x83,
-       0xc1, 0xef, 0x64, 0x15, 0xd4, 0x1b, 0xe0, 0x8f, 0x26, 0xef, 0x41, 0x8f,
-       0xdf, 0xa9, 0xb4, 0x83, 0x1e, 0x5b, 0x0a, 0xc7, 0x90, 0xbb, 0x68, 0x83,
-       0xd6, 0x36, 0xad, 0x1d, 0x79, 0x18, 0xfc, 0x8e, 0x1a, 0x93, 0x67, 0x17,
-       0xa7, 0x16, 0xca, 0x3a, 0x60, 0xc1, 0xf3, 0x51, 0xf4, 0xa1, 0x7f, 0x97,
-       0x2a, 0x5c, 0xa7, 0xcb, 0xbb, 0x15, 0x43, 0x7e, 0x8e, 0xbc, 0xee, 0x3d,
-       0xfb, 0xe2, 0x14, 0x6c, 0xb0, 0x0f, 0xf1, 0x0a, 0xb5, 0xd0, 0x1e, 0xc6,
-       0x8c, 0x01, 0x13, 0xcf, 0x3c, 0x7e, 0x87, 0x91, 0xe7, 0x5d, 0x7b, 0xcd,
-       0x27, 0xc1, 0x93, 0xb6, 0x18, 0xd6, 0x10, 0xde, 0x04, 0x6d, 0x5d, 0xd0,
-       0xc1, 0xb4, 0x35, 0x21, 0xdd, 0x96, 0xca, 0x9d, 0x34, 0xce, 0x07, 0x7e,
-       0xf2, 0xe3, 0xf3, 0xe4, 0xb3, 0x01, 0x1d, 0xe2, 0x98, 0xef, 0xe8, 0xcf,
-       0x89, 0x2f, 0x7d, 0x30, 0x8b, 0xc3, 0x5c, 0xaa, 0x04, 0xfd, 0x68, 0x4e,
-       0xb4, 0x28, 0xa6, 0xd2, 0x4f, 0xe7, 0x61, 0xab, 0x1c, 0x8f, 0x8b, 0x92,
-       0xc1, 0x26, 0x79, 0x52, 0x8f, 0x56, 0xa7, 0x66, 0x6c, 0xca, 0xd5, 0x92,
-       0xe9, 0x72, 0x24, 0x57, 0xca, 0x08, 0x75, 0x66, 0xe5, 0xdb, 0x90, 0xab,
-       0x1e, 0xd6, 0x20, 0xf0, 0x03, 0x73, 0x94, 0x2f, 0xea, 0xc4, 0x0a, 0xf2,
-       0xb0, 0x8a, 0xc4, 0x83, 0x1a, 0xea, 0x19, 0xd4, 0x1d, 0x90, 0x5f, 0x79,
-       0x0e, 0x38, 0x12, 0x78, 0x2e, 0xe1, 0x99, 0xc4, 0xf3, 0x2c, 0x9e, 0xfd,
-       0x78, 0xd6, 0x68, 0x1f, 0x61, 0xde, 0xf3, 0x31, 0x7a, 0x60, 0x27, 0x79,
-       0xda, 0xb4, 0x7c, 0xaf, 0x9e, 0x91, 0xbf, 0xad, 0x1f, 0x94, 0xbf, 0xa9,
-       0x8f, 0xca, 0x5f, 0xd7, 0x1d, 0x79, 0xb9, 0xbe, 0x5f, 0xfe, 0xaa, 0x3e,
-       0xcc, 0x9a, 0x10, 0x39, 0x5c, 0x0a, 0xbe, 0xf9, 0xbc, 0x3c, 0xe8, 0xd5,
-       0xe1, 0x73, 0x28, 0xff, 0x8b, 0x53, 0xd9, 0xda, 0x75, 0x52, 0x78, 0xd6,
-       0x42, 0x9e, 0x69, 0xb0, 0x2e, 0x93, 0xc7, 0x9c, 0x3b, 0xe2, 0x94, 0xbd,
-       0x6e, 0xb3, 0x4e, 0x39, 0x49, 0x38, 0xd4, 0xbb, 0x1a, 0xf2, 0x97, 0x16,
-       0x99, 0x48, 0xa4, 0x57, 0x5c, 0x23, 0x19, 0xfa, 0xa3, 0x3b, 0x01, 0x87,
-       0x3d, 0xbd, 0x0e, 0x59, 0x7b, 0x1e, 0xb6, 0xe0, 0xa0, 0x56, 0x4e, 0xc4,
-       0xe0, 0xfb, 0x54, 0x7e, 0xa2, 0x7c, 0x4b, 0xe0, 0x4b, 0xa3, 0x9a, 0x91,
-       0x73, 0xd9, 0x70, 0x8e, 0xf1, 0xd1, 0x02, 0xec, 0x72, 0x18, 0x43, 0xb6,
-       0xe2, 0xa4, 0x6f, 0x3c, 0x16, 0xfa, 0xc7, 0x15, 0x39, 0xe1, 0x0d, 0x66,
-       0xaf, 0x20, 0xf6, 0x68, 0x2d, 0x51, 0x5e, 0xb4, 0x0b, 0xb4, 0xf9, 0xfe,
-       0xdd, 0xac, 0xbf, 0xe3, 0xa6, 0xfc, 0x70, 0x36, 0x6d, 0x3d, 0xa2, 0xcf,
-       0x40, 0xce, 0xbe, 0x7f, 0xd4, 0x4e, 0x9f, 0x9a, 0xd0, 0x3b, 0xe5, 0x27,
-       0xcf, 0x30, 0x26, 0xaf, 0x4e, 0x7d, 0x1f, 0x7a, 0x50, 0x5d, 0x6a, 0x95,
-       0x6a, 0xd5, 0x94, 0x4b, 0x23, 0x83, 0x6a, 0xdf, 0x6a, 0x2d, 0x8e, 0x3c,
-       0xaf, 0x4d, 0xa6, 0xfb, 0x94, 0xb2, 0xc3, 0x6f, 0x0f, 0x2b, 0xbf, 0xed,
-       0xda, 0x78, 0xd6, 0x92, 0xd6, 0x66, 0x5a, 0x5e, 0x96, 0x82, 0x07, 0x1d,
-       0x8b, 0xef, 0x02, 0x4f, 0xd8, 0x1f, 0xb4, 0x0a, 0x3a, 0x62, 0xa0, 0x39,
-       0x68, 0x3d, 0xa8, 0xff, 0xd2, 0xff, 0x1d, 0x93, 0x7c, 0x7c, 0x1b, 0xb1,
-       0x85, 0xb1, 0x52, 0x53, 0x7a, 0xb7, 0xb0, 0xf4, 0x53, 0x8b, 0xfe, 0x65,
-       0xa5, 0xb6, 0x2b, 0x1c, 0xd3, 0xbf, 0x73, 0xdc, 0x2e, 0x2f, 0x57, 0xb7,
-       0xcb, 0x62, 0x95, 0xef, 0x5b, 0x65, 0xa1, 0x3a, 0x78, 0xa5, 0x57, 0xef,
-       0x93, 0xd5, 0xeb, 0x6e, 0xb4, 0xee, 0xd7, 0xc1, 0x93, 0x63, 0x1f, 0xc9,
-       0x07, 0x23, 0xdd, 0xf2, 0xd6, 0x7d, 0xe9, 0x17, 0xfe, 0x44, 0x87, 0x3e,
-       0x8e, 0x74, 0xd0, 0xce, 0xd0, 0xe7, 0x7c, 0xfa, 0x4a, 0x56, 0xa7, 0x9e,
-       0xfd, 0x00, 0xfa, 0x95, 0xae, 0x04, 0x3a, 0x49, 0xdc, 0xc4, 0x0b, 0xf9,
-       0xd8, 0x6f, 0x00, 0x27, 0xde, 0xd5, 0x06, 0x81, 0xeb, 0x0d, 0xc5, 0x8b,
-       0xbb, 0x9d, 0xf4, 0x15, 0x84, 0x28, 0xff, 0x92, 0x3d, 0x38, 0x3c, 0xa0,
-       0xef, 0x92, 0x6a, 0xf2, 0x46, 0xeb, 0xbb, 0x88, 0x07, 0xd9, 0x44, 0xfa,
-       0xd4, 0x45, 0x59, 0x9d, 0xba, 0x60, 0x53, 0x17, 0x69, 0xc3, 0xff, 0x80,
-       0x9c, 0xd4, 0x92, 0x4a, 0x8d, 0xbe, 0x8b, 0xb8, 0x58, 0x17, 0xec, 0xb5,
-       0x4e, 0x80, 0x06, 0x77, 0x3f, 0xde, 0x61, 0xde, 0xf8, 0x3c, 0xe5, 0xd6,
-       0xc2, 0xb5, 0xc3, 0x59, 0xbd, 0x7f, 0x0b, 0x8f, 0x06, 0xad, 0x43, 0x3a,
-       0xf7, 0xfb, 0x2f, 0xec, 0xfb, 0x3e, 0x68, 0x1d, 0xc4, 0x5a, 0xc4, 0xd0,
-       0x64, 0xe3, 0x1e, 0x3f, 0x52, 0x7b, 0x3c, 0x5b, 0x43, 0x0e, 0xb8, 0xbe,
-       0x07, 0xe6, 0x6a, 0x3a, 0xce, 0x69, 0x2a, 0xb9, 0x5c, 0x1a, 0x21, 0x7f,
-       0x6f, 0xef, 0x61, 0x2c, 0x37, 0x32, 0x2f, 0x85, 0x79, 0x46, 0x4c, 0x7e,
-       0x8c, 0xba, 0x6b, 0x12, 0xfe, 0x7f, 0x61, 0xef, 0x20, 0x68, 0x40, 0x7d,
-       0x9a, 0x54, 0xf1, 0x7c, 0xca, 0x05, 0x8e, 0x9c, 0xc2, 0xfd, 0xa6, 0x2c,
-       0x01, 0xf7, 0x38, 0xf9, 0x00, 0xdc, 0x33, 0x9c, 0x57, 0x32, 0xc0, 0x7c,
-       0x2d, 0x05, 0xbc, 0xbd, 0xa1, 0xff, 0x8b, 0x43, 0x57, 0xf7, 0x59, 0x77,
-       0x4b, 0x2c, 0xf4, 0x7f, 0x71, 0x79, 0xeb, 0x79, 0xe8, 0x7d, 0x9c, 0xfa,
-       0x93, 0xe8, 0xd9, 0xd0, 0x9f, 0x46, 0xfc, 0xad, 0x92, 0xaf, 0xc4, 0x80,
-       0x17, 0x39, 0xf7, 0x28, 0xf1, 0x62, 0x5c, 0xa5, 0x2e, 0x17, 0x43, 0x5d,
-       0xee, 0x08, 0x71, 0xaf, 0x41, 0x97, 0xd3, 0xa9, 0x55, 0x9d, 0xf5, 0xd5,
-       0x4e, 0x55, 0xf3, 0x1a, 0xb0, 0xaf, 0x42, 0x99, 0xb1, 0x88, 0xb6, 0x75,
-       0x71, 0x6a, 0x12, 0x35, 0x6c, 0xa1, 0x7c, 0x50, 0x2f, 0xd4, 0x47, 0xf5,
-       0x82, 0x47, 0x7d, 0xdb, 0x6b, 0x2d, 0x28, 0x1e, 0x27, 0x65, 0xa1, 0xfe,
-       0x81, 0x5f, 0xda, 0xbb, 0x0d, 0x7d, 0xe8, 0xfe, 0x38, 0xe5, 0x7b, 0x3d,
-       0xe9, 0x42, 0x50, 0x27, 0xbf, 0x13, 0x72, 0x66, 0xe8, 0x7b, 0xdd, 0xcc,
-       0xd1, 0x96, 0x87, 0x88, 0x1f, 0x74, 0x24, 0x12, 0xb2, 0xe8, 0x71, 0x8f,
-       0xd5, 0x29, 0xf2, 0xb2, 0x30, 0x67, 0xc9, 0x09, 0x25, 0x3f, 0x9e, 0x9b,
-       0xf7, 0x47, 0x86, 0x4c, 0xc6, 0x07, 0xad, 0x47, 0x25, 0x7d, 0x65, 0xcd,
-       0x48, 0xbf, 0x30, 0x81, 0xb8, 0xba, 0x30, 0x6f, 0x88, 0xab, 0xea, 0x30,
-       0xca, 0x28, 0x5d, 0x81, 0x35, 0x86, 0x67, 0xbf, 0xa7, 0xe1, 0xec, 0x5d,
-       0x72, 0xe1, 0xf9, 0xcf, 0xc3, 0xee, 0x5f, 0x81, 0x2c, 0xcc, 0xd4, 0x71,
-       0xe4, 0x19, 0xcf, 0xc9, 0xa0, 0x55, 0x42, 0xfe, 0x0c, 0xbe, 0xa3, 0xbd,
-       0xa2, 0x6c, 0x60, 0x41, 0xc7, 0xb8, 0x9f, 0x7c, 0xe2, 0x78, 0xb7, 0x2c,
-       0xf4, 0x05, 0x36, 0xce, 0x77, 0x03, 0xc0, 0x11, 0xbc, 0xe3, 0xf8, 0xb7,
-       0x64, 0x40, 0xbd, 0xab, 0xaa, 0x75, 0x25, 0xe9, 0x0d, 0xe5, 0xf7, 0x18,
-       0xf6, 0x24, 0x8f, 0xa3, 0xf9, 0x4e, 0x09, 0x6c, 0x29, 0xe2, 0xbb, 0x25,
-       0x47, 0x6b, 0x09, 0xb9, 0xa7, 0x96, 0x94, 0x2f, 0xd7, 0xfa, 0x25, 0x0f,
-       0x39, 0x4e, 0x8e, 0x3e, 0xd9, 0xc3, 0xb3, 0xe5, 0x96, 0xd2, 0x2f, 0x88,
-       0x4e, 0x5a, 0xab, 0x72, 0xdc, 0x8b, 0xe8, 0xe9, 0x08, 0xe9, 0x33, 0xc3,
-       0x71, 0x2c, 0xa4, 0xa1, 0x11, 0x5f, 0x07, 0x70, 0x65, 0x81, 0xe7, 0xa5,
-       0x10, 0x0f, 0xfd, 0x08, 0x68, 0x3d, 0x96, 0x94, 0x25, 0x8f, 0x74, 0x6c,
-       0x97, 0x52, 0x82, 0xfd, 0x57, 0xa0, 0x6f, 0xc4, 0xb3, 0x8d, 0xf9, 0xcd,
-       0x26, 0x1e, 0x3f, 0x5c, 0x2b, 0x82, 0xc7, 0xe4, 0x2f, 0xe1, 0xe0, 0xaf,
-       0xbf, 0x40, 0xf9, 0xed, 0x43, 0x8e, 0x6f, 0x07, 0xba, 0x69, 0x6d, 0xec,
-       0x99, 0x9f, 0xeb, 0x82, 0xac, 0xb8, 0x6f, 0xbb, 0x1c, 0x83, 0xdd, 0xe7,
-       0xaa, 0xdc, 0xff, 0x18, 0xf4, 0xe8, 0x2d, 0xb5, 0x7f, 0x7e, 0xa9, 0x2f,
-       0x5c, 0xcf, 0xb5, 0x5d, 0x5b, 0xd6, 0xb6, 0xca, 0xa1, 0x8a, 0x75, 0x8d,
-       0xf5, 0xbf, 0x8f, 0xf5, 0xba, 0x9c, 0x1e, 0xe5, 0x7a, 0xe2, 0x01, 0x5c,
-       0x35, 0xf1, 0x29, 0x78, 0xe2, 0xaa, 0xde, 0xcf, 0x55, 0x5b, 0x25, 0x57,
-       0x89, 0x70, 0x11, 0xcf, 0x47, 0xa8, 0x87, 0xbf, 0xaa, 0x70, 0x4d, 0x2a,
-       0x5c, 0x78, 0x5f, 0xa5, 0xcf, 0xb9, 0x15, 0xeb, 0x3b, 0xe8, 0xff, 0xa5,
-       0x14, 0xef, 0x94, 0x92, 0xaa, 0xe9, 0xdb, 0x95, 0xaf, 0x29, 0xc5, 0xdb,
-       0xf0, 0xbe, 0x13, 0x36, 0xbf, 0x0f, 0xb9, 0x45, 0x17, 0xeb, 0xdc, 0x2d,
-       0x73, 0x5b, 0xe9, 0x8f, 0x6d, 0xa1, 0x3f, 0x06, 0xb8, 0x5e, 0xec, 0x19,
-       0xc0, 0xe5, 0x01, 0x37, 0x3d, 0x07, 0x3e, 0x3b, 0xf4, 0x2b, 0x8c, 0x93,
-       0xd7, 0x29, 0x5a, 0xa6, 0x97, 0xfe, 0x1b, 0xe7, 0xea, 0xc3, 0xda, 0x68,
-       0x1c, 0xf0, 0xe1, 0x69, 0xe0, 0x99, 0xab, 0xaa, 0xbb, 0x0b, 0xc8, 0x60,
-       0x7b, 0x9c, 0x67, 0x2f, 0x55, 0x3f, 0x8b, 0x67, 0xd7, 0x35, 0xf0, 0x8b,
-       0xbc, 0x22, 0xbd, 0xa4, 0x95, 0xf7, 0x48, 0xb0, 0x37, 0x07, 0x7a, 0x1c,
-       0x37, 0x24, 0x3f, 0x6a, 0x21, 0x3f, 0xe7, 0x3d, 0x2c, 0xed, 0xd2, 0xe2,
-       0xdd, 0x67, 0x4c, 0xb7, 0x19, 0x6b, 0x4d, 0x75, 0xf6, 0xe3, 0x4b, 0xbc,
-       0x8b, 0x4d, 0xf1, 0xee, 0x6e, 0x98, 0xd7, 0x18, 0x8f, 0x2c, 0xd9, 0xf2,
-       0x78, 0x6d, 0x58, 0x1e, 0xad, 0xa5, 0xad, 0xfb, 0xe1, 0x03, 0x0a, 0xeb,
-       0x77, 0xb4, 0x43, 0x71, 0xfa, 0x2f, 0x13, 0x79, 0x60, 0x8b, 0x1d, 0xe4,
-       0x05, 0x25, 0xd6, 0x6c, 0x73, 0x69, 0xde, 0xe3, 0x58, 0x55, 0xd9, 0x9a,
-       0x3b, 0xfc, 0x5f, 0xe6, 0x0d, 0xdc, 0x9f, 0xfe, 0x1a, 0x79, 0x82, 0x87,
-       0x3c, 0xc1, 0x43, 0x9e, 0xe0, 0x21, 0x4f, 0xf0, 0x90, 0x27, 0x78, 0xc8,
-       0x13, 0x3c, 0xe4, 0x09, 0x1e, 0xf2, 0x04, 0xc4, 0xee, 0xa0, 0x5e, 0x18,
-       0x43, 0xfe, 0x0b, 0xff, 0xe5, 0xdd, 0x06, 0x3e, 0xf1, 0xfe, 0x92, 0x31,
-       0x87, 0xb1, 0x99, 0x73, 0xab, 0xdb, 0x5c, 0xca, 0x4d, 0xf9, 0xbe, 0x3b,
-       0x31, 0x37, 0x1e, 0xe6, 0x23, 0x84, 0x89, 0x62, 0x37, 0xe1, 0xe4, 0xa0,
-       0xeb, 0x68, 0xb0, 0x31, 0xe6, 0x2b, 0x41, 0xcc, 0x0a, 0x72, 0xe5, 0xb7,
-       0x91, 0xb3, 0xa4, 0x90, 0xb3, 0xf4, 0x23, 0x3f, 0xe1, 0x9d, 0x75, 0x74,
-       0xc7, 0x94, 0xd5, 0x8e, 0x7a, 0x63, 0xda, 0x3d, 0x1e, 0x73, 0x69, 0x3b,
-       0x55, 0xd0, 0xf5, 0xb9, 0x5e, 0xf1, 0x25, 0x37, 0xf2, 0x4d, 0xe4, 0xad,
-       0xcf, 0xa9, 0xfb, 0xb4, 0xf1, 0x21, 0xca, 0xbc, 0xf2, 0x09, 0xb9, 0x6b,
-       0xc4, 0xdf, 0xe0, 0x1e, 0x50, 0x5f, 0x20, 0xff, 0x44, 0x7a, 0xce, 0x81,
-       0xe1, 0xe7, 0x62, 0x12, 0x3f, 0xb3, 0x1d, 0x73, 0x96, 0xf4, 0xaa, 0xbb,
-       0x24, 0x88, 0xf2, 0xdc, 0x55, 0xc8, 0xcb, 0x16, 0xfd, 0x1c, 0x6f, 0x1c,
-       0x88, 0x97, 0xfe, 0x75, 0x65, 0x2a, 0x57, 0x5d, 0x51, 0x3a, 0x75, 0xb4,
-       0x96, 0x47, 0x7d, 0xd4, 0xd3, 0x2b, 0xed, 0x26, 0x6a, 0xab, 0x08, 0x37,
-       0x71, 0xfe, 0x32, 0xae, 0x6a, 0x9e, 0x73, 0xeb, 0xf2, 0x84, 0xac, 0xb9,
-       0xcf, 0xca, 0x54, 0xa9, 0x92, 0x4e, 0xb2, 0x56, 0xce, 0x5a, 0x2b, 0x53,
-       0x27, 0x81, 0x63, 0x11, 0xb9, 0x81, 0xa1, 0xf6, 0x5e, 0x99, 0x9a, 0xae,
-       0x04, 0xf7, 0x59, 0x01, 0x0d, 0x8c, 0x57, 0xed, 0x62, 0x2c, 0x04, 0xf7,
-       0x5a, 0xba, 0x5a, 0xcb, 0x75, 0x5c, 0x6f, 0x62, 0x1d, 0xe5, 0x36, 0x8c,
-       0xb5, 0x94, 0x1d, 0x69, 0x58, 0x99, 0x2a, 0x56, 0x1b, 0x69, 0x20, 0x1e,
-       0xe2, 0x8d, 0xce, 0xc3, 0xb3, 0xc4, 0x45, 0x3f, 0xe3, 0xfb, 0x85, 0x91,
-       0xfe, 0x30, 0xef, 0x3a, 0x89, 0xfc, 0xce, 0x0c, 0xf4, 0x5c, 0x8d, 0xbf,
-       0xa3, 0xe2, 0x54, 0x4a, 0xe7, 0x3c, 0x9f, 0x78, 0x37, 0xba, 0x80, 0x39,
-       0x8c, 0x17, 0x23, 0x58, 0x3d, 0x84, 0xed, 0x6c, 0xe0, 0x67, 0x4b, 0xb8,
-       0x1f, 0x69, 0xe2, 0x39, 0x2f, 0x61, 0x2f, 0xd2, 0x45, 0x98, 0x38, 0x68,
-       0x83, 0x2c, 0xbd, 0xff, 0x2d, 0xef, 0x1b, 0xcf, 0x44, 0x9e, 0x9a, 0x58,
-       0x43, 0x78, 0xe2, 0x88, 0xd6, 0xe0, 0xc5, 0xb9, 0x60, 0x9d, 0xbe, 0x7e,
-       0xff, 0xf7, 0x69, 0xfb, 0x36, 0xd2, 0x1a, 0xed, 0x1f, 0xe1, 0x19, 0x0e,
-       0xe4, 0xb6, 0xbe, 0x5e, 0xfd, 0x9f, 0x61, 0x78, 0x42, 0x17, 0x3f, 0x76,
-       0x8f, 0x3a, 0xdc, 0x50, 0x87, 0x46, 0xf7, 0x17, 0xbc, 0x0f, 0x60, 0x7d,
-       0xcf, 0x6f, 0x07, 0x8d, 0xb5, 0xe2, 0xcb, 0x61, 0x2c, 0xdb, 0x29, 0x59,
-       0x93, 0x75, 0xc3, 0xf9, 0x70, 0xbc, 0x03, 0xb1, 0x8d, 0xe3, 0x3a, 0xf8,
-       0x0b, 0x5d, 0x76, 0xda, 0xc3, 0xba, 0x25, 0x1e, 0x7c, 0xe3, 0x19, 0xa6,
-       0x1d, 0xb1, 0xee, 0x6b, 0x0b, 0xe7, 0x22, 0x3b, 0xa2, 0x1f, 0x36, 0xc3,
-       0x39, 0xfa, 0x5b, 0x1d, 0xb5, 0x0b, 0xfb, 0xc0, 0xb3, 0xd8, 0x68, 0x4b,
-       0xd1, 0x33, 0x2e, 0x67, 0xe7, 0x23, 0xbf, 0x05, 0x9f, 0x32, 0x64, 0x86,
-       0xbe, 0xbf, 0x03, 0xbe, 0xaf, 0x4b, 0x0e, 0xc1, 0x67, 0x1d, 0x86, 0xcf,
-       0x3a, 0x82, 0x7a, 0x71, 0x6c, 0xa9, 0xf1, 0x9e, 0x97, 0x35, 0x6a, 0x97,
-       0x76, 0x5c, 0xc9, 0xbf, 0xe8, 0x1b, 0xf6, 0x47, 0xd0, 0x01, 0xd6, 0x5d,
-       0x91, 0x4e, 0xc0, 0xdf, 0x3a, 0x71, 0xe8, 0xc4, 0xd6, 0xfb, 0xe4, 0x61,
-       0xd8, 0x46, 0x7b, 0x56, 0xc5, 0x86, 0xa5, 0x80, 0xf7, 0xa5, 0x6a, 0xc0,
-       0x7b, 0xf8, 0x65, 0xe0, 0x37, 0xa5, 0x58, 0xb3, 0xa4, 0x88, 0x7d, 0x8b,
-       0xd8, 0xb7, 0x88, 0x3a, 0x6f, 0xba, 0xd6, 0xf8, 0x1d, 0xab, 0x33, 0xa4,
-       0x9d, 0x6b, 0xa3, 0xbe, 0xd5, 0x70, 0xfe, 0xe8, 0x79, 0x0a, 0xfc, 0x7f,
-       0x0c, 0xfc, 0x3f, 0x81, 0xfa, 0xe6, 0x8f, 0x50, 0xdf, 0x7c, 0x0d, 0xf5,
-       0xcd, 0x71, 0xd4, 0x37, 0x13, 0xa8, 0x6f, 0xbe, 0x0a, 0xff, 0xf1, 0x15,
-       0xf8, 0x8f, 0x63, 0xf0, 0x1f, 0xe3, 0xea, 0xee, 0xe9, 0xa8, 0xb7, 0xf5,
-       0x4e, 0x25, 0xda, 0x8b, 0xed, 0x67, 0x22, 0x76, 0x11, 0x67, 0x1a, 0x93,
-       0x6a, 0x9d, 0xf5, 0x8d, 0x23, 0xee, 0x41, 0xd6, 0x37, 0xc7, 0xb4, 0x09,
-       0xe4, 0xef, 0xf7, 0xef, 0x67, 0xdd, 0x13, 0xd7, 0x72, 0xaa, 0xee, 0x49,
-       0x9f, 0x77, 0x91, 0x22, 0x21, 0xf7, 0xc3, 0x99, 0xd3, 0x67, 0x73, 0xa0,
-       0x25, 0xc8, 0xf9, 0x7a, 0x42, 0xbf, 0xd7, 0x21, 0x8b, 0xb3, 0xa8, 0x19,
-       0xbc, 0x1f, 0x6b, 0x05, 0xe5, 0x1b, 0x2d, 0x8c, 0x51, 0x2b, 0x7b, 0xff,
-       0x1c, 0x8e, 0x47, 0x64, 0x72, 0x1e, 0xb5, 0xed, 0xf3, 0xff, 0xa8, 0xe5,
-       0xd4, 0xd8, 0xc1, 0x18, 0xf9, 0xee, 0xf3, 0x7f, 0x1f, 0x8e, 0x8b, 0xa1,
-       0x3e, 0x84, 0xb4, 0x5a, 0x0e, 0x9e, 0xdd, 0x61, 0xce, 0xf1, 0x6a, 0xef,
-       0xe6, 0xff, 0xd3, 0x8e, 0xad, 0x45, 0x13, 0xfb, 0x1b, 0x3b, 0x82, 0xfa,
-       0xac, 0x71, 0xbe, 0xab, 0x61, 0xfe, 0x8a, 0xfa, 0xce, 0x5a, 0x28, 0xb7,
-       0xfd, 0x0a, 0x1e, 0x58, 0x96, 0x86, 0x98, 0xe7, 0x7d, 0xe4, 0xf3, 0xfb,
-       0x9f, 0xab, 0xb7, 0xab, 0x6f, 0x72, 0xae, 0xca, 0xb7, 0x61, 0xe7, 0x23,
-       0xa5, 0x1d, 0x81, 0x2f, 0x60, 0x3f, 0xa1, 0x05, 0xfe, 0xfd, 0x8f, 0x81,
-       0x07, 0xbc, 0xf6, 0x1a, 0x6b, 0x38, 0x2b, 0xbc, 0x4b, 0xb9, 0x32, 0xc5,
-       0xdc, 0xba, 0xa4, 0x70, 0xb3, 0xd6, 0x63, 0xdd, 0x17, 0xc5, 0x80, 0x08,
-       0xd7, 0xcf, 0x13, 0x01, 0xdd, 0xe3, 0xa8, 0xe9, 0x08, 0x13, 0x8d, 0x1b,
-       0xeb, 0xbf, 0x8e, 0xf0, 0x1e, 0xee, 0x4a, 0x90, 0x57, 0x29, 0x7c, 0x66,
-       0x88, 0xef, 0x3f, 0xfd, 0xc0, 0xf7, 0x70, 0xbd, 0xd5, 0xb0, 0xfe, 0x3c,
-       0x72, 0x3d, 0xde, 0x99, 0xec, 0x52, 0xdf, 0x19, 0xdf, 0x9f, 0xed, 0x94,
-       0x5f, 0x3c, 0xe3, 0xfb, 0xe3, 0x4e, 0x7a, 0xf8, 0x4d, 0xd4, 0x1e, 0x67,
-       0x68, 0x27, 0x23, 0xa4, 0x73, 0x30, 0x35, 0x2d, 0x03, 0xbd, 0x41, 0x2e,
-       0xfe, 0x75, 0xed, 0xe3, 0x74, 0xeb, 0xe1, 0x3e, 0x3f, 0x6c, 0xd8, 0x27,
-       0xd5, 0xb0, 0xcf, 0x0a, 0x6d, 0xb6, 0x7a, 0x2f, 0xce, 0x5c, 0xdc, 0x75,
-       0xa3, 0x95, 0x08, 0xeb, 0xb2, 0x47, 0x47, 0xda, 0xa4, 0xd2, 0x97, 0x5e,
-       0xf9, 0x11, 0xf2, 0xf5, 0xc2, 0x08, 0xe6, 0x12, 0x83, 0x78, 0xc7, 0xf9,
-       0x74, 0x15, 0xb9, 0xe8, 0x4a, 0x55, 0x86, 0xb0, 0x3e, 0x5d, 0x14, 0xe1,
-       0x3c, 0xfb, 0x8a, 0xb6, 0x6a, 0xe8, 0x03, 0x92, 0x6b, 0x38, 0xf3, 0x04,
-       0xea, 0xaf, 0x13, 0xeb, 0xf5, 0x30, 0xf7, 0xb9, 0x59, 0x5b, 0x53, 0xb9,
-       0xf1, 0x01, 0xad, 0x98, 0x08, 0xce, 0xf8, 0x87, 0xf0, 0x17, 0x86, 0xce,
-       0xb5, 0xef, 0x03, 0xb7, 0x26, 0x0b, 0xcf, 0x18, 0xea, 0x0e, 0xb6, 0x30,
-       0x42, 0x59, 0xf3, 0x79, 0x2d, 0xde, 0x45, 0x67, 0xfa, 0xf3, 0xf0, 0x4c,
-       0xd9, 0xb0, 0x9e, 0x8e, 0xce, 0x14, 0x93, 0x77, 0x67, 0x2d, 0xac, 0xfd,
-       0x1c, 0xf8, 0x91, 0x97, 0xa5, 0x7a, 0xea, 0x33, 0xf0, 0x94, 0x1b, 0x78,
-       0x63, 0x6e, 0x91, 0x61, 0x71, 0xa3, 0x86, 0x1f, 0x4f, 0xc2, 0x0e, 0xbf,
-       0xd1, 0x1b, 0xdd, 0x0d, 0x1b, 0xb6, 0xcf, 0xba, 0x07, 0x8d, 0xf3, 0xfd,
-       0xb0, 0xc5, 0x14, 0xec, 0x93, 0x39, 0x53, 0x9e, 0xb5, 0x0a, 0xed, 0xc9,
-       0x72, 0x8d, 0xb4, 0x75, 0x4c, 0x86, 0x51, 0xef, 0xf0, 0xfc, 0x19, 0x59,
-       0xac, 0x47, 0x34, 0x8c, 0xc2, 0x1e, 0x0f, 0xe2, 0xb7, 0x1f, 0xef, 0x1c,
-       0xfc, 0x58, 0x2b, 0xad, 0xc8, 0xe3, 0x2a, 0x17, 0x47, 0xae, 0x3d, 0x44,
-       0xfa, 0xee, 0x04, 0x3c, 0xf5, 0x99, 0x7a, 0x7a, 0xa7, 0xb8, 0x7d, 0xf4,
-       0x15, 0x49, 0xe0, 0xc6, 0x1a, 0xef, 0x22, 0x6c, 0xbd, 0x1f, 0xcf, 0xb4,
-       0x55, 0x20, 0x6f, 0x15, 0x7e, 0xdf, 0x37, 0x46, 0xf9, 0x8d, 0xe2, 0x7c,
-       0x38, 0x1e, 0xb4, 0xbe, 0x4c, 0xdd, 0x4b, 0xee, 0x96, 0x95, 0xf9, 0x28,
-       0x0e, 0x9e, 0x86, 0x0d, 0xf2, 0xce, 0x76, 0x0c, 0x7c, 0xe1, 0x58, 0x0b,
-       0xe3, 0x21, 0xe6, 0x17, 0x97, 0x71, 0xee, 0x8c, 0x9c, 0x41, 0xfd, 0x2f,
-       0x7d, 0x7c, 0xa6, 0x80, 0x7f, 0x7b, 0xa8, 0xef, 0x9b, 0xd7, 0x1b, 0x36,
-       0xfb, 0x63, 0xa0, 0xcf, 0x6c, 0x58, 0xcf, 0x35, 0x41, 0x7d, 0xb2, 0x26,
-       0x88, 0xc7, 0x49, 0xff, 0x76, 0x3d, 0xf3, 0xa2, 0x3c, 0xa0, 0xce, 0x54,
-       0x93, 0xe3, 0xf3, 0xbe, 0xef, 0x8e, 0x0e, 0x0e, 0x2f, 0x4a, 0x7a, 0xf8,
-       0xa4, 0xec, 0xb3, 0x0e, 0xb1, 0x1e, 0xb3, 0x88, 0xc7, 0xbf, 0xbd, 0x25,
-       0xe3, 0xfb, 0xa7, 0x41, 0xfb, 0xf7, 0xd5, 0x3e, 0x2f, 0x82, 0x7e, 0xf0,
-       0x4a, 0xd5, 0x24, 0xa4, 0x15, 0xcf, 0x04, 0xe9, 0x2d, 0xcb, 0xf1, 0xfa,
-       0x85, 0x50, 0x36, 0x8f, 0x89, 0xeb, 0x5d, 0x36, 0x5c, 0xbb, 0x0c, 0xd8,
-       0x85, 0x90, 0xb6, 0x0c, 0xe8, 0xc5, 0xfe, 0xf5, 0xb7, 0x13, 0xf4, 0x0d,
-       0x94, 0xb9, 0x8b, 0xac, 0xd1, 0x1d, 0x41, 0x1e, 0x95, 0xf8, 0x24, 0x3f,
-       0x10, 0x97, 0xcd, 0x7e, 0x80, 0xeb, 0xe2, 0xd7, 0xd0, 0x15, 0xd2, 0x51,
-       0x54, 0xfe, 0x53, 0xc5, 0x2d, 0x85, 0xcf, 0xd8, 0xe2, 0x0b, 0x2a, 0xea,
-       0xb9, 0x6a, 0xd0, 0x37, 0x31, 0xfe, 0x51, 0x87, 0xbb, 0xe0, 0xff, 0xa0,
-       0x83, 0xb0, 0xe3, 0xdc, 0x3c, 0xef, 0x27, 0x86, 0x78, 0xaf, 0x74, 0x36,
-       0x0f, 0xd9, 0x2e, 0xf0, 0xfb, 0x63, 0x22, 0xa8, 0x31, 0x83, 0xfa, 0x2b,
-       0x45, 0x5f, 0x88, 0xb6, 0xa4, 0xfc, 0x64, 0x5e, 0x7d, 0x6f, 0x8c, 0x03,
-       0xc6, 0xa7, 0xef, 0x6c, 0xf8, 0x9b, 0x89, 0x1f, 0x64, 0x83, 0xbf, 0x99,
-       0x08, 0xbf, 0xfd, 0x56, 0x83, 0x3c, 0xe2, 0xe1, 0x9a, 0x29, 0x13, 0xb5,
-       0xe8, 0x6f, 0x28, 0x28, 0x07, 0xf8, 0xe6, 0x5a, 0x94, 0x3b, 0xf8, 0x41,
-       0x4d, 0xb3, 0x49, 0x96, 0x4b, 0x61, 0x4e, 0xc4, 0x1a, 0x80, 0x3c, 0xc4,
-       0x78, 0x31, 0xaa, 0x2f, 0x07, 0x20, 0x3f, 0xf0, 0x1c, 0x74, 0xbd, 0x3b,
-       0x1b, 0xd4, 0xb9, 0x25, 0xfa, 0xc5, 0xfe, 0xa8, 0xee, 0xdd, 0x25, 0xa5,
-       0x63, 0x7c, 0x1f, 0x93, 0x77, 0x66, 0x63, 0xea, 0x7d, 0x41, 0x62, 0xe1,
-       0x7b, 0x8e, 0xe3, 0x52, 0x50, 0xef, 0xab, 0x21, 0x3e, 0xd4, 0x69, 0x5f,
-       0x89, 0xc6, 0xa6, 0x76, 0xbc, 0x1e, 0xac, 0x9b, 0xac, 0x57, 0xe5, 0xf1,
-       0xfa, 0x2a, 0xce, 0xaf, 0x49, 0x6e, 0xbc, 0x28, 0xbb, 0x6d, 0x4b, 0xc5,
-       0x7d, 0x37, 0x4e, 0x1d, 0xa3, 0x7e, 0x8d, 0xa9, 0xba, 0xb3, 0x88, 0x7c,
-       0xa1, 0x30, 0xc2, 0x6f, 0x3c, 0xbf, 0xba, 0xab, 0x50, 0x4e, 0x5b, 0x59,
-       0xf9, 0xd0, 0x77, 0x4d, 0x8e, 0x45, 0x47, 0x3d, 0x74, 0xd7, 0xc3, 0xb5,
-       0x0b, 0x77, 0x05, 0x67, 0xc5, 0xfb, 0x1a, 0x61, 0x0d, 0xf5, 0x6d, 0xf6,
-       0x5f, 0x6f, 0x35, 0x65, 0xed, 0x56, 0xdf, 0xbf, 0xdf, 0xb1, 0xc4, 0x0d,
-       0x6b, 0x57, 0x4b, 0xd5, 0xae, 0xed, 0x2a, 0x07, 0x71, 0x47, 0x52, 0x5a,
-       0x1e, 0xf6, 0x7a, 0xc6, 0x43, 0x9d, 0xa3, 0xa7, 0x0f, 0xae, 0xea, 0x16,
-       0x62, 0x6e, 0x3a, 0x35, 0x27, 0x6e, 0x2f, 0xbf, 0x37, 0xcf, 0x38, 0x84,
-       0xd9, 0x19, 0xdc, 0x75, 0xdd, 0x34, 0xae, 0xfc, 0xac, 0x48, 0x18, 0x7b,
-       0x6e, 0x6a, 0xb4, 0x89, 0xc6, 0xdc, 0x92, 0xb6, 0x20, 0x13, 0x26, 0x68,
-       0x29, 0x95, 0xa3, 0x3c, 0x8d, 0x7f, 0x1b, 0xb0, 0x7a, 0xd7, 0xd3, 0xa0,
-       0x73, 0x1a, 0x74, 0xf2, 0x1c, 0xd3, 0xb5, 0x48, 0xe7, 0xa2, 0x5a, 0x81,
-       0x7d, 0xc4, 0x7c, 0x0f, 0x31, 0xdf, 0x43, 0xcc, 0xf7, 0x10, 0xf3, 0x3d,
-       0xc4, 0x7c, 0x0f, 0x31, 0xdf, 0x43, 0xcc, 0xf7, 0x10, 0xf3, 0xbd, 0xf1,
-       0x30, 0x4f, 0x7b, 0x62, 0x3d, 0x4f, 0x5b, 0xa9, 0xf3, 0x3b, 0x94, 0xa2,
-       0xa5, 0x58, 0x94, 0x20, 0xcf, 0x15, 0x9d, 0x39, 0x4d, 0x94, 0xe7, 0x5e,
-       0xfb, 0x9b, 0x48, 0xb0, 0x8e, 0x39, 0x1e, 0xd7, 0x15, 0x35, 0xdd, 0xe6,
-       0xba, 0x20, 0xcf, 0x63, 0x6d, 0xb5, 0x79, 0x0d, 0xf2, 0xb5, 0x0c, 0xfd,
-       0x19, 0xed, 0x22, 0x11, 0xd4, 0x8b, 0x99, 0xf3, 0xf7, 0xba, 0x88, 0xbf,
-       0x85, 0x9a, 0x8a, 0xc1, 0xbc, 0x17, 0xbc, 0x97, 0x7f, 0xb7, 0x00, 0x39,
-       0xf0, 0xdd, 0x7d, 0xac, 0x27, 0x0a, 0xb5, 0xa4, 0x14, 0x17, 0xa3, 0xfc,
-       0x07, 0xeb, 0xbc, 0x7d, 0x5a, 0xbe, 0x42, 0xd9, 0xea, 0x32, 0x9d, 0x00,
-       0x53, 0xec, 0xc6, 0xbc, 0xee, 0x4d, 0x55, 0x23, 0xad, 0xd4, 0x49, 0xcf,
-       0x7e, 0xd0, 0x16, 0xdd, 0xe3, 0x8a, 0x18, 0xb3, 0x09, 0xd1, 0x67, 0x91,
-       0xd3, 0xda, 0x43, 0xea, 0x6f, 0x1d, 0x7a, 0xb0, 0x8f, 0x3e, 0x3b, 0x10,
-       0xfd, 0x2d, 0x06, 0xeb, 0xae, 0xec, 0xc6, 0xfd, 0x2b, 0xcf, 0x91, 0x80,
-       0xbd, 0x7e, 0x69, 0x27, 0xce, 0x06, 0xb9, 0x5e, 0xde, 0xa1, 0xf2, 0x6e,
-       0xf8, 0xce, 0xd3, 0x43, 0xe9, 0x3e, 0xe9, 0xda, 0x25, 0x67, 0x86, 0x58,
-       0xa3, 0xb5, 0x01, 0x1f, 0x61, 0x79, 0xe7, 0xb4, 0x4b, 0x96, 0xe7, 0xe1,
-       0x5b, 0xe7, 0xd3, 0x0e, 0xff, 0xbe, 0x60, 0x01, 0x21, 0x6d, 0xa1, 0x3e,
-       0xd6, 0xc7, 0x98, 0xbc, 0x58, 0xa7, 0xae, 0xf4, 0x60, 0x7d, 0x3f, 0x74,
-       0x71, 0x1b, 0x6c, 0x48, 0xc7, 0xfe, 0x11, 0xee, 0xf7, 0x14, 0xee, 0x1e,
-       0xfb, 0xb7, 0x77, 0x2a, 0xdd, 0xd0, 0xd3, 0x56, 0x4a, 0x07, 0xed, 0x1f,
-       0xab, 0x2d, 0x1d, 0xe1, 0xf7, 0xc2, 0x69, 0xaf, 0xf1, 0xbb, 0xe1, 0x3e,
-       0xad, 0x50, 0xe1, 0xdf, 0x38, 0x0c, 0xc9, 0x21, 0x8b, 0x7f, 0xff, 0xb3,
-       0x4f, 0x7b, 0xa0, 0x4a, 0x18, 0x1b, 0x7d, 0xd6, 0xe1, 0xcb, 0xb0, 0xe5,
-       0xff, 0x29, 0xdc, 0xea, 0x62, 0xdb, 0x3a, 0xcb, 0xf0, 0xfb, 0x1d, 0xe7,
-       0xc7, 0x4d, 0xdd, 0xe4, 0x34, 0x71, 0x12, 0x27, 0xca, 0xc0, 0xc7, 0x39,
-       0x49, 0x3d, 0x39, 0xd5, 0x4e, 0xa2, 0x14, 0x22, 0x88, 0x84, 0xe5, 0xfc,
-       0xcc, 0x63, 0x14, 0x3c, 0xc8, 0xa6, 0x4e, 0x42, 0x55, 0x94, 0x74, 0x5b,
-       0x27, 0xee, 0xb8, 0x40, 0x5c, 0x80, 0x6a, 0x39, 0x69, 0xe9, 0x86, 0x3d,
-       0xa7, 0x5b, 0xba, 0x00, 0x57, 0x9e, 0xe3, 0xa4, 0x4d, 0xe7, 0xcc, 0x1a,
-       0x03, 0x69, 0x70, 0x41, 0x23, 0x33, 0x6d, 0xe3, 0x66, 0x37, 0x48, 0x5c,
-       0x57, 0x29, 0x83, 0x02, 0x6b, 0x2b, 0xb8, 0xe1, 0xef, 0xe2, 0xf0, 0x3c,
-       0xdf, 0x39, 0x76, 0xd3, 0xc0, 0x44, 0x24, 0xeb, 0x7c, 0xe7, 0x3b, 0xdf,
-       0xff, 0xf7, 0xbe, 0xcf, 0xfb, 0x9b, 0x6e, 0xb9, 0x08, 0x3a, 0xce, 0x8d,
-       0xb5, 0xfa, 0xfe, 0xd6, 0x0e, 0x9f, 0x87, 0x07, 0xfb, 0x7c, 0x19, 0xa5,
-       0x75, 0xc9, 0x9c, 0xd6, 0xa7, 0xbb, 0x0e, 0x7d, 0x7b, 0x16, 0x6b, 0x8a,
-       0xe0, 0x1c, 0x1e, 0xe9, 0xd3, 0x78, 0x64, 0xf0, 0xbd, 0xff, 0xd0, 0x7b,
-       0xdf, 0xa1, 0xf7, 0xde, 0xff, 0xd1, 0x9e, 0xe5, 0xc3, 0xf4, 0xc0, 0x75,
-       0x5a, 0x53, 0x1a, 0xfd, 0xf2, 0x93, 0x6a, 0x39, 0x6f, 0x25, 0xa9, 0x0b,
-       0xcc, 0x88, 0xab, 0x66, 0x9c, 0x36, 0x60, 0x5c, 0x9b, 0xac, 0xae, 0x83,
-       0xe6, 0xb1, 0x8f, 0x76, 0x9b, 0xf1, 0xf2, 0x89, 0x3e, 0xf2, 0x4c, 0x10,
-       0xd7, 0x60, 0xd8, 0xc3, 0x11, 0xb4, 0x73, 0x5f, 0x74, 0x12, 0xe6, 0x39,
-       0xed, 0xbf, 0xa1, 0x0e, 0xe3, 0xaa, 0x9c, 0xce, 0xfd, 0x60, 0x9b, 0x16,
-       0xb9, 0x6d, 0xa7, 0xba, 0xfd, 0xdc, 0x20, 0xd8, 0xbb, 0xa9, 0x3e, 0xea,
-       0x17, 0x2f, 0x38, 0xcd, 0x3a, 0x73, 0x5f, 0x98, 0x77, 0x05, 0xa2, 0x79,
-       0x4a, 0xa4, 0x54, 0x11, 0xb9, 0x86, 0xdf, 0x6f, 0x2a, 0x7e, 0xfc, 0x42,
-       0xd1, 0xd6, 0x9e, 0x96, 0x1b, 0xc5, 0x2f, 0x48, 0x15, 0x32, 0x67, 0xc7,
-       0x71, 0xdd, 0x3b, 0x4e, 0x54, 0x9f, 0xf9, 0x0f, 0xf2, 0x4a, 0x62, 0xe3,
-       0x94, 0x69, 0x6d, 0xf2, 0xc3, 0x75, 0xe6, 0xd5, 0x59, 0xe6, 0x1d, 0x61,
-       0x7e, 0x5b, 0x44, 0xd2, 0xe1, 0x80, 0xd6, 0x4b, 0xe5, 0x69, 0x68, 0x12,
-       0xf8, 0xf6, 0x87, 0xf5, 0xb3, 0x7d, 0xf4, 0xb9, 0x7c, 0xbc, 0xce, 0x77,
-       0x03, 0x4f, 0x43, 0xea, 0x76, 0x00, 0xfa, 0x2b, 0x80, 0xc7, 0xe4, 0xb9,
-       0x73, 0xbf, 0xcf, 0x73, 0x6d, 0xa8, 0xa3, 0x0d, 0xdb, 0x26, 0xb9, 0x11,
-       0xe0, 0xa0, 0x1a, 0xd6, 0xf9, 0x47, 0xf5, 0xb0, 0xc6, 0xe5, 0x40, 0x99,
-       0x7e, 0x7b, 0xf3, 0xa8, 0xc6, 0xe8, 0xd4, 0xee, 0xf7, 0xf4, 0x5e, 0x50,
-       0xce, 0x96, 0x1d, 0xd2, 0xaa, 0x29, 0x3b, 0xe0, 0xb5, 0xeb, 0xb5, 0x37,
-       0xfa, 0x79, 0x57, 0x37, 0x6a, 0xdf, 0xef, 0xf3, 0x6c, 0x34, 0xd6, 0x5d,
-       0xe8, 0xf3, 0xea, 0xa2, 0xbe, 0xcd, 0x45, 0xdb, 0xac, 0x84, 0xbd, 0x7d,
-       0x5b, 0x6a, 0x1b, 0xdf, 0x95, 0x77, 0x8b, 0xdf, 0x91, 0x5f, 0x6c, 0x9c,
-       0x81, 0xce, 0x61, 0x95, 0xb2, 0x90, 0x27, 0x6f, 0xd7, 0x5c, 0xf7, 0x6d,
-       0x67, 0x01, 0xf6, 0x81, 0xeb, 0xfe, 0xd6, 0xd9, 0x93, 0xd8, 0xc4, 0x37,
-       0xb1, 0xe7, 0x0c, 0x78, 0x88, 0x58, 0x98, 0x06, 0xbd, 0x7d, 0xb1, 0x5f,
-       0x3a, 0x42, 0x9a, 0x4e, 0x86, 0x27, 0x5a, 0xb1, 0x07, 0xc3, 0xd7, 0xc3,
-       0xb9, 0x97, 0xe9, 0x7e, 0xd2, 0x8c, 0x51, 0xfb, 0x09, 0xe6, 0x6f, 0x05,
-       0x5f, 0x1c, 0xc5, 0x4f, 0xc9, 0x9d, 0x71, 0xac, 0x75, 0x9c, 0xb4, 0xd7,
-       0x2a, 0xb1, 0xc7, 0xb0, 0x8f, 0x4c, 0x8b, 0xdc, 0xcb, 0x6f, 0xf6, 0xd1,
-       0x9f, 0x77, 0x2f, 0xcf, 0xb2, 0xf1, 0xb9, 0x4e, 0x71, 0xa5, 0x05, 0xf2,
-       0x7b, 0x75, 0xd2, 0xd3, 0x95, 0x7e, 0xad, 0x4e, 0xa0, 0xbd, 0x9d, 0x7d,
-       0x4f, 0x51, 0xb7, 0xcb, 0xba, 0xad, 0xd0, 0xc5, 0xe7, 0xa0, 0x03, 0xa5,
-       0x6a, 0x17, 0xa4, 0x3e, 0x1e, 0x42, 0x1b, 0xea, 0x28, 0x1a, 0x4b, 0x64,
-       0x26, 0xcf, 0x7c, 0x2d, 0xe6, 0x4e, 0x61, 0x8d, 0x0b, 0xc4, 0x0d, 0xae,
-       0xb1, 0x8d, 0x31, 0x38, 0xbf, 0xce, 0x06, 0x8d, 0xb0, 0x8e, 0xf4, 0x9d,
-       0x04, 0x4f, 0x26, 0x29, 0x37, 0x31, 0xde, 0x18, 0xc6, 0x63, 0xb9, 0x13,
-       0xe3, 0x5d, 0x90, 0x94, 0xd3, 0x18, 0x73, 0x0a, 0x6d, 0x88, 0x33, 0x53,
-       0xd0, 0x1f, 0x86, 0xd4, 0xec, 0x7a, 0x18, 0xf2, 0xbb, 0x4f, 0x66, 0xcd,
-       0x23, 0x07, 0xf6, 0x98, 0xd5, 0xf6, 0x81, 0x61, 0x8c, 0xf9, 0x6b, 0xea,
-       0x3c, 0xb0, 0x26, 0xf6, 0xc7, 0x0f, 0xb6, 0x71, 0x6a, 0x7d, 0x0d, 0x38,
-       0xb5, 0xf6, 0x61, 0xca, 0x39, 0x2b, 0x33, 0x61, 0xae, 0x89, 0xf5, 0x61,
-       0xac, 0x99, 0x7e, 0xac, 0x67, 0x81, 0x43, 0x47, 0xfc, 0x3a, 0xb6, 0x15,
-       0x23, 0x85, 0xb3, 0xf7, 0xec, 0x5a, 0xd6, 0x7d, 0x56, 0x52, 0x6b, 0x19,
-       0x99, 0xd7, 0xfd, 0x78, 0x86, 0x83, 0x5a, 0xf7, 0x20, 0xaf, 0xc6, 0x7a,
-       0x70, 0x96, 0x89, 0x07, 0x36, 0x70, 0xb4, 0x47, 0xcb, 0xcc, 0x7e, 0x8f,
-       0x67, 0xf1, 0xad, 0x87, 0x77, 0xd4, 0x26, 0xb1, 0x6f, 0x40, 0x46, 0xe6,
-       0x1b, 0xf5, 0x21, 0xf9, 0x24, 0xdf, 0xd1, 0xcf, 0x38, 0xcb, 0xdd, 0xbc,
-       0x29, 0x1f, 0xe7, 0x75, 0x2c, 0x74, 0x31, 0x20, 0xd6, 0x79, 0xcf, 0x3e,
-       0x1f, 0x59, 0x5c, 0x55, 0xfc, 0x3e, 0x72, 0x7e, 0x4b, 0x05, 0xd1, 0x36,
-       0x84, 0x76, 0x5c, 0x87, 0x29, 0x73, 0xf9, 0xbf, 0xb9, 0x4b, 0xa3, 0xae,
-       0x3b, 0xaf, 0xf3, 0xc3, 0x12, 0xe6, 0xaa, 0x6a, 0xe8, 0xe4, 0x71, 0xc9,
-       0x87, 0xdb, 0x31, 0x57, 0xc2, 0xdc, 0x52, 0x23, 0x58, 0x0f, 0xcb, 0x3d,
-       0xe4, 0x89, 0xc8, 0x9e, 0x70, 0x7c, 0x2b, 0xbd, 0xa9, 0x12, 0xd1, 0x61,
-       0x65, 0x25, 0x73, 0xf8, 0xb5, 0x28, 0x1d, 0x47, 0x8c, 0x44, 0x15, 0x78,
-       0x17, 0x7b, 0xb2, 0x4f, 0xba, 0x6e, 0xda, 0x66, 0x7d, 0xc2, 0x0c, 0x29,
-       0xfa, 0x5b, 0x3a, 0x74, 0xbc, 0xf1, 0x72, 0x6f, 0xc2, 0x3c, 0xa9, 0x8e,
-       0xfb, 0xef, 0x53, 0xc0, 0xcc, 0xe6, 0x78, 0x67, 0x36, 0x95, 0x29, 0x2f,
-       0xe5, 0x13, 0xd1, 0x65, 0x65, 0x65, 0x30, 0x66, 0x66, 0x56, 0x11, 0x37,
-       0x12, 0x66, 0x87, 0xa2, 0x4f, 0xb4, 0x5d, 0xef, 0x3b, 0x8d, 0xfe, 0x09,
-       0xd5, 0xe2, 0xaf, 0x87, 0xf7, 0xf5, 0xe3, 0x7e, 0x8f, 0x67, 0x88, 0x39,
-       0xa3, 0xc0, 0x4c, 0xe6, 0x9a, 0xe9, 0xdc, 0x86, 0x64, 0x6c, 0x62, 0x54,
-       0x63, 0xe8, 0xfd, 0x53, 0x7f, 0x47, 0x1d, 0xca, 0x25, 0xd6, 0xc5, 0x7d,
-       0x7e, 0x1b, 0xd5, 0x3a, 0xf3, 0xfd, 0x53, 0x59, 0x9d, 0xc7, 0x58, 0x57,
-       0x31, 0x7f, 0xdf, 0xcd, 0x3b, 0x8b, 0xa6, 0x9c, 0x47, 0x38, 0xce, 0x5a,
-       0x60, 0xba, 0x5d, 0x98, 0x23, 0x3a, 0x57, 0x6c, 0xd0, 0x06, 0xfd, 0x01,
-       0xcc, 0x17, 0x68, 0xc4, 0xbd, 0x2f, 0x88, 0x31, 0x11, 0x3c, 0x40, 0x27,
-       0xd0, 0x35, 0xa1, 0xa3, 0x56, 0x30, 0x4e, 0x6e, 0x5d, 0xb2, 0x5e, 0x7f,
-       0x09, 0x32, 0x27, 0x35, 0x57, 0xf9, 0xb4, 0x31, 0x38, 0x37, 0xe6, 0xc0,
-       0xfb, 0xfd, 0x53, 0xa4, 0x4f, 0x9e, 0x4d, 0x54, 0xcd, 0x6d, 0x70, 0x3d,
-       0x83, 0x32, 0xbf, 0x3e, 0x24, 0xcb, 0xf8, 0xad, 0xae, 0x7b, 0xf7, 0xb6,
-       0x0d, 0xdd, 0x7a, 0x3e, 0x6f, 0x6a, 0x7e, 0x5d, 0x76, 0x18, 0x33, 0x01,
-       0xaf, 0xe8, 0x9c, 0x2a, 0xf6, 0x65, 0x5e, 0xe1, 0x10, 0xe5, 0xa3, 0x53,
-       0x87, 0x5c, 0xdd, 0xae, 0x51, 0x4f, 0x65, 0xbd, 0x35, 0x15, 0x0d, 0x74,
-       0xc9, 0x2a, 0xf0, 0xae, 0x0c, 0xd9, 0x99, 0x7b, 0x25, 0x24, 0xcb, 0x79,
-       0x1d, 0x4f, 0x8e, 0xfe, 0x5e, 0x39, 0x52, 0xad, 0x4d, 0xca, 0x6e, 0x2d,
-       0xae, 0xbf, 0x51, 0xae, 0xe5, 0x5e, 0x37, 0xe4, 0xf9, 0x51, 0x9d, 0x57,
-       0x17, 0x2f, 0x4b, 0xef, 0x00, 0x75, 0x9e, 0x2d, 0x9d, 0x63, 0x07, 0xec,
-       0x80, 0xce, 0xf1, 0x33, 0xe8, 0x1c, 0xef, 0x40, 0xe7, 0xf8, 0x69, 0x11,
-       0xf8, 0x52, 0x4c, 0xfb, 0xf8, 0xbf, 0x08, 0x1c, 0xa2, 0xac, 0xb6, 0xce,
-       0xe0, 0x4e, 0x17, 0xb3, 0xa0, 0xc1, 0x5b, 0x92, 0x06, 0xde, 0xa6, 0xe4,
-       0xfa, 0xc6, 0xbc, 0xec, 0x6c, 0x78, 0x79, 0xc8, 0x1f, 0x30, 0x07, 0x6c,
-       0x9c, 0xf7, 0x14, 0x07, 0x0e, 0x1d, 0x91, 0xd8, 0x49, 0xe2, 0x47, 0x50,
-       0x36, 0x0b, 0xef, 0x68, 0x1c, 0xda, 0x2c, 0xb0, 0x1c, 0x10, 0x9d, 0x4f,
-       0xb6, 0xb0, 0x27, 0x65, 0xe7, 0x97, 0xa8, 0x3f, 0xa6, 0x7d, 0x40, 0x9e,
-       0x4f, 0x9e, 0x78, 0xf9, 0x67, 0xff, 0xee, 0x95, 0xce, 0xb3, 0x5b, 0x32,
-       0xbb, 0xd0, 0xae, 0x81, 0x5d, 0xc3, 0x5e, 0xcc, 0x5b, 0xfd, 0x05, 0x6d,
-       0x30, 0x47, 0xb1, 0x4b, 0xb6, 0x21, 0x43, 0xea, 0xf1, 0x2e, 0xad, 0xfb,
-       0xd5, 0xe3, 0x43, 0x3a, 0x17, 0x97, 0xe3, 0xe4, 0x0a, 0xb6, 0xac, 0x14,
-       0xac, 0x68, 0x16, 0xf4, 0xb7, 0x0b, 0x5b, 0xed, 0x3a, 0xee, 0x60, 0x07,
-       0x67, 0x70, 0xa3, 0x46, 0x39, 0x7f, 0x57, 0x63, 0xef, 0x66, 0xed, 0x4f,
-       0x18, 0xc7, 0x3a, 0x93, 0x94, 0x3f, 0xf6, 0x13, 0x03, 0xe9, 0x8f, 0x9a,
-       0xd1, 0xfd, 0xbd, 0x7e, 0xd7, 0xd1, 0x76, 0xa7, 0x46, 0x3c, 0x16, 0xb9,
-       0x94, 0xb7, 0x21, 0x4b, 0x5e, 0x8f, 0x50, 0x07, 0x28, 0xa9, 0x46, 0x3f,
-       0xd7, 0x5f, 0xb3, 0xeb, 0x1e, 0xb5, 0xb9, 0xae, 0xb8, 0x8f, 0xdb, 0x94,
-       0xfd, 0x7b, 0x5a, 0xee, 0xe7, 0x8b, 0x67, 0xe5, 0x2d, 0xdc, 0xb7, 0xa7,
-       0xe3, 0x64, 0xe4, 0x4d, 0xe8, 0x78, 0xb5, 0x62, 0x23, 0x6f, 0x7b, 0x1a,
-       0xe7, 0x64, 0xa9, 0x95, 0x2b, 0x2f, 0xcb, 0xe5, 0xab, 0xfb, 0xea, 0xa5,
-       0xab, 0x31, 0xf5, 0xf2, 0x95, 0x61, 0x95, 0xbb, 0xe2, 0xba, 0xff, 0x74,
-       0x96, 0xe4, 0xdd, 0x0d, 0x57, 0x4e, 0x3b, 0xc6, 0x40, 0x40, 0x1a, 0xb9,
-       0x75, 0xae, 0x1b, 0x04, 0x36, 0xdf, 0xe8, 0x75, 0xdd, 0x47, 0xc7, 0xc7,
-       0x25, 0xde, 0x4b, 0x1d, 0xe5, 0xf3, 0x11, 0xe6, 0xbb, 0x12, 0x73, 0x52,
-       0xb6, 0x7d, 0xbe, 0xac, 0x14, 0xf0, 0xad, 0xcb, 0xd3, 0x5f, 0x1e, 0x3b,
-       0xe6, 0xc7, 0x4a, 0x7e, 0xf4, 0x22, 0x7d, 0xc9, 0x91, 0xff, 0xf2, 0x25,
-       0x9b, 0x72, 0xae, 0xf0, 0x19, 0xf4, 0x0f, 0xcb, 0xb7, 0x0a, 0xa1, 0x43,
-       0x65, 0x13, 0xcf, 0x31, 0x95, 0x2b, 0xdc, 0x73, 0x87, 0x75, 0xcc, 0x00,
-       0x3a, 0x89, 0xe9, 0xba, 0xcb, 0x0e, 0xe7, 0xeb, 0xc2, 0x7c, 0x7b, 0xe6,
-       0x31, 0xc8, 0xff, 0xd3, 0x5a, 0x3e, 0x9f, 0x53, 0xb0, 0x7d, 0xc1, 0xdf,
-       0x61, 0x99, 0x2d, 0x40, 0xc6, 0x2b, 0xe6, 0x9c, 0x52, 0x57, 0xb0, 0x22,
-       0xcb, 0xc0, 0x8e, 0x25, 0xe0, 0xcd, 0x93, 0x3a, 0xb6, 0xda, 0xa3, 0xb1,
-       0x67, 0x85, 0xe5, 0x8c, 0x24, 0xcb, 0x4e, 0xb7, 0x3e, 0xbf, 0xfd, 0xdd,
-       0x57, 0x23, 0xde, 0x9d, 0x83, 0x8f, 0x33, 0x4a, 0xda, 0x60, 0x03, 0xcd,
-       0x6c, 0x2d, 0x80, 0x27, 0x22, 0x38, 0xdb, 0x56, 0xcd, 0x0f, 0x75, 0xc8,
-       0xef, 0xba, 0xf6, 0x23, 0x7a, 0xf1, 0x8a, 0xba, 0xc9, 0x76, 0xcf, 0xa0,
-       0x5f, 0xbb, 0xa4, 0xae, 0xb4, 0x69, 0x5c, 0x7d, 0xb8, 0x2e, 0x09, 0x3d,
-       0xe4, 0x69, 0x94, 0x03, 0xa8, 0x8b, 0xfa, 0x65, 0x03, 0xe5, 0x45, 0x94,
-       0x5b, 0xf0, 0x64, 0x9b, 0x11, 0xe8, 0x15, 0x78, 0xbe, 0x81, 0xf1, 0xc6,
-       0xb1, 0xe6, 0x8c, 0x29, 0x1f, 0x9d, 0xa2, 0x2c, 0x19, 0x53, 0xcc, 0x4b,
-       0x5e, 0xb6, 0xf1, 0xac, 0x0e, 0xab, 0x99, 0x35, 0x96, 0xf1, 0x2c, 0x79,
-       0xdf, 0x1f, 0xc2, 0x24, 0xf4, 0x49, 0x5d, 0xf5, 0x30, 0xe9, 0xa3, 0x26,
-       0x26, 0xb1, 0xae, 0x5d, 0x66, 0xaf, 0x90, 0xd7, 0x4d, 0xd0, 0x5b, 0x87,
-       0xcc, 0x5c, 0x0d, 0x6b, 0x7d, 0xb4, 0x0c, 0x5a, 0xdc, 0x06, 0x5d, 0x6d,
-       0x82, 0xa6, 0x52, 0x05, 0x6b, 0x6a, 0x51, 0x45, 0xb5, 0x2f, 0xe0, 0x09,
-       0xd0, 0x6b, 0xf0, 0x15, 0xea, 0xa2, 0xe4, 0xe5, 0x38, 0x68, 0x4f, 0xdc,
-       0xa0, 0x6d, 0xa7, 0xe3, 0xca, 0x06, 0x0d, 0x82, 0x2e, 0x0b, 0x1e, 0x4f,
-       0xbf, 0xa7, 0x34, 0xae, 0x4e, 0xdd, 0x96, 0x44, 0xf2, 0xb6, 0x58, 0xc0,
-       0x02, 0xcb, 0xf9, 0x50, 0x1c, 0x8c, 0x39, 0x29, 0xd7, 0x30, 0x8f, 0x01,
-       0xfe, 0x1e, 0x3d, 0xa1, 0xf9, 0x7b, 0x4a, 0x02, 0x87, 0x79, 0x1c, 0xf4,
-       0x06, 0x0c, 0xf2, 0x78, 0x3a, 0xe9, 0xd3, 0xe8, 0xd7, 0xc1, 0xbf, 0x16,
-       0x2c, 0xb1, 0xb0, 0xac, 0x82, 0xff, 0xb7, 0xf1, 0xfd, 0x66, 0x6d, 0x44,
-       0xad, 0xac, 0x29, 0x3f, 0x97, 0xe4, 0x19, 0xe8, 0xc9, 0xb7, 0x70, 0x76,
-       0x9d, 0x5a, 0x77, 0x8f, 0x8d, 0x33, 0x7e, 0x96, 0x56, 0x97, 0xed, 0x93,
-       0xb2, 0x3f, 0x36, 0x89, 0xf2, 0x31, 0x3c, 0x0d, 0x9c, 0x43, 0x48, 0xc7,
-       0xbf, 0x37, 0xf3, 0x8e, 0xf2, 0xfe, 0x67, 0x61, 0x42, 0xe7, 0xe7, 0x1b,
-       0x76, 0x2f, 0xbe, 0xd3, 0x17, 0xc3, 0xbd, 0x41, 0x67, 0x52, 0x11, 0x9d,
-       0x6f, 0x5a, 0x86, 0x2e, 0xb1, 0x85, 0xf1, 0xde, 0xa7, 0x2f, 0xaf, 0x0a,
-       0x1e, 0x1e, 0xfb, 0x97, 0x9b, 0x0c, 0x33, 0x47, 0xfd, 0x6e, 0xc4, 0x93,
-       0x7f, 0x9f, 0xb8, 0xfb, 0xf6, 0xca, 0x94, 0x81, 0x97, 0x5b, 0x66, 0x18,
-       0x6d, 0x21, 0xcb, 0x20, 0x8b, 0x4a, 0x9a, 0x7e, 0xd9, 0xce, 0xeb, 0x9b,
-       0xab, 0x26, 0xcc, 0x0f, 0xc4, 0xeb, 0xbb, 0x6a, 0x53, 0xee, 0xb4, 0x03,
-       0x5f, 0xa2, 0x5a, 0xaf, 0x7c, 0xdf, 0xce, 0x02, 0x15, 0xac, 0x68, 0x1a,
-       0x34, 0xda, 0x26, 0x56, 0x7c, 0x4e, 0x1e, 0xcc, 0xbb, 0xac, 0xfb, 0xb2,
-       0x6d, 0xa3, 0x6f, 0x63, 0x5e, 0xae, 0x9f, 0x7b, 0xe1, 0x1e, 0xe8, 0x9b,
-       0x36, 0x35, 0x8d, 0xd6, 0xab, 0xdd, 0x03, 0x1e, 0x8d, 0x36, 0xf6, 0x11,
-       0xfe, 0x3f, 0xfb, 0x20, 0x9d, 0x38, 0xca, 0xcb, 0xbb, 0xc0, 0xb3, 0xca,
-       0xf3, 0x1c, 0x01, 0x6d, 0x1c, 0xa4, 0x9f, 0x86, 0x6f, 0xd1, 0xa3, 0x9f,
-       0x47, 0x9b, 0xf4, 0x43, 0xba, 0xe9, 0x90, 0xd9, 0xab, 0xb6, 0xcc, 0x17,
-       0xf4, 0x7d, 0x43, 0xd7, 0xa4, 0xcf, 0x68, 0x12, 0x74, 0x43, 0x5a, 0x27,
-       0x6f, 0x99, 0x52, 0x02, 0x1d, 0x95, 0x80, 0x4f, 0x25, 0xd0, 0x54, 0x19,
-       0xf8, 0x56, 0x02, 0xbe, 0x95, 0x6a, 0x56, 0xbc, 0x82, 0x3d, 0x53, 0x66,
-       0x6f, 0x81, 0x8e, 0xb6, 0x6b, 0xbc, 0x7f, 0xbd, 0x66, 0x93, 0x72, 0xf0,
-       0x66, 0xf3, 0xee, 0xff, 0x81, 0xbb, 0x1f, 0x92, 0x5d, 0xd8, 0x2d, 0x6f,
-       0x15, 0xc7, 0x80, 0x49, 0x02, 0x8c, 0x72, 0x40, 0x1b, 0x53, 0x72, 0xbd,
-       0x38, 0x2d, 0x3b, 0x90, 0x4f, 0x37, 0x36, 0x62, 0xd0, 0xa7, 0x23, 0xb2,
-       0xf2, 0xda, 0xa8, 0xbc, 0xb9, 0xa1, 0x64, 0x09, 0xf4, 0x9b, 0xdb, 0xa4,
-       0xdf, 0x1d, 0xf4, 0x5c, 0xea, 0xd0, 0x71, 0xfa, 0xd9, 0x8a, 0xe7, 0x7f,
-       0x9f, 0xab, 0x74, 0xca, 0x7c, 0xc5, 0x94, 0xc7, 0x2b, 0xdd, 0xf2, 0xe5,
-       0x4a, 0x58, 0x4e, 0xc3, 0x0e, 0xfc, 0x4a, 0x65, 0x50, 0x9e, 0xac, 0x0c,
-       0xc9, 0x57, 0xab, 0x51, 0xf9, 0x5a, 0xd5, 0x96, 0x4c, 0x35, 0x2e, 0xe9,
-       0xea, 0x98, 0x3c, 0x51, 0xa5, 0x5f, 0x1d, 0xf3, 0xe1, 0x37, 0xd3, 0xf4,
-       0x57, 0x70, 0x5d, 0x41, 0xac, 0x2b, 0xae, 0xe6, 0x74, 0x9c, 0x52, 0x32,
-       0x9e, 0xcf, 0x43, 0xe4, 0x39, 0x8c, 0x75, 0xf1, 0x35, 0x25, 0x65, 0x3d,
-       0x7f, 0xe3, 0xff, 0x46, 0x42, 0xda, 0x36, 0x7a, 0xae, 0x34, 0x88, 0x36,
-       0x90, 0x7b, 0xf9, 0x86, 0xef, 0xa3, 0xe1, 0xf3, 0x6f, 0xd8, 0x5e, 0x86,
-       0xf6, 0x5b, 0xdf, 0xa4, 0xed, 0xa5, 0xcf, 0x9e, 0xf8, 0x41, 0x3b, 0xe7,
-       0x9a, 0xf6, 0x9b, 0x3c, 0x88, 0x6d, 0x34, 0xe6, 0xbd, 0x98, 0x79, 0xf8,
-       0xff, 0x53, 0xbc, 0x18, 0xd5, 0xb9, 0xea, 0x20, 0xff, 0x4f, 0x05, 0x6b,
-       0xf9, 0xf4, 0xdc, 0xf1, 0xf9, 0xe2, 0xac, 0x7a, 0xbc, 0x48, 0x8d, 0xc6,
-       0x95, 0x8b, 0xcd, 0x9c, 0xb8, 0x2f, 0xc9, 0xa6, 0x13, 0xd2, 0x6b, 0xf0,
-       0xf3, 0x1f, 0x75, 0x7e, 0xdc, 0xec, 0x09, 0xd2, 0x1f, 0x63, 0x6f, 0x9d,
-       0x7e, 0x3c, 0x01, 0xba, 0xad, 0x63, 0xca, 0xa5, 0x8a, 0xe7, 0xb3, 0x5a,
-       0xd1, 0xf4, 0xf2, 0x2b, 0xd0, 0x1c, 0x63, 0x0e, 0xde, 0x33, 0x5b, 0xf2,
-       0xfa, 0xce, 0xe0, 0xde, 0x60, 0x8f, 0x63, 0xbf, 0x46, 0x37, 0xe7, 0xe2,
-       0xff, 0xe9, 0xa0, 0xec, 0xaf, 0x97, 0xb9, 0xc6, 0xb6, 0xa6, 0x45, 0x2f,
-       0xae, 0x1b, 0x97, 0x17, 0x70, 0x7e, 0x65, 0x93, 0xeb, 0x0f, 0x4a, 0x39,
-       0x4e, 0xdb, 0x96, 0xf8, 0x7d, 0x42, 0x4a, 0x98, 0xa7, 0x1c, 0x6f, 0xf8,
-       0xc3, 0x3c, 0x9c, 0x2d, 0x9b, 0x0f, 0xe6, 0x5d, 0x2c, 0x1d, 0xc7, 0x3b,
-       0xea, 0xe2, 0xd0, 0x99, 0x16, 0xf8, 0x7e, 0x11, 0x65, 0xfa, 0x46, 0x56,
-       0xf0, 0x8c, 0xf8, 0x75, 0xd5, 0x01, 0xad, 0xab, 0x4f, 0x3f, 0xe8, 0xb7,
-       0x54, 0xb2, 0xb2, 0xa9, 0x40, 0x42, 0x19, 0xaf, 0xfe, 0x7c, 0x80, 0x98,
-       0x7b, 0xdc, 0xe6, 0x2f, 0x24, 0x7f, 0x35, 0xb5, 0x4f, 0xc1, 0xff, 0x76,
-       0x44, 0x9e, 0x32, 0x99, 0xc7, 0x9e, 0x54, 0xb3, 0xc5, 0x9c, 0x9f, 0xe3,
-       0x9b, 0x50, 0xc7, 0xcb, 0x37, 0x07, 0xbc, 0x9c, 0x77, 0x8e, 0x7d, 0x30,
-       0xcf, 0xfd, 0x20, 0x9d, 0x30, 0xdf, 0xbd, 0xbd, 0xf9, 0x3f, 0x52, 0xe5,
-       0x3c, 0xf0, 0xce, 0x6e, 0xd1, 0xfc, 0x98, 0xab, 0xfe, 0xdb, 0xdd, 0xd3,
-       0xfc, 0xdc, 0xf0, 0x31, 0xfc, 0x6e, 0x80, 0xb6, 0x2d, 0x71, 0xe3, 0x92,
-       0x97, 0x3b, 0xaa, 0x6d, 0x68, 0x60, 0x05, 0xea, 0xc8, 0xab, 0xe0, 0x93,
-       0x66, 0x5b, 0xfe, 0xfd, 0x07, 0x69, 0x3f, 0x51, 0x42, 0x6c, 0x67, 0x00,
-       0x00, 0x00 };
+       0xec, 0x5c, 0x7d, 0x6c, 0x1c, 0xc7, 0x75, 0x7f, 0x3b, 0xbb, 0xa4, 0x8e,
+       0xd4, 0x91, 0x5c, 0x1e, 0x4f, 0xcc, 0x51, 0xa6, 0xed, 0x5b, 0x71, 0x25,
+       0x9e, 0x4d, 0xc6, 0x59, 0xd1, 0x07, 0x9b, 0x28, 0x0e, 0xc9, 0x66, 0xef,
+       0x24, 0xb1, 0x86, 0x5b, 0x53, 0x35, 0x1d, 0x1b, 0x6d, 0xea, 0xb2, 0x47,
+       0xb5, 0x29, 0x8c, 0x06, 0x90, 0xbf, 0x00, 0x17, 0xa8, 0xe4, 0xcb, 0x91,
+       0x8a, 0x55, 0xf7, 0xc0, 0xbd, 0xc8, 0x8c, 0x18, 0x20, 0x6e, 0x7d, 0x25,
+       0x29, 0x4a, 0x08, 0x0e, 0x3a, 0xa6, 0x71, 0x1a, 0xfd, 0x61, 0xd7, 0x04,
+       0x2b, 0x1b, 0x6e, 0x91, 0xd6, 0x72, 0xe3, 0xb6, 0x46, 0x50, 0x04, 0x84,
+       0xec, 0x34, 0x6e, 0xd0, 0x0f, 0xa1, 0x2e, 0x6c, 0x03, 0x96, 0xbd, 0xfd,
+       0xbd, 0xd9, 0x5d, 0xf2, 0x48, 0x5b, 0x76, 0xd0, 0x3f, 0xfa, 0x4f, 0x77,
+       0x80, 0xc3, 0xce, 0xcc, 0xbe, 0xf7, 0xe6, 0xcd, 0x9b, 0xf7, 0x39, 0x4b,
+       0xe9, 0xb7, 0xe3, 0xd4, 0x4e, 0x41, 0xeb, 0xc0, 0x2f, 0x7d, 0xf4, 0xb1,
+       0x87, 0x6e, 0xb9, 0xfd, 0x96, 0x5b, 0xd1, 0xdd, 0xaf, 0x2a, 0x3b, 0xd4,
+       0x70, 0x3e, 0x6a, 0x51, 0x8b, 0x5a, 0xd4, 0xa2, 0x16, 0xb5, 0xa8, 0x45,
+       0x2d, 0x6a, 0x51, 0x8b, 0x5a, 0xd4, 0xa2, 0x16, 0xb5, 0xa8, 0x45, 0x2d,
+       0x6a, 0x51, 0x8b, 0x5a, 0xd4, 0xa2, 0x16, 0xb5, 0xa8, 0x45, 0x2d, 0x6a,
+       0x51, 0x8b, 0x5a, 0xd4, 0xa2, 0x16, 0xb5, 0xa8, 0x45, 0x2d, 0x6a, 0x51,
+       0x8b, 0x5a, 0xd4, 0xa2, 0x16, 0xb5, 0xa8, 0x45, 0x2d, 0x6a, 0x51, 0x8b,
+       0x5a, 0xd4, 0xa2, 0x16, 0xb5, 0xa8, 0x45, 0xed, 0xff, 0x7b, 0x53, 0x89,
+       0x74, 0x7e, 0x76, 0x04, 0x3f, 0x8a, 0x89, 0x5c, 0xfa, 0x01, 0xc7, 0xa4,
+       0x98, 0x9a, 0xeb, 0x3f, 0x3e, 0x65, 0x12, 0xd9, 0xf5, 0xa1, 0x74, 0x9e,
+       0x3e, 0xf0, 0x4a, 0x49, 0x8d, 0x78, 0xfe, 0xfa, 0xdc, 0xd5, 0x67, 0x9e,
+       0xbf, 0xdd, 0xb8, 0x52, 0x53, 0x29, 0xa6, 0xe7, 0x66, 0xf6, 0xeb, 0xfb,
+       0x28, 0xd6, 0x0f, 0x9c, 0xa7, 0x07, 0xff, 0xb1, 0x93, 0x3a, 0x43, 0x5a,
+       0x44, 0x0b, 0x15, 0xc3, 0x3a, 0x88, 0xe7, 0x72, 0x7d, 0xc8, 0x5a, 0x23,
+       0x8d, 0x56, 0x75, 0x7f, 0xc5, 0x72, 0x45, 0x61, 0x3a, 0x54, 0xae, 0xc7,
+       0x68, 0x5d, 0xfe, 0x3b, 0x0f, 0xac, 0x69, 0x72, 0xff, 0x82, 0xe2, 0x34,
+       0x3c, 0xef, 0x8c, 0xe5, 0x79, 0x2f, 0xe1, 0xf7, 0x33, 0x0b, 0x63, 0xf7,
+       0x43, 0xcf, 0xd6, 0x54, 0x12, 0xe6, 0x1f, 0x2b, 0xce, 0x62, 0x2b, 0x95,
+       0xe7, 0x89, 0xa6, 0xdd, 0x18, 0x9d, 0x74, 0x4b, 0x4a, 0xa1, 0x51, 0x51,
+       0x0e, 0x9c, 0x9d, 0x55, 0x0e, 0x9e, 0x3d, 0xa9, 0x1c, 0x3a, 0x5b, 0x55,
+       0x9c, 0xb3, 0x54, 0x12, 0xfb, 0xe3, 0x64, 0xeb, 0xe7, 0x94, 0x7c, 0xa3,
+       0x57, 0x71, 0xe6, 0xaf, 0x7a, 0x8e, 0x65, 0xe8, 0xbf, 0x4e, 0x9a, 0xcd,
+       0xeb, 0x39, 0x15, 0x0f, 0x63, 0x8d, 0xec, 0xa4, 0xe7, 0x89, 0x9c, 0xf7,
+       0xb8, 0x93, 0x35, 0x75, 0xa1, 0xc4, 0xa8, 0xdc, 0x68, 0x07, 0x5d, 0x4d,
+       0xc9, 0xbb, 0xde, 0x0b, 0x8e, 0xb5, 0x0c, 0x3a, 0x75, 0xe0, 0x93, 0x2e,
+       0x72, 0xcc, 0x4f, 0xc8, 0x63, 0x49, 0xc9, 0x0f, 0x86, 0xfc, 0x50, 0x9a,
+       0xf9, 0x2d, 0x2e, 0x09, 0xf0, 0xb5, 0x93, 0x8a, 0x35, 0x9d, 0x26, 0x97,
+       0xb6, 0xc3, 0xaf, 0x7b, 0xcf, 0x0f, 0xea, 0xb4, 0xd2, 0x30, 0x4a, 0x25,
+       0xec, 0x7d, 0xc6, 0x4d, 0x93, 0xc8, 0x91, 0xed, 0x64, 0xfb, 0xe9, 0x85,
+       0x46, 0x8a, 0xfe, 0xbc, 0x61, 0xa6, 0xca, 0xb4, 0x83, 0x8a, 0xc9, 0x24,
+       0x7d, 0x17, 0x38, 0xd3, 0x58, 0x5b, 0x98, 0xa6, 0x5e, 0x06, 0x6c, 0xb9,
+       0xf1, 0x23, 0xfe, 0xb7, 0x31, 0xfa, 0x54, 0x56, 0xe2, 0x94, 0xc0, 0x67,
+       0x00, 0xcb, 0x7c, 0x4b, 0x58, 0xc9, 0xbb, 0x0f, 0x4b, 0xa5, 0xa9, 0x2c,
+       0xe6, 0x1a, 0x4e, 0x20, 0xfb, 0x56, 0xec, 0x8f, 0x9f, 0x37, 0x28, 0xf9,
+       0xf9, 0x1b, 0x20, 0x03, 0x4a, 0x0a, 0xda, 0x9b, 0x2a, 0x62, 0x66, 0xba,
+       0x11, 0xc7, 0x98, 0x79, 0xf1, 0xbc, 0x43, 0x16, 0xe9, 0x65, 0xab, 0x0b,
+       0xb2, 0x4a, 0x53, 0xd9, 0xea, 0x04, 0x4e, 0x0b, 0x75, 0x9b, 0xbc, 0x07,
+       0xa6, 0xdb, 0x86, 0x79, 0xaf, 0x43, 0xcd, 0x79, 0xde, 0x54, 0x96, 0x3a,
+       0xfd, 0xb9, 0x21, 0xd0, 0xd0, 0x68, 0x72, 0x5c, 0x01, 0xdc, 0xdb, 0xcc,
+       0x5f, 0x2c, 0x91, 0xe3, 0x3e, 0x3f, 0xb3, 0xe4, 0xcc, 0xa6, 0x83, 0x75,
+       0xe3, 0x54, 0x76, 0xaf, 0x0f, 0xfa, 0x90, 0xad, 0x8b, 0x3d, 0x5b, 0x7d,
+       0x18, 0x2b, 0x37, 0x82, 0x8e, 0x55, 0x26, 0x5e, 0x63, 0x17, 0xad, 0x25,
+       0x49, 0x5c, 0xb6, 0x7a, 0x02, 0xb8, 0x4e, 0xf0, 0x1a, 0x9e, 0x71, 0x3b,
+       0xcd, 0xcc, 0xb7, 0xd2, 0x89, 0x79, 0x96, 0x6d, 0x05, 0x67, 0x21, 0x68,
+       0xcf, 0x6d, 0x25, 0xc5, 0x6e, 0x9c, 0x44, 0x5f, 0xa3, 0x29, 0xd3, 0x7b,
+       0x61, 0xc6, 0x9a, 0x55, 0xf2, 0x67, 0x97, 0x95, 0x02, 0xce, 0xfc, 0xc0,
+       0xd9, 0x0b, 0xca, 0xc1, 0xc6, 0xcb, 0x1d, 0xd4, 0x6e, 0x40, 0xbb, 0x34,
+       0x3a, 0xe1, 0x2a, 0xc4, 0xfc, 0x2e, 0x40, 0x5e, 0xb6, 0x0e, 0xc9, 0x9b,
+       0x9d, 0xca, 0x41, 0xd0, 0x6a, 0x31, 0xbf, 0x1e, 0xa7, 0x4e, 0x95, 0x76,
+       0x98, 0x21, 0x6c, 0x8c, 0xbe, 0x0e, 0xde, 0xd6, 0xac, 0x24, 0xe0, 0xa8,
+       0xcb, 0xc7, 0xe9, 0x0e, 0xf8, 0x61, 0xdd, 0x61, 0xbd, 0x11, 0x76, 0x61,
+       0xee, 0x8f, 0x7a, 0xca, 0xc3, 0x3b, 0x19, 0x06, 0xf6, 0x60, 0x3f, 0x30,
+       0x65, 0x3a, 0xdd, 0x1a, 0x95, 0x74, 0x41, 0x86, 0x9e, 0xa7, 0x1b, 0x69,
+       0xc6, 0x22, 0xca, 0x43, 0x9f, 0x85, 0xa9, 0x41, 0x46, 0x26, 0x64, 0xb4,
+       0xb7, 0xa4, 0x8a, 0x7b, 0x41, 0xa2, 0xa4, 0x68, 0x81, 0x3c, 0x17, 0xe8,
+       0x0e, 0x89, 0x2f, 0x72, 0x16, 0x74, 0xb0, 0x9d, 0xfb, 0x58, 0x37, 0x26,
+       0xd7, 0x55, 0x73, 0x66, 0x6a, 0x91, 0x48, 0x11, 0xb9, 0x21, 0xd0, 0x63,
+       0xdd, 0x64, 0x38, 0x17, 0x3c, 0x32, 0xef, 0xdc, 0x37, 0x81, 0x13, 0x23,
+       0xc7, 0xea, 0x68, 0xe2, 0x13, 0xfc, 0x24, 0x59, 0xe6, 0x2c, 0x43, 0xb9,
+       0x4f, 0x65, 0x73, 0x9f, 0xef, 0x7b, 0x83, 0x23, 0x1a, 0xbd, 0x24, 0xf7,
+       0xcb, 0x76, 0xc4, 0x70, 0x72, 0x8f, 0xc4, 0xf2, 0x99, 0x76, 0x49, 0x29,
+       0x5a, 0xfa, 0x06, 0x2d, 0xe8, 0x85, 0x50, 0x73, 0x71, 0xca, 0x4b, 0xfe,
+       0x46, 0xb1, 0x16, 0xdb, 0x17, 0xec, 0xc4, 0xe4, 0xbd, 0xf0, 0x5c, 0x0e,
+       0xb6, 0x6a, 0x48, 0xfd, 0x29, 0x56, 0xd9, 0xfe, 0x99, 0xb7, 0x55, 0x43,
+       0x50, 0x48, 0x4f, 0xf4, 0xaa, 0xd4, 0x45, 0xe3, 0xd6, 0x55, 0x4f, 0xec,
+       0xc3, 0xfb, 0xe1, 0x14, 0x78, 0x33, 0xd2, 0xb0, 0xb6, 0x84, 0x4a, 0xb0,
+       0x73, 0x6b, 0x28, 0xa5, 0x93, 0x89, 0xbd, 0x25, 0xc8, 0x1e, 0x5f, 0x85,
+       0xe0, 0xaf, 0xc5, 0xa7, 0x4f, 0x17, 0x6c, 0xda, 0x0e, 0x78, 0x74, 0xac,
+       0x5b, 0xa5, 0xcc, 0x74, 0xec, 0x5f, 0x9d, 0x65, 0xf9, 0xb6, 0x43, 0xff,
+       0x15, 0x2a, 0x5a, 0x4c, 0x3b, 0xa4, 0x21, 0x68, 0xf0, 0xb6, 0x66, 0x1a,
+       0xe1, 0xd9, 0xb2, 0xfe, 0x6a, 0x34, 0x32, 0xc2, 0xb0, 0x0c, 0xc7, 0xf0,
+       0xc6, 0x68, 0x5a, 0xbc, 0xef, 0xed, 0xdf, 0xb2, 0xa6, 0x49, 0x62, 0x16,
+       0x3c, 0xfb, 0x67, 0x01, 0x19, 0x7e, 0x1a, 0x2c, 0x9f, 0xc3, 0x76, 0x79,
+       0x33, 0x6c, 0x33, 0x1c, 0x74, 0xa8, 0x97, 0x79, 0xa8, 0xc7, 0x7d, 0x7b,
+       0x0c, 0x79, 0x0a, 0xcf, 0x52, 0x09, 0x68, 0x7c, 0xd2, 0x3e, 0x18, 0x1e,
+       0x7e, 0xc2, 0x85, 0x9f, 0x70, 0xe1, 0x1f, 0x5c, 0xf8, 0x11, 0x97, 0xfd,
+       0x4a, 0x9a, 0x9e, 0x1f, 0x84, 0xdf, 0xdb, 0xf4, 0x43, 0x68, 0x63, 0xe8,
+       0x0b, 0x52, 0xe1, 0x87, 0xa6, 0x6b, 0x02, 0xb6, 0x0e, 0x9b, 0x5b, 0xe2,
+       0x39, 0x1d, 0xcf, 0x02, 0x9e, 0x26, 0xfc, 0x2c, 0xeb, 0x61, 0xe8, 0x5f,
+       0xd9, 0x2f, 0xa5, 0xe0, 0x83, 0xd8, 0xef, 0xb0, 0x7f, 0x62, 0x58, 0xcf,
+       0x2b, 0x58, 0x8c, 0xeb, 0xe1, 0x1c, 0xd9, 0xee, 0xe2, 0x24, 0x12, 0x25,
+       0xe5, 0xf0, 0x20, 0x6c, 0xf2, 0xe6, 0x16, 0xf0, 0xca, 0xb6, 0x79, 0x1d,
+       0xbb, 0x16, 0xb4, 0xf7, 0x3b, 0xfc, 0x7f, 0xb7, 0xb7, 0x03, 0x30, 0xd2,
+       0xc6, 0x3b, 0xfd, 0x71, 0x77, 0xe0, 0x7f, 0xf8, 0xbd, 0x91, 0xb6, 0x69,
+       0x5f, 0x30, 0xe6, 0xfe, 0x06, 0xbf, 0x96, 0xb8, 0x2d, 0x46, 0x7b, 0x96,
+       0x7d, 0xbf, 0xb9, 0x67, 0x01, 0x9a, 0xb1, 0xec, 0xf3, 0xb8, 0xe7, 0x7c,
+       0xe8, 0x3f, 0x3b, 0x40, 0x0f, 0xfc, 0xb9, 0x9b, 0x71, 0x84, 0xe8, 0xbf,
+       0x14, 0x98, 0x16, 0xe6, 0xb6, 0xcb, 0xc2, 0xf3, 0x66, 0x2c, 0xb6, 0x4f,
+       0xbd, 0xd9, 0x3e, 0xf7, 0xc3, 0x3e, 0xad, 0x56, 0x32, 0xac, 0xbf, 0x82,
+       0x7d, 0x3e, 0x61, 0x29, 0x90, 0x0d, 0xd1, 0xc5, 0x4a, 0x1c, 0xbe, 0x41,
+       0x4b, 0xbd, 0x41, 0x7b, 0xd3, 0xd3, 0xd0, 0xcb, 0x33, 0x3c, 0x87, 0x23,
+       0x3a, 0x21, 0xfd, 0xb5, 0xef, 0x0f, 0xd6, 0xd5, 0x6f, 0x80, 0x2f, 0xcf,
+       0x9b, 0x06, 0xcd, 0xe2, 0xb0, 0x1a, 0xd8, 0x62, 0x38, 0x6f, 0x23, 0x26,
+       0x3a, 0x37, 0xa9, 0x54, 0xca, 0xb4, 0x90, 0x91, 0x59, 0x00, 0xed, 0x29,
+       0xcb, 0xb7, 0x7b, 0xb6, 0x8d, 0x45, 0xd0, 0x9f, 0x71, 0x07, 0xe1, 0x17,
+       0xd8, 0x6e, 0xc0, 0x17, 0xe8, 0x2f, 0x82, 0xfe, 0x4c, 0xa3, 0x85, 0xbe,
+       0xa6, 0x85, 0xb1, 0x36, 0xdc, 0x0f, 0x44, 0x6d, 0x86, 0xeb, 0x1e, 0xa5,
+       0x3b, 0xdc, 0x84, 0xe2, 0x3c, 0xc5, 0x7e, 0xb9, 0x9c, 0x81, 0x5d, 0x29,
+       0x65, 0x8b, 0xd7, 0x56, 0x69, 0x71, 0x03, 0x86, 0xec, 0xb2, 0x6f, 0xb3,
+       0xb6, 0x33, 0x58, 0x4a, 0xa9, 0xd2, 0xf7, 0x10, 0x1d, 0xac, 0x68, 0x80,
+       0xe1, 0x31, 0xcf, 0xfb, 0x73, 0x63, 0x95, 0x5e, 0xf8, 0x52, 0x1e, 0x5f,
+       0xf5, 0xa6, 0x2c, 0x7f, 0xee, 0x97, 0x2b, 0x0f, 0xf0, 0x19, 0x61, 0x2f,
+       0x94, 0x2e, 0x5b, 0x3f, 0xf7, 0xa0, 0xbf, 0x5b, 0x70, 0x3e, 0x9e, 0x8e,
+       0x31, 0xe6, 0xeb, 0x2c, 0x29, 0x87, 0x4c, 0xd1, 0xdb, 0x1a, 0xf8, 0xbc,
+       0x43, 0x98, 0x3c, 0x50, 0x29, 0xf7, 0xb4, 0xd2, 0x55, 0x95, 0x63, 0xeb,
+       0x65, 0x38, 0x01, 0xa7, 0xb2, 0x0f, 0xf2, 0x28, 0x77, 0x37, 0xcd, 0xc5,
+       0x0a, 0x15, 0x8f, 0xd6, 0x2c, 0x1f, 0x07, 0xe3, 0x78, 0xbe, 0x22, 0x7a,
+       0x63, 0xb4, 0x31, 0xd6, 0x19, 0x67, 0x89, 0xf6, 0x65, 0x16, 0x49, 0xe2,
+       0xf6, 0xc4, 0x36, 0x71, 0x93, 0x85, 0x4a, 0xb9, 0xbb, 0x69, 0x9c, 0xca,
+       0x83, 0x96, 0xd8, 0xbf, 0x81, 0xdb, 0xbf, 0x89, 0xbb, 0x8b, 0xd2, 0xdd,
+       0x8c, 0x2f, 0x7a, 0xdb, 0x36, 0x69, 0xa7, 0x03, 0x7e, 0x7a, 0xda, 0x36,
+       0x69, 0x98, 0x4c, 0xb3, 0x69, 0x9c, 0x61, 0x9a, 0x7b, 0x36, 0x69, 0x0e,
+       0x6f, 0xe5, 0xe7, 0x28, 0xc1, 0x07, 0xc5, 0x5a, 0x73, 0xb4, 0xff, 0x62,
+       0x65, 0x60, 0xfc, 0x0e, 0x42, 0x8c, 0x1c, 0xde, 0x11, 0xf8, 0x70, 0x6d,
+       0xbf, 0x03, 0x59, 0x69, 0xc4, 0x3e, 0x51, 0xa1, 0x32, 0xce, 0xf9, 0x81,
+       0x3a, 0xed, 0x5f, 0xab, 0x53, 0xa0, 0x4b, 0xac, 0x13, 0x6f, 0xc1, 0xc6,
+       0xa8, 0xb4, 0x3b, 0x17, 0x9f, 0xd4, 0x72, 0x3a, 0x6c, 0x8d, 0xc6, 0xcb,
+       0xf0, 0xe1, 0x6a, 0x6e, 0xef, 0xeb, 0x79, 0xf5, 0x71, 0x4f, 0x35, 0xd9,
+       0x1f, 0xc6, 0x47, 0x9d, 0x2c, 0xe6, 0xeb, 0x6c, 0x5b, 0xf0, 0x2b, 0x0d,
+       0xa6, 0xfd, 0x4c, 0x17, 0x75, 0x22, 0x8e, 0xd6, 0xcf, 0xec, 0xf2, 0x6d,
+       0x87, 0x34, 0x0d, 0xbe, 0x79, 0x26, 0xcb, 0x71, 0xbf, 0x35, 0x06, 0xf8,
+       0x49, 0x35, 0x37, 0xd6, 0x77, 0xa4, 0x7e, 0x67, 0x5f, 0xb1, 0x5e, 0xea,
+       0x2b, 0x56, 0x74, 0xb6, 0x13, 0xe1, 0x64, 0xd1, 0x97, 0xb9, 0x54, 0x0a,
+       0x36, 0xc1, 0x6b, 0x27, 0xb1, 0xe6, 0x0f, 0x60, 0x7f, 0x6c, 0xdf, 0x44,
+       0xe3, 0x2e, 0xd6, 0x18, 0xf9, 0x00, 0xe7, 0x0e, 0xde, 0xe0, 0xd3, 0x6c,
+       0xec, 0x5a, 0x8c, 0xfc, 0x6b, 0x60, 0x9f, 0xdc, 0x7f, 0xc7, 0xf3, 0xe3,
+       0xc3, 0xdd, 0x5d, 0xfe, 0xdc, 0x8f, 0x03, 0x9b, 0x0e, 0x69, 0x31, 0x9d,
+       0x8c, 0x32, 0x8e, 0x1c, 0x66, 0xbc, 0xa1, 0x29, 0xec, 0x9f, 0xf3, 0x2e,
+       0xe7, 0x1e, 0x9c, 0x77, 0x4c, 0x07, 0x7e, 0x8e, 0x6c, 0xe4, 0x4f, 0x9e,
+       0x40, 0x2e, 0x52, 0x84, 0xdd, 0x68, 0xb9, 0x2b, 0x34, 0x23, 0x7d, 0x24,
+       0xc5, 0x5a, 0x72, 0x8f, 0x01, 0xe6, 0xdf, 0x60, 0x73, 0xdd, 0x5d, 0x81,
+       0x1e, 0x06, 0x3e, 0x5e, 0xfa, 0x5d, 0xc0, 0xbe, 0xb5, 0x0d, 0xf6, 0xcd,
+       0x66, 0x58, 0xbc, 0x5f, 0xdf, 0xf6, 0xfe, 0x9f, 0xd9, 0x7e, 0xf1, 0x6e,
+       0x15, 0xfe, 0xb4, 0x35, 0xb0, 0xfd, 0x8b, 0x54, 0x84, 0x6f, 0xd5, 0x4c,
+       0xce, 0x2d, 0x0f, 0x02, 0x17, 0xe3, 0x3a, 0x78, 0x84, 0xbf, 0x40, 0x8c,
+       0x85, 0xbc, 0x11, 0x13, 0x92, 0x37, 0x72, 0x3e, 0x05, 0xd8, 0x34, 0x60,
+       0xd9, 0xff, 0x32, 0xec, 0x85, 0x38, 0xcb, 0xbc, 0x58, 0x67, 0x1c, 0xf6,
+       0x55, 0xe4, 0x39, 0xd9, 0x36, 0x68, 0x94, 0xf7, 0x82, 0x6a, 0x86, 0xb0,
+       0x21, 0xdd, 0xed, 0xb0, 0x9c, 0xdf, 0x30, 0xed, 0xae, 0x20, 0x6f, 0x18,
+       0x23, 0xbb, 0x61, 0xe3, 0x57, 0xa2, 0xa9, 0xa7, 0x90, 0xbb, 0x99, 0x2d,
+       0x2c, 0x0b, 0x9e, 0xd7, 0x7d, 0x19, 0x85, 0x78, 0xa5, 0x9e, 0xad, 0xe3,
+       0xdf, 0x4a, 0x6c, 0xfa, 0x4a, 0xb6, 0x34, 0xb2, 0x11, 0x2b, 0x20, 0xe3,
+       0xf4, 0xa4, 0xc8, 0x25, 0x29, 0x5f, 0xf7, 0xe5, 0x8b, 0xf8, 0x0c, 0xff,
+       0x28, 0xfd, 0x07, 0xce, 0x3d, 0xf4, 0x83, 0xe1, 0x99, 0xb3, 0x9e, 0xd9,
+       0x38, 0x9b, 0x34, 0x74, 0x69, 0x0c, 0xb8, 0x74, 0x14, 0x34, 0x38, 0x6e,
+       0x5b, 0x22, 0x97, 0xa0, 0xa2, 0xce, 0xf9, 0x85, 0xcc, 0x0d, 0x6d, 0xf6,
+       0x03, 0x22, 0xd7, 0x86, 0x39, 0xee, 0xff, 0x41, 0x97, 0x7f, 0xd6, 0x1d,
+       0x3c, 0x1e, 0x17, 0xb9, 0xae, 0x6d, 0xf3, 0x7f, 0xd7, 0xe1, 0xf3, 0x26,
+       0xc7, 0x98, 0xff, 0xc9, 0xb6, 0xf1, 0xa3, 0x89, 0xad, 0xe3, 0xaf, 0xf6,
+       0x85, 0xfa, 0x20, 0x72, 0x8f, 0x05, 0xfc, 0xb2, 0x9e, 0x6e, 0xe7, 0xf5,
+       0x17, 0xd1, 0x97, 0x3f, 0x01, 0x4d, 0xa9, 0xe3, 0xbf, 0x80, 0xbe, 0x6c,
+       0xc0, 0x5e, 0x43, 0x5f, 0x9a, 0x79, 0xd8, 0xa8, 0x3b, 0xaa, 0x02, 0x39,
+       0xac, 0x93, 0xdd, 0x9b, 0x2e, 0xc3, 0xc6, 0x0b, 0x0d, 0xc8, 0x6e, 0x23,
+       0xae, 0x6e, 0xc0, 0x94, 0x36, 0x61, 0xfc, 0xb8, 0x53, 0x68, 0x78, 0xc8,
+       0xfb, 0x9a, 0x63, 0x70, 0x06, 0xfd, 0x12, 0xf6, 0xba, 0x42, 0x53, 0xee,
+       0x9a, 0x2d, 0xcc, 0x93, 0x32, 0x6f, 0x15, 0xe6, 0x93, 0x4a, 0x61, 0x91,
+       0x73, 0xda, 0x18, 0xfa, 0xb2, 0x3e, 0x41, 0x8c, 0x3b, 0xa5, 0xd8, 0x67,
+       0xe7, 0x90, 0xcf, 0x2e, 0xe1, 0x77, 0x0e, 0xbf, 0x3a, 0x7e, 0x61, 0xdd,
+       0xf0, 0x2d, 0xd4, 0x1d, 0xd2, 0xdf, 0x23, 0x36, 0xf9, 0xeb, 0xff, 0x74,
+       0x09, 0xf9, 0xf4, 0x5c, 0x92, 0x9e, 0x30, 0x45, 0x8f, 0xf0, 0x7d, 0x9c,
+       0x8d, 0x5c, 0x5c, 0x7f, 0x8b, 0x7e, 0x25, 0xc8, 0xe9, 0x88, 0xde, 0xa8,
+       0xe2, 0x2c, 0x87, 0x0f, 0x05, 0xfe, 0xe9, 0xe4, 0x57, 0x1c, 0xe9, 0xcb,
+       0x83, 0x9c, 0x0d, 0x7e, 0xc7, 0x96, 0x50, 0xaf, 0x40, 0x3e, 0x0a, 0xfd,
+       0x0c, 0x7a, 0xfc, 0x46, 0xb5, 0x1d, 0xfc, 0x98, 0x54, 0x9c, 0x30, 0x46,
+       0x49, 0x19, 0xd0, 0x77, 0x28, 0xed, 0xc8, 0xdb, 0xe0, 0x77, 0xe4, 0x98,
+       0x65, 0x46, 0xc7, 0x17, 0x2a, 0x02, 0xb0, 0x90, 0x79, 0x16, 0x7d, 0xe8,
+       0xdf, 0xe5, 0x2a, 0xe3, 0x09, 0x7a, 0xb3, 0xaa, 0xd2, 0xbf, 0x20, 0x0f,
+       0xc4, 0xbb, 0xe3, 0xb0, 0xc1, 0x5e, 0xc4, 0xab, 0x7e, 0x95, 0xf6, 0x72,
+       0xcc, 0xd8, 0xa3, 0xe1, 0x59, 0xc0, 0xef, 0x20, 0xf2, 0xc2, 0x6b, 0xe0,
+       0x5c, 0x03, 0x9e, 0x79, 0x8b, 0x01, 0x87, 0xe1, 0x35, 0xf0, 0xd6, 0x09,
+       0x1d, 0x34, 0xf4, 0x49, 0xfa, 0x8c, 0x2e, 0x73, 0x27, 0x85, 0xe7, 0x7d,
+       0x3f, 0xf9, 0xd1, 0x79, 0x96, 0xb3, 0x0a, 0x1d, 0xe2, 0x31, 0xbf, 0x63,
+       0x7f, 0xce, 0xf4, 0x8c, 0x51, 0x1b, 0x9b, 0xb9, 0x5c, 0xf5, 0xfb, 0xe1,
+       0x1c, 0x29, 0x61, 0x4c, 0x65, 0x3f, 0x5d, 0x80, 0xad, 0xf2, 0x78, 0x9c,
+       0xe4, 0x19, 0x6c, 0x39, 0x4f, 0xa9, 0x47, 0xc7, 0x66, 0x4c, 0x3e, 0x57,
+       0x9d, 0xa6, 0x2b, 0xe1, 0xb9, 0xf2, 0x19, 0xa1, 0x0e, 0xad, 0x3e, 0x89,
+       0x73, 0x15, 0x41, 0xcd, 0x02, 0x3f, 0x30, 0xc7, 0xe7, 0x8b, 0x3a, 0xb2,
+       0x8a, 0x3c, 0xac, 0x4a, 0x09, 0xbf, 0xe6, 0x3a, 0x85, 0x3a, 0x05, 0xe7,
+       0x57, 0x99, 0x03, 0x8d, 0x24, 0x9e, 0x4b, 0x78, 0xa6, 0xf0, 0x3c, 0x87,
+       0x67, 0x3f, 0x9e, 0x75, 0xb6, 0x8f, 0x20, 0xef, 0xf9, 0x08, 0x3f, 0xb0,
+       0x93, 0x02, 0xdb, 0x34, 0xfd, 0x65, 0x23, 0x47, 0x3f, 0x68, 0x8c, 0xd2,
+       0x5f, 0x34, 0xb2, 0xf4, 0xfd, 0x86, 0x45, 0xcf, 0x36, 0x86, 0xe9, 0x7b,
+       0x8d, 0x0c, 0xd7, 0x90, 0xc8, 0xe1, 0xd2, 0xf0, 0xcd, 0x17, 0xe8, 0x2b,
+       0x6e, 0x03, 0x3e, 0x47, 0xfa, 0xcb, 0xe3, 0x76, 0xfd, 0x3a, 0x2a, 0x3e,
+       0xa5, 0x23, 0xcf, 0x54, 0xb9, 0x8e, 0xa3, 0x47, 0xad, 0xbb, 0x13, 0x7c,
+       0xf6, 0xc2, 0xe4, 0xba, 0xe6, 0x04, 0xc3, 0xa1, 0x1e, 0x56, 0x90, 0xbf,
+       0xb4, 0xd0, 0x64, 0xd2, 0x58, 0x71, 0xd4, 0x74, 0xe0, 0x8f, 0x26, 0x00,
+       0x87, 0x35, 0xdd, 0x38, 0xad, 0x9d, 0x86, 0x2d, 0x58, 0xa8, 0xa5, 0x93,
+       0x31, 0xf8, 0x3e, 0x99, 0x9f, 0x48, 0xdf, 0xe2, 0xfb, 0xd2, 0xb0, 0xc6,
+       0xe4, 0x39, 0x3b, 0x98, 0xe3, 0xf8, 0xa8, 0x03, 0xb6, 0x11, 0xc4, 0x90,
+       0xed, 0x34, 0xd9, 0x37, 0x4e, 0x04, 0xfe, 0x71, 0x85, 0x1e, 0x76, 0x07,
+       0xec, 0xb7, 0x11, 0x7b, 0x94, 0x96, 0x30, 0x2f, 0xda, 0x0d, 0xde, 0x3c,
+       0xef, 0x30, 0xea, 0xf3, 0x74, 0x42, 0xa3, 0xbf, 0x9f, 0x35, 0xf4, 0xc3,
+       0x02, 0x01, 0xae, 0xdd, 0xf3, 0xc6, 0x4d, 0xa3, 0x64, 0x8b, 0x0e, 0xfa,
+       0xa7, 0x53, 0x1c, 0x93, 0xd7, 0x8f, 0xbd, 0x08, 0x3d, 0xa8, 0x2d, 0xb5,
+       0x52, 0xad, 0xa6, 0xd1, 0xe5, 0x91, 0x01, 0xb9, 0x6e, 0xad, 0x9e, 0x40,
+       0x9e, 0xd7, 0x46, 0x8b, 0xbd, 0x52, 0xd9, 0xe1, 0xb7, 0x33, 0xd2, 0x6f,
+       0x3b, 0x26, 0x9e, 0xf5, 0xb4, 0xbe, 0x95, 0x97, 0x67, 0xa9, 0xe8, 0x76,
+       0xa2, 0x42, 0xd9, 0x0d, 0x99, 0x70, 0x7f, 0x40, 0x77, 0x04, 0x62, 0xa0,
+       0x36, 0xa0, 0x1f, 0x12, 0xff, 0xed, 0x7d, 0x51, 0x63, 0x39, 0xbe, 0x8e,
+       0xd8, 0xc2, 0xb1, 0x52, 0x91, 0x7a, 0xb7, 0xb0, 0xf4, 0xa6, 0xce, 0xfe,
+       0xe5, 0x7b, 0xf5, 0xdd, 0xc1, 0x98, 0xfd, 0x3b, 0x8f, 0xdb, 0xe9, 0xfb,
+       0xb5, 0x9d, 0xb4, 0x58, 0xe3, 0xf7, 0xad, 0xb4, 0x50, 0x1b, 0xb8, 0xf2,
+       0x90, 0xe8, 0xa5, 0xd5, 0xeb, 0x6e, 0xd6, 0x3f, 0x2f, 0x20, 0x93, 0x89,
+       0x0f, 0xe9, 0xdd, 0x91, 0x2e, 0x7a, 0xf5, 0x5e, 0xa3, 0x7a, 0xbf, 0x80,
+       0x3e, 0x8e, 0xc4, 0xd9, 0xce, 0xd0, 0xe7, 0x79, 0xe3, 0x4a, 0x5a, 0xb0,
+       0x9e, 0xbd, 0x0c, 0xfd, 0x32, 0x4e, 0xfa, 0x3a, 0xc9, 0xb4, 0x99, 0x2e,
+       0xce, 0xc7, 0x7c, 0x05, 0x34, 0xf1, 0xae, 0x3e, 0x00, 0x5a, 0xaf, 0x48,
+       0x59, 0x1c, 0xb6, 0x8c, 0x2b, 0x08, 0x51, 0xde, 0x65, 0x73, 0x20, 0x23,
+       0xc4, 0x6e, 0xaa, 0xa5, 0x6e, 0xd6, 0xbf, 0x8b, 0x78, 0x80, 0x9a, 0xab,
+       0xb4, 0x4e, 0xeb, 0xc7, 0x2e, 0x9a, 0xac, 0x8b, 0x6c, 0xc3, 0x3f, 0x44,
+       0x4e, 0xaa, 0xd3, 0x53, 0x75, 0xf6, 0x5d, 0x4c, 0x8b, 0xeb, 0x82, 0x7d,
+       0xfa, 0xdd, 0xe0, 0xc1, 0x19, 0xc6, 0x3b, 0xcc, 0xab, 0x9f, 0xe5, 0x73,
+       0x6b, 0x61, 0xdc, 0x4c, 0x9a, 0x37, 0xb3, 0x45, 0x46, 0x03, 0xfa, 0x5e,
+       0xc1, 0xeb, 0xbd, 0x8b, 0x75, 0xdf, 0x01, 0xaf, 0x03, 0xc0, 0x45, 0x0c,
+       0x4d, 0x35, 0xaf, 0xf1, 0x9a, 0x5c, 0xe3, 0x54, 0x1d, 0x39, 0xe0, 0xc6,
+       0x1a, 0x98, 0xab, 0x0b, 0xec, 0xf3, 0x57, 0x65, 0xfe, 0xac, 0x22, 0xff,
+       0xb9, 0x3c, 0xf2, 0x4c, 0x90, 0x5f, 0x3c, 0x07, 0x59, 0xc7, 0xe8, 0xb5,
+       0x59, 0xae, 0x2f, 0x0f, 0x51, 0x39, 0xb1, 0x7e, 0x6c, 0xca, 0x44, 0x4d,
+       0x8f, 0x38, 0x50, 0xde, 0x37, 0xe0, 0xeb, 0x55, 0x3f, 0xe3, 0x3c, 0x27,
+       0xcf, 0xa4, 0x2c, 0x5a, 0xe9, 0x8b, 0x5a, 0x1a, 0xf8, 0x3c, 0x77, 0x29,
+       0x38, 0xcf, 0x6f, 0x83, 0x1f, 0xf4, 0xeb, 0x3d, 0x81, 0xff, 0x4b, 0x40,
+       0x57, 0x87, 0xf4, 0xc3, 0x14, 0x0b, 0xfc, 0x5f, 0x82, 0x5e, 0x3d, 0xad,
+       0x42, 0x87, 0x58, 0x7f, 0xfa, 0xbb, 0x37, 0xf5, 0x87, 0xdf, 0xad, 0x1f,
+       0x73, 0xc0, 0x63, 0x7e, 0xae, 0x95, 0x0a, 0xd5, 0x18, 0x4d, 0x65, 0x91,
+       0x73, 0x23, 0xfe, 0xe4, 0xa1, 0x4b, 0x85, 0x1a, 0xeb, 0x72, 0x29, 0xd0,
+       0xe5, 0x78, 0x40, 0xfb, 0x6f, 0xa0, 0xcb, 0x46, 0x7a, 0x55, 0x70, 0x7d,
+       0xd5, 0x27, 0x6b, 0x64, 0x15, 0xf6, 0x55, 0xac, 0x70, 0x2c, 0x62, 0xdb,
+       0xa2, 0xe3, 0xcc, 0x7f, 0xb1, 0x32, 0x2a, 0x8a, 0x8d, 0xac, 0x28, 0xba,
+       0xcc, 0xdf, 0x3e, 0xf0, 0xad, 0xc8, 0x3a, 0x78, 0xa1, 0xf1, 0xae, 0xb7,
+       0xb0, 0x6f, 0x07, 0xfa, 0xd0, 0xfd, 0x71, 0x3e, 0xdf, 0xeb, 0x99, 0xaf,
+       0xb4, 0x2d, 0x58, 0xde, 0x49, 0x5a, 0x1e, 0x7c, 0xa9, 0x8b, 0x73, 0xb4,
+       0xb3, 0x83, 0x4c, 0x1f, 0x7c, 0x24, 0x93, 0xb4, 0xe8, 0xf2, 0x1a, 0x2c,
+       0x17, 0xf8, 0xba, 0x39, 0x9d, 0x1e, 0x96, 0xe7, 0xc7, 0xba, 0xc5, 0xf7,
+       0x4d, 0x2a, 0xe5, 0x13, 0x03, 0xfa, 0x43, 0x64, 0x5c, 0x59, 0x53, 0x8d,
+       0xea, 0x24, 0xe2, 0xea, 0xc2, 0xbc, 0x4a, 0x7b, 0x64, 0x1d, 0xc6, 0x67,
+       0x64, 0x9c, 0x84, 0x35, 0x06, 0x7b, 0xff, 0x8d, 0xa6, 0xbd, 0x77, 0xd2,
+       0xc5, 0xd3, 0x9f, 0x85, 0xdd, 0xb3, 0x5c, 0xb5, 0xf4, 0x11, 0xe4, 0x19,
+       0x73, 0x04, 0xf9, 0x22, 0x7f, 0xb6, 0x53, 0xe1, 0xb9, 0xb0, 0xbc, 0x77,
+       0x49, 0xf9, 0x0b, 0x29, 0xff, 0x1b, 0xa8, 0xdc, 0xeb, 0xdb, 0x38, 0xbf,
+       0x13, 0xa0, 0xe1, 0xbf, 0xe3, 0xf1, 0x67, 0x90, 0x1f, 0xf1, 0xbb, 0x9a,
+       0x8f, 0x47, 0x3d, 0x4c, 0x07, 0xef, 0xfe, 0x10, 0x6b, 0xb2, 0x8c, 0xc3,
+       0xf9, 0x0e, 0xf2, 0x6d, 0x29, 0x94, 0x3b, 0x12, 0x8c, 0x7a, 0x92, 0x7e,
+       0xad, 0x9e, 0xa2, 0x89, 0x7a, 0x3f, 0x15, 0xea, 0x69, 0x9c, 0xc1, 0x13,
+       0xdd, 0xbc, 0xb7, 0xfc, 0x12, 0xf6, 0x23, 0x98, 0xd7, 0x1a, 0x1d, 0x71,
+       0x43, 0x7e, 0xe2, 0x01, 0x7f, 0x5a, 0x30, 0x8e, 0x05, 0x3c, 0x34, 0xd3,
+       0x8b, 0x83, 0x96, 0x0d, 0x3a, 0x67, 0x02, 0x3a, 0xec, 0x47, 0xc0, 0xeb,
+       0x44, 0x8a, 0x96, 0x5c, 0xe6, 0x63, 0x27, 0x95, 0x93, 0xdc, 0x7f, 0x0e,
+       0x7a, 0xc6, 0x74, 0x76, 0x70, 0x7e, 0xb3, 0x45, 0xc6, 0x47, 0xeb, 0x25,
+       0xc8, 0x98, 0xe5, 0xcb, 0x70, 0x71, 0x5a, 0xf8, 0x25, 0x3e, 0xbf, 0x21,
+       0xe4, 0xf8, 0xac, 0x0b, 0x3b, 0x03, 0xbd, 0xf2, 0xd7, 0x2c, 0xcc, 0x75,
+       0xe2, 0xac, 0x78, 0xdd, 0x76, 0xba, 0x07, 0x76, 0x9f, 0xaf, 0xf1, 0xfa,
+       0x13, 0xd0, 0xa3, 0x1f, 0xcb, 0xf5, 0x0b, 0x4b, 0xbd, 0x01, 0x3e, 0xe3,
+       0x76, 0x6e, 0xc3, 0x6d, 0xa5, 0x03, 0x55, 0xfd, 0x63, 0xf0, 0x7f, 0x13,
+       0xf8, 0x82, 0xce, 0x64, 0x19, 0x9f, 0xe9, 0x00, 0xae, 0x96, 0xfc, 0x04,
+       0x3a, 0x09, 0x59, 0xef, 0xe7, 0x6b, 0xad, 0x94, 0xaf, 0x86, 0xb4, 0x98,
+       0xce, 0x87, 0xa8, 0x87, 0xbf, 0x2c, 0x69, 0x4d, 0x49, 0x5a, 0x78, 0x5f,
+       0x63, 0x9f, 0x73, 0x3b, 0xf0, 0xe3, 0xec, 0xff, 0x69, 0x21, 0xd1, 0x41,
+       0x0b, 0xb2, 0xa6, 0x6f, 0xf7, 0x7d, 0x4d, 0xa2, 0x0d, 0xef, 0x77, 0xc1,
+       0xe6, 0x87, 0x90, 0x5b, 0x74, 0x62, 0x2e, 0xbd, 0x6d, 0x6e, 0x3b, 0xff,
+       0xb1, 0x6d, 0xfc, 0xeb, 0x80, 0xeb, 0xc1, 0x9a, 0x3e, 0x5c, 0x01, 0x70,
+       0xd3, 0x73, 0x90, 0xb3, 0xc5, 0x7e, 0x85, 0xe3, 0xe4, 0x75, 0x92, 0x97,
+       0xe9, 0x25, 0x05, 0x70, 0xbd, 0xc0, 0x0d, 0xc7, 0xbe, 0x1c, 0xaa, 0xa0,
+       0xf3, 0xcd, 0x9a, 0xbc, 0xbb, 0xc0, 0x19, 0xf4, 0x24, 0x78, 0xef, 0xe5,
+       0xda, 0xa7, 0xc9, 0xec, 0xba, 0x26, 0x79, 0xb1, 0xac, 0x98, 0x5f, 0xe6,
+       0x15, 0x7a, 0x8a, 0x38, 0xe4, 0x58, 0xa8, 0x0b, 0x13, 0x2a, 0x15, 0xb2,
+       0x3a, 0xf2, 0x73, 0xbe, 0xb7, 0x65, 0xbb, 0xd4, 0xf9, 0xae, 0x34, 0x26,
+       0x4c, 0x8e, 0xb5, 0x9a, 0xdc, 0xfb, 0x91, 0x25, 0xbe, 0xbb, 0x4d, 0xf3,
+       0x5d, 0x5f, 0x86, 0xb0, 0xf7, 0x07, 0x97, 0x4c, 0x7a, 0xa4, 0x9e, 0xa1,
+       0x87, 0xea, 0x86, 0x7e, 0x3f, 0x7c, 0x40, 0x71, 0xe3, 0x4e, 0xf7, 0x73,
+       0x09, 0xae, 0x45, 0x34, 0xe4, 0x81, 0x2d, 0xa6, 0x9f, 0x17, 0x94, 0xb9,
+       0x66, 0x9b, 0x33, 0xf8, 0x1e, 0x47, 0xaf, 0xd1, 0xf6, 0xdc, 0xe1, 0xff,
+       0x32, 0x6f, 0xe0, 0xf5, 0xd9, 0x5f, 0x23, 0x4f, 0x70, 0x91, 0x27, 0xb8,
+       0xc8, 0x13, 0x5c, 0xe4, 0x09, 0x2e, 0xf2, 0x04, 0x17, 0x79, 0x82, 0x8b,
+       0x3c, 0xc1, 0x45, 0x9e, 0x80, 0xd8, 0xed, 0xd7, 0x0b, 0x63, 0xc8, 0x7f,
+       0xe1, 0xbf, 0xdc, 0xcf, 0x43, 0x4e, 0x7c, 0xdf, 0xc9, 0x31, 0x87, 0x63,
+       0x33, 0xcf, 0xad, 0xee, 0x70, 0xf8, 0xdc, 0xa4, 0xef, 0xbb, 0x13, 0x73,
+       0xe3, 0x41, 0x3e, 0xc2, 0x30, 0x61, 0xec, 0x66, 0x38, 0x1a, 0x75, 0x2c,
+       0x05, 0x36, 0xc6, 0xf9, 0x8a, 0x1f, 0xb3, 0xfc, 0x5c, 0xf9, 0x75, 0xe4,
+       0x2c, 0x69, 0xe4, 0x2c, 0xfd, 0xc8, 0x4f, 0xf8, 0x8e, 0x3b, 0xbc, 0x63,
+       0xb2, 0x95, 0xc3, 0xee, 0x98, 0x72, 0xb7, 0xcb, 0xb9, 0xb4, 0x99, 0x2e,
+       0x0a, 0x31, 0xd7, 0x43, 0x1e, 0xe5, 0x47, 0xbe, 0x86, 0xbc, 0xf5, 0x9b,
+       0xf2, 0x3e, 0x6d, 0x7c, 0x90, 0xcf, 0x7c, 0xe5, 0x1a, 0xb9, 0x6b, 0x28,
+       0x5f, 0xff, 0x1e, 0x50, 0x2c, 0xb0, 0xfc, 0x88, 0xba, 0xcf, 0x43, 0xe0,
+       0xe7, 0x63, 0x94, 0x58, 0xde, 0x89, 0x39, 0x9d, 0x7a, 0xe4, 0x5d, 0x12,
+       0x8e, 0xf2, 0xbc, 0xd6, 0x43, 0xed, 0x26, 0x89, 0xf3, 0x7c, 0xe3, 0xc0,
+       0x74, 0xd9, 0xbf, 0x5e, 0x3a, 0x96, 0xaf, 0x5d, 0x92, 0x3a, 0x75, 0xb8,
+       0x5e, 0x40, 0x7d, 0xd4, 0x07, 0x18, 0x0d, 0xb5, 0x55, 0x48, 0x9b, 0x69,
+       0x5e, 0x4d, 0xc8, 0x9a, 0xe7, 0xfc, 0xc6, 0x79, 0xe2, 0xac, 0x79, 0x9d,
+       0x4b, 0xc7, 0xca, 0x55, 0x23, 0xc5, 0xb5, 0xb2, 0xad, 0x5f, 0x3a, 0x76,
+       0x02, 0x34, 0x16, 0x91, 0x1b, 0xa8, 0x72, 0xed, 0x4b, 0xc7, 0xa6, 0xab,
+       0xfe, 0x7d, 0x96, 0xcf, 0x03, 0xe2, 0x60, 0xb6, 0x9d, 0xd4, 0x05, 0xff,
+       0x5e, 0x4b, 0x48, 0x5c, 0xc6, 0x63, 0x7c, 0x0d, 0x78, 0x7c, 0x6e, 0x19,
+       0xe0, 0xf2, 0xd9, 0x31, 0x0f, 0x97, 0x8e, 0x95, 0x6a, 0xcd, 0x3c, 0x30,
+       0x1d, 0xa6, 0x1b, 0xee, 0x87, 0xf7, 0x92, 0x20, 0xb1, 0xec, 0x79, 0xc5,
+       0x91, 0xfe, 0x20, 0xef, 0x3a, 0x81, 0xfc, 0x4e, 0x93, 0x7a, 0xee, 0x8f,
+       0xff, 0x4c, 0xc6, 0xa9, 0xb4, 0xe0, 0x79, 0x7e, 0xe2, 0x5d, 0xf6, 0x3b,
+       0x98, 0xc3, 0x78, 0x31, 0x84, 0x15, 0x01, 0x6c, 0x47, 0x93, 0x3c, 0x5b,
+       0x82, 0xf5, 0x98, 0x27, 0xde, 0xe7, 0xcf, 0xb1, 0x7f, 0x79, 0x07, 0xc7,
+       0xf9, 0x18, 0xd6, 0xc5, 0x59, 0xba, 0xff, 0x5b, 0xd9, 0x37, 0xef, 0x89,
+       0x65, 0xaa, 0x01, 0x87, 0xe1, 0x99, 0x46, 0x88, 0x83, 0x17, 0xe7, 0x7d,
+       0x3c, 0xb1, 0x71, 0xff, 0xf7, 0x49, 0xeb, 0x36, 0xf3, 0x1a, 0xae, 0x1f,
+       0xd2, 0xc9, 0xf8, 0xe7, 0xb6, 0x81, 0x2f, 0xff, 0x4f, 0x31, 0x3c, 0xa1,
+       0x8b, 0x1f, 0xb9, 0x47, 0xcd, 0x34, 0xd5, 0xa1, 0xe1, 0xfd, 0x05, 0xdf,
+       0x07, 0x70, 0x7d, 0xcf, 0xdf, 0x1a, 0x9a, 0x6b, 0xc5, 0x67, 0x83, 0x58,
+       0xd6, 0x47, 0xb6, 0xc6, 0x75, 0xc3, 0x85, 0x60, 0xbc, 0x0b, 0xb1, 0x8d,
+       0xc7, 0x0d, 0xc8, 0x17, 0xba, 0x6c, 0xb5, 0x07, 0x75, 0x4b, 0xc2, 0xff,
+       0x26, 0x94, 0x61, 0x3b, 0xe2, 0xba, 0xaf, 0x2d, 0x98, 0x0b, 0xed, 0x88,
+       0xfd, 0xb0, 0x16, 0xcc, 0xb1, 0xbf, 0x15, 0xa8, 0x5d, 0xb8, 0x0f, 0x3a,
+       0x8b, 0xcd, 0xb6, 0x14, 0x3e, 0x13, 0x74, 0x6e, 0x3e, 0xf4, 0x5b, 0xf0,
+       0x29, 0x83, 0x5a, 0xe0, 0xfb, 0xe3, 0xf0, 0x7d, 0x9d, 0x74, 0x00, 0x3e,
+       0xeb, 0x20, 0x7c, 0xd6, 0x21, 0xd4, 0x8b, 0x63, 0x4b, 0xcd, 0xf7, 0xbc,
+       0x5c, 0xa3, 0x76, 0x2a, 0x47, 0xe4, 0xf9, 0x97, 0x3c, 0xd5, 0xfc, 0x10,
+       0x3a, 0xc0, 0x75, 0x57, 0xa8, 0x13, 0xf0, 0xb7, 0x56, 0x02, 0x3a, 0xb1,
+       0xfd, 0x3e, 0x39, 0x03, 0xdb, 0x68, 0xb7, 0x85, 0xcc, 0xe5, 0x7c, 0xd9,
+       0x97, 0x6b, 0xbe, 0xec, 0xe1, 0x97, 0x41, 0x5f, 0xa3, 0x52, 0x5d, 0xa7,
+       0x12, 0xd6, 0x2d, 0x61, 0xdd, 0x12, 0xea, 0xbc, 0xe9, 0x7a, 0xf3, 0x77,
+       0xaf, 0x8e, 0x80, 0x77, 0xc6, 0x0d, 0xfb, 0x7a, 0xd3, 0xfe, 0xc3, 0xe7,
+       0x49, 0xc8, 0xff, 0x11, 0xc8, 0xff, 0x28, 0xea, 0x9b, 0xdf, 0x47, 0x7d,
+       0xf3, 0x7b, 0xa8, 0x6f, 0x8e, 0xa0, 0xbe, 0x99, 0x44, 0x7d, 0xf3, 0x65,
+       0xf8, 0x8f, 0xfb, 0xe0, 0x3f, 0x26, 0xe0, 0x3f, 0xc6, 0xe5, 0xdd, 0xd3,
+       0x61, 0x77, 0xfb, 0x9d, 0x4a, 0xb8, 0x16, 0xb7, 0x9f, 0x12, 0x99, 0x25,
+       0xec, 0x69, 0x8c, 0x6a, 0x0d, 0xae, 0x6f, 0x2c, 0x72, 0x46, 0xb9, 0xbe,
+       0x99, 0x50, 0x26, 0x91, 0xbf, 0xdf, 0x3f, 0xcc, 0x75, 0x4f, 0x42, 0xc9,
+       0xcb, 0xba, 0xc7, 0xb8, 0xe0, 0x20, 0x75, 0x43, 0xee, 0x87, 0x3d, 0x1b,
+       0xe7, 0xf2, 0xe0, 0xc5, 0xcf, 0xf9, 0xba, 0x03, 0xbf, 0x17, 0xa7, 0xc5,
+       0x59, 0xd4, 0x0c, 0xee, 0x3f, 0x28, 0x45, 0xe9, 0x1b, 0x75, 0x8c, 0x51,
+       0x2b, 0xbb, 0xaf, 0x06, 0xe3, 0x11, 0x9a, 0x9a, 0x47, 0x6d, 0x7b, 0xfa,
+       0x6f, 0x95, 0xbc, 0x1c, 0x5b, 0x18, 0x23, 0xdf, 0x3d, 0xfd, 0xd7, 0xc1,
+       0xb8, 0x14, 0xe8, 0x43, 0xc0, 0xab, 0x6e, 0xe1, 0xd9, 0x15, 0xe4, 0x1c,
+       0x2f, 0xf6, 0x6c, 0xfd, 0x3f, 0xef, 0xb8, 0xb5, 0x28, 0x64, 0x1e, 0xdf,
+       0xe5, 0xd7, 0x67, 0xcd, 0xf3, 0x9d, 0x4d, 0xf3, 0xba, 0xfc, 0x0e, 0x5b,
+       0xac, 0xb4, 0xbd, 0x07, 0x0f, 0x4c, 0x4b, 0x83, 0x46, 0xd5, 0xa6, 0x0f,
+       0x3d, 0xfe, 0x5e, 0xe8, 0x88, 0x76, 0xf9, 0x0d, 0xcf, 0x91, 0xf7, 0x7a,
+       0xb0, 0xf3, 0x91, 0x27, 0x77, 0xf9, 0xbe, 0x80, 0xfb, 0x49, 0xc5, 0xf7,
+       0xef, 0x8f, 0x83, 0x0e, 0x64, 0xed, 0x36, 0xd7, 0x70, 0x7a, 0x70, 0x97,
+       0xa2, 0x1f, 0x9f, 0xe1, 0xb3, 0x96, 0xb4, 0xb9, 0xd6, 0xe3, 0xba, 0x2f,
+       0x8c, 0x01, 0x21, 0xad, 0xff, 0x48, 0xfa, 0x7c, 0xdf, 0x87, 0x9a, 0x8e,
+       0x61, 0xc2, 0x71, 0x73, 0xfd, 0x17, 0x0f, 0xee, 0xe1, 0x98, 0xd7, 0x58,
+       0xc0, 0xab, 0x16, 0xd0, 0xfb, 0x77, 0xcf, 0xf7, 0x3d, 0x8c, 0xaf, 0x37,
+       0xe1, 0x5f, 0x40, 0xae, 0xc7, 0x77, 0x26, 0xbb, 0xe5, 0x77, 0xc9, 0x77,
+       0x66, 0x3b, 0xe8, 0xed, 0x53, 0xc8, 0x59, 0x2d, 0x23, 0x73, 0x09, 0xb5,
+       0xc7, 0x32, 0xdb, 0xc9, 0x08, 0xf3, 0x39, 0x90, 0x9e, 0xa6, 0x9b, 0x7b,
+       0xfc, 0x5c, 0xfc, 0xab, 0xca, 0x47, 0xf9, 0x16, 0xc1, 0x3a, 0x3f, 0x6a,
+       0x5a, 0x27, 0xdd, 0xb4, 0xce, 0x0a, 0xdb, 0x6c, 0xed, 0x4b, 0xd8, 0x73,
+       0x69, 0xf7, 0xcd, 0x7a, 0x32, 0xa8, 0xcb, 0x1e, 0x1e, 0x69, 0xa3, 0x6a,
+       0xaf, 0xb1, 0xf2, 0x1a, 0xf2, 0xf5, 0xe2, 0x08, 0xe6, 0x92, 0x03, 0x78,
+       0xc7, 0xf3, 0x46, 0x8d, 0x84, 0xb1, 0x52, 0xa3, 0xcf, 0x01, 0xdf, 0x28,
+       0x11, 0xf1, 0x3c, 0xf7, 0x25, 0x6f, 0xb5, 0xc0, 0x07, 0xa4, 0xd6, 0xb0,
+       0xe7, 0x49, 0xd4, 0x5f, 0x47, 0x37, 0xea, 0x61, 0x5e, 0xe7, 0x56, 0x65,
+       0x4d, 0xe6, 0xc6, 0xfb, 0x95, 0x52, 0xd2, 0xdf, 0xe3, 0xef, 0xc2, 0x5f,
+       0xa8, 0x82, 0x71, 0xdf, 0x01, 0x6d, 0x85, 0x16, 0x4e, 0xa9, 0xf2, 0x0e,
+       0xb6, 0x38, 0xc2, 0x67, 0xcd, 0xcf, 0x8f, 0x93, 0x5d, 0xb8, 0xa7, 0x3f,
+       0x0d, 0xf6, 0x34, 0x16, 0xd4, 0xd3, 0xe1, 0x9e, 0x62, 0xf4, 0xe6, 0xac,
+       0x0e, 0xdc, 0x9b, 0x20, 0x8f, 0x02, 0x2d, 0x35, 0xd2, 0x9f, 0x42, 0xa7,
+       0xd2, 0x24, 0x1b, 0x6d, 0xdb, 0x19, 0x96, 0x36, 0x6b, 0xf8, 0xf1, 0x14,
+       0xec, 0xf0, 0x78, 0x4f, 0x78, 0x37, 0xac, 0x9a, 0x1e, 0xd7, 0x3d, 0x68,
+       0x3c, 0xdf, 0x0f, 0x5b, 0x4c, 0xc3, 0x3e, 0x39, 0x67, 0x2a, 0x70, 0xad,
+       0xc2, 0xf6, 0xa4, 0x3b, 0xaa, 0xa1, 0x4f, 0x50, 0x06, 0xf5, 0x0e, 0xef,
+       0x3f, 0x47, 0x8b, 0x8d, 0x90, 0x87, 0x2c, 0xec, 0x71, 0x14, 0xbf, 0x61,
+       0xbc, 0xb3, 0xf0, 0xe3, 0x5a, 0x69, 0x85, 0x1e, 0x95, 0xb9, 0x38, 0x72,
+       0xed, 0x41, 0xe6, 0xef, 0x4e, 0xc0, 0xb3, 0x3e, 0xb3, 0x9e, 0xde, 0x49,
+       0x4e, 0x2f, 0xfb, 0x8a, 0x14, 0x68, 0x03, 0xc7, 0x5d, 0x87, 0xad, 0xf7,
+       0xe3, 0x69, 0xe8, 0x45, 0x96, 0xad, 0xa4, 0xef, 0x79, 0x6a, 0x96, 0xbf,
+       0x51, 0x5c, 0x08, 0xc6, 0x03, 0xfa, 0x3d, 0xac, 0x7b, 0xa9, 0x1b, 0x68,
+       0x65, 0x3e, 0x8c, 0x83, 0x67, 0x60, 0x83, 0x7c, 0x67, 0x3b, 0x06, 0xb9,
+       0xf0, 0x58, 0x09, 0xe2, 0x21, 0xe6, 0x17, 0x91, 0x94, 0xb4, 0xe7, 0x68,
+       0x19, 0xf5, 0x3f, 0xf5, 0xf2, 0x13, 0xf9, 0xae, 0xbb, 0x33, 0xd0, 0xf7,
+       0xad, 0xf8, 0xaa, 0xc9, 0xfd, 0x31, 0xf0, 0xa7, 0x35, 0xe1, 0x33, 0x8e,
+       0x5f, 0x9f, 0xac, 0x11, 0xe2, 0x71, 0xca, 0xfb, 0x82, 0xc8, 0x3d, 0x4d,
+       0xbf, 0x23, 0xf7, 0x54, 0xa7, 0x23, 0xf3, 0xa8, 0x6d, 0xb3, 0x03, 0x99,
+       0x45, 0x32, 0x32, 0x27, 0x68, 0x48, 0x3f, 0x40, 0xaa, 0xfc, 0xd6, 0x97,
+       0x16, 0xde, 0x17, 0x5a, 0x72, 0x9e, 0x77, 0x06, 0xbc, 0xbf, 0x28, 0xd7,
+       0x79, 0x1a, 0xfc, 0x43, 0x56, 0xb2, 0x26, 0x61, 0x5e, 0xf1, 0x4c, 0x32,
+       0xbf, 0x15, 0x3a, 0xd2, 0xf8, 0x61, 0x70, 0x36, 0x8f, 0x90, 0xe3, 0xbe,
+       0xa5, 0x3a, 0x66, 0x05, 0xb0, 0xdf, 0x09, 0x78, 0xcb, 0x81, 0x5f, 0xac,
+       0xdf, 0x58, 0x4f, 0xb2, 0x6f, 0xe0, 0x33, 0x77, 0x90, 0x35, 0x3a, 0x23,
+       0xc8, 0xa3, 0x92, 0xd7, 0xf2, 0x03, 0x09, 0xda, 0xea, 0x07, 0x18, 0x2f,
+       0xf1, 0x31, 0xba, 0xc2, 0x7c, 0x94, 0xa4, 0xff, 0x94, 0x71, 0x4b, 0xd2,
+       0x53, 0xb7, 0xf9, 0x82, 0x6f, 0xc9, 0xe7, 0xaa, 0xca, 0xbe, 0x89, 0xe3,
+       0x1f, 0xeb, 0x70, 0x27, 0xfc, 0x1f, 0x74, 0x10, 0x76, 0x9c, 0x9f, 0xe7,
+       0xfb, 0x89, 0x41, 0xbe, 0x57, 0x3a, 0x57, 0xc0, 0xd9, 0x2e, 0xf0, 0xf7,
+       0xc7, 0xa4, 0x5f, 0x63, 0xfa, 0xf5, 0x57, 0x9a, 0x7d, 0x21, 0xda, 0x92,
+       0xf4, 0x93, 0x05, 0xf9, 0xbd, 0x31, 0x01, 0x18, 0x8f, 0x7d, 0x67, 0xd3,
+       0xdf, 0x58, 0xbc, 0x6c, 0xfb, 0x7f, 0x63, 0x11, 0x7c, 0xfb, 0xad, 0xf9,
+       0x79, 0xc4, 0x83, 0x75, 0x8d, 0x26, 0xeb, 0xe1, 0xdf, 0x5c, 0xf0, 0x39,
+       0xc0, 0x37, 0xd7, 0xc3, 0xdc, 0xc1, 0x93, 0xf1, 0xa5, 0xbc, 0xe5, 0x2c,
+       0x97, 0x82, 0x9c, 0x88, 0x6b, 0x00, 0x96, 0x21, 0xc6, 0x8b, 0xfe, 0xf9,
+       0x2d, 0x88, 0x3d, 0x38, 0x3f, 0xc8, 0x1c, 0x7c, 0xbd, 0x39, 0xeb, 0xd7,
+       0xb9, 0x65, 0xf6, 0x8b, 0xfd, 0x61, 0xdd, 0xbb, 0x9b, 0xca, 0x13, 0xfc,
+       0x3e, 0x46, 0x6f, 0xcc, 0xc6, 0xe4, 0xfb, 0x22, 0xc5, 0x82, 0xf7, 0x3c,
+       0x4e, 0x50, 0x51, 0xbe, 0xaf, 0x05, 0xf4, 0x50, 0xa7, 0xdd, 0x17, 0x8e,
+       0x35, 0xe5, 0x48, 0xc3, 0xc7, 0x9b, 0x6a, 0xd4, 0xe8, 0xd1, 0xc6, 0x2a,
+       0xf6, 0xaf, 0x50, 0x7e, 0xbc, 0x44, 0x37, 0x98, 0xba, 0x8c, 0xfb, 0x4e,
+       0x82, 0x75, 0x8c, 0xf5, 0x6b, 0x4c, 0xd6, 0x9d, 0x25, 0xe4, 0x0b, 0xc5,
+       0x11, 0xfe, 0xc6, 0xf3, 0xde, 0x5d, 0xc5, 0x8a, 0xa1, 0xdb, 0xf4, 0x81,
+       0xe7, 0x68, 0x3c, 0x26, 0x21, 0x72, 0xab, 0x77, 0x3d, 0x58, 0xbf, 0x78,
+       0x97, 0xbf, 0x57, 0xbc, 0xaf, 0x33, 0xac, 0x2a, 0xbf, 0xcd, 0xfe, 0xe4,
+       0x76, 0x8d, 0xd6, 0x6e, 0xf7, 0xbc, 0xfb, 0x2d, 0x9d, 0x9c, 0xa0, 0x76,
+       0xf5, 0xbf, 0xb9, 0xb7, 0xcb, 0x1c, 0xc4, 0x19, 0x49, 0x2b, 0x05, 0xd8,
+       0xeb, 0xb2, 0x8b, 0x3a, 0x47, 0x18, 0xa3, 0xab, 0x42, 0x47, 0xcc, 0xe5,
+       0x3b, 0x80, 0x3b, 0x7a, 0xf8, 0x7b, 0xf3, 0x8c, 0xc5, 0x30, 0x7d, 0xfe,
+       0x5d, 0xd7, 0x2d, 0xf7, 0x49, 0x3f, 0x4b, 0x14, 0xc4, 0x9e, 0x5b, 0x9a,
+       0x6d, 0xa2, 0x39, 0xb7, 0x64, 0x5b, 0xa0, 0x49, 0x0d, 0xbc, 0x94, 0x2b,
+       0x61, 0x9e, 0xc6, 0x7f, 0x4b, 0xb0, 0x7a, 0xd7, 0x37, 0xc0, 0xe7, 0x34,
+       0xf8, 0xe4, 0x7d, 0x4c, 0xd7, 0x43, 0x9d, 0x0b, 0x6b, 0x05, 0xee, 0x23,
+       0xe6, 0xbb, 0x88, 0xf9, 0x2e, 0x62, 0xbe, 0x8b, 0x98, 0xef, 0x22, 0xe6,
+       0xbb, 0x88, 0xf9, 0x2e, 0x62, 0xbe, 0x8b, 0x98, 0xef, 0x8e, 0x07, 0x79,
+       0xda, 0x63, 0x1b, 0x79, 0xda, 0x4a, 0x83, 0xbf, 0x43, 0x49, 0x5e, 0x4a,
+       0x25, 0xf2, 0xf3, 0x5c, 0x12, 0x9c, 0xd3, 0x84, 0x79, 0xee, 0xc7, 0x7f,
+       0x13, 0xf1, 0xf1, 0x38, 0xc7, 0x63, 0xbc, 0x92, 0x22, 0x4c, 0xc6, 0xf3,
+       0xf3, 0x3c, 0xae, 0xad, 0xb6, 0xe2, 0x20, 0x5f, 0xcb, 0xb1, 0x3f, 0x63,
+       0xbb, 0x48, 0xfa, 0xf5, 0x62, 0xee, 0xf5, 0x2f, 0xa1, 0x76, 0x3c, 0x5e,
+       0xac, 0xcb, 0x18, 0x8c, 0xf1, 0x7b, 0x18, 0x6b, 0xac, 0x73, 0xfc, 0xee,
+       0x5e, 0xae, 0x27, 0x8a, 0xf5, 0x14, 0x95, 0x16, 0xc3, 0xfc, 0x07, 0x78,
+       0xee, 0x90, 0x52, 0xa8, 0xf2, 0xd9, 0x0a, 0x9a, 0x4e, 0x42, 0x28, 0x66,
+       0x73, 0x5e, 0x77, 0x49, 0xd6, 0x48, 0xfe, 0xdf, 0x05, 0x0d, 0x83, 0xb7,
+       0xf0, 0x1e, 0x97, 0x48, 0x9d, 0x4d, 0xca, 0xbf, 0x31, 0x48, 0x98, 0x83,
+       0xf2, 0x6f, 0x1d, 0xba, 0xb1, 0x8e, 0x98, 0xdd, 0x13, 0xfe, 0xed, 0x06,
+       0xd7, 0x5d, 0xf6, 0xe6, 0xfd, 0x2b, 0xef, 0x23, 0x09, 0x7b, 0xbd, 0xa7,
+       0x0f, 0x7b, 0xc3, 0xb9, 0x5e, 0xd9, 0x25, 0xf3, 0x6e, 0xf8, 0xce, 0x33,
+       0x83, 0x37, 0xf5, 0x52, 0xe7, 0x6e, 0x5a, 0x1e, 0xe4, 0x1a, 0xad, 0x0d,
+       0xf4, 0x18, 0xd6, 0xc8, 0xd8, 0x62, 0x37, 0x9d, 0x9d, 0x87, 0x6f, 0x9d,
+       0x37, 0x2c, 0xfe, 0xfb, 0x82, 0x85, 0xc1, 0x24, 0x7c, 0xf2, 0x78, 0x2f,
+       0xc7, 0xe4, 0xc5, 0x06, 0xeb, 0x4a, 0x37, 0xf0, 0xfb, 0xa1, 0x8b, 0x3b,
+       0x60, 0x43, 0x02, 0xeb, 0x87, 0xb4, 0xff, 0x53, 0xd2, 0xee, 0x36, 0xf3,
+       0x7d, 0x52, 0x37, 0x84, 0xa1, 0xa7, 0x05, 0x78, 0xff, 0x48, 0x6d, 0x69,
+       0x11, 0x7f, 0x2f, 0x9c, 0x76, 0x9b, 0xbf, 0x1b, 0x0e, 0x29, 0xc5, 0x2a,
+       0xff, 0x8d, 0xc3, 0x20, 0xfd, 0x4f, 0xe1, 0x56, 0x17, 0xd3, 0xd6, 0x79,
+       0x86, 0xdf, 0xcf, 0xe6, 0x2f, 0xc4, 0x81, 0x13, 0xe2, 0x80, 0x41, 0x54,
+       0xf3, 0x31, 0x07, 0xe2, 0xca, 0x44, 0x3d, 0x20, 0x32, 0x59, 0x15, 0x52,
+       0x2d, 0xdb, 0x50, 0xb7, 0x5d, 0x36, 0x77, 0xcb, 0xa6, 0x4c, 0xda, 0x22,
+       0x06, 0x49, 0x9b, 0x6a, 0xd2, 0x2e, 0x76, 0x31, 0xed, 0x2e, 0x96, 0x81,
+       0x34, 0xcd, 0xec, 0x1a, 0x56, 0x32, 0xa4, 0x5d, 0x4c, 0xae, 0x31, 0x04,
+       0x88, 0x53, 0xab, 0x5b, 0x2f, 0x32, 0x4d, 0x53, 0x90, 0x57, 0x25, 0xdd,
+       0x4d, 0x6f, 0x76, 0x3f, 0x55, 0x64, 0xad, 0x72, 0xd1, 0x25, 0x6a, 0xa7,
+       0x6a, 0x7f, 0x17, 0x67, 0xcf, 0xf3, 0x9d, 0x63, 0x20, 0x6c, 0xd5, 0x90,
+       0xac, 0xf3, 0x9d, 0xef, 0x7c, 0xff, 0xdf, 0xfb, 0x3e, 0xef, 0x2f, 0x53,
+       0xa0, 0x2f, 0xc3, 0x8a, 0xa9, 0x4b, 0x65, 0xb6, 0xb1, 0x50, 0xa6, 0x1d,
+       0x7e, 0x13, 0xbc, 0xdc, 0x23, 0x8b, 0xa0, 0xe3, 0xfc, 0x68, 0xab, 0xe7,
+       0x6f, 0xed, 0xf4, 0x78, 0x38, 0xd2, 0xeb, 0xc9, 0x28, 0xad, 0x4b, 0xe6,
+       0xb5, 0x3e, 0xdd, 0x7d, 0xe8, 0xdb, 0x0f, 0xb0, 0xa6, 0x10, 0xce, 0x61,
+       0xb8, 0x57, 0xe3, 0x91, 0x8f, 0xef, 0x7d, 0x87, 0xde, 0x7b, 0x0f, 0xbd,
+       0x9f, 0xfc, 0x1f, 0xed, 0x59, 0x3e, 0x4c, 0x0f, 0x5c, 0xa7, 0x19, 0xe7,
+       0x2c, 0xf9, 0xc2, 0x84, 0x9a, 0x2b, 0x98, 0x09, 0xea, 0x02, 0x29, 0x71,
+       0x54, 0xca, 0x6e, 0x03, 0xc6, 0xb5, 0xc9, 0xc2, 0x0a, 0x68, 0x1e, 0xfb,
+       0x68, 0xb7, 0x18, 0x2f, 0x7f, 0xb6, 0x97, 0x3c, 0xd3, 0x81, 0x6b, 0xf0,
+       0x59, 0x43, 0x21, 0xb4, 0x73, 0x5e, 0xb3, 0x63, 0xc6, 0x45, 0xed, 0xbf,
+       0xa1, 0x0e, 0xe3, 0xa8, 0xbc, 0xce, 0xfd, 0x60, 0x9b, 0x16, 0x79, 0x60,
+       0x25, 0x7b, 0xbc, 0x5c, 0x22, 0xd8, 0xbb, 0x2f, 0xf6, 0x52, 0xbf, 0x78,
+       0xd5, 0xde, 0xab, 0x33, 0x76, 0x85, 0x79, 0x5a, 0x20, 0x9a, 0x97, 0x45,
+       0xca, 0x55, 0x91, 0x9b, 0xf8, 0xfd, 0xb1, 0xea, 0xc5, 0x2f, 0x14, 0x6d,
+       0xed, 0x49, 0xd9, 0x2e, 0x3d, 0x2b, 0x35, 0xc8, 0x9c, 0x2d, 0xdb, 0x71,
+       0x1e, 0xda, 0x61, 0x7d, 0xe6, 0xaf, 0x17, 0x94, 0x44, 0xc6, 0x28, 0xd3,
+       0xda, 0xe4, 0x67, 0x2b, 0xcc, 0xbb, 0x33, 0x8d, 0x87, 0xc2, 0xfc, 0xb7,
+       0x90, 0x64, 0x82, 0x7e, 0xad, 0x97, 0xca, 0xb7, 0x45, 0x3e, 0xc1, 0xb7,
+       0x4f, 0x56, 0x5e, 0xe9, 0xa5, 0xcf, 0xe5, 0xe3, 0x15, 0xbe, 0xfb, 0xf0,
+       0xf4, 0x49, 0xc3, 0xf2, 0x43, 0x7f, 0x05, 0xf0, 0x18, 0x3c, 0x77, 0xee,
+       0xf7, 0x47, 0x5c, 0x1b, 0xea, 0x68, 0xc3, 0xb6, 0x49, 0x7e, 0x18, 0x38,
+       0xa8, 0x86, 0x74, 0xbe, 0x52, 0x23, 0xa8, 0x71, 0xd9, 0x5f, 0x61, 0x5e,
+       0x9d, 0x71, 0x54, 0x63, 0x74, 0xf2, 0xf6, 0x82, 0xde, 0x0b, 0xca, 0xb9,
+       0x8a, 0x4d, 0x5a, 0x35, 0x64, 0x0b, 0xbc, 0xb6, 0x59, 0xdf, 0xea, 0xe3,
+       0x5d, 0x6d, 0xd7, 0x17, 0x7b, 0x5d, 0x1b, 0x8d, 0x75, 0xaf, 0xf7, 0xba,
+       0x75, 0x61, 0xcf, 0xe6, 0xa2, 0x6d, 0x56, 0xc6, 0xde, 0x7e, 0x2c, 0xf5,
+       0xd5, 0x9f, 0xca, 0x9d, 0xd2, 0x4f, 0xe4, 0xb7, 0xab, 0xe7, 0xa1, 0x73,
+       0x98, 0xe5, 0x1c, 0xe4, 0xc9, 0xbb, 0x75, 0xc7, 0x79, 0xd7, 0x3e, 0x07,
+       0xfb, 0xc0, 0x71, 0xfe, 0x64, 0xef, 0x48, 0x64, 0xfc, 0x7b, 0xd8, 0x73,
+       0x16, 0x3c, 0x44, 0x2c, 0xcc, 0x80, 0xde, 0x52, 0x7d, 0xd2, 0x19, 0xd0,
+       0x74, 0x32, 0x34, 0xde, 0x8a, 0x3d, 0xf8, 0x3c, 0x3d, 0x9c, 0x7b, 0x49,
+       0xf7, 0x91, 0x66, 0x7c, 0xf5, 0x0a, 0xe6, 0x6f, 0x05, 0x5f, 0x1c, 0xc5,
+       0x4f, 0xc9, 0xc3, 0x31, 0xac, 0x75, 0x8c, 0xb4, 0xd7, 0x2a, 0x91, 0x67,
+       0xb0, 0x8f, 0x6c, 0x8b, 0x3c, 0x2a, 0xdc, 0xea, 0xa5, 0x3f, 0xef, 0x51,
+       0x81, 0x65, 0xdf, 0x57, 0xbb, 0xc4, 0x91, 0x16, 0xc8, 0xef, 0x85, 0x09,
+       0x57, 0x57, 0xfa, 0x83, 0x3a, 0x85, 0xf6, 0x56, 0xee, 0x7d, 0x45, 0xdd,
+       0x2e, 0xe7, 0xb4, 0x42, 0x17, 0x9f, 0x82, 0x0e, 0x94, 0xac, 0x5f, 0x91,
+       0xc6, 0x58, 0x00, 0x6d, 0xa8, 0xa3, 0x68, 0x2c, 0x91, 0x54, 0x81, 0xf9,
+       0x5d, 0xcc, 0xb5, 0xc2, 0x1a, 0xcf, 0x11, 0x37, 0xb8, 0xc6, 0x36, 0xc6,
+       0xe0, 0xbc, 0x3a, 0x0b, 0x34, 0xc2, 0x3a, 0xd2, 0x77, 0x02, 0x3c, 0x99,
+       0xa0, 0xdc, 0xc4, 0x78, 0xa3, 0x18, 0x8f, 0xe5, 0x2e, 0x8c, 0x77, 0x45,
+       0x92, 0x76, 0x73, 0xcc, 0x38, 0xda, 0x10, 0x67, 0xe2, 0xd0, 0x1f, 0x06,
+       0x55, 0x7a, 0x25, 0x08, 0xf9, 0xdd, 0x2b, 0x69, 0xe3, 0xc8, 0x81, 0x3d,
+       0xe6, 0xb4, 0x7d, 0xe0, 0xf3, 0x8d, 0x7a, 0x6b, 0xea, 0x3a, 0xb0, 0x26,
+       0xf6, 0xc7, 0x0f, 0xb6, 0x71, 0x72, 0x65, 0x09, 0x38, 0xb5, 0xf4, 0x41,
+       0xd2, 0xbe, 0x20, 0xa9, 0x20, 0xd7, 0xc4, 0xfa, 0x20, 0xd6, 0x4c, 0x3f,
+       0xd6, 0x77, 0x81, 0x43, 0x47, 0xbc, 0x3a, 0xb6, 0x15, 0x5f, 0x12, 0x67,
+       0xef, 0xda, 0xb5, 0xac, 0xfb, 0x8a, 0x24, 0x97, 0xb2, 0x32, 0xad, 0xfb,
+       0xf1, 0x0c, 0x07, 0xb4, 0xee, 0x41, 0x5e, 0x8d, 0x9c, 0xc0, 0x59, 0xc6,
+       0xf6, 0x6d, 0xe0, 0xf0, 0x09, 0x72, 0x91, 0xd1, 0xe7, 0xf2, 0x2c, 0xbe,
+       0x9d, 0xe0, 0x1d, 0xb5, 0x49, 0xe4, 0x5b, 0x90, 0x91, 0x85, 0x66, 0x7d,
+       0x40, 0x3e, 0x2d, 0xf4, 0xf4, 0x31, 0xce, 0xf2, 0xd7, 0x82, 0x21, 0x1f,
+       0x17, 0x74, 0x2c, 0x74, 0xc6, 0x2f, 0xe6, 0x65, 0xd7, 0x3e, 0x1f, 0x9e,
+       0x59, 0x50, 0xfc, 0x3e, 0x7c, 0x79, 0x5d, 0x75, 0xa0, 0x6d, 0x00, 0xed,
+       0xb8, 0x0e, 0x43, 0xa6, 0x0a, 0x9f, 0x3b, 0xb3, 0x23, 0x8e, 0x33, 0xad,
+       0xf3, 0xc3, 0x62, 0xc6, 0x82, 0x6a, 0xea, 0xe4, 0x51, 0x29, 0x04, 0xdb,
+       0x31, 0x57, 0xcc, 0x58, 0x57, 0xc3, 0x58, 0x0f, 0xcb, 0x27, 0xc8, 0x13,
+       0xa1, 0x1d, 0xe1, 0xf8, 0x66, 0x66, 0x4d, 0xc5, 0xc2, 0x43, 0xca, 0x4c,
+       0xe4, 0xf1, 0x6b, 0x51, 0x3a, 0x8e, 0x18, 0x0a, 0x2b, 0xf0, 0x2e, 0xf6,
+       0x64, 0x9d, 0x76, 0x9c, 0x8c, 0xc5, 0xfa, 0x98, 0x11, 0x50, 0xf4, 0xb7,
+       0x74, 0xea, 0x78, 0xe3, 0xb5, 0x93, 0x31, 0xe3, 0xb4, 0x3a, 0xee, 0xbd,
+       0xc7, 0x81, 0x99, 0x7b, 0xe3, 0x9d, 0x5f, 0x53, 0x86, 0xbc, 0x51, 0x88,
+       0x85, 0xe7, 0x94, 0x99, 0xc5, 0x98, 0xd9, 0xb4, 0x22, 0x6e, 0xc4, 0x8c,
+       0x4e, 0x45, 0x9f, 0x68, 0xbb, 0xde, 0x77, 0x06, 0xfd, 0x63, 0xaa, 0xc5,
+       0x5b, 0x0f, 0xef, 0xeb, 0xed, 0x3e, 0x97, 0x67, 0x88, 0x39, 0x23, 0xc0,
+       0x4c, 0xe6, 0x9a, 0xe9, 0xdc, 0x86, 0x44, 0x64, 0x7c, 0x44, 0x63, 0xe8,
+       0xe3, 0x33, 0x7f, 0x47, 0x1d, 0xca, 0x65, 0xd6, 0x45, 0x3d, 0x7e, 0x1b,
+       0xd1, 0x3a, 0xf3, 0xe3, 0x33, 0x39, 0x9d, 0xf7, 0xd8, 0x50, 0x11, 0x6f,
+       0xdf, 0x7b, 0x77, 0x16, 0x4e, 0xda, 0x4f, 0x71, 0x9c, 0x25, 0xff, 0x64,
+       0xbb, 0x30, 0xa7, 0x74, 0xaa, 0xd4, 0xa4, 0x0d, 0xfa, 0x03, 0x98, 0x2f,
+       0xd0, 0x8c, 0x7b, 0x5f, 0x11, 0xdf, 0x78, 0xc7, 0x01, 0x3a, 0x81, 0xae,
+       0x09, 0x1d, 0xb5, 0x8a, 0x71, 0xf2, 0x2b, 0x92, 0x73, 0xfb, 0x4b, 0x07,
+       0x73, 0x58, 0xf3, 0xd5, 0x2f, 0x1b, 0x83, 0x73, 0x63, 0x0e, 0xbc, 0x3f,
+       0x3e, 0x43, 0xfa, 0xe4, 0xd9, 0x84, 0xd5, 0xd4, 0x2a, 0xd7, 0x33, 0x20,
+       0xd3, 0x2b, 0x83, 0x32, 0x87, 0xdf, 0xc2, 0x8a, 0x7b, 0x6f, 0x1b, 0xd0,
+       0xad, 0xa7, 0x0b, 0x86, 0xe6, 0xd7, 0x39, 0x9b, 0x31, 0x13, 0xf0, 0x8a,
+       0xce, 0xa9, 0x62, 0x5f, 0xc6, 0x89, 0x06, 0x29, 0x1f, 0xed, 0x06, 0xe4,
+       0xea, 0x46, 0x9d, 0x7a, 0x2a, 0xeb, 0xcd, 0x78, 0xd8, 0xdf, 0x2d, 0x0b,
+       0xc0, 0xbb, 0x0a, 0x64, 0x67, 0xfe, 0xcd, 0x80, 0xcc, 0x15, 0x74, 0x3c,
+       0x39, 0xfc, 0x17, 0x65, 0x4b, 0xad, 0x3e, 0x21, 0xb7, 0xeb, 0x51, 0xfd,
+       0x8d, 0x72, 0x2d, 0xff, 0x0b, 0x9f, 0xbc, 0x32, 0xa2, 0xf3, 0xea, 0xa2,
+       0x15, 0x79, 0xaa, 0x9f, 0x3a, 0xcf, 0xba, 0xce, 0xb1, 0x03, 0x76, 0x40,
+       0xe7, 0x78, 0x0f, 0x3a, 0xc7, 0x6f, 0xa0, 0x73, 0xfc, 0xba, 0x04, 0x7c,
+       0x29, 0x65, 0x3c, 0xfc, 0x9f, 0x01, 0x0e, 0x51, 0x56, 0x9b, 0xe7, 0x71,
+       0xa7, 0x33, 0x39, 0xd0, 0xe0, 0x47, 0x92, 0x01, 0xde, 0x26, 0x65, 0x73,
+       0x75, 0x5a, 0xb6, 0x56, 0xdd, 0x3c, 0xe5, 0xfb, 0xcc, 0x01, 0x1b, 0xe3,
+       0x3d, 0x45, 0x81, 0x43, 0x47, 0x24, 0x72, 0x9a, 0xf8, 0xd1, 0x21, 0x6b,
+       0xc5, 0xdf, 0x69, 0x1c, 0x5a, 0x2b, 0xb2, 0xec, 0x17, 0x9d, 0x4f, 0x76,
+       0x6e, 0x47, 0x2a, 0x76, 0x03, 0xf5, 0xc7, 0xb4, 0x0f, 0xc8, 0xf5, 0xc9,
+       0x13, 0x2f, 0x3f, 0xf7, 0xee, 0x5e, 0xe9, 0x3c, 0xbb, 0x59, 0xa3, 0x1b,
+       0xed, 0x9a, 0xd8, 0x35, 0xe4, 0xc6, 0xbc, 0xd5, 0xdf, 0xd0, 0x06, 0x73,
+       0x94, 0xba, 0x65, 0x03, 0x32, 0xa4, 0x11, 0xed, 0xd6, 0xba, 0x5f, 0x23,
+       0x3a, 0xa8, 0x73, 0x77, 0x39, 0x4e, 0xbe, 0x68, 0xc9, 0x7c, 0xd1, 0x0c,
+       0xe7, 0x40, 0x7f, 0xb7, 0x61, 0xab, 0x6d, 0xe2, 0x0e, 0xb6, 0x70, 0x06,
+       0xdb, 0x75, 0xca, 0xf9, 0x2f, 0x34, 0xf6, 0xae, 0xd5, 0x3f, 0xc3, 0x38,
+       0xe6, 0xf9, 0x84, 0x3c, 0xee, 0x23, 0x06, 0xd2, 0x1f, 0x95, 0xd2, 0xfd,
+       0xdd, 0x7e, 0x9b, 0x68, 0xbb, 0x55, 0x27, 0x1e, 0x8b, 0x5c, 0x2d, 0x58,
+       0x90, 0x25, 0xbf, 0x0a, 0x51, 0x07, 0x28, 0xab, 0x66, 0x3f, 0xc7, 0x5b,
+       0xb3, 0xe3, 0x1c, 0xb5, 0xb8, 0xae, 0xa8, 0x87, 0xdb, 0x94, 0xfd, 0x3b,
+       0x5a, 0xee, 0x17, 0x4a, 0x17, 0xe4, 0x1d, 0xdc, 0xb7, 0xab, 0xe3, 0x64,
+       0xe5, 0x16, 0x74, 0xbc, 0x7a, 0xa9, 0x99, 0xd7, 0x3d, 0x89, 0x73, 0x32,
+       0xd5, 0xfc, 0xf2, 0x75, 0xb9, 0x76, 0x63, 0x57, 0xbd, 0x71, 0x23, 0xa2,
+       0xae, 0x2f, 0x0f, 0xa9, 0xfc, 0xb2, 0xe3, 0xfc, 0xd3, 0x9e, 0x95, 0x3b,
+       0xab, 0x8e, 0x9c, 0xb5, 0x7d, 0xfd, 0x7e, 0x69, 0xe6, 0xd6, 0x39, 0x4e,
+       0x07, 0xb0, 0x79, 0xfb, 0xa4, 0xe3, 0x3c, 0x3d, 0x36, 0x26, 0xd1, 0x93,
+       0xd4, 0x51, 0x9e, 0x0b, 0x31, 0x3f, 0x96, 0x98, 0x93, 0xb4, 0xac, 0xcb,
+       0x15, 0xa5, 0x80, 0x6f, 0xdd, 0xae, 0xfe, 0xf2, 0xcc, 0x31, 0x2f, 0x56,
+       0x72, 0xe7, 0x35, 0xfa, 0x92, 0x43, 0xff, 0xe5, 0x4b, 0x36, 0xe4, 0x62,
+       0x71, 0x04, 0xfd, 0x83, 0xf2, 0xc3, 0x62, 0xe0, 0x50, 0xd9, 0xc0, 0x73,
+       0x54, 0xe5, 0x8b, 0x8f, 0x9c, 0x21, 0x1d, 0x33, 0x80, 0x4e, 0x62, 0x38,
+       0xce, 0x9c, 0xcd, 0xf9, 0xba, 0x31, 0xdf, 0x8e, 0x71, 0x0c, 0xf2, 0xff,
+       0xac, 0x96, 0xcf, 0x17, 0x15, 0x6c, 0x5f, 0xf0, 0x77, 0x50, 0xd2, 0x45,
+       0xc8, 0x78, 0xc5, 0x9c, 0x53, 0xea, 0x0a, 0x66, 0x68, 0x0e, 0xd8, 0x31,
+       0x0b, 0xbc, 0x79, 0x49, 0xc7, 0x56, 0x4f, 0x68, 0xec, 0x99, 0x67, 0x39,
+       0x2b, 0x89, 0x8a, 0xdd, 0xa3, 0xcf, 0x6f, 0xf7, 0xf6, 0x2f, 0x43, 0xee,
+       0x9d, 0x83, 0x8f, 0xb3, 0x4a, 0xda, 0x60, 0x03, 0xa5, 0xd6, 0xcf, 0x81,
+       0x27, 0x42, 0x38, 0xdb, 0x56, 0xcd, 0x0f, 0x0d, 0xc8, 0xef, 0x86, 0xf6,
+       0x23, 0xba, 0xf1, 0x8a, 0x86, 0xc1, 0x76, 0x17, 0xd0, 0xaf, 0x5d, 0x92,
+       0xcb, 0x6d, 0x1a, 0x57, 0x9f, 0xac, 0x4b, 0x40, 0x0f, 0xf9, 0x3e, 0xca,
+       0x7e, 0xd4, 0x85, 0xbd, 0xb2, 0x0f, 0xe5, 0x19, 0x94, 0x5b, 0xf0, 0x64,
+       0x9b, 0x61, 0xe8, 0x15, 0x78, 0xbe, 0x8d, 0xf1, 0xc6, 0xb0, 0xe6, 0xac,
+       0x21, 0x1f, 0x9e, 0xa1, 0x2c, 0x19, 0x55, 0xcc, 0x63, 0x9e, 0xb3, 0xf0,
+       0xac, 0x0d, 0xa9, 0xd4, 0x12, 0xcb, 0x78, 0x96, 0xdd, 0xef, 0x4f, 0x60,
+       0x12, 0xfa, 0x24, 0x6f, 0xb8, 0x98, 0xf4, 0xe1, 0x1e, 0x26, 0xb1, 0xae,
+       0x5d, 0xd2, 0xcb, 0xe4, 0x75, 0x03, 0xf4, 0xd6, 0x29, 0xa9, 0x1b, 0x41,
+       0xad, 0x8f, 0x56, 0x40, 0x8b, 0x1b, 0xa0, 0xab, 0x35, 0xd0, 0x54, 0xb2,
+       0x68, 0xc6, 0x67, 0x54, 0x58, 0xfb, 0x02, 0x5e, 0x00, 0xbd, 0x76, 0xbc,
+       0x49, 0x5d, 0x94, 0xbc, 0x1c, 0x05, 0xed, 0x89, 0xd3, 0x61, 0x59, 0x99,
+       0xa8, 0xb2, 0x40, 0x83, 0xa0, 0xcb, 0xa2, 0xcb, 0xd3, 0xef, 0x2b, 0x8d,
+       0xab, 0xf1, 0x07, 0x12, 0x4b, 0x3c, 0x10, 0x13, 0x58, 0x60, 0xda, 0x1f,
+       0x88, 0x8d, 0x31, 0x27, 0xe4, 0x26, 0xe6, 0xf1, 0x81, 0xbf, 0x47, 0x4e,
+       0x69, 0xfe, 0x8e, 0x8b, 0xff, 0x30, 0x8f, 0x83, 0xde, 0x80, 0x41, 0x2e,
+       0x4f, 0x27, 0x3c, 0x1a, 0xfd, 0x26, 0xf8, 0xd7, 0x84, 0x25, 0x16, 0x94,
+       0x05, 0xf0, 0xff, 0x06, 0xbe, 0xdf, 0xad, 0x0f, 0xab, 0xf9, 0x25, 0xe5,
+       0xe5, 0x92, 0x7c, 0x07, 0x7a, 0xf2, 0x43, 0x9c, 0x5d, 0x97, 0xd6, 0xdd,
+       0x23, 0x63, 0x8c, 0x9f, 0x65, 0xd4, 0x35, 0xeb, 0xb4, 0xec, 0x8e, 0x4e,
+       0xa0, 0x7c, 0x0c, 0x4f, 0x1f, 0xce, 0x21, 0xa0, 0xe3, 0xdf, 0x6b, 0x05,
+       0x5b, 0xb9, 0xff, 0xd3, 0x30, 0x8e, 0xbe, 0xc4, 0xb2, 0x93, 0xf8, 0x4e,
+       0x5f, 0x0c, 0xf7, 0x06, 0x9d, 0x49, 0x85, 0x74, 0xbe, 0x69, 0x05, 0xba,
+       0xc4, 0x3a, 0xc6, 0xbb, 0x47, 0x5f, 0x5e, 0x0d, 0x3c, 0x3c, 0xfa, 0x2f,
+       0x27, 0x11, 0x64, 0x4e, 0xfb, 0x17, 0x21, 0x57, 0xfe, 0x7d, 0xea, 0xec,
+       0x5a, 0xf3, 0x71, 0x1f, 0x5e, 0x3e, 0x32, 0x82, 0x68, 0x0b, 0x59, 0x06,
+       0x59, 0x54, 0xd6, 0xf4, 0xcb, 0x76, 0x6e, 0xdf, 0x7c, 0x2d, 0x66, 0xdc,
+       0x17, 0xb7, 0xef, 0x82, 0x45, 0xb9, 0xd3, 0x0e, 0x7c, 0x09, 0x6b, 0xbd,
+       0xf2, 0x9e, 0x95, 0x03, 0x2a, 0x98, 0xe1, 0x0c, 0x68, 0xb4, 0x4d, 0xcc,
+       0xe8, 0x94, 0xec, 0xcf, 0x3b, 0xa7, 0xfb, 0xb2, 0x6d, 0xb3, 0x6f, 0x73,
+       0x5e, 0xae, 0x9f, 0x7b, 0xe1, 0x1e, 0xe8, 0x9b, 0x36, 0x34, 0x8d, 0x36,
+       0x6a, 0x03, 0xfd, 0x2e, 0x8d, 0x36, 0xf7, 0x11, 0xfc, 0x3f, 0xfb, 0x20,
+       0x9d, 0xd8, 0xca, 0x8d, 0xd3, 0xe3, 0x59, 0xe3, 0x79, 0x0e, 0x83, 0x36,
+       0x0e, 0xd2, 0x4f, 0xd3, 0xb7, 0xe8, 0xd2, 0xcf, 0xd3, 0x7b, 0xf4, 0x43,
+       0xba, 0xe9, 0x94, 0xf4, 0x0d, 0x4b, 0xa6, 0x8b, 0xfa, 0xbe, 0xa1, 0x6b,
+       0xd2, 0x67, 0x34, 0x01, 0xba, 0x21, 0xad, 0x93, 0xb7, 0x0c, 0x29, 0x83,
+       0x8e, 0xca, 0xc0, 0xa7, 0x32, 0x68, 0xaa, 0x02, 0x7c, 0x2b, 0x03, 0xdf,
+       0xca, 0x75, 0x33, 0x5a, 0xc5, 0x9e, 0x29, 0xb3, 0xd7, 0x41, 0x47, 0x1b,
+       0x75, 0xde, 0xbf, 0x5e, 0xb3, 0x41, 0x39, 0x78, 0x77, 0xef, 0xee, 0xff,
+       0x81, 0xbb, 0x1f, 0x94, 0xdb, 0xb0, 0x5b, 0xde, 0x29, 0x8d, 0x02, 0x93,
+       0x04, 0x18, 0x65, 0x83, 0x36, 0xe2, 0xb2, 0x59, 0x9a, 0x94, 0x2d, 0xc8,
+       0xa7, 0xed, 0xd5, 0x08, 0xf4, 0xe9, 0x90, 0xcc, 0xbf, 0x35, 0x22, 0xb7,
+       0x56, 0x95, 0xcc, 0x82, 0x7e, 0xf3, 0x6b, 0xf4, 0xbb, 0x83, 0x9e, 0xcb,
+       0x9d, 0x3a, 0x4e, 0x9f, 0xae, 0xba, 0xfe, 0xf7, 0xa9, 0x6a, 0x97, 0x4c,
+       0x57, 0x0d, 0x79, 0xbe, 0xda, 0x23, 0x2f, 0x56, 0x83, 0x72, 0x16, 0x76,
+       0xe0, 0xd7, 0xaa, 0x03, 0xf2, 0x52, 0x75, 0x50, 0xbe, 0x5e, 0x0b, 0xcb,
+       0x37, 0x6a, 0x96, 0x64, 0x6b, 0x51, 0xc9, 0xd4, 0x46, 0xe5, 0x85, 0x1a,
+       0xfd, 0xea, 0x98, 0x0f, 0xbf, 0xd4, 0x9e, 0xbf, 0x82, 0xeb, 0xea, 0xc0,
+       0xba, 0xa2, 0x6a, 0x4a, 0xc7, 0x29, 0x25, 0xeb, 0xfa, 0x3c, 0x44, 0x2e,
+       0x61, 0xac, 0xc5, 0xb7, 0x94, 0x54, 0xf4, 0xfc, 0xcd, 0xff, 0x33, 0x09,
+       0x68, 0xdb, 0xe8, 0x52, 0x79, 0x00, 0x6d, 0x20, 0xf7, 0x0a, 0x4d, 0xdf,
+       0x47, 0xd3, 0xe7, 0xdf, 0xb4, 0xbd, 0x7c, 0xda, 0x6f, 0x7d, 0x97, 0xb6,
+       0x97, 0x3e, 0x7b, 0xe2, 0x07, 0xed, 0x9c, 0x9b, 0xda, 0x6f, 0xb2, 0x1f,
+       0xdb, 0x68, 0xce, 0xbb, 0x98, 0x7d, 0xf2, 0xff, 0x59, 0xdc, 0x18, 0xd5,
+       0xc5, 0xda, 0x00, 0xff, 0xaf, 0x05, 0x6b, 0xf9, 0xf2, 0xdc, 0xf1, 0xe9,
+       0x52, 0x5a, 0x3d, 0x5f, 0xa2, 0x46, 0xe3, 0xc8, 0xe2, 0x5e, 0x4e, 0xdc,
+       0x73, 0xb2, 0x66, 0x07, 0xf4, 0x1a, 0x5c, 0x5f, 0x7d, 0x42, 0xe7, 0xc7,
+       0xa5, 0x4f, 0x91, 0xfe, 0x18, 0x7b, 0xeb, 0xf2, 0xe2, 0x09, 0xd0, 0x6d,
+       0x6d, 0x43, 0xae, 0x56, 0x5d, 0x9f, 0xd5, 0xbc, 0xa6, 0x97, 0x7b, 0xa0,
+       0x39, 0xc6, 0x1c, 0xdc, 0x67, 0xae, 0xec, 0xf6, 0x4d, 0xe1, 0xde, 0x60,
+       0x8f, 0x63, 0xbf, 0xbe, 0x1e, 0xce, 0xc5, 0xff, 0xe3, 0x41, 0xd9, 0x5b,
+       0x2f, 0x73, 0x8d, 0x2d, 0x4d, 0x8b, 0x6e, 0x5c, 0x37, 0x2a, 0xaf, 0xe2,
+       0xfc, 0x2a, 0x06, 0xd7, 0xdf, 0x21, 0x95, 0x28, 0x6d, 0x5b, 0xe2, 0xf7,
+       0x29, 0x29, 0x63, 0x9e, 0x4a, 0xb4, 0xe9, 0x0f, 0x73, 0x71, 0xb6, 0x62,
+       0xec, 0xcf, 0x3b, 0x53, 0x3e, 0x8e, 0x77, 0xd4, 0x45, 0xa1, 0x33, 0x9d,
+       0xe3, 0xfb, 0x22, 0xca, 0xf4, 0x8d, 0xcc, 0xe3, 0x19, 0xf2, 0xea, 0xde,
+       0xeb, 0xd7, 0xba, 0xfa, 0xe4, 0x7e, 0xbf, 0xd9, 0xb2, 0x99, 0x4b, 0xfa,
+       0x63, 0xca, 0xf7, 0xf3, 0xdf, 0xf7, 0x13, 0x73, 0x8f, 0x5b, 0xfc, 0x05,
+       0xe4, 0x33, 0x43, 0xfb, 0x14, 0xbc, 0x6f, 0x47, 0xe4, 0x65, 0x83, 0x79,
+       0xec, 0x09, 0x95, 0x2e, 0x5d, 0xf7, 0x72, 0x7c, 0x63, 0xea, 0x78, 0xe5,
+       0x7e, 0xbf, 0x9b, 0xf3, 0xce, 0xb1, 0x0f, 0xe6, 0xb9, 0x1f, 0xa4, 0x13,
+       0xe6, 0xbb, 0xb7, 0xef, 0xfd, 0x0f, 0x55, 0xa5, 0x00, 0xbc, 0xb3, 0x5a,
+       0x34, 0x3f, 0xe6, 0x6b, 0xff, 0x76, 0x76, 0x34, 0x3f, 0x37, 0x7d, 0x0c,
+       0x7f, 0xee, 0xa7, 0x6d, 0x4b, 0xdc, 0xb8, 0xea, 0xe6, 0x8e, 0x6a, 0x1b,
+       0x1a, 0x58, 0x81, 0x3a, 0xf2, 0x2a, 0xf8, 0x64, 0xaf, 0x2d, 0xff, 0xfe,
+       0x03, 0x9a, 0xb8, 0x8a, 0x6c, 0x8c, 0x67, 0x00, 0x00, 0x00 };
 
 static const u32 bnx2_RXP_b09FwData[(0x0/4) + 1] = { 0x0 };
 static const u32 bnx2_RXP_b09FwRodata[(0x278/4) + 1] = {
-       0x08004050, 0x08003f50, 0x08003ff4, 0x0800400c, 0x08004024, 0x08004044,
-       0x08004050, 0x08004050, 0x08003f58, 0x00000000, 0x08004a0c, 0x08004a44,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004a7c, 0x08004c40,
-       0x08004b88, 0x08004bc0, 0x08004c40, 0x08004b10, 0x08004c40, 0x08004c40,
-       0x08004bc0, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c00,
-       0x08004c40, 0x08004c00, 0x08004b88, 0x08004c40, 0x08004c40, 0x08004c00,
-       0x08004c00, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40, 0x08004c40,
-       0x08004aec, 0x00000000, 0x08006058, 0x08006070, 0x08006070, 0x08006070,
-       0x08006058, 0x08006070, 0x08006070, 0x08006070, 0x08006058, 0x08006070,
-       0x08006070, 0x08006070, 0x08006058, 0x08006070, 0x08006070, 0x08006070,
-       0x08006064, 0x00000000, 0x00000000 };
+       0x08004070, 0x08003f70, 0x08004014, 0x0800402c, 0x08004044, 0x08004064,
+       0x08004070, 0x08004070, 0x08003f78, 0x00000000, 0x08004a2c, 0x08004a64,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004a9c, 0x08004c60,
+       0x08004ba8, 0x08004be0, 0x08004c60, 0x08004b30, 0x08004c60, 0x08004c60,
+       0x08004be0, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c20,
+       0x08004c60, 0x08004c20, 0x08004ba8, 0x08004c60, 0x08004c60, 0x08004c20,
+       0x08004c20, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60, 0x08004c60,
+       0x08004b0c, 0x00000000, 0x08006078, 0x08006090, 0x08006090, 0x08006090,
+       0x08006078, 0x08006090, 0x08006090, 0x08006090, 0x08006078, 0x08006090,
+       0x08006090, 0x08006090, 0x08006078, 0x08006090, 0x08006090, 0x08006090,
+       0x08006084, 0x00000000, 0x00000000 };
 
 static struct fw_info bnx2_rxp_fw_09 = {
+       /* Firmware version:  3.7.1 */
        .ver_major                      = 0x3,
-       .ver_minor                      = 0x4,
-       .ver_fix                        = 0x3,
+       .ver_minor                      = 0x7,
+       .ver_fix                        = 0x1,
 
        .start_addr                     = 0x08003184,
 
        .text_addr                      = 0x08000000,
-       .text_len                       = 0x6768,
+       .text_len                       = 0x6788,
        .text_index                     = 0x0,
        .gz_text                        = bnx2_RXP_b09FwText,
        .gz_text_len                    = sizeof(bnx2_RXP_b09FwText),
 
-       .data_addr                      = 0x08006a00,
+       .data_addr                      = 0x08006a20,
        .data_len                       = 0x0,
        .data_index                     = 0x0,
        .data                           = bnx2_RXP_b09FwData,
 
-       .sbss_addr                      = 0x08006a00,
+       .sbss_addr                      = 0x08006a20,
        .sbss_len                       = 0x20,
        .sbss_index                     = 0x0,
 
-       .bss_addr                       = 0x08006a20,
+       .bss_addr                       = 0x08006a40,
        .bss_len                        = 0x13dc,
        .bss_index                      = 0x0,
 
-       .rodata_addr                    = 0x08006768,
+       .rodata_addr                    = 0x08006788,
        .rodata_len                     = 0x278,
        .rodata_index                   = 0x0,
        .rodata                         = bnx2_RXP_b09FwRodata,
 };
 
 static u8 bnx2_TPAT_b09FwText[] = {
-/*     0x1f, 0x8b, 0x08, 0x00, 0x0e, 0x34, 0xe7, 0x45, 0x00, 0x03, */
-                                                                   0xcd, 0x58,
-       0x5d, 0x68, 0x1c, 0xd7, 0x15, 0x3e, 0xf3, 0xb7, 0x3b, 0x52, 0x24, 0xeb,
-       0x5a, 0xd9, 0xa6, 0xeb, 0xa0, 0x34, 0x33, 0xda, 0x91, 0xac, 0x22, 0x13,
-       0x4f, 0x9d, 0x25, 0x16, 0x65, 0x21, 0x93, 0xd9, 0x91, 0xac, 0x98, 0x3c,
-       0x28, 0xc5, 0x90, 0x87, 0x52, 0x50, 0x57, 0x32, 0x09, 0x79, 0x69, 0xda,
-       0xc6, 0x90, 0x3e, 0x79, 0x3b, 0x2b, 0xc7, 0x0e, 0x6c, 0xbc, 0x8d, 0x52,
-       0xe4, 0x52, 0xfa, 0x60, 0xd6, 0xb1, 0x05, 0xcd, 0x46, 0x93, 0xd4, 0x7e,
-       0x35, 0x36, 0x4e, 0x93, 0xa7, 0x42, 0x9f, 0x52, 0xf4, 0x18, 0xd2, 0x12,
-       0xda, 0x52, 0x8a, 0x69, 0xa1, 0x09, 0x8d, 0xeb, 0xdb, 0xef, 0xdc, 0x99,
-       0x91, 0x57, 0xb6, 0xec, 0xa4, 0x25, 0x85, 0x0a, 0x56, 0x77, 0xe6, 0xce,
-       0x3d, 0xe7, 0x9e, 0x7b, 0xee, 0x77, 0xbe, 0x73, 0xee, 0x2d, 0xeb, 0x34,
-       0x48, 0xd9, 0xdf, 0x30, 0x7e, 0x2f, 0x7e, 0xf7, 0x85, 0x17, 0xab, 0x8f,
-       0x3c, 0xea, 0x10, 0x3d, 0xfa, 0x88, 0x66, 0x98, 0x06, 0x7d, 0x09, 0x7f,
-       0x50, 0x22, 0x72, 0xfd, 0xfc, 0x23, 0x5b, 0xaf, 0x9d, 0x72, 0x42, 0x8f,
-       0x6c, 0xa3, 0x26, 0xbe, 0xbe, 0xe4, 0x11, 0x05, 0xbd, 0x69, 0xa7, 0x4e,
-       0xff, 0x92, 0xcd, 0x92, 0x49, 0xdc, 0xff, 0x50, 0xed, 0xc6, 0xfe, 0xcb,
-       0x07, 0xdd, 0xeb, 0x67, 0x0d, 0xb2, 0x45, 0x6d, 0xd1, 0x16, 0x93, 0x64,
-       0x8f, 0xd5, 0x9a, 0xce, 0x2f, 0xf6, 0x1e, 0x28, 0xd0, 0xae, 0x5c, 0x97,
-       0xa0, 0xb8, 0x43, 0x4d, 0xab, 0x66, 0x53, 0xd4, 0x7e, 0x49, 0x0b, 0x3b,
-       0x9e, 0x98, 0x85, 0x8e, 0xa0, 0x04, 0xfd, 0x1e, 0xde, 0x13, 0x53, 0x8b,
-       0xce, 0xd8, 0xa4, 0xd7, 0x02, 0x3c, 0x4f, 0x51, 0xab, 0x23, 0xe5, 0x2b,
-       0xbe, 0x46, 0x4b, 0xbe, 0x4d, 0x8b, 0xc2, 0x0d, 0x1c, 0xed, 0xa6, 0xac,
-       0x4c, 0x48, 0xf9, 0x9c, 0xaf, 0x93, 0xee, 0xcd, 0x69, 0xe1, 0xfa, 0xbc,
-       0x56, 0x5f, 0x9f, 0x67, 0x7f, 0xc0, 0xbe, 0x39, 0x2d, 0x58, 0xe7, 0xb6,
-       0x66, 0xd7, 0xdb, 0xbb, 0x68, 0xb1, 0x44, 0x23, 0xba, 0x37, 0x85, 0xf9,
-       0x4a, 0xd0, 0xe3, 0x50, 0xe8, 0x4f, 0x0b, 0x9d, 0x2a, 0xf8, 0x0d, 0xd0,
-       0xac, 0x4f, 0x03, 0xba, 0xa7, 0x53, 0xa3, 0xa4, 0xd1, 0x1b, 0x55, 0x0b,
-       0xbf, 0xc3, 0x5a, 0xb4, 0xfe, 0x7c, 0xa6, 0x87, 0xc7, 0xdb, 0xf8, 0xc6,
-       0x36, 0xb3, 0x7c, 0xbf, 0xec, 0x30, 0x9e, 0x9f, 0xc3, 0x38, 0x8b, 0xc2,
-       0xea, 0xed, 0xdf, 0x06, 0xf0, 0xac, 0xa1, 0xff, 0x30, 0xec, 0x62, 0x3d,
-       0x0e, 0xec, 0x28, 0xd3, 0x4a, 0x67, 0x1e, 0xeb, 0x29, 0x50, 0x53, 0x4c,
-       0x4c, 0x35, 0xc8, 0x84, 0x8c, 0x41, 0x41, 0xe9, 0x8a, 0xd4, 0x6b, 0x52,
-       0x86, 0x55, 0x6f, 0xaa, 0xab, 0xe6, 0xd0, 0xc9, 0xf0, 0x0a, 0x14, 0xf9,
-       0xc3, 0xd4, 0x12, 0x06, 0xc5, 0xfb, 0x2c, 0x0a, 0x16, 0x4c, 0xac, 0x71,
-       0x14, 0x72, 0x1a, 0xe4, 0x5f, 0xcb, 0xf6, 0xbc, 0x48, 0xb1, 0x28, 0xa0,
-       0x7f, 0x84, 0xe2, 0xd2, 0x6e, 0x4d, 0xaf, 0xbd, 0x82, 0xfe, 0x09, 0xd1,
-       0xa5, 0x53, 0x68, 0x35, 0xbc, 0xef, 0xc6, 0x58, 0x7e, 0xd7, 0xa0, 0x8f,
-       0x44, 0x98, 0x78, 0xd4, 0x4a, 0x72, 0x59, 0xee, 0x4f, 0xfb, 0x9a, 0xc9,
-       0xed, 0xfb, 0xed, 0xc1, 0x4e, 0x41, 0x27, 0x3a, 0xb3, 0x98, 0x8f, 0x9a,
-       0x46, 0x0d, 0xe3, 0xb0, 0x37, 0xbc, 0xbf, 0x81, 0xc2, 0xc1, 0xe3, 0xdc,
-       0xcf, 0x7f, 0xe8, 0x77, 0xc8, 0xa8, 0xf1, 0xb7, 0x6f, 0x52, 0xfa, 0x2d,
-       0xb5, 0x3f, 0xf4, 0x1f, 0xcb, 0xde, 0x4b, 0x22, 0x3c, 0xf3, 0x28, 0xd6,
-       0xa8, 0x60, 0x83, 0xe7, 0x02, 0xf0, 0x11, 0xcf, 0xe8, 0xd4, 0x2c, 0x17,
-       0xc9, 0xf5, 0x8f, 0xa2, 0xf7, 0xd7, 0x6d, 0x83, 0xea, 0xec, 0x2b, 0xdf,
-       0xcc, 0x64, 0x18, 0x1b, 0x1f, 0x64, 0x76, 0x0a, 0x5a, 0x3c, 0x22, 0xe5,
-       0x8a, 0x2f, 0xa5, 0x55, 0xf3, 0x9c, 0x13, 0x34, 0x5d, 0x36, 0x69, 0x52,
-       0xa0, 0x85, 0x8f, 0xbd, 0x72, 0x83, 0x2c, 0x60, 0xa1, 0x1f, 0xff, 0xfc,
-       0xf7, 0xa6, 0x86, 0x25, 0xd0, 0xb5, 0x36, 0xeb, 0x98, 0x70, 0x66, 0x95,
-       0x8c, 0x94, 0xf1, 0xcc, 0xbd, 0x64, 0x2e, 0x65, 0x32, 0x52, 0x46, 0x55,
-       0x81, 0x3d, 0x6f, 0x0a, 0xd8, 0x87, 0x75, 0x31, 0xc6, 0x89, 0xa2, 0x9e,
-       0x6f, 0x37, 0xda, 0xb0, 0xd1, 0x43, 0xdb, 0x13, 0xf0, 0x0f, 0x51, 0x0b,
-       0x63, 0xf5, 0xea, 0x7d, 0x8c, 0x0d, 0xec, 0xef, 0x82, 0x1d, 0xb5, 0xdd,
-       0xf2, 0x29, 0x5a, 0xb0, 0xeb, 0xbd, 0xe9, 0xf2, 0x32, 0x3d, 0xc4, 0x73,
-       0xd8, 0x56, 0xed, 0x88, 0xdd, 0x55, 0x72, 0x88, 0xc4, 0x41, 0x3c, 0xf7,
-       0x88, 0xe2, 0x36, 0x69, 0xa1, 0x7f, 0x1f, 0xaf, 0x15, 0x72, 0xf3, 0x99,
-       0xdc, 0x7c, 0x26, 0x37, 0x92, 0xc9, 0x3d, 0xd5, 0x27, 0xf7, 0x14, 0xcb,
-       0x61, 0x6c, 0x90, 0x8d, 0x0d, 0xb2, 0xb1, 0x66, 0x36, 0x36, 0xca, 0xc6,
-       0xa2, 0xed, 0x8d, 0xc1, 0x36, 0x77, 0xca, 0xd1, 0x6c, 0x8a, 0x3d, 0xf9,
-       0x70, 0xe8, 0x53, 0x50, 0xf7, 0xdc, 0xcd, 0xba, 0x31, 0x42, 0xe7, 0xfc,
-       0x21, 0x5a, 0x49, 0xc6, 0x28, 0x4e, 0x56, 0x28, 0x4c, 0x74, 0xc8, 0x8e,
-       0x50, 0xd7, 0xbb, 0x2e, 0x67, 0x7d, 0x1f, 0x7b, 0x66, 0xb3, 0x5c, 0x79,
-       0x96, 0x1c, 0x7c, 0x9f, 0x16, 0xcb, 0xe4, 0x03, 0x2b, 0x3a, 0xf6, 0xad,
-       0xa2, 0x9e, 0xe3, 0xc4, 0xe7, 0x35, 0x37, 0xf5, 0xaa, 0x2b, 0x62, 0x72,
-       0xcb, 0xa1, 0x41, 0x42, 0xaf, 0xc1, 0x4f, 0x49, 0x93, 0xa2, 0xc4, 0xa6,
-       0x0f, 0x8d, 0x97, 0x54, 0x8c, 0xc6, 0x9d, 0x4d, 0x79, 0x79, 0xaf, 0x43,
-       0x57, 0x30, 0xcf, 0xc5, 0xa4, 0x4c, 0xbf, 0x4a, 0x4a, 0xf4, 0x4e, 0x42,
-       0x7a, 0xe8, 0x03, 0xc3, 0x25, 0x41, 0x6f, 0x27, 0xfd, 0x3e, 0xff, 0x88,
-       0x7d, 0x6e, 0xdf, 0x5f, 0x23, 0x7b, 0xb4, 0xc6, 0x38, 0x4b, 0x39, 0xa0,
-       0x9e, 0x72, 0x80, 0xc2, 0x52, 0xab, 0x13, 0x3f, 0x68, 0x80, 0x7f, 0x96,
-       0xfc, 0x60, 0xb7, 0xa1, 0xf6, 0xa3, 0x89, 0x3d, 0xcc, 0x5b, 0xde, 0x9b,
-       0xab, 0xce, 0x92, 0xe7, 0x9e, 0xaa, 0x33, 0x6a, 0x4f, 0x5b, 0x39, 0x2e,
-       0xfb, 0xe6, 0xf8, 0x33, 0xe6, 0x18, 0xa2, 0x06, 0xe2, 0xec, 0x09, 0x13,
-       0xb1, 0xe3, 0xfd, 0xdd, 0x60, 0x5c, 0x39, 0x1b, 0x8c, 0x6f, 0xa2, 0xf1,
-       0x0d, 0x9b, 0xd6, 0xdb, 0x45, 0x72, 0xba, 0x43, 0xb4, 0xd4, 0x19, 0xa4,
-       0xca, 0x05, 0x13, 0x63, 0xef, 0xa3, 0xca, 0xaa, 0x5e, 0xe2, 0x38, 0xae,
-       0xc3, 0xc7, 0xe3, 0x5d, 0x09, 0x7c, 0x0e, 0xd2, 0xf8, 0x9a, 0xab, 0xb0,
-       0xb3, 0xe4, 0xb5, 0x7c, 0x83, 0x7e, 0x4c, 0xd7, 0xf6, 0x15, 0xb0, 0xa6,
-       0x12, 0xf9, 0x93, 0xfd, 0xf3, 0xe9, 0x80, 0x18, 0xf7, 0xc5, 0x45, 0xda,
-       0xe5, 0x3a, 0xa4, 0xb3, 0x3e, 0x9b, 0xc6, 0x2f, 0xd8, 0x5a, 0xbd, 0xc3,
-       0x3e, 0x63, 0xfc, 0xd9, 0x19, 0xfe, 0x4c, 0x2d, 0x3c, 0x53, 0xc4, 0x5c,
-       0x7f, 0x91, 0xa1, 0x27, 0xb1, 0x0f, 0x3a, 0x2d, 0x55, 0x7f, 0x04, 0xfb,
-       0xd0, 0xd7, 0xe5, 0x6f, 0xd7, 0xb3, 0x7e, 0xd6, 0x01, 0x7e, 0xf0, 0xef,
-       0xa7, 0x90, 0xb9, 0xe0, 0x08, 0xcb, 0x14, 0x69, 0x7c, 0x95, 0xf9, 0x05,
-       0x6d, 0x97, 0xdf, 0x79, 0x6d, 0x03, 0xd4, 0x80, 0x57, 0x1a, 0x53, 0x25,
-       0xd8, 0xa5, 0x2b, 0xbe, 0x68, 0x80, 0x3f, 0x74, 0x6f, 0x10, 0x2d, 0xcf,
-       0xf7, 0x73, 0x23, 0x8f, 0xa9, 0xb8, 0x33, 0x44, 0x75, 0xe0, 0xd7, 0x84,
-       0x3d, 0xcb, 0x34, 0x51, 0x3e, 0xaa, 0xbe, 0xa1, 0xaf, 0xc7, 0xdf, 0xc4,
-       0x6d, 0xdf, 0xf0, 0xde, 0xcb, 0x6d, 0x40, 0x6c, 0x7b, 0x2d, 0xcc, 0x62,
-       0x65, 0x7e, 0xe1, 0xf1, 0xcd, 0x32, 0xf6, 0x06, 0x7c, 0x46, 0xf0, 0x25,
-       0x51, 0xb7, 0x6d, 0x82, 0x6f, 0xf4, 0xaf, 0xea, 0x2c, 0x57, 0x62, 0x3d,
-       0x58, 0xff, 0x9a, 0xa9, 0xd5, 0xcf, 0x78, 0xce, 0x1f, 0x88, 0xe5, 0x2b,
-       0xf0, 0xc1, 0xc4, 0x4c, 0x8b, 0xc7, 0xf7, 0x2c, 0xf2, 0x56, 0x9b, 0xc2,
-       0xc4, 0x9e, 0xc2, 0x73, 0x54, 0xff, 0xc9, 0x08, 0xf6, 0xda, 0x75, 0x5a,
-       0xf4, 0x5b, 0xd8, 0x53, 0x20, 0xaf, 0x6b, 0xd2, 0x1b, 0x6d, 0xf6, 0x85,
-       0x4d, 0x95, 0x35, 0x29, 0x4f, 0xfa, 0xbc, 0x27, 0xbf, 0x83, 0x5f, 0x08,
-       0x2b, 0x9c, 0x98, 0xf9, 0x08, 0xfb, 0xb3, 0xde, 0xe3, 0xbd, 0xb1, 0x94,
-       0x4f, 0xbc, 0xd5, 0x29, 0xec, 0xeb, 0x54, 0x66, 0x23, 0xef, 0x97, 0x49,
-       0x2b, 0x55, 0x9d, 0xce, 0x57, 0x3f, 0x93, 0xba, 0xc7, 0xfc, 0x5a, 0x80,
-       0x6f, 0x31, 0xae, 0x8b, 0x71, 0x49, 0x01, 0x3e, 0xfc, 0x07, 0x78, 0x45,
-       0xca, 0xf3, 0x55, 0xf4, 0xaf, 0x1e, 0x87, 0xad, 0x06, 0x64, 0x53, 0x8c,
-       0xb1, 0x3d, 0x73, 0xed, 0x7c, 0x7d, 0xde, 0xcc, 0x7b, 0x4a, 0xdf, 0x10,
-       0x4d, 0x6e, 0x0c, 0xd1, 0xb3, 0xbd, 0x21, 0x1a, 0x3f, 0xcd, 0x32, 0xe0,
-       0xa6, 0xaa, 0x27, 0x22, 0xc6, 0xa8, 0xa7, 0xfc, 0x50, 0x36, 0x74, 0x5e,
-       0x27, 0xbe, 0x6f, 0x10, 0x2d, 0xf7, 0x78, 0x0e, 0xb3, 0x4f, 0xa7, 0x4e,
-       0x87, 0x7e, 0x4a, 0x74, 0xa8, 0xc7, 0xb2, 0x5b, 0xbe, 0x83, 0x5e, 0x01,
-       0x9d, 0x82, 0x38, 0x0f, 0x19, 0x1e, 0xf2, 0xdd, 0x7a, 0x88, 0xfc, 0x15,
-       0xe1, 0x37, 0x87, 0x9c, 0xc6, 0xeb, 0x9f, 0x42, 0xfc, 0x31, 0x8f, 0xdf,
-       0xc4, 0xda, 0x0b, 0xb4, 0xe2, 0xcf, 0x63, 0x0c, 0xef, 0xf1, 0x61, 0x7c,
-       0x1f, 0x46, 0x1e, 0xc8, 0xf2, 0x84, 0xe0, 0x3c, 0xb1, 0x1b, 0x71, 0x30,
-       0x00, 0xee, 0xdf, 0x63, 0x6e, 0xcf, 0x13, 0x18, 0x57, 0xda, 0x83, 0xbc,
-       0x70, 0x3f, 0xfa, 0x59, 0xd7, 0x28, 0xda, 0x01, 0xbc, 0xef, 0xc1, 0xd8,
-       0xfe, 0x1c, 0x91, 0xcb, 0xdd, 0x2d, 0x3f, 0x20, 0x26, 0x56, 0x11, 0x2b,
-       0x6b, 0x9c, 0x27, 0x38, 0x16, 0x79, 0x4f, 0x8b, 0xe0, 0x6f, 0x1b, 0x3a,
-       0x78, 0x6f, 0x8b, 0xd8, 0x43, 0xce, 0x71, 0x82, 0x2a, 0x1b, 0x3b, 0xe5,
-       0x0f, 0x5e, 0x0f, 0x38, 0xec, 0x34, 0xaf, 0xc5, 0x15, 0x0d, 0xf0, 0x59,
-       0xb8, 0x31, 0x8d, 0xef, 0xc8, 0x85, 0x22, 0xb2, 0x1b, 0xa7, 0x53, 0x2e,
-       0x6b, 0x6c, 0x8c, 0x29, 0x9c, 0xc6, 0x89, 0xc0, 0x3b, 0x73, 0x59, 0xce,
-       0x5d, 0x8c, 0x25, 0x0a, 0x20, 0xbb, 0x19, 0x1a, 0x52, 0x2e, 0xf9, 0x23,
-       0xd4, 0x00, 0x2e, 0x03, 0xf0, 0x59, 0x03, 0x7c, 0x56, 0xef, 0xe3, 0xb3,
-       0xfa, 0xe7, 0xf2, 0x19, 0xb8, 0xaa, 0x03, 0xae, 0xea, 0x80, 0xab, 0x50,
-       0x1b, 0xbc, 0x03, 0xec, 0xbf, 0xdd, 0xd9, 0x89, 0xe3, 0x98, 0xdf, 0x98,
-       0xe7, 0xa6, 0xe8, 0xf2, 0xde, 0xff, 0x94, 0xe7, 0x8e, 0x83, 0x13, 0x6c,
-       0xfa, 0xfe, 0xde, 0x7b, 0x73, 0xdd, 0x09, 0x70, 0x9d, 0xf5, 0xf9, 0x5c,
-       0xd7, 0x64, 0xae, 0x33, 0x81, 0xbd, 0x26, 0x78, 0x40, 0x5f, 0xed, 0x9f,
-       0xe7, 0x24, 0xe6, 0xe1, 0x3e, 0x33, 0xcb, 0xa5, 0x3a, 0x75, 0x81, 0x7b,
-       0xc3, 0xe3, 0x79, 0x60, 0x73, 0x92, 0x72, 0xd1, 0x13, 0x66, 0x89, 0xac,
-       0x49, 0xe0, 0x61, 0x75, 0x88, 0x8c, 0xd3, 0xb7, 0xf0, 0x8e, 0x7a, 0x00,
-       0x71, 0x8e, 0x7f, 0x1b, 0xb9, 0x8e, 0x41, 0x70, 0x8d, 0x49, 0x85, 0x55,
-       0x0b, 0xef, 0xda, 0xb6, 0x71, 0x87, 0x90, 0x6f, 0x8c, 0x9a, 0x3b, 0xf3,
-       0x7b, 0x7e, 0xee, 0xf1, 0x98, 0x41, 0xd2, 0xd7, 0x5c, 0xc7, 0xd1, 0x5d,
-       0xff, 0x1a, 0xb8, 0xe1, 0x7d, 0x8f, 0xf9, 0x2f, 0x06, 0x0a, 0x0a, 0x64,
-       0xae, 0xca, 0xe3, 0x56, 0x8d, 0xe7, 0x6e, 0x3a, 0x88, 0x73, 0xe7, 0x35,
-       0xe0, 0x87, 0x73, 0xe7, 0xf9, 0x2a, 0xd7, 0x7b, 0x69, 0x8c, 0xb6, 0x7a,
-       0xf9, 0x9c, 0xa3, 0xb0, 0xdb, 0x82, 0x4c, 0xff, 0x58, 0xc6, 0x8b, 0x94,
-       0xcf, 0x62, 0x4d, 0x06, 0xe6, 0xb1, 0xd6, 0x6c, 0x2a, 0xac, 0xb1, 0x5f,
-       0x5c, 0xc8, 0x57, 0xc4, 0x1c, 0x6d, 0x6e, 0xe3, 0x83, 0x93, 0xbd, 0x0f,
-       0x4c, 0xe6, 0x50, 0x03, 0xb1, 0x59, 0xc4, 0xbc, 0xd6, 0x96, 0x2e, 0xca,
-       0x74, 0xb1, 0xbc, 0x57, 0x7e, 0x76, 0x4b, 0x9e, 0x79, 0x6d, 0xa2, 0xcc,
-       0xfc, 0xc5, 0x76, 0x18, 0x8a, 0x4b, 0x07, 0x33, 0x2e, 0xad, 0x60, 0x3f,
-       0x07, 0x55, 0x5c, 0xea, 0xde, 0xc3, 0x19, 0x9f, 0xee, 0x46, 0xcb, 0x7d,
-       0x37, 0xb2, 0x38, 0x31, 0x61, 0x2f, 0xeb, 0x1d, 0x24, 0x03, 0x76, 0x45,
-       0x6a, 0x4d, 0x7f, 0x93, 0x4b, 0x1e, 0x73, 0x04, 0xe3, 0x53, 0x71, 0x29,
-       0xfa, 0x27, 0x60, 0x33, 0xf3, 0x02, 0xcb, 0xb1, 0xfc, 0x4e, 0x72, 0x7f,
-       0x85, 0x9c, 0xd8, 0x41, 0x0e, 0x7d, 0x1b, 0x2c, 0xc3, 0xdc, 0x30, 0x8a,
-       0xf1, 0x21, 0xf3, 0x02, 0x7c, 0xc6, 0xb2, 0xe5, 0x2c, 0x0e, 0x23, 0x7c,
-       0xe3, 0xba, 0x97, 0xe3, 0x23, 0x20, 0xab, 0xc6, 0xeb, 0xe0, 0x9a, 0x98,
-       0xf3, 0x22, 0xd7, 0xa1, 0x5c, 0x6f, 0xe6, 0xf5, 0xa9, 0x37, 0x35, 0x7b,
-       0xb7, 0x5a, 0x53, 0xf4, 0xd7, 0x9a, 0xe8, 0xd8, 0xb1, 0xd6, 0xf4, 0xac,
-       0xb4, 0xd6, 0xac, 0x58, 0x77, 0xaf, 0x35, 0x73, 0xd9, 0x7b, 0xd7, 0x9a,
-       0x71, 0x87, 0xf7, 0x08, 0xb9, 0x54, 0xf0, 0x5a, 0xa8, 0x69, 0x66, 0x7c,
-       0x11, 0xdd, 0xc6, 0x17, 0xd1, 0x69, 0xb7, 0x7c, 0x8e, 0x38, 0xa6, 0xdd,
-       0x72, 0x8b, 0x6b, 0xa0, 0x0d, 0xae, 0x81, 0x0c, 0xe4, 0xd2, 0x7e, 0xce,
-       0xc8, 0x7d, 0xc2, 0xbe, 0x1c, 0x04, 0x27, 0xb3, 0x1f, 0x8b, 0x19, 0x3f,
-       0xa0, 0xf5, 0x3e, 0x05, 0x3f, 0xe4, 0xbc, 0xc2, 0x3e, 0xfb, 0x7f, 0xe2,
-       0x15, 0xb2, 0x07, 0xc0, 0x0f, 0x36, 0xea, 0xcd, 0x46, 0x47, 0xd9, 0x02,
-       0x5f, 0x48, 0x39, 0xe7, 0x33, 0xf6, 0x53, 0xbe, 0x50, 0x3e, 0x51, 0x78,
-       0x2c, 0xd2, 0xbb, 0x3e, 0x63, 0x01, 0xe7, 0x23, 0x8f, 0x73, 0x22, 0xf3,
-       0xef, 0x4d, 0xf9, 0xae, 0x17, 0xa2, 0x2f, 0xc2, 0x9e, 0x33, 0x0e, 0xe6,
-       0xb5, 0x43, 0xeb, 0x36, 0xe4, 0x18, 0x0b, 0xe5, 0x3b, 0xce, 0x3d, 0xe9,
-       0xf9, 0x84, 0x6b, 0xe1, 0xff, 0x16, 0x1b, 0x17, 0xef, 0x82, 0x8d, 0x37,
-       0x33, 0x6c, 0xfc, 0xf2, 0x1e, 0xd8, 0xb8, 0xf8, 0x05, 0xb1, 0xe1, 0x3a,
-       0x1f, 0xa3, 0x5e, 0x7a, 0xcf, 0x63, 0x7c, 0x48, 0xf9, 0xb1, 0xbf, 0x53,
-       0x3e, 0x09, 0x6c, 0xe3, 0xd5, 0x9b, 0x32, 0xce, 0x72, 0x89, 0xfe, 0xd6,
-       0xad, 0x5c, 0x32, 0xfe, 0x6a, 0x8a, 0x8b, 0xf1, 0xb7, 0xa4, 0x3c, 0xb7,
-       0x03, 0x0e, 0xb8, 0x56, 0xbe, 0x0a, 0x1e, 0x68, 0xd1, 0xff, 0xa2, 0x56,
-       0x66, 0xce, 0xae, 0xda, 0x47, 0xdb, 0xf9, 0xbe, 0xe7, 0x7b, 0x5e, 0xa0,
-       0xb3, 0x62, 0x17, 0xfc, 0xb5, 0x9f, 0x5a, 0xaf, 0x9b, 0x7c, 0x7e, 0x00,
-       0x1e, 0x1e, 0x37, 0x39, 0x56, 0x71, 0x56, 0xc4, 0x73, 0x7f, 0x3d, 0x0d,
-       0x3c, 0xfa, 0xbc, 0x76, 0xb5, 0xee, 0x3e, 0xae, 0xff, 0x1e, 0x4a, 0x92,
-       0x3b, 0xf2, 0xc8, 0xb6, 0x73, 0xb3, 0x81, 0x73, 0x73, 0x5d, 0xe9, 0xe0,
-       0xb3, 0x55, 0xea, 0xbf, 0x13, 0xea, 0xac, 0x7c, 0x53, 0x9e, 0x53, 0xe7,
-       0xe5, 0xd1, 0x02, 0x0d, 0xce, 0x67, 0x58, 0x61, 0x5f, 0x0c, 0xab, 0x7a,
-       0x82, 0x31, 0xd5, 0x42, 0xbe, 0x5d, 0x82, 0x3f, 0x1a, 0x2a, 0x16, 0xb0,
-       0xf6, 0xcc, 0x1f, 0x2d, 0xf8, 0xa3, 0x9e, 0xa4, 0x31, 0xf1, 0xe5, 0x9e,
-       0x1d, 0xfe, 0x88, 0x7c, 0x6a, 0x2f, 0x9a, 0x38, 0x6f, 0x5f, 0x49, 0x54,
-       0xfe, 0x5c, 0x68, 0xb5, 0xa9, 0xf9, 0x60, 0xed, 0x38, 0xd7, 0x6d, 0x5c,
-       0x77, 0xcd, 0x2c, 0x55, 0xd1, 0xd7, 0xb3, 0x29, 0x84, 0x4f, 0xbe, 0x7d,
-       0x90, 0x16, 0x8d, 0x1a, 0xe3, 0x17, 0xef, 0x09, 0x35, 0xc3, 0x83, 0xa8,
-       0xa5, 0x92, 0xb1, 0x45, 0xbd, 0x36, 0x06, 0x1c, 0x35, 0x29, 0x80, 0x9d,
-       0x01, 0x74, 0xcf, 0xb5, 0x6d, 0x7b, 0xb9, 0xcd, 0x67, 0xa4, 0x26, 0xf1,
-       0x19, 0xbc, 0xdb, 0xbb, 0x0e, 0x7d, 0x03, 0xcf, 0xe0, 0xcc, 0xea, 0xc4,
-       0xc0, 0xd5, 0xcb, 0x89, 0x45, 0xad, 0x12, 0xdf, 0x51, 0x30, 0x57, 0x96,
-       0xa1, 0xe3, 0x99, 0x42, 0x8a, 0xcb, 0x32, 0xf4, 0x70, 0xcc, 0x10, 0xe6,
-       0x63, 0xff, 0xe5, 0x58, 0x2b, 0xf7, 0xd5, 0xee, 0x85, 0xec, 0xbc, 0x4a,
-       0xca, 0x07, 0xec, 0xdf, 0xd0, 0x7b, 0xbe, 0x90, 0xdf, 0xc7, 0xb4, 0x10,
-       0xf3, 0x8d, 0x7d, 0x8c, 0x43, 0x0d, 0x78, 0xc3, 0x98, 0x84, 0xfb, 0x90,
-       0x57, 0xf6, 0x21, 0x37, 0x97, 0x8a, 0xaa, 0x6d, 0x26, 0xc7, 0xb2, 0xf1,
-       0xba, 0x1a, 0xc7, 0x39, 0x21, 0x4e, 0xd4, 0x59, 0x41, 0x8b, 0x3a, 0xe4,
-       0x34, 0x7c, 0x9c, 0x81, 0x50, 0x5b, 0xac, 0x24, 0x9c, 0xcf, 0xf7, 0xd9,
-       0xba, 0xe2, 0xb9, 0x4d, 0xc8, 0xe0, 0x79, 0x83, 0xf4, 0x86, 0xcf, 0xf7,
-       0x07, 0xd9, 0xdd, 0x46, 0x89, 0x86, 0x21, 0x0f, 0xbb, 0xc6, 0xd8, 0xae,
-       0xa0, 0xa1, 0x6a, 0x11, 0xd6, 0xbd, 0x5f, 0x4f, 0xef, 0x5c, 0x7e, 0x93,
-       0xcd, 0x65, 0x83, 0x5f, 0x08, 0xe7, 0x1d, 0x9f, 0xf3, 0xda, 0xd7, 0x0c,
-       0xba, 0x4e, 0x8a, 0x23, 0xc5, 0x37, 0x90, 0xef, 0x0e, 0x42, 0x26, 0x50,
-       0xfc, 0x92, 0x9e, 0x19, 0x72, 0x99, 0x8a, 0xb1, 0x5d, 0xc7, 0x77, 0xcc,
-       0xed, 0xef, 0x01, 0x62, 0xab, 0x9a, 0xcd, 0xd7, 0x8f, 0xd3, 0x4d, 0xe0,
-       0x74, 0xb3, 0xb0, 0x75, 0xee, 0x28, 0x15, 0x30, 0x8e, 0x6d, 0x64, 0x2e,
-       0x61, 0x99, 0x4f, 0xac, 0xed, 0x7a, 0x2a, 0x3b, 0xe8, 0xf8, 0x53, 0x9f,
-       0x8e, 0x12, 0xaf, 0x4d, 0x34, 0xd2, 0xf3, 0xb3, 0xfa, 0x6b, 0xc0, 0xcf,
-       0x38, 0x6f, 0x3c, 0xa0, 0x63, 0x1d, 0x5c, 0x7f, 0xd5, 0x55, 0x3f, 0x0e,
-       0x56, 0xdb, 0xf4, 0xfe, 0x30, 0x9b, 0x67, 0x5f, 0x1a, 0x0f, 0x1e, 0xda,
-       0x64, 0xb3, 0xcf, 0x76, 0x6b, 0x87, 0x79, 0x91, 0xd8, 0xbd, 0x19, 0x8d,
-       0xf1, 0x66, 0xd4, 0x38, 0x07, 0xe3, 0x79, 0x0b, 0x1f, 0x8c, 0xd5, 0xcf,
-       0xc7, 0xa8, 0xf5, 0x05, 0x31, 0xfa, 0x46, 0x9b, 0xb9, 0x22, 0xc5, 0x68,
-       0xe3, 0x0e, 0x8c, 0xa2, 0x06, 0x2a, 0xe5, 0xf8, 0xe4, 0x78, 0xc9, 0xf1,
-       0x99, 0x3f, 0xf3, 0xfd, 0x08, 0x38, 0x38, 0xe3, 0xb6, 0x18, 0xdc, 0x16,
-       0xa9, 0x1c, 0xe7, 0x96, 0x23, 0x4a, 0xe3, 0x78, 0x19, 0x71, 0x1c, 0x19,
-       0x9c, 0xf3, 0x38, 0x86, 0x59, 0x8e, 0xe3, 0x98, 0xe5, 0x46, 0x32, 0x39,
-       0xb4, 0x88, 0xe7, 0x28, 0x8b, 0xe7, 0x16, 0x78, 0x37, 0xca, 0xe2, 0xb9,
-       0x85, 0x18, 0x5e, 0xc9, 0xe2, 0xb9, 0x95, 0xc5, 0x33, 0xdf, 0xdb, 0x19,
-       0x55, 0x95, 0x8b, 0x9d, 0x3a, 0x78, 0x6d, 0x45, 0xe9, 0x6c, 0x62, 0x9d,
-       0xb0, 0xb1, 0x93, 0xc7, 0xc5, 0x1d, 0xf7, 0x5b, 0x58, 0xcf, 0xad, 0xbc,
-       0x32, 0x8b, 0xbc, 0x72, 0x0e, 0x79, 0xa5, 0xdb, 0x77, 0xbf, 0x75, 0x56,
-       0xe5, 0x95, 0x27, 0x8b, 0x79, 0x5e, 0xe9, 0x66, 0x79, 0xa5, 0xab, 0xf2,
-       0xca, 0x13, 0x45, 0xce, 0x2b, 0x31, 0x05, 0xc5, 0xfe, 0xbc, 0x12, 0x6f,
-       0xcb, 0x2b, 0xb9, 0x2c, 0xf7, 0xef, 0x94, 0x57, 0x72, 0x9f, 0x71, 0x6e,
-       0xb1, 0x72, 0x5e, 0xbd, 0x2d, 0x9f, 0xe4, 0x63, 0xd8, 0x56, 0xe6, 0x25,
-       0xe6, 0xe0, 0xb4, 0xae, 0xbf, 0x92, 0xe4, 0xb1, 0x74, 0x0c, 0xf3, 0xe0,
-       0xbd, 0xb3, 0x53, 0x2c, 0xd9, 0x59, 0x2c, 0x0d, 0xa7, 0x32, 0x9d, 0xfe,
-       0x78, 0x3a, 0x56, 0xdc, 0x1e, 0x4f, 0xb9, 0x9e, 0x3c, 0x9e, 0x52, 0x9d,
-       0x1f, 0x1a, 0x65, 0xae, 0x07, 0x70, 0x96, 0x76, 0xfd, 0x39, 0xf4, 0x5e,
-       0xe8, 0x4d, 0xa3, 0xae, 0x36, 0xe9, 0x6a, 0xce, 0x37, 0xea, 0xbe, 0x07,
-       0x6d, 0x2f, 0xb7, 0xb5, 0xb8, 0xf5, 0xad, 0x8b, 0xda, 0xfa, 0x7d, 0xf0,
-       0xc8, 0x79, 0xf5, 0xfd, 0x33, 0x79, 0xb5, 0x84, 0x33, 0xb0, 0x97, 0x8f,
-       0x7b, 0x1d, 0xf3, 0xb9, 0xe2, 0x2c, 0x9e, 0x5e, 0xee, 0xdd, 0x82, 0xf9,
-       0x8a, 0xc7, 0x7d, 0xff, 0x44, 0x0e, 0x41, 0x5d, 0xbe, 0x35, 0x96, 0xcf,
-       0x38, 0x1e, 0xd6, 0xec, 0xd0, 0xa5, 0x6d, 0xe7, 0x9c, 0xf4, 0x7c, 0x83,
-       0x75, 0xa3, 0x3e, 0xe1, 0x3a, 0x25, 0xfc, 0x8a, 0x4e, 0x2f, 0xd1, 0xb7,
-       0x7c, 0xee, 0xd3, 0x69, 0xf6, 0x31, 0x29, 0x5f, 0x40, 0xcd, 0xf2, 0xf4,
-       0xb6, 0x9a, 0xa5, 0x48, 0xe3, 0x07, 0xfa, 0xcf, 0x87, 0x37, 0xe5, 0xf8,
-       0xa4, 0x7b, 0x36, 0xa0, 0x40, 0x9b, 0x5d, 0xe7, 0x5a, 0x76, 0xab, 0x76,
-       0x25, 0x1a, 0xbd, 0x21, 0xf5, 0x49, 0xce, 0x85, 0x57, 0x33, 0x5f, 0xe1,
-       0xdb, 0x99, 0x1b, 0xe0, 0xd6, 0x48, 0xdd, 0xf1, 0x06, 0xeb, 0x3c, 0x0f,
-       0xbf, 0xa3, 0x4d, 0xb8, 0xbe, 0xb9, 0xdb, 0xbd, 0xab, 0x89, 0x7d, 0x71,
-       0x9d, 0xa3, 0x06, 0xa9, 0xbb, 0x8b, 0x25, 0xdf, 0xfd, 0x59, 0x8b, 0x52,
-       0x9e, 0x88, 0xfc, 0x05, 0xd8, 0x02, 0x9c, 0x8b, 0x45, 0xec, 0xcd, 0x24,
-       0x78, 0xc9, 0x75, 0x0e, 0xe8, 0x42, 0x61, 0x7f, 0x19, 0xba, 0x8d, 0x03,
-       0x5c, 0x3f, 0x7e, 0x2a, 0x97, 0x7b, 0x2a, 0x07, 0xfb, 0x8c, 0x91, 0x7a,
-       0xb2, 0x5b, 0xe7, 0x36, 0x48, 0xf8, 0xb9, 0x80, 0x79, 0x9c, 0xbb, 0xe0,
-       0xa7, 0x24, 0xa2, 0x33, 0x8e, 0x98, 0xed, 0x38, 0x62, 0xae, 0xa3, 0x03,
-       0xdd, 0xb6, 0x4d, 0xbb, 0xb0, 0x27, 0xc8, 0xc1, 0xf4, 0x00, 0x6c, 0xb9,
-       0xe0, 0x88, 0x3a, 0x6a, 0xc1, 0x1f, 0x18, 0xae, 0x78, 0x9a, 0x3e, 0xc1,
-       0x1a, 0x6f, 0xc8, 0xf4, 0xde, 0xc5, 0x11, 0xd1, 0xd6, 0xdc, 0x37, 0x30,
-       0x37, 0xdb, 0xc4, 0x31, 0xca, 0xf9, 0x72, 0x5e, 0x5b, 0x80, 0x8f, 0x8e,
-       0xac, 0x6b, 0xe0, 0x35, 0xce, 0x97, 0x23, 0xd9, 0xfd, 0x12, 0xf6, 0x07,
-       0xeb, 0xbf, 0x74, 0x47, 0xad, 0x99, 0xd7, 0x94, 0xe9, 0xdd, 0x69, 0x3c,
-       0xc3, 0xf3, 0x13, 0x6c, 0x99, 0x98, 0xba, 0xa0, 0xce, 0x3d, 0xd3, 0xa8,
-       0xf1, 0xb8, 0x95, 0xa8, 0x83, 0xf8, 0xae, 0x8b, 0x6b, 0x27, 0x89, 0xf8,
-       0x4f, 0x9f, 0x63, 0x3e, 0x13, 0xcd, 0xb0, 0x0e, 0x3e, 0x1b, 0x71, 0xfc,
-       0xfc, 0x1b, 0x2f, 0xf3, 0x0a, 0xbd, 0x68, 0x18, 0x00, 0x00, 0x00 };
+       0xcd, 0x58, 0x5d, 0x6c, 0x1c, 0x57, 0x15, 0x3e, 0xf3, 0xb7, 0x3b, 0xde,
+       0x38, 0xf1, 0x24, 0x19, 0xca, 0xa6, 0x72, 0xe9, 0x8c, 0x3d, 0x76, 0x8c,
+       0x6c, 0x35, 0xd3, 0x76, 0xd5, 0x58, 0x68, 0xa4, 0x4e, 0x67, 0x76, 0x1d,
+       0x2b, 0xf4, 0xc1, 0x85, 0x48, 0x3c, 0xf0, 0xe2, 0xae, 0x1d, 0x05, 0x78,
+       0x2a, 0x28, 0x0f, 0x11, 0x2f, 0x59, 0x76, 0x37, 0xfd, 0x41, 0xdb, 0x2c,
+       0x35, 0xc8, 0x41, 0x02, 0xa4, 0xb0, 0x69, 0xe2, 0x97, 0xad, 0x27, 0x2d,
+       0x45, 0xea, 0x4b, 0x95, 0x28, 0x55, 0x2b, 0xc4, 0x13, 0x2f, 0x54, 0x79,
+       0xac, 0x52, 0x5a, 0xf1, 0x00, 0x28, 0x42, 0x15, 0xaa, 0x68, 0xf0, 0xe5,
+       0x3b, 0x77, 0x66, 0xdc, 0xdd, 0xc4, 0x49, 0xcb, 0x9f, 0x84, 0xa5, 0xf5,
+       0x9d, 0xb9, 0xf7, 0x9e, 0x73, 0xcf, 0x3d, 0x3f, 0xdf, 0x39, 0x67, 0xca,
+       0x2a, 0x95, 0x28, 0xfb, 0xdb, 0x8d, 0xdf, 0xc9, 0xa7, 0x9f, 0x39, 0x79,
+       0xf8, 0xa1, 0x47, 0x1d, 0xa2, 0x87, 0x1f, 0x52, 0x94, 0xa2, 0x46, 0xff,
+       0x85, 0x3f, 0x30, 0xb1, 0x72, 0xfe, 0xfc, 0x23, 0x53, 0x0d, 0x7e, 0xe3,
+       0x44, 0x1e, 0x99, 0x5a, 0xb0, 0xf4, 0xe5, 0x15, 0x8f, 0x28, 0xec, 0xcf,
+       0x3a, 0x31, 0xfd, 0x43, 0x34, 0x6c, 0x9d, 0x78, 0xfe, 0x81, 0xe0, 0xd6,
+       0xa1, 0x37, 0x0f, 0xbb, 0x37, 0xcf, 0x6b, 0x64, 0x5a, 0xc1, 0xb2, 0x69,
+       0x4d, 0x93, 0x39, 0x1e, 0x5c, 0x75, 0x7e, 0x7e, 0x30, 0x28, 0xd0, 0x9e,
+       0x9c, 0x97, 0x4d, 0xcd, 0x2e, 0x35, 0xf4, 0xc0, 0xa4, 0x5a, 0xe7, 0x94,
+       0x12, 0x75, 0x3d, 0xab, 0x0a, 0x1e, 0xa1, 0x0d, 0xfe, 0x1e, 0xde, 0x13,
+       0x5d, 0xa9, 0x9e, 0x33, 0x49, 0x0d, 0x42, 0x3c, 0xcf, 0x51, 0xab, 0x2b,
+       0xc4, 0x0f, 0x7d, 0x85, 0x56, 0x7c, 0x93, 0x96, 0x2d, 0x77, 0x31, 0x54,
+       0xb6, 0x44, 0x3c, 0x25, 0xc4, 0xb7, 0x7d, 0x95, 0x54, 0x6f, 0x41, 0x89,
+       0x36, 0x16, 0x95, 0x78, 0x63, 0x91, 0xf5, 0x01, 0xf9, 0x16, 0x94, 0x70,
+       0x83, 0xc7, 0xc0, 0x8c, 0x3b, 0x7b, 0x68, 0xd9, 0xa6, 0x31, 0xd5, 0x9b,
+       0xc3, 0x79, 0x65, 0xf0, 0x71, 0x28, 0xf2, 0x67, 0x2d, 0x95, 0x26, 0xf1,
+       0x1b, 0xa1, 0x9a, 0x4f, 0x23, 0xaa, 0xa7, 0x52, 0xdd, 0x56, 0xe8, 0xe5,
+       0x8a, 0x81, 0xdf, 0x51, 0xa5, 0xba, 0xf1, 0x9d, 0x8c, 0x0f, 0xef, 0x37,
+       0xb1, 0xc6, 0x32, 0x33, 0xfd, 0x20, 0xed, 0x6e, 0x3c, 0x7f, 0x0b, 0xfb,
+       0x0c, 0x8a, 0x2a, 0xb7, 0xaf, 0x8d, 0xe0, 0x59, 0xc1, 0xfc, 0x51, 0xc8,
+       0xc5, 0x7c, 0x1c, 0xc8, 0x31, 0x4e, 0xed, 0xee, 0x22, 0xee, 0x53, 0xa0,
+       0x86, 0x35, 0x35, 0x53, 0x27, 0x1d, 0x34, 0x1a, 0x85, 0xf6, 0x15, 0xa1,
+       0x06, 0x42, 0x44, 0x15, 0x6f, 0xa6, 0x27, 0xcf, 0x50, 0x49, 0xf3, 0x0a,
+       0x54, 0xf5, 0x77, 0x53, 0xcb, 0xd2, 0xa8, 0x39, 0x67, 0x50, 0xb8, 0xa4,
+       0xe3, 0x8e, 0xfb, 0x40, 0xa7, 0x80, 0xfe, 0xa5, 0xcc, 0xe6, 0x45, 0x6a,
+       0x5a, 0x05, 0xcc, 0x8f, 0x51, 0xd3, 0xde, 0xab, 0xa8, 0xc1, 0x0b, 0x98,
+       0x9f, 0xb2, 0x7a, 0xf4, 0x3c, 0x46, 0x05, 0xef, 0x7b, 0xb1, 0x97, 0xdf,
+       0x15, 0xf0, 0x23, 0x2b, 0x4a, 0x66, 0xa8, 0x95, 0xe4, 0xb4, 0x3c, 0x9f,
+       0xce, 0x35, 0x92, 0xdb, 0xed, 0x8d, 0x7d, 0xdd, 0x1a, 0x74, 0xcc, 0xb6,
+       0xc1, 0x9e, 0xdc, 0x2e, 0xd2, 0x07, 0x1e, 0xe7, 0x79, 0xfe, 0xc3, 0xbc,
+       0x43, 0x5a, 0xe0, 0x59, 0x31, 0x7d, 0x85, 0xd2, 0xb5, 0x54, 0xf6, 0xc8,
+       0x7f, 0x2c, 0x7b, 0xb7, 0xad, 0xe8, 0xdc, 0xa3, 0xb8, 0x9f, 0x74, 0x19,
+       0x3c, 0xdb, 0xb8, 0x7f, 0x01, 0xfe, 0xd1, 0x0c, 0x55, 0x6a, 0x94, 0x4d,
+       0x72, 0xe7, 0x57, 0xb1, 0xf2, 0x41, 0x47, 0xa3, 0x98, 0x75, 0xe5, 0xeb,
+       0x19, 0x1d, 0xfb, 0xc6, 0xbb, 0x90, 0xb3, 0x61, 0x99, 0x70, 0xbc, 0xe5,
+       0x63, 0x42, 0x5c, 0xf4, 0x85, 0x28, 0x04, 0xde, 0xcc, 0x25, 0x9a, 0x2d,
+       0x1b, 0x34, 0x6d, 0x61, 0x84, 0x8e, 0xbd, 0x72, 0x9d, 0x8c, 0x5c, 0x9e,
+       0xdc, 0x37, 0xf1, 0xd7, 0x57, 0x08, 0x3e, 0x79, 0xa3, 0xf3, 0x7b, 0xd6,
+       0xc7, 0xcc, 0x82, 0xa4, 0x11, 0xa2, 0x37, 0x7f, 0x2f, 0x9a, 0x5f, 0x67,
+       0x34, 0x42, 0xd4, 0x2a, 0x7c, 0xae, 0x8b, 0x3b, 0xb3, 0x7f, 0x13, 0xd5,
+       0xfa, 0xbe, 0x59, 0xef, 0x40, 0x3e, 0x0f, 0x63, 0x9f, 0xa8, 0xde, 0xe5,
+       0x7b, 0x98, 0xd4, 0x84, 0xde, 0x5a, 0xd8, 0xaf, 0x56, 0x76, 0xb1, 0x7f,
+       0xc0, 0xc6, 0x4b, 0x66, 0xb5, 0xe3, 0x96, 0x5f, 0xa0, 0x25, 0x33, 0xee,
+       0xcf, 0x96, 0x57, 0xe9, 0x01, 0x3e, 0xc7, 0x34, 0x82, 0x63, 0x66, 0x4f,
+       0xd2, 0x1b, 0x1a, 0x95, 0xf0, 0x0c, 0x1e, 0xcd, 0x0e, 0x29, 0x91, 0xbf,
+       0x8b, 0xef, 0x0b, 0xba, 0xc5, 0x8c, 0x6e, 0x31, 0xa3, 0x1b, 0xcb, 0xe8,
+       0x9e, 0x1c, 0xa0, 0x7b, 0x92, 0xe9, 0xb0, 0x37, 0xcc, 0xf6, 0x86, 0xd9,
+       0x5e, 0x3d, 0xdb, 0x5b, 0xcd, 0xf6, 0x62, 0xec, 0x3b, 0x90, 0xcf, 0x9d,
+       0x09, 0x15, 0xc8, 0xe8, 0x89, 0x07, 0x23, 0x9f, 0xc2, 0xd8, 0x73, 0xaf,
+       0xc7, 0xda, 0x18, 0x5d, 0xf0, 0x2d, 0x6a, 0x27, 0x0e, 0x64, 0x6f, 0x53,
+       0x94, 0xa8, 0xa0, 0x1d, 0xa3, 0x9e, 0x77, 0x53, 0xd4, 0xfc, 0x0a, 0x6c,
+       0x37, 0xca, 0x74, 0xe5, 0x1a, 0x14, 0xd1, 0x4c, 0x66, 0xad, 0x55, 0xaa,
+       0xc0, 0x5f, 0x54, 0xd8, 0x6f, 0x52, 0x3e, 0x37, 0x93, 0x0a, 0xd6, 0xa9,
+       0xa1, 0x56, 0x5c, 0xab, 0x49, 0x6e, 0x39, 0xd2, 0xc8, 0x52, 0x03, 0x1b,
+       0x7b, 0x1a, 0x54, 0x4d, 0x4c, 0x7a, 0x4f, 0x3b, 0x25, 0xe3, 0xb4, 0xd9,
+       0xbd, 0x2e, 0xde, 0x3c, 0xe8, 0xd0, 0x95, 0x64, 0x9c, 0x7e, 0x95, 0x94,
+       0xe9, 0xb5, 0xc4, 0xa6, 0x57, 0x13, 0x52, 0x23, 0x1f, 0x7e, 0x6c, 0x5b,
+       0x74, 0x39, 0x19, 0xd4, 0xfb, 0x07, 0xac, 0x77, 0x73, 0x7f, 0x40, 0xe6,
+       0xbe, 0x80, 0x1a, 0x5a, 0x90, 0xe2, 0x40, 0x9c, 0xe2, 0x80, 0xf4, 0xa9,
+       0x56, 0xb7, 0x79, 0xbf, 0x06, 0x0c, 0x5a, 0xf1, 0xc3, 0xbd, 0x1a, 0xec,
+       0x12, 0x23, 0x0a, 0xd4, 0xed, 0x51, 0xda, 0xc8, 0x5d, 0xf1, 0xdc, 0xe7,
+       0x63, 0xec, 0xf6, 0xce, 0x1a, 0x98, 0xbd, 0xdd, 0xb6, 0x7f, 0xc6, 0x19,
+       0xa3, 0xb0, 0x9b, 0x46, 0x4f, 0xe8, 0x88, 0x1f, 0xef, 0x23, 0x8d, 0x63,
+       0xc0, 0xd9, 0xb4, 0xe9, 0x4c, 0x97, 0x68, 0x62, 0xd3, 0xa4, 0x8d, 0x4e,
+       0x91, 0x9c, 0xde, 0x28, 0xad, 0x74, 0x4b, 0x34, 0x79, 0x49, 0xc7, 0xde,
+       0x5d, 0x34, 0xb9, 0xa6, 0xda, 0x1c, 0xcb, 0x31, 0x74, 0x3c, 0xd1, 0x13,
+       0xf0, 0xd1, 0x12, 0x4d, 0xac, 0xbb, 0xd2, 0x7f, 0x56, 0xbc, 0x96, 0xaf,
+       0xd1, 0x0f, 0xe8, 0xda, 0x5c, 0x01, 0x77, 0xb2, 0xc9, 0x9f, 0x1e, 0x3c,
+       0xcf, 0x80, 0x9b, 0xf1, 0x1c, 0x98, 0xee, 0x71, 0x1d, 0x52, 0x99, 0x9f,
+       0x49, 0x13, 0x97, 0x4c, 0x25, 0xee, 0xb2, 0xce, 0xd8, 0x07, 0xcd, 0xcc,
+       0x07, 0x75, 0x25, 0x3a, 0x57, 0xc4, 0x59, 0x7f, 0x12, 0x91, 0x07, 0xdf,
+       0x03, 0x96, 0xad, 0x54, 0xbe, 0x0f, 0xf9, 0x30, 0xd7, 0xe3, 0xb5, 0x9b,
+       0xd9, 0x3c, 0xf3, 0x00, 0x46, 0xf8, 0xfb, 0x29, 0x62, 0x3c, 0x38, 0xc6,
+       0x34, 0x45, 0x9a, 0x58, 0x63, 0x8c, 0xc1, 0xd8, 0xe3, 0x77, 0xbe, 0xdb,
+       0x08, 0xd5, 0xa1, 0x95, 0xfa, 0x8c, 0x0d, 0xb9, 0x54, 0x89, 0x19, 0x75,
+       0x60, 0x88, 0xea, 0x95, 0x30, 0xf2, 0x79, 0x3f, 0xd3, 0xd2, 0xf8, 0xb7,
+       0xa5, 0xbd, 0x63, 0xf8, 0xaf, 0x0e, 0x79, 0x56, 0x69, 0xaa, 0x7c, 0x5c,
+       0xae, 0x61, 0xae, 0xcf, 0x6b, 0xd6, 0x6d, 0x6b, 0x78, 0xef, 0xe7, 0x32,
+       0x20, 0xc6, 0xbd, 0x16, 0x4e, 0x31, 0x32, 0xbd, 0xf0, 0xfe, 0x46, 0x19,
+       0xb6, 0x01, 0xa6, 0x11, 0x74, 0x49, 0xd4, 0xeb, 0xe8, 0xc0, 0x1c, 0xf5,
+       0x8b, 0x2a, 0xd3, 0xd9, 0xcc, 0x07, 0xf7, 0x5f, 0xd7, 0x95, 0xf8, 0x9c,
+       0xe7, 0xfc, 0x81, 0x98, 0x7e, 0x12, 0x3a, 0x98, 0x9a, 0x6f, 0xf1, 0xfe,
+       0xbe, 0x41, 0xde, 0x5a, 0xc3, 0xd2, 0x61, 0x53, 0x15, 0x06, 0x8d, 0x7f,
+       0x34, 0x06, 0x5b, 0xbb, 0x4e, 0x8b, 0x7e, 0x07, 0x79, 0x0a, 0xe4, 0xf5,
+       0x74, 0x7a, 0xb9, 0xc3, 0xba, 0x30, 0x69, 0x72, 0x5d, 0x88, 0xe7, 0x7c,
+       0xb6, 0xc9, 0xbb, 0xd0, 0x0b, 0xe1, 0x86, 0x53, 0xf3, 0x37, 0x60, 0x9f,
+       0x8d, 0x3e, 0xdb, 0xc6, 0x90, 0x3a, 0xf1, 0xd6, 0xe6, 0x60, 0xd7, 0x99,
+       0x4c, 0x46, 0xb6, 0x97, 0x4e, 0xed, 0x8a, 0x4a, 0x17, 0x2b, 0x9f, 0x08,
+       0xd5, 0x63, 0x8c, 0x2d, 0x40, 0xb7, 0xd8, 0xd7, 0xc3, 0xbe, 0xa4, 0x00,
+       0x1d, 0xfe, 0x4d, 0x18, 0xc0, 0xdf, 0x8b, 0x15, 0xcc, 0xaf, 0x9d, 0x86,
+       0xac, 0x1a, 0x68, 0x53, 0x1f, 0x63, 0x79, 0x16, 0x3a, 0xf9, 0xfd, 0xbc,
+       0xf9, 0xb7, 0x25, 0xbf, 0x51, 0x9a, 0xde, 0x1c, 0xa5, 0x13, 0xfd, 0x51,
+       0x9a, 0x38, 0xcb, 0x34, 0x42, 0xb4, 0x2b, 0x8c, 0x91, 0xf0, 0x51, 0x4f,
+       0xea, 0xa1, 0xac, 0xa9, 0x7c, 0x4f, 0xac, 0x6f, 0x12, 0xad, 0xf6, 0xf9,
+       0x0c, 0x7d, 0x80, 0xa7, 0x4a, 0x47, 0x7e, 0x42, 0x74, 0xa4, 0xcf, 0xb4,
+       0xdb, 0xba, 0x03, 0x5f, 0x0b, 0x3c, 0x2d, 0xe2, 0x5c, 0xa4, 0x79, 0xc8,
+       0x79, 0x1b, 0x11, 0x72, 0x58, 0x15, 0xbf, 0x05, 0xe4, 0x35, 0xbe, 0xff,
+       0x1c, 0xe2, 0x8f, 0xb1, 0x7c, 0x0b, 0x77, 0x2f, 0x50, 0xdb, 0x5f, 0xc4,
+       0x1e, 0xb6, 0xf1, 0x51, 0xac, 0xef, 0x46, 0x2e, 0xc8, 0x72, 0x85, 0xc5,
+       0xb9, 0x62, 0x2f, 0xe2, 0x60, 0x04, 0xf8, 0x7f, 0xbf, 0x3e, 0x9c, 0x2b,
+       0xb0, 0xcf, 0x3e, 0x80, 0xdc, 0x80, 0x44, 0x5d, 0x62, 0x5e, 0xfb, 0x31,
+       0x8e, 0xe0, 0xfd, 0x00, 0xf6, 0x0e, 0xe6, 0x89, 0x9c, 0xee, 0x6e, 0x39,
+       0x02, 0x31, 0xb1, 0x86, 0x58, 0x59, 0x9f, 0x61, 0xcc, 0x80, 0x3d, 0xd8,
+       0xa6, 0x45, 0x60, 0xb8, 0x09, 0x1e, 0x6c, 0xdb, 0x22, 0x6c, 0xc8, 0x79,
+       0xce, 0xa2, 0xc9, 0x4d, 0x8e, 0xeb, 0x34, 0x8f, 0xc4, 0xdb, 0x79, 0x84,
+       0x64, 0x4c, 0x34, 0x13, 0xf6, 0x89, 0xd0, 0x8c, 0xce, 0x6e, 0x09, 0xc4,
+       0x70, 0x39, 0x66, 0x5c, 0xdb, 0x9c, 0x05, 0xbd, 0x86, 0xf8, 0xa8, 0x9a,
+       0xf5, 0xb3, 0x29, 0xa6, 0xd5, 0x37, 0x1d, 0xe9, 0x93, 0xcd, 0xc4, 0xc2,
+       0x3b, 0x63, 0x5a, 0x8e, 0x61, 0x4c, 0x4f, 0x61, 0x04, 0x7c, 0x8b, 0x34,
+       0x21, 0x56, 0xfc, 0x31, 0xaa, 0xc3, 0x3f, 0x43, 0xe0, 0x5a, 0x1d, 0xb8,
+       0x16, 0x0f, 0xe0, 0x5a, 0xfc, 0x99, 0xb8, 0x06, 0xcc, 0xea, 0x02, 0xb3,
+       0x50, 0x23, 0xbc, 0x06, 0x8c, 0x7f, 0x15, 0xe7, 0x5d, 0xee, 0xee, 0x84,
+       0x75, 0x8c, 0x73, 0x8c, 0x77, 0x33, 0xf4, 0xe6, 0xc1, 0x7f, 0x15, 0xef,
+       0xda, 0xc0, 0x06, 0x93, 0xbe, 0x7b, 0xf0, 0xde, 0x98, 0x77, 0x06, 0x98,
+       0x67, 0x7c, 0x36, 0xe6, 0x35, 0x18, 0xf3, 0x74, 0xf8, 0x60, 0x03, 0x78,
+       0xa0, 0xae, 0x0d, 0x9e, 0xd3, 0xc1, 0x39, 0x3c, 0xa7, 0x67, 0x79, 0x55,
+       0xa5, 0x1e, 0xfc, 0x5f, 0xf3, 0xf8, 0x9c, 0x39, 0xd6, 0xbb, 0xd4, 0xff,
+       0x13, 0xba, 0x4d, 0xc6, 0x34, 0xfc, 0x62, 0x6d, 0x94, 0xb4, 0xb3, 0x9f,
+       0xfa, 0x3d, 0x6a, 0x03, 0xc4, 0x3b, 0xfe, 0x6d, 0xe6, 0x3c, 0x4a, 0xc0,
+       0x1c, 0x9d, 0x0a, 0x6b, 0x06, 0xde, 0x95, 0xa1, 0x7d, 0x47, 0x90, 0x77,
+       0xb4, 0xc0, 0x9d, 0x7f, 0x9f, 0x9f, 0xfb, 0xbc, 0xa7, 0x44, 0xea, 0xba,
+       0xeb, 0x38, 0xaa, 0xeb, 0x5f, 0x03, 0x46, 0xbc, 0xe3, 0x31, 0x0e, 0x36,
+       0xe1, 0x0d, 0x05, 0xd2, 0xd7, 0xc4, 0x69, 0x23, 0xe0, 0xb3, 0x1b, 0x0e,
+       0xe2, 0xdd, 0x79, 0x09, 0x7e, 0xc4, 0x39, 0xf4, 0x22, 0xe2, 0xa7, 0x96,
+       0xc5, 0x6a, 0xab, 0x9f, 0x9f, 0xb9, 0x0f, 0x72, 0x1b, 0xa0, 0x19, 0xdc,
+       0xcb, 0x71, 0x20, 0xc4, 0x09, 0xdc, 0x49, 0xc3, 0x39, 0xc6, 0xba, 0x49,
+       0x85, 0x75, 0xd6, 0x8b, 0x0b, 0xfa, 0x49, 0x6b, 0x81, 0xae, 0x0f, 0xe1,
+       0xc2, 0x73, 0xfd, 0xeb, 0x3a, 0x63, 0xa9, 0x86, 0x18, 0x2d, 0xe2, 0x5c,
+       0x63, 0x9b, 0x17, 0x65, 0xbc, 0x98, 0xde, 0x2b, 0x9f, 0xd8, 0xa6, 0x67,
+       0x7c, 0x9b, 0x2a, 0x33, 0x8e, 0xb1, 0x1c, 0x9a, 0xc4, 0xd4, 0x52, 0x86,
+       0xa9, 0x93, 0xb0, 0x67, 0x49, 0xc6, 0xa7, 0xea, 0x3d, 0x98, 0xe1, 0xea,
+       0x5e, 0x8c, 0x3c, 0x27, 0xb2, 0x78, 0xd1, 0x21, 0x2f, 0xf3, 0x2d, 0x91,
+       0xb6, 0xce, 0x35, 0x04, 0xdf, 0xe9, 0xaf, 0xf0, 0x6d, 0xc6, 0x0a, 0xf6,
+       0x4f, 0x89, 0xa9, 0x98, 0x9f, 0x82, 0xcc, 0x8c, 0x0f, 0x4c, 0xc7, 0xf4,
+       0x3b, 0xd1, 0xfd, 0x05, 0x74, 0xd6, 0x0e, 0x74, 0x98, 0xdb, 0x64, 0x1a,
+       0xc6, 0x88, 0x7d, 0xd8, 0x1f, 0x31, 0x3e, 0x40, 0x67, 0x4c, 0x3b, 0x9e,
+       0xc5, 0x63, 0x15, 0x6b, 0x5c, 0x03, 0xcb, 0xf8, 0x22, 0x23, 0xe0, 0x7b,
+       0x70, 0x7d, 0xcc, 0xf9, 0x91, 0x6b, 0x52, 0xae, 0x3d, 0xf3, 0x5a, 0xd5,
+       0x9b, 0xa9, 0xdd, 0xad, 0xee, 0xb4, 0x06, 0xeb, 0xce, 0x43, 0xc6, 0xce,
+       0x75, 0xe7, 0x41, 0x23, 0xad, 0x3b, 0xa7, 0x8d, 0xbb, 0xd7, 0x9d, 0x39,
+       0xed, 0xbd, 0xeb, 0xce, 0x66, 0x97, 0xcf, 0xdc, 0x19, 0x2f, 0x56, 0xe0,
+       0xaf, 0xad, 0x24, 0xbf, 0x27, 0xf7, 0x06, 0xa1, 0x59, 0x3b, 0x9b, 0xda,
+       0xbe, 0x29, 0x7d, 0x11, 0x38, 0xb2, 0x39, 0x0b, 0x3b, 0xa2, 0xa6, 0x1e,
+       0xc2, 0x8e, 0x9c, 0x86, 0x75, 0x5a, 0x02, 0x46, 0xb3, 0x3e, 0x8b, 0x19,
+       0x4e, 0x60, 0xf4, 0x3e, 0x06, 0x4e, 0xe4, 0xf8, 0xc2, 0xfc, 0xfe, 0x9f,
+       0xf0, 0x85, 0xcc, 0x11, 0xe0, 0x84, 0x19, 0x30, 0x5e, 0x4a, 0x59, 0x50,
+       0x93, 0x0b, 0xb1, 0xe0, 0x73, 0x0c, 0x0c, 0xf6, 0x4c, 0xec, 0x0f, 0x45,
+       0x7a, 0xcb, 0x67, 0x9f, 0x40, 0xcf, 0xe4, 0x71, 0x8e, 0x64, 0x3c, 0xde,
+       0x12, 0x6f, 0x79, 0x11, 0xe6, 0xaa, 0xb0, 0x3d, 0xfb, 0xc3, 0xa2, 0x72,
+       0x64, 0xc3, 0x04, 0x1d, 0xfb, 0xc4, 0xf8, 0x1d, 0xbd, 0x50, 0xda, 0xb3,
+       0x70, 0x7d, 0xfc, 0xef, 0xfa, 0xc8, 0x1b, 0x77, 0xf1, 0x91, 0xcb, 0x99,
+       0x8f, 0x24, 0xf7, 0xf0, 0x91, 0x37, 0x3e, 0xa7, 0x8f, 0xb8, 0xe5, 0x0f,
+       0x51, 0x3f, 0xbd, 0x0d, 0x39, 0x42, 0x4b, 0x88, 0x0f, 0xfd, 0x9d, 0xfa,
+       0x94, 0xd0, 0xd4, 0x5f, 0x64, 0x9d, 0xa5, 0x79, 0xa5, 0x85, 0x77, 0xed,
+       0x15, 0xae, 0x97, 0x39, 0xe7, 0xa4, 0xb9, 0x65, 0xe2, 0xc5, 0xd4, 0x3f,
+       0x26, 0x5e, 0x11, 0xe2, 0xc2, 0x0e, 0xfe, 0xc0, 0x35, 0xf4, 0x55, 0xf8,
+       0x55, 0x8b, 0xfe, 0x17, 0x35, 0x34, 0x63, 0x78, 0xc5, 0x3c, 0xde, 0xc9,
+       0xed, 0x9f, 0xdb, 0xbe, 0x40, 0xe7, 0xad, 0x3d, 0xd0, 0xdb, 0xa3, 0xd4,
+       0xfa, 0xb1, 0xce, 0x7d, 0x05, 0xfc, 0xe2, 0x71, 0x9d, 0x63, 0x17, 0x7d,
+       0x24, 0x9e, 0x07, 0xeb, 0x6c, 0xf8, 0xa5, 0x5f, 0xc8, 0xe3, 0x65, 0x00,
+       0xfb, 0x4f, 0xa1, 0x54, 0xb9, 0x23, 0xaf, 0x0c, 0xf5, 0xd4, 0x1a, 0x7a,
+       0xea, 0x58, 0xf2, 0xe0, 0xbe, 0x2b, 0xd5, 0x63, 0x5b, 0xf6, 0xd1, 0x5b,
+       0xa2, 0x25, 0x7b, 0xe9, 0x03, 0x05, 0x2a, 0x2d, 0x66, 0x3e, 0xe3, 0x20,
+       0x1f, 0xb9, 0x7e, 0x03, 0xfc, 0xb9, 0xd6, 0x80, 0x1c, 0xb4, 0x8a, 0x58,
+       0xbc, 0x80, 0x3c, 0xbc, 0x02, 0xbd, 0xd4, 0x65, 0x6c, 0x8c, 0xd1, 0x35,
+       0xe4, 0xfe, 0x36, 0xf2, 0xf3, 0x19, 0xe8, 0xa6, 0x05, 0xdd, 0xc4, 0x49,
+       0x1a, 0x27, 0xd7, 0xa0, 0x9b, 0x85, 0x01, 0xdd, 0x2c, 0xfc, 0x47, 0xfd,
+       0xc5, 0x1f, 0x91, 0x6b, 0xcd, 0x65, 0x1d, 0xf3, 0x57, 0x12, 0x99, 0x5b,
+       0x97, 0x5a, 0x1d, 0x6a, 0xdc, 0x1f, 0x9c, 0xe6, 0xda, 0x8e, 0x6b, 0xb3,
+       0xf9, 0x95, 0x0a, 0xe6, 0xfa, 0x26, 0x45, 0xd0, 0xcf, 0x37, 0x0f, 0xd3,
+       0xb2, 0x16, 0xb0, 0x4f, 0xe3, 0x3d, 0xa1, 0x46, 0x74, 0x18, 0xf5, 0x56,
+       0x32, 0xbe, 0x8c, 0x7e, 0x1c, 0xbe, 0xd5, 0xa0, 0x10, 0x72, 0x86, 0xe0,
+       0xbd, 0xd0, 0x31, 0xcd, 0xd5, 0x0e, 0xf7, 0x51, 0x0d, 0xe2, 0x5e, 0xbd,
+       0xd7, 0xbf, 0x09, 0x7e, 0x23, 0xdf, 0x40, 0x7f, 0xeb, 0x34, 0x81, 0xd3,
+       0xcf, 0xc2, 0x6d, 0x5b, 0x36, 0x7f, 0xcb, 0x60, 0x1c, 0x1d, 0x07, 0x8f,
+       0xa7, 0x0b, 0xa9, 0xaf, 0x8e, 0x83, 0x0f, 0xc7, 0x11, 0xe1, 0x3c, 0xd6,
+       0x65, 0xee, 0x7f, 0xe5, 0x81, 0xfa, 0xbe, 0x40, 0x39, 0x86, 0x35, 0xa1,
+       0x37, 0xd6, 0x75, 0xe4, 0x9d, 0x2c, 0xe4, 0xdf, 0x6d, 0x5a, 0xc0, 0x81,
+       0xfa, 0x1c, 0x63, 0x96, 0x02, 0xdf, 0xa3, 0xb4, 0xaf, 0x44, 0x1f, 0x52,
+       0x9f, 0x43, 0xde, 0xb6, 0x8b, 0x72, 0x6c, 0x24, 0xa7, 0xb3, 0xfd, 0xaa,
+       0xdc, 0xc7, 0xf9, 0xa2, 0x99, 0xc8, 0x7e, 0x42, 0xa9, 0x76, 0xc9, 0xa9,
+       0xfb, 0xe8, 0x93, 0x50, 0x7b, 0xb4, 0x13, 0xce, 0xf5, 0x73, 0xa6, 0x2a,
+       0xb1, 0xef, 0x06, 0x68, 0xf0, 0xbc, 0x49, 0x6a, 0xdd, 0xe7, 0xef, 0x0c,
+       0xfc, 0x0d, 0x04, 0xf1, 0x63, 0xd3, 0x6e, 0xd0, 0x43, 0xae, 0x71, 0x96,
+       0x2b, 0xac, 0xcb, 0x3a, 0x85, 0x79, 0x1f, 0x52, 0xd3, 0x6f, 0x33, 0xef,
+       0x66, 0x67, 0x99, 0x88, 0x1f, 0xc6, 0x5d, 0x9f, 0x73, 0xde, 0x97, 0x34,
+       0xba, 0x49, 0x12, 0x37, 0xad, 0x87, 0x91, 0x0b, 0x0f, 0x83, 0x26, 0x94,
+       0x98, 0x93, 0xf6, 0x15, 0x39, 0x8d, 0xa7, 0x0d, 0xf3, 0x58, 0xd6, 0x87,
+       0xdf, 0x43, 0xc4, 0x59, 0x25, 0x3b, 0x6f, 0xd0, 0x67, 0xdf, 0x87, 0xcf,
+       0xde, 0xc8, 0xf6, 0x00, 0x87, 0xed, 0x02, 0xf6, 0xb1, 0x8c, 0x8c, 0x2f,
+       0x4c, 0xb3, 0x65, 0x0c, 0xf3, 0x99, 0xdc, 0x81, 0xc7, 0x47, 0x03, 0x3c,
+       0x6c, 0xbe, 0x9b, 0x55, 0x4f, 0x7b, 0x6c, 0xf9, 0x57, 0x87, 0x9e, 0xd1,
+       0x93, 0xdc, 0xa7, 0xe2, 0x1e, 0x5c, 0x9b, 0xc5, 0x72, 0xfe, 0x97, 0xc5,
+       0x61, 0xbe, 0xa7, 0xb2, 0x73, 0xfc, 0x34, 0x36, 0x3c, 0x8c, 0xc9, 0x8d,
+       0x01, 0xd9, 0x8d, 0x1d, 0xce, 0xdd, 0xa5, 0xa3, 0x35, 0x50, 0xd8, 0xdf,
+       0xb4, 0x80, 0xf3, 0x33, 0x9e, 0xb7, 0xfd, 0x83, 0x7d, 0xf5, 0xb3, 0x7d,
+       0xd4, 0xf8, 0x9c, 0x3e, 0xfa, 0x72, 0x87, 0x71, 0x23, 0xf5, 0xd1, 0xfa,
+       0x1d, 0x3e, 0x8a, 0xfa, 0xc8, 0xce, 0xfd, 0x93, 0xe3, 0x25, 0xf7, 0xcf,
+       0xfc, 0x99, 0x63, 0x1c, 0xb8, 0x9c, 0xe1, 0x5c, 0x13, 0x38, 0x57, 0x95,
+       0x79, 0xcf, 0x2d, 0x57, 0x29, 0x8d, 0xe5, 0x55, 0xc4, 0x72, 0x55, 0xe3,
+       0x3c, 0xc8, 0x31, 0xcc, 0x74, 0x1c, 0xc7, 0x4c, 0x37, 0x96, 0xd1, 0x61,
+       0x44, 0x3c, 0x57, 0xb3, 0x78, 0x6e, 0x75, 0x5d, 0xa7, 0x9a, 0xc5, 0x73,
+       0x0b, 0x31, 0xdc, 0xce, 0xe2, 0xb9, 0x95, 0xc5, 0x33, 0x7f, 0xdf, 0xd3,
+       0x2a, 0x9c, 0x1b, 0x5d, 0x27, 0x06, 0xc6, 0xb5, 0x25, 0xcf, 0x06, 0xee,
+       0x09, 0x19, 0xbb, 0x79, 0x5c, 0xdc, 0xf1, 0x1d, 0x0c, 0xf7, 0xf9, 0x34,
+       0xd7, 0xd4, 0x90, 0x6b, 0x2e, 0x20, 0xd7, 0xf4, 0x06, 0xbe, 0x83, 0x9d,
+       0x97, 0xb9, 0xe6, 0xeb, 0xc5, 0x3c, 0xd7, 0xf4, 0xb2, 0x5c, 0xd3, 0x93,
+       0xb9, 0xe6, 0xab, 0x45, 0xce, 0x35, 0x4d, 0x3a, 0x5a, 0x1c, 0xcc, 0x35,
+       0xcd, 0xa1, 0x5c, 0x93, 0xd3, 0xf2, 0xfc, 0x4e, 0xb9, 0x26, 0xd7, 0xd9,
+       0xbd, 0x6a, 0x92, 0x7c, 0x0f, 0xcb, 0xca, 0xb8, 0xc4, 0x78, 0x9c, 0xd6,
+       0xfc, 0x57, 0x92, 0x3c, 0x96, 0x4e, 0xe3, 0x1c, 0xbc, 0x77, 0x77, 0x8a,
+       0x25, 0x33, 0x8b, 0xa5, 0xdd, 0x29, 0x4d, 0x77, 0x30, 0x9e, 0x4e, 0x17,
+       0x87, 0xe3, 0x29, 0xe7, 0x93, 0xc7, 0x53, 0xca, 0xf3, 0x3d, 0xad, 0xcc,
+       0x35, 0x02, 0xfa, 0x6d, 0xd7, 0x5f, 0xc0, 0xec, 0xa5, 0xfe, 0x2c, 0x6a,
+       0x6e, 0x9d, 0xae, 0xe6, 0x78, 0x23, 0xbf, 0x09, 0x61, 0xec, 0xe7, 0xb2,
+       0x16, 0xb7, 0xd7, 0x7a, 0xa8, 0xbb, 0xdf, 0x01, 0x8e, 0x5c, 0x94, 0xeb,
+       0x9f, 0x88, 0xab, 0x68, 0x09, 0xdb, 0x5e, 0xbe, 0xef, 0x17, 0x38, 0xcf,
+       0xb5, 0xce, 0xe3, 0xe9, 0xd9, 0x7e, 0xae, 0x13, 0x5e, 0xe7, 0xb9, 0xbf,
+       0x23, 0x9f, 0xa0, 0x66, 0xdf, 0xde, 0xcb, 0xfd, 0x8f, 0x87, 0x3b, 0x3b,
+       0xf4, 0xfa, 0x50, 0x0f, 0x94, 0xf6, 0x3e, 0x75, 0xf9, 0x8d, 0x97, 0x6b,
+       0x97, 0xe8, 0x0b, 0x2a, 0x9d, 0xa2, 0xaf, 0xf9, 0x3c, 0xa7, 0x52, 0xed,
+       0x31, 0x21, 0x9e, 0x41, 0x1d, 0xf3, 0xd4, 0x50, 0x1d, 0x53, 0xa4, 0x89,
+       0x47, 0x06, 0x7b, 0xc8, 0x2d, 0x31, 0x31, 0xed, 0x9e, 0x0f, 0x29, 0x54,
+       0x6a, 0x1b, 0x5c, 0xe7, 0x6e, 0xd7, 0xb5, 0x44, 0xfb, 0x6e, 0x09, 0x75,
+       0x9a, 0xf3, 0xe2, 0x6f, 0x33, 0x5d, 0x61, 0xed, 0xdc, 0x2d, 0x60, 0x6b,
+       0x55, 0x7e, 0x0b, 0x0e, 0x37, 0xf8, 0x1c, 0x7e, 0xc7, 0x98, 0x70, 0xcd,
+       0x73, 0xb7, 0xef, 0xb3, 0x3a, 0xec, 0xe2, 0x3a, 0xc7, 0x35, 0x92, 0xdf,
+       0x37, 0x56, 0x7c, 0xf7, 0xa7, 0x2d, 0x4a, 0x71, 0xa2, 0xea, 0x2f, 0x41,
+       0x16, 0xd4, 0x9d, 0xd6, 0x32, 0x6c, 0x33, 0x0d, 0x5c, 0x72, 0x9d, 0x47,
+       0x54, 0x5b, 0xe2, 0xf8, 0x2a, 0x78, 0x6b, 0x8f, 0x70, 0x4d, 0xf9, 0xb1,
+       0x58, 0xed, 0xcb, 0x7c, 0xec, 0xb3, 0x8f, 0xc4, 0xc9, 0x5e, 0x95, 0xc7,
+       0x30, 0xe1, 0xe7, 0x02, 0x71, 0x2d, 0xb9, 0xb3, 0xff, 0xd8, 0x56, 0xf5,
+       0x9c, 0x63, 0xd5, 0xba, 0x8e, 0xb5, 0xd0, 0x55, 0xe1, 0xdd, 0xfb, 0x4c,
+       0xda, 0x03, 0x9b, 0x20, 0x1f, 0xd3, 0x7d, 0x90, 0xe5, 0x92, 0x63, 0xc5,
+       0xa8, 0x0f, 0xbf, 0xa7, 0xb9, 0xd6, 0x53, 0xa4, 0x98, 0x54, 0xba, 0x25,
+       0xd2, 0x6f, 0x33, 0x8e, 0x55, 0xdd, 0x3e, 0xfb, 0x16, 0xce, 0x66, 0x99,
+       0x38, 0x46, 0x39, 0x5f, 0x2e, 0x2a, 0x4b, 0xd0, 0xd1, 0xb1, 0x8d, 0x5d,
+       0xc0, 0x35, 0xce, 0x97, 0x07, 0xb2, 0x6f, 0x50, 0xb0, 0x0f, 0xee, 0xff,
+       0xfa, 0x1d, 0xf5, 0x67, 0x5e, 0x67, 0x32, 0xbd, 0x10, 0xcd, 0x79, 0x3e,
+       0x9f, 0x20, 0xcb, 0xd4, 0xcc, 0x25, 0xd9, 0x13, 0xcd, 0xa2, 0xee, 0xe3,
+       0x51, 0xa0, 0x26, 0xe2, 0xef, 0x61, 0xae, 0x55, 0xc7, 0x73, 0x35, 0x7b,
+       0x6e, 0x72, 0xbf, 0x34, 0xcf, 0x3c, 0xb8, 0x6f, 0xe2, 0xf8, 0xf9, 0x27,
+       0x6e, 0xb7, 0x92, 0x82, 0x90, 0x18, 0x00, 0x00, 0x00 };
 
 static const u32 bnx2_TPAT_b09FwData[(0x0/4) + 1] = { 0x0 };
 static const u32 bnx2_TPAT_b09FwRodata[(0x0/4) + 1] = { 0x0 };
 
 static struct fw_info bnx2_tpat_fw_09 = {
+       /* Firmware version:  3.7.1 */
        .ver_major                      = 0x3,
-       .ver_minor                      = 0x4,
-       .ver_fix                        = 0x3,
+       .ver_minor                      = 0x7,
+       .ver_fix                        = 0x1,
 
        .start_addr                     = 0x08000860,
 
        .text_addr                      = 0x08000800,
-       .text_len                       = 0x1864,
+       .text_len                       = 0x188c,
        .text_index                     = 0x0,
        .gz_text                        = bnx2_TPAT_b09FwText,
        .gz_text_len                    = sizeof(bnx2_TPAT_b09FwText),
 
-       .data_addr                      = 0x08002080,
+       .data_addr                      = 0x080020c0,
        .data_len                       = 0x0,
        .data_index                     = 0x0,
        .data                           = bnx2_TPAT_b09FwData,
 
-       .sbss_addr                      = 0x08002088,
-       .sbss_len                       = 0x2c,
+       .sbss_addr                      = 0x080020c8,
+       .sbss_len                       = 0x30,
        .sbss_index                     = 0x0,
 
-       .bss_addr                       = 0x080020c0,
+       .bss_addr                       = 0x08002100,
        .bss_len                        = 0x850,
        .bss_index                      = 0x0,
 
@@ -3267,768 +3289,770 @@ static struct fw_info bnx2_tpat_fw_09 = {
 };
 
 static u8 bnx2_TXP_b09FwText[] = {
-/*     0x1f, 0x8b, 0x08, 0x00, 0x0e, 0x34, 0xe7, 0x45, 0x00, 0x03, */
-                                                                   0xcd, 0x7c,
-       0x6f, 0x70, 0x5b, 0xd7, 0x95, 0xdf, 0x79, 0xef, 0x81, 0x24, 0x48, 0xd1,
-       0xd4, 0x13, 0x17, 0x56, 0x60, 0x87, 0x71, 0x00, 0xf1, 0x81, 0x66, 0x42,
-       0xae, 0x04, 0x2b, 0x4c, 0xc2, 0x6d, 0xd1, 0xf8, 0x05, 0x00, 0x29, 0x48,
-       0xd1, 0x6c, 0x68, 0x95, 0x49, 0x94, 0x54, 0xe3, 0x62, 0x41, 0x52, 0xf1,
-       0xb6, 0xce, 0x54, 0x9b, 0x78, 0x5a, 0x4d, 0xeb, 0xad, 0x11, 0x90, 0xfa,
-       0xe7, 0x85, 0x04, 0xda, 0x62, 0x44, 0x7f, 0xc8, 0x07, 0x18, 0x80, 0x24,
-       0x6f, 0xf2, 0x44, 0x28, 0x9b, 0x7f, 0xfd, 0xd0, 0xac, 0x50, 0x4a, 0xd6,
-       0xba, 0x9b, 0xb4, 0xa3, 0xed, 0x66, 0x67, 0x3b, 0xd3, 0x2f, 0x1c, 0x49,
-       0xf6, 0x7a, 0x77, 0x67, 0x36, 0xda, 0x6e, 0xb6, 0xab, 0xb6, 0xb2, 0xd1,
-       0xdf, 0xef, 0xbe, 0xf7, 0x28, 0x90, 0xa6, 0x6c, 0xcb, 0xb3, 0xed, 0x94,
-       0x33, 0x18, 0xe0, 0xdd, 0x77, 0xdf, 0xb9, 0xe7, 0x9e, 0x73, 0xee, 0x39,
-       0xe7, 0x77, 0xee, 0x7d, 0x0c, 0x8b, 0x74, 0x89, 0xf7, 0xf7, 0x00, 0x3e,
-       0x91, 0x43, 0x87, 0x9f, 0xd9, 0x3e, 0xb2, 0xfd, 0x13, 0xf8, 0xf9, 0x09,
-       0x31, 0x02, 0x06, 0x6f, 0xbe, 0x69, 0x88, 0x64, 0xff, 0x42, 0x3e, 0xf0,
-       0x1f, 0x1e, 0x37, 0x7d, 0xfa, 0xfc, 0x48, 0x50, 0x4f, 0x4c, 0xec, 0x4a,
-       0x5a, 0x12, 0x34, 0x12, 0xb2, 0x6f, 0xca, 0x12, 0xb1, 0x9d, 0xa1, 0x48,
-       0x4a, 0xde, 0x6a, 0xe6, 0x43, 0x01, 0x61, 0xfb, 0x47, 0x12, 0x77, 0x9e,
-       0xfb, 0xc9, 0xa7, 0xa3, 0xb7, 0xca, 0x86, 0x04, 0xcd, 0x44, 0x56, 0xcc,
-       0x01, 0x09, 0xf6, 0xe1, 0x99, 0x6f, 0x3f, 0x6a, 0x18, 0xd2, 0xb3, 0xca,
-       0xab, 0xcc, 0x95, 0x56, 0x9a, 0x3f, 0x79, 0x34, 0x2c, 0xbf, 0x57, 0x0f,
-       0xc9, 0xf7, 0xea, 0xa6, 0x5c, 0xac, 0x07, 0xb4, 0xf1, 0x92, 0x29, 0xb3,
-       0xa5, 0x69, 0xfd, 0x48, 0x31, 0x2f, 0xa9, 0x7a, 0x56, 0x2f, 0x2c, 0x98,
-       0x3d, 0xc9, 0xf3, 0x39, 0x7d, 0x76, 0xa1, 0xb7, 0x27, 0x75, 0x7e, 0x5a,
-       0x2f, 0x14, 0xc3, 0x3d, 0xc9, 0xba, 0xd9, 0x93, 0x5a, 0x0c, 0xe1, 0xba,
-       0xb7, 0x27, 0xb9, 0x18, 0x9d, 0x17, 0xd9, 0x8a, 0x3e, 0xe1, 0x9e, 0x54,
-       0x29, 0x9a, 0x15, 0xe9, 0x8f, 0xbf, 0x2a, 0x7d, 0x3d, 0xa9, 0xfa, 0x3f,
-       0xd1, 0x1b, 0xa6, 0x26, 0x85, 0x5f, 0x15, 0x33, 0x9c, 0xb8, 0xd5, 0x7c,
-       0xc8, 0xd2, 0xc4, 0xb4, 0x6e, 0x37, 0xb7, 0x58, 0x41, 0xc9, 0x9d, 0xee,
-       0x14, 0x5b, 0xcd, 0xc9, 0x94, 0xdc, 0xe2, 0x90, 0xb9, 0x2c, 0x6d, 0x62,
-       0x87, 0xfc, 0xeb, 0x66, 0x33, 0x19, 0xff, 0x32, 0xe5, 0x8a, 0x71, 0xa4,
-       0x67, 0xbc, 0x2e, 0x92, 0x2c, 0x05, 0x25, 0x19, 0x7f, 0xab, 0xe9, 0x3e,
-       0x13, 0xc4, 0x98, 0x81, 0x9e, 0xb1, 0x52, 0xb3, 0x99, 0x8e, 0x83, 0x7e,
-       0xdc, 0x7f, 0xb6, 0x4d, 0xca, 0x21, 0xbb, 0x3c, 0x1b, 0xff, 0x6f, 0xba,
-       0xab, 0x13, 0xce, 0x91, 0xd7, 0xb6, 0xe8, 0x56, 0x5e, 0x72, 0x21, 0x29,
-       0x17, 0xe2, 0x9f, 0x92, 0x13, 0xf1, 0x30, 0xe6, 0x17, 0x94, 0x63, 0x71,
-       0xc8, 0xd1, 0x3a, 0xac, 0x25, 0xeb, 0xd1, 0x48, 0x56, 0x9e, 0x97, 0xe4,
-       0x62, 0xbf, 0x99, 0x16, 0x8c, 0x6d, 0x35, 0x3f, 0x9a, 0x8c, 0x63, 0xbc,
-       0xe1, 0xff, 0xd5, 0xb4, 0x43, 0xd1, 0x6c, 0x59, 0x06, 0xa5, 0x50, 0xea,
-       0x8f, 0xff, 0x4c, 0x34, 0x09, 0x5a, 0x62, 0x4f, 0x59, 0x26, 0xe4, 0x16,
-       0x1d, 0x4c, 0x19, 0x4d, 0xd9, 0x83, 0xf1, 0x93, 0x16, 0xee, 0xd7, 0x65,
-       0xb3, 0x6e, 0xb5, 0x4b, 0xc1, 0x94, 0x50, 0x97, 0x3c, 0x22, 0x85, 0xd3,
-       0x68, 0x8f, 0xdb, 0xbd, 0x3a, 0x9e, 0xc9, 0x8c, 0xb0, 0x4d, 0x34, 0x23,
-       0x11, 0x33, 0x53, 0xe0, 0xa8, 0xe2, 0x0c, 0x62, 0xfc, 0x98, 0xdd, 0xa9,
-       0x99, 0xb2, 0x62, 0x06, 0xa4, 0xea, 0xc4, 0xec, 0xb0, 0xd6, 0x2e, 0xc7,
-       0x62, 0x5d, 0x90, 0x69, 0x18, 0xb4, 0xe5, 0x9b, 0x7a, 0x22, 0x16, 0xce,
-       0x41, 0x51, 0x3a, 0x64, 0x35, 0x07, 0x7e, 0xe6, 0xe2, 0x59, 0x2d, 0x55,
-       0xff, 0x8a, 0x96, 0x3c, 0xbf, 0x5f, 0xdb, 0x75, 0x1e, 0x7d, 0xea, 0xe7,
-       0x3c, 0xbb, 0x0b, 0x83, 0x37, 0x1d, 0xcf, 0xb2, 0x1d, 0x3c, 0x2b, 0xde,
-       0xd1, 0x06, 0x5d, 0x36, 0x26, 0x43, 0x3d, 0x49, 0xa5, 0x4b, 0xf2, 0xa6,
-       0x4b, 0x6e, 0x42, 0x93, 0x5e, 0xcb, 0x96, 0xe0, 0x27, 0xa1, 0xcf, 0x45,
-       0xe8, 0x72, 0x31, 0x22, 0x47, 0x4a, 0x12, 0xd2, 0x85, 0x63, 0x65, 0xf5,
-       0xaa, 0x43, 0x7b, 0x80, 0x6e, 0xa1, 0xfb, 0x82, 0xc3, 0x67, 0xa1, 0xc3,
-       0x52, 0x1a, 0xf2, 0xc9, 0x60, 0xec, 0x7d, 0xda, 0x9e, 0xea, 0xa4, 0x96,
-       0x81, 0x9d, 0x14, 0x4e, 0x0f, 0x41, 0x77, 0xd1, 0xc8, 0x8a, 0x6c, 0x96,
-       0x82, 0x65, 0x45, 0xbe, 0x2c, 0xdd, 0x72, 0x6c, 0xd1, 0x92, 0x23, 0x8b,
-       0x21, 0xc9, 0x9b, 0x51, 0xb3, 0x26, 0x7d, 0xd9, 0x4d, 0x89, 0x1e, 0x79,
-       0xfe, 0x74, 0x34, 0x53, 0x96, 0x7e, 0xfb, 0x75, 0xdc, 0xcf, 0x9d, 0xa4,
-       0x4e, 0x25, 0x9f, 0x8a, 0x1b, 0x92, 0x85, 0x4d, 0x18, 0xd6, 0x1f, 0x81,
-       0xff, 0xe6, 0x73, 0xc9, 0x78, 0x34, 0x2c, 0xa2, 0x4b, 0xea, 0x0b, 0xfd,
-       0xe6, 0x6e, 0x89, 0x9a, 0x19, 0xca, 0x3f, 0x3e, 0x04, 0x3d, 0xfc, 0x77,
-       0xca, 0x1e, 0xb4, 0xa8, 0xe3, 0xa1, 0xf0, 0x31, 0xe8, 0x32, 0xab, 0x74,
-       0xdc, 0x83, 0xf1, 0x03, 0x9e, 0xed, 0xf4, 0x48, 0xbe, 0x7a, 0xc3, 0x93,
-       0x43, 0x8f, 0xcc, 0x57, 0xbb, 0xa5, 0x00, 0x1d, 0x16, 0xc4, 0x92, 0xc2,
-       0xf9, 0x3f, 0xf7, 0xda, 0x2d, 0x99, 0x3b, 0xff, 0x32, 0xec, 0xe1, 0xb0,
-       0xb6, 0xbf, 0xfe, 0x0b, 0xcd, 0xb3, 0x1f, 0xd8, 0x5f, 0x50, 0xec, 0x89,
-       0xa0, 0x9c, 0xab, 0xbb, 0xf6, 0x57, 0xc1, 0x1a, 0xb3, 0x4d, 0x1b, 0xb6,
-       0xf4, 0xc6, 0x6a, 0x9f, 0x73, 0xf5, 0x3e, 0x3c, 0x1b, 0x94, 0x23, 0x75,
-       0xf6, 0xcf, 0xc3, 0xc6, 0x82, 0xb2, 0xf4, 0x68, 0xb7, 0x64, 0xd1, 0x5e,
-       0x58, 0x14, 0x3b, 0x19, 0xd7, 0xf1, 0x4c, 0x0f, 0xe6, 0xb2, 0x15, 0x9f,
-       0x2e, 0x99, 0xaa, 0x76, 0xd8, 0x86, 0x15, 0x92, 0xa9, 0x3a, 0xf5, 0x8f,
-       0xef, 0x92, 0x6f, 0x03, 0x94, 0x2f, 0xdb, 0xf9, 0x1c, 0xdb, 0x4d, 0xb4,
-       0xb7, 0xb6, 0xd1, 0xb6, 0x37, 0x53, 0xa6, 0x83, 0x82, 0xb6, 0x5c, 0x29,
-       0x66, 0xee, 0xe7, 0x77, 0x9d, 0xf6, 0xd0, 0x6a, 0x0b, 0x01, 0xf4, 0x87,
-       0x1e, 0xab, 0x18, 0xeb, 0xf4, 0x9d, 0x66, 0xdb, 0x08, 0xae, 0x2d, 0x2c,
-       0xaa, 0x2e, 0x8e, 0x1d, 0x00, 0x5f, 0xba, 0x64, 0xab, 0x8a, 0xb7, 0x08,
-       0x6d, 0xc0, 0x9d, 0x47, 0x9f, 0xcc, 0x2e, 0x76, 0xf7, 0xa4, 0x17, 0xd9,
-       0x9e, 0x0c, 0x1b, 0x98, 0xe7, 0x54, 0x5c, 0x1a, 0x73, 0x71, 0xbd, 0x3f,
-       0x00, 0xbe, 0xa6, 0xb1, 0xe0, 0x30, 0x0f, 0x8f, 0xc7, 0x06, 0xee, 0xf7,
-       0xca, 0xd4, 0x79, 0xf6, 0xe5, 0x18, 0x85, 0x2d, 0xba, 0x24, 0xc0, 0x1b,
-       0x3e, 0x56, 0x14, 0xf7, 0x3b, 0x31, 0x4e, 0x37, 0x6c, 0x27, 0x83, 0x31,
-       0x9b, 0x8f, 0x27, 0xe3, 0xbd, 0x92, 0x5d, 0xed, 0x2b, 0xb0, 0x3b, 0xf6,
-       0x1f, 0x5c, 0xd7, 0x17, 0xf2, 0x3d, 0x0f, 0x9a, 0x8b, 0x9d, 0x90, 0x21,
-       0xdb, 0x75, 0xf0, 0xdc, 0x01, 0x1e, 0x82, 0x98, 0x4f, 0x3f, 0xd6, 0x43,
-       0x07, 0xe8, 0x6f, 0xc2, 0x9c, 0x3a, 0x65, 0xfa, 0x74, 0x2f, 0x74, 0x61,
-       0xa2, 0x6f, 0x50, 0x9e, 0x2f, 0x45, 0x61, 0x03, 0xec, 0x0f, 0x1d, 0x2c,
-       0x46, 0xc3, 0x55, 0xb1, 0x65, 0x2e, 0xde, 0x01, 0xfb, 0x6a, 0x36, 0x67,
-       0x60, 0x1f, 0xdf, 0x51, 0xfe, 0x62, 0xc8, 0x1c, 0xd3, 0x24, 0xdf, 0x91,
-       0x38, 0x0c, 0x7e, 0xa2, 0x4f, 0x89, 0xf0, 0x7a, 0x87, 0xc6, 0x35, 0x0b,
-       0x39, 0x72, 0x6c, 0xf8, 0xa4, 0xad, 0x90, 0x21, 0xfd, 0x56, 0x1f, 0xec,
-       0x39, 0xac, 0xfc, 0xc9, 0xd8, 0x86, 0xfe, 0x24, 0x3a, 0x51, 0xc6, 0x58,
-       0x85, 0xf3, 0x01, 0xfa, 0xb0, 0x51, 0x2c, 0x57, 0x79, 0x00, 0x6b, 0x6f,
-       0x56, 0xd9, 0xc7, 0x09, 0xce, 0xb7, 0xf9, 0xf9, 0x38, 0xf9, 0xe2, 0x7c,
-       0x6d, 0x3c, 0x4b, 0x1b, 0x8c, 0x1e, 0xb6, 0xd5, 0xf8, 0x27, 0xbc, 0xf1,
-       0x5d, 0xde, 0x0b, 0xa5, 0x1e, 0x2d, 0xa5, 0x78, 0xf0, 0xe9, 0x88, 0x2c,
-       0x9f, 0xec, 0x37, 0xf7, 0xc0, 0x86, 0xe9, 0xa7, 0x96, 0x2f, 0x50, 0xc7,
-       0xa0, 0x31, 0x42, 0x1d, 0x9b, 0x8a, 0xbf, 0xe4, 0x22, 0xd7, 0x9e, 0xf4,
-       0x19, 0x42, 0x1f, 0x01, 0x9f, 0x8b, 0xb5, 0x38, 0xeb, 0xad, 0xc5, 0x9c,
-       0x43, 0xfb, 0x7b, 0x06, 0xcf, 0xea, 0x32, 0x16, 0xa3, 0x7f, 0x78, 0x5e,
-       0x52, 0xf0, 0x91, 0xd0, 0xa3, 0x54, 0x31, 0x97, 0x4a, 0xa9, 0xd5, 0x6f,
-       0xc1, 0xb6, 0x86, 0xff, 0xae, 0xe9, 0xfa, 0x43, 0xfa, 0x06, 0xfa, 0x9a,
-       0x82, 0xa9, 0x43, 0x72, 0x3a, 0x9c, 0x21, 0x74, 0x13, 0x4f, 0x1a, 0xd1,
-       0x4c, 0x16, 0x7c, 0x4d, 0x59, 0x4d, 0xb1, 0x1e, 0x13, 0x44, 0x0c, 0xf4,
-       0xa9, 0xcb, 0x4e, 0xdf, 0x3f, 0x2d, 0x3b, 0xbe, 0x2e, 0xa8, 0x57, 0xea,
-       0xc1, 0xf7, 0x11, 0x01, 0xb9, 0x0c, 0xdf, 0x35, 0x57, 0xea, 0x96, 0x06,
-       0x78, 0xba, 0xe2, 0xf8, 0xb6, 0x66, 0x78, 0xb6, 0xc6, 0x67, 0xba, 0xf1,
-       0x7c, 0x00, 0x7e, 0x4d, 0xf2, 0x46, 0x02, 0xbf, 0x8b, 0xa4, 0xc9, 0x36,
-       0xdf, 0xce, 0xb9, 0x66, 0xa2, 0x76, 0x59, 0xda, 0x25, 0x13, 0x43, 0xfc,
-       0x58, 0xd4, 0x31, 0x56, 0x1f, 0x7c, 0x79, 0x40, 0x0e, 0x96, 0x42, 0xf2,
-       0xd5, 0x12, 0xe7, 0x95, 0xd6, 0x52, 0xd0, 0x5b, 0x72, 0xb1, 0x09, 0x9d,
-       0x8f, 0xc3, 0xe7, 0x65, 0xb4, 0x31, 0xf8, 0x9f, 0xdd, 0xd5, 0xaf, 0x68,
-       0xe9, 0xf3, 0x59, 0x6d, 0xbc, 0xbe, 0x5f, 0xcb, 0x9c, 0x9f, 0xd4, 0x76,
-       0xb5, 0xf8, 0x22, 0xd1, 0xde, 0xdd, 0x17, 0x9d, 0x38, 0xcd, 0x31, 0xfb,
-       0xe3, 0x1b, 0xfb, 0xa2, 0x5f, 0x6a, 0xad, 0xbe, 0xa8, 0x1f, 0xbe, 0x28,
-       0x03, 0x5f, 0x34, 0x7e, 0xdf, 0xbe, 0xa8, 0x5d, 0xdf, 0xd8, 0x17, 0x75,
-       0xeb, 0x77, 0x7d, 0x11, 0x63, 0xcf, 0xbf, 0xc6, 0xb5, 0x29, 0xdb, 0x76,
-       0xfa, 0x72, 0x0e, 0xc3, 0x0f, 0x6f, 0x82, 0xac, 0xbb, 0xb8, 0x76, 0x22,
-       0x05, 0xd8, 0xfd, 0x34, 0xc6, 0xfa, 0x4d, 0xd8, 0xfb, 0xb6, 0x98, 0x65,
-       0x3e, 0xa1, 0xc6, 0x7d, 0xa7, 0xce, 0xc7, 0x56, 0x75, 0x4e, 0x1e, 0xdf,
-       0x53, 0xe7, 0xb6, 0xab, 0x73, 0xea, 0xba, 0x53, 0x66, 0xd4, 0xb8, 0x4d,
-       0x09, 0x3c, 0x26, 0xf0, 0x2a, 0xf2, 0x59, 0x23, 0x11, 0x05, 0x3d, 0x1d,
-       0xe3, 0x53, 0x5f, 0x31, 0xf0, 0x20, 0xd0, 0x6f, 0xb7, 0xf2, 0x45, 0xbb,
-       0xa0, 0xf7, 0x65, 0xe7, 0xfe, 0x74, 0x95, 0x69, 0xd1, 0xd5, 0x9e, 0x35,
-       0xba, 0xea, 0x90, 0xe1, 0x98, 0xaf, 0xa3, 0xcd, 0x92, 0x8c, 0x51, 0x67,
-       0xf7, 0xa3, 0xab, 0x7f, 0xaa, 0xff, 0xfd, 0xe8, 0xea, 0xb7, 0xee, 0xa1,
-       0xab, 0x7f, 0xb5, 0x4e, 0x57, 0x96, 0xf9, 0x82, 0x46, 0xda, 0x8c, 0x1f,
-       0xf4, 0x47, 0xcd, 0x8f, 0x4e, 0x31, 0x7f, 0xa8, 0x73, 0x4d, 0xfb, 0x79,
-       0x07, 0xd7, 0xf3, 0xa5, 0xa6, 0x61, 0x59, 0x90, 0x1d, 0xd7, 0x34, 0xe5,
-       0x16, 0x35, 0x3f, 0x4f, 0xfe, 0x11, 0x3b, 0xa6, 0x10, 0x6b, 0x5c, 0x1e,
-       0xda, 0xa5, 0xbc, 0xc5, 0xed, 0x3f, 0x55, 0x6a, 0xfe, 0x42, 0x4f, 0xbc,
-       0xdd, 0x4c, 0x8e, 0x58, 0x5e, 0x1c, 0x08, 0xca, 0xd7, 0xaa, 0xd1, 0xac,
-       0xad, 0x75, 0x4b, 0xfe, 0x41, 0xc4, 0x9e, 0x12, 0xfd, 0xd7, 0xd6, 0x7b,
-       0xc4, 0xe8, 0x3e, 0x2f, 0x46, 0x57, 0xc1, 0x2b, 0xf3, 0xab, 0xef, 0xbe,
-       0xd5, 0x08, 0xf1, 0x3b, 0x66, 0xee, 0x93, 0x2f, 0x73, 0x8e, 0x88, 0xf7,
-       0x8c, 0xfb, 0x16, 0x73, 0x9e, 0x7c, 0x20, 0xd1, 0x25, 0xf9, 0x2d, 0x5c,
-       0x8f, 0xf4, 0x73, 0xf4, 0x5d, 0xed, 0x1e, 0xdf, 0x7e, 0x8e, 0xa4, 0x78,
-       0x33, 0x30, 0x65, 0xf4, 0x41, 0x3e, 0x54, 0xe2, 0x3c, 0xde, 0xf2, 0xec,
-       0x89, 0xb9, 0x82, 0xb4, 0xb9, 0xbe, 0x61, 0x2f, 0x72, 0x01, 0xda, 0x81,
-       0xaf, 0x73, 0xea, 0x9b, 0x39, 0x82, 0x44, 0x74, 0x8b, 0x39, 0x82, 0x98,
-       0x46, 0x62, 0x9f, 0x66, 0x43, 0xf7, 0x36, 0x74, 0x6f, 0x43, 0xf7, 0x36,
-       0x74, 0x9f, 0xac, 0x1f, 0xc6, 0x3d, 0x95, 0x87, 0x80, 0x17, 0x97, 0x7e,
-       0xda, 0xa5, 0x0f, 0x3e, 0xb7, 0x4a, 0x4e, 0xe9, 0x84, 0xf3, 0x45, 0xae,
-       0xa1, 0xfc, 0xf5, 0xb8, 0xe6, 0xfa, 0x6b, 0xd2, 0xcb, 0xe0, 0xf9, 0xdb,
-       0x98, 0xa7, 0xad, 0xeb, 0xd6, 0x5d, 0x99, 0xcc, 0xb5, 0xc8, 0x64, 0xd6,
-       0xa1, 0x8c, 0xd8, 0x9f, 0x3e, 0x77, 0x5a, 0xaf, 0xac, 0xca, 0x65, 0x2f,
-       0x78, 0xe8, 0xe0, 0xdc, 0xbd, 0x79, 0x90, 0x7e, 0xaf, 0x47, 0xff, 0x6f,
-       0xd1, 0x87, 0xfe, 0x75, 0xa3, 0x71, 0x39, 0x26, 0x73, 0xc6, 0x77, 0x9b,
-       0x0f, 0x72, 0x66, 0xac, 0x81, 0xef, 0x21, 0x96, 0x5f, 0x44, 0x2c, 0x59,
-       0x31, 0x22, 0xf2, 0x93, 0x47, 0xaf, 0x21, 0x97, 0x96, 0xfc, 0xc3, 0x89,
-       0x66, 0x24, 0x90, 0x78, 0xab, 0x39, 0x37, 0x82, 0x18, 0x97, 0x88, 0x86,
-       0x93, 0xc6, 0xb0, 0x5c, 0xaa, 0x0f, 0xca, 0x8f, 0xea, 0x96, 0xfc, 0xb0,
-       0x1e, 0x91, 0x1f, 0x20, 0xe6, 0x7f, 0xbf, 0xde, 0x9a, 0x73, 0x47, 0x68,
-       0x4f, 0x3d, 0xe9, 0xfa, 0x46, 0xb9, 0x7f, 0x13, 0x34, 0xde, 0x82, 0x9d,
-       0x04, 0xb2, 0xc8, 0xf5, 0x19, 0xbf, 0x26, 0x0e, 0x15, 0x9f, 0x6b, 0x82,
-       0xb7, 0x6c, 0x5b, 0xc2, 0xca, 0xeb, 0x7a, 0xf7, 0xa8, 0xf9, 0x29, 0xb4,
-       0x39, 0xa3, 0x81, 0x6a, 0xb1, 0x53, 0xe5, 0x8b, 0xd0, 0x91, 0xd8, 0xf5,
-       0x60, 0xb0, 0x56, 0xbc, 0x85, 0x7e, 0xcd, 0xe6, 0xa1, 0xf8, 0x6f, 0xed,
-       0x30, 0xff, 0x81, 0x85, 0x35, 0xdd, 0xf9, 0x25, 0x23, 0xb1, 0x49, 0x66,
-       0x43, 0xdf, 0x6f, 0x98, 0x03, 0x7d, 0x59, 0x3d, 0x11, 0x94, 0x74, 0x91,
-       0x6b, 0x2a, 0x24, 0xb3, 0x55, 0x28, 0xff, 0x3c, 0xd7, 0x85, 0x3c, 0x3b,
-       0x17, 0xef, 0x86, 0xed, 0xff, 0x9a, 0xe1, 0xae, 0x03, 0x18, 0x50, 0x75,
-       0x50, 0xf2, 0xe0, 0x37, 0x5f, 0x7f, 0xcb, 0xc3, 0x0e, 0xf0, 0x2a, 0x5b,
-       0x21, 0xf8, 0xc4, 0x70, 0xda, 0x76, 0xfe, 0x30, 0x88, 0xb6, 0xe0, 0x56,
-       0xeb, 0xce, 0x26, 0x7c, 0x3f, 0x10, 0xb2, 0x88, 0x4d, 0x24, 0xf3, 0x05,
-       0x7c, 0xff, 0x4a, 0x42, 0x36, 0xf7, 0xe2, 0x7b, 0x4b, 0x02, 0x26, 0x99,
-       0x60, 0xcc, 0xd5, 0x5a, 0x62, 0xae, 0x68, 0x69, 0xc8, 0x6e, 0x0e, 0x73,
-       0x4f, 0x43, 0x9e, 0x5f, 0xac, 0x07, 0xb5, 0xd4, 0xe9, 0x47, 0xc0, 0x87,
-       0x9f, 0x3b, 0x23, 0x3f, 0x33, 0x97, 0xb7, 0x04, 0xe4, 0x16, 0x7c, 0x5c,
-       0x12, 0x7e, 0xcc, 0x46, 0x6e, 0xb1, 0x03, 0xcb, 0x35, 0xfa, 0x5f, 0xbf,
-       0x20, 0x5f, 0xf3, 0x78, 0x6b, 0x93, 0x05, 0x65, 0xa3, 0x6c, 0xcf, 0x67,
-       0xfe, 0xcd, 0xc0, 0xdd, 0xf6, 0x17, 0x57, 0xdb, 0xcb, 0x99, 0x7f, 0xb8,
-       0xda, 0xde, 0xdb, 0xe6, 0xf2, 0x3f, 0xaa, 0x4d, 0xd4, 0xf7, 0x78, 0x6d,
-       0xb7, 0xa1, 0xb3, 0x66, 0x93, 0xb9, 0x45, 0x01, 0xd8, 0x24, 0x1d, 0xa7,
-       0x2f, 0xbe, 0x1f, 0x5f, 0xbb, 0xc6, 0xcf, 0x9a, 0x49, 0x83, 0xb6, 0x10,
-       0x14, 0x97, 0x26, 0xef, 0x77, 0x20, 0x7f, 0xbf, 0x8d, 0xdf, 0x8c, 0xa3,
-       0x7e, 0x6e, 0xce, 0x3e, 0x7c, 0xfe, 0xcd, 0x7b, 0xd8, 0x4b, 0x08, 0xf6,
-       0xf2, 0xff, 0xab, 0x5d, 0x5c, 0xba, 0x1f, 0xbb, 0xc0, 0x9f, 0xb2, 0x0b,
-       0xd5, 0xff, 0xd2, 0xea, 0x5a, 0x09, 0x43, 0x3e, 0x8c, 0x07, 0x83, 0xd0,
-       0xf1, 0x66, 0x99, 0xb5, 0xc8, 0x8f, 0x15, 0xc9, 0xc1, 0x5f, 0x9e, 0x58,
-       0x17, 0xbb, 0xbb, 0x10, 0x0f, 0x8e, 0x9f, 0x8e, 0x8e, 0x32, 0x1e, 0xc4,
-       0xe0, 0x1b, 0x93, 0xef, 0x88, 0x07, 0x37, 0x8c, 0xd6, 0x78, 0x60, 0x20,
-       0x1e, 0xec, 0x7a, 0x97, 0x78, 0x70, 0xe2, 0x1d, 0xf1, 0x40, 0x83, 0x6c,
-       0x38, 0xbf, 0xbf, 0x35, 0xfc, 0x78, 0x50, 0x58, 0x13, 0x0f, 0x7c, 0x5d,
-       0x59, 0x0a, 0x0b, 0xdc, 0xd5, 0x5b, 0x97, 0xa7, 0x2b, 0x09, 0x06, 0x12,
-       0x8d, 0xcc, 0x9c, 0xf5, 0xb0, 0xb4, 0xc1, 0xe7, 0x5e, 0xaa, 0x8f, 0x40,
-       0x67, 0x97, 0x30, 0xf7, 0x68, 0x9c, 0x89, 0x65, 0x5b, 0x82, 0xeb, 0xe1,
-       0xcd, 0x08, 0x30, 0xe2, 0x6e, 0xe0, 0xbe, 0xdd, 0x67, 0xd5, 0xfa, 0x78,
-       0x33, 0xea, 0x61, 0xf7, 0x6d, 0xc0, 0xee, 0x78, 0x3e, 0x00, 0x4c, 0xc8,
-       0xf6, 0x2b, 0x66, 0x12, 0x7a, 0xaa, 0x3a, 0xf6, 0xee, 0x02, 0x3e, 0x73,
-       0xaa, 0xef, 0xad, 0x08, 0xfb, 0x76, 0x24, 0x12, 0xd1, 0x3f, 0xc3, 0x77,
-       0x7b, 0x22, 0xbc, 0xed, 0xaa, 0x45, 0xba, 0x87, 0xa2, 0x67, 0x15, 0x8d,
-       0x80, 0x14, 0xd4, 0xb3, 0x91, 0x6d, 0x7c, 0xf6, 0x18, 0x62, 0xf6, 0x51,
-       0xc7, 0x94, 0x23, 0x4e, 0x76, 0x77, 0x0e, 0x1f, 0x62, 0xd5, 0x4b, 0x25,
-       0xde, 0x1f, 0xc5, 0xfd, 0x80, 0x30, 0x97, 0xfc, 0x2a, 0xfa, 0x1c, 0x44,
-       0x9f, 0x19, 0xc7, 0xd7, 0x05, 0xef, 0x37, 0x32, 0x29, 0xdc, 0x9f, 0x29,
-       0x36, 0x32, 0xe9, 0x22, 0xf3, 0xd6, 0xa1, 0xf0, 0x11, 0xc8, 0x33, 0x8b,
-       0x5c, 0xcd, 0x96, 0xe8, 0x60, 0x5e, 0x9e, 0xee, 0x1c, 0x07, 0x4e, 0x3a,
-       0x87, 0x1c, 0xc2, 0x9e, 0x8c, 0xc6, 0xcb, 0xf2, 0xe1, 0xce, 0xe4, 0x69,
-       0xe4, 0x0b, 0xf1, 0xed, 0x90, 0x61, 0x23, 0xa3, 0xc7, 0x04, 0xb6, 0x1e,
-       0x87, 0x5f, 0x1e, 0xd1, 0x53, 0xc5, 0x7e, 0x73, 0x56, 0x1e, 0x95, 0x86,
-       0x19, 0x0d, 0x8f, 0xcb, 0x26, 0x49, 0x05, 0xd0, 0x6f, 0xf0, 0x43, 0x92,
-       0x0d, 0x53, 0xd6, 0x0f, 0xc2, 0xdf, 0x6b, 0xd2, 0x61, 0xb5, 0xc6, 0x9e,
-       0x5b, 0x10, 0x6f, 0x2e, 0x40, 0x9f, 0xdd, 0x61, 0x75, 0x7a, 0x3a, 0xd9,
-       0x24, 0xcb, 0xef, 0xe8, 0x77, 0xbb, 0xa5, 0x5f, 0x6b, 0xfb, 0xdb, 0x68,
-       0xdf, 0x84, 0x9c, 0xb3, 0x91, 0x09, 0xc4, 0x20, 0x7f, 0xcc, 0xa1, 0x0d,
-       0x76, 0x72, 0x15, 0xf3, 0x61, 0x1c, 0x2c, 0x94, 0x99, 0xf7, 0x18, 0x52,
-       0x36, 0x71, 0xcf, 0x69, 0x36, 0x2b, 0x16, 0xf8, 0xbd, 0x40, 0x9e, 0x83,
-       0x32, 0xee, 0x0c, 0x88, 0x5d, 0xa3, 0x1c, 0xa2, 0xf0, 0x4a, 0x0f, 0x77,
-       0xa5, 0x16, 0xa3, 0x76, 0x1e, 0x14, 0x8d, 0x0b, 0x7d, 0x5d, 0x49, 0xe4,
-       0x39, 0xfa, 0x85, 0x48, 0x57, 0x0a, 0x36, 0x6b, 0x5c, 0x78, 0xa8, 0x2b,
-       0x7d, 0x9a, 0x7c, 0x19, 0xc8, 0x73, 0x3e, 0x0a, 0x9c, 0xdf, 0x94, 0xdf,
-       0x45, 0x2e, 0x5b, 0x18, 0x44, 0x0e, 0x80, 0xd5, 0xaf, 0x83, 0xef, 0xbc,
-       0x29, 0xc1, 0xae, 0xc4, 0xab, 0xe0, 0x6f, 0x18, 0xb2, 0xd9, 0x84, 0x3e,
-       0x06, 0xda, 0x07, 0x58, 0x13, 0x68, 0x69, 0xb7, 0xba, 0x10, 0x4f, 0x11,
-       0xbb, 0x24, 0x98, 0x1c, 0xe9, 0x06, 0xfd, 0x2b, 0x01, 0xe6, 0x82, 0xc1,
-       0xd8, 0x6a, 0xfb, 0x37, 0xdd, 0xf6, 0x41, 0xf0, 0xc2, 0xe7, 0x88, 0x09,
-       0x24, 0x38, 0x35, 0x62, 0x82, 0x07, 0xf6, 0x0d, 0xa9, 0xbe, 0xe9, 0x45,
-       0xda, 0x40, 0x23, 0x53, 0xb1, 0x1e, 0x91, 0xd4, 0xc2, 0x56, 0x19, 0x5f,
-       0xe8, 0x95, 0x5d, 0x0b, 0xc4, 0x30, 0xac, 0x69, 0x60, 0x2a, 0xc0, 0x18,
-       0xfa, 0x05, 0xe6, 0x76, 0xd1, 0xf0, 0x41, 0xe9, 0x0f, 0x7f, 0x15, 0xeb,
-       0x60, 0xca, 0x8a, 0x45, 0x66, 0xb1, 0xc6, 0x02, 0x8a, 0x4e, 0xd8, 0x1f,
-       0x93, 0x36, 0xba, 0x66, 0xdc, 0xf4, 0xe2, 0xbd, 0xe8, 0x62, 0xe1, 0x5c,
-       0x08, 0xaf, 0xa3, 0xfb, 0x57, 0x1e, 0x5d, 0x13, 0x74, 0xfb, 0x40, 0x93,
-       0x73, 0x7c, 0xa8, 0x73, 0xec, 0xb4, 0xd8, 0x1d, 0xe0, 0x2f, 0x1d, 0x7b,
-       0x58, 0x66, 0x41, 0xe7, 0xe8, 0x02, 0xfd, 0xa4, 0x6c, 0xc5, 0x67, 0xb8,
-       0x4d, 0x62, 0x83, 0xe7, 0x81, 0x73, 0xc6, 0x14, 0x0d, 0x17, 0x73, 0xe8,
-       0x17, 0x12, 0xc0, 0xa9, 0x1f, 0x07, 0x3f, 0xcc, 0xb1, 0x38, 0xe7, 0x00,
-       0xe6, 0x9b, 0xc0, 0x3a, 0x64, 0x7d, 0x85, 0xeb, 0x1b, 0xbf, 0xcf, 0x87,
-       0x3b, 0x53, 0xa7, 0xdb, 0xb1, 0xee, 0xe4, 0x11, 0x43, 0xc5, 0x7e, 0xea,
-       0xc5, 0xea, 0x4c, 0x96, 0x14, 0xdf, 0x9d, 0xa9, 0x12, 0x65, 0x14, 0xef,
-       0x4c, 0x97, 0x28, 0x23, 0x01, 0x3f, 0x71, 0xd8, 0x64, 0x40, 0x22, 0x5b,
-       0xa8, 0xc7, 0x43, 0xe8, 0xf7, 0x57, 0x01, 0xe2, 0xb8, 0xa4, 0xc5, 0xdf,
-       0xf0, 0xb5, 0x17, 0x0e, 0xa3, 0x2f, 0x7f, 0x6f, 0x07, 0xdd, 0xfe, 0xc1,
-       0x82, 0xb4, 0x0f, 0xce, 0xc0, 0x4f, 0xe8, 0x23, 0xc0, 0x91, 0xca, 0xce,
-       0x9b, 0xc0, 0xd8, 0x3b, 0x30, 0x1f, 0xac, 0x8d, 0x98, 0x25, 0xd3, 0xf3,
-       0x94, 0xab, 0x7c, 0x08, 0x73, 0xc0, 0xfc, 0x63, 0xf0, 0x2d, 0x9c, 0x03,
-       0xc7, 0x16, 0xe4, 0x36, 0x4b, 0x92, 0x9b, 0x0f, 0x2a, 0x2c, 0x6b, 0x9b,
-       0x1c, 0x5f, 0xd3, 0xf4, 0x44, 0x17, 0x74, 0xcc, 0xb9, 0xcd, 0x81, 0xb7,
-       0x67, 0x10, 0xff, 0xa2, 0x0a, 0x43, 0x19, 0x17, 0xb8, 0x56, 0x46, 0xb1,
-       0x4e, 0xc8, 0xbf, 0x67, 0x7b, 0x5a, 0x03, 0x3e, 0x45, 0xf9, 0x7f, 0xe4,
-       0xea, 0x09, 0xf8, 0x91, 0x51, 0xf9, 0x7d, 0xf8, 0x92, 0x1f, 0xd7, 0xe3,
-       0xc8, 0x1b, 0x86, 0x91, 0x37, 0x0c, 0x22, 0x6f, 0xb0, 0x90, 0x37, 0x44,
-       0x90, 0x37, 0xf4, 0x21, 0x6f, 0x08, 0x23, 0x3e, 0x88, 0x1c, 0xad, 0xe7,
-       0x61, 0x63, 0x0d, 0xf8, 0x41, 0x33, 0x68, 0xd7, 0x43, 0xc1, 0x64, 0x3d,
-       0x1c, 0x4c, 0xd5, 0x03, 0x98, 0xd3, 0x01, 0x8e, 0x89, 0xf9, 0xe5, 0x3b,
-       0xc7, 0x4a, 0xc3, 0x88, 0x39, 0x36, 0xfc, 0x52, 0x1a, 0xf1, 0x36, 0x2e,
-       0x47, 0xf0, 0xcc, 0xf2, 0x7c, 0x04, 0xcf, 0x34, 0x25, 0x1d, 0x6f, 0x93,
-       0x59, 0x33, 0x0e, 0x1a, 0x5b, 0x94, 0x9d, 0x22, 0xdf, 0x6a, 0x83, 0x9d,
-       0x4a, 0xae, 0xc8, 0x7c, 0xab, 0x0f, 0xf4, 0x3a, 0x11, 0x97, 0xe9, 0x1f,
-       0xe8, 0x0b, 0xec, 0xdd, 0x5f, 0xb2, 0xb8, 0xe6, 0xba, 0xb4, 0xe4, 0xe9,
-       0xbc, 0x10, 0x6b, 0x22, 0x0e, 0xc2, 0x2e, 0xd8, 0x36, 0x81, 0xe7, 0xf8,
-       0xfb, 0x6d, 0xcf, 0xef, 0x7f, 0x24, 0x28, 0x30, 0xde, 0x4b, 0x8c, 0xf9,
-       0x16, 0xe8, 0x39, 0xad, 0xeb, 0xb5, 0xa6, 0x8b, 0xe5, 0xdf, 0x67, 0xfd,
-       0x8d, 0x35, 0xc7, 0xd7, 0xc0, 0x73, 0xbf, 0xb9, 0x8c, 0x1c, 0xd9, 0xde,
-       0xbf, 0x82, 0xdf, 0xad, 0xfd, 0xeb, 0xe8, 0xaf, 0xda, 0x82, 0x66, 0x22,
-       0xce, 0x7c, 0x18, 0x3e, 0x73, 0x10, 0xfe, 0xf1, 0x56, 0x46, 0x5f, 0xba,
-       0x89, 0x79, 0x42, 0x9e, 0xc5, 0x5b, 0x99, 0xc0, 0xc0, 0xb5, 0xe6, 0x8b,
-       0xc0, 0x37, 0x63, 0x4b, 0x23, 0x92, 0x5a, 0xea, 0x0f, 0x5f, 0x96, 0xce,
-       0xdb, 0xb6, 0x5c, 0x6b, 0xce, 0x3a, 0xd1, 0xe3, 0xb6, 0x10, 0x6f, 0x99,
-       0x52, 0x01, 0xa9, 0x6d, 0x3b, 0x3b, 0x88, 0x19, 0x2f, 0x8a, 0x1e, 0x91,
-       0xe4, 0x29, 0x5b, 0x46, 0x76, 0xfa, 0xb9, 0xfb, 0x9d, 0x0e, 0xe9, 0x42,
-       0xdb, 0x52, 0x04, 0x7d, 0x88, 0x53, 0x39, 0xef, 0x2c, 0xe6, 0xac, 0xb9,
-       0xcf, 0x78, 0xf5, 0xc9, 0x42, 0x09, 0x73, 0xaf, 0xdf, 0xca, 0x5c, 0x3e,
-       0x05, 0xec, 0x0e, 0x1d, 0x25, 0x4f, 0xb1, 0xae, 0xb0, 0x09, 0x72, 0x1a,
-       0x83, 0xad, 0xd0, 0x06, 0xfa, 0xf1, 0x6c, 0x53, 0xbe, 0x11, 0xa7, 0x5d,
-       0xbc, 0x04, 0x59, 0x82, 0x56, 0xc0, 0x9f, 0x0f, 0x70, 0xde, 0x3c, 0xe5,
-       0x17, 0x46, 0x6e, 0xce, 0xb1, 0x25, 0xd8, 0x99, 0x58, 0x9f, 0x77, 0xdf,
-       0xca, 0x2c, 0x9f, 0x02, 0xfd, 0x01, 0xd6, 0xde, 0xe0, 0xb3, 0x8b, 0xac,
-       0x1d, 0x32, 0x27, 0xdd, 0x05, 0x3d, 0xed, 0x55, 0xb5, 0xb8, 0x64, 0x35,
-       0x2e, 0xd6, 0x49, 0xfa, 0x2c, 0x89, 0x18, 0xd6, 0x7e, 0xe4, 0xaf, 0x62,
-       0xea, 0x89, 0x49, 0xdc, 0xa3, 0x3c, 0x35, 0xe4, 0x1c, 0xb8, 0x7f, 0x61,
-       0x45, 0xe9, 0xc4, 0x80, 0xee, 0x72, 0x3b, 0x99, 0x84, 0xc9, 0xbc, 0x91,
-       0x80, 0x2f, 0x1c, 0xe1, 0x1c, 0xd4, 0xd8, 0xc8, 0xc7, 0xb9, 0xfe, 0x30,
-       0x67, 0xd8, 0x55, 0x4b, 0x5e, 0xae, 0xfe, 0x66, 0x4b, 0x47, 0x60, 0xd3,
-       0x92, 0x6f, 0x43, 0x3e, 0x90, 0x1c, 0xc1, 0x6f, 0x38, 0x81, 0xa3, 0xd0,
-       0xe7, 0xd9, 0x11, 0xd6, 0x3f, 0x5f, 0x02, 0xb6, 0x27, 0xdf, 0xb1, 0xc8,
-       0x11, 0xb5, 0x86, 0x71, 0xed, 0x30, 0x97, 0xdb, 0x24, 0x97, 0xd5, 0xfc,
-       0x1e, 0x22, 0xf6, 0x80, 0x9e, 0xee, 0x67, 0x7e, 0xe3, 0xf7, 0x39, 0x3f,
-       0x97, 0x3e, 0x63, 0x57, 0xd2, 0x8a, 0x48, 0xaa, 0x78, 0xa9, 0x19, 0xb0,
-       0x2c, 0x60, 0x67, 0x57, 0x8f, 0x29, 0x27, 0x08, 0x3e, 0x58, 0x6b, 0xdb,
-       0xa9, 0x74, 0x09, 0x3e, 0x68, 0x3b, 0xf9, 0x60, 0x62, 0xb3, 0x9c, 0x9b,
-       0xef, 0x91, 0xca, 0xfc, 0xcf, 0xa5, 0x3a, 0xdf, 0x25, 0xe7, 0xe7, 0x9b,
-       0x72, 0x35, 0xae, 0x7c, 0x93, 0xd5, 0xae, 0xd6, 0xb5, 0x3c, 0xec, 0xd6,
-       0x61, 0x62, 0xa3, 0xd7, 0xe5, 0x79, 0x39, 0x57, 0x76, 0x79, 0xcf, 0xb4,
-       0xf0, 0x7e, 0x15, 0xb6, 0xf6, 0xaa, 0x45, 0xfe, 0x47, 0xa4, 0x52, 0x24,
-       0xef, 0xfb, 0x14, 0xef, 0xbb, 0x56, 0x79, 0x97, 0xac, 0x61, 0x91, 0xff,
-       0x8d, 0x78, 0xef, 0x90, 0xec, 0x56, 0xf2, 0x1f, 0xc1, 0xb3, 0xef, 0xb4,
-       0xbf, 0x8a, 0x73, 0xad, 0xb9, 0x5c, 0x6c, 0x53, 0x3c, 0x1b, 0x89, 0x11,
-       0xc8, 0xe7, 0x5a, 0xb3, 0xe1, 0x70, 0x1d, 0xe1, 0xb7, 0xf3, 0x2f, 0xe0,
-       0xab, 0x7a, 0x55, 0xce, 0x92, 0x9b, 0xec, 0xee, 0x4c, 0x2e, 0x8e, 0x42,
-       0xb7, 0x9d, 0x6a, 0x1d, 0xc2, 0x6d, 0x40, 0x67, 0xff, 0x1e, 0xfd, 0xbf,
-       0xcd, 0xf5, 0xa6, 0xe4, 0x92, 0x86, 0x5c, 0x0a, 0xc5, 0xf1, 0x76, 0xe0,
-       0x27, 0x8c, 0xd3, 0xc8, 0x64, 0x1d, 0x3e, 0xd3, 0x07, 0xdf, 0xc6, 0xef,
-       0xf7, 0x6d, 0x0f, 0x79, 0xf8, 0x5c, 0xe8, 0x1c, 0x79, 0x05, 0xd7, 0xf3,
-       0x48, 0x03, 0x31, 0x36, 0x36, 0x58, 0x51, 0xfb, 0x10, 0x71, 0x85, 0x85,
-       0x67, 0x9d, 0x6f, 0xe3, 0xe3, 0x8e, 0x37, 0x56, 0xe7, 0x98, 0x6b, 0xe7,
-       0x54, 0x70, 0x1a, 0xc8, 0xdf, 0x2d, 0xd0, 0xe5, 0xb8, 0x79, 0x31, 0x12,
-       0x06, 0xc6, 0x65, 0x5b, 0x37, 0x7c, 0x4c, 0x04, 0x3e, 0x6b, 0x18, 0xbe,
-       0x9f, 0x6b, 0x99, 0x7e, 0xde, 0xe7, 0x7d, 0x18, 0x34, 0xe9, 0x7f, 0x87,
-       0x31, 0x67, 0xe6, 0xd8, 0xf4, 0x9f, 0x88, 0x27, 0xb5, 0x70, 0x57, 0xf2,
-       0xb4, 0x5b, 0x1b, 0x74, 0x7f, 0xf3, 0xbe, 0x04, 0x1f, 0x49, 0x44, 0xcb,
-       0x79, 0xe4, 0x7e, 0x29, 0xac, 0xd1, 0xa4, 0x85, 0x3c, 0xbb, 0x16, 0x7d,
-       0x85, 0x98, 0x5b, 0xa7, 0x0c, 0x96, 0x28, 0x27, 0xd6, 0xa9, 0x4c, 0xc9,
-       0x57, 0xbe, 0x0b, 0x79, 0x04, 0x65, 0x8b, 0x95, 0x85, 0x4f, 0x01, 0xff,
-       0x98, 0xfb, 0x5c, 0x89, 0xb5, 0xc8, 0x7e, 0xc4, 0x31, 0x03, 0x42, 0x40,
-       0x4e, 0xb5, 0x64, 0xc8, 0x67, 0x03, 0x43, 0xc8, 0x01, 0x9f, 0x45, 0xdf,
-       0x80, 0xe4, 0x97, 0x18, 0x0f, 0x02, 0x32, 0xb7, 0x24, 0x72, 0xfd, 0x14,
-       0xfd, 0x8a, 0xfa, 0x83, 0xcc, 0x1b, 0x99, 0x69, 0x62, 0xed, 0x79, 0xfa,
-       0x18, 0xfa, 0x89, 0x07, 0xa1, 0x8b, 0xd8, 0x4b, 0xdf, 0x40, 0x6c, 0x9a,
-       0x2d, 0xf6, 0xc3, 0x67, 0x4a, 0x43, 0x87, 0x4c, 0x11, 0xd3, 0x98, 0xa3,
-       0x6f, 0x50, 0x77, 0xf4, 0x6b, 0x8e, 0x41, 0x29, 0x9c, 0x62, 0xbd, 0x31,
-       0x08, 0x5e, 0x98, 0xb7, 0x1a, 0x2a, 0x0f, 0x7a, 0x50, 0xf9, 0x56, 0x7e,
-       0x07, 0x5a, 0xc6, 0x8d, 0x1d, 0xdf, 0xa6, 0xd3, 0x8f, 0x3d, 0x22, 0xf6,
-       0xc4, 0xa1, 0xce, 0x5d, 0xa5, 0x76, 0x29, 0xf7, 0xd2, 0x2e, 0xa9, 0xff,
-       0xac, 0x4e, 0x5f, 0x8b, 0x3c, 0x0c, 0xf4, 0x58, 0x23, 0x08, 0xa0, 0x5f,
-       0xc8, 0xeb, 0x47, 0xb9, 0xfe, 0xb6, 0x4c, 0xed, 0xfc, 0x3b, 0xf0, 0xe5,
-       0xfa, 0xb5, 0xdc, 0x4e, 0xf8, 0xdb, 0x09, 0x5d, 0x1e, 0xfb, 0x54, 0x1a,
-       0xcf, 0x32, 0x16, 0xde, 0xf2, 0xf0, 0x38, 0xdb, 0x58, 0xa3, 0x45, 0x9e,
-       0x7e, 0xce, 0xc4, 0x77, 0xaf, 0xe4, 0xcf, 0x05, 0x21, 0x07, 0xe4, 0xc4,
-       0x15, 0x97, 0x16, 0xf3, 0xde, 0xe3, 0xd0, 0x91, 0x7e, 0x32, 0x28, 0x6d,
-       0x27, 0x7b, 0x25, 0xf0, 0xad, 0x2e, 0x69, 0xff, 0xd6, 0x80, 0x18, 0xdf,
-       0x62, 0x2d, 0x29, 0x1a, 0x39, 0xaa, 0xea, 0x58, 0x69, 0x39, 0x86, 0xf8,
-       0xa5, 0x23, 0x16, 0x2b, 0x3b, 0x35, 0xb7, 0x8a, 0x81, 0xc4, 0x55, 0x7f,
-       0xc1, 0x96, 0xaf, 0xef, 0xfc, 0x85, 0xaa, 0xa3, 0x26, 0x47, 0x70, 0xfd,
-       0x72, 0x06, 0xd8, 0x44, 0x83, 0xad, 0x34, 0x32, 0xd7, 0x1e, 0xf5, 0x73,
-       0xcb, 0x41, 0x55, 0x93, 0xff, 0xfa, 0x4e, 0x37, 0xb7, 0x9c, 0x45, 0x6e,
-       0x99, 0x56, 0xb9, 0x25, 0xfc, 0x6b, 0x80, 0xfd, 0xb6, 0x8a, 0x8e, 0xb1,
-       0x72, 0xc2, 0x5c, 0xfd, 0xa3, 0x62, 0x1f, 0xc0, 0xba, 0x38, 0x23, 0xf3,
-       0x7a, 0x42, 0x53, 0x34, 0x8d, 0x17, 0xe8, 0xa7, 0xe8, 0xbf, 0x68, 0xe3,
-       0xac, 0x69, 0xa1, 0xed, 0x65, 0xfa, 0x28, 0xd7, 0xb6, 0xc7, 0x5a, 0x7c,
-       0xdd, 0x5c, 0xa9, 0x0e, 0x1d, 0x22, 0xa7, 0xb7, 0xda, 0x30, 0x7f, 0xc4,
-       0x74, 0x8b, 0xd7, 0x9c, 0x3f, 0x7c, 0x67, 0x28, 0xa4, 0xae, 0x0b, 0x65,
-       0xb7, 0x86, 0xe1, 0xd2, 0x67, 0xfe, 0x01, 0x1f, 0x53, 0x27, 0x1f, 0x1c,
-       0xb7, 0x4f, 0x8c, 0x33, 0x21, 0x09, 0x9c, 0xa1, 0xfd, 0x45, 0x23, 0x69,
-       0xc8, 0x6f, 0xce, 0x22, 0x06, 0x3c, 0x04, 0x6c, 0xf4, 0x88, 0xe8, 0xe7,
-       0x06, 0xb1, 0x76, 0xa2, 0xe1, 0xb2, 0xc4, 0xc4, 0xa8, 0x04, 0xe5, 0x8d,
-       0x53, 0xd1, 0x08, 0xed, 0xe5, 0x2c, 0xe2, 0xd5, 0x91, 0x7a, 0xe7, 0xed,
-       0x86, 0xe2, 0x82, 0x6d, 0xdf, 0x08, 0x00, 0x3b, 0x0c, 0xda, 0x7a, 0xb7,
-       0xdc, 0x80, 0xbe, 0xb3, 0xaa, 0xed, 0x11, 0xd0, 0x05, 0x0f, 0x67, 0x58,
-       0x1b, 0x24, 0xdd, 0xa3, 0xa0, 0x49, 0xda, 0x8d, 0xcc, 0x32, 0x73, 0xd3,
-       0x53, 0xb4, 0xdd, 0x5e, 0xd8, 0x1d, 0xae, 0xeb, 0xed, 0x92, 0x9d, 0x8c,
-       0x88, 0x7e, 0x6a, 0x8f, 0xf4, 0xef, 0xd4, 0xdd, 0xf9, 0xa8, 0x39, 0xb2,
-       0x8d, 0x35, 0xe7, 0x11, 0xb5, 0x1e, 0xf5, 0x25, 0xd8, 0xcc, 0x3e, 0xea,
-       0x18, 0xb1, 0x1f, 0x71, 0x8c, 0x7e, 0xcc, 0x40, 0x1c, 0x4b, 0xd5, 0x5d,
-       0xbd, 0x97, 0xf7, 0x6d, 0x95, 0x63, 0x67, 0x68, 0x4f, 0xb8, 0xb7, 0x6a,
-       0x53, 0xfe, 0xde, 0x10, 0xef, 0x59, 0x72, 0xfc, 0x45, 0xe6, 0x1e, 0xcc,
-       0x39, 0x98, 0x67, 0x45, 0xc3, 0xbb, 0x30, 0x1f, 0xfd, 0x31, 0xfa, 0x03,
-       0x5d, 0xd9, 0x6e, 0x0e, 0x3e, 0xba, 0x50, 0xa7, 0xde, 0x86, 0xb9, 0x7f,
-       0x66, 0x32, 0x5f, 0xb3, 0xc3, 0xae, 0xbc, 0x0b, 0x68, 0x9b, 0x85, 0xef,
-       0x4f, 0x39, 0x6d, 0xb2, 0x32, 0x69, 0x43, 0xf7, 0x5f, 0x02, 0x5f, 0x07,
-       0x3a, 0x59, 0x23, 0x58, 0x99, 0x4c, 0xe3, 0xfa, 0x80, 0xca, 0xd1, 0x8c,
-       0xc7, 0x6c, 0xd0, 0xd8, 0xca, 0x75, 0xe4, 0xe9, 0x29, 0xae, 0x17, 0xe6,
-       0x1f, 0xd3, 0x67, 0xe1, 0xb3, 0xc7, 0xe3, 0x8c, 0xf1, 0xdc, 0x4b, 0xe8,
-       0x00, 0x1f, 0xdd, 0x0a, 0x57, 0xe8, 0xd6, 0x4e, 0xbd, 0x50, 0xa6, 0x9f,
-       0xcf, 0x87, 0xdb, 0x85, 0x78, 0xc4, 0xd4, 0x2b, 0x16, 0x75, 0xa2, 0xc9,
-       0x65, 0xb5, 0xef, 0x20, 0x92, 0x76, 0x0e, 0x61, 0xac, 0xb8, 0x5e, 0x2d,
-       0xef, 0xd4, 0xf3, 0x65, 0x43, 0x56, 0x42, 0xe4, 0x3b, 0xa2, 0xf2, 0xf8,
-       0x9d, 0xca, 0xd6, 0x8a, 0x88, 0x25, 0xb0, 0x99, 0xf8, 0x87, 0x31, 0xae,
-       0x6a, 0x83, 0x4d, 0x51, 0xf7, 0xd4, 0xbb, 0xf2, 0x91, 0x9e, 0xee, 0x37,
-       0x8a, 0x99, 0x45, 0xf8, 0x5f, 0xd6, 0x2f, 0x3a, 0xbc, 0x5a, 0xe3, 0x4b,
-       0x5e, 0x3e, 0xf4, 0x8c, 0x30, 0x4f, 0x99, 0x2b, 0x91, 0x97, 0x22, 0xfc,
-       0xe1, 0x46, 0xb6, 0x44, 0x39, 0xba, 0x3e, 0xe5, 0x10, 0xec, 0x42, 0x5f,
-       0x32, 0x3d, 0x1b, 0xe0, 0xdf, 0x28, 0xee, 0x31, 0x06, 0xe0, 0xbb, 0xde,
-       0x86, 0xf5, 0xbe, 0x17, 0x32, 0xa2, 0x6e, 0xa0, 0xbf, 0x25, 0xee, 0xbb,
-       0x42, 0x7f, 0x4b, 0x57, 0xde, 0xb6, 0x7b, 0xe9, 0xf3, 0x46, 0xe4, 0x18,
-       0xfc, 0xe8, 0xd1, 0x45, 0xf2, 0x93, 0xf6, 0x70, 0xd9, 0x30, 0x64, 0x42,
-       0x1f, 0x3f, 0x2c, 0x6f, 0xd4, 0x7e, 0xa0, 0x70, 0xe0, 0xb6, 0x9d, 0x0d,
-       0x99, 0x86, 0x7f, 0x98, 0x71, 0x20, 0x7f, 0x33, 0x82, 0xf5, 0x19, 0x56,
-       0xfe, 0x71, 0xe6, 0xfd, 0xe5, 0x24, 0x01, 0x37, 0x66, 0x7f, 0xf6, 0x3e,
-       0x63, 0xf6, 0x03, 0xc0, 0x61, 0xef, 0x8b, 0xbe, 0xe1, 0xd2, 0xff, 0x33,
-       0xe8, 0xea, 0xd7, 0x55, 0xfd, 0x22, 0xb7, 0x73, 0x2b, 0x65, 0xfa, 0x5e,
-       0xcf, 0xe9, 0xee, 0x73, 0x9f, 0xbb, 0x4f, 0xbe, 0x4c, 0xa9, 0x01, 0x2b,
-       0xe4, 0x55, 0x1c, 0x65, 0xae, 0xd8, 0xe6, 0xe9, 0x6f, 0x10, 0x18, 0x9a,
-       0x74, 0x7d, 0xdf, 0xdb, 0x21, 0xf9, 0x5e, 0x3f, 0xff, 0x84, 0xcf, 0x5e,
-       0x6d, 0xf7, 0xf3, 0x59, 0x3e, 0xbf, 0x92, 0x41, 0xfe, 0x0c, 0x1b, 0x60,
-       0x2c, 0x60, 0x5b, 0x5c, 0xf9, 0xa1, 0x77, 0xe7, 0x9b, 0xf5, 0x0b, 0xf2,
-       0xbd, 0x5b, 0xf1, 0x9d, 0x56, 0x7c, 0xb3, 0x06, 0xb9, 0x5f, 0x4b, 0x9d,
-       0x67, 0x1d, 0xd2, 0xaf, 0x3b, 0x92, 0x1e, 0xb0, 0x01, 0xf4, 0xfd, 0x63,
-       0xd0, 0xfd, 0x11, 0xf4, 0xfa, 0xc3, 0x12, 0xb0, 0x41, 0x09, 0xd8, 0xa0,
-       0x04, 0x6c, 0x50, 0x02, 0x36, 0x28, 0x85, 0xbd, 0x3a, 0x8b, 0x4d, 0x6c,
-       0xff, 0x3e, 0x6d, 0xd7, 0xaf, 0x6d, 0xac, 0xb7, 0x4b, 0xb7, 0xb6, 0x99,
-       0xaa, 0xfb, 0x18, 0x39, 0xc8, 0x5a, 0x2b, 0xb0, 0x9a, 0x5f, 0xf7, 0xf0,
-       0x62, 0x44, 0x8d, 0xfb, 0x5e, 0x88, 0x11, 0x35, 0x1b, 0xeb, 0x66, 0x28,
-       0x6c, 0x00, 0x1b, 0x1a, 0x12, 0xc6, 0x6f, 0x13, 0xbe, 0x17, 0xb4, 0x86,
-       0xfb, 0xb1, 0x92, 0xda, 0x55, 0x5d, 0xef, 0x88, 0xaa, 0x3b, 0x58, 0x32,
-       0x5b, 0xf6, 0x73, 0xb7, 0x98, 0x8c, 0xcd, 0x13, 0x6f, 0xca, 0x16, 0x3d,
-       0x01, 0x1d, 0x38, 0xc4, 0x88, 0xdc, 0x27, 0xe4, 0xf8, 0xb1, 0xc1, 0x2a,
-       0xc6, 0x2c, 0x58, 0x2e, 0x7f, 0x47, 0x9c, 0xbb, 0xcf, 0xec, 0x82, 0x7f,
-       0xce, 0x14, 0x23, 0x32, 0x5e, 0x74, 0x31, 0x01, 0xf2, 0x9f, 0x75, 0xf5,
-       0xe5, 0x5b, 0xd0, 0xc3, 0xad, 0xcc, 0x94, 0xb5, 0x6a, 0x1b, 0x91, 0xcb,
-       0x71, 0xca, 0x98, 0xfa, 0xdf, 0xab, 0xf6, 0x29, 0x76, 0x55, 0xdd, 0xbd,
-       0xa4, 0x71, 0x65, 0x0b, 0x01, 0xfa, 0x19, 0xd0, 0x89, 0xbb, 0x6b, 0x18,
-       0x76, 0x91, 0x73, 0x7c, 0xb9, 0xb4, 0xe2, 0x91, 0x2f, 0x6a, 0x62, 0x6d,
-       0xd4, 0xfe, 0x1b, 0x2d, 0xed, 0xab, 0xf7, 0x3d, 0x7e, 0xe1, 0xfb, 0x56,
-       0x6b, 0x0d, 0xf4, 0x53, 0x77, 0xdb, 0x81, 0xdd, 0x24, 0xa0, 0xee, 0xc3,
-       0x87, 0xd7, 0x42, 0x92, 0xaa, 0x59, 0x92, 0x2e, 0xb3, 0x1f, 0xeb, 0x17,
-       0xf4, 0x47, 0x7f, 0x22, 0x29, 0xe4, 0xab, 0xd9, 0x50, 0x34, 0x6e, 0xcb,
-       0x7f, 0x96, 0xe5, 0x85, 0x7c, 0x84, 0xe7, 0x0a, 0xf2, 0x13, 0x1a, 0x9e,
-       0xfb, 0x19, 0xae, 0xc9, 0xb3, 0x25, 0x33, 0x45, 0xc6, 0x9d, 0xa1, 0x70,
-       0x0d, 0xf7, 0xb2, 0x93, 0xac, 0xd9, 0x7c, 0x07, 0x36, 0x19, 0x8d, 0x94,
-       0xa1, 0xef, 0x2b, 0x45, 0x8e, 0x07, 0x6c, 0x54, 0x64, 0x5d, 0xc7, 0xbf,
-       0xff, 0x27, 0xc0, 0x81, 0xf0, 0xd5, 0x21, 0xaf, 0x8f, 0x9a, 0xab, 0x6d,
-       0x06, 0x60, 0xe3, 0x0d, 0xcf, 0xdf, 0x56, 0x8a, 0x6e, 0x1d, 0xe5, 0x2c,
-       0xf9, 0x70, 0xfe, 0x77, 0xb3, 0x11, 0x42, 0x0e, 0xb4, 0x3a, 0xc7, 0xab,
-       0xa4, 0x6f, 0xc2, 0xdd, 0xca, 0x51, 0xc7, 0x97, 0x05, 0xef, 0xb3, 0x8d,
-       0x67, 0x27, 0x9a, 0xcd, 0xb3, 0xd6, 0x07, 0xad, 0x99, 0xf5, 0x6d, 0x4f,
-       0x5a, 0xf9, 0xdd, 0x15, 0x27, 0xef, 0xd5, 0xcc, 0xbe, 0xbd, 0xc3, 0xad,
-       0x99, 0xd5, 0x76, 0xac, 0xad, 0x99, 0x59, 0xdb, 0xdd, 0x9a, 0xd9, 0xfc,
-       0xee, 0x02, 0x3e, 0x6e, 0xcd, 0x2c, 0xbb, 0xdd, 0xad, 0x99, 0x95, 0xb7,
-       0xbb, 0x35, 0x33, 0x67, 0x87, 0x5b, 0x33, 0xfb, 0xf9, 0xf6, 0xb5, 0x35,
-       0xb3, 0x1f, 0xec, 0x58, 0x5b, 0x33, 0xbb, 0xb8, 0x3b, 0x87, 0xcf, 0xdd,
-       0x9a, 0xd9, 0xcf, 0x76, 0xdc, 0xbb, 0x66, 0xf6, 0x9a, 0x8f, 0xd7, 0x31,
-       0x9f, 0x11, 0xcc, 0x21, 0x0e, 0xbc, 0x3e, 0x0c, 0xbc, 0xfe, 0x6e, 0x75,
-       0xfe, 0x00, 0xe6, 0x39, 0xe8, 0xc5, 0x83, 0x0f, 0x82, 0xdb, 0x47, 0xbc,
-       0x67, 0x6d, 0xe4, 0xbb, 0x11, 0x2f, 0x57, 0x21, 0x76, 0xdf, 0xec, 0xe5,
-       0x6c, 0xff, 0xa8, 0xf3, 0xee, 0xb9, 0x97, 0xd6, 0xef, 0x0f, 0x21, 0xf5,
-       0xf6, 0xf1, 0x3c, 0xe7, 0x95, 0x47, 0xee, 0x47, 0x39, 0xd8, 0xe8, 0x3f,
-       0xbf, 0xfb, 0x1b, 0x16, 0x31, 0xfe, 0x73, 0x58, 0xab, 0xf6, 0x16, 0x43,
-       0x9d, 0x01, 0x60, 0x8c, 0x3a, 0x2e, 0x29, 0xf4, 0x4f, 0xa9, 0xfe, 0xd7,
-       0x5a, 0xfa, 0xaf, 0xa0, 0x3f, 0xe9, 0x46, 0xff, 0x1d, 0x3e, 0x2f, 0x29,
-       0xfb, 0xb6, 0x5c, 0x0c, 0x9f, 0x2e, 0xf9, 0x78, 0x2b, 0xe0, 0x61, 0xe7,
-       0x46, 0xc6, 0x76, 0x3e, 0x8f, 0x67, 0xa2, 0x17, 0x6d, 0xb9, 0xa9, 0xf0,
-       0xbb, 0x91, 0x88, 0x5e, 0xcc, 0xaa, 0x7c, 0xad, 0x91, 0xc9, 0x39, 0x7e,
-       0xfe, 0x8d, 0x1c, 0x6a, 0x80, 0x39, 0x0c, 0xec, 0x7d, 0x69, 0x10, 0x71,
-       0xac, 0x35, 0xc7, 0x66, 0x5e, 0xad, 0x7b, 0x79, 0xb5, 0x29, 0x9f, 0xd9,
-       0xd9, 0x8a, 0xcd, 0x2f, 0xee, 0xfe, 0xc7, 0x0a, 0x9b, 0x6f, 0x42, 0x6e,
-       0x4e, 0xec, 0x4d, 0x1c, 0x43, 0x0c, 0x41, 0x7c, 0xce, 0x7a, 0x01, 0xf3,
-       0x19, 0xc6, 0x46, 0xe6, 0x37, 0x21, 0x7c, 0x78, 0x26, 0xc9, 0xc7, 0xe8,
-       0xed, 0x9e, 0x7f, 0x67, 0x5e, 0xe4, 0x63, 0x95, 0xe4, 0x26, 0x37, 0x37,
-       0xda, 0xa4, 0xb9, 0xf9, 0x67, 0xc4, 0xeb, 0x13, 0x58, 0xc5, 0xc2, 0x81,
-       0x55, 0x2c, 0xbc, 0x66, 0x1f, 0x4b, 0xd4, 0xf9, 0x27, 0xb5, 0x1f, 0xc6,
-       0xfd, 0xb1, 0x46, 0xe6, 0xca, 0x80, 0x68, 0x7a, 0x82, 0xfb, 0x64, 0xc0,
-       0x3a, 0x16, 0xf7, 0xcd, 0xe8, 0x3b, 0xf7, 0x69, 0xa9, 0x2a, 0xe3, 0x0f,
-       0xf1, 0x91, 0xbf, 0x17, 0xee, 0xeb, 0x89, 0xb2, 0x63, 0xdb, 0x1f, 0x6b,
-       0xc8, 0x79, 0xe3, 0xed, 0xd6, 0x53, 0xe0, 0x25, 0x83, 0x6f, 0x5f, 0xa6,
-       0x9f, 0x55, 0xb1, 0xaf, 0x03, 0xb6, 0x7b, 0xa4, 0x44, 0xec, 0xba, 0x59,
-       0x6a, 0x1e, 0x7e, 0x3d, 0x37, 0xef, 0x62, 0xd7, 0xc0, 0x5a, 0xec, 0x1a,
-       0x5f, 0x16, 0x97, 0xc7, 0x5d, 0x1b, 0xf2, 0x48, 0xbc, 0x4a, 0xfe, 0x18,
-       0x77, 0xf6, 0xc2, 0xff, 0x35, 0x80, 0x69, 0x19, 0x73, 0x18, 0x6f, 0x22,
-       0xc0, 0xf6, 0xf7, 0xe2, 0x4f, 0xb5, 0x1d, 0xea, 0xb0, 0x82, 0xf8, 0x4c,
-       0xc3, 0x7f, 0x4c, 0xe0, 0x99, 0x8c, 0xcc, 0x9e, 0xfe, 0x1a, 0xe6, 0x36,
-       0x2d, 0x57, 0xe6, 0x27, 0xc1, 0xdf, 0x73, 0x32, 0x17, 0xcf, 0xc3, 0x8f,
-       0x70, 0xcf, 0x83, 0xb8, 0xad, 0xdf, 0xfb, 0x9e, 0xd6, 0xcf, 0x5a, 0x51,
-       0xe2, 0x46, 0xa9, 0x16, 0xe9, 0x83, 0xb9, 0x67, 0xc8, 0xbd, 0x61, 0xda,
-       0x0f, 0xeb, 0x27, 0xc8, 0x5d, 0x99, 0xc3, 0x9e, 0xe2, 0xf8, 0x6b, 0x75,
-       0xb2, 0xec, 0x10, 0x7f, 0x35, 0x32, 0x8d, 0x25, 0xe2, 0xc7, 0xf7, 0x8b,
-       0x25, 0xa9, 0x07, 0xe2, 0xc9, 0xfb, 0xc1, 0x91, 0xd1, 0x79, 0x60, 0xc8,
-       0x57, 0x1a, 0x7a, 0x2b, 0x8e, 0x74, 0x31, 0x64, 0x72, 0x29, 0x0b, 0x9a,
-       0x71, 0x85, 0x95, 0x91, 0xc7, 0xc1, 0xed, 0xf5, 0xe3, 0xd9, 0x7e, 0xe4,
-       0xe4, 0x2e, 0x66, 0x4c, 0x01, 0x33, 0xfe, 0x06, 0x30, 0xe3, 0xac, 0x74,
-       0x76, 0x11, 0x33, 0xda, 0x1e, 0x66, 0x4c, 0xc3, 0x9e, 0x73, 0x6b, 0xec,
-       0x59, 0x53, 0xb5, 0x28, 0xde, 0xcb, 0x01, 0xf3, 0xa5, 0x4e, 0x45, 0xef,
-       0x03, 0x27, 0x6a, 0x12, 0x52, 0xe7, 0x52, 0x02, 0x2d, 0x34, 0x7d, 0x3c,
-       0xb8, 0x4d, 0xe1, 0xbc, 0xdd, 0xa5, 0x4d, 0xc8, 0x51, 0x14, 0xee, 0xf3,
-       0xf6, 0x4b, 0x03, 0xeb, 0xf6, 0x90, 0x03, 0x2d, 0x7b, 0xc8, 0x77, 0xf1,
-       0x21, 0x9e, 0xf3, 0x6a, 0x7d, 0x6d, 0xf0, 0x05, 0xff, 0x13, 0x3c, 0x71,
-       0x7d, 0x71, 0x2d, 0x68, 0xee, 0x7a, 0x59, 0x83, 0x13, 0xff, 0x7a, 0x1d,
-       0x4e, 0x44, 0xec, 0x3a, 0x17, 0x92, 0x24, 0x30, 0xa2, 0xbd, 0x44, 0x5a,
-       0x5c, 0xd3, 0xc3, 0xd2, 0x8e, 0xf9, 0x75, 0x9c, 0xea, 0x05, 0x36, 0xea,
-       0x92, 0x20, 0x30, 0x52, 0x9b, 0xc2, 0x48, 0x03, 0xc4, 0x32, 0x83, 0x33,
-       0xc0, 0x36, 0xb5, 0x55, 0x9c, 0x14, 0x8d, 0xff, 0x01, 0xf4, 0xf2, 0x94,
-       0xf2, 0x3d, 0x69, 0x39, 0x01, 0x5f, 0xda, 0xbe, 0x04, 0x7c, 0x77, 0xce,
-       0xc5, 0x4f, 0x6d, 0xeb, 0xf0, 0xd3, 0xc1, 0x0d, 0xf1, 0x93, 0xaa, 0xdf,
-       0x8f, 0x52, 0x26, 0x37, 0x1c, 0xb7, 0x7e, 0x7f, 0xdd, 0x71, 0xeb, 0xf7,
-       0x37, 0x9c, 0xd6, 0xfa, 0xfd, 0x47, 0xa4, 0x60, 0x46, 0xed, 0x15, 0x59,
-       0x57, 0xbf, 0x9f, 0x60, 0x3d, 0xdc, 0xe9, 0x72, 0xeb, 0xf4, 0x5d, 0x5e,
-       0xfd, 0x3e, 0x2a, 0x85, 0x35, 0xed, 0xa6, 0xbc, 0x69, 0xf9, 0xf5, 0xfb,
-       0xef, 0xa2, 0xad, 0x1b, 0x63, 0xac, 0xad, 0xdd, 0x5f, 0x77, 0x58, 0xbb,
-       0x0f, 0xb1, 0x9f, 0x57, 0xbb, 0x67, 0x3f, 0xe4, 0xf2, 0x0e, 0xeb, 0xf6,
-       0x8f, 0x40, 0x16, 0x5b, 0x21, 0x87, 0x5e, 0x69, 0x3f, 0x13, 0x66, 0x1f,
-       0x55, 0xaf, 0x5f, 0x71, 0x42, 0x78, 0xce, 0xad, 0xab, 0xcf, 0xc0, 0xae,
-       0x0e, 0xae, 0xd6, 0xeb, 0xdd, 0x31, 0x6e, 0x3a, 0x6b, 0xe9, 0xaf, 0xa5,
-       0xd3, 0xe7, 0xd1, 0x09, 0x81, 0x4e, 0x78, 0x1d, 0x9d, 0xbb, 0xf5, 0xf9,
-       0x9b, 0x8e, 0x5b, 0x9b, 0x4f, 0x9f, 0x16, 0xbb, 0x1d, 0xbe, 0xf9, 0xe2,
-       0xc0, 0xc3, 0x1e, 0x8d, 0xd5, 0xda, 0x3c, 0x7d, 0x08, 0x70, 0x7b, 0x4c,
-       0x9d, 0xbd, 0x9a, 0xf9, 0x7f, 0x50, 0x9b, 0x67, 0x5d, 0xde, 0xdd, 0x5f,
-       0xe1, 0xfa, 0x04, 0x3e, 0x7f, 0xd1, 0xad, 0xc9, 0x8f, 0x95, 0xfc, 0x5a,
-       0x3b, 0xf3, 0x47, 0xff, 0x5c, 0x54, 0x7f, 0xe4, 0x88, 0xd0, 0x56, 0xc8,
-       0x1f, 0xe9, 0x76, 0xcb, 0x94, 0xc2, 0x47, 0xb0, 0xa9, 0xd8, 0xbd, 0x31,
-       0x72, 0xe5, 0x94, 0x8f, 0x91, 0x43, 0x0a, 0x23, 0x57, 0x96, 0x7c, 0x8c,
-       0x9c, 0xbc, 0x07, 0x46, 0x6e, 0x76, 0xb9, 0x71, 0x20, 0x28, 0x79, 0x85,
-       0x91, 0xef, 0x75, 0x96, 0x8c, 0xf7, 0xba, 0x88, 0x07, 0xc4, 0x3d, 0x5f,
-       0xd0, 0x7b, 0x8f, 0xb5, 0xe6, 0xe3, 0x66, 0xc6, 0xfe, 0xad, 0x32, 0x71,
-       0xe6, 0x2e, 0x6e, 0x76, 0xb1, 0x71, 0x34, 0x72, 0x48, 0xc5, 0x44, 0xe0,
-       0x84, 0x3a, 0xeb, 0xdf, 0xc4, 0xbe, 0x8c, 0x39, 0x01, 0x85, 0xcf, 0x72,
-       0x45, 0xe6, 0x01, 0x6c, 0x23, 0x16, 0xee, 0xe4, 0x31, 0x2b, 0x2f, 0x26,
-       0xf9, 0x58, 0xd3, 0x3f, 0xd7, 0xc2, 0x3d, 0x86, 0x37, 0x8d, 0xa4, 0x85,
-       0x76, 0xc7, 0xcf, 0x15, 0xe2, 0xea, 0x3c, 0x50, 0x12, 0x58, 0x72, 0x6a,
-       0x15, 0x4b, 0xd2, 0x57, 0xfc, 0xf4, 0x6d, 0xdb, 0xa4, 0x5f, 0xf3, 0xb1,
-       0x22, 0x72, 0xa2, 0x12, 0xd7, 0xb6, 0x8f, 0x15, 0x5d, 0x9c, 0x98, 0x72,
-       0x1a, 0xc0, 0xcb, 0x01, 0x19, 0x03, 0x4e, 0x6f, 0x7c, 0x89, 0x35, 0x28,
-       0x1f, 0x1b, 0xd9, 0xf8, 0x6e, 0xad, 0x49, 0xf1, 0xba, 0x5d, 0xed, 0x05,
-       0x5e, 0x1e, 0x08, 0xb6, 0xb4, 0x3f, 0x0b, 0xff, 0x8d, 0xfc, 0x08, 0xd8,
-       0xc4, 0xc5, 0x44, 0x3b, 0xa0, 0x83, 0x91, 0x7b, 0x60, 0xa2, 0xf5, 0x31,
-       0x8a, 0x31, 0xf3, 0x6e, 0x8c, 0x4a, 0xd7, 0xe9, 0xcf, 0xef, 0xc6, 0xa8,
-       0x7b, 0xc7, 0x50, 0xb6, 0x61, 0x76, 0x56, 0x06, 0x9f, 0x69, 0x29, 0xac,
-       0x8b, 0x51, 0x73, 0x1f, 0x20, 0x46, 0xb9, 0xf8, 0xc0, 0xe5, 0xfb, 0xf7,
-       0x21, 0x9b, 0x1f, 0x43, 0xa6, 0x3f, 0x02, 0xe6, 0xfa, 0x21, 0xe6, 0xf5,
-       0x03, 0xe0, 0xa1, 0xef, 0x97, 0xd6, 0x9f, 0x07, 0x19, 0x15, 0xe6, 0x87,
-       0x2e, 0x66, 0x72, 0x31, 0xfd, 0x0c, 0x56, 0x57, 0xad, 0xd8, 0xc8, 0x4c,
-       0x15, 0x87, 0xcc, 0x69, 0x77, 0x1f, 0x35, 0x92, 0x95, 0xa7, 0x3b, 0x53,
-       0x8b, 0x8c, 0x19, 0xea, 0x3a, 0xcc, 0xfa, 0x25, 0xb1, 0x43, 0x55, 0xe5,
-       0x99, 0x03, 0x52, 0xae, 0xb9, 0x78, 0x6b, 0x6e, 0xd1, 0xa5, 0x31, 0xe5,
-       0xe1, 0xad, 0x9c, 0x87, 0xb7, 0xb2, 0xb5, 0xe5, 0x48, 0x00, 0xfd, 0xe7,
-       0xe2, 0x6b, 0x31, 0xd6, 0x8c, 0x87, 0xb1, 0xa6, 0x3f, 0x20, 0xc6, 0xe2,
-       0x58, 0x39, 0x3c, 0x33, 0x3e, 0x1f, 0x91, 0x5d, 0x90, 0xf3, 0x58, 0x91,
-       0xfa, 0xe2, 0x19, 0xb2, 0xf7, 0xd2, 0x19, 0xf5, 0xe5, 0xea, 0x2a, 0x10,
-       0xdb, 0xa7, 0x8d, 0x43, 0x57, 0x63, 0xef, 0xa9, 0x2b, 0x31, 0xdf, 0x18,
-       0x09, 0xe2, 0xf3, 0xf7, 0xa5, 0x2b, 0xce, 0x83, 0xfa, 0x5a, 0x8f, 0xc5,
-       0xee, 0x07, 0x93, 0xad, 0xc5, 0x63, 0xb6, 0xc2, 0x63, 0xed, 0x5e, 0x1f,
-       0xd9, 0x33, 0x0e, 0x5d, 0xfe, 0x27, 0xf4, 0xf9, 0x99, 0xd5, 0x2d, 0x3f,
-       0x85, 0xff, 0xfe, 0x43, 0xe8, 0xe4, 0x3f, 0x22, 0x57, 0x78, 0xcd, 0xea,
-       0x93, 0x3f, 0x40, 0xdb, 0x5d, 0x9c, 0xc3, 0xfe, 0xc1, 0xc7, 0x92, 0xd6,
-       0x35, 0xe0, 0x93, 0x6b, 0x1e, 0x3e, 0x79, 0x3a, 0x99, 0xb4, 0x26, 0x59,
-       0x37, 0x87, 0x9c, 0x0f, 0xa4, 0xa6, 0x14, 0x36, 0xf1, 0x31, 0xc9, 0xed,
-       0x34, 0xc7, 0x9f, 0x75, 0x56, 0x80, 0x7d, 0x56, 0x3c, 0xec, 0x73, 0x60,
-       0xcc, 0xc5, 0x3e, 0xc1, 0xcf, 0x50, 0xff, 0x2e, 0xee, 0x59, 0xb1, 0x93,
-       0x18, 0xa7, 0x0a, 0x4c, 0x52, 0x71, 0x0e, 0x48, 0xbe, 0xbe, 0x57, 0x7d,
-       0x8e, 0x94, 0xec, 0x68, 0x1b, 0xe4, 0xc4, 0xda, 0xeb, 0x49, 0xae, 0x4a,
-       0x27, 0x6a, 0x16, 0xf1, 0x9d, 0x75, 0xa2, 0xe1, 0xdf, 0xf1, 0xae, 0x9f,
-       0xf7, 0xae, 0x4f, 0x78, 0xd7, 0xc7, 0x11, 0x87, 0x8f, 0xa9, 0x58, 0xca,
-       0x76, 0xb6, 0x41, 0xc9, 0x0e, 0x68, 0x01, 0x7b, 0x9c, 0x1d, 0xfe, 0x8b,
-       0x66, 0x59, 0xe9, 0x98, 0xf4, 0x27, 0xf0, 0x39, 0x8e, 0xcf, 0x34, 0x3e,
-       0xfb, 0xf1, 0xc9, 0xe3, 0xb3, 0x2a, 0x53, 0x2d, 0x55, 0x9a, 0x84, 0x8d,
-       0x0c, 0x4a, 0xaa, 0xfe, 0x12, 0xf4, 0xf8, 0x1c, 0x74, 0x7b, 0x58, 0x0a,
-       0xd5, 0x3f, 0x95, 0xd9, 0x79, 0x4d, 0xba, 0x2c, 0xe8, 0xb4, 0x0a, 0x5b,
-       0x9e, 0x77, 0xf7, 0x13, 0x3b, 0x13, 0x7b, 0xd1, 0xb7, 0x29, 0x4f, 0xc5,
-       0x9f, 0x13, 0xfd, 0xb1, 0x39, 0xf4, 0x13, 0xbd, 0x30, 0xfc, 0x31, 0xb5,
-       0x6f, 0x56, 0x8d, 0xbb, 0x32, 0xde, 0x65, 0xd9, 0x51, 0xe8, 0x7c, 0xf0,
-       0x18, 0x68, 0x27, 0xd5, 0xd9, 0xd8, 0x8c, 0x1c, 0x3d, 0xbd, 0xbc, 0xc5,
-       0xf5, 0xad, 0x51, 0xf3, 0x26, 0xf5, 0x8e, 0x79, 0xd8, 0xf0, 0x85, 0x19,
-       0xd8, 0xfb, 0x41, 0x27, 0xa0, 0x8d, 0x21, 0xde, 0x8c, 0x39, 0x37, 0x55,
-       0xbc, 0x81, 0xef, 0xca, 0xc4, 0x4e, 0x86, 0x70, 0xcd, 0xb3, 0x45, 0x88,
-       0x8b, 0xea, 0x6c, 0xe5, 0x32, 0xf0, 0x8d, 0xa6, 0xea, 0x80, 0xb3, 0xab,
-       0xfb, 0x43, 0x86, 0xf2, 0x5b, 0xb1, 0x98, 0x2e, 0xb9, 0x11, 0xe2, 0xdc,
-       0xbd, 0x2a, 0x36, 0xd5, 0x8a, 0xf6, 0x43, 0xcc, 0x15, 0x6f, 0x08, 0xe3,
-       0xdc, 0xe3, 0xe8, 0xd7, 0x07, 0x7f, 0x8c, 0x7b, 0x75, 0xda, 0x27, 0xe7,
-       0xca, 0x67, 0xa6, 0xa5, 0x5a, 0x1e, 0xc5, 0x7c, 0xbd, 0x1c, 0x49, 0xe5,
-       0x12, 0x11, 0xd8, 0xa3, 0xbf, 0x17, 0xe5, 0xd6, 0x4f, 0xaa, 0x8e, 0x8f,
-       0x29, 0xba, 0xd1, 0x87, 0x79, 0x05, 0x64, 0xe4, 0xee, 0x9f, 0xa9, 0xbd,
-       0xb3, 0x82, 0x33, 0x0a, 0x39, 0x25, 0xd1, 0xce, 0x5a, 0x35, 0x7e, 0x97,
-       0x75, 0x55, 0x13, 0x58, 0x31, 0x66, 0xa4, 0x56, 0x6e, 0x82, 0x5f, 0xc4,
-       0xdc, 0x2d, 0x33, 0x52, 0x29, 0x4f, 0xcb, 0x2b, 0xe5, 0x9f, 0x77, 0x03,
-       0x53, 0x41, 0xa6, 0xe4, 0xbf, 0x5b, 0xee, 0x9e, 0xbf, 0xf5, 0xdb, 0x21,
-       0xcf, 0xd3, 0xf9, 0xb0, 0x9b, 0xe7, 0xe6, 0x55, 0x2d, 0xc6, 0xfd, 0xb6,
-       0xf5, 0x29, 0x2b, 0x1a, 0x9e, 0x45, 0xcf, 0x83, 0x0b, 0xb4, 0xcd, 0xfc,
-       0xf8, 0x9c, 0xb5, 0x43, 0xae, 0xc6, 0x37, 0xcb, 0x72, 0x5c, 0xe5, 0xc5,
-       0xc4, 0x0f, 0x58, 0xeb, 0x51, 0xb3, 0x21, 0x7b, 0xe4, 0x28, 0xd6, 0xed,
-       0xd5, 0xf8, 0xd3, 0xb0, 0xd3, 0x67, 0x61, 0x0b, 0xac, 0x01, 0x1c, 0x62,
-       0xae, 0x25, 0x0d, 0x55, 0x23, 0x6b, 0x36, 0xc7, 0xd5, 0x19, 0xee, 0x76,
-       0x59, 0x56, 0x58, 0xcc, 0xad, 0x9d, 0x2f, 0x4f, 0xba, 0x6b, 0xc4, 0x50,
-       0x76, 0xff, 0xc7, 0xe0, 0xc7, 0x84, 0xed, 0xb6, 0xa9, 0x3e, 0x46, 0xa2,
-       0xc3, 0xeb, 0xa3, 0xf4, 0xdb, 0xd2, 0xe7, 0x95, 0x44, 0xd2, 0xda, 0xff,
-       0x89, 0xa4, 0x75, 0x73, 0xb7, 0x5b, 0x6f, 0x89, 0x9a, 0xb6, 0xc6, 0xf7,
-       0x52, 0xdc, 0xf5, 0x98, 0xc1, 0xba, 0xba, 0xb4, 0x8a, 0xa1, 0x61, 0xa4,
-       0x2f, 0x5f, 0x81, 0x7e, 0x03, 0xd2, 0x7e, 0xb2, 0xf9, 0xf8, 0x54, 0x7c,
-       0x28, 0x72, 0x50, 0x78, 0x02, 0x8b, 0x79, 0x75, 0x34, 0x9e, 0x95, 0x2b,
-       0x88, 0x93, 0x77, 0x88, 0x1d, 0x06, 0x2f, 0xcb, 0x9d, 0xc7, 0x93, 0xf1,
-       0x51, 0xad, 0x32, 0x89, 0xac, 0xe5, 0xe5, 0x49, 0xc6, 0xd9, 0x43, 0x22,
-       0xc0, 0x97, 0x27, 0x47, 0x24, 0x5d, 0x54, 0xef, 0xa9, 0xf0, 0x9c, 0xad,
-       0x36, 0x0d, 0xf9, 0xe1, 0xf9, 0x09, 0x06, 0x46, 0xdd, 0xea, 0x8f, 0xa4,
-       0xe5, 0x69, 0xd6, 0xc0, 0x24, 0xb7, 0x20, 0xdb, 0x92, 0xf0, 0xab, 0xf6,
-       0x44, 0xbb, 0x4c, 0xd7, 0x1a, 0x99, 0xfe, 0x53, 0xcf, 0x82, 0xc6, 0x14,
-       0x68, 0xed, 0x45, 0x6e, 0x92, 0x45, 0xac, 0xa6, 0x7c, 0xe9, 0xbb, 0x9f,
-       0x81, 0x8c, 0x3e, 0xc2, 0x3d, 0xe5, 0xd1, 0xac, 0x44, 0x27, 0xf2, 0x8a,
-       0xee, 0x5b, 0x5a, 0x6e, 0xf8, 0x57, 0x10, 0xeb, 0x02, 0xb2, 0x2b, 0x26,
-       0xfa, 0xde, 0x58, 0xe0, 0xed, 0x29, 0x8b, 0x6d, 0x41, 0xb6, 0xe9, 0x68,
-       0x0b, 0xfc, 0x7a, 0x2c, 0xa8, 0x27, 0x63, 0xd1, 0x51, 0x9e, 0x8f, 0x36,
-       0xac, 0x29, 0xee, 0x4d, 0x3c, 0x20, 0x5d, 0x7b, 0xa5, 0xe7, 0x42, 0x74,
-       0xf4, 0x06, 0x78, 0x09, 0x28, 0x5f, 0x3f, 0x25, 0xba, 0xd7, 0xde, 0xbd,
-       0xda, 0x1e, 0xf0, 0xda, 0xf7, 0x4a, 0xd7, 0x85, 0x21, 0xf3, 0x75, 0x99,
-       0x01, 0x4d, 0x43, 0xae, 0x23, 0xd7, 0xb1, 0x06, 0xa6, 0x60, 0x8b, 0x4f,
-       0x92, 0x97, 0xfd, 0xc0, 0x1a, 0x58, 0x1b, 0xc8, 0xbf, 0xad, 0x0f, 0xcb,
-       0x57, 0xcd, 0x4e, 0xc9, 0xa9, 0x5c, 0x37, 0xe0, 0xd6, 0x52, 0x61, 0xef,
-       0x8f, 0x0e, 0x1c, 0xec, 0x71, 0xeb, 0x05, 0xdc, 0xef, 0x18, 0x46, 0xdb,
-       0x9d, 0xe6, 0x39, 0x8b, 0x6d, 0xbc, 0x77, 0xa7, 0x59, 0xb5, 0x86, 0xcc,
-       0x94, 0x16, 0xf4, 0xf6, 0xbd, 0x0f, 0xa9, 0xb9, 0xe7, 0xcb, 0xfd, 0x66,
-       0x45, 0x1e, 0xd5, 0x52, 0x0f, 0x22, 0x5e, 0x38, 0xd3, 0xe8, 0x7b, 0x87,
-       0xe7, 0x29, 0x54, 0x7d, 0xbf, 0x22, 0xfe, 0x35, 0xe9, 0x0c, 0x99, 0xe3,
-       0xea, 0xd9, 0x21, 0xf3, 0xa8, 0xd6, 0xfa, 0x6c, 0x58, 0x1b, 0x5f, 0xf3,
-       0x6c, 0x97, 0x92, 0x91, 0x61, 0xb9, 0x7d, 0x66, 0xcb, 0x7b, 0xe5, 0x79,
-       0x87, 0xfd, 0xee, 0x34, 0x53, 0xd6, 0x03, 0xda, 0xd1, 0x07, 0xe9, 0x0b,
-       0xd9, 0xf7, 0xf6, 0xba, 0x71, 0x78, 0x7d, 0xaf, 0x31, 0x9a, 0xb2, 0x76,
-       0x8c, 0x4d, 0xaa, 0xcf, 0x55, 0xd5, 0x27, 0xa0, 0x64, 0xbd, 0x76, 0x9c,
-       0xbf, 0x91, 0xb5, 0xe3, 0x74, 0xad, 0xce, 0x79, 0x16, 0x34, 0x8f, 0xa1,
-       0x6f, 0xd1, 0xe9, 0x0f, 0x57, 0xe5, 0x76, 0x33, 0x67, 0xbd, 0x29, 0x57,
-       0x57, 0x69, 0xff, 0x12, 0xd7, 0xad, 0x3c, 0xfd, 0xd2, 0xe3, 0x91, 0xbf,
-       0xd9, 0xf6, 0x2f, 0x95, 0xbc, 0x1f, 0xb0, 0xfa, 0xf7, 0x57, 0xb4, 0xe8,
-       0xe8, 0x5f, 0x0a, 0x75, 0xf5, 0xcf, 0x94, 0xaf, 0xf9, 0x18, 0xf4, 0xb4,
-       0xed, 0x05, 0xac, 0xdd, 0xe1, 0xa4, 0xea, 0x73, 0xdd, 0xda, 0x2b, 0xdb,
-       0x4e, 0xf6, 0x9b, 0xd7, 0xe5, 0x33, 0x92, 0x0e, 0xf1, 0x1a, 0x39, 0x94,
-       0xc5, 0xf7, 0x52, 0x3e, 0xc1, 0xbc, 0x00, 0xba, 0xec, 0x1f, 0xfc, 0x4b,
-       0x79, 0x56, 0x8e, 0x96, 0xe6, 0xe0, 0x7b, 0xa6, 0x64, 0xf0, 0x05, 0xfa,
-       0x9f, 0xbc, 0xe9, 0xd6, 0x6a, 0xdc, 0x98, 0x98, 0xf2, 0x62, 0xe2, 0x9c,
-       0xf2, 0x73, 0xaf, 0x79, 0xe7, 0x22, 0xfa, 0x07, 0xcf, 0xe1, 0xd9, 0x57,
-       0x94, 0x0f, 0xf8, 0x3d, 0xa9, 0x62, 0x2d, 0x44, 0x5e, 0xde, 0x2c, 0x0f,
-       0x3c, 0x41, 0x9b, 0x44, 0x06, 0xf0, 0xb1, 0x36, 0xf5, 0x1e, 0x8c, 0x6e,
-       0x75, 0x88, 0x6c, 0xa1, 0xfd, 0x5c, 0x86, 0xad, 0x4d, 0xb9, 0x7b, 0x5f,
-       0x6b, 0xae, 0xa3, 0x13, 0x2b, 0xf2, 0x1f, 0x94, 0x1d, 0x7e, 0xfc, 0x82,
-       0xfb, 0x3d, 0x7c, 0x01, 0xe9, 0x72, 0x6c, 0xaf, 0x6c, 0xbf, 0xe0, 0xda,
-       0xdd, 0xec, 0xfc, 0xb3, 0x4a, 0xbe, 0x53, 0x4a, 0xbe, 0x4d, 0x99, 0x89,
-       0x53, 0xf6, 0x9c, 0x13, 0xcf, 0x4f, 0xba, 0x32, 0xf9, 0x9c, 0x67, 0x47,
-       0xfd, 0x2f, 0xf0, 0x3d, 0x35, 0xca, 0x88, 0x7c, 0xcf, 0xf4, 0x70, 0x3f,
-       0x76, 0xdb, 0x05, 0xce, 0xb7, 0x6f, 0xcd, 0x7c, 0x4f, 0xc0, 0xc7, 0x0e,
-       0x0c, 0xb8, 0x73, 0x7e, 0x6d, 0xfe, 0xfd, 0xcf, 0xf9, 0x77, 0x57, 0xe7,
-       0x6c, 0x48, 0x55, 0xe5, 0xb9, 0xb1, 0xcd, 0xd2, 0x95, 0x93, 0x06, 0xec,
-       0xe3, 0xcf, 0x85, 0x67, 0xc6, 0xc9, 0x8b, 0x3b, 0xee, 0xb2, 0x43, 0x9e,
-       0xfc, 0x39, 0x90, 0xaf, 0x29, 0x4f, 0x7f, 0xe4, 0xe3, 0xd9, 0x0d, 0xef,
-       0x5d, 0x97, 0x46, 0x66, 0x10, 0x6d, 0xba, 0xd2, 0xe1, 0x98, 0xb7, 0xde,
-       0xf6, 0x8a, 0xae, 0x74, 0x98, 0x5c, 0xd5, 0xe1, 0x0d, 0xe8, 0xb0, 0x2a,
-       0x9f, 0xc6, 0x9c, 0xb0, 0xbe, 0x5f, 0x18, 0x32, 0x67, 0x64, 0xab, 0xd2,
-       0xbf, 0x35, 0x00, 0x9f, 0xea, 0xe9, 0xb2, 0xfd, 0x3e, 0x74, 0xf9, 0xba,
-       0x28, 0x7d, 0xaa, 0x73, 0x44, 0x55, 0x45, 0x87, 0xbe, 0x8d, 0x73, 0x6b,
-       0x57, 0x3e, 0x81, 0x3c, 0xaa, 0xb3, 0x01, 0x13, 0xae, 0x7e, 0xd5, 0x9a,
-       0xf7, 0xf4, 0x9b, 0x9d, 0xa0, 0x0e, 0x7f, 0xad, 0xc7, 0xd5, 0x67, 0x87,
-       0xea, 0x73, 0x2a, 0x36, 0xaa, 0xd6, 0xbb, 0x35, 0xf0, 0xe9, 0x1e, 0xea,
-       0xf4, 0x79, 0xc7, 0xfd, 0x2e, 0x22, 0xce, 0x9d, 0x72, 0xde, 0x4b, 0xaf,
-       0xae, 0x4e, 0xc7, 0xc4, 0x5d, 0x57, 0xeb, 0xf5, 0xa9, 0x5f, 0x08, 0x28,
-       0x1b, 0x1e, 0x83, 0x0c, 0x8f, 0x97, 0x1e, 0xf4, 0xec, 0xde, 0x9d, 0xf3,
-       0xc0, 0xfb, 0x9c, 0xf3, 0x91, 0x62, 0xbf, 0xf9, 0x26, 0xee, 0x8d, 0x63,
-       0xce, 0x33, 0xd2, 0x26, 0x29, 0x6f, 0xce, 0x91, 0xd5, 0x39, 0xfb, 0x3c,
-       0xba, 0xfd, 0x52, 0xcc, 0x63, 0x1d, 0xfa, 0xaf, 0x7f, 0xab, 0xde, 0x37,
-       0xb9, 0x59, 0xa4, 0xdf, 0x06, 0x56, 0x0a, 0xf5, 0xca, 0xf5, 0x5a, 0x44,
-       0xae, 0x13, 0x83, 0x8c, 0xe0, 0xdb, 0x99, 0xf3, 0x62, 0x78, 0x50, 0x5e,
-       0x2f, 0x6e, 0xc4, 0xc7, 0xb0, 0xdc, 0x28, 0xfa, 0xbc, 0x10, 0x0b, 0x33,
-       0x5f, 0x98, 0x92, 0x37, 0xe6, 0xfb, 0xa5, 0x31, 0x81, 0xb8, 0x3f, 0x40,
-       0x99, 0x0c, 0x99, 0x7b, 0xd4, 0x7b, 0x48, 0x77, 0x9a, 0x97, 0x2d, 0xd0,
-       0x5f, 0x68, 0xca, 0x41, 0xee, 0x67, 0xf3, 0x77, 0xed, 0x21, 0x69, 0x30,
-       0xa7, 0x18, 0xe8, 0x95, 0xca, 0x02, 0xf2, 0xf9, 0x22, 0xe9, 0x53, 0x6e,
-       0x7b, 0xd5, 0xef, 0x71, 0x8c, 0xf7, 0x39, 0xbe, 0x1f, 0x10, 0xa2, 0x6e,
-       0xee, 0x34, 0x97, 0x2d, 0xee, 0x67, 0x4e, 0x49, 0x0d, 0xfa, 0xfb, 0xe7,
-       0x31, 0xee, 0xb7, 0xe7, 0xd4, 0xf9, 0xdb, 0x4a, 0x6d, 0x02, 0xb9, 0xc3,
-       0x9d, 0xe6, 0x9c, 0x75, 0x56, 0xe9, 0xad, 0x56, 0x7e, 0xc2, 0x6b, 0xe7,
-       0x35, 0xef, 0x35, 0x32, 0xdb, 0x06, 0x98, 0xaf, 0x3e, 0x81, 0x7c, 0x81,
-       0xb9, 0xea, 0x04, 0xf0, 0x1a, 0x65, 0x12, 0x91, 0xd9, 0x22, 0x69, 0x49,
-       0x68, 0x13, 0xf2, 0xfb, 0x9c, 0x8c, 0x83, 0x9f, 0x08, 0x72, 0x7b, 0xc6,
-       0x87, 0x47, 0x65, 0x39, 0xe4, 0xc6, 0x01, 0x9e, 0xfb, 0x5a, 0x46, 0x6c,
-       0x58, 0x5e, 0x8d, 0x0d, 0x5b, 0x71, 0xdd, 0xc8, 0xc4, 0x07, 0xfe, 0x06,
-       0xf4, 0x59, 0xb7, 0x61, 0x6c, 0x18, 0x45, 0x7f, 0xb6, 0xf5, 0xca, 0xec,
-       0x02, 0x92, 0x08, 0xe4, 0x2c, 0x15, 0xe1, 0x99, 0x8e, 0xac, 0x9c, 0xaa,
-       0xf5, 0x87, 0x2f, 0x6b, 0x69, 0x75, 0xf6, 0x23, 0x36, 0xc0, 0xf3, 0x2c,
-       0xbd, 0x52, 0x5b, 0x90, 0x88, 0x91, 0x78, 0x52, 0x9c, 0x9a, 0x8b, 0xd9,
-       0xe7, 0x34, 0x9e, 0x69, 0xb1, 0xa5, 0xb6, 0xb6, 0x8f, 0x89, 0xdc, 0x57,
-       0xbe, 0xe3, 0xf5, 0x49, 0xab, 0x3e, 0x7f, 0xdd, 0xc3, 0x3d, 0xb4, 0x9a,
-       0xd3, 0x03, 0x1e, 0xc8, 0xdb, 0xc3, 0xad, 0xe3, 0x46, 0xee, 0x8e, 0xcb,
-       0x31, 0x91, 0xcd, 0x6c, 0xb1, 0x31, 0xee, 0x4d, 0x3c, 0xf3, 0x24, 0xf8,
-       0xb8, 0x63, 0xe8, 0xd6, 0x93, 0x52, 0xa8, 0xad, 0x1f, 0xa3, 0x95, 0x07,
-       0x3e, 0x43, 0xfa, 0x1c, 0xe7, 0x00, 0xf8, 0xbb, 0xa3, 0xe9, 0xd6, 0x01,
-       0xc8, 0xd2, 0x1d, 0xc3, 0x38, 0x13, 0x35, 0x7f, 0x2a, 0x03, 0xa2, 0x9f,
-       0xd3, 0x94, 0xfc, 0xf5, 0xca, 0x30, 0x16, 0x48, 0x46, 0xba, 0x96, 0x26,
-       0xc5, 0x58, 0x62, 0x0d, 0xe1, 0xb5, 0xce, 0xb4, 0xda, 0xbf, 0xdd, 0x84,
-       0xf5, 0x2d, 0x76, 0xc0, 0x62, 0xbd, 0x80, 0xf5, 0xe0, 0x9f, 0x6e, 0x96,
-       0x1e, 0xd6, 0x0b, 0x98, 0x37, 0xec, 0xc7, 0x37, 0x73, 0x87, 0x4b, 0x4d,
-       0xe4, 0x7a, 0x9b, 0x19, 0x5f, 0x73, 0x35, 0xde, 0x8f, 0x46, 0x44, 0x78,
-       0x8f, 0x7e, 0xa3, 0x57, 0xda, 0xbe, 0x35, 0x08, 0x5f, 0xf1, 0x34, 0xb0,
-       0x37, 0xe8, 0x9e, 0x1c, 0x90, 0x80, 0x7b, 0x66, 0x42, 0xd5, 0x5b, 0xde,
-       0x58, 0x88, 0x7a, 0xef, 0x73, 0xc9, 0xb6, 0xcb, 0x71, 0xd6, 0x44, 0xfb,
-       0x58, 0xf3, 0x41, 0x3f, 0xd1, 0x97, 0x91, 0x9f, 0x5e, 0xaf, 0x59, 0x9b,
-       0x79, 0x7e, 0xf3, 0x86, 0x83, 0x6b, 0x62, 0xff, 0x90, 0xc2, 0x98, 0xde,
-       0x3d, 0xfe, 0x46, 0xbe, 0xf4, 0x8e, 0x77, 0x13, 0x98, 0x4f, 0x4d, 0x7a,
-       0x67, 0xe7, 0x1a, 0x99, 0xa3, 0x6b, 0x72, 0xaa, 0x41, 0x55, 0xef, 0x6d,
-       0x38, 0x16, 0xfc, 0xe3, 0x08, 0xec, 0x93, 0x6b, 0xa0, 0xa9, 0x3d, 0x01,
-       0x6c, 0x16, 0xe9, 0x55, 0x39, 0xd1, 0xf1, 0x27, 0xc4, 0xb5, 0x77, 0x58,
-       0x99, 0xf2, 0x65, 0x8d, 0xb2, 0x9b, 0x83, 0x2c, 0x97, 0x33, 0xf2, 0x47,
-       0xce, 0x15, 0x55, 0x6b, 0x9d, 0x47, 0x5e, 0x12, 0x38, 0xa5, 0x72, 0xb2,
-       0x16, 0x7c, 0x0b, 0xbf, 0xf7, 0xe2, 0xd7, 0xb1, 0x16, 0xa3, 0xea, 0x8c,
-       0x82, 0x7e, 0xae, 0xd9, 0x4c, 0xc1, 0x7f, 0xe8, 0x96, 0x65, 0x16, 0x10,
-       0x0f, 0x53, 0xea, 0x9c, 0x0b, 0xd7, 0xf1, 0x6f, 0x2b, 0xff, 0x2c, 0x15,
-       0xc8, 0xe6, 0x4c, 0x04, 0x74, 0x34, 0x65, 0x9f, 0x86, 0xd2, 0xc3, 0x13,
-       0x0a, 0xf3, 0x1a, 0xe7, 0xe0, 0xb0, 0x96, 0x06, 0x44, 0xce, 0x65, 0x64,
-       0x0e, 0x6b, 0x38, 0xb0, 0x44, 0x1d, 0x50, 0xb6, 0x93, 0xd2, 0x06, 0xd9,
-       0x1f, 0x01, 0xf6, 0x30, 0x4e, 0x51, 0xc6, 0x61, 0xac, 0x8b, 0x5e, 0x09,
-       0x9c, 0x81, 0x8c, 0x4f, 0x01, 0x23, 0x2c, 0xb4, 0xcb, 0xf7, 0x6a, 0xbe,
-       0x4c, 0x2f, 0xf1, 0x5c, 0xbf, 0x3e, 0x35, 0xd2, 0x47, 0x1c, 0x25, 0xd5,
-       0xda, 0x9c, 0xcc, 0x9d, 0x66, 0xce, 0x3e, 0xa9, 0xce, 0x0c, 0x04, 0xd4,
-       0x99, 0x15, 0x37, 0x67, 0x76, 0xbf, 0x5d, 0x8c, 0x59, 0x15, 0xee, 0xb5,
-       0x09, 0x6c, 0x67, 0x18, 0xe3, 0x6e, 0x24, 0x5f, 0x37, 0x57, 0x1d, 0x07,
-       0xbf, 0x97, 0xe7, 0xa3, 0x99, 0xbc, 0xc4, 0x79, 0x76, 0x7a, 0xc2, 0xc6,
-       0xfc, 0x97, 0xe1, 0x3f, 0xe7, 0x4a, 0x3c, 0x27, 0x5d, 0xc0, 0x0a, 0xcb,
-       0xc8, 0xe5, 0x22, 0x73, 0xc6, 0x8f, 0x43, 0x6f, 0xbc, 0x2e, 0x8c, 0x1a,
-       0xf0, 0x03, 0x2b, 0xea, 0xdd, 0xcf, 0xa8, 0xdd, 0x40, 0x0e, 0x1b, 0xd1,
-       0xf6, 0x43, 0xd7, 0x79, 0xb3, 0xcd, 0xb3, 0x07, 0x9e, 0xc5, 0x3f, 0x0b,
-       0x3f, 0x7a, 0x5e, 0xf8, 0x4e, 0xd6, 0xed, 0x26, 0xf3, 0xa5, 0xab, 0xf0,
-       0x7b, 0x99, 0x58, 0x06, 0x36, 0x94, 0x0f, 0x77, 0x80, 0xe7, 0xdf, 0xc4,
-       0xbd, 0x9c, 0xc3, 0x71, 0xa2, 0xf1, 0x15, 0x29, 0x44, 0x02, 0x32, 0x14,
-       0xb9, 0x22, 0x9b, 0xe1, 0xc9, 0x34, 0x79, 0xdd, 0x8a, 0x8e, 0x8a, 0xa6,
-       0xe8, 0x0d, 0xee, 0x86, 0x0d, 0xde, 0x84, 0xbf, 0x6b, 0xf7, 0x72, 0xfd,
-       0x54, 0x91, 0x18, 0xea, 0x59, 0x75, 0xb6, 0xe0, 0xaa, 0xc5, 0x3a, 0x20,
-       0xdf, 0xc5, 0xfe, 0x1f, 0x6a, 0x8c, 0xbb, 0x7b, 0x77, 0xac, 0x43, 0x93,
-       0x3f, 0x77, 0x8e, 0xbb, 0x2c, 0x97, 0x47, 0xd2, 0x69, 0x6b, 0xa1, 0x73,
-       0xd9, 0xa3, 0x73, 0xd6, 0xa3, 0x53, 0xf1, 0xe8, 0x5c, 0x5d, 0xa5, 0xb3,
-       0x07, 0x76, 0xd0, 0x6c, 0x9e, 0x00, 0xde, 0x48, 0xc6, 0x9b, 0xcd, 0x34,
-       0xf2, 0xb2, 0xd9, 0xe1, 0x69, 0xb5, 0xe7, 0xaa, 0x27, 0x46, 0xc7, 0x93,
-       0x96, 0x2b, 0x7f, 0x58, 0x81, 0x4c, 0xc3, 0x1e, 0xf3, 0xe2, 0x62, 0x75,
-       0xee, 0x07, 0xba, 0xfb, 0x85, 0x5d, 0xf0, 0x03, 0x4f, 0x23, 0x96, 0x5c,
-       0x1c, 0x3f, 0x6f, 0x49, 0x7e, 0xdb, 0x27, 0x75, 0xd8, 0x7b, 0x0f, 0xdf,
-       0x27, 0x35, 0xa5, 0xeb, 0xe2, 0x78, 0xb5, 0xf6, 0x34, 0xf2, 0x23, 0xf6,
-       0xdf, 0x4e, 0x0c, 0xb6, 0xab, 0x52, 0x8b, 0xec, 0x3a, 0xcb, 0xfd, 0x21,
-       0xf4, 0xab, 0xd4, 0xba, 0x21, 0xf7, 0x6e, 0x55, 0x57, 0xb9, 0x52, 0x0c,
-       0x41, 0x8f, 0x26, 0x6c, 0x3e, 0x84, 0xb6, 0x30, 0xec, 0xa0, 0x0f, 0xed,
-       0x3f, 0xc7, 0xda, 0x8e, 0xa0, 0x7d, 0xa5, 0x73, 0x5c, 0xe1, 0x58, 0x4b,
-       0xce, 0x39, 0x37, 0x11, 0x73, 0xdf, 0x84, 0x1f, 0x1d, 0x44, 0x9f, 0x61,
-       0xf4, 0xf9, 0x14, 0xc6, 0xe1, 0x3b, 0xcd, 0x1b, 0xf1, 0xd4, 0x00, 0x4f,
-       0x7a, 0x0b, 0x4f, 0x0d, 0xf0, 0x03, 0xdf, 0x79, 0x92, 0x35, 0xe8, 0x61,
-       0x39, 0x5a, 0xe4, 0x19, 0x29, 0xbe, 0x17, 0x6f, 0x4a, 0x00, 0x98, 0xb4,
-       0xed, 0x64, 0x34, 0xdc, 0x50, 0xb5, 0x1e, 0xda, 0xd6, 0x50, 0xbc, 0x2a,
-       0x2a, 0xce, 0x44, 0x8e, 0x22, 0x7e, 0xdd, 0x74, 0xba, 0xe5, 0x75, 0x6f,
-       0xac, 0x15, 0xe1, 0xfe, 0xe5, 0xda, 0xb1, 0x8e, 0x95, 0xae, 0x8d, 0xbf,
-       0x6a, 0x19, 0xde, 0xbc, 0x7a, 0x31, 0xd6, 0xaf, 0xa2, 0xef, 0xb5, 0xf1,
-       0xcb, 0xb5, 0x8d, 0xfa, 0xde, 0x44, 0xdf, 0xb6, 0x96, 0xbe, 0x37, 0xd1,
-       0xaf, 0x1b, 0x71, 0xb0, 0x5b, 0xcd, 0x69, 0x16, 0x7c, 0x5d, 0x2f, 0xaa,
-       0xf7, 0xb4, 0x21, 0x77, 0x8e, 0x69, 0x12, 0x53, 0x67, 0xdc, 0x5a, 0x49,
-       0xd4, 0x8c, 0x68, 0xef, 0xa8, 0xf7, 0x28, 0x1b, 0x18, 0xb3, 0x80, 0x7b,
-       0xe7, 0x27, 0xb4, 0x54, 0x35, 0x87, 0x98, 0xf5, 0x30, 0xf1, 0x53, 0xdc,
-       0x46, 0xcc, 0xac, 0x80, 0x5e, 0xad, 0xd8, 0xe0, 0x79, 0x6a, 0xd8, 0xc5,
-       0x2d, 0xe2, 0xec, 0x87, 0x0d, 0x75, 0xae, 0x21, 0xad, 0x6a, 0x76, 0x95,
-       0xa2, 0x98, 0xc9, 0x11, 0x9e, 0x65, 0xf8, 0x0c, 0xd6, 0xe5, 0x57, 0xd0,
-       0x96, 0x44, 0x7c, 0x3c, 0xa0, 0x25, 0xcf, 0x8f, 0xe3, 0xfa, 0x49, 0x5c,
-       0xc3, 0x1f, 0x2f, 0x64, 0x71, 0xff, 0x49, 0x5c, 0x4f, 0x6b, 0xa9, 0x7a,
-       0x16, 0xd7, 0x4f, 0xe1, 0x7a, 0xca, 0x64, 0x9e, 0xf2, 0xaa, 0x95, 0xd1,
-       0x6c, 0xd0, 0xb2, 0xcf, 0x8f, 0xe3, 0xd3, 0x4a, 0x8f, 0xf7, 0xa0, 0xa7,
-       0x22, 0xf7, 0xda, 0x62, 0xe0, 0x69, 0x9f, 0x96, 0xae, 0x76, 0x81, 0xc6,
-       0x00, 0x9e, 0xa7, 0x4d, 0xed, 0xf7, 0xc6, 0x67, 0xcd, 0xe9, 0x63, 0xaa,
-       0xe6, 0x64, 0x24, 0x32, 0xc0, 0xc9, 0x87, 0x91, 0x07, 0x68, 0x92, 0xb6,
-       0x9e, 0x93, 0x42, 0x1c, 0x7e, 0xa5, 0x6a, 0x48, 0x2a, 0x94, 0xc7, 0xef,
-       0xbc, 0x24, 0x47, 0x71, 0xbf, 0x4a, 0x5b, 0x60, 0xbf, 0x3f, 0x95, 0x42,
-       0x99, 0xb8, 0x9f, 0x75, 0x26, 0xd6, 0xa6, 0x58, 0x5f, 0xca, 0x41, 0x06,
-       0x21, 0xda, 0xef, 0x06, 0x35, 0x31, 0xf7, 0x8c, 0x34, 0xe2, 0xb2, 0x96,
-       0xac, 0x72, 0xdf, 0xaf, 0x91, 0xb9, 0x6c, 0xf1, 0xfd, 0xb1, 0x69, 0xee,
-       0x23, 0x16, 0x8c, 0x04, 0xeb, 0x23, 0xaa, 0xbe, 0x1e, 0x77, 0xf7, 0x07,
-       0x5b, 0xcf, 0xa4, 0xf8, 0xeb, 0x85, 0xe3, 0x7e, 0x0d, 0xcf, 0xbb, 0xf5,
-       0xac, 0x54, 0xfd, 0x9d, 0xba, 0xe0, 0x3b, 0x00, 0xe7, 0xa0, 0x8b, 0xcb,
-       0x2a, 0x37, 0xe6, 0x1e, 0xee, 0xbb, 0xe5, 0x54, 0xc8, 0x61, 0x8a, 0xac,
-       0x91, 0xf9, 0xfb, 0x76, 0xbe, 0x1c, 0xd7, 0xf3, 0x4a, 0x3e, 0x67, 0x40,
-       0x53, 0xe2, 0xf4, 0xbb, 0xd9, 0x10, 0xf7, 0xdf, 0xf8, 0x8c, 0x7c, 0xf3,
-       0x2e, 0xdf, 0xe4, 0x99, 0xf2, 0x38, 0x0c, 0xff, 0xc9, 0xf7, 0x2b, 0x9e,
-       0x93, 0x5c, 0x9c, 0x35, 0x1e, 0x03, 0xb1, 0x31, 0x8f, 0xdf, 0x77, 0xe5,
-       0x37, 0xeb, 0xc9, 0x2f, 0x57, 0xfe, 0x2f, 0x4a, 0x87, 0x15, 0x8b, 0xe3,
-       0xf9, 0xb5, 0x8f, 0xbd, 0x4a, 0x77, 0x15, 0x75, 0x7e, 0xd7, 0x97, 0x81,
-       0x5f, 0xbf, 0xdb, 0xd8, 0xf6, 0xc6, 0x2d, 0xf2, 0xf6, 0x10, 0xcf, 0x43,
-       0x0c, 0xda, 0x42, 0xfe, 0x39, 0x0f, 0xc6, 0x30, 0x7f, 0xaf, 0xd5, 0x9f,
-       0x83, 0x3f, 0xcf, 0xfb, 0x95, 0x0f, 0xf9, 0xfd, 0xe4, 0x16, 0xe9, 0xca,
-       0x98, 0x86, 0xc5, 0xd8, 0xf0, 0xb8, 0xb7, 0x3f, 0xf0, 0x7f, 0x43, 0xce,
-       0xae, 0x2c, 0x02, 0x09, 0x99, 0xf5, 0xde, 0xbf, 0xde, 0xc0, 0x1e, 0xd6,
-       0xef, 0x35, 0x37, 0x32, 0x67, 0xad, 0xbb, 0xf3, 0xae, 0x6c, 0x30, 0xef,
-       0x8a, 0x37, 0xef, 0xea, 0x7d, 0xf2, 0x5b, 0x99, 0xb7, 0x31, 0x67, 0xda,
-       0xdc, 0x46, 0xf6, 0x28, 0xea, 0xdd, 0xb0, 0x15, 0x23, 0x18, 0xb4, 0x9d,
-       0x7b, 0xd5, 0x50, 0x99, 0x57, 0xbb, 0x76, 0x79, 0x16, 0xb1, 0xb0, 0x5c,
-       0x76, 0x73, 0xec, 0xb2, 0xc3, 0x5a, 0xf6, 0xbb, 0xf1, 0xc0, 0x77, 0xb9,
-       0xbe, 0xa8, 0xce, 0xbb, 0xcc, 0x3a, 0x6e, 0xdd, 0xab, 0x5c, 0x6e, 0x8d,
-       0xa9, 0x0f, 0x32, 0x9e, 0x0e, 0xe6, 0x65, 0x82, 0xef, 0x94, 0xe3, 0xfa,
-       0x11, 0xb9, 0xb2, 0xa0, 0xf6, 0xac, 0xbc, 0xbd, 0x21, 0xee, 0xf9, 0xa8,
-       0xfd, 0x6f, 0xf8, 0xb5, 0x49, 0xe5, 0xd7, 0x97, 0x17, 0xd4, 0x3d, 0x17,
-       0x2b, 0x39, 0x13, 0xf0, 0xfb, 0xc8, 0x25, 0xac, 0x07, 0xa4, 0x80, 0x9c,
-       0xfb, 0xac, 0x75, 0x78, 0x0b, 0x71, 0x0e, 0x69, 0x2d, 0x83, 0xd6, 0xe5,
-       0x05, 0xd9, 0xc2, 0x33, 0x25, 0x65, 0xb5, 0xcf, 0xe6, 0xd6, 0xc5, 0xa7,
-       0xc5, 0xff, 0x7f, 0x1d, 0x41, 0x2f, 0x16, 0xf2, 0x5c, 0x0b, 0xdf, 0x73,
-       0xa6, 0xaf, 0x40, 0x1e, 0x34, 0xc1, 0x7d, 0x9c, 0x66, 0xd3, 0xad, 0x9b,
-       0x37, 0xb1, 0x2e, 0xda, 0xf8, 0x0e, 0x05, 0xfe, 0x0e, 0xc3, 0x7e, 0xb0,
-       0x4e, 0x56, 0xdb, 0x79, 0xcd, 0xdc, 0xc3, 0xbf, 0x66, 0x60, 0xfb, 0x3f,
-       0xe8, 0xf3, 0x49, 0x14, 0x38, 0x46, 0x00, 0x00, 0x00 };
+       0xbd, 0x7c, 0x7d, 0x70, 0x1c, 0xe7, 0x79, 0xdf, 0xb3, 0xbb, 0x07, 0xe0,
+       0x00, 0x82, 0xe0, 0x12, 0x39, 0x52, 0x27, 0x0a, 0xa6, 0x6e, 0x89, 0x3d,
+       0x08, 0x32, 0x20, 0x71, 0xc5, 0x20, 0x36, 0x26, 0xb9, 0xca, 0xab, 0xbb,
+       0x03, 0x78, 0x94, 0x31, 0x31, 0xc4, 0xc2, 0x16, 0xed, 0x70, 0xd4, 0xeb,
+       0x01, 0xa4, 0x95, 0x54, 0x9e, 0xb2, 0xb6, 0xda, 0x72, 0x5a, 0x35, 0x3a,
+       0x1f, 0xc0, 0x0f, 0x29, 0x47, 0x1c, 0x24, 0xc0, 0x84, 0xfe, 0x70, 0x93,
+       0x13, 0x0e, 0x24, 0x64, 0xf7, 0x88, 0x93, 0xfc, 0xd9, 0x3f, 0x62, 0x0b,
+       0x03, 0xd2, 0xb4, 0x5a, 0xbb, 0xb5, 0xda, 0x28, 0x13, 0xcf, 0xf4, 0x63,
+       0x30, 0x14, 0xa5, 0x28, 0x71, 0xa7, 0x56, 0x9b, 0x4c, 0xa2, 0x36, 0x94,
+       0xaf, 0xbf, 0xdf, 0xbb, 0xbb, 0xe0, 0x01, 0x22, 0x65, 0x51, 0x93, 0x14,
+       0x33, 0x37, 0x77, 0xfb, 0xee, 0xbb, 0xef, 0xfb, 0x7c, 0xbd, 0xcf, 0xf3,
+       0xfc, 0x9e, 0xf7, 0x5d, 0x44, 0x45, 0xda, 0xc4, 0xff, 0xdb, 0x8a, 0x4f,
+       0xec, 0xd8, 0xf1, 0xc7, 0xef, 0xfd, 0xf8, 0xbd, 0xbf, 0x8a, 0x9f, 0xf7,
+       0x89, 0xd6, 0x62, 0xf0, 0xe6, 0x5b, 0x86, 0x48, 0xf6, 0xcf, 0xe5, 0x43,
+       0xff, 0xe1, 0x71, 0x33, 0x18, 0x9f, 0x1f, 0x09, 0xeb, 0x89, 0x57, 0x87,
+       0x93, 0xb6, 0x84, 0x8d, 0x44, 0xfe, 0xa1, 0x71, 0x5b, 0xc4, 0xad, 0xf6,
+       0xc5, 0x52, 0xf2, 0x6e, 0x3d, 0x1f, 0x09, 0x09, 0xdb, 0x3f, 0x92, 0xb8,
+       0xf6, 0xe4, 0xf7, 0x3e, 0x6e, 0xbd, 0x5d, 0x36, 0x24, 0x6c, 0x26, 0xb2,
+       0x62, 0xf6, 0x48, 0xb8, 0x0b, 0xcf, 0x7c, 0xf5, 0xae, 0x47, 0x0d, 0xe9,
+       0x08, 0xc6, 0x7a, 0xab, 0xfe, 0xbd, 0xbb, 0x24, 0xbf, 0x2b, 0x51, 0x8f,
+       0x85, 0x12, 0xef, 0xd6, 0xa7, 0x06, 0xc2, 0xa2, 0x27, 0xac, 0x68, 0xd2,
+       0x88, 0xc8, 0xcb, 0x35, 0x53, 0x5e, 0xac, 0xc5, 0x64, 0xb2, 0x26, 0x1d,
+       0xe9, 0xda, 0x8d, 0x68, 0xaa, 0xa3, 0xef, 0xbb, 0xf5, 0xe4, 0x40, 0x28,
+       0x6b, 0x24, 0xa4, 0x23, 0x59, 0x93, 0xd1, 0x63, 0xc5, 0xd6, 0x87, 0x9b,
+       0x12, 0x4f, 0xd6, 0x75, 0x5b, 0xb2, 0xa1, 0x84, 0x9d, 0xd7, 0xf5, 0xf6,
+       0x41, 0xf3, 0x63, 0x68, 0xaf, 0x0e, 0x86, 0x26, 0x8b, 0xa6, 0x9c, 0x1b,
+       0x68, 0x15, 0xdd, 0x0e, 0x4b, 0xb2, 0xd6, 0xfa, 0xb0, 0x9e, 0x88, 0x88,
+       0x5b, 0xab, 0xd7, 0x8f, 0x39, 0xff, 0x64, 0xaf, 0xf9, 0xeb, 0xe1, 0xf0,
+       0x64, 0x51, 0xde, 0x0e, 0xd9, 0x76, 0x74, 0x42, 0x7a, 0xcc, 0x9c, 0x68,
+       0x92, 0xec, 0xef, 0x89, 0x1e, 0xc1, 0xf7, 0x78, 0x7f, 0xdc, 0x4c, 0xc9,
+       0x16, 0x71, 0xcd, 0x6f, 0xae, 0x98, 0x3d, 0x5d, 0x59, 0x3d, 0x11, 0x96,
+       0x74, 0x51, 0x13, 0xc3, 0x8e, 0xc8, 0x64, 0xc5, 0x96, 0xfc, 0x52, 0x87,
+       0xe4, 0x2b, 0xf2, 0xc4, 0x94, 0xd3, 0x2e, 0x53, 0x4b, 0x47, 0x7d, 0x5d,
+       0x44, 0xd0, 0xd6, 0x2b, 0xf9, 0x5a, 0x14, 0x9f, 0x9f, 0xf8, 0xfc, 0xea,
+       0x22, 0x3b, 0x05, 0xcf, 0xf7, 0xa7, 0xdd, 0xea, 0xd7, 0xc2, 0x5e, 0xdb,
+       0x7f, 0xd9, 0xe2, 0x7d, 0x83, 0xdf, 0x12, 0xf8, 0x2d, 0x85, 0x65, 0xcd,
+       0x88, 0xca, 0xf7, 0xee, 0x8a, 0xc9, 0x54, 0x69, 0x0d, 0xb2, 0x89, 0xca,
+       0x37, 0x6a, 0x11, 0x79, 0x49, 0xc9, 0x22, 0xa4, 0x0d, 0xa3, 0xcf, 0x64,
+       0x69, 0x42, 0x3f, 0x51, 0xcc, 0x4b, 0xaa, 0x96, 0xd5, 0x0b, 0x73, 0x66,
+       0x47, 0x72, 0x29, 0xa7, 0x4f, 0xce, 0x75, 0x76, 0xa4, 0x96, 0x26, 0xf4,
+       0x42, 0x31, 0x0a, 0x39, 0x98, 0x1d, 0xa9, 0xf9, 0x08, 0xae, 0x3b, 0x3b,
+       0x92, 0xf3, 0xd6, 0x0c, 0x26, 0x45, 0x9f, 0x68, 0x47, 0xaa, 0x64, 0x65,
+       0x45, 0xba, 0x9d, 0x1f, 0x48, 0x57, 0x47, 0xaa, 0xf6, 0x5b, 0xfa, 0x8a,
+       0xa9, 0x49, 0xe1, 0x1e, 0x31, 0xa3, 0x89, 0xb7, 0xeb, 0xb7, 0xdb, 0x9a,
+       0x98, 0xf6, 0x3b, 0xf5, 0xed, 0x90, 0x4d, 0x6e, 0xb6, 0x15, 0xbc, 0x92,
+       0x26, 0x53, 0x72, 0xf3, 0x7d, 0xe6, 0xaa, 0x34, 0x89, 0x1b, 0x09, 0xae,
+       0xeb, 0xf5, 0xa4, 0xf3, 0x07, 0xe4, 0x91, 0xf2, 0xee, 0x18, 0x86, 0x5e,
+       0x92, 0xa0, 0x39, 0xe9, 0xbc, 0x5b, 0xf7, 0x9e, 0x09, 0x63, 0xce, 0x50,
+       0xc7, 0x50, 0xa9, 0x5e, 0x4f, 0x3b, 0x18, 0xdf, 0x09, 0x9e, 0x6d, 0x92,
+       0x72, 0xc4, 0x2d, 0x4f, 0x3a, 0x96, 0xe1, 0xc9, 0x87, 0xba, 0xe7, 0xb5,
+       0x0b, 0x7d, 0xe4, 0x25, 0x17, 0x91, 0x72, 0xc1, 0xf9, 0x98, 0x3c, 0xe5,
+       0x44, 0xc1, 0x5f, 0x58, 0x4e, 0x39, 0xb0, 0x2f, 0xfb, 0xb8, 0x96, 0xac,
+       0x59, 0xb1, 0xac, 0x3c, 0x2d, 0xc9, 0xf9, 0x6e, 0x33, 0x2d, 0x98, 0xdb,
+       0xae, 0xdf, 0x99, 0x74, 0x30, 0x5f, 0xff, 0xff, 0xad, 0xbb, 0x11, 0x2b,
+       0x5b, 0x96, 0x5e, 0x29, 0x94, 0xba, 0x9d, 0x1f, 0x43, 0x4f, 0x61, 0x5b,
+       0xdc, 0x71, 0xdb, 0x84, 0xdc, 0xac, 0xde, 0x94, 0x51, 0x97, 0x07, 0x31,
+       0x7f, 0xd2, 0xc6, 0xfd, 0x9a, 0x6c, 0xd3, 0xed, 0x66, 0x29, 0x98, 0x12,
+       0x69, 0x93, 0xdd, 0x52, 0x98, 0x45, 0xbb, 0xe3, 0x76, 0xea, 0x78, 0x26,
+       0x33, 0xc0, 0x36, 0xd1, 0x8c, 0x04, 0x75, 0x2c, 0xb2, 0x50, 0xed, 0xc5,
+       0xfc, 0x71, 0xb7, 0x55, 0x33, 0x65, 0xcd, 0x0c, 0x49, 0xa5, 0x1a, 0x77,
+       0xa3, 0x5a, 0xb3, 0x9c, 0x8a, 0xb7, 0x41, 0xa6, 0x51, 0x8c, 0x2d, 0x5f,
+       0xd6, 0x13, 0xf1, 0x68, 0x0e, 0x4a, 0xa3, 0x1d, 0x4d, 0x81, 0x9e, 0x29,
+       0x27, 0xab, 0xa5, 0x6a, 0x9f, 0xd3, 0x92, 0x4b, 0x87, 0xb4, 0xfd, 0x4b,
+       0xe8, 0x53, 0xfb, 0x1f, 0xbe, 0x0d, 0x44, 0x41, 0x9b, 0x8e, 0x67, 0xd9,
+       0x0e, 0x9a, 0x15, 0xed, 0x68, 0x83, 0x2e, 0x57, 0xc6, 0x22, 0x1d, 0x49,
+       0xa5, 0x4b, 0xd2, 0xa6, 0x4b, 0x6e, 0x54, 0x93, 0x4e, 0xdb, 0x95, 0xf0,
+       0xaf, 0x41, 0x9f, 0xf3, 0xd0, 0xe5, 0x7c, 0x4c, 0x4e, 0x94, 0x24, 0xa2,
+       0x0b, 0xe7, 0xca, 0xea, 0x95, 0x2a, 0xed, 0x01, 0xba, 0x85, 0xee, 0x0b,
+       0x55, 0x3e, 0x0b, 0x1d, 0x96, 0xd2, 0x90, 0x4f, 0x06, 0x73, 0x1f, 0xd4,
+       0x1e, 0xac, 0x8c, 0x69, 0x19, 0xd8, 0x49, 0x61, 0xb6, 0x0f, 0xba, 0xb3,
+       0x62, 0x6b, 0xb2, 0x4d, 0x0a, 0xb6, 0x1d, 0xfb, 0xac, 0xb4, 0xcb, 0xa9,
+       0x79, 0x5b, 0x4e, 0xcc, 0xc3, 0x1e, 0x4d, 0xcb, 0x5c, 0x94, 0xae, 0xec,
+       0x96, 0x44, 0x87, 0x3c, 0x3d, 0x6b, 0x65, 0xca, 0xd2, 0xed, 0xbe, 0x81,
+       0xfb, 0xb9, 0x33, 0xd4, 0xa9, 0xe4, 0x53, 0x8e, 0x21, 0x59, 0x93, 0x76,
+       0x7d, 0x9b, 0x26, 0x6d, 0xf5, 0x27, 0x93, 0x8e, 0x15, 0xa5, 0xcd, 0xa6,
+       0x3e, 0xdd, 0x6d, 0x1e, 0x10, 0xcb, 0xcc, 0x50, 0xfe, 0x4e, 0x1f, 0xf4,
+       0xf0, 0xbf, 0x29, 0x7b, 0x8c, 0x45, 0x1d, 0xf7, 0x45, 0x4f, 0x41, 0x97,
+       0x59, 0xa5, 0xe3, 0x0e, 0xcc, 0x1f, 0xf2, 0x6d, 0x87, 0x6b, 0xe2, 0x6e,
+       0xcd, 0x93, 0x43, 0x87, 0xcc, 0x54, 0xda, 0xa5, 0x00, 0x1d, 0x16, 0xc4,
+       0x96, 0xc2, 0xd2, 0x5e, 0xbf, 0xdd, 0xc6, 0x7a, 0xf9, 0x53, 0x5d, 0xda,
+       0x8e, 0x6b, 0x87, 0x6a, 0x3f, 0xd7, 0x7c, 0xfb, 0x81, 0xfd, 0x85, 0xc5,
+       0x1d, 0x0d, 0xcb, 0xf9, 0x9a, 0x67, 0x7f, 0x0b, 0xf0, 0x3d, 0xae, 0xe9,
+       0xc2, 0x96, 0xde, 0x5c, 0xef, 0x73, 0xbe, 0xd6, 0x85, 0x67, 0xc3, 0x72,
+       0xa2, 0xc6, 0xfe, 0x79, 0xd8, 0x58, 0x58, 0x96, 0xef, 0x6a, 0x97, 0x2c,
+       0xda, 0x0b, 0xf3, 0xe2, 0x26, 0x1d, 0x1d, 0xcf, 0x74, 0x80, 0x97, 0x9d,
+       0xf8, 0xb4, 0xc9, 0x78, 0xa5, 0xc5, 0xe5, 0x7a, 0x1d, 0xaf, 0x51, 0xff,
+       0xf8, 0x2e, 0x05, 0x36, 0x40, 0xf9, 0xb2, 0x9d, 0xcf, 0xb1, 0xdd, 0x44,
+       0x7b, 0x63, 0x1b, 0x6d, 0x7b, 0x1b, 0x65, 0xda, 0xcb, 0x35, 0x9a, 0x2b,
+       0xc5, 0xcd, 0x43, 0xfc, 0xae, 0xd1, 0x1e, 0x1a, 0x6d, 0x21, 0x84, 0xfe,
+       0xd0, 0x63, 0x05, 0x73, 0xcd, 0x5e, 0xab, 0x37, 0x0d, 0xe0, 0xda, 0xfe,
+       0x1d, 0xf0, 0xc9, 0xb9, 0x43, 0xa0, 0x4b, 0x97, 0x6c, 0x45, 0xd1, 0x16,
+       0xa3, 0x0d, 0x78, 0x7c, 0x74, 0xc9, 0xe4, 0x7c, 0x7b, 0x47, 0x7a, 0x9e,
+       0xed, 0xc9, 0xa8, 0x01, 0x3e, 0xc7, 0x1d, 0x59, 0x99, 0x72, 0xf4, 0xee,
+       0x10, 0xe8, 0x9a, 0xc0, 0x82, 0x03, 0x1f, 0x3e, 0x8d, 0x2b, 0xb8, 0xdf,
+       0x29, 0xe3, 0x4b, 0xec, 0xcb, 0x39, 0x0a, 0xdb, 0x75, 0x49, 0x80, 0x36,
+       0x7c, 0x6c, 0x0b, 0xf7, 0x5b, 0x31, 0x4f, 0x3b, 0x6c, 0x67, 0x9a, 0xba,
+       0xfb, 0x44, 0xd2, 0xe9, 0x94, 0xec, 0x7a, 0x5f, 0x81, 0xdd, 0xb1, 0x7f,
+       0xef, 0xa6, 0xbe, 0x90, 0xef, 0x12, 0xc6, 0x9c, 0x6f, 0x85, 0x0c, 0xd9,
+       0xae, 0x83, 0xe6, 0x16, 0xd0, 0x00, 0x1f, 0x6c, 0x77, 0x63, 0x3d, 0xb4,
+       0x60, 0xfc, 0x2d, 0xe0, 0xa9, 0x55, 0x26, 0x66, 0x3b, 0xa1, 0x0b, 0x13,
+       0x7d, 0xc3, 0xf2, 0x74, 0xc9, 0x82, 0x0d, 0xb0, 0x3f, 0x74, 0x30, 0x6f,
+       0x45, 0x2b, 0xe2, 0xca, 0x94, 0xd3, 0x02, 0xfb, 0xaa, 0xd7, 0x8f, 0xc0,
+       0x3e, 0xbe, 0xae, 0xfc, 0x45, 0x9f, 0x39, 0xa4, 0x49, 0xbe, 0x25, 0xf1,
+       0x7d, 0xd0, 0x63, 0x3d, 0x2a, 0xc2, 0xeb, 0xbd, 0x1a, 0xd7, 0x2c, 0xe4,
+       0xc8, 0xb9, 0xe1, 0x93, 0x76, 0x42, 0x86, 0xf4, 0x5b, 0x5d, 0xb0, 0xe7,
+       0xa8, 0xf2, 0x27, 0x43, 0x37, 0xf4, 0x27, 0xd6, 0x68, 0x19, 0x73, 0x15,
+       0x96, 0x42, 0xf4, 0x61, 0x83, 0x58, 0xae, 0xb2, 0x15, 0x6b, 0x6f, 0x52,
+       0xd9, 0xc7, 0x4f, 0xc8, 0x6f, 0xfd, 0x53, 0x0e, 0xe9, 0x22, 0xbf, 0x2e,
+       0x9e, 0xa5, 0x0d, 0x5a, 0xc7, 0x5d, 0x35, 0xff, 0x4f, 0xfc, 0xf9, 0x3d,
+       0xda, 0x0b, 0xa5, 0x0e, 0x2d, 0xa5, 0x68, 0x08, 0xc6, 0x11, 0x59, 0x3d,
+       0xd3, 0x6d, 0x3e, 0x08, 0x1b, 0xa6, 0x9f, 0x5a, 0xbd, 0x40, 0x1d, 0x63,
+       0x8c, 0x01, 0xea, 0xd8, 0x54, 0xf4, 0x25, 0xe7, 0xb9, 0xf6, 0xa4, 0xcb,
+       0x10, 0xfa, 0x08, 0xf8, 0x5c, 0xac, 0xc5, 0x49, 0x7f, 0x2d, 0xe6, 0xaa,
+       0xb4, 0xbf, 0xc7, 0xf1, 0xac, 0x2e, 0x43, 0x71, 0xfa, 0x87, 0xa7, 0x25,
+       0x05, 0x1f, 0x09, 0x3d, 0x4a, 0x05, 0xbc, 0x2c, 0x94, 0x1a, 0xfd, 0x16,
+       0x6c, 0xab, 0xff, 0xaf, 0xeb, 0x9e, 0x3f, 0xa4, 0x6f, 0xa0, 0xaf, 0x29,
+       0x98, 0x3a, 0x24, 0x87, 0xc8, 0xe0, 0x42, 0x37, 0x4e, 0xd2, 0xb0, 0x32,
+       0x59, 0xc6, 0x1c, 0xbb, 0x2e, 0xf6, 0x7d, 0x82, 0x48, 0xda, 0xcb, 0xf8,
+       0xb7, 0x2f, 0xf0, 0x4f, 0xab, 0xd5, 0x40, 0x17, 0xd4, 0x2b, 0xf5, 0x10,
+       0xf8, 0x88, 0x90, 0x5c, 0x84, 0xef, 0x9a, 0x2a, 0xb5, 0xcb, 0x0a, 0x68,
+       0xba, 0x54, 0x0d, 0x6c, 0xcd, 0xf0, 0x6d, 0x8d, 0xcf, 0xb4, 0xe3, 0xf9,
+       0x10, 0xfc, 0x9a, 0xe4, 0x8d, 0x04, 0x7e, 0x17, 0x39, 0x26, 0xdb, 0x02,
+       0x3b, 0xe7, 0x9a, 0xb1, 0xdc, 0xb2, 0x34, 0x4b, 0x26, 0x8e, 0xf8, 0x31,
+       0xaf, 0x63, 0xae, 0x2e, 0xf8, 0xf2, 0x90, 0x1c, 0x2d, 0x45, 0xe4, 0xf3,
+       0x25, 0xf2, 0x95, 0xd6, 0x52, 0xd0, 0x5b, 0x72, 0xbe, 0x0e, 0x9d, 0x0f,
+       0xc3, 0xe7, 0x65, 0xb4, 0x21, 0xf8, 0x9f, 0x03, 0x95, 0xcf, 0x69, 0xe9,
+       0xa5, 0xac, 0x36, 0x5c, 0x3b, 0xa4, 0x65, 0x96, 0xc6, 0xb4, 0xfd, 0x0d,
+       0xbe, 0x48, 0xb4, 0xf7, 0xf7, 0x45, 0x4f, 0xcd, 0x72, 0xce, 0x6e, 0xe7,
+       0xc6, 0xbe, 0xe8, 0xd7, 0xf5, 0x46, 0x5f, 0xd4, 0x0d, 0x5f, 0x94, 0x81,
+       0x2f, 0x1a, 0xbe, 0x65, 0x5f, 0x34, 0xa2, 0xdf, 0xd8, 0x17, 0x1d, 0xd4,
+       0xaf, 0xfb, 0x22, 0xc6, 0x9e, 0x15, 0x5c, 0x9b, 0xb2, 0x67, 0x5f, 0x20,
+       0xe7, 0x28, 0xfc, 0xf0, 0x16, 0xc8, 0xba, 0x8d, 0x6b, 0x27, 0x56, 0x80,
+       0xdd, 0x4f, 0x60, 0xae, 0xdf, 0x86, 0xbd, 0xef, 0x89, 0xdb, 0xe6, 0x43,
+       0x6a, 0xde, 0xf7, 0xea, 0x7c, 0x68, 0x5d, 0xe7, 0xa4, 0xf1, 0x97, 0xea,
+       0xdc, 0xf5, 0x74, 0x4e, 0x5d, 0xb7, 0xca, 0x11, 0x35, 0x6f, 0x5d, 0x42,
+       0xf7, 0x09, 0xbc, 0x8a, 0x3c, 0x60, 0x24, 0x2c, 0x8c, 0xa7, 0x63, 0x7e,
+       0xea, 0x2b, 0x0e, 0x1a, 0x04, 0xfa, 0x6d, 0x57, 0xbe, 0x68, 0x3f, 0xf4,
+       0xbe, 0x5a, 0xbd, 0x35, 0x5d, 0x65, 0x1a, 0x74, 0xf5, 0xe0, 0x06, 0x5d,
+       0xb5, 0x48, 0x7f, 0x3c, 0xd0, 0xd1, 0x36, 0x49, 0xc6, 0xa9, 0xb3, 0x5b,
+       0xd1, 0xd5, 0xb9, 0xbf, 0x25, 0x5d, 0x7d, 0xf7, 0x26, 0xba, 0xfa, 0xde,
+       0x26, 0x5d, 0xd9, 0xe6, 0x33, 0x1a, 0xc7, 0x66, 0xfc, 0xa0, 0x3f, 0xaa,
+       0xdf, 0x39, 0xce, 0xfc, 0xa1, 0xc6, 0x35, 0x1d, 0xe4, 0x1d, 0x5c, 0xcf,
+       0x2f, 0xd7, 0x0d, 0xdb, 0x86, 0xec, 0xb8, 0xa6, 0x29, 0x37, 0xcb, 0xfc,
+       0x14, 0xe9, 0x47, 0xec, 0x18, 0x47, 0xac, 0xf1, 0x68, 0x68, 0x96, 0xf2,
+       0x76, 0xaf, 0xff, 0x78, 0xa9, 0xfe, 0x73, 0x3d, 0xf1, 0x0b, 0xe4, 0x95,
+       0xb6, 0x1f, 0x07, 0xc2, 0xf2, 0x85, 0x8a, 0x95, 0x75, 0xb5, 0x76, 0xc9,
+       0xef, 0x40, 0xec, 0x29, 0xd1, 0x7f, 0xed, 0xbc, 0x49, 0x8c, 0xee, 0xf2,
+       0x63, 0xf4, 0x9f, 0x81, 0x56, 0xe6, 0x57, 0xff, 0xe6, 0xdd, 0x95, 0x08,
+       0xbf, 0xe3, 0xe6, 0x41, 0xf9, 0x2c, 0x79, 0x44, 0xbc, 0x67, 0xdc, 0xb7,
+       0x99, 0xf3, 0xe4, 0x43, 0x89, 0x36, 0xc9, 0x6f, 0xe7, 0x7a, 0xa4, 0x9f,
+       0xa3, 0xef, 0x6a, 0xf6, 0xe9, 0x0e, 0x72, 0x24, 0xfe, 0xb5, 0x18, 0x60,
+       0x19, 0x7d, 0x90, 0x0f, 0x95, 0xc8, 0xc7, 0xbb, 0xbe, 0x3d, 0x31, 0x57,
+       0x90, 0x26, 0xcf, 0x37, 0x8c, 0x20, 0x17, 0xa0, 0x1d, 0x04, 0x3a, 0xa7,
+       0xbe, 0x99, 0x23, 0x48, 0x4c, 0xb7, 0x99, 0x23, 0x88, 0x69, 0x24, 0x0e,
+       0x6a, 0x2e, 0x74, 0xef, 0x42, 0xf7, 0x2e, 0x74, 0xef, 0x42, 0xf7, 0xc9,
+       0xda, 0x71, 0xdc, 0x53, 0x79, 0x08, 0x68, 0xf1, 0xc6, 0x4f, 0x7b, 0xe3,
+       0x83, 0xce, 0x9d, 0x92, 0x53, 0x3a, 0x21, 0xbf, 0xc8, 0x35, 0x94, 0xbf,
+       0x1e, 0xd6, 0x3c, 0x7f, 0xcd, 0xf1, 0x32, 0x78, 0xfe, 0x7e, 0xe4, 0x73,
+       0xae, 0xae, 0xdb, 0xd7, 0x65, 0x32, 0xd5, 0x20, 0x93, 0xc9, 0x2a, 0x65,
+       0xc4, 0xfe, 0xf4, 0xb9, 0x13, 0xfa, 0xc2, 0xba, 0x5c, 0x46, 0x40, 0x43,
+       0x0b, 0x79, 0xf7, 0xf9, 0xe0, 0xf8, 0x9d, 0xfe, 0xf8, 0xbf, 0x81, 0x31,
+       0xe9, 0x5f, 0x6f, 0x34, 0x2f, 0xe7, 0x64, 0xce, 0xf8, 0x7e, 0xfc, 0x20,
+       0x67, 0xc6, 0x1a, 0x78, 0x69, 0x3d, 0x9f, 0x8e, 0x21, 0x9f, 0x7e, 0x07,
+       0xb9, 0x74, 0xbd, 0xce, 0x38, 0x55, 0x40, 0x9e, 0x9b, 0x76, 0xb8, 0xae,
+       0x6f, 0x65, 0xdd, 0x6e, 0x58, 0xb3, 0x66, 0xd2, 0xe0, 0xb8, 0x61, 0xf1,
+       0xc6, 0xe4, 0xfd, 0x16, 0xe4, 0x82, 0xef, 0xe0, 0x37, 0x7d, 0x72, 0x90,
+       0xe7, 0xb1, 0x0f, 0x9f, 0x7f, 0x15, 0x73, 0xf7, 0x03, 0xcf, 0xf4, 0xca,
+       0x77, 0x6a, 0xb6, 0x7c, 0x1b, 0x98, 0xe6, 0x5b, 0xc8, 0x2d, 0xbe, 0x59,
+       0x0b, 0x72, 0xfb, 0xbd, 0x30, 0x75, 0xe6, 0xf7, 0x12, 0xde, 0x69, 0x13,
+       0x57, 0xe5, 0xf7, 0x7f, 0xda, 0x96, 0xad, 0x11, 0xfc, 0xfe, 0x95, 0x84,
+       0x6c, 0xeb, 0xc4, 0xf7, 0xf6, 0x04, 0x4c, 0x27, 0xc1, 0xd8, 0xa8, 0x35,
+       0xc4, 0x46, 0xd1, 0xd2, 0xe0, 0x71, 0x0a, 0xe3, 0xa5, 0xc1, 0xf7, 0x67,
+       0x6a, 0x61, 0x2d, 0x35, 0xbb, 0x1b, 0x98, 0x24, 0xc8, 0x71, 0x91, 0x47,
+       0x99, 0xab, 0xdb, 0x43, 0xf2, 0x36, 0x78, 0x4a, 0x82, 0x76, 0x17, 0x39,
+       0xc0, 0x3f, 0xc5, 0x5c, 0xd6, 0x4f, 0x3f, 0x2d, 0xff, 0xda, 0xcf, 0xc3,
+       0x9b, 0x64, 0x4e, 0xf1, 0xc8, 0x76, 0xc9, 0xfc, 0xcb, 0x9e, 0xeb, 0xed,
+       0xcf, 0xae, 0xb7, 0xc7, 0x32, 0xbf, 0xb1, 0xde, 0x7e, 0x35, 0xe4, 0xe1,
+       0x95, 0x41, 0x6d, 0xb4, 0xf6, 0x2f, 0x8c, 0x00, 0xeb, 0x14, 0x66, 0x7b,
+       0x31, 0xd7, 0x36, 0x99, 0xb4, 0xdf, 0x06, 0xf6, 0xb2, 0x63, 0x39, 0xac,
+       0xaf, 0xa7, 0x36, 0xf9, 0xfa, 0x36, 0xf8, 0x8f, 0xd3, 0xb3, 0xd6, 0x20,
+       0xfd, 0x47, 0x1c, 0x6b, 0x29, 0xf9, 0x1e, 0xff, 0xf1, 0x6d, 0xa3, 0xd1,
+       0x7f, 0x18, 0xf0, 0x1f, 0xfb, 0xdf, 0xc7, 0x7f, 0x3c, 0xf5, 0x1e, 0xff,
+       0xa1, 0xc1, 0x2e, 0xe8, 0x3f, 0x7e, 0x68, 0x04, 0xfe, 0xa3, 0xb0, 0xc1,
+       0x7f, 0x04, 0xfa, 0xb0, 0x55, 0xee, 0xe8, 0xfd, 0x26, 0xfe, 0x6c, 0xf3,
+       0x31, 0xa7, 0x84, 0x43, 0x09, 0x37, 0x33, 0x65, 0xef, 0x92, 0x26, 0xac,
+       0xd1, 0x97, 0x6b, 0x03, 0xf0, 0x25, 0xbf, 0x0f, 0x9c, 0x66, 0x39, 0x4c,
+       0x44, 0x9a, 0x12, 0xd4, 0xcd, 0x48, 0x2c, 0x69, 0xbf, 0x90, 0x59, 0xa8,
+       0xbe, 0x90, 0x39, 0xa7, 0x74, 0x35, 0x61, 0x79, 0x18, 0xf8, 0x09, 0x0b,
+       0x18, 0x18, 0xcf, 0x87, 0x80, 0x21, 0xd8, 0xde, 0x6e, 0x26, 0x91, 0xa3,
+       0x54, 0xaa, 0x2b, 0x99, 0x02, 0x3e, 0x53, 0xaa, 0xef, 0x58, 0x8c, 0x7d,
+       0x5b, 0x12, 0xe5, 0xd8, 0x9f, 0xe2, 0xbb, 0x39, 0x31, 0x67, 0x5d, 0xb6,
+       0x39, 0xee, 0x6b, 0xb1, 0x73, 0x6a, 0x8c, 0x90, 0x14, 0xd4, 0xb3, 0x5f,
+       0xb5, 0xf8, 0xec, 0x29, 0xf8, 0xf8, 0x93, 0x55, 0x53, 0x4e, 0x54, 0xd7,
+       0x32, 0x39, 0x7c, 0x88, 0x6d, 0x5e, 0x2e, 0xf1, 0xfe, 0xb7, 0x70, 0x3f,
+       0x24, 0xcc, 0x3d, 0x3e, 0x8f, 0x3e, 0x47, 0xd1, 0xe7, 0x48, 0x35, 0xc0,
+       0x8d, 0xbc, 0xef, 0x66, 0x52, 0xb8, 0x7f, 0xa4, 0xe8, 0x66, 0xd2, 0x45,
+       0xe6, 0x39, 0x7d, 0xd1, 0x13, 0x90, 0x67, 0x16, 0xb1, 0xdd, 0x15, 0xab,
+       0x37, 0x2f, 0x8f, 0xb5, 0x0e, 0x23, 0xaf, 0x3e, 0x8f, 0x98, 0xe3, 0x8e,
+       0x59, 0x4e, 0x19, 0xcc, 0x4d, 0x95, 0xee, 0x90, 0xc2, 0x0c, 0x62, 0x8c,
+       0x73, 0x0f, 0x73, 0xed, 0x8c, 0x1e, 0x77, 0xe0, 0x13, 0x06, 0x80, 0x27,
+       0xbb, 0x81, 0x85, 0xef, 0x92, 0x15, 0xd3, 0x8a, 0x0e, 0x03, 0x03, 0xa7,
+       0x42, 0xe8, 0xd3, 0x7b, 0x9b, 0x64, 0xa3, 0x94, 0xf5, 0x0e, 0xf8, 0x07,
+       0x4d, 0x5a, 0xec, 0x46, 0x5f, 0xf5, 0x17, 0x10, 0x2f, 0x92, 0xdf, 0x36,
+       0xb6, 0xb7, 0xfa, 0x3a, 0xd9, 0x22, 0xab, 0xef, 0xe9, 0xf7, 0x37, 0x0d,
+       0xfd, 0x1a, 0xdb, 0x35, 0x4d, 0xd0, 0x7f, 0x0d, 0x34, 0x84, 0xe2, 0x90,
+       0x3f, 0x78, 0x68, 0x82, 0x9d, 0x5c, 0x06, 0x3f, 0xf4, 0x9b, 0x85, 0x32,
+       0xe3, 0xa4, 0x21, 0x65, 0x13, 0xf7, 0xaa, 0xf5, 0xfa, 0x82, 0x0d, 0x5a,
+       0x2f, 0x90, 0xde, 0xb0, 0x0c, 0x57, 0x7b, 0xc4, 0x5d, 0xa4, 0x1c, 0x2c,
+       0xac, 0x8e, 0x5d, 0x6d, 0xa9, 0x79, 0xcb, 0xcd, 0x63, 0x44, 0xe3, 0x42,
+       0x57, 0x5b, 0x12, 0x71, 0x51, 0xbf, 0x10, 0x6b, 0x4b, 0xc1, 0x1f, 0x18,
+       0x17, 0x6e, 0x6f, 0x4b, 0xcf, 0x92, 0x2e, 0x03, 0x71, 0xf1, 0x4e, 0xe0,
+       0xc2, 0xba, 0x7c, 0x0d, 0xb9, 0x4f, 0xa1, 0x17, 0x31, 0x03, 0xab, 0x44,
+       0x07, 0xdd, 0x79, 0x53, 0xc2, 0x6d, 0x89, 0x79, 0xd0, 0xd7, 0xdf, 0x9a,
+       0x9c, 0xdd, 0x82, 0x3e, 0x06, 0xda, 0x7b, 0x88, 0x21, 0x1b, 0xda, 0xed,
+       0x36, 0xf8, 0x5f, 0xf8, 0x3a, 0x09, 0x27, 0x07, 0xda, 0x31, 0xfe, 0xd9,
+       0x10, 0x73, 0x87, 0x70, 0x7c, 0xbd, 0xfd, 0xcb, 0x5e, 0x7b, 0x2f, 0x68,
+       0xe1, 0x73, 0xcc, 0x21, 0x25, 0x3c, 0x3e, 0x60, 0x82, 0x06, 0xf6, 0x8d,
+       0xa8, 0xbe, 0xe9, 0x79, 0xda, 0x80, 0x9b, 0x59, 0xb0, 0x77, 0x4b, 0x6a,
+       0x6e, 0xa7, 0x0c, 0xcf, 0x75, 0xca, 0xfe, 0x39, 0xe6, 0xbc, 0xc4, 0xc0,
+       0x60, 0x05, 0x39, 0xa9, 0x7e, 0x81, 0xb9, 0x80, 0x15, 0x3d, 0x2a, 0xdd,
+       0xd1, 0xcf, 0x63, 0x1d, 0x8c, 0xdb, 0xf1, 0xd8, 0x24, 0xd6, 0x58, 0x48,
+       0x8d, 0x13, 0x0d, 0xe6, 0xa4, 0x8d, 0x6e, 0x98, 0x37, 0x3d, 0x7f, 0xb3,
+       0x71, 0xb1, 0x70, 0x2e, 0x44, 0x37, 0x8d, 0xfb, 0x3f, 0xfd, 0x71, 0x4d,
+       0x8c, 0xdb, 0x85, 0x31, 0xc9, 0xe3, 0xed, 0xad, 0x43, 0xb3, 0xe2, 0xb6,
+       0x80, 0xbe, 0x74, 0x7c, 0x97, 0x4c, 0x62, 0x9c, 0x93, 0x73, 0xf4, 0x85,
+       0xb2, 0x13, 0x9f, 0xfe, 0x26, 0x89, 0xf7, 0x2e, 0x21, 0x2f, 0x1e, 0x52,
+       0x63, 0x78, 0x39, 0xaa, 0x7e, 0x21, 0x01, 0x5c, 0xf3, 0x51, 0xd0, 0xc3,
+       0x98, 0x4c, 0x9e, 0x43, 0xe0, 0x37, 0x81, 0x75, 0x48, 0x3c, 0xce, 0xf5,
+       0x8d, 0xdf, 0x4b, 0xd1, 0xd6, 0xd4, 0x6c, 0x33, 0xd6, 0x9d, 0xec, 0x36,
+       0x54, 0xac, 0xa0, 0x5e, 0xec, 0xd6, 0x64, 0x49, 0xd1, 0xdd, 0x9a, 0x2a,
+       0x51, 0x46, 0x4e, 0x6b, 0xba, 0x44, 0x19, 0x09, 0xe8, 0x71, 0xe0, 0x63,
+       0x43, 0x12, 0xdb, 0x4e, 0x3d, 0x1e, 0x43, 0xbf, 0x95, 0x10, 0xf3, 0xfe,
+       0xa4, 0xcd, 0xdf, 0xc0, 0x2b, 0x17, 0x8e, 0xa3, 0x2f, 0x7f, 0xdf, 0x8b,
+       0x71, 0xbb, 0x7b, 0x0b, 0xd2, 0xdc, 0x7b, 0x04, 0x7e, 0x42, 0x1f, 0x00,
+       0xee, 0x50, 0x76, 0x5e, 0x07, 0x26, 0xdb, 0x0b, 0x7e, 0xb0, 0x36, 0xe2,
+       0xb6, 0x4c, 0xcc, 0x50, 0xae, 0x72, 0x1b, 0x78, 0x00, 0xff, 0x71, 0xf8,
+       0x16, 0xf2, 0xc0, 0xb9, 0x05, 0x76, 0xbf, 0x2c, 0xb9, 0x99, 0xb0, 0xc2,
+       0x3e, 0xae, 0xc9, 0xf9, 0x35, 0x4d, 0x4f, 0xb4, 0x41, 0xc7, 0xe4, 0x6d,
+       0x0a, 0xb4, 0x3d, 0x0e, 0x3f, 0x6c, 0xa9, 0x9c, 0xdb, 0x40, 0xff, 0x42,
+       0x69, 0x50, 0x4f, 0x15, 0x49, 0xbf, 0x6f, 0x7b, 0xda, 0x0a, 0x7c, 0x8a,
+       0xaa, 0x63, 0x21, 0xb7, 0x4b, 0xc0, 0x8f, 0x0c, 0xca, 0xf7, 0xe1, 0x4b,
+       0xbe, 0x5b, 0x73, 0xe0, 0xff, 0xfb, 0xe1, 0xff, 0x7b, 0xe1, 0xff, 0x6d,
+       0xf8, 0xff, 0x18, 0xfc, 0x7f, 0x17, 0xfc, 0x7f, 0x94, 0xbe, 0x5f, 0x4e,
+       0xd6, 0xf2, 0xb0, 0xb1, 0x15, 0xf8, 0x41, 0x33, 0xec, 0xd6, 0x22, 0xe1,
+       0x64, 0x2d, 0x1a, 0x4e, 0xd5, 0x42, 0xe0, 0xe9, 0x30, 0xe7, 0x04, 0x7f,
+       0xf9, 0xd6, 0xa1, 0x52, 0x3f, 0xe2, 0x8a, 0x0b, 0xbf, 0x94, 0x86, 0xdf,
+       0x77, 0x80, 0x7f, 0xf3, 0xb2, 0x3a, 0x13, 0xc3, 0x33, 0x75, 0x49, 0x3b,
+       0x4d, 0x32, 0x69, 0x3a, 0x18, 0x63, 0xbb, 0xb2, 0x53, 0x23, 0xb1, 0xab,
+       0x09, 0x76, 0x2a, 0xb9, 0x22, 0xe3, 0x73, 0x17, 0xc6, 0x6b, 0x45, 0x7c,
+       0xa0, 0x7f, 0xa0, 0x2f, 0x58, 0xc9, 0x3c, 0x6c, 0x73, 0xcd, 0xb5, 0x69,
+       0x49, 0xe0, 0x67, 0x62, 0x13, 0xc4, 0x3a, 0xd8, 0x05, 0xdb, 0xf6, 0xe0,
+       0x39, 0xfe, 0xfe, 0x6f, 0x7e, 0x8d, 0xea, 0xaf, 0x5a, 0x04, 0xc6, 0xfb,
+       0x32, 0x63, 0x8f, 0x8d, 0xf1, 0xaa, 0x8d, 0xeb, 0x75, 0x49, 0x17, 0x3b,
+       0xb8, 0xcf, 0x7a, 0x0d, 0x6b, 0x54, 0xaf, 0x80, 0xde, 0x7a, 0x7d, 0x55,
+       0x61, 0x48, 0xe4, 0x33, 0x87, 0xd6, 0xc0, 0x43, 0xe3, 0x33, 0xdf, 0xc0,
+       0x33, 0xaa, 0x2d, 0x6c, 0x26, 0x1c, 0xe6, 0x50, 0xf0, 0x9b, 0x2f, 0xc0,
+       0x47, 0x1e, 0xcb, 0xe8, 0xcb, 0x57, 0xf1, 0x2c, 0x64, 0x5a, 0x3c, 0x96,
+       0x09, 0xf5, 0xbc, 0x5a, 0x7f, 0x16, 0x39, 0xf1, 0xd0, 0xf2, 0x80, 0xa4,
+       0x96, 0xbb, 0xa3, 0x17, 0xa5, 0xf5, 0x1d, 0x17, 0xb1, 0x74, 0xb2, 0x6a,
+       0x9d, 0x76, 0x85, 0x39, 0xba, 0x29, 0x0b, 0xc0, 0xd5, 0x7b, 0xf6, 0x3d,
+       0x0f, 0xda, 0xad, 0x17, 0x45, 0x8f, 0xe1, 0x37, 0x31, 0x0c, 0x79, 0x5c,
+       0x03, 0x7f, 0x1a, 0xae, 0x5b, 0xd6, 0x6b, 0x57, 0x85, 0x12, 0xf8, 0xac,
+       0x1d, 0xcb, 0x5c, 0x9c, 0x06, 0xae, 0x83, 0x3e, 0x92, 0xd3, 0xc4, 0x9c,
+       0x5b, 0x20, 0x93, 0x21, 0xd8, 0x05, 0xf5, 0x1d, 0xc7, 0xb3, 0x75, 0xf9,
+       0x92, 0x43, 0x1b, 0x78, 0x0e, 0x72, 0xc3, 0x58, 0xa1, 0x80, 0x6e, 0x60,
+       0x80, 0x19, 0xca, 0x6a, 0x17, 0xf2, 0x36, 0x57, 0x06, 0xf6, 0x49, 0x78,
+       0x47, 0x62, 0x73, 0x4e, 0x76, 0x2c, 0xb3, 0x3a, 0x8d, 0xf1, 0x7b, 0x80,
+       0x79, 0x84, 0xb5, 0x19, 0xfa, 0x60, 0x81, 0xed, 0xec, 0x87, 0x7e, 0x98,
+       0x7b, 0x33, 0x47, 0xa3, 0x6f, 0x3a, 0xa8, 0xa5, 0x2a, 0x65, 0x43, 0x3a,
+       0x0e, 0x21, 0xb7, 0x71, 0x64, 0x71, 0x9a, 0x39, 0x1a, 0xf3, 0x99, 0x20,
+       0x7f, 0xd1, 0x90, 0x4b, 0xa0, 0x7d, 0xf9, 0x25, 0xa5, 0x07, 0x03, 0xfa,
+       0xca, 0xed, 0xbb, 0x9f, 0x7c, 0xcd, 0x18, 0x09, 0xf8, 0xbf, 0x01, 0xf2,
+       0xa2, 0x68, 0x40, 0xce, 0xc6, 0x35, 0x17, 0x03, 0x5f, 0xf8, 0x5c, 0xcf,
+       0xdd, 0xd4, 0xdf, 0x64, 0xe9, 0x04, 0xec, 0x58, 0xf2, 0x4d, 0x09, 0xf0,
+       0x36, 0x80, 0xdf, 0x58, 0xf8, 0x27, 0xa1, 0xc3, 0x73, 0x03, 0xac, 0x91,
+       0x3d, 0x07, 0xfc, 0x47, 0xfa, 0xe3, 0xb1, 0x13, 0x6a, 0xdd, 0xe2, 0xba,
+       0xca, 0x3c, 0x62, 0x8b, 0x5c, 0x54, 0x7c, 0xde, 0xc1, 0xfc, 0x14, 0x7a,
+       0xb9, 0x15, 0x3e, 0x87, 0x3f, 0x24, 0x9f, 0xde, 0x3c, 0x8c, 0x5b, 0x49,
+       0x3b, 0x26, 0xa9, 0xe2, 0xcb, 0x75, 0xaf, 0x0e, 0xfb, 0x47, 0xb0, 0x2b,
+       0x5c, 0x57, 0xc3, 0xa0, 0x87, 0x75, 0x99, 0x01, 0xa5, 0x5b, 0xd0, 0x43,
+       0x9b, 0xc9, 0x87, 0x13, 0xdb, 0xe4, 0xfc, 0x4c, 0x87, 0x2c, 0xcc, 0xbc,
+       0x26, 0x95, 0x99, 0x36, 0x59, 0x9a, 0xa9, 0xcb, 0x65, 0x47, 0xf9, 0x25,
+       0xbb, 0x59, 0xad, 0x69, 0xd9, 0xe5, 0x61, 0xf6, 0xf8, 0xe0, 0x15, 0x79,
+       0x5a, 0xce, 0x97, 0x3d, 0x1e, 0x32, 0x0d, 0x3c, 0xbc, 0x0a, 0x1b, 0xeb,
+       0xec, 0x21, 0x0f, 0xb4, 0x07, 0xf2, 0xc3, 0xdc, 0x83, 0x39, 0xe6, 0x41,
+       0xac, 0xa3, 0x11, 0x60, 0xa3, 0x83, 0x5a, 0xd2, 0xe7, 0x21, 0xe5, 0xf1,
+       0x90, 0x7d, 0x2f, 0x0f, 0x2d, 0x92, 0xdd, 0x49, 0x3e, 0xa0, 0x83, 0x69,
+       0xea, 0x25, 0xc0, 0x1b, 0x1e, 0xfd, 0xc9, 0xe5, 0x57, 0xeb, 0xfa, 0x74,
+       0x93, 0xa2, 0xdd, 0x48, 0x0c, 0xc0, 0xae, 0x5e, 0xad, 0xcb, 0x32, 0xd7,
+       0x12, 0x7e, 0x57, 0xff, 0x31, 0xfc, 0x55, 0xa7, 0xca, 0x5b, 0x72, 0x63,
+       0xed, 0xad, 0xc9, 0xf9, 0x41, 0xe8, 0xba, 0x55, 0xad, 0x45, 0xb8, 0x0e,
+       0xe8, 0xf0, 0x0f, 0xd1, 0xff, 0xab, 0x5c, 0x73, 0x4a, 0x3e, 0x69, 0xc8,
+       0xa7, 0x50, 0xbc, 0xbd, 0x19, 0x39, 0x37, 0xe6, 0x71, 0x33, 0xd9, 0x2a,
+       0x9f, 0xe9, 0x82, 0x7f, 0xe3, 0xf7, 0x07, 0xb6, 0x8f, 0x3c, 0xfc, 0x2e,
+       0x6c, 0x00, 0xb9, 0x05, 0xd7, 0xf4, 0xc0, 0x0a, 0xe2, 0x6c, 0xbc, 0x77,
+       0x41, 0xd5, 0xf4, 0x1d, 0x85, 0x9f, 0x26, 0xab, 0x5f, 0xc5, 0xc7, 0x9b,
+       0x6f, 0xa8, 0xc6, 0x39, 0x37, 0xf2, 0x84, 0x9c, 0x06, 0xb9, 0xa4, 0x8d,
+       0x71, 0x39, 0x6f, 0x5e, 0x8c, 0x84, 0x81, 0x79, 0xd9, 0xd6, 0x0e, 0x3f,
+       0x13, 0x83, 0xdf, 0xea, 0x87, 0xff, 0xe7, 0x5a, 0xa6, 0xaf, 0x0f, 0x68,
+       0xef, 0xc7, 0x98, 0xf4, 0xc1, 0xfd, 0xe0, 0x99, 0xb9, 0x34, 0x7d, 0x28,
+       0x62, 0xca, 0x62, 0xb4, 0x2d, 0x39, 0xeb, 0xd5, 0x93, 0xbc, 0xdf, 0xbc,
+       0x2f, 0xe1, 0xdd, 0x09, 0xab, 0x9c, 0x47, 0xfe, 0x97, 0xc2, 0xda, 0x4d,
+       0xda, 0xc8, 0xa7, 0x17, 0xad, 0x17, 0x88, 0xd3, 0x74, 0xca, 0x60, 0x99,
+       0x72, 0x62, 0x6d, 0xc3, 0x94, 0xfc, 0xc2, 0xef, 0x42, 0x1e, 0x61, 0xd9,
+       0x6e, 0x67, 0xe1, 0x53, 0x98, 0xb7, 0xb8, 0xe0, 0x8d, 0xbe, 0xa7, 0x1b,
+       0xb1, 0xcc, 0x80, 0x10, 0x90, 0x57, 0x2d, 0x1b, 0xf2, 0x40, 0xa8, 0x0f,
+       0x79, 0xe0, 0xa7, 0xd0, 0x37, 0x24, 0xf9, 0x65, 0xc6, 0x84, 0x90, 0x4c,
+       0x2d, 0x8b, 0x5c, 0x99, 0xa6, 0x5f, 0x51, 0x7f, 0x90, 0xb9, 0x9b, 0x99,
+       0x20, 0x3e, 0x9b, 0xa1, 0x8f, 0xa1, 0xff, 0xd8, 0x01, 0x5d, 0xc4, 0x9f,
+       0xfb, 0x12, 0xe2, 0xd3, 0x64, 0xb1, 0x1b, 0x7e, 0x53, 0x56, 0x74, 0xc8,
+       0x14, 0x71, 0x8d, 0xf5, 0xaa, 0x1b, 0xd4, 0xaa, 0x82, 0x3a, 0x55, 0x58,
+       0x0a, 0xd3, 0xac, 0x51, 0x85, 0x41, 0x0b, 0x73, 0x57, 0x43, 0xe5, 0x42,
+       0x3b, 0x94, 0x7f, 0xe5, 0x77, 0xa8, 0x61, 0xde, 0xf8, 0xe9, 0x3d, 0x3a,
+       0xfd, 0xd8, 0x6e, 0x71, 0x47, 0x8f, 0xb5, 0xee, 0x2f, 0x01, 0x8b, 0x76,
+       0xd2, 0x3e, 0xa9, 0xff, 0xac, 0x4e, 0x7f, 0x3b, 0x55, 0x1a, 0xc0, 0x78,
+       0xc4, 0x95, 0x21, 0xf4, 0x8b, 0xf8, 0xfd, 0x28, 0xd7, 0x7f, 0x25, 0xe3,
+       0xfb, 0xfe, 0x1a, 0x74, 0x79, 0xfe, 0x8e, 0x75, 0xee, 0xdc, 0x67, 0x74,
+       0xb9, 0xef, 0x63, 0x69, 0x3c, 0xcb, 0x78, 0xf8, 0xb6, 0x8f, 0xe1, 0xd8,
+       0xc6, 0xba, 0x1e, 0x72, 0xf5, 0xf3, 0x26, 0xbe, 0x3b, 0x25, 0x7f, 0x3e,
+       0x0c, 0x39, 0x20, 0x2f, 0x5e, 0xf0, 0xc6, 0x62, 0xee, 0x7b, 0x1a, 0x3a,
+       0xd2, 0xcf, 0x84, 0xa5, 0xe9, 0x4c, 0xa7, 0x84, 0xbe, 0xd2, 0x26, 0xcd,
+       0x5f, 0xe9, 0x11, 0xe3, 0x2b, 0xac, 0x3f, 0x58, 0xb1, 0x93, 0xaa, 0xf6,
+       0x91, 0x96, 0x53, 0x88, 0x61, 0x3a, 0xe2, 0xb1, 0xb2, 0x53, 0x73, 0xa7,
+       0x18, 0x48, 0x5e, 0xf5, 0x67, 0x5c, 0xf9, 0xe2, 0xbe, 0x9f, 0xab, 0xda,
+       0x1b, 0x70, 0xb3, 0xe8, 0xcf, 0x67, 0xc4, 0xad, 0xbd, 0x46, 0x3b, 0xcd,
+       0xbc, 0x7a, 0xd7, 0x1d, 0xd0, 0x39, 0x73, 0xcb, 0x5e, 0x55, 0xc7, 0xfd,
+       0xe2, 0x3e, 0xc6, 0x4c, 0x2f, 0xbf, 0x4c, 0x23, 0xbf, 0x9c, 0x94, 0x6e,
+       0xf8, 0x59, 0xf6, 0xdb, 0x29, 0x3a, 0xe6, 0xca, 0x09, 0xf3, 0xf5, 0x3b,
+       0xc5, 0x3d, 0x8c, 0x75, 0x71, 0x56, 0x66, 0xf4, 0x84, 0xa6, 0xc6, 0x34,
+       0x9e, 0xa1, 0xdf, 0xa2, 0x3f, 0xa3, 0x8d, 0xb3, 0x0e, 0x82, 0xb6, 0xe7,
+       0xe9, 0xb3, 0x3c, 0xdb, 0x1e, 0x6a, 0xf0, 0x7d, 0x53, 0xa5, 0x1a, 0x74,
+       0x88, 0xbc, 0xde, 0x6e, 0x02, 0xff, 0x88, 0xeb, 0x36, 0xaf, 0xc9, 0x3f,
+       0x7c, 0x69, 0x24, 0xa2, 0xae, 0x0b, 0x65, 0x0f, 0xf7, 0x7a, 0xe3, 0x33,
+       0x07, 0x81, 0xaf, 0xa9, 0x91, 0x0e, 0xce, 0xdb, 0x25, 0xc6, 0xd9, 0x88,
+       0x84, 0xce, 0xd2, 0xfe, 0xac, 0x58, 0x1a, 0xf2, 0x9b, 0xb2, 0x89, 0xf5,
+       0x0e, 0xc0, 0x17, 0xec, 0x16, 0xfd, 0x7c, 0x2f, 0xd6, 0x8e, 0x15, 0x2d,
+       0x4b, 0x5c, 0x8c, 0x85, 0xb0, 0xbc, 0x09, 0xdf, 0x41, 0x7b, 0x39, 0x87,
+       0x78, 0x75, 0xa2, 0xd6, 0xfa, 0xce, 0x8a, 0xa2, 0x82, 0x6d, 0x43, 0xc0,
+       0x4b, 0x56, 0xaf, 0xab, 0xb7, 0xcb, 0xeb, 0xd0, 0x77, 0x56, 0xb5, 0xed,
+       0xc6, 0xb8, 0xa0, 0xe1, 0x2c, 0xeb, 0x49, 0x1c, 0xf7, 0x1f, 0x60, 0x4c,
+       0x8e, 0xed, 0x66, 0x56, 0x99, 0x9f, 0x4e, 0xd3, 0x76, 0x3b, 0x61, 0x77,
+       0xb8, 0xae, 0x35, 0x4b, 0x76, 0x2c, 0x26, 0xfa, 0xf4, 0x83, 0xd2, 0xbd,
+       0x4f, 0xf7, 0xf8, 0x51, 0x3c, 0xb2, 0x8d, 0x75, 0xca, 0x16, 0xb5, 0x1e,
+       0xf5, 0x65, 0xd8, 0xcc, 0x41, 0xea, 0x18, 0xf1, 0x1f, 0xf1, 0x8d, 0xfe,
+       0xcc, 0x40, 0x7c, 0x4b, 0xd5, 0x3c, 0xbd, 0x97, 0x0f, 0xee, 0x94, 0x53,
+       0x67, 0x69, 0x4f, 0xb8, 0xb7, 0x6e, 0x53, 0xc1, 0x7e, 0x02, 0xef, 0xd9,
+       0x72, 0xfa, 0x59, 0xe6, 0x1f, 0xcc, 0x3b, 0x98, 0x6b, 0x59, 0xd1, 0xfd,
+       0xe0, 0x47, 0xbf, 0x8f, 0xfe, 0x40, 0x57, 0xb6, 0x9b, 0x83, 0xaf, 0x2e,
+       0xd4, 0xa8, 0xb7, 0x7e, 0xee, 0xb9, 0x98, 0xcc, 0xd9, 0xdc, 0xa8, 0x27,
+       0xef, 0x02, 0xda, 0x26, 0x11, 0x07, 0x52, 0xd5, 0x26, 0x59, 0x1b, 0x73,
+       0xa1, 0xfb, 0x8f, 0x82, 0xae, 0xc3, 0xad, 0xc4, 0xab, 0x6b, 0x63, 0x69,
+       0x5c, 0x1f, 0x56, 0x79, 0x9a, 0x71, 0x9f, 0x8b, 0x31, 0x76, 0x72, 0x1d,
+       0xf9, 0x7a, 0x72, 0xf4, 0xc2, 0xcc, 0x7d, 0xfa, 0x24, 0x7c, 0xf7, 0xb0,
+       0xc3, 0x18, 0xcf, 0xfa, 0x73, 0x0b, 0xe8, 0x68, 0x57, 0xd8, 0x42, 0xb7,
+       0xf7, 0xe9, 0x85, 0x32, 0xfd, 0x7d, 0x3e, 0xda, 0x2c, 0x0e, 0x7d, 0x96,
+       0xbe, 0x60, 0x53, 0x27, 0x9a, 0x5c, 0x54, 0xb5, 0x6a, 0x44, 0xa0, 0x6a,
+       0x0a, 0x73, 0x39, 0x7a, 0xa5, 0xbc, 0x4f, 0xcf, 0xc3, 0x55, 0xaf, 0x45,
+       0x48, 0x77, 0x4c, 0xe5, 0xf2, 0xfb, 0x94, 0xad, 0x15, 0x11, 0x53, 0x60,
+       0x33, 0xce, 0x1d, 0x98, 0x57, 0xb5, 0xc1, 0xa6, 0xa8, 0x7b, 0xea, 0x5d,
+       0xf9, 0x48, 0x5f, 0xf7, 0x37, 0x8a, 0xa1, 0x45, 0xf8, 0x5f, 0x62, 0xe9,
+       0x16, 0xbf, 0x3e, 0xf5, 0xcf, 0xfd, 0x9c, 0xe8, 0x71, 0x61, 0x9e, 0x32,
+       0x55, 0x22, 0x2d, 0x45, 0xf8, 0xc3, 0x1b, 0xd9, 0x12, 0xe5, 0xe8, 0xf9,
+       0x94, 0x63, 0xb0, 0x0b, 0x7d, 0xd9, 0xf4, 0x6d, 0x40, 0xe1, 0x67, 0xdc,
+       0x63, 0x0c, 0xc0, 0x77, 0xad, 0x09, 0xeb, 0x7d, 0x04, 0x32, 0xa2, 0x6e,
+       0xa0, 0xbf, 0x65, 0xee, 0xd5, 0x41, 0x7f, 0xcb, 0x97, 0x7e, 0xe1, 0x76,
+       0xd2, 0xe7, 0x0d, 0xc8, 0x29, 0xf8, 0xd1, 0x93, 0xf3, 0xa4, 0x27, 0xad,
+       0xd6, 0xce, 0x14, 0xe4, 0x7d, 0x42, 0xf9, 0xf8, 0x7e, 0x79, 0x73, 0xf1,
+       0x5b, 0x0a, 0x0b, 0xee, 0xd9, 0xb7, 0x22, 0x13, 0xf0, 0x0f, 0x47, 0xaa,
+       0x90, 0xb7, 0x19, 0xc3, 0xfa, 0xdc, 0xa5, 0xfc, 0xe3, 0x17, 0x3f, 0x78,
+       0xae, 0x12, 0xd2, 0x13, 0x0f, 0x7c, 0xc8, 0x18, 0xbe, 0x55, 0xdc, 0xce,
+       0x0f, 0x3c, 0x8f, 0xa1, 0x27, 0xfe, 0x10, 0x3a, 0xfb, 0x4d, 0xcc, 0x15,
+       0x06, 0x9d, 0x6a, 0x3f, 0xe4, 0x83, 0x3c, 0xa7, 0xeb, 0x89, 0x4f, 0x7e,
+       0x48, 0xfa, 0x4c, 0x59, 0x04, 0x7e, 0xc8, 0xab, 0xb8, 0xca, 0xdc, 0xb1,
+       0xc9, 0xd7, 0xe7, 0x0b, 0xc0, 0xd5, 0xc0, 0xd2, 0xc5, 0xc0, 0x17, 0xb7,
+       0x48, 0xbe, 0x33, 0xc8, 0x47, 0xe1, 0xc3, 0xd7, 0xdb, 0x83, 0x1c, 0x97,
+       0xcf, 0x67, 0x33, 0xc8, 0xa9, 0x61, 0x13, 0xb7, 0x61, 0x8d, 0xb2, 0x4d,
+       0xe5, 0xb0, 0x37, 0xa1, 0xdf, 0xa3, 0x3d, 0x57, 0x6c, 0xcc, 0x2d, 0x0e,
+       0xa8, 0xdc, 0x62, 0x68, 0x43, 0x6e, 0x11, 0xd4, 0xb4, 0x02, 0xba, 0x39,
+       0x2e, 0x70, 0x03, 0xec, 0xe0, 0xbb, 0x18, 0xff, 0x3b, 0xd0, 0xf7, 0xb7,
+       0x4b, 0xc0, 0x0d, 0x25, 0xe0, 0x86, 0x12, 0x70, 0x43, 0x09, 0xb8, 0xa1,
+       0x14, 0xf5, 0xeb, 0x5b, 0x2e, 0x71, 0xff, 0x07, 0xb4, 0xe9, 0xa0, 0xee,
+       0xb1, 0xd9, 0x5e, 0xbd, 0x3a, 0x59, 0xaa, 0x16, 0xe0, 0xe7, 0x30, 0xeb,
+       0x76, 0xc0, 0x71, 0x41, 0x4d, 0xc4, 0x8f, 0x1d, 0x8b, 0xdc, 0x43, 0x41,
+       0xec, 0x58, 0x74, 0xb1, 0x9e, 0xfa, 0xa2, 0x06, 0x70, 0xa3, 0x21, 0x51,
+       0xfc, 0x36, 0xe1, 0x93, 0xb9, 0x67, 0xde, 0x8d, 0x15, 0xd6, 0xac, 0x6a,
+       0x4f, 0x27, 0x54, 0x4d, 0xc2, 0x96, 0xc9, 0x72, 0x90, 0xdb, 0xc5, 0x65,
+       0x68, 0x86, 0x58, 0x54, 0xb6, 0xeb, 0x09, 0xe8, 0xa2, 0x4a, 0xfc, 0xc8,
+       0x3d, 0x27, 0xce, 0x1f, 0xef, 0xad, 0x60, 0xce, 0x82, 0xed, 0xd1, 0x77,
+       0xa2, 0xaa, 0xce, 0x05, 0xf8, 0xcf, 0x05, 0x67, 0x01, 0xe2, 0xb2, 0x7f,
+       0x86, 0x7b, 0xef, 0x31, 0x19, 0x2d, 0x3a, 0xc8, 0x65, 0x55, 0x8e, 0x84,
+       0x78, 0xe0, 0xc9, 0x7d, 0xc8, 0x97, 0x7b, 0x0e, 0xd8, 0x61, 0xdc, 0x0e,
+       0xe4, 0x4e, 0x79, 0x8f, 0x68, 0xc3, 0x90, 0xf5, 0x7e, 0x5f, 0xd6, 0xe9,
+       0x25, 0x31, 0x91, 0xff, 0xc4, 0x8c, 0x7d, 0x63, 0xda, 0x68, 0x4d, 0x61,
+       0x16, 0xfa, 0x23, 0x8c, 0xe5, 0x78, 0x6b, 0x1d, 0xf6, 0x92, 0xab, 0x6e,
+       0xde, 0x8f, 0x6f, 0xc4, 0x2f, 0x9f, 0xd5, 0xc4, 0x0e, 0xe4, 0xd8, 0xd8,
+       0x3e, 0xd1, 0xd0, 0xbe, 0x7e, 0xdf, 0xe7, 0x01, 0xbe, 0x72, 0xbd, 0x3e,
+       0x41, 0xbf, 0x76, 0xbd, 0x1d, 0x78, 0x4f, 0x42, 0xea, 0x3e, 0x7c, 0xfe,
+       0x62, 0x44, 0x52, 0x8b, 0xb6, 0xa4, 0xcb, 0xec, 0xc7, 0x9a, 0x07, 0xfd,
+       0xd7, 0x1f, 0x4b, 0x0a, 0x79, 0x6e, 0x36, 0x62, 0x39, 0xae, 0xfc, 0x47,
+       0x59, 0x9d, 0xcb, 0xc7, 0xb8, 0x77, 0x9d, 0x1f, 0xd5, 0xf0, 0xdc, 0x8f,
+       0x71, 0x4d, 0xda, 0x6d, 0xac, 0x0f, 0xc6, 0xa9, 0xbe, 0xe8, 0x22, 0xee,
+       0x65, 0xc7, 0x58, 0xe7, 0x79, 0x2a, 0x2c, 0x6d, 0x56, 0xac, 0x0c, 0x3b,
+       0xb8, 0x54, 0xe4, 0x7c, 0xc0, 0x52, 0x45, 0xd6, 0x82, 0x82, 0xfb, 0x7f,
+       0x0c, 0xec, 0xa8, 0x13, 0x3b, 0x79, 0x7d, 0x94, 0xbe, 0x5c, 0x33, 0x84,
+       0x35, 0xb0, 0xe2, 0xfb, 0xe7, 0x85, 0xa2, 0x57, 0x7b, 0x39, 0x47, 0x3a,
+       0xaa, 0x7f, 0x53, 0x5f, 0x89, 0x20, 0x67, 0x5a, 0xe7, 0xf1, 0x1c, 0xc7,
+       0x37, 0xe1, 0x9e, 0xe5, 0x64, 0x35, 0x90, 0x05, 0xef, 0xb3, 0x8d, 0xfb,
+       0xf3, 0xf5, 0xfa, 0x39, 0xfb, 0xc3, 0xd6, 0xd9, 0x9e, 0xbb, 0x27, 0x69,
+       0xcb, 0x81, 0x85, 0xaa, 0x1c, 0xf0, 0xea, 0x6c, 0xd1, 0xbd, 0x5e, 0x9d,
+       0x2d, 0xb6, 0x77, 0x63, 0x9d, 0xad, 0x7c, 0x8f, 0x57, 0x67, 0x33, 0x0f,
+       0xc0, 0x07, 0x1f, 0xf0, 0xea, 0x6c, 0xff, 0xf5, 0x1e, 0xaf, 0xce, 0xd6,
+       0x75, 0xaf, 0x57, 0x67, 0xeb, 0xdd, 0xeb, 0xd5, 0xd9, 0x46, 0xef, 0xdd,
+       0x58, 0x67, 0x73, 0xf6, 0x6e, 0xac, 0xb3, 0x39, 0x07, 0x72, 0xf8, 0x5c,
+       0xaf, 0xb3, 0x65, 0xf6, 0xde, 0xbc, 0xce, 0xf6, 0x4a, 0x80, 0xf1, 0xc1,
+       0xcf, 0x00, 0x78, 0x70, 0x80, 0xf1, 0xfb, 0x81, 0xf1, 0x6f, 0x56, 0xe3,
+       0x55, 0xe7, 0x37, 0xc0, 0xa7, 0xe6, 0xc7, 0x8f, 0x0f, 0x83, 0xf5, 0xb7,
+       0xfa, 0xcf, 0xba, 0xc8, 0x8f, 0x63, 0x7e, 0x6e, 0x43, 0xbc, 0xbf, 0xcd,
+       0xcf, 0xf1, 0xba, 0x5a, 0xaf, 0x9f, 0xad, 0x68, 0xfc, 0xbe, 0x0d, 0xa9,
+       0x7a, 0x50, 0x03, 0x20, 0x5f, 0x72, 0xe0, 0x61, 0x25, 0x87, 0x3b, 0xd1,
+       0xdf, 0x3c, 0xf0, 0x25, 0x9b, 0x75, 0x81, 0x27, 0xb1, 0x86, 0xdd, 0xed,
+       0x86, 0xda, 0x67, 0x66, 0x4c, 0x3b, 0x2d, 0x29, 0xf4, 0x4f, 0xa9, 0xfe,
+       0xa3, 0x0d, 0xfd, 0xb3, 0xe8, 0xcf, 0x71, 0xad, 0x7f, 0x8b, 0xcf, 0x73,
+       0xca, 0xbe, 0x6d, 0x0f, 0xf7, 0xa7, 0x4b, 0x01, 0x4e, 0x0b, 0xf9, 0x18,
+       0xdc, 0xcd, 0xb8, 0xd5, 0x7b, 0xf1, 0x8c, 0xf5, 0xa2, 0x2b, 0x57, 0x15,
+       0xde, 0x37, 0x12, 0xd6, 0x8b, 0x59, 0x95, 0xdf, 0xb9, 0x99, 0x5c, 0x75,
+       0x3d, 0x5f, 0x07, 0x0e, 0x63, 0xce, 0x03, 0x7b, 0x5f, 0xee, 0x45, 0xdc,
+       0x6b, 0xcc, 0xc9, 0x99, 0x87, 0xeb, 0x7e, 0x1e, 0x6e, 0xca, 0xfd, 0xfb,
+       0x1a, 0x31, 0xbe, 0x73, 0xe0, 0xef, 0x2b, 0x8c, 0xbf, 0x05, 0xb9, 0x3c,
+       0x31, 0x3c, 0x71, 0x0f, 0x31, 0x07, 0x71, 0x3e, 0xeb, 0x0b, 0xcc, 0x7f,
+       0x18, 0x4b, 0x99, 0x0f, 0x45, 0xf0, 0xe1, 0xb9, 0x97, 0x00, 0xeb, 0x37,
+       0xfb, 0xfe, 0x9f, 0x79, 0x54, 0x80, 0x6d, 0xac, 0x2d, 0x5e, 0x2e, 0xb5,
+       0x45, 0xf3, 0xf2, 0xd5, 0x98, 0xdf, 0x27, 0xb4, 0x8e, 0xa5, 0x43, 0xeb,
+       0x58, 0x7a, 0xc3, 0x5e, 0x89, 0xa8, 0x33, 0x36, 0x6a, 0xcf, 0x85, 0x7b,
+       0x30, 0x6e, 0xe6, 0x52, 0x0f, 0xf1, 0x30, 0xf7, 0x62, 0x80, 0x8d, 0xec,
+       0xc6, 0x58, 0xc5, 0x38, 0x45, 0x3c, 0x15, 0xec, 0xb7, 0x06, 0x7a, 0xa2,
+       0xec, 0xd8, 0xf6, 0x47, 0x1a, 0x72, 0x64, 0xa7, 0xd9, 0xde, 0x0f, 0x5a,
+       0x32, 0xf8, 0x0e, 0x64, 0xfa, 0x80, 0x8a, 0x91, 0x2d, 0xb0, 0xdd, 0x13,
+       0x25, 0x62, 0xde, 0x6d, 0xb2, 0xe8, 0xe3, 0xde, 0xf3, 0x33, 0x1e, 0xe6,
+       0x0d, 0x6d, 0xc4, 0xbc, 0xce, 0xaa, 0x78, 0x34, 0xee, 0xbf, 0x21, 0x8d,
+       0xc4, 0xb7, 0xa4, 0x8f, 0x31, 0x89, 0xfe, 0xd1, 0xcd, 0x5c, 0xee, 0x61,
+       0x3c, 0x62, 0x2c, 0x8a, 0xc9, 0xea, 0x4d, 0xe9, 0x53, 0x6d, 0xc7, 0x5a,
+       0xec, 0x30, 0x3e, 0x13, 0xf0, 0x1f, 0xa3, 0x78, 0x26, 0x23, 0x93, 0xb3,
+       0x5f, 0x00, 0x6f, 0x13, 0x72, 0x69, 0x66, 0x0c, 0xf4, 0x3d, 0x29, 0x53,
+       0x4e, 0x1e, 0x7e, 0x84, 0x7b, 0x21, 0xc4, 0x79, 0xdd, 0xfe, 0xf7, 0x84,
+       0x7e, 0xce, 0xb6, 0x88, 0x33, 0xa5, 0x52, 0xa4, 0x0f, 0xe6, 0xbe, 0x14,
+       0xf7, 0x1f, 0x69, 0x3f, 0xac, 0xc3, 0x20, 0xd7, 0x65, 0xce, 0x3b, 0xcd,
+       0xf9, 0x37, 0xea, 0x64, 0xb5, 0x4a, 0xbc, 0xe6, 0x66, 0x56, 0x96, 0x89,
+       0x37, 0x3f, 0x28, 0xf6, 0xa4, 0x1e, 0x88, 0x3f, 0x6f, 0x05, 0x77, 0x5a,
+       0x33, 0xc0, 0x9c, 0x2f, 0xac, 0xe8, 0x8d, 0xb8, 0xd3, 0xc3, 0x9c, 0xc9,
+       0xe5, 0x2c, 0xc6, 0x74, 0x14, 0xb6, 0x46, 0xde, 0x07, 0xb7, 0xd7, 0x8d,
+       0x67, 0xbb, 0x91, 0xc3, 0x7b, 0x18, 0x33, 0x05, 0x8c, 0xf9, 0x0f, 0x81,
+       0x31, 0x27, 0xe5, 0xad, 0x56, 0x62, 0x4c, 0xd7, 0xc7, 0x98, 0x69, 0xd8,
+       0x73, 0x6e, 0x83, 0x3d, 0x6b, 0xaa, 0x76, 0xc5, 0x7b, 0x39, 0x60, 0xc4,
+       0xd4, 0xb4, 0x75, 0x0b, 0xb8, 0x52, 0x93, 0x88, 0x3a, 0xfb, 0x10, 0x6a,
+       0x18, 0x33, 0xc0, 0x8f, 0x7b, 0x14, 0x2e, 0x3c, 0x50, 0xda, 0x82, 0x1c,
+       0x46, 0xe1, 0x44, 0x7f, 0x4f, 0x2e, 0xb4, 0x69, 0x9f, 0x32, 0xd4, 0xb0,
+       0x4f, 0x79, 0x1d, 0x4f, 0xe2, 0x39, 0xbf, 0x3e, 0xd8, 0x04, 0x5f, 0xf0,
+       0x7f, 0x40, 0x13, 0xd7, 0x17, 0xd7, 0x82, 0xe6, 0xad, 0x97, 0xd1, 0x46,
+       0x5c, 0xf9, 0xbf, 0x36, 0xe1, 0x4a, 0xc4, 0xae, 0xf3, 0x11, 0x49, 0x02,
+       0x53, 0xba, 0xcb, 0x1c, 0x8b, 0x6b, 0xba, 0x5f, 0x9a, 0xc1, 0x5f, 0xcb,
+       0x74, 0x27, 0xb0, 0x54, 0x9b, 0x84, 0x81, 0xa9, 0x9a, 0x14, 0xa6, 0xea,
+       0x21, 0xf6, 0xe9, 0x3d, 0x02, 0x2c, 0xb4, 0xb8, 0x8e, 0xab, 0x2c, 0xe7,
+       0x87, 0xd0, 0xcb, 0xa3, 0xca, 0xf7, 0xa4, 0xe5, 0x29, 0xf8, 0xd2, 0xe6,
+       0x65, 0xe0, 0xc1, 0xf3, 0x1e, 0xde, 0x6a, 0xda, 0x84, 0xb7, 0x8e, 0xde,
+       0x10, 0x6f, 0xa9, 0x9a, 0xff, 0x20, 0x65, 0xf2, 0x7a, 0xd5, 0xab, 0xf9,
+       0x5f, 0xa9, 0x7a, 0x35, 0xff, 0xd7, 0xab, 0x8d, 0x35, 0xff, 0x8f, 0x48,
+       0xc1, 0xb4, 0xdc, 0x35, 0xd9, 0x54, 0xf3, 0x1f, 0x65, 0x0d, 0xfd, 0xf7,
+       0xda, 0xbc, 0xda, 0x7e, 0x9b, 0x5f, 0xf3, 0xb7, 0xa4, 0xb0, 0xa1, 0xdd,
+       0x94, 0xb7, 0xec, 0xa0, 0xe6, 0xff, 0x34, 0xda, 0xda, 0x31, 0xc7, 0xc6,
+       0x7a, 0xff, 0x95, 0x2a, 0xeb, 0xfd, 0x11, 0xf6, 0xf3, 0xeb, 0xfd, 0xec,
+       0x87, 0xdc, 0xbf, 0xca, 0x5a, 0xff, 0x6e, 0xc8, 0x62, 0x27, 0xe4, 0xd0,
+       0x29, 0xcd, 0x67, 0xa3, 0xec, 0xa3, 0x6a, 0xfc, 0x6b, 0xc8, 0x37, 0xae,
+       0x54, 0xbd, 0x5a, 0xfc, 0x11, 0xd8, 0xd5, 0xd1, 0xf5, 0x1a, 0xbf, 0x37,
+       0xc7, 0xd5, 0xea, 0xc6, 0xf1, 0x37, 0x8e, 0xd3, 0xe5, 0x8f, 0x13, 0xc1,
+       0x38, 0xd1, 0x4d, 0xe3, 0x5c, 0xaf, 0xe9, 0x5f, 0xad, 0x7a, 0xf5, 0xfc,
+       0xf4, 0xac, 0xb8, 0xcd, 0xf0, 0xcd, 0x2f, 0xf6, 0xec, 0xf2, 0xc7, 0x58,
+       0xaf, 0xe7, 0xd3, 0x87, 0x00, 0xe7, 0xc7, 0xd5, 0xf9, 0x9e, 0x23, 0xff,
+       0x1f, 0xea, 0xf9, 0xac, 0xe5, 0x7b, 0x7b, 0x32, 0x5c, 0x9f, 0xc0, 0xf3,
+       0xcf, 0x7a, 0x75, 0xfc, 0xa1, 0x52, 0x50, 0x9f, 0x67, 0x5e, 0x19, 0x9c,
+       0xbd, 0xe9, 0x8e, 0x9d, 0x10, 0xda, 0x0a, 0xe9, 0xe3, 0xb8, 0xed, 0x32,
+       0xae, 0xf0, 0x14, 0x6c, 0x2a, 0x7e, 0x73, 0x4c, 0xbd, 0x30, 0x1d, 0x60,
+       0xea, 0x88, 0xc2, 0xd4, 0x0b, 0xcb, 0x01, 0xa6, 0x4e, 0xde, 0x04, 0x53,
+       0xff, 0xf7, 0x36, 0x2f, 0x0e, 0x84, 0x25, 0xaf, 0x30, 0xf5, 0xcd, 0xce,
+       0x2b, 0xf1, 0x5e, 0x1b, 0xf1, 0x82, 0x78, 0x7b, 0xd8, 0x9d, 0x37, 0x59,
+       0x6b, 0x01, 0xce, 0x66, 0xec, 0xdf, 0x29, 0xa3, 0x67, 0xaf, 0xe3, 0x6c,
+       0x0f, 0x4b, 0x5b, 0xb1, 0x63, 0x2a, 0x26, 0x02, 0xd7, 0xd5, 0x58, 0x2f,
+       0x27, 0x56, 0x66, 0xcc, 0x09, 0x29, 0x3c, 0x97, 0x2b, 0x32, 0x0f, 0x60,
+       0x1b, 0xb1, 0x73, 0x2b, 0x8f, 0xf2, 0xf8, 0x31, 0x29, 0xc0, 0xa6, 0xc1,
+       0xd9, 0x09, 0xee, 0x4b, 0xbc, 0x65, 0x24, 0x6d, 0xb4, 0x57, 0x83, 0x5c,
+       0xc1, 0x51, 0x67, 0x4e, 0x92, 0xc0, 0x3f, 0xe3, 0xeb, 0xd8, 0x93, 0xbe,
+       0xe2, 0x47, 0xbf, 0x70, 0x4d, 0xfa, 0xb5, 0x00, 0x5b, 0x22, 0x27, 0x2a,
+       0x71, 0x6d, 0x07, 0xd8, 0xd2, 0xc3, 0x95, 0xa9, 0xea, 0x0a, 0xf0, 0x75,
+       0x48, 0x86, 0x80, 0xeb, 0x57, 0x1e, 0x66, 0xcd, 0x2a, 0xc0, 0x4e, 0x2e,
+       0xbe, 0x1b, 0x6b, 0x58, 0xbc, 0x6e, 0x56, 0x7b, 0x87, 0x17, 0x7b, 0xc2,
+       0x0d, 0xed, 0xbf, 0x05, 0xff, 0x8d, 0xfc, 0x08, 0x98, 0xc5, 0xc3, 0x4c,
+       0x7b, 0xa1, 0x83, 0x01, 0x85, 0x99, 0xa6, 0xde, 0x83, 0x99, 0x36, 0xc7,
+       0x28, 0xc6, 0xcc, 0xeb, 0x31, 0x2a, 0x5d, 0xa3, 0x3f, 0xbf, 0x1e, 0xa3,
+       0x6e, 0x1e, 0x43, 0xd9, 0x06, 0xee, 0xec, 0x0c, 0x3e, 0x13, 0x52, 0xd8,
+       0x14, 0xa3, 0xa6, 0x3e, 0x44, 0x8c, 0x1a, 0x56, 0x31, 0xca, 0xa3, 0xfb,
+       0xfb, 0x90, 0xcd, 0x77, 0x21, 0xd3, 0xef, 0x00, 0x8b, 0x7d, 0x1b, 0x7c,
+       0x7d, 0x0b, 0x38, 0xe9, 0x9b, 0xa5, 0xcd, 0x67, 0x0e, 0x06, 0x85, 0xf9,
+       0xa1, 0x87, 0xa5, 0xbc, 0x1a, 0xc0, 0x11, 0xac, 0xae, 0xc5, 0xa2, 0x9b,
+       0x19, 0x2f, 0xf6, 0x99, 0x13, 0xde, 0xde, 0x6b, 0x2c, 0x2b, 0x8f, 0xb5,
+       0xa6, 0xe6, 0x19, 0x33, 0xd4, 0x75, 0x94, 0xf5, 0x4e, 0x62, 0x87, 0x8a,
+       0xca, 0x33, 0x7b, 0xa4, 0xbc, 0xe8, 0xe1, 0xb0, 0xa9, 0x79, 0x6f, 0x8c,
+       0x71, 0x1f, 0x87, 0xe5, 0x7c, 0x1c, 0x96, 0x5d, 0x5c, 0x8d, 0x85, 0xd0,
+       0x7f, 0xca, 0xd9, 0x88, 0xbd, 0x8e, 0xf8, 0xd8, 0x6b, 0xe2, 0x43, 0x61,
+       0x2f, 0x6f, 0xae, 0x1c, 0x9e, 0x19, 0x9e, 0x89, 0xc9, 0x7e, 0xc8, 0x79,
+       0xa8, 0x48, 0x7d, 0xf1, 0x9c, 0xd2, 0x2f, 0xd3, 0x19, 0xf5, 0xe5, 0xe9,
+       0x2a, 0x14, 0x3f, 0xa8, 0x0d, 0x43, 0x57, 0x43, 0xbf, 0x54, 0x57, 0x62,
+       0xbe, 0x39, 0x10, 0xc6, 0xe7, 0x6f, 0x4b, 0x57, 0xe4, 0x83, 0xfa, 0xda,
+       0x8c, 0xc5, 0x6e, 0x05, 0x93, 0x6d, 0xc4, 0x63, 0xae, 0xc2, 0x63, 0xcd,
+       0x7e, 0x9f, 0xfc, 0x81, 0x61, 0xe8, 0xf2, 0x3f, 0xa0, 0xcf, 0x8f, 0xed,
+       0x76, 0xf9, 0x11, 0xfc, 0xf7, 0xbf, 0x87, 0x4e, 0xfe, 0x1d, 0x72, 0x85,
+       0x57, 0xec, 0x2e, 0xf9, 0x21, 0xda, 0xae, 0xe3, 0x1c, 0xf6, 0x9f, 0x72,
+       0x92, 0xf6, 0x28, 0xf0, 0xc9, 0xa8, 0x8f, 0x4f, 0xde, 0x7a, 0x20, 0x69,
+       0x8f, 0xb1, 0xce, 0x0e, 0x39, 0xff, 0x34, 0x39, 0xae, 0xb0, 0x49, 0x80,
+       0x49, 0x1e, 0x4f, 0x73, 0xfe, 0xc9, 0x6a, 0x16, 0xd8, 0x27, 0xeb, 0x63,
+       0x9f, 0x9f, 0xa6, 0x3d, 0xec, 0x33, 0xf5, 0xf7, 0xa8, 0x7f, 0x0f, 0xf7,
+       0x1c, 0x76, 0x93, 0x98, 0x07, 0xb8, 0x07, 0xd7, 0x87, 0x25, 0x5f, 0x1b,
+       0x51, 0x9f, 0x13, 0x25, 0xd7, 0x6a, 0x82, 0x9c, 0x58, 0xab, 0x3d, 0xc3,
+       0x55, 0x59, 0xb5, 0xcc, 0x22, 0xbe, 0xb3, 0x55, 0x2b, 0xfa, 0x7b, 0xfe,
+       0xf5, 0xd3, 0xfe, 0xf5, 0x53, 0xfe, 0xf5, 0x69, 0xc4, 0xe1, 0x53, 0x2a,
+       0x96, 0xb2, 0x9d, 0x6d, 0x50, 0x72, 0x15, 0x63, 0x01, 0x7b, 0x9c, 0xeb,
+       0xff, 0xf3, 0x7a, 0x59, 0xe9, 0x98, 0xe3, 0x8f, 0xe2, 0x73, 0x1a, 0x9f,
+       0x09, 0x7c, 0x0e, 0xe1, 0x93, 0xc7, 0x67, 0x5d, 0xa6, 0x5a, 0xaa, 0x34,
+       0x06, 0x1b, 0xe9, 0x95, 0x54, 0xed, 0x39, 0xe8, 0xf1, 0x49, 0xe8, 0xf6,
+       0xb8, 0x14, 0x2a, 0x7f, 0x22, 0x93, 0x33, 0x9a, 0xb4, 0xd9, 0xd0, 0x69,
+       0x05, 0xb6, 0x3c, 0xe3, 0xed, 0x41, 0xb6, 0x26, 0x46, 0xd0, 0xb7, 0x2e,
+       0x8f, 0x3a, 0x4f, 0x8a, 0x7e, 0xdf, 0x14, 0xfa, 0x89, 0x5e, 0xe8, 0xbf,
+       0x5b, 0xed, 0xbf, 0x55, 0x1c, 0x4f, 0xc6, 0xfb, 0x6d, 0xd7, 0x82, 0xce,
+       0x7b, 0x4f, 0x61, 0xec, 0xa4, 0x3a, 0x7f, 0x99, 0x91, 0x93, 0xb3, 0xab,
+       0xdb, 0x3d, 0xdf, 0x6a, 0x99, 0x57, 0xa9, 0x77, 0xf0, 0xe1, 0xc2, 0x17,
+       0x66, 0x60, 0xef, 0x47, 0xab, 0x21, 0x6d, 0x08, 0xf1, 0x66, 0xa8, 0x7a,
+       0x55, 0xc5, 0x9b, 0x54, 0xd5, 0xcd, 0xc4, 0xcf, 0x44, 0x70, 0xcd, 0x73,
+       0x31, 0x88, 0x8b, 0xea, 0xfc, 0xde, 0x2a, 0xf0, 0x8d, 0xa6, 0xea, 0x86,
+       0x93, 0xeb, 0xfb, 0x4a, 0xea, 0x7c, 0x71, 0x26, 0x1e, 0xd7, 0x25, 0x37,
+       0x40, 0x9c, 0x3b, 0xa2, 0x62, 0x13, 0xd6, 0xea, 0xed, 0xcc, 0x15, 0x5f,
+       0xe7, 0xbb, 0x00, 0xf6, 0x27, 0xd0, 0xaf, 0x0b, 0xfe, 0x18, 0xf7, 0x6a,
+       0xb4, 0x4f, 0xf2, 0xca, 0x67, 0x26, 0xa4, 0x52, 0x1e, 0x04, 0xbf, 0x7e,
+       0x8e, 0xa4, 0x72, 0x89, 0x18, 0xec, 0x31, 0xd8, 0xc3, 0xf2, 0xea, 0x2a,
+       0x95, 0x6a, 0x80, 0x29, 0xda, 0xd1, 0x87, 0x79, 0x05, 0x64, 0xe4, 0xed,
+       0xbf, 0xa9, 0xbd, 0xb7, 0x42, 0x75, 0x10, 0x72, 0x4a, 0xa2, 0x9d, 0xb5,
+       0x6d, 0xfc, 0x2e, 0xeb, 0xaa, 0x26, 0xb0, 0x66, 0x1c, 0x91, 0xc5, 0x72,
+       0x1d, 0xf4, 0x22, 0xe6, 0x6e, 0x3f, 0x22, 0x0b, 0xe5, 0x09, 0x79, 0xa1,
+       0xfc, 0xcd, 0x76, 0x60, 0x2a, 0xc8, 0x94, 0xf4, 0xb7, 0xcb, 0xf5, 0x33,
+       0x9e, 0x41, 0x3b, 0xe4, 0x39, 0x9b, 0x8f, 0x7a, 0x79, 0x6e, 0x5e, 0xd5,
+       0x68, 0xbc, 0x6f, 0x57, 0x1f, 0xb7, 0xad, 0xe8, 0x24, 0x7a, 0x1e, 0x9d,
+       0x53, 0xb6, 0x39, 0x3c, 0x65, 0xef, 0x95, 0xcb, 0xce, 0x36, 0x59, 0x75,
+       0x54, 0x5e, 0x4c, 0xfc, 0x80, 0xb5, 0x6e, 0x99, 0x2b, 0xf2, 0xa0, 0x9c,
+       0xc4, 0xba, 0xbd, 0xec, 0x3c, 0x06, 0x3b, 0x7d, 0x02, 0xb6, 0xc0, 0x1a,
+       0xc0, 0x31, 0xe6, 0x5a, 0xb2, 0xa2, 0x6a, 0x68, 0xf5, 0xfa, 0xb0, 0x3a,
+       0x27, 0xdc, 0x2c, 0xab, 0x0a, 0x8b, 0x79, 0xb5, 0xf6, 0xd5, 0x31, 0x6f,
+       0x8d, 0x18, 0xca, 0xee, 0xbf, 0x01, 0x7a, 0x8a, 0xb0, 0xdd, 0x26, 0xd5,
+       0xc7, 0x48, 0xb4, 0xf8, 0x7d, 0x14, 0x06, 0x6d, 0xe8, 0x63, 0x27, 0x92,
+       0xf6, 0x6b, 0xfb, 0x92, 0xf6, 0xc4, 0x81, 0x5c, 0xd5, 0xf3, 0x99, 0xae,
+       0xb6, 0xb6, 0x5e, 0xff, 0xc9, 0x60, 0x5d, 0xbd, 0xbc, 0x8e, 0xa1, 0x61,
+       0xa4, 0xcf, 0x5f, 0x82, 0x7e, 0x43, 0xd2, 0x7c, 0xa6, 0xfe, 0x89, 0x71,
+       0xa7, 0x2f, 0x76, 0x54, 0x78, 0x32, 0x8b, 0x79, 0xb5, 0xe5, 0x64, 0xe5,
+       0x12, 0xe2, 0xe4, 0x35, 0x62, 0x87, 0xde, 0x8b, 0x72, 0xed, 0x13, 0x49,
+       0x67, 0x50, 0x5b, 0x18, 0x43, 0xd6, 0xf2, 0xfc, 0x18, 0xe3, 0xec, 0x31,
+       0x11, 0xe0, 0xcb, 0x33, 0x03, 0x92, 0x2e, 0xaa, 0x77, 0x21, 0x78, 0x96,
+       0x53, 0x9b, 0x80, 0xfc, 0xf0, 0xfc, 0x28, 0x03, 0xa3, 0x6e, 0x77, 0xc7,
+       0xd2, 0xf2, 0x18, 0x6b, 0x63, 0x92, 0x9b, 0x93, 0x3d, 0x49, 0xf8, 0x55,
+       0x77, 0xb4, 0x59, 0x26, 0x16, 0xdd, 0x4c, 0xf7, 0xf4, 0x13, 0x18, 0x63,
+       0x1c, 0x63, 0x8d, 0x20, 0x37, 0xc9, 0x22, 0x56, 0x53, 0xbe, 0xf4, 0xdd,
+       0x8f, 0x43, 0x46, 0x1f, 0xe1, 0x59, 0xd7, 0xc1, 0xac, 0x58, 0xa3, 0x79,
+       0x35, 0xee, 0xbb, 0x5a, 0xae, 0xff, 0x57, 0x10, 0xeb, 0x42, 0xb2, 0x3f,
+       0x2e, 0xfa, 0x48, 0x3c, 0xf4, 0x8b, 0x71, 0x9b, 0x6d, 0x61, 0xb6, 0xe9,
+       0x68, 0x0b, 0xfd, 0x66, 0x3c, 0xac, 0x27, 0xe3, 0xd6, 0x20, 0xcf, 0xe0,
+       0x1a, 0xf6, 0xb8, 0x18, 0xcf, 0xd7, 0x21, 0x8b, 0x11, 0xe9, 0xb8, 0x60,
+       0x0d, 0xbe, 0x0e, 0x5a, 0x42, 0xca, 0xd7, 0x8f, 0x8b, 0xee, 0xb7, 0xb7,
+       0xaf, 0xb7, 0x87, 0xfc, 0xf6, 0x11, 0x69, 0xbb, 0xd0, 0x67, 0xbe, 0x21,
+       0x47, 0x30, 0xa6, 0x21, 0x57, 0x90, 0xeb, 0xd8, 0x3d, 0xe3, 0xb0, 0xc5,
+       0x47, 0x48, 0xcb, 0x21, 0xd6, 0x1b, 0x5d, 0xd8, 0x5f, 0x8b, 0x7d, 0x87,
+       0x7c, 0xde, 0x6c, 0x95, 0x9c, 0xca, 0x75, 0x43, 0xea, 0xbd, 0x85, 0x1c,
+       0xec, 0xfd, 0xae, 0x9e, 0xa1, 0x0e, 0xaf, 0x5e, 0xc0, 0xfd, 0x91, 0x7e,
+       0xb4, 0x5d, 0xab, 0x9f, 0xb7, 0xd9, 0xc6, 0x7b, 0xd7, 0xea, 0x15, 0xbb,
+       0xcf, 0x4c, 0x69, 0x61, 0x7f, 0xff, 0xfc, 0x98, 0xe2, 0x3d, 0x5f, 0xee,
+       0x36, 0x17, 0xe4, 0x2e, 0x2d, 0xb5, 0x03, 0xf1, 0xa2, 0x9a, 0x42, 0xdf,
+       0x6b, 0x3c, 0x83, 0xa1, 0xf6, 0x03, 0x16, 0x24, 0xb8, 0xe6, 0x38, 0x7d,
+       0xe6, 0xb0, 0x7a, 0xb6, 0xcf, 0x3c, 0xa9, 0x35, 0x3e, 0x1b, 0xd5, 0x86,
+       0x37, 0x3c, 0xdb, 0xa6, 0x64, 0x64, 0xd8, 0x5e, 0x9f, 0xc9, 0xf2, 0x88,
+       0x3c, 0x5d, 0x65, 0xbf, 0x6b, 0xf5, 0x94, 0xbd, 0x55, 0x3b, 0xb9, 0x83,
+       0xbe, 0x90, 0x7d, 0xdf, 0xd9, 0x34, 0x0f, 0xaf, 0x6f, 0x36, 0x47, 0x5d,
+       0x36, 0xce, 0xb1, 0x45, 0xf5, 0xb9, 0xac, 0xfa, 0x84, 0x94, 0xac, 0x37,
+       0xce, 0xf3, 0x17, 0xb2, 0x71, 0x9e, 0xb6, 0x75, 0x9e, 0x27, 0x31, 0xe6,
+       0x29, 0xf4, 0x2d, 0x56, 0xbb, 0xa3, 0x15, 0x79, 0xa7, 0x9e, 0xb3, 0xdf,
+       0x92, 0xcb, 0xeb, 0x63, 0xff, 0x25, 0xae, 0x1b, 0x69, 0xfa, 0x4b, 0x9f,
+       0x46, 0xfe, 0x66, 0xdb, 0x3f, 0x53, 0xf2, 0xde, 0x6a, 0x77, 0x1f, 0x5a,
+       0xd0, 0xac, 0xc1, 0x9f, 0x09, 0x75, 0xf5, 0x3b, 0xca, 0xd7, 0xdc, 0x0d,
+       0x3d, 0xed, 0x79, 0x06, 0x6b, 0xb7, 0x3f, 0xa9, 0xfa, 0x5c, 0xb1, 0x47,
+       0x64, 0xcf, 0x99, 0x6e, 0xf3, 0x8a, 0xdc, 0x2f, 0xe9, 0x08, 0xaf, 0x91,
+       0x43, 0xd9, 0x7c, 0xf7, 0xe1, 0x57, 0x99, 0x17, 0x40, 0x97, 0xdd, 0xbd,
+       0x3f, 0x93, 0x27, 0xe4, 0x64, 0x69, 0x0a, 0xbe, 0x67, 0x5c, 0x7a, 0x9f,
+       0xa1, 0xff, 0xc9, 0x9b, 0x5e, 0xad, 0xc6, 0x8b, 0x89, 0x29, 0x3f, 0x26,
+       0x4e, 0x29, 0x3f, 0xf7, 0x8a, 0x7f, 0x8e, 0xa2, 0xbb, 0xf7, 0x3c, 0x9e,
+       0x7d, 0x41, 0xf9, 0x80, 0x6f, 0x48, 0x05, 0x6b, 0x21, 0xf6, 0xfc, 0x36,
+       0xd9, 0xfa, 0x10, 0x6d, 0x12, 0x19, 0xc0, 0xdd, 0x4d, 0xea, 0x5d, 0x0b,
+       0xdd, 0x6e, 0x11, 0xd9, 0x4e, 0xfb, 0x59, 0xd8, 0x2a, 0x6d, 0xe3, 0xde,
+       0x5e, 0xd9, 0x86, 0x6b, 0x6b, 0x74, 0x4d, 0xca, 0x5b, 0x69, 0x87, 0x1f,
+       0xbd, 0xe0, 0x7d, 0xf7, 0x5f, 0x40, 0xba, 0x1c, 0x1f, 0x91, 0x7b, 0x2f,
+       0x78, 0x76, 0x37, 0x39, 0xf3, 0x84, 0x92, 0xef, 0xb8, 0x92, 0x6f, 0x5d,
+       0x8e, 0x38, 0x94, 0x3d, 0x79, 0xe2, 0xb9, 0x4a, 0x4f, 0x26, 0x9f, 0xf4,
+       0xed, 0xa8, 0xfb, 0x19, 0xbe, 0x23, 0x46, 0x19, 0x91, 0xee, 0x74, 0x07,
+       0xf7, 0x6f, 0xf7, 0x5c, 0x20, 0xbf, 0x5d, 0x1b, 0xf8, 0x7d, 0x0a, 0x3e,
+       0xb6, 0xa7, 0xc7, 0xe3, 0xf9, 0x95, 0x99, 0x0f, 0xce, 0xf3, 0xd7, 0xd6,
+       0x79, 0x36, 0xa4, 0xa2, 0xf2, 0xdc, 0xd0, 0x36, 0x69, 0xcb, 0xc9, 0x0a,
+       0xec, 0xe3, 0xcf, 0x84, 0xe7, 0x92, 0x49, 0x8b, 0x37, 0xef, 0x6a, 0x95,
+       0x34, 0x05, 0x3c, 0x90, 0xae, 0xa4, 0xaf, 0x3f, 0xd2, 0xf1, 0xc4, 0x0d,
+       0xef, 0x5d, 0x11, 0x37, 0xd3, 0x8b, 0x36, 0x5d, 0xe9, 0x70, 0xc8, 0x5f,
+       0x6f, 0x23, 0xa2, 0x2b, 0x1d, 0x26, 0xd7, 0x75, 0xf8, 0x3a, 0x74, 0x58,
+       0x91, 0x8f, 0x83, 0x27, 0xac, 0xef, 0x67, 0xfa, 0xcc, 0x23, 0xb2, 0x53,
+       0xe9, 0xdf, 0xee, 0x81, 0x4f, 0xf5, 0x75, 0xd9, 0x7c, 0x0b, 0xba, 0x7c,
+       0x43, 0x94, 0x3e, 0xd5, 0xd9, 0xa3, 0x8a, 0x1a, 0x87, 0xbe, 0x8d, 0xbc,
+       0x35, 0x2b, 0x9f, 0x40, 0x1a, 0xd5, 0x59, 0x82, 0x51, 0x4f, 0xbf, 0x6a,
+       0xcd, 0xfb, 0xfa, 0xcd, 0x8e, 0x52, 0x87, 0xd1, 0x0e, 0x4f, 0x9f, 0x2d,
+       0xaa, 0xcf, 0x74, 0xfc, 0x36, 0xb5, 0xde, 0xed, 0x9e, 0x9d, 0x1d, 0xd4,
+       0xe9, 0xd3, 0x55, 0xef, 0xbb, 0x88, 0x38, 0x37, 0x5d, 0xfd, 0x65, 0x7a,
+       0xf5, 0x74, 0x3a, 0x24, 0xde, 0xba, 0xda, 0xac, 0x4f, 0xfd, 0x42, 0x48,
+       0xd9, 0xf0, 0x10, 0x64, 0x78, 0xba, 0xb4, 0xc3, 0xb7, 0x7b, 0x8f, 0xe7,
+       0x9e, 0x0f, 0xc8, 0xf3, 0x89, 0x62, 0xb7, 0xf9, 0x16, 0xee, 0x0d, 0x83,
+       0xe7, 0x23, 0xd2, 0x24, 0x29, 0x9f, 0xe7, 0xd8, 0x3a, 0xcf, 0x01, 0x8d,
+       0x5e, 0xbf, 0x14, 0xf3, 0xd8, 0x2a, 0xfd, 0xd7, 0xef, 0xaa, 0x77, 0x1a,
+       0xae, 0x16, 0xe9, 0xb7, 0x81, 0x95, 0x22, 0x9d, 0x72, 0x65, 0x31, 0x26,
+       0x57, 0x88, 0x41, 0x06, 0xf0, 0x5d, 0x9d, 0xf2, 0x63, 0x78, 0x58, 0xde,
+       0x28, 0xde, 0x88, 0x8e, 0x7e, 0x79, 0xbd, 0x18, 0xd0, 0x42, 0x2c, 0xcc,
+       0x7c, 0x61, 0x5c, 0xde, 0x9c, 0xe9, 0x96, 0x95, 0x51, 0xc4, 0xfd, 0x1e,
+       0xca, 0xa4, 0xcf, 0x7c, 0x50, 0xbd, 0xeb, 0x72, 0xad, 0x7e, 0xd1, 0xc6,
+       0xf8, 0x73, 0x75, 0x39, 0xca, 0xfd, 0x6f, 0xfe, 0x5e, 0xbc, 0x5d, 0x56,
+       0x98, 0x53, 0xf4, 0x74, 0xca, 0xc2, 0x1c, 0xf2, 0xf9, 0x22, 0xc7, 0xa7,
+       0xdc, 0x46, 0xd4, 0xef, 0x61, 0xcc, 0xf7, 0x49, 0x9e, 0x41, 0x8f, 0x50,
+       0x37, 0xd7, 0xea, 0xab, 0x36, 0xf7, 0x3f, 0xc7, 0x65, 0x11, 0xfa, 0xfb,
+       0x47, 0x71, 0xee, 0xcf, 0xe7, 0xd4, 0xfb, 0x85, 0x0b, 0x8b, 0xa3, 0xc8,
+       0x1d, 0xae, 0xd5, 0xa7, 0xec, 0x29, 0xa5, 0xb7, 0xc5, 0xf2, 0x43, 0x7e,
+       0x3b, 0xaf, 0x79, 0xcf, 0xcd, 0xec, 0xe9, 0x61, 0xbe, 0xfa, 0x10, 0xf2,
+       0x05, 0xe6, 0xaa, 0xa3, 0xc0, 0x6b, 0x94, 0x49, 0x4c, 0x26, 0x8b, 0x1c,
+       0x4b, 0x22, 0x5b, 0x90, 0xdf, 0xe7, 0x64, 0x18, 0xf4, 0xc4, 0x90, 0xdb,
+       0x33, 0x3e, 0xdc, 0x25, 0xab, 0x11, 0x2f, 0x0e, 0xf0, 0xac, 0xd8, 0x2a,
+       0x62, 0xc3, 0xea, 0x7a, 0x6c, 0xd8, 0x89, 0x6b, 0x37, 0xe3, 0xf4, 0xfc,
+       0x67, 0x8c, 0xcf, 0xba, 0x0d, 0x63, 0xc3, 0x20, 0xfa, 0xb3, 0xad, 0x53,
+       0x26, 0xe7, 0x90, 0x44, 0x20, 0x67, 0x59, 0x10, 0x9e, 0x01, 0xc9, 0xca,
+       0xf4, 0x62, 0x77, 0xf4, 0xa2, 0x96, 0x56, 0x67, 0x45, 0xe2, 0x98, 0x73,
+       0xa1, 0xd8, 0x29, 0x8b, 0x73, 0x12, 0x33, 0x12, 0x8f, 0x48, 0x75, 0xd1,
+       0xc3, 0xec, 0x53, 0x1a, 0xda, 0xab, 0xae, 0x2c, 0x6e, 0xec, 0x63, 0x1a,
+       0x89, 0xc3, 0xf2, 0x75, 0xbf, 0x4f, 0x5a, 0xf5, 0x79, 0xb5, 0x83, 0x7b,
+       0x6c, 0x8b, 0xd5, 0x0e, 0xd0, 0x40, 0xda, 0x76, 0x35, 0xce, 0x1b, 0xbb,
+       0x3e, 0x2f, 0xe7, 0x44, 0x36, 0xb3, 0xdd, 0xc5, 0xbc, 0x17, 0xf1, 0xcc,
+       0x23, 0xa0, 0xe3, 0x9a, 0xa1, 0xdb, 0x8f, 0x48, 0x61, 0x71, 0xf3, 0x1c,
+       0x8d, 0x34, 0xf0, 0x19, 0x8e, 0xcf, 0x79, 0x0e, 0x83, 0xbe, 0x6b, 0x9a,
+       0x6e, 0x1f, 0x86, 0x2c, 0xbd, 0x39, 0x8c, 0xb3, 0x96, 0xf9, 0x23, 0xe9,
+       0x11, 0xfd, 0xbc, 0xa6, 0xe4, 0xaf, 0x2f, 0xf4, 0x63, 0x81, 0x64, 0xa4,
+       0x6d, 0x79, 0x4c, 0x8c, 0x65, 0xd6, 0x10, 0x5e, 0x69, 0x4d, 0xab, 0xfd,
+       0xde, 0x2d, 0x58, 0xdf, 0xe2, 0x86, 0x6c, 0xd6, 0x0b, 0x58, 0x0f, 0xfe,
+       0xfa, 0x36, 0xe9, 0x60, 0xbd, 0x80, 0x79, 0xc3, 0x21, 0x7c, 0x33, 0x77,
+       0x78, 0xb9, 0x9e, 0x74, 0x7e, 0xa6, 0xe2, 0x6b, 0x6e, 0x91, 0xf7, 0xad,
+       0x98, 0x08, 0xef, 0xd1, 0x6f, 0x74, 0x4a, 0xd3, 0x57, 0x7a, 0xe1, 0x2b,
+       0x1e, 0x03, 0xf6, 0xc6, 0xb8, 0x67, 0x7a, 0x24, 0xe4, 0x9d, 0xb1, 0x50,
+       0xf5, 0x96, 0x37, 0xe7, 0x2c, 0xff, 0x9d, 0x21, 0xd9, 0x73, 0xd1, 0x61,
+       0x4d, 0xb4, 0x8b, 0x35, 0x1f, 0xf4, 0x13, 0x7d, 0x15, 0xf9, 0xe9, 0x95,
+       0x45, 0x63, 0x1b, 0xcf, 0x7c, 0xbe, 0x5e, 0xc5, 0x35, 0xb1, 0x7f, 0x44,
+       0x61, 0x4c, 0xff, 0x1e, 0x7f, 0x23, 0x5f, 0x7a, 0xcf, 0xf9, 0x77, 0xe6,
+       0x53, 0x63, 0xfe, 0x59, 0x3b, 0x37, 0x73, 0x72, 0x43, 0x4e, 0xd5, 0xab,
+       0xea, 0xbd, 0x2b, 0x55, 0x1b, 0xfe, 0x71, 0x00, 0xf6, 0xc9, 0x35, 0x50,
+       0xd7, 0x1e, 0x02, 0x36, 0x8b, 0x75, 0xaa, 0x9c, 0xe8, 0xf4, 0x43, 0xe2,
+       0xd9, 0x3b, 0xac, 0x4c, 0xf9, 0xb2, 0x95, 0xb2, 0x97, 0x83, 0xac, 0x96,
+       0x33, 0xf2, 0x9f, 0xaa, 0x97, 0x54, 0xad, 0x75, 0x06, 0x79, 0x49, 0x68,
+       0x5a, 0xe5, 0x64, 0x0d, 0xf8, 0x16, 0x7e, 0xef, 0xd9, 0x2f, 0x62, 0x2d,
+       0x5a, 0xea, 0x4c, 0x83, 0x7e, 0xbe, 0x5e, 0x4f, 0xc1, 0x7f, 0xe8, 0xb6,
+       0x6d, 0x16, 0x10, 0x0f, 0x53, 0xea, 0x5c, 0x0c, 0xd7, 0xf1, 0x61, 0xe5,
+       0x9f, 0x65, 0x01, 0xb2, 0x39, 0x1b, 0xc3, 0x38, 0x9a, 0xb2, 0x4f, 0x43,
+       0xe9, 0xe1, 0x21, 0x85, 0x79, 0x8d, 0xf3, 0x70, 0x58, 0xcb, 0x3d, 0x22,
+       0xe7, 0x33, 0x32, 0x85, 0x35, 0x1c, 0x5a, 0xa6, 0x0e, 0x28, 0xdb, 0x31,
+       0x69, 0x82, 0xec, 0x4f, 0x00, 0x7b, 0x18, 0xd3, 0x94, 0x71, 0x14, 0xeb,
+       0xa2, 0x53, 0x42, 0x67, 0x21, 0xe3, 0x69, 0x60, 0x84, 0xb9, 0x66, 0x79,
+       0x69, 0x31, 0x90, 0xe9, 0xcb, 0x3c, 0xef, 0xaf, 0x8f, 0x0f, 0x74, 0x11,
+       0x47, 0x49, 0x65, 0x71, 0x4a, 0xa6, 0x66, 0x99, 0xb3, 0x8f, 0xa9, 0x33,
+       0x06, 0x21, 0x75, 0xc6, 0xc5, 0xcb, 0x99, 0xbd, 0x6f, 0x0f, 0x63, 0x56,
+       0x84, 0x7b, 0x6d, 0x02, 0xdb, 0xe9, 0xc7, 0xbc, 0x37, 0x92, 0xaf, 0x97,
+       0xab, 0x0e, 0x83, 0xde, 0x8b, 0x33, 0x56, 0x26, 0x2f, 0x0e, 0xcf, 0x5b,
+       0x8f, 0xba, 0xe0, 0x7f, 0x15, 0xfe, 0x73, 0xaa, 0x74, 0x2f, 0xf8, 0x2c,
+       0x60, 0x85, 0x65, 0xe4, 0x62, 0x91, 0x39, 0xe3, 0x47, 0xa1, 0x37, 0x5e,
+       0x17, 0x06, 0x0d, 0xf8, 0x81, 0x35, 0xf5, 0x7e, 0xa1, 0xe5, 0xae, 0x20,
+       0x87, 0x8d, 0x69, 0x87, 0xa0, 0xeb, 0xbc, 0xd9, 0xe4, 0xdb, 0x03, 0xdf,
+       0x35, 0x3e, 0x07, 0x3f, 0xba, 0x24, 0x7c, 0xef, 0xe7, 0x9d, 0x3a, 0xf3,
+       0xa5, 0xcb, 0xf0, 0x7b, 0x99, 0x78, 0x06, 0x36, 0x94, 0x8f, 0xb6, 0x80,
+       0xe6, 0xdf, 0xc6, 0xbd, 0x5c, 0x95, 0xf3, 0x58, 0xce, 0x9a, 0x14, 0x62,
+       0x21, 0xe9, 0x8b, 0x5d, 0x92, 0x6d, 0xf0, 0x64, 0x9a, 0xbc, 0x61, 0x5b,
+       0x83, 0xa2, 0xa9, 0xf1, 0x7a, 0x0f, 0xc0, 0x06, 0xaf, 0xc2, 0xdf, 0x35,
+       0xfb, 0xb9, 0x7e, 0xaa, 0x48, 0x0c, 0xf5, 0x84, 0x3a, 0x8b, 0x70, 0xd9,
+       0x66, 0x1d, 0x90, 0xef, 0xfb, 0xfe, 0x95, 0x9a, 0xe3, 0xfa, 0xde, 0x1d,
+       0xeb, 0xd0, 0xa4, 0xcf, 0xe3, 0x71, 0xbf, 0xed, 0xd1, 0xc8, 0x71, 0x9a,
+       0x1a, 0xc6, 0xb9, 0xe8, 0x8f, 0x73, 0xce, 0x1f, 0x67, 0xc1, 0x1f, 0xe7,
+       0xf2, 0xfa, 0x38, 0x0f, 0xc2, 0x0e, 0xea, 0xf5, 0xa7, 0x80, 0x37, 0x92,
+       0x4e, 0xbd, 0x9e, 0x46, 0x5e, 0x36, 0xd9, 0x3f, 0xa1, 0xf6, 0x5e, 0xf5,
+       0xc4, 0x8b, 0x43, 0x49, 0xdb, 0x93, 0x3f, 0xac, 0x40, 0x26, 0x60, 0x8f,
+       0x79, 0xf1, 0xb0, 0x3a, 0xf7, 0x03, 0xbd, 0xfd, 0xc2, 0x36, 0xf8, 0x81,
+       0xc7, 0x10, 0x4b, 0x9c, 0xe1, 0x25, 0x5b, 0xf2, 0x7b, 0x7e, 0x4d, 0x87,
+       0xbd, 0x77, 0x20, 0x2e, 0xbd, 0x09, 0xdb, 0x71, 0x86, 0x2b, 0x8b, 0x8f,
+       0xa9, 0x3d, 0xe1, 0xa6, 0xc4, 0xbd, 0xd0, 0x67, 0x79, 0x78, 0x61, 0xb1,
+       0x3c, 0x7c, 0x8e, 0xfb, 0x43, 0xe8, 0xb7, 0xb0, 0xd8, 0x0e, 0xb9, 0xb7,
+       0xab, 0xba, 0xca, 0xa5, 0x62, 0x04, 0x7a, 0x34, 0x61, 0xf3, 0x11, 0xb4,
+       0x45, 0x61, 0x07, 0x5d, 0x68, 0x7f, 0x0d, 0x6b, 0x3b, 0x86, 0xf6, 0xb5,
+       0xd6, 0x61, 0x85, 0x63, 0x6d, 0x39, 0x5f, 0xbd, 0x8a, 0x98, 0xfb, 0x16,
+       0xfc, 0x68, 0x2f, 0xfa, 0xf4, 0xa3, 0xcf, 0x0e, 0x13, 0xf8, 0x2a, 0x53,
+       0xbe, 0x21, 0x4d, 0x2e, 0x68, 0xd2, 0x1b, 0x68, 0x72, 0x41, 0x0f, 0x7c,
+       0xe7, 0x19, 0xd6, 0xa0, 0xfb, 0xe5, 0x64, 0x91, 0x67, 0xaa, 0xf8, 0xee,
+       0xb5, 0x29, 0x21, 0x60, 0xd2, 0xa6, 0x33, 0x56, 0x74, 0x45, 0xd5, 0x7a,
+       0x68, 0x5b, 0x7d, 0x4e, 0x45, 0x54, 0x9c, 0x89, 0x9d, 0x44, 0xfc, 0xba,
+       0x5a, 0x6d, 0x97, 0x37, 0xfc, 0xb9, 0xd6, 0x84, 0xfb, 0x97, 0x1b, 0xe7,
+       0x3a, 0x55, 0x1a, 0x1d, 0xfe, 0x81, 0x6d, 0xf8, 0x7c, 0x75, 0x62, 0xae,
+       0x76, 0xf4, 0x1d, 0x1d, 0xbe, 0xb8, 0x78, 0xa3, 0xbe, 0x13, 0xe8, 0xdb,
+       0xd4, 0xd0, 0x77, 0x02, 0xfd, 0xda, 0x11, 0x07, 0xdb, 0x15, 0x4f, 0x93,
+       0xa0, 0xeb, 0x4a, 0x51, 0xbd, 0x0b, 0x0c, 0xb9, 0x73, 0x4e, 0x93, 0x98,
+       0x3a, 0xe3, 0xd5, 0x4a, 0x2c, 0x33, 0xa6, 0xbd, 0xa7, 0xde, 0xa3, 0x6c,
+       0x60, 0xc8, 0x06, 0xee, 0x9d, 0x19, 0xd5, 0x52, 0x95, 0x1c, 0x62, 0xd6,
+       0x2e, 0xe2, 0x27, 0xc7, 0x45, 0xcc, 0x5c, 0xc0, 0x78, 0x8b, 0xc5, 0x15,
+       0x9e, 0xc1, 0x86, 0x5d, 0xbc, 0x4d, 0x9c, 0xbd, 0xcb, 0x50, 0x67, 0x1e,
+       0xd2, 0xaa, 0x66, 0xb7, 0x50, 0x14, 0x33, 0x39, 0xc0, 0x33, 0x0e, 0xf7,
+       0x63, 0x5d, 0x7e, 0x0e, 0x6d, 0x49, 0xc4, 0xc7, 0xc3, 0x5a, 0x72, 0x69,
+       0x18, 0xd7, 0x8f, 0xe0, 0x1a, 0xfe, 0x78, 0x2e, 0x8b, 0xfb, 0x8f, 0xe0,
+       0x7a, 0x42, 0x4b, 0xd5, 0xb2, 0xb8, 0x7e, 0x14, 0xd7, 0x49, 0x93, 0x79,
+       0xca, 0x0f, 0xec, 0x8c, 0xe6, 0x62, 0x2c, 0x77, 0x69, 0x18, 0x9f, 0xc6,
+       0xf1, 0x78, 0x0f, 0x7a, 0x2a, 0x72, 0xaf, 0x2d, 0x0e, 0x9a, 0x0e, 0x6a,
+       0xe9, 0x4a, 0x1b, 0xc6, 0xe8, 0xc1, 0xf3, 0xb4, 0xa9, 0x43, 0xfe, 0xfc,
+       0xac, 0x39, 0xdd, 0xad, 0x6a, 0x4e, 0x46, 0x22, 0x03, 0x9c, 0x7c, 0x1c,
+       0x79, 0x80, 0x26, 0x69, 0xfb, 0x49, 0x29, 0x38, 0xf0, 0x2b, 0x15, 0x43,
+       0x52, 0x91, 0x3c, 0x7e, 0xe7, 0x25, 0x39, 0x88, 0xfb, 0x15, 0xda, 0x02,
+       0xfb, 0xfd, 0x89, 0x14, 0xca, 0xc4, 0xfd, 0xac, 0x33, 0xb1, 0x36, 0xc5,
+       0xfa, 0x52, 0x0e, 0x32, 0x88, 0xd0, 0x7e, 0x6f, 0x50, 0x13, 0xf3, 0xce,
+       0x55, 0x23, 0x2e, 0x6b, 0xc9, 0x0a, 0xf7, 0xfd, 0xdc, 0xcc, 0x45, 0x9b,
+       0xef, 0x28, 0x4d, 0x70, 0x1f, 0xb1, 0x60, 0x24, 0x58, 0x1f, 0x51, 0xf5,
+       0x75, 0xc7, 0xdb, 0x1f, 0xe4, 0xb8, 0x63, 0xe0, 0xb7, 0xb1, 0x6e, 0xc5,
+       0x79, 0xbf, 0x80, 0xe7, 0xbd, 0x7a, 0x56, 0xaa, 0xf6, 0x5e, 0x5d, 0xf0,
+       0xbd, 0x81, 0xf3, 0xd0, 0xc5, 0x45, 0x95, 0x1b, 0x73, 0x0f, 0xf7, 0xfd,
+       0x72, 0x2a, 0xe4, 0x30, 0x45, 0xd6, 0xc8, 0x82, 0x7d, 0xbb, 0x40, 0x8e,
+       0x9b, 0x69, 0x25, 0x9d, 0x47, 0x30, 0xa6, 0x38, 0xf4, 0xbb, 0xd9, 0x08,
+       0xf7, 0xdf, 0xf8, 0x8c, 0x7c, 0xf9, 0x3a, 0xdd, 0xa4, 0x99, 0xf2, 0x38,
+       0x0e, 0xff, 0xc9, 0x77, 0x32, 0x9e, 0x94, 0x9c, 0xc3, 0x1a, 0x8f, 0x81,
+       0xd8, 0x98, 0xc7, 0xef, 0xeb, 0xf2, 0x9b, 0xf4, 0xe5, 0x97, 0x2b, 0xbf,
+       0xa4, 0x74, 0xb8, 0x60, 0x73, 0xbe, 0xa0, 0xf6, 0x31, 0xa2, 0x74, 0xb7,
+       0xa0, 0xce, 0xfd, 0x06, 0x32, 0x08, 0xea, 0x77, 0x37, 0xb6, 0xbd, 0x61,
+       0x9b, 0xb4, 0xdd, 0xce, 0xf3, 0x10, 0xbd, 0xae, 0x90, 0x7e, 0xf2, 0xc1,
+       0x18, 0x16, 0xec, 0xb5, 0x06, 0x3c, 0x04, 0x7c, 0xde, 0xaa, 0x7c, 0x48,
+       0x6f, 0x64, 0xbb, 0xb4, 0x65, 0x4c, 0xc3, 0x66, 0x6c, 0xf8, 0x84, 0xbf,
+       0x3f, 0xf0, 0x77, 0x21, 0x67, 0x4f, 0x16, 0xa1, 0x84, 0x4c, 0xfa, 0xef,
+       0xf8, 0xde, 0xc0, 0x1e, 0x36, 0xef, 0x35, 0xbb, 0x99, 0x73, 0xf6, 0x75,
+       0xbe, 0x17, 0x6e, 0xc0, 0xf7, 0x82, 0xcf, 0x77, 0xe5, 0x16, 0xe9, 0x5d,
+       0x98, 0x71, 0xc1, 0x33, 0x6d, 0xee, 0x46, 0xf6, 0x28, 0xea, 0x7f, 0x5f,
+       0xac, 0x19, 0xe1, 0xb0, 0x5b, 0xbd, 0x59, 0x0d, 0x95, 0x79, 0xb5, 0x67,
+       0x97, 0xe7, 0x10, 0x0b, 0xcb, 0x65, 0x2f, 0xc7, 0x2e, 0x57, 0x59, 0xcb,
+       0x7e, 0x3f, 0x1a, 0xf8, 0xfe, 0xd7, 0x67, 0xd4, 0x79, 0x97, 0xc9, 0xaa,
+       0x57, 0xf7, 0x2a, 0x97, 0x1b, 0x63, 0xea, 0x0e, 0xc6, 0xd3, 0xde, 0xbc,
+       0x8c, 0xf2, 0xbd, 0x65, 0x5c, 0xef, 0x96, 0x4b, 0x73, 0x6a, 0xcf, 0xca,
+       0xdf, 0x1b, 0xe2, 0x9e, 0x8f, 0xda, 0xff, 0x86, 0x5f, 0x1b, 0x53, 0x7e,
+       0x7d, 0x75, 0x4e, 0xdd, 0xf3, 0xb0, 0x52, 0x75, 0x14, 0x7e, 0x1f, 0xb9,
+       0x84, 0xbd, 0x55, 0x0a, 0xc8, 0xb9, 0xcf, 0xd9, 0x0f, 0x6f, 0x27, 0xce,
+       0xe1, 0x58, 0xab, 0x18, 0xeb, 0xe2, 0x9c, 0x6c, 0xe7, 0x99, 0x92, 0xb2,
+       0xda, 0x67, 0xf3, 0xea, 0xe2, 0x13, 0x12, 0xfc, 0x4f, 0x88, 0xb0, 0x1f,
+       0x0b, 0x79, 0xae, 0x85, 0xef, 0xd2, 0xd2, 0x57, 0x20, 0x0f, 0x1a, 0xe5,
+       0x3e, 0x4e, 0xbd, 0xee, 0xd5, 0xcd, 0xeb, 0x58, 0x17, 0x4d, 0x7c, 0xef,
+       0x02, 0x7f, 0xc7, 0x61, 0x3f, 0x58, 0x27, 0xeb, 0xed, 0xbc, 0x66, 0xee,
+       0x11, 0x5c, 0x33, 0xb0, 0xfd, 0x3f, 0xd4, 0x46, 0x90, 0x7c, 0xb4, 0x45,
+       0x00, 0x00, 0x00 };
 
 static const u32 bnx2_TXP_b09FwData[(0xd0/4) + 1] = {
        0x00000000, 0x00000014, 0x00000014, 0x00000014, 0x00000014, 0x00000010,
@@ -4041,37 +4065,38 @@ static const u32 bnx2_TXP_b09FwData[(0xd0/4) + 1] = {
        0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 };
 static const u32 bnx2_TXP_b09FwRodata[(0x30/4) + 1] = {
-       0x08004060, 0x0800408c, 0x080040d4, 0x080040d4, 0x08003f60, 0x08003f8c,
-       0x08003f8c, 0x080040d4, 0x080040d4, 0x080040d4, 0x08003ff4, 0x00000000,
+       0x08003fdc, 0x08004008, 0x08004050, 0x08004050, 0x08003edc, 0x08003f08,
+       0x08003f08, 0x08004050, 0x08004050, 0x08004050, 0x08003f70, 0x00000000,
        0x00000000 };
 
 static struct fw_info bnx2_txp_fw_09 = {
+       /* Firmware version:  3.7.1 */
        .ver_major                      = 0x3,
-       .ver_minor                      = 0x4,
-       .ver_fix                        = 0x3,
+       .ver_minor                      = 0x7,
+       .ver_fix                        = 0x1,
 
        .start_addr                     = 0x08000060,
 
        .text_addr                      = 0x08000000,
-       .text_len                       = 0x4634,
+       .text_len                       = 0x45b0,
        .text_index                     = 0x0,
        .gz_text                        = bnx2_TXP_b09FwText,
        .gz_text_len                    = sizeof(bnx2_TXP_b09FwText),
 
-       .data_addr                      = 0x08004680,
+       .data_addr                      = 0x08004600,
        .data_len                       = 0xd0,
        .data_index                     = 0x0,
        .data                           = bnx2_TXP_b09FwData,
 
-       .sbss_addr                      = 0x08004750,
+       .sbss_addr                      = 0x080046d0,
        .sbss_len                       = 0x8c,
        .sbss_index                     = 0x0,
 
-       .bss_addr                       = 0x080047e0,
+       .bss_addr                       = 0x08004760,
        .bss_len                        = 0xa20,
        .bss_index                      = 0x0,
 
-       .rodata_addr                    = 0x08004638,
+       .rodata_addr                    = 0x080045b0,
        .rodata_len                     = 0x30,
        .rodata_index                   = 0x0,
        .rodata                         = bnx2_TXP_b09FwRodata,
index fe5ffac7ac5746acc2798759c44f2cbb62bdaf81..2809c99906e093682f91d0f8e7cfc765905cd94f 100644 (file)
@@ -3218,7 +3218,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
        /* get adapter properties */
        ret = ehea_sense_adapter_attr(adapter);
        if (ret) {
-               dev_err(&dev->dev, "sense_adapter_attr failed: %d", ret);
+               dev_err(&dev->dev, "sense_adapter_attr failed: %d\n", ret);
                goto out_free_ad;
        }
 
@@ -3226,7 +3226,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
                                      EHEA_NEQ, EHEA_MAX_ENTRIES_EQ, 1);
        if (!adapter->neq) {
                ret = -EIO;
-               dev_err(&dev->dev, "NEQ creation failed");
+               dev_err(&dev->dev, "NEQ creation failed\n");
                goto out_free_ad;
        }
 
@@ -3237,7 +3237,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
                                  ehea_interrupt_neq, IRQF_DISABLED,
                                  "ehea_neq", adapter);
        if (ret) {
-               dev_err(&dev->dev, "requesting NEQ IRQ failed");
+               dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
                goto out_kill_eq;
        }
 
@@ -3247,7 +3247,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
 
        ret = ehea_setup_ports(adapter);
        if (ret) {
-               dev_err(&dev->dev, "setup_ports failed");
+               dev_err(&dev->dev, "setup_ports failed\n");
                goto out_rem_dev_sysfs;
        }
 
index 64c8151f200401aca8bf9d4c21e4c07f82850176..366e62a2b1e5dacea1e1afd7fa0e89870afbf07d 100644 (file)
@@ -3058,7 +3058,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (status != 0) {
                dac_enabled = 0;
                dev_err(&pdev->dev,
-                       "64-bit pci address mask was refused, trying 32-bit");
+                       "64-bit pci address mask was refused, "
+                       "trying 32-bit\n");
                status = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
        }
        if (status != 0) {
index 2a1d6d7ec351d37f4a7189f2e3987d76a5a8990c..601051c584e8a3c688358c983d7f09809c111217 100644 (file)
@@ -53,9 +53,6 @@ static char netxen_nic_driver_string[] = "NetXen Network Driver version "
 #define NETXEN_ADAPTER_UP_MAGIC 777
 #define NETXEN_NIC_PEG_TUNE 0
 
-#define DMA_32BIT_MASK 0x00000000ffffffffULL
-#define DMA_35BIT_MASK 0x00000007ffffffffULL
-
 /* Local functions to NetXen NIC driver */
 static int __devinit netxen_nic_probe(struct pci_dev *pdev,
                                      const struct pci_device_id *ent);
index 7967240534d5b647d97313920c9d5ff7b2455bc0..70d7e478a3e0ae0c17dca3bfae18fbb4c63e9ce3 100644 (file)
@@ -3961,7 +3961,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
        struct net_device *dev = alloc_etherdev(sizeof(*sky2));
 
        if (!dev) {
-               dev_err(&hw->pdev->dev, "etherdev alloc failed");
+               dev_err(&hw->pdev->dev, "etherdev alloc failed\n");
                return NULL;
        }
 
index 6240b978fe3d94ccbe08ebf489ba75b47c042566..f55a5951733ab56b44aaaae2af0939c71c10c15c 100644 (file)
@@ -114,8 +114,8 @@ static void mcs7830_async_cmd_callback(struct urb *urb)
        struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
 
        if (urb->status < 0)
-               printk(KERN_DEBUG "mcs7830_async_cmd_callback() failed with %d",
-                       urb->status);
+               printk(KERN_DEBUG "%s() failed with %d\n",
+                      __FUNCTION__, urb->status);
 
        kfree(req);
        usb_free_urb(urb);
@@ -129,15 +129,15 @@ static void mcs7830_set_reg_async(struct usbnet *dev, u16 index, u16 size, void
 
        urb = usb_alloc_urb(0, GFP_ATOMIC);
        if (!urb) {
-               dev_dbg(&dev->udev->dev, "Error allocating URB "
-                               "in write_cmd_async!");
+               dev_dbg(&dev->udev->dev,
+                       "Error allocating URB in write_cmd_async!\n");
                return;
        }
 
        req = kmalloc(sizeof *req, GFP_ATOMIC);
        if (!req) {
-               dev_err(&dev->udev->dev, "Failed to allocate memory for "
-                               "control request");
+               dev_err(&dev->udev->dev,
+                       "Failed to allocate memory for control request\n");
                goto out;
        }
        req->bRequestType = MCS7830_WR_BMREQ;
@@ -153,8 +153,8 @@ static void mcs7830_set_reg_async(struct usbnet *dev, u16 index, u16 size, void
 
        ret = usb_submit_urb(urb, GFP_ATOMIC);
        if (ret < 0) {
-               dev_err(&dev->udev->dev, "Error submitting the control "
-                               "message: ret=%d", ret);
+               dev_err(&dev->udev->dev,
+                       "Error submitting the control message: ret=%d\n", ret);
                goto out;
        }
        return;
index 7fd505cc4f7ab3b9a8fb32a8847596bca1d51d19..2a8fc431099f6e1fcd5a652edd043a774629d002 100644 (file)
@@ -1526,7 +1526,7 @@ static int xennet_connect(struct net_device *dev)
 
        if (!feature_rx_copy) {
                dev_info(&dev->dev,
-                        "backend does not support copying recieve path");
+                        "backend does not support copying receive path\n");
                return -ENODEV;
        }
 
index 864f09fd9f86f6978d1bc87710b0fe35c48669a6..b47bb2d7476a82e5618fc50c0772cfea9ddd46ec 100644 (file)
@@ -12,6 +12,7 @@
  *
  */
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/device.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
@@ -94,3 +95,23 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
        bus->resume = of_platform_device_resume;
        return bus_register(bus);
 }
+
+int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
+{
+       /* initialize common driver fields */
+       if (!drv->driver.name)
+               drv->driver.name = drv->name;
+       if (!drv->driver.owner)
+               drv->driver.owner = drv->owner;
+       drv->driver.bus = bus;
+
+       /* register with core */
+       return driver_register(&drv->driver);
+}
+EXPORT_SYMBOL(of_register_driver);
+
+void of_unregister_driver(struct of_platform_driver *drv)
+{
+       driver_unregister(&drv->driver);
+}
+EXPORT_SYMBOL(of_unregister_driver);
index ff9f34453530d991d668fb35737c488a107b1c17..5bbff2028f8f52b242d222d1583e95d52fa74d76 100644 (file)
@@ -275,35 +275,6 @@ void parport_close(struct pardevice *dev)
        parport_unregister_device(dev);
 }
 
-/**
- *     parport_device_num - convert device coordinates
- *     @parport: parallel port number
- *     @mux: multiplexor port number (-1 for no multiplexor)
- *     @daisy: daisy chain address (-1 for no daisy chain address)
- *
- *     This tries to locate a device on the given parallel port,
- *     multiplexor port and daisy chain address, and returns its
- *     device number or %-ENXIO if no device with those coordinates
- *     exists.
- **/
-
-int parport_device_num(int parport, int mux, int daisy)
-{
-       int res = -ENXIO;
-       struct daisydev *dev;
-
-       spin_lock(&topology_lock);
-       dev = topology;
-       while (dev && dev->port->portnum != parport &&
-              dev->port->muxport != mux && dev->daisy != daisy)
-               dev = dev->next;
-       if (dev)
-               res = dev->devnum;
-       spin_unlock(&topology_lock);
-
-       return res;
-}
-
 /* Send a daisy-chain-style CPP command packet. */
 static int cpp_daisy(struct parport *port, int cmd)
 {
index bdbdab9285cacfbb6839c24cbbf9f11239e5796f..ed82e41210d1d1e89616105b2b23e7f3322bd292 100644 (file)
@@ -237,7 +237,7 @@ static int do_hardware_modes (ctl_table *table, int write,
 #define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \
                                      .mode = 0555, .child = CHILD }
 #define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD }
-#define PARPORT_DEVICES_ROOT_DIR  { .ctl_name = DEV_PARPORT_DEVICES, .procname = "devices", \
+#define PARPORT_DEVICES_ROOT_DIR  {  .procname = "devices", \
                                     .mode = 0555, .child = NULL }
 
 static const unsigned long parport_min_timeslice_value =
@@ -266,7 +266,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
        .sysctl_header = NULL,
         {
                {
-                       .ctl_name       = DEV_PARPORT_SPINTIME,
                        .procname       = "spintime",
                        .data           = NULL,
                        .maxlen         = sizeof(int),
@@ -276,7 +275,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .extra2         = (void*) &parport_max_spintime_value
                },
                {
-                       .ctl_name       = DEV_PARPORT_BASE_ADDR,
                        .procname       = "base-addr",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -284,7 +282,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   = &do_hardware_base_addr
                },
                {
-                       .ctl_name       = DEV_PARPORT_IRQ,
                        .procname       = "irq",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -292,7 +289,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   = &do_hardware_irq
                },
                {
-                       .ctl_name       = DEV_PARPORT_DMA,
                        .procname       = "dma",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -300,7 +296,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   = &do_hardware_dma
                },
                {
-                       .ctl_name       = DEV_PARPORT_MODES,
                        .procname       = "modes",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -310,7 +305,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                PARPORT_DEVICES_ROOT_DIR,
 #ifdef CONFIG_PARPORT_1284
                {
-                       .ctl_name       = DEV_PARPORT_AUTOPROBE,
                        .procname       = "autoprobe",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -318,7 +312,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   = &do_autoprobe
                },
                {
-                       .ctl_name       = DEV_PARPORT_AUTOPROBE + 1,
                        .procname       = "autoprobe0",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -326,7 +319,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   =  &do_autoprobe
                },
                {
-                       .ctl_name       = DEV_PARPORT_AUTOPROBE + 2,
                        .procname       = "autoprobe1",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -334,7 +326,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   = &do_autoprobe
                },
                {
-                       .ctl_name       = DEV_PARPORT_AUTOPROBE + 3,
                        .procname       = "autoprobe2",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -342,7 +333,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .proc_handler   = &do_autoprobe
                },
                {
-                       .ctl_name       = DEV_PARPORT_AUTOPROBE + 4,
                        .procname       = "autoprobe3",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -354,7 +344,6 @@ static const struct parport_sysctl_table parport_sysctl_template = {
        },
        {
                {
-                       .ctl_name       = DEV_PARPORT_DEVICES_ACTIVE,
                        .procname       = "active",
                        .data           = NULL,
                        .maxlen         = 0,
@@ -393,7 +382,6 @@ parport_device_sysctl_template = {
        .sysctl_header = NULL,
        {
                {
-                       .ctl_name       = DEV_PARPORT_DEVICE_TIMESLICE,
                        .procname       = "timeslice",
                        .data           = NULL,
                        .maxlen         = sizeof(int),
@@ -449,7 +437,6 @@ parport_default_sysctl_table = {
        .sysctl_header  = NULL,
        {
                {
-                       .ctl_name       = DEV_PARPORT_DEFAULT_TIMESLICE,
                        .procname       = "timeslice",
                        .data           = &parport_default_timeslice,
                        .maxlen         = sizeof(parport_default_timeslice),
@@ -459,7 +446,6 @@ parport_default_sysctl_table = {
                        .extra2         = (void*) &parport_max_timeslice_value
                },
                {
-                       .ctl_name       = DEV_PARPORT_DEFAULT_SPINTIME,
                        .procname       = "spintime",
                        .data           = &parport_default_spintime,
                        .maxlen         = sizeof(parport_default_spintime),
@@ -502,7 +488,7 @@ int parport_proc_register(struct parport *port)
 
        t->device_dir[0].extra1 = port;
 
-       for (i = 0; i < 8; i++)
+       for (i = 0; i < 5; i++)
                t->vars[i].extra1 = port;
 
        t->vars[0].data = &port->spintime;
@@ -512,7 +498,7 @@ int parport_proc_register(struct parport *port)
                t->vars[6 + i].extra2 = &port->probe_info[i];
 
        t->port_dir[0].procname = port->name;
-       t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */
+       t->port_dir[0].ctl_name = 0;
 
        t->port_dir[0].child = t->vars;
        t->parport_dir[0].child = t->port_dir;
@@ -551,26 +537,12 @@ int parport_device_proc_register(struct pardevice *device)
        t->dev_dir[0].child = t->parport_dir;
        t->parport_dir[0].child = t->port_dir;
        t->port_dir[0].procname = port->name;
-       t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */
+       t->port_dir[0].ctl_name = 0;
        t->port_dir[0].child = t->devices_root_dir;
        t->devices_root_dir[0].child = t->device_dir;
 
-#ifdef CONFIG_PARPORT_1284
-
-       t->device_dir[0].ctl_name =
-               parport_device_num(port->number, port->muxport,
-                                  device->daisy)
-               + 1;  /* nb 0 isn't legal here */ 
-
-#else /* No IEEE 1284 support */
-
-       /* parport_device_num isn't available. */
-       t->device_dir[0].ctl_name = 1;
-       
-#endif /* IEEE 1284 support or not */
-
+       t->device_dir[0].ctl_name = 0;
        t->device_dir[0].procname = device->name;
-       t->device_dir[0].extra1 = device;
        t->device_dir[0].child = t->vars;
        t->vars[0].data = &device->timeslice;
 
index be7021ee3611d72350514c6a4551f155bd126f98..bdb9b7285b3d7b6b0afc744f3be084d01c1ca11b 100644 (file)
@@ -366,7 +366,7 @@ static int ds2760_battery_probe(struct platform_device *pdev)
 
        retval = power_supply_register(&pdev->dev, &di->bat);
        if (retval) {
-               dev_err(di->dev, "failed to register battery");
+               dev_err(di->dev, "failed to register battery\n");
                goto batt_failed;
        }
 
index 3a9824e3b251ff3a41fdcacbf8f75b3edc26cd93..55955f16ad919ad7fb6d5aeadbb4334733fa1e71 100644 (file)
@@ -66,7 +66,7 @@ static int ps3stor_probe_access(struct ps3_storage_device *dev)
        if (n > 1)
                dev_info(&dev->sbd.core,
                         "%s:%u: %lu accessible regions found. Only the first "
-                        "one will be used",
+                        "one will be used\n",
                         __func__, __LINE__, n);
        dev->region_idx = __ffs(dev->accessible_regions);
        dev_info(&dev->sbd.core,
index 6cad0841f3c4d8719ab56e322a2fb82eb6fb89c7..2ae0e8304d3aa83bd7f75cdd6052b4394ba31a8b 100644 (file)
@@ -200,9 +200,8 @@ void rtc_sysfs_add_device(struct rtc_device *rtc)
 
        err = device_create_file(&rtc->dev, &dev_attr_wakealarm);
        if (err)
-               dev_err(rtc->dev.parent, "failed to create "
-                               "alarm attribute, %d",
-                               err);
+               dev_err(rtc->dev.parent,
+                       "failed to create alarm attribute, %d\n", err);
 }
 
 void rtc_sysfs_del_device(struct rtc_device *rtc)
index 63941a259b927436f2f96e7589d8e8267e48ffa9..f1aa1389ea4ac231866310a92e2cbd625fef6a7c 100644 (file)
@@ -126,7 +126,7 @@ struct vfc_dev {
        volatile struct vfc_regs __iomem *regs;
        struct vfc_regs *phys_regs;
        unsigned int control_reg;
-       struct semaphore device_lock_sem;
+       struct mutex device_lock_mtx;
        int instance;
        int busy;
        unsigned long which_io;
index 9269f7fbd36364957f0cdc97a90357f4e987fd1f..e7a1642b2aa4c528baa0aa4f1bf85f6f970fe6ce 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/fs.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <linux/mm.h>
 
 #include <asm/openprom.h>
@@ -54,12 +55,12 @@ static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
 
 void vfc_lock_device(struct vfc_dev *dev)
 {
-       down(&dev->device_lock_sem);
+       mutex_lock(&dev->device_lock_mtx);
 }
 
 void vfc_unlock_device(struct vfc_dev *dev)
 {
-       up(&dev->device_lock_sem);
+       mutex_unlock(&dev->device_lock_mtx);
 }
 
 
index b41dfb5390212ddade69f1ff80bbe1930389b36f..c316a0bcae6cc8f9ca717153fb266dda5f8fe3fb 100644 (file)
@@ -5134,6 +5134,7 @@ static void ipr_build_ata_ioadl(struct ipr_cmnd *ipr_cmd,
        u32 ioadl_flags = 0;
        struct ipr_ioarcb *ioarcb = &ipr_cmd->ioarcb;
        struct ipr_ioadl_desc *ioadl = ipr_cmd->ioadl;
+       struct ipr_ioadl_desc *last_ioadl = NULL;
        int len = qc->nbytes + qc->pad_len;
        struct scatterlist *sg;
 
@@ -5156,11 +5157,13 @@ static void ipr_build_ata_ioadl(struct ipr_cmnd *ipr_cmd,
        ata_for_each_sg(sg, qc) {
                ioadl->flags_and_data_len = cpu_to_be32(ioadl_flags | sg_dma_len(sg));
                ioadl->address = cpu_to_be32(sg_dma_address(sg));
-               if (ata_sg_is_last(sg, qc))
-                       ioadl->flags_and_data_len |= cpu_to_be32(IPR_IOADL_FLAGS_LAST);
-               else
-                       ioadl++;
+
+               last_ioadl = ioadl;
+               ioadl++;
        }
+
+       if (likely(last_ioadl))
+               last_ioadl->flags_and_data_len |= cpu_to_be32(IPR_IOADL_FLAGS_LAST);
 }
 
 /**
index e5337ad4121efd36f9d6493dc6ea011cd9404b6c..ce348c5c706ce901f05cc72349804c63cc2b9935 100644 (file)
@@ -1243,7 +1243,8 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
                                memset(adaptermsg, 0, LPFC_MAX_ADPTMSG);
                                memcpy(&adaptermsg[0], (uint8_t *) irsp,
                                       MAX_MSG_DATA);
-                               dev_warn(&((phba->pcidev)->dev), "lpfc%d: %s",
+                               dev_warn(&((phba->pcidev)->dev),
+                                        "lpfc%d: %s\n",
                                         phba->brd_no, adaptermsg);
                        } else {
                                /* Unknown IOCB command */
@@ -1430,7 +1431,8 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
                                memset(adaptermsg, 0, LPFC_MAX_ADPTMSG);
                                memcpy(&adaptermsg[0], (uint8_t *) irsp,
                                       MAX_MSG_DATA);
-                               dev_warn(&((phba->pcidev)->dev), "lpfc%d: %s",
+                               dev_warn(&((phba->pcidev)->dev),
+                                        "lpfc%d: %s\n",
                                         phba->brd_no, adaptermsg);
                        } else {
                                /* Unknown IOCB command */
@@ -1681,7 +1683,7 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
                                        memcpy(&adaptermsg[0], (uint8_t *) irsp,
                                               MAX_MSG_DATA);
                                        dev_warn(&((phba->pcidev)->dev),
-                                                "lpfc%d: %s",
+                                                "lpfc%d: %s\n",
                                                 phba->brd_no, adaptermsg);
                                } else {
                                        /* Unknown IOCB command */
index 03b68d4f3bd0e1821f84aa5d75af404e8170e16c..89460d27c68959225bc27bfb818f989a06426738 100644 (file)
@@ -1286,7 +1286,7 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
 
         ret = scsi_init_shared_tag_map(host, MAX_SRBS);
         if (ret) {
-                dev_warn(&ha->pdev->dev, "scsi_init_shared_tag_map failed");
+                dev_warn(&ha->pdev->dev, "scsi_init_shared_tag_map failed\n");
                 goto probe_failed;
         }
 
index 68aa4da0186573fce0ed514f0d1ea0e784e864e5..103189095c80344ecadcdf15db3112abe8f947c1 100644 (file)
@@ -1959,12 +1959,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
 
        mutex_lock(&state->mutex);
 
-#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
-       if (uart_console(port)) {
+       if (!console_suspend_enabled && uart_console(port)) {
+               /* we're going to avoid suspending serial console */
                mutex_unlock(&state->mutex);
                return 0;
        }
-#endif
 
        tty_dev = device_find_child(port->dev, &match, serial_match_port);
        if (device_may_wakeup(tty_dev)) {
@@ -2016,12 +2015,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
 
        mutex_lock(&state->mutex);
 
-#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
-       if (uart_console(port)) {
+       if (!console_suspend_enabled && uart_console(port)) {
+               /* no need to resume serial console, it wasn't suspended */
                mutex_unlock(&state->mutex);
                return 0;
        }
-#endif
 
        if (!port->suspended) {
                disable_irq_wake(port->irq);
index 6cb71d74738f45671ce846be7d76c2c549054bcc..2ef11bb70b2ee9c5b588a432c006efa0cee2320c 100644 (file)
@@ -1070,7 +1070,7 @@ static int setup(struct spi_device *spi)
                return -ENODEV;
        }
 
-       dev_dbg(&spi->dev, "setup spi chip %s, width is %d, dma is %d,",
+       dev_dbg(&spi->dev, "setup spi chip %s, width is %d, dma is %d\n",
                        spi->modalias, chip->width, chip->enable_dma);
        dev_dbg(&spi->dev, "ctl_reg is 0x%x, flag_reg is 0x%x\n",
                        chip->ctl_reg, chip->flag);
index 3b4650ae6f1ab14acd070d9b87f0faa75c1e3ce2..7686ba34430f7011a1d65e0fbf5004c2e40d2384 100644 (file)
@@ -1194,7 +1194,7 @@ static int setup(struct spi_device *spi)
                chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
                if (!chip) {
                        dev_err(&spi->dev,
-                               "setup - cannot allocate controller state");
+                               "setup - cannot allocate controller state\n");
                        return -ENOMEM;
                }
                chip->control = SPI_DEFAULT_CONTROL;
@@ -1206,7 +1206,7 @@ static int setup(struct spi_device *spi)
                        if (!chip_info) {
                                dev_err(&spi->dev,
                                        "setup - "
-                                       "cannot allocate controller data");
+                                       "cannot allocate controller data\n");
                                status = -ENOMEM;
                                goto err_first_setup;
                        }
index b4a5e5e9d9fc4bd15ae52a9d78a9700ff3ee2cf8..d976660cb7f07902f70215d530a89008ae9ed4a6 100644 (file)
@@ -22,7 +22,7 @@ config SSB
 
 config SSB_PCIHOST_POSSIBLE
        bool
-       depends on SSB && PCI
+       depends on SSB && (PCI = y || PCI = SSB)
        default y
 
 config SSB_PCIHOST
@@ -37,7 +37,7 @@ config SSB_PCIHOST
 
 config SSB_PCMCIAHOST_POSSIBLE
        bool
-       depends on SSB && PCMCIA && EXPERIMENTAL
+       depends on SSB && (PCMCIA = y || PCMCIA = SSB) && EXPERIMENTAL
        default y
 
 config SSB_PCMCIAHOST
index ab8691a325802e19d374e601e6a3c5f3f60fc55a..3d3dd32bf3ab88475aa16ad6abccdc491682a86b 100644 (file)
@@ -173,7 +173,7 @@ u32 ssb_cpu_clock(struct ssb_mipscore *mcore)
 
 void ssb_mipscore_init(struct ssb_mipscore *mcore)
 {
-       struct ssb_bus *bus = mcore->dev->bus;
+       struct ssb_bus *bus;
        struct ssb_device *dev;
        unsigned long hz, ns;
        unsigned int irq, i;
@@ -183,6 +183,7 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore)
 
        ssb_dprintk(KERN_INFO PFX "Initializing MIPS core...\n");
 
+       bus = mcore->dev->bus;
        hz = ssb_clockspeed(bus);
        if (!hz)
                hz = 100000000;
index f51e22490edfaccae55b641723c939ce0019087b..912d97aaf9bf7b7ad52068dc850a8332aa4a76e5 100644 (file)
@@ -332,7 +332,7 @@ static void acm_read_bulk(struct urb *urb)
                return;
 
        if (status)
-               dev_dbg(&acm->data->dev, "bulk rx status %d", status);
+               dev_dbg(&acm->data->dev, "bulk rx status %d\n", status);
 
        buf = rcv->buffer;
        buf->size = urb->actual_length;
@@ -831,13 +831,13 @@ static int acm_probe (struct usb_interface *intf,
        
        /* normal probing*/
        if (!buffer) {
-               err("Wierd descriptor references\n");
+               err("Weird descriptor references\n");
                return -EINVAL;
        }
 
        if (!buflen) {
                if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) {
-                       dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint");
+                       dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n");
                        buflen = intf->cur_altsetting->endpoint->extralen;
                        buffer = intf->cur_altsetting->endpoint->extra;
                } else {
@@ -887,24 +887,24 @@ next_desc:
 
        if (!union_header) {
                if (call_interface_num > 0) {
-                       dev_dbg(&intf->dev,"No union descriptor, using call management descriptor");
+                       dev_dbg(&intf->dev,"No union descriptor, using call management descriptor\n");
                        data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = call_interface_num));
                        control_interface = intf;
                } else {
-                       dev_dbg(&intf->dev,"No union descriptor, giving up");
+                       dev_dbg(&intf->dev,"No union descriptor, giving up\n");
                        return -ENODEV;
                }
        } else {
                control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0);
                data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0));
                if (!control_interface || !data_interface) {
-                       dev_dbg(&intf->dev,"no interfaces");
+                       dev_dbg(&intf->dev,"no interfaces\n");
                        return -ENODEV;
                }
        }
        
        if (data_interface_num != call_interface_num)
-               dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.");
+               dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n");
 
 skip_normal_probe:
 
@@ -912,7 +912,7 @@ skip_normal_probe:
        if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
                if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) {
                        struct usb_interface *t;
-                       dev_dbg(&intf->dev,"Your device has switched interfaces.");
+                       dev_dbg(&intf->dev,"Your device has switched interfaces.\n");
 
                        t = control_interface;
                        control_interface = data_interface;
@@ -927,7 +927,7 @@ skip_normal_probe:
                return -ENODEV;
        
        if (usb_interface_claimed(data_interface)) { /* valid in this context */
-               dev_dbg(&intf->dev,"The data interface isn't available");
+               dev_dbg(&intf->dev,"The data interface isn't available\n");
                return -EBUSY;
        }
 
@@ -944,7 +944,7 @@ skip_normal_probe:
        if (!usb_endpoint_dir_in(epread)) {
                /* descriptors are swapped */
                struct usb_endpoint_descriptor *t;
-               dev_dbg(&intf->dev,"The data interface has switched endpoints");
+               dev_dbg(&intf->dev,"The data interface has switched endpoints\n");
                
                t = epread;
                epread = epwrite;
@@ -959,7 +959,7 @@ skip_normal_probe:
        }
 
        if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) {
-               dev_dbg(&intf->dev, "out of memory (acm kzalloc)");
+               dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n");
                goto alloc_fail;
        }
 
@@ -985,26 +985,26 @@ skip_normal_probe:
 
        buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
        if (!buf) {
-               dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)");
+               dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
                goto alloc_fail2;
        }
        acm->ctrl_buffer = buf;
 
        if (acm_write_buffers_alloc(acm) < 0) {
-               dev_dbg(&intf->dev, "out of memory (write buffer alloc)");
+               dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n");
                goto alloc_fail4;
        }
 
        acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
        if (!acm->ctrlurb) {
-               dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)");
+               dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n");
                goto alloc_fail5;
        }
        for (i = 0; i < num_rx_buf; i++) {
                struct acm_ru *rcv = &(acm->ru[i]);
 
                if (!(rcv->urb = usb_alloc_urb(0, GFP_KERNEL))) {
-                       dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)");
+                       dev_dbg(&intf->dev, "out of memory (read urbs usb_alloc_urb)\n");
                        goto alloc_fail7;
                }
 
@@ -1015,13 +1015,13 @@ skip_normal_probe:
                struct acm_rb *buf = &(acm->rb[i]);
 
                if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) {
-                       dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)");
+                       dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n");
                        goto alloc_fail7;
                }
        }
        acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
        if (!acm->writeurb) {
-               dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)");
+               dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n");
                goto alloc_fail7;
        }
 
index 7dc123d6b2d0e2893f9ddac031da0d3fe71ede35..99e5a68a3f120ead6785fc6b880968e97ab47e83 100644 (file)
@@ -291,7 +291,7 @@ int usb_create_ep_files(struct device *parent,
 
        retval = endpoint_get_minor(ep_dev);
        if (retval) {
-               dev_err(parent, "can not allocate minor number for %s",
+               dev_err(parent, "can not allocate minor number for %s\n",
                        ep_dev->dev.bus_id);
                goto error_register;
        }
index 60a8f55a0cc7d552887dcbb17c34584c3d8cc071..036c3dea855e66d4df3186dd83df3ecbd20542d7 100644 (file)
@@ -2870,10 +2870,9 @@ static int hub_thread(void *__unused)
        set_freezable();
        do {
                hub_events();
-               wait_event_interruptible(khubd_wait,
+               wait_event_freezable(khubd_wait,
                                !list_empty(&hub_event_list) ||
                                kthread_should_stop());
-               try_to_freeze();
        } while (!kthread_should_stop() || !list_empty(&hub_event_list));
 
        pr_debug("%s: khubd exiting\n", usbcore_name);
index c021af3903723b3d27db15f2cc904cd80ed4bd36..8dd5a6afd513a3de9835d64ba74d15e8a46ee9b4 100644 (file)
@@ -1526,7 +1526,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
                new_interfaces = kmalloc(nintf * sizeof(*new_interfaces),
                                GFP_KERNEL);
                if (!new_interfaces) {
-                       dev_err(&dev->dev, "Out of memory");
+                       dev_err(&dev->dev, "Out of memory\n");
                        return -ENOMEM;
                }
 
@@ -1535,7 +1535,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
                                        sizeof(struct usb_interface),
                                        GFP_KERNEL);
                        if (!new_interfaces[n]) {
-                               dev_err(&dev->dev, "Out of memory");
+                               dev_err(&dev->dev, "Out of memory\n");
                                ret = -ENOMEM;
 free_interfaces:
                                while (--n >= 0)
index 6829814b7aafbd6faa17288ebd1999a11ff9dec4..44b79e8a6e25526e71264dc77c40f713bd47ad95 100644 (file)
@@ -358,7 +358,7 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
        hcd->rsrc_len   = dev->resource[0].end - dev->resource[0].start + 1;
 
        if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
-               dev_err(&dev->dev, "request_mem_region failed");
+               dev_err(&dev->dev, "request_mem_region failed\n");
                retval = -EBUSY;
                goto err_put;
        }
index 5131cbfb2f5230cec9c0c3cd9d5c95d5f5731538..c567aa7a41ead3643de3c38ab4b286a3c13c283b 100644 (file)
@@ -805,7 +805,7 @@ static int adu_probe(struct usb_interface *interface,
        dev->minor = interface->minor;
 
        /* let the user know what node this device is now attached to */
-       dev_info(&interface->dev, "ADU%d %s now attached to /dev/usb/adutux%d",
+       dev_info(&interface->dev, "ADU%d %s now attached to /dev/usb/adutux%d\n",
                 udev->descriptor.idProduct, dev->serial_number,
                 (dev->minor - ADU_MINOR_BASE));
 exit:
@@ -851,7 +851,7 @@ static void adu_disconnect(struct usb_interface *interface)
                mutex_unlock(&dev->mtx);
        }
 
-       dev_info(&interface->dev, "ADU device adutux%d now disconnected",
+       dev_info(&interface->dev, "ADU device adutux%d now disconnected\n",
                 (minor - ADU_MINOR_BASE));
 
        dbg(2," %s : leave", __FUNCTION__);
index 46d9f27ec17380122d0f3db1ef198b04d3fa2696..d372fbc4effbb0a44c31213142c92f720a13bea3 100644 (file)
@@ -216,7 +216,7 @@ static void iowarrior_callback(struct urb *urb)
 exit:
        retval = usb_submit_urb(urb, GFP_ATOMIC);
        if (retval)
-               dev_err(&dev->interface->dev, "%s - usb_submit_urb failed with result %d",
+               dev_err(&dev->interface->dev, "%s - usb_submit_urb failed with result %d\n",
                        __FUNCTION__, retval);
 
 }
@@ -451,7 +451,7 @@ static ssize_t iowarrior_write(struct file *file,
                break;
        default:
                /* what do we have here ? An unsupported Product-ID ? */
-               dev_err(&dev->interface->dev, "%s - not supported for product=0x%x",
+               dev_err(&dev->interface->dev, "%s - not supported for product=0x%x\n",
                        __FUNCTION__, dev->product_id);
                retval = -EFAULT;
                goto exit;
@@ -526,7 +526,7 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
                } else {
                        retval = -EINVAL;
                        dev_err(&dev->interface->dev,
-                               "ioctl 'IOW_WRITE' is not supported for product=0x%x.",
+                               "ioctl 'IOW_WRITE' is not supported for product=0x%x.\n",
                                dev->product_id);
                }
                break;
@@ -752,7 +752,7 @@ static int iowarrior_probe(struct usb_interface *interface,
        /* allocate memory for our device state and intialize it */
        dev = kzalloc(sizeof(struct iowarrior), GFP_KERNEL);
        if (dev == NULL) {
-               dev_err(&interface->dev, "Out of memory");
+               dev_err(&interface->dev, "Out of memory\n");
                return retval;
        }
 
index df0ebcdb9d6a6fbef91cffd476a0f5151945b324..2ad09b1f4848a57d9aac01f2bd46539590ec9377 100644 (file)
@@ -155,7 +155,7 @@ resubmit:
        retval = usb_submit_urb(urb, GFP_ATOMIC);
        if (retval)
                dev_err(&mc->intf->dev,
-                       "can't resubmit intr, %s-%s/motorcontrol0, retval %d",
+                       "can't resubmit intr, %s-%s/motorcontrol0, retval %d\n",
                        mc->udev->bus->bus_name,
                        mc->udev->devpath, retval);
 }
index e4c248c98e8480faa45fbd72600f8fc81cd7c4af..65257867b34b40ac798d6fa65de4c9f621ef4597 100644 (file)
@@ -1071,7 +1071,7 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a
                             (char*) &latency, 1, WDR_TIMEOUT);
 
        if (rv < 0) {
-               dev_err(dev, "Unable to read latency timer: %i", rv);
+               dev_err(dev, "Unable to read latency timer: %i\n", rv);
                return -EIO;
        }
        return sprintf(buf, "%i\n", latency);
@@ -1098,7 +1098,7 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute *
                             buf, 0, WDR_TIMEOUT);
 
        if (rv < 0) {
-               dev_err(dev, "Unable to write latency timer: %i", rv);
+               dev_err(dev, "Unable to write latency timer: %i\n", rv);
                return -EIO;
        }
 
index 2ecb1d2a034d0aa03dc08af168ae09a2f918efea..8dd3abc99d639b4ce32d3390006dd681d7bacf2d 100644 (file)
@@ -2882,7 +2882,7 @@ static int edge_startup (struct usb_serial *serial)
            (edge_serial->product_info.NumPorts != serial->num_ports)) {
                dev_warn(&serial->dev->dev, "Device Reported %d serial ports "
                         "vs. core thinking we have %d ports, email "
-                        "greg@kroah.com this information.",
+                        "greg@kroah.com this information.\n",
                         edge_serial->product_info.NumPorts,
                         serial->num_ports);
        }
index 1b94daa615845f50f185328b2ecf3326f71bdffa..cbe5530f3db2554bc40b99e2c357dd33e2567e2f 100644 (file)
@@ -227,7 +227,7 @@ static int ipw_open(struct usb_serial_port *port, struct file *filp)
                                 0,
                                 100000);
        if (result < 0)
-               dev_err(&port->dev, "Init of modem failed (error = %d)", result);
+               dev_err(&port->dev, "Init of modem failed (error = %d)\n", result);
 
        /* reset the bulk pipes */
        usb_clear_halt(dev, usb_rcvbulkpipe(dev, port->bulk_in_endpointAddress));
@@ -255,7 +255,7 @@ static int ipw_open(struct usb_serial_port *port, struct file *filp)
                                 0,
                                 100000);
        if (result < 0) 
-               dev_err(&port->dev, "Enabling bulk RxRead failed (error = %d)", result);
+               dev_err(&port->dev, "Enabling bulk RxRead failed (error = %d)\n", result);
 
        /*--4: setup the initial flowcontrol */
        dbg("%s:setting init flowcontrol (%s)",__FUNCTION__,buf_flow_init);
@@ -268,7 +268,7 @@ static int ipw_open(struct usb_serial_port *port, struct file *filp)
                                 0x10,
                                 200000);
        if (result < 0)
-               dev_err(&port->dev, "initial flowcontrol failed (error = %d)", result);
+               dev_err(&port->dev, "initial flowcontrol failed (error = %d)\n", result);
 
 
        /*--5: raise the dtr */
@@ -282,7 +282,7 @@ static int ipw_open(struct usb_serial_port *port, struct file *filp)
                                 0,
                                 200000);
        if (result < 0)
-               dev_err(&port->dev, "setting dtr failed (error = %d)", result);
+               dev_err(&port->dev, "setting dtr failed (error = %d)\n", result);
 
        /*--6: raise the rts */
        dbg("%s:raising rts",__FUNCTION__);
@@ -295,7 +295,7 @@ static int ipw_open(struct usb_serial_port *port, struct file *filp)
                                 0,
                                 200000);
        if (result < 0)
-               dev_err(&port->dev, "setting dtr failed (error = %d)", result);
+               dev_err(&port->dev, "setting dtr failed (error = %d)\n", result);
        
        kfree(buf_flow_init);
        return 0;
@@ -322,7 +322,7 @@ static void ipw_close(struct usb_serial_port *port, struct file * filp)
                                 0,
                                 200000);
        if (result < 0)
-               dev_err(&port->dev, "dropping dtr failed (error = %d)", result);
+               dev_err(&port->dev, "dropping dtr failed (error = %d)\n", result);
 
        /*--2: drop the rts */
        dbg("%s:dropping rts",__FUNCTION__);
@@ -334,7 +334,7 @@ static void ipw_close(struct usb_serial_port *port, struct file * filp)
                                 0,
                                 200000);
        if (result < 0)
-               dev_err(&port->dev, "dropping rts failed (error = %d)", result);
+               dev_err(&port->dev, "dropping rts failed (error = %d)\n", result);
 
 
        /*--3: purge */
@@ -347,7 +347,7 @@ static void ipw_close(struct usb_serial_port *port, struct file * filp)
                                 0,
                                 200000);
        if (result < 0)
-               dev_err(&port->dev, "purge failed (error = %d)", result);
+               dev_err(&port->dev, "purge failed (error = %d)\n", result);
 
 
        /* send RXBULK_off (tell modem to stop transmitting bulk data on rx chan) */
@@ -361,7 +361,7 @@ static void ipw_close(struct usb_serial_port *port, struct file * filp)
                                 100000);
 
        if (result < 0)
-               dev_err(&port->dev, "Disabling bulk RxRead failed (error = %d)", result);
+               dev_err(&port->dev, "Disabling bulk RxRead failed (error = %d)\n", result);
 
        /* shutdown any in-flight urbs that we know about */
        usb_kill_urb(port->read_urb);
index 01e811becec4659055bc27f02ec2693ac66011d2..e02c198016b02204ee5ef92c43850356e99d9264 100644 (file)
@@ -478,7 +478,7 @@ static int mos7720_open(struct usb_serial_port *port, struct file * filp)
                response = usb_submit_urb(port0->interrupt_in_urb, GFP_KERNEL);
                if (response)
                        dev_err(&port->dev,
-                               "%s - Error %d submitting control urb",
+                               "%s - Error %d submitting control urb\n",
                                __FUNCTION__, response);
        }
 
@@ -492,7 +492,7 @@ static int mos7720_open(struct usb_serial_port *port, struct file * filp)
        response = usb_submit_urb(port->read_urb, GFP_KERNEL);
        if (response)
                dev_err(&port->dev,
-                       "%s - Error %d submitting read urb", __FUNCTION__, response);
+                       "%s - Error %d submitting read urb\n", __FUNCTION__, response);
 
        /* initialize our icount structure */
        memset(&(mos7720_port->icount), 0x00, sizeof(mos7720_port->icount));
index d19861166b505cbca39a37f692d61fafd41cdf07..eea226ae37bd15bacf66e4057ce54b8152256469 100644 (file)
@@ -256,7 +256,7 @@ static void setup_line(struct work_struct *work)
                                100);
 
        if (result != OTI6858_CTRL_PKT_SIZE) {
-               dev_err(&port->dev, "%s(): error reading status", __FUNCTION__);
+               dev_err(&port->dev, "%s(): error reading status\n", __FUNCTION__);
                kfree(new_setup);
                /* we will try again */
                schedule_delayed_work(&priv->delayed_setup_work, msecs_to_jiffies(2));
index 0bb8de4cc5241a2b4071095b7c6b3b57049fe357..959b3e4e90774faf1a44815b6c6b19df0fedc336 100644 (file)
@@ -48,7 +48,7 @@ enum devicetype {
 static int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
 {
        int result;
-       dev_dbg(&udev->dev, "%s", "SET POWER STATE");
+       dev_dbg(&udev->dev, "%s", "SET POWER STATE\n");
        result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                        0x00,                   /* __u8 request      */
                        0x40,                   /* __u8 request type */
@@ -63,7 +63,7 @@ static int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
 static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSocMode)
 {
        int result;
-       dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH");
+       dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH\n");
        result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
                        SWIMS_USB_REQUEST_SetMode,      /* __u8 request      */
                        SWIMS_USB_REQUEST_TYPE_SetMode, /* __u8 request type */
@@ -397,7 +397,7 @@ static void sierra_indat_callback(struct urb *urb)
                        err = usb_submit_urb(urb, GFP_ATOMIC);
                        if (err)
                                dev_err(&port->dev, "resubmit read urb failed."
-                                       "(%d)", err);
+                                       "(%d)\n", err);
                }
        }
        return;
@@ -525,7 +525,7 @@ static int sierra_open(struct usb_serial_port *port, struct file *filp)
 
                result = usb_submit_urb(urb, GFP_KERNEL);
                if (result) {
-                       dev_err(&port->dev, "submit urb %d failed (%d) %d",
+                       dev_err(&port->dev, "submit urb %d failed (%d) %d\n",
                                i, result, urb->transfer_buffer_length);
                }
        }
@@ -538,7 +538,7 @@ static int sierra_open(struct usb_serial_port *port, struct file *filp)
        if (port->interrupt_in_urb) {
                result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
                if (result)
-                       dev_err(&port->dev, "submit irq_in urb failed %d",
+                       dev_err(&port->dev, "submit irq_in urb failed %d\n",
                                result);
        }
        return 0;
index 3451e8d03ab0e4653ff2f7208077f565f7294e19..ac6114eea0c3008f6f328ecd1bcf74368c837929 100644 (file)
@@ -907,12 +907,9 @@ static int usb_stor_scan_thread(void * __us)
        if (delay_use > 0) {
                printk(KERN_DEBUG "usb-storage: waiting for device "
                                "to settle before scanning\n");
-retry:
-               wait_event_interruptible_timeout(us->delay_wait,
+               wait_event_freezable_timeout(us->delay_wait,
                                test_bit(US_FLIDX_DISCONNECTING, &us->flags),
                                delay_use * HZ);
-               if (try_to_freeze())
-                       goto retry;
        }
 
        /* If the device is still connected, perform the scanning */
index 832e4613673a3eaf910ff650b5de5ca77385fb31..62bd4441b5e06c81fc9c4366916ecb3a2747f09e 100644 (file)
@@ -457,7 +457,7 @@ static struct fb_ops au1100fb_ops =
 
 /* AU1100 LCD controller device driver */
 
-int au1100fb_drv_probe(struct device *dev)
+static int __init au1100fb_drv_probe(struct device *dev)
 {
        struct au1100fb_device *fbdev = NULL;
        struct resource *regs_res;
index f57d7b2758b7985686192820ed1fc47d2e857bda..d31b203bf6549bdb94b337e9f28f7265d8b544e4 100644 (file)
@@ -98,7 +98,7 @@ static inline void newport_init_cmap(void)
        }
 }
 
-static struct linux_logo *newport_show_logo(void)
+static const struct linux_logo *newport_show_logo(void)
 {
 #ifdef CONFIG_LOGO_SGI_CLUT224
        const struct linux_logo *logo = fb_find_logo(8);
@@ -108,8 +108,8 @@ static struct linux_logo *newport_show_logo(void)
 
        if (!logo)
                return NULL;
-       *clut = logo->clut;
-       *data = logo->data;
+       clut = logo->clut;
+       data = logo->data;
 
        for (i = 0; i < logo->clutsize; i++) {
                newport_bfwait(npregs);
index 23a6bcc3e3ceb74703d1f9aeb76718b0de7e7ede..e92337bef50d00951bc4a7b9689f0d05b31a62ec 100644 (file)
@@ -636,7 +636,7 @@ static int __devinit gxt4500_probe(struct pci_dev *pdev,
 
        info = framebuffer_alloc(sizeof(struct gxt4500_par), &pdev->dev);
        if (!info) {
-               dev_err(&pdev->dev, "gxt4500: cannot alloc FB info record");
+               dev_err(&pdev->dev, "gxt4500: cannot alloc FB info record\n");
                goto err_free_fb;
        }
        par = info->par;
index a9283bae7790a954d98023559b2e0841064e4e90..fc72684aae5aae4328e67db391dcb2b62bdd4e8f 100644 (file)
@@ -78,10 +78,7 @@ const struct linux_logo * __init_refok fb_find_logo(int depth)
 #endif
 #ifdef CONFIG_LOGO_DEC_CLUT224
                /* DEC Linux logo on MIPS/MIPS64 or ALPHA */
-#ifndef CONFIG_ALPHA
-               if (mips_machgroup == MACH_GROUP_DEC)
-#endif
-                       logo = &logo_dec_clut224;
+               logo = &logo_dec_clut224;
 #endif
 #ifdef CONFIG_LOGO_MAC_CLUT224
                /* Macintosh Linux logo on m68k */
@@ -94,10 +91,7 @@ const struct linux_logo * __init_refok fb_find_logo(int depth)
 #endif
 #ifdef CONFIG_LOGO_SGI_CLUT224
                /* SGI Linux logo on MIPS/MIPS64 and VISWS */
-#ifndef CONFIG_X86_VISWS
-               if (mips_machgroup == MACH_GROUP_SGI)
-#endif
-                       logo = &logo_sgi_clut224;
+               logo = &logo_sgi_clut224;
 #endif
 #ifdef CONFIG_LOGO_SUN_CLUT224
                /* Sun Linux logo */
index 42f5d76a87771134d421feafd84895abf4084ccb..8d81ef019c6c6f8de6a5eeb6013b061de650a649 100644 (file)
@@ -510,7 +510,9 @@ int fb_find_mode(struct fb_var_screeninfo *var,
        default_bpp = 8;
 
     /* Did the user specify a video mode? */
-    if (mode_option || (mode_option = fb_mode_option)) {
+    if (!mode_option)
+       mode_option = fb_mode_option;
+    if (mode_option) {
        const char *name = mode_option;
        unsigned int namelen = strlen(name);
        int res_specified = 0, bpp_specified = 0, refresh_specified = 0;
index e682940a97a4183b40cbe0c61c18f27317cff6f0..4d8ad9cd0e19701c0b8c15135ac08610680f107d 100644 (file)
@@ -225,7 +225,7 @@ static void blizzard_restart_sdram(void)
        while (!(blizzard_read_reg(BLIZZARD_MEM_BANK0_STATUS) & 0x01)) {
                if (time_after(jiffies, tmo)) {
                        dev_err(blizzard.fbdev->dev,
-                                       "s1d1374x: SDRAM not ready");
+                                       "s1d1374x: SDRAM not ready\n");
                        break;
                }
                msleep(1);
index f4c23434de6f6a5508cbf1c3bec83e1ed1c5314f..ab32ceb061781fdb1a2c155991ec1b879dc53133 100644 (file)
@@ -880,19 +880,19 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *dev)
 static int get_dss_clocks(void)
 {
        if (IS_ERR((dispc.dss_ick = clk_get(dispc.fbdev->dev, "dss_ick")))) {
-               dev_err(dispc.fbdev->dev, "can't get dss_ick");
+               dev_err(dispc.fbdev->dev, "can't get dss_ick\n");
                return PTR_ERR(dispc.dss_ick);
        }
 
        if (IS_ERR((dispc.dss1_fck = clk_get(dispc.fbdev->dev, "dss1_fck")))) {
-               dev_err(dispc.fbdev->dev, "can't get dss1_fck");
+               dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
                clk_put(dispc.dss_ick);
                return PTR_ERR(dispc.dss1_fck);
        }
 
        if (IS_ERR((dispc.dss_54m_fck =
                                clk_get(dispc.fbdev->dev, "dss_54m_fck")))) {
-               dev_err(dispc.fbdev->dev, "can't get dss_54m_fck");
+               dev_err(dispc.fbdev->dev, "can't get dss_54m_fck\n");
                clk_put(dispc.dss_ick);
                clk_put(dispc.dss1_fck);
                return PTR_ERR(dispc.dss_54m_fck);
index dc48e02f215c4b2fad5944589f319aaac6521254..1e642b7a20fed1d7d63958c2a6a410de9040915a 100644 (file)
@@ -508,7 +508,7 @@ int hwa742_update_window_async(struct fb_info *fbi,
        if (unlikely(win->format &
            ~(0x03 | OMAPFB_FORMAT_FLAG_DOUBLE |
            OMAPFB_FORMAT_FLAG_TEARSYNC | OMAPFB_FORMAT_FLAG_FORCE_VSYNC))) {
-               dev_dbg(hwa742.fbdev->dev, "invalid window flag");
+               dev_dbg(hwa742.fbdev->dev, "invalid window flag\n");
                r = -EINVAL;
                goto out;
        }
index 2b4269813b222e66c55d2eec09cb4caaa3d77952..789cfd23c36b1477734b59f9e5accdcead17e6fd 100644 (file)
@@ -84,12 +84,12 @@ static inline u32 rfbi_read_reg(int idx)
 static int rfbi_get_clocks(void)
 {
        if (IS_ERR((rfbi.dss_ick = clk_get(rfbi.fbdev->dev, "dss_ick")))) {
-               dev_err(rfbi.fbdev->dev, "can't get dss_ick");
+               dev_err(rfbi.fbdev->dev, "can't get dss_ick\n");
                return PTR_ERR(rfbi.dss_ick);
        }
 
        if (IS_ERR((rfbi.dss1_fck = clk_get(rfbi.fbdev->dev, "dss1_fck")))) {
-               dev_err(rfbi.fbdev->dev, "can't get dss1_fck");
+               dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
                clk_put(rfbi.dss_ick);
                return PTR_ERR(rfbi.dss1_fck);
        }
index 4b696641ce33a94d7ba3ae36fc86b45114f0e690..5747997f8d7db5c2130c5b8e648330f9daf6084b 100644 (file)
@@ -307,7 +307,7 @@ static void ds1wm_search(void *data, u8 search_type,
                rom_id |= (unsigned long long) r << (i * 4);
 
        }
-       dev_dbg(&ds1wm_data->pdev->dev, "found 0x%08llX", rom_id);
+       dev_dbg(&ds1wm_data->pdev->dev, "found 0x%08llX\n", rom_id);
 
        ds1wm_write_register(ds1wm_data, DS1WM_CMD, ~DS1WM_CMD_SRA);
        ds1wm_reset(ds1wm_data);
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
new file mode 100644 (file)
index 0000000..37bddc1
--- /dev/null
@@ -0,0 +1,853 @@
+#
+# Watchdog device configuration
+#
+
+menuconfig WATCHDOG
+       bool "Watchdog Timer Support"
+       ---help---
+         If you say Y here (and to one of the following options) and create a
+         character special file /dev/watchdog with major number 10 and minor
+         number 130 using mknod ("man mknod"), you will get a watchdog, i.e.:
+         subsequently opening the file and then failing to write to it for
+         longer than 1 minute will result in rebooting the machine. This
+         could be useful for a networked machine that needs to come back
+         on-line as fast as possible after a lock-up. There's both a watchdog
+         implementation entirely in software (which can sometimes fail to
+         reboot the machine) and a driver for hardware watchdog boards, which
+         are more robust and can also keep track of the temperature inside
+         your computer. For details, read <file:Documentation/watchdog/watchdog.txt>
+         in the kernel source.
+
+         The watchdog is usually used together with the watchdog daemon
+         which is available from
+         <ftp://ibiblio.org/pub/Linux/system/daemons/watchdog/>. This daemon can
+         also monitor NFS connections and can reboot the machine when the process
+         table is full.
+
+         If unsure, say N.
+
+if WATCHDOG
+
+config WATCHDOG_NOWAYOUT
+       bool "Disable watchdog shutdown on close"
+       help
+         The default watchdog behaviour (which you get if you say N here) is
+         to stop the timer if the process managing it closes the file
+         /dev/watchdog. It's always remotely possible that this process might
+         get killed. If you say Y here, the watchdog cannot be stopped once
+         it has been started.
+
+#
+# General Watchdog drivers
+#
+
+comment "Watchdog Device Drivers"
+
+# Architecture Independent
+
+config SOFT_WATCHDOG
+       tristate "Software watchdog"
+       help
+         A software monitoring watchdog. This will fail to reboot your system
+         from some situations that the hardware watchdog will recover
+         from. Equally it's a lot cheaper to install.
+
+         To compile this driver as a module, choose M here: the
+         module will be called softdog.
+
+# ALPHA Architecture
+
+# ARM Architecture
+
+config AT91RM9200_WATCHDOG
+       tristate "AT91RM9200 watchdog"
+       depends on ARCH_AT91RM9200
+       help
+         Watchdog timer embedded into AT91RM9200 chips. This will reboot your
+         system when the timeout is reached.
+
+config 21285_WATCHDOG
+       tristate "DC21285 watchdog"
+       depends on FOOTBRIDGE
+       help
+         The Intel Footbridge chip contains a built-in watchdog circuit. Say Y
+         here if you wish to use this. Alternatively say M to compile the
+         driver as a module, which will be called wdt285.
+
+         This driver does not work on all machines. In particular, early CATS
+         boards have hardware problems that will cause the machine to simply
+         lock up if the watchdog fires.
+
+         "If in doubt, leave it out" - say N.
+
+config 977_WATCHDOG
+       tristate "NetWinder WB83C977 watchdog"
+       depends on FOOTBRIDGE && ARCH_NETWINDER
+       help
+         Say Y here to include support for the WB977 watchdog included in
+         NetWinder machines. Alternatively say M to compile the driver as
+         a module, which will be called wdt977.
+
+         Not sure? It's safe to say N.
+
+config IXP2000_WATCHDOG
+       tristate "IXP2000 Watchdog"
+       depends on ARCH_IXP2000
+       help
+         Say Y here if to include support for the watchdog timer
+         in the Intel IXP2000(2400, 2800, 2850) network processors.
+         This driver can be built as a module by choosing M. The module
+         will be called ixp2000_wdt.
+
+         Say N if you are unsure.
+
+config IXP4XX_WATCHDOG
+       tristate "IXP4xx Watchdog"
+       depends on ARCH_IXP4XX
+       help
+         Say Y here if to include support for the watchdog timer
+         in the Intel IXP4xx network processors. This driver can
+         be built as a module by choosing M. The module will
+         be called ixp4xx_wdt.
+
+         Note: The internal IXP4xx watchdog does a soft CPU reset
+         which doesn't reset any peripherals. There are circumstances
+         where the watchdog will fail to reset the board correctly
+         (e.g., if the boot ROM is in an unreadable state).
+
+         Say N if you are unsure.
+
+config KS8695_WATCHDOG
+       tristate "KS8695 watchdog"
+       depends on ARCH_KS8695
+       help
+         Watchdog timer embedded into KS8695 processor. This will reboot your
+         system when the timeout is reached.
+
+config S3C2410_WATCHDOG
+       tristate "S3C2410 Watchdog"
+       depends on ARCH_S3C2410
+       help
+         Watchdog timer block in the Samsung S3C2410 chips. This will
+         reboot the system when the timer expires with the watchdog
+         enabled.
+
+         The driver is limited by the speed of the system's PCLK
+         signal, so with reasonably fast systems (PCLK around 50-66MHz)
+         then watchdog intervals of over approximately 20seconds are
+         unavailable.
+
+         The driver can be built as a module by choosing M, and will
+         be called s3c2410_wdt
+
+config SA1100_WATCHDOG
+       tristate "SA1100/PXA2xx watchdog"
+       depends on ARCH_SA1100 || ARCH_PXA
+       help
+         Watchdog timer embedded into SA11x0 and PXA2xx chips. This will
+         reboot your system when timeout is reached.
+
+         NOTE: once enabled, this timer cannot be disabled.
+
+         To compile this driver as a module, choose M here: the
+         module will be called sa1100_wdt.
+
+config MPCORE_WATCHDOG
+       tristate "MPcore watchdog"
+       depends on ARM_MPCORE_PLATFORM && LOCAL_TIMERS
+       help
+         Watchdog timer embedded into the MPcore system.
+
+         To compile this driver as a module, choose M here: the
+         module will be called mpcore_wdt.
+
+config EP93XX_WATCHDOG
+       tristate "EP93xx Watchdog"
+       depends on ARCH_EP93XX
+       help
+         Say Y here if to include support for the watchdog timer
+         embedded in the Cirrus Logic EP93xx family of devices.
+
+         To compile this driver as a module, choose M here: the
+         module will be called ep93xx_wdt.
+
+config OMAP_WATCHDOG
+       tristate "OMAP Watchdog"
+       depends on ARCH_OMAP16XX || ARCH_OMAP24XX
+       help
+         Support for TI OMAP1610/OMAP1710/OMAP2420 watchdog.  Say 'Y' here to
+         enable the OMAP1610/OMAP1710 watchdog timer.
+
+config PNX4008_WATCHDOG
+       tristate "PNX4008 Watchdog"
+       depends on ARCH_PNX4008
+       help
+         Say Y here if to include support for the watchdog timer
+         in the PNX4008 processor.
+         This driver can be built as a module by choosing M. The module
+         will be called pnx4008_wdt.
+
+         Say N if you are unsure.
+
+config IOP_WATCHDOG
+       tristate "IOP Watchdog"
+       depends on PLAT_IOP
+       select WATCHDOG_NOWAYOUT if (ARCH_IOP32X || ARCH_IOP33X)
+       help
+         Say Y here if to include support for the watchdog timer
+         in the Intel IOP3XX & IOP13XX I/O Processors.  This driver can
+         be built as a module by choosing M. The module will
+         be called iop_wdt.
+
+         Note: The IOP13XX watchdog does an Internal Bus Reset which will
+         affect both cores and the peripherals of the IOP.  The ATU-X
+         and/or ATUe configuration registers will remain intact, but if
+         operating as an Root Complex and/or Central Resource, the PCI-X
+         and/or PCIe busses will also be reset.  THIS IS A VERY BIG HAMMER.
+
+config DAVINCI_WATCHDOG
+       tristate "DaVinci watchdog"
+       depends on ARCH_DAVINCI
+       help
+         Say Y here if to include support for the watchdog timer
+         in the DaVinci DM644x/DM646x processors.
+         To compile this driver as a module, choose M here: the
+         module will be called davinci_wdt.
+
+         NOTE: once enabled, this timer cannot be disabled.
+         Say N if you are unsure.
+
+# ARM26 Architecture
+
+# AVR32 Architecture
+
+config AT32AP700X_WDT
+       tristate "AT32AP700x watchdog"
+       depends on CPU_AT32AP7000
+       help
+         Watchdog timer embedded into AT32AP700x devices. This will reboot
+         your system when the timeout is reached.
+
+# BLACKFIN Architecture
+
+config BFIN_WDT
+       tristate "Blackfin On-Chip Watchdog Timer"
+       depends on BLACKFIN
+       ---help---
+         If you say yes here you will get support for the Blackfin On-Chip
+         Watchdog Timer. If you have one of these processors and wish to
+         have watchdog support enabled, say Y, otherwise say N.
+
+         To compile this driver as a module, choose M here: the
+         module will be called bfin_wdt.
+
+# CRIS Architecture
+
+# FRV Architecture
+
+# H8300 Architecture
+
+# X86 (i386 + ia64 + x86_64) Architecture
+
+config ACQUIRE_WDT
+       tristate "Acquire SBC Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on Single Board
+         Computers produced by Acquire Inc (and others). This watchdog
+         simply watches your kernel to make sure it doesn't freeze, and if
+         it does, it reboots your computer after a certain amount of time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called acquirewdt.
+
+         Most people will say N.
+
+config ADVANTECH_WDT
+       tristate "Advantech SBC Watchdog Timer"
+       depends on X86
+       help
+         If you are configuring a Linux kernel for the Advantech single-board
+         computer, say `Y' here to support its built-in watchdog timer
+         feature. More information can be found at
+         <http://www.advantech.com.tw/products/>
+
+config ALIM1535_WDT
+       tristate "ALi M1535 PMU Watchdog Timer"
+       depends on X86 && PCI
+       ---help---
+         This is the driver for the hardware watchdog on the ALi M1535 PMU.
+
+         To compile this driver as a module, choose M here: the
+         module will be called alim1535_wdt.
+
+         Most people will say N.
+
+config ALIM7101_WDT
+       tristate "ALi M7101 PMU Computer Watchdog"
+       depends on X86 && PCI
+       help
+         This is the driver for the hardware watchdog on the ALi M7101 PMU
+         as used in the x86 Cobalt servers.
+
+         To compile this driver as a module, choose M here: the
+         module will be called alim7101_wdt.
+
+         Most people will say N.
+
+config SC520_WDT
+       tristate "AMD Elan SC520 processor Watchdog"
+       depends on X86
+       help
+         This is the driver for the hardware watchdog built in to the
+         AMD "Elan" SC520 microcomputer commonly used in embedded systems.
+         This watchdog simply watches your kernel to make sure it doesn't
+         freeze, and if it does, it reboots your computer after a certain
+         amount of time.
+
+         You can compile this driver directly into the kernel, or use
+         it as a module.  The module will be called sc520_wdt.
+
+config EUROTECH_WDT
+       tristate "Eurotech CPU-1220/1410 Watchdog Timer"
+       depends on X86
+       help
+         Enable support for the watchdog timer on the Eurotech CPU-1220 and
+         CPU-1410 cards.  These are PC/104 SBCs. Spec sheets and product
+         information are at <http://www.eurotech.it/>.
+
+config IB700_WDT
+       tristate "IB700 SBC Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on the IB700 Single
+         Board Computer produced by TMC Technology (www.tmc-uk.com). This watchdog
+         simply watches your kernel to make sure it doesn't freeze, and if
+         it does, it reboots your computer after a certain amount of time.
+
+         This driver is like the WDT501 driver but for slightly different hardware.
+
+         To compile this driver as a module, choose M here: the
+         module will be called ib700wdt.
+
+         Most people will say N.
+
+config IBMASR
+       tristate "IBM Automatic Server Restart"
+       depends on X86
+       help
+         This is the driver for the IBM Automatic Server Restart watchdog
+         timer built-in into some eServer xSeries machines.
+
+         To compile this driver as a module, choose M here: the
+         module will be called ibmasr.
+
+config WAFER_WDT
+       tristate "ICP Wafer 5823 Single Board Computer Watchdog"
+       depends on X86
+       help
+         This is a driver for the hardware watchdog on the ICP Wafer 5823
+         Single Board Computer (and probably other similar models).
+
+         To compile this driver as a module, choose M here: the
+         module will be called wafer5823wdt.
+
+config I6300ESB_WDT
+       tristate "Intel 6300ESB Timer/Watchdog"
+       depends on X86 && PCI
+       ---help---
+         Hardware driver for the watchdog timer built into the Intel
+         6300ESB controller hub.
+
+         To compile this driver as a module, choose M here: the
+         module will be called i6300esb.
+
+config ITCO_WDT
+       tristate "Intel TCO Timer/Watchdog"
+       depends on (X86 || IA64) && PCI
+       ---help---
+         Hardware driver for the intel TCO timer based watchdog devices.
+         These drivers are included in the Intel 82801 I/O Controller
+         Hub family (from ICH0 up to ICH8) and in the Intel 6300ESB
+         controller hub.
+
+         The TCO (Total Cost of Ownership) timer is a watchdog timer
+         that will reboot the machine after its second expiration. The
+         expiration time can be configured with the "heartbeat" parameter.
+
+         On some motherboards the driver may fail to reset the chipset's
+         NO_REBOOT flag which prevents the watchdog from rebooting the
+         machine. If this is the case you will get a kernel message like
+         "failed to reset NO_REBOOT flag, reboot disabled by hardware".
+
+         To compile this driver as a module, choose M here: the
+         module will be called iTCO_wdt.
+
+config ITCO_VENDOR_SUPPORT
+       bool "Intel TCO Timer/Watchdog Specific Vendor Support"
+       depends on ITCO_WDT
+       ---help---
+         Add vendor specific support to the intel TCO timer based watchdog
+         devices. At this moment we only have additional support for some
+         SuperMicro Inc. motherboards.
+
+config SC1200_WDT
+       tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog"
+       depends on X86
+       help
+         This is a driver for National Semiconductor PC87307/PC97307 hardware
+         watchdog cards as found on the SC1200. This watchdog is mainly used
+         for power management purposes and can be used to power down the device
+         during inactivity periods (includes interrupt activity monitoring).
+
+         To compile this driver as a module, choose M here: the
+         module will be called sc1200wdt.
+
+         Most people will say N.
+
+config SCx200_WDT
+       tristate "National Semiconductor SCx200 Watchdog"
+       depends on SCx200 && PCI
+       help
+         Enable the built-in watchdog timer support on the National
+         Semiconductor SCx200 processors.
+
+         If compiled as a module, it will be called scx200_wdt.
+
+config PC87413_WDT
+       tristate "NS PC87413 watchdog"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on the PC87413 chipset
+         This watchdog simply watches your kernel to make sure it doesn't
+         freeze, and if it does, it reboots your computer after a certain
+         amount of time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called pc87413_wdt.
+
+         Most people will say N.
+config 60XX_WDT
+       tristate "SBC-60XX Watchdog Timer"
+       depends on X86
+       help
+         This driver can be used with the watchdog timer found on some
+         single board computers, namely the 6010 PII based computer.
+         It may well work with other cards.  It reads port 0x443 to enable
+         and re-set the watchdog timer, and reads port 0x45 to disable
+         the watchdog.  If you have a card that behave in similar ways,
+         you can probably make this driver work with your card as well.
+
+         You can compile this driver directly into the kernel, or use
+         it as a module.  The module will be called sbc60xxwdt.
+
+config SBC8360_WDT
+       tristate "SBC8360 Watchdog Timer"
+       depends on X86
+       ---help---
+
+         This is the driver for the hardware watchdog on the SBC8360 Single
+         Board Computer produced by Axiomtek Co., Ltd. (www.axiomtek.com).
+
+         To compile this driver as a module, choose M here: the
+         module will be called sbc8360.ko.
+
+         Most people will say N.
+
+config CPU5_WDT
+       tristate "SMA CPU5 Watchdog"
+       depends on X86
+       ---help---
+         TBD.
+         To compile this driver as a module, choose M here: the
+         module will be called cpu5wdt.
+
+config SMSC37B787_WDT
+       tristate "Winbond SMsC37B787 Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog component on the
+         Winbond SMsC37B787 chipset as used on the NetRunner Mainboard
+         from Vision Systems and maybe others.
+
+         This watchdog simply watches your kernel to make sure it doesn't
+         freeze, and if it does, it reboots your computer after a certain
+         amount of time.
+
+         Usually a userspace daemon will notify the kernel WDT driver that
+         userspace is still alive, at regular intervals.
+
+         To compile this driver as a module, choose M here: the
+         module will be called smsc37b787_wdt.
+
+         Most people will say N.
+
+config W83627HF_WDT
+       tristate "W83627HF Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on the W83627HF chipset
+         as used in Advantech PC-9578 and Tyan S2721-533 motherboards
+         (and likely others).  This watchdog simply watches your kernel to
+         make sure it doesn't freeze, and if it does, it reboots your computer
+         after a certain amount of time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called w83627hf_wdt.
+
+         Most people will say N.
+
+config W83697HF_WDT
+       tristate "W83697HF/W83697HG Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on the W83697HF/HG
+         chipset as used in Dedibox/VIA motherboards (and likely others).
+         This watchdog simply watches your kernel to make sure it doesn't
+         freeze, and if it does, it reboots your computer after a certain
+         amount of time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called w83697hf_wdt.
+
+         Most people will say N.
+
+config W83877F_WDT
+       tristate "W83877F (EMACS) Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on the W83877F chipset
+         as used in EMACS PC-104 motherboards (and likely others).  This
+         watchdog simply watches your kernel to make sure it doesn't freeze,
+         and if it does, it reboots your computer after a certain amount of
+         time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called w83877f_wdt.
+
+         Most people will say N.
+
+config W83977F_WDT
+       tristate "W83977F (PCM-5335) Watchdog Timer"
+       depends on X86
+       ---help---
+         This is the driver for the hardware watchdog on the W83977F I/O chip
+         as used in AAEON's PCM-5335 SBC (and likely others).  This
+         watchdog simply watches your kernel to make sure it doesn't freeze,
+         and if it does, it reboots your computer after a certain amount of
+         time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called w83977f_wdt.
+
+config MACHZ_WDT
+       tristate "ZF MachZ Watchdog"
+       depends on X86
+       ---help---
+         If you are using a ZF Micro MachZ processor, say Y here, otherwise
+         N.  This is the driver for the watchdog timer built-in on that
+         processor using ZF-Logic interface.  This watchdog simply watches
+         your kernel to make sure it doesn't freeze, and if it does, it
+         reboots your computer after a certain amount of time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called machzwd.
+
+config SBC_EPX_C3_WATCHDOG
+       tristate "Winsystems SBC EPX-C3 watchdog"
+       depends on X86
+       ---help---
+         This is the driver for the built-in watchdog timer on the EPX-C3
+         Single-board computer made by Winsystems, Inc.
+
+         *Note*: This hardware watchdog is not probeable and thus there
+         is no way to know if writing to its IO address will corrupt
+         your system or have any real effect.  The only way to be sure
+         that this driver does what you want is to make sure you
+         are running it on an EPX-C3 from Winsystems with the watchdog
+         timer at IO address 0x1ee and 0x1ef.  It will write to both those
+         IO ports.  Basically, the assumption is made that if you compile
+         this driver into your kernel and/or load it as a module, that you
+         know what you are doing and that you are in fact running on an
+         EPX-C3 board!
+
+         To compile this driver as a module, choose M here: the
+         module will be called sbc_epx_c3.
+
+# M32R Architecture
+
+# M68K Architecture
+
+# M68KNOMMU Architecture
+
+# MIPS Architecture
+
+config INDYDOG
+       tristate "Indy/I2 Hardware Watchdog"
+       depends on SGI_IP22
+       help
+         Hardware driver for the Indy's/I2's watchdog. This is a
+         watchdog timer that will reboot the machine after a 60 second
+         timer expired and no process has written to /dev/watchdog during
+         that time.
+
+config WDT_MTX1
+       tristate "MTX-1 Hardware Watchdog"
+       depends on MIPS_MTX1
+       help
+         Hardware driver for the MTX-1 boards. This is a watchdog timer that
+         will reboot the machine after a 100 seconds timer expired.
+
+config WDT_RM9K_GPI
+       tristate "RM9000/GPI hardware watchdog"
+       depends on CPU_RM9000
+       help
+         Watchdog implementation using the GPI hardware found on
+         PMC-Sierra RM9xxx CPUs.
+
+         To compile this driver as a module, choose M here: the
+         module will be called rm9k_wdt.
+
+# PARISC Architecture
+
+# POWERPC Architecture
+
+config MPC5200_WDT
+       tristate "MPC5200 Watchdog Timer"
+       depends on PPC_MPC52xx
+
+config 8xx_WDT
+       tristate "MPC8xx Watchdog Timer"
+       depends on 8xx
+
+config 83xx_WDT
+       tristate "MPC83xx Watchdog Timer"
+       depends on PPC_83xx
+
+config MV64X60_WDT
+       tristate "MV64X60 (Marvell Discovery) Watchdog Timer"
+       depends on MV64X60
+
+config BOOKE_WDT
+       bool "PowerPC Book-E Watchdog Timer"
+       depends on BOOKE || 4xx
+       ---help---
+         Please see Documentation/watchdog/watchdog-api.txt for
+         more information.
+
+# PPC64 Architecture
+
+config WATCHDOG_RTAS
+       tristate "RTAS watchdog"
+       depends on PPC_RTAS
+       help
+         This driver adds watchdog support for the RTAS watchdog.
+
+         To compile this driver as a module, choose M here. The module
+         will be called wdrtas.
+
+# S390 Architecture
+
+config ZVM_WATCHDOG
+       tristate "z/VM Watchdog Timer"
+       depends on S390
+       help
+         IBM s/390 and zSeries machines running under z/VM 5.1 or later
+         provide a virtual watchdog timer to their guest that cause a
+         user define Control Program command to be executed after a
+         timeout.
+
+         To compile this driver as a module, choose M here. The module
+         will be called vmwatchdog.
+
+# SUPERH (sh + sh64) Architecture
+
+config SH_WDT
+       tristate "SuperH Watchdog"
+       depends on SUPERH && (CPU_SH3 || CPU_SH4)
+       help
+         This driver adds watchdog support for the integrated watchdog in the
+         SuperH processors. If you have one of these processors and wish
+         to have watchdog support enabled, say Y, otherwise say N.
+
+         As a side note, saying Y here will automatically boost HZ to 1000
+         so that the timer has a chance to clear the overflow counter. On
+         slower systems (such as the SH-2 and SH-3) this will likely yield
+         some performance issues. As such, the WDT should be avoided here
+         unless it is absolutely necessary.
+
+         To compile this driver as a module, choose M here: the
+         module will be called shwdt.
+
+config SH_WDT_MMAP
+       bool "Allow mmap of SH WDT"
+       default n
+       depends on SH_WDT
+       help
+         If you say Y here, user applications will be able to mmap the
+         WDT/CPG registers.
+
+# SPARC Architecture
+
+# SPARC64 Architecture
+
+config WATCHDOG_CP1XXX
+       tristate "CP1XXX Hardware Watchdog support"
+       depends on SPARC64 && PCI
+       ---help---
+         This is the driver for the hardware watchdog timers present on
+         Sun Microsystems CompactPCI models CP1400 and CP1500.
+
+         To compile this driver as a module, choose M here: the
+         module will be called cpwatchdog.
+
+         If you do not have a CompactPCI model CP1400 or CP1500, or
+         another UltraSPARC-IIi-cEngine boardset with hardware watchdog,
+         you should say N to this option.
+
+config WATCHDOG_RIO
+       tristate "RIO Hardware Watchdog support"
+       depends on SPARC64 && PCI
+       help
+         Say Y here to support the hardware watchdog capability on Sun RIO
+         machines.  The watchdog timeout period is normally one minute but
+         can be changed with a boot-time parameter.
+
+# V850 Architecture
+
+# XTENSA Architecture
+
+#
+# ISA-based Watchdog Cards
+#
+
+comment "ISA-based Watchdog Cards"
+       depends on ISA
+
+config PCWATCHDOG
+       tristate "Berkshire Products ISA-PC Watchdog"
+       depends on ISA
+       ---help---
+         This is the driver for the Berkshire Products ISA-PC Watchdog card.
+         This card simply watches your kernel to make sure it doesn't freeze,
+         and if it does, it reboots your computer after a certain amount of
+         time. This driver is like the WDT501 driver but for different
+         hardware. Please read <file:Documentation/watchdog/pcwd-watchdog.txt>. The PC
+         watchdog cards can be ordered from <http://www.berkprod.com/>.
+
+         To compile this driver as a module, choose M here: the
+         module will be called pcwd.
+
+         Most people will say N.
+
+config MIXCOMWD
+       tristate "Mixcom Watchdog"
+       depends on ISA
+       ---help---
+         This is a driver for the Mixcom hardware watchdog cards.  This
+         watchdog simply watches your kernel to make sure it doesn't freeze,
+         and if it does, it reboots your computer after a certain amount of
+         time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called mixcomwd.
+
+         Most people will say N.
+
+config WDT
+       tristate "WDT Watchdog timer"
+       depends on ISA
+       ---help---
+         If you have a WDT500P or WDT501P watchdog board, say Y here,
+         otherwise N. It is not possible to probe for this board, which means
+         that you have to inform the kernel about the IO port and IRQ that
+         is needed (you can do this via the io and irq parameters)
+
+         To compile this driver as a module, choose M here: the
+         module will be called wdt.
+
+config WDT_501
+       bool "WDT501 features"
+       depends on WDT
+       help
+         Saying Y here and creating a character special file /dev/temperature
+         with major number 10 and minor number 131 ("man mknod") will give
+         you a thermometer inside your computer: reading from
+         /dev/temperature yields one byte, the temperature in degrees
+         Fahrenheit. This works only if you have a WDT501P watchdog board
+         installed.
+
+         If you want to enable the Fan Tachometer on the WDT501P, then you
+         can do this via the tachometer parameter. Only do this if you have a
+         fan tachometer actually set up.
+
+#
+# PCI-based Watchdog Cards
+#
+
+comment "PCI-based Watchdog Cards"
+       depends on PCI
+
+config PCIPCWATCHDOG
+       tristate "Berkshire Products PCI-PC Watchdog"
+       depends on PCI
+       ---help---
+         This is the driver for the Berkshire Products PCI-PC Watchdog card.
+         This card simply watches your kernel to make sure it doesn't freeze,
+         and if it does, it reboots your computer after a certain amount of
+         time. The card can also monitor the internal temperature of the PC.
+         More info is available at <http://www.berkprod.com/pci_pc_watchdog.htm>.
+
+         To compile this driver as a module, choose M here: the
+         module will be called pcwd_pci.
+
+         Most people will say N.
+
+config WDTPCI
+       tristate "PCI-WDT500/501 Watchdog timer"
+       depends on PCI
+       ---help---
+         If you have a PCI-WDT500/501 watchdog board, say Y here, otherwise N.
+
+         To compile this driver as a module, choose M here: the
+         module will be called wdt_pci.
+
+config WDT_501_PCI
+       bool "PCI-WDT501 features"
+       depends on WDTPCI
+       help
+         Saying Y here and creating a character special file /dev/temperature
+         with major number 10 and minor number 131 ("man mknod") will give
+         you a thermometer inside your computer: reading from
+         /dev/temperature yields one byte, the temperature in degrees
+         Fahrenheit. This works only if you have a PCI-WDT501 watchdog board
+         installed.
+
+         If you want to enable the Fan Tachometer on the PCI-WDT501, then you
+         can do this via the tachometer parameter. Only do this if you have a
+         fan tachometer actually set up.
+
+#
+# USB-based Watchdog Cards
+#
+
+comment "USB-based Watchdog Cards"
+       depends on USB
+
+config USBPCWATCHDOG
+       tristate "Berkshire Products USB-PC Watchdog"
+       depends on USB
+       ---help---
+         This is the driver for the Berkshire Products USB-PC Watchdog card.
+         This card simply watches your kernel to make sure it doesn't freeze,
+         and if it does, it reboots your computer after a certain amount of
+         time. The card can also monitor the internal temperature of the PC.
+         More info is available at <http://www.berkprod.com/usb_pc_watchdog.htm>.
+
+         To compile this driver as a module, choose M here: the
+         module will be called pcwd_usb.
+
+         Most people will say N.
+
+endif # WATCHDOG
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
new file mode 100644 (file)
index 0000000..389f8b1
--- /dev/null
@@ -0,0 +1,120 @@
+#
+# Makefile for the WatchDog device drivers.
+#
+
+# Only one watchdog can succeed. We probe the ISA/PCI/USB based
+# watchdog-cards first, then the architecture specific watchdog
+# drivers and then the architecture independant "softdog" driver.
+# This means that if your ISA/PCI/USB card isn't detected that
+# you can fall back to an architecture specific driver and if
+# that also fails then you can fall back to the software watchdog
+# to give you some cover.
+
+# ISA-based Watchdog Cards
+obj-$(CONFIG_PCWATCHDOG) += pcwd.o
+obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
+obj-$(CONFIG_WDT) += wdt.o
+
+# PCI-based Watchdog Cards
+obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o
+obj-$(CONFIG_WDTPCI) += wdt_pci.o
+
+# USB-based Watchdog Cards
+obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
+
+# ALPHA Architecture
+
+# ARM Architecture
+obj-$(CONFIG_AT91RM9200_WATCHDOG) += at91rm9200_wdt.o
+obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
+obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
+obj-$(CONFIG_977_WATCHDOG) += wdt977.o
+obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
+obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
+obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
+obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
+obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
+obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
+obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
+obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
+obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
+obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
+
+# ARM26 Architecture
+
+# AVR32 Architecture
+obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
+
+# BLACKFIN Architecture
+obj-$(CONFIG_BFIN_WDT) += bfin_wdt.o
+
+# CRIS Architecture
+
+# FRV Architecture
+
+# H8300 Architecture
+
+# X86 (i386 + ia64 + x86_64) Architecture
+obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
+obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
+obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o
+obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
+obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
+obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
+obj-$(CONFIG_IB700_WDT) += ib700wdt.o
+obj-$(CONFIG_IBMASR) += ibmasr.o
+obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
+obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o
+obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o iTCO_vendor_support.o
+obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
+obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
+obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
+obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
+obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
+obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
+obj-$(CONFIG_SMSC37B787_WDT) += smsc37b787_wdt.o
+obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o
+obj-$(CONFIG_W83697HF_WDT) += w83697hf_wdt.o
+obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
+obj-$(CONFIG_W83977F_WDT) += w83977f_wdt.o
+obj-$(CONFIG_MACHZ_WDT) += machzwd.o
+obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
+
+# M32R Architecture
+
+# M68K Architecture
+
+# M68KNOMMU Architecture
+
+# MIPS Architecture
+obj-$(CONFIG_INDYDOG) += indydog.o
+obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
+obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
+
+# PARISC Architecture
+
+# POWERPC Architecture
+obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
+obj-$(CONFIG_83xx_WDT) += mpc83xx_wdt.o
+obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
+obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o
+
+# PPC64 Architecture
+obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o
+
+# S390 Architecture
+
+# SUPERH (sh + sh64) Architecture
+obj-$(CONFIG_SH_WDT) += shwdt.o
+
+# SPARC Architecture
+
+# SPARC64 Architecture
+
+# V850 Architecture
+
+# XTENSA Architecture
+
+# Architecture Independant
+obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c
new file mode 100644 (file)
index 0000000..85269c3
--- /dev/null
@@ -0,0 +1,348 @@
+/*
+ *     Acquire Single Board Computer Watchdog Timer driver
+ *
+ *      Based on wdt.c. Original copyright messages:
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ *
+ *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *          Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *          Can't add timeout - driver doesn't allow changing value
+ */
+
+/*
+ *     Theory of Operation:
+ *             The Watch-Dog Timer is provided to ensure that standalone
+ *             Systems can always recover from catastrophic conditions that
+ *             caused the CPU to crash. This condition may have occured by
+ *             external EMI or a software bug. When the CPU stops working
+ *             correctly, hardware on the board will either perform a hardware
+ *             reset (cold boot) or a non-maskable interrupt (NMI) to bring the
+ *             system back to a known state.
+ *
+ *             The Watch-Dog Timer is controlled by two I/O Ports.
+ *               443 hex       - Read  - Enable or refresh the Watch-Dog Timer
+ *               043 hex       - Read  - Disable the Watch-Dog Timer
+ *
+ *             To enable the Watch-Dog Timer, a read from I/O port 443h must
+ *             be performed. This will enable and activate the countdown timer
+ *             which will eventually time out and either reset the CPU or cause
+ *             an NMI depending on the setting of a jumper. To ensure that this
+ *             reset condition does not occur, the Watch-Dog Timer must be
+ *             periodically refreshed by reading the same I/O port 443h.
+ *             The Watch-Dog Timer is disabled by reading I/O port 043h.
+ *
+ *             The Watch-Dog Timer Time-Out Period is set via jumpers.
+ *             It can be 1, 2, 10, 20, 110 or 220 seconds.
+ */
+
+/*
+ *     Includes, defines, variables, module parameters, ...
+ */
+
+/* Includes */
+#include <linux/module.h>              /* For module specific items */
+#include <linux/moduleparam.h>         /* For new moduleparam's */
+#include <linux/types.h>               /* For standard types (like size_t) */
+#include <linux/errno.h>               /* For the -ENODEV/... values */
+#include <linux/kernel.h>              /* For printk/panic/... */
+#include <linux/miscdevice.h>          /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
+#include <linux/watchdog.h>            /* For the watchdog specific items */
+#include <linux/fs.h>                  /* For file operations */
+#include <linux/ioport.h>              /* For io-port access */
+#include <linux/platform_device.h>     /* For platform_driver framework */
+#include <linux/init.h>                        /* For __init/__exit/... */
+
+#include <asm/uaccess.h>               /* For copy_to_user/put_user/... */
+#include <asm/io.h>                    /* For inb/outb/... */
+
+/* Module information */
+#define DRV_NAME "acquirewdt"
+#define PFX DRV_NAME ": "
+#define WATCHDOG_NAME "Acquire WDT"
+#define WATCHDOG_HEARTBEAT 0   /* There is no way to see what the correct time-out period is */
+
+/* internal variables */
+static struct platform_device *acq_platform_device;    /* the watchdog platform device */
+static unsigned long acq_is_open;
+static char expect_close;
+
+/* module parameters */
+static int wdt_stop = 0x43;    /* You must set this - there is no sane way to probe for this board. */
+module_param(wdt_stop, int, 0);
+MODULE_PARM_DESC(wdt_stop, "Acquire WDT 'stop' io port (default 0x43)");
+
+static int wdt_start = 0x443;  /* You must set this - there is no sane way to probe for this board. */
+module_param(wdt_start, int, 0);
+MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Watchdog Operations
+ */
+
+static void acq_keepalive(void)
+{
+       /* Write a watchdog value */
+       inb_p(wdt_start);
+}
+
+static void acq_stop(void)
+{
+       /* Turn the card off */
+       inb_p(wdt_stop);
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if(count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+
+               /* Well, anyhow someone wrote to us, we should return that favour */
+               acq_keepalive();
+       }
+       return count;
+}
+
+static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       int options, retval = -EINVAL;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident =
+       {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = WATCHDOG_NAME,
+       };
+
+       switch(cmd)
+       {
+       case WDIOC_GETSUPPORT:
+         return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+         return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+         acq_keepalive();
+         return 0;
+
+       case WDIOC_GETTIMEOUT:
+         return put_user(WATCHDOG_HEARTBEAT, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+           if (get_user(options, p))
+             return -EFAULT;
+
+           if (options & WDIOS_DISABLECARD)
+           {
+             acq_stop();
+             retval = 0;
+           }
+
+           if (options & WDIOS_ENABLECARD)
+           {
+             acq_keepalive();
+             retval = 0;
+           }
+
+           return retval;
+       }
+
+       default:
+         return -ENOTTY;
+       }
+}
+
+static int acq_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &acq_is_open))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Activate */
+       acq_keepalive();
+       return nonseekable_open(inode, file);
+}
+
+static int acq_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               acq_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               acq_keepalive();
+       }
+       clear_bit(0, &acq_is_open);
+       expect_close = 0;
+       return 0;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations acq_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = acq_write,
+       .ioctl          = acq_ioctl,
+       .open           = acq_open,
+       .release        = acq_close,
+};
+
+static struct miscdevice acq_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &acq_fops,
+};
+
+/*
+ *     Init & exit routines
+ */
+
+static int __devinit acq_probe(struct platform_device *dev)
+{
+       int ret;
+
+       if (wdt_stop != wdt_start) {
+               if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
+                       printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                               wdt_stop);
+                       ret = -EIO;
+                       goto out;
+               }
+       }
+
+       if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
+               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       wdt_start);
+               ret = -EIO;
+               goto unreg_stop;
+       }
+
+       ret = misc_register(&acq_miscdev);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto unreg_regions;
+       }
+
+       printk (KERN_INFO PFX "initialized. (nowayout=%d)\n",
+               nowayout);
+
+       return 0;
+
+unreg_regions:
+       release_region(wdt_start, 1);
+unreg_stop:
+       if (wdt_stop != wdt_start)
+               release_region(wdt_stop, 1);
+out:
+       return ret;
+}
+
+static int __devexit acq_remove(struct platform_device *dev)
+{
+       misc_deregister(&acq_miscdev);
+       release_region(wdt_start,1);
+       if(wdt_stop != wdt_start)
+               release_region(wdt_stop,1);
+
+       return 0;
+}
+
+static void acq_shutdown(struct platform_device *dev)
+{
+       /* Turn the WDT off if we have a soft shutdown */
+       acq_stop();
+}
+
+static struct platform_driver acquirewdt_driver = {
+       .probe          = acq_probe,
+       .remove         = __devexit_p(acq_remove),
+       .shutdown       = acq_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = DRV_NAME,
+       },
+};
+
+static int __init acq_init(void)
+{
+       int err;
+
+       printk(KERN_INFO "WDT driver for Acquire single board computer initialising.\n");
+
+       err = platform_driver_register(&acquirewdt_driver);
+       if (err)
+               return err;
+
+       acq_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
+       if (IS_ERR(acq_platform_device)) {
+               err = PTR_ERR(acq_platform_device);
+               goto unreg_platform_driver;
+       }
+
+       return 0;
+
+unreg_platform_driver:
+       platform_driver_unregister(&acquirewdt_driver);
+       return err;
+}
+
+static void __exit acq_exit(void)
+{
+       platform_device_unregister(acq_platform_device);
+       platform_driver_unregister(&acquirewdt_driver);
+       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
+}
+
+module_init(acq_init);
+module_exit(acq_exit);
+
+MODULE_AUTHOR("David Woodhouse");
+MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c
new file mode 100644 (file)
index 0000000..8121cc2
--- /dev/null
@@ -0,0 +1,362 @@
+/*
+ *     Advantech Single Board Computer WDT driver
+ *
+ *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
+ *
+ *     Based on acquirewdt.c which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ *
+ *     14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *         Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *
+ *     16-Oct-2002 Rob Radez <rob@osinvestor.com>
+ *         Clean up ioctls, clean up init + exit, add expect close support,
+ *         add wdt_start and wdt_stop as parameters.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/platform_device.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define DRV_NAME "advantechwdt"
+#define PFX DRV_NAME ": "
+#define WATCHDOG_NAME "Advantech WDT"
+#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
+
+static struct platform_device *advwdt_platform_device; /* the watchdog platform device */
+static unsigned long advwdt_is_open;
+static char adv_expect_close;
+
+/*
+ *     You must set these - there is no sane way to probe for this board.
+ *
+ *     To enable or restart, write the timeout value in seconds (1 to 63)
+ *     to I/O port wdt_start.  To disable, read I/O port wdt_stop.
+ *     Both are 0x443 for most boards (tested on a PCA-6276VE-00B1), but
+ *     check your manual (at least the PCA-6159 seems to be different -
+ *     the manual says wdt_stop is 0x43, not 0x443).
+ *     (0x43 is also a write-only control register for the 8254 timer!)
+ */
+
+static int wdt_stop = 0x443;
+module_param(wdt_stop, int, 0);
+MODULE_PARM_DESC(wdt_stop, "Advantech WDT 'stop' io port (default 0x443)");
+
+static int wdt_start = 0x443;
+module_param(wdt_start, int, 0);
+MODULE_PARM_DESC(wdt_start, "Advantech WDT 'start' io port (default 0x443)");
+
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Watchdog Operations
+ */
+
+static void
+advwdt_ping(void)
+{
+       /* Write a watchdog value */
+       outb_p(timeout, wdt_start);
+}
+
+static void
+advwdt_disable(void)
+{
+       inb_p(wdt_stop);
+}
+
+static int
+advwdt_set_heartbeat(int t)
+{
+       if ((t < 1) || (t > 63))
+               return -EINVAL;
+
+       timeout = t;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static ssize_t
+advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       adv_expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       adv_expect_close = 42;
+                       }
+               }
+               advwdt_ping();
+       }
+       return count;
+}
+
+static int
+advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+         unsigned long arg)
+{
+       int new_timeout;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = WATCHDOG_NAME,
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+         if (copy_to_user(argp, &ident, sizeof(ident)))
+           return -EFAULT;
+         break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+         return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+         advwdt_ping();
+         break;
+
+       case WDIOC_SETTIMEOUT:
+         if (get_user(new_timeout, p))
+                 return -EFAULT;
+         if (advwdt_set_heartbeat(new_timeout))
+                 return -EINVAL;
+         advwdt_ping();
+         /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+         return put_user(timeout, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+         int options, retval = -EINVAL;
+
+         if (get_user(options, p))
+           return -EFAULT;
+
+         if (options & WDIOS_DISABLECARD) {
+           advwdt_disable();
+           retval = 0;
+         }
+
+         if (options & WDIOS_ENABLECARD) {
+           advwdt_ping();
+           retval = 0;
+         }
+
+         return retval;
+       }
+
+       default:
+         return -ENOTTY;
+       }
+       return 0;
+}
+
+static int
+advwdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &advwdt_is_open))
+               return -EBUSY;
+       /*
+        *      Activate
+        */
+
+       advwdt_ping();
+       return nonseekable_open(inode, file);
+}
+
+static int
+advwdt_close(struct inode *inode, struct file *file)
+{
+       if (adv_expect_close == 42) {
+               advwdt_disable();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               advwdt_ping();
+       }
+       clear_bit(0, &advwdt_is_open);
+       adv_expect_close = 0;
+       return 0;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations advwdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = advwdt_write,
+       .ioctl          = advwdt_ioctl,
+       .open           = advwdt_open,
+       .release        = advwdt_close,
+};
+
+static struct miscdevice advwdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &advwdt_fops,
+};
+
+/*
+ *     Init & exit routines
+ */
+
+static int __devinit
+advwdt_probe(struct platform_device *dev)
+{
+       int ret;
+
+       if (wdt_stop != wdt_start) {
+               if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) {
+                       printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                               wdt_stop);
+                       ret = -EIO;
+                       goto out;
+               }
+       }
+
+       if (!request_region(wdt_start, 1, WATCHDOG_NAME)) {
+               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       wdt_start);
+               ret = -EIO;
+               goto unreg_stop;
+       }
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (advwdt_set_heartbeat(timeout)) {
+               advwdt_set_heartbeat(WATCHDOG_TIMEOUT);
+               printk (KERN_INFO PFX "timeout value must be 1<=x<=63, using %d\n",
+                       timeout);
+       }
+
+       ret = misc_register(&advwdt_miscdev);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto unreg_regions;
+       }
+
+       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+out:
+       return ret;
+unreg_regions:
+       release_region(wdt_start, 1);
+unreg_stop:
+       if (wdt_stop != wdt_start)
+               release_region(wdt_stop, 1);
+       goto out;
+}
+
+static int __devexit
+advwdt_remove(struct platform_device *dev)
+{
+       misc_deregister(&advwdt_miscdev);
+       release_region(wdt_start,1);
+       if(wdt_stop != wdt_start)
+               release_region(wdt_stop,1);
+
+       return 0;
+}
+
+static void
+advwdt_shutdown(struct platform_device *dev)
+{
+       /* Turn the WDT off if we have a soft shutdown */
+       advwdt_disable();
+}
+
+static struct platform_driver advwdt_driver = {
+       .probe          = advwdt_probe,
+       .remove         = __devexit_p(advwdt_remove),
+       .shutdown       = advwdt_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = DRV_NAME,
+       },
+};
+
+static int __init
+advwdt_init(void)
+{
+       int err;
+
+       printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n");
+
+       err = platform_driver_register(&advwdt_driver);
+       if (err)
+               return err;
+
+       advwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
+       if (IS_ERR(advwdt_platform_device)) {
+               err = PTR_ERR(advwdt_platform_device);
+               goto unreg_platform_driver;
+       }
+
+       return 0;
+
+unreg_platform_driver:
+       platform_driver_unregister(&advwdt_driver);
+       return err;
+}
+
+static void __exit
+advwdt_exit(void)
+{
+       platform_device_unregister(advwdt_platform_device);
+       platform_driver_unregister(&advwdt_driver);
+       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
+}
+
+module_init(advwdt_init);
+module_exit(advwdt_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Marek Michalkiewicz <marekm@linux.org.pl>");
+MODULE_DESCRIPTION("Advantech Single Board Computer WDT driver");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c
new file mode 100644 (file)
index 0000000..c404fc6
--- /dev/null
@@ -0,0 +1,465 @@
+/*
+ *     Watchdog for the 7101 PMU version found in the ALi M1535 chipsets
+ *
+ *     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.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/pci.h>
+
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define WATCHDOG_NAME "ALi_M1535"
+#define PFX WATCHDOG_NAME ": "
+#define WATCHDOG_TIMEOUT 60    /* 60 sec default timeout */
+
+/* internal variables */
+static unsigned long ali_is_open;
+static char ali_expect_release;
+static struct pci_dev *ali_pci;
+static u32 ali_timeout_bits;   /* stores the computed timeout */
+static spinlock_t ali_lock;    /* Guards the hardware */
+
+/* module parameters */
+static int timeout = WATCHDOG_TIMEOUT;
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     ali_start       -       start watchdog countdown
+ *
+ *     Starts the timer running providing the timer has a counter
+ *     configuration set.
+ */
+
+static void ali_start(void)
+{
+       u32 val;
+
+       spin_lock(&ali_lock);
+
+       pci_read_config_dword(ali_pci, 0xCC, &val);
+       val &= ~0x3F;   /* Mask count */
+       val |= (1<<25) | ali_timeout_bits;
+       pci_write_config_dword(ali_pci, 0xCC, val);
+
+       spin_unlock(&ali_lock);
+}
+
+/*
+ *     ali_stop        -       stop the timer countdown
+ *
+ *     Stop the ALi watchdog countdown
+ */
+
+static void ali_stop(void)
+{
+       u32 val;
+
+       spin_lock(&ali_lock);
+
+       pci_read_config_dword(ali_pci, 0xCC, &val);
+       val &= ~0x3F;   /* Mask count to zero (disabled) */
+       val &= ~(1<<25);/* and for safety mask the reset enable */
+       pci_write_config_dword(ali_pci, 0xCC, val);
+
+       spin_unlock(&ali_lock);
+}
+
+/*
+ *     ali_keepalive   -       send a keepalive to the watchdog
+ *
+ *      Send a keepalive to the timer (actually we restart the timer).
+ */
+
+static void ali_keepalive(void)
+{
+       ali_start();
+}
+
+/*
+ *     ali_settimer    -       compute the timer reload value
+ *     @t: time in seconds
+ *
+ *     Computes the timeout values needed
+ */
+
+static int ali_settimer(int t)
+{
+       if(t < 0)
+               return -EINVAL;
+       else if(t < 60)
+               ali_timeout_bits = t|(1<<6);
+       else if(t < 3600)
+               ali_timeout_bits = (t/60)|(1<<7);
+       else if(t < 18000)
+               ali_timeout_bits = (t/300)|(1<<6)|(1<<7);
+       else return -EINVAL;
+
+       timeout = t;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+/*
+ *     ali_write       -       writes to ALi watchdog
+ *     @file: file from VFS
+ *     @data: user address of data
+ *     @len: length of data
+ *     @ppos: pointer to the file offset
+ *
+ *     Handle a write to the ALi watchdog. Writing to the file pings
+ *     the watchdog and resets it. Writing the magic 'V' sequence allows
+ *     the next close to turn off the watchdog.
+ */
+
+static ssize_t ali_write(struct file *file, const char __user *data,
+                             size_t len, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       ali_expect_release = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if(get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       ali_expect_release = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               ali_start();
+       }
+       return len;
+}
+
+/*
+ *     ali_ioctl       -       handle watchdog ioctls
+ *     @inode: VFS inode
+ *     @file: VFS file pointer
+ *     @cmd: ioctl number
+ *     @arg: arguments to the ioctl
+ *
+ *     Handle the watchdog ioctls supported by the ALi driver. Really
+ *     we want an extension to enable irq ack monitoring and the like
+ */
+
+static int ali_ioctl(struct inode *inode, struct file *file,
+                         unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_KEEPALIVEPING |
+                                       WDIOF_SETTIMEOUT |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     0,
+               .identity =             "ALi M1535 WatchDog Timer",
+       };
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident,
+                               sizeof (ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_KEEPALIVE:
+                       ali_keepalive();
+                       return 0;
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if (get_user (new_options, p))
+                               return -EFAULT;
+
+                       if (new_options & WDIOS_DISABLECARD) {
+                               ali_stop();
+                               retval = 0;
+                       }
+
+                       if (new_options & WDIOS_ENABLECARD) {
+                               ali_start();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_timeout;
+
+                       if (get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       if (ali_settimer(new_timeout))
+                           return -EINVAL;
+
+                       ali_keepalive();
+                       /* Fall */
+               }
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout, p);
+
+               default:
+                       return -ENOTTY;
+       }
+}
+
+/*
+ *     ali_open        -       handle open of ali watchdog
+ *     @inode: inode from VFS
+ *     @file: file from VFS
+ *
+ *     Open the ALi watchdog device. Ensure only one person opens it
+ *     at a time. Also start the watchdog running.
+ */
+
+static int ali_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+       if (test_and_set_bit(0, &ali_is_open))
+               return -EBUSY;
+
+       /* Activate */
+       ali_start();
+       return nonseekable_open(inode, file);
+}
+
+/*
+ *     ali_release     -       close an ALi watchdog
+ *     @inode: inode from VFS
+ *     @file: file from VFS
+ *
+ *     Close the ALi watchdog device. Actual shutdown of the timer
+ *     only occurs if the magic sequence has been set.
+ */
+
+static int ali_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        */
+       if (ali_expect_release == 42) {
+               ali_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               ali_keepalive();
+       }
+       clear_bit(0, &ali_is_open);
+       ali_expect_release = 0;
+       return 0;
+}
+
+/*
+ *     ali_notify_sys  -       System down notifier
+ *
+ *     Notifier for system down
+ */
+
+
+static int ali_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code==SYS_DOWN || code==SYS_HALT) {
+               /* Turn the WDT off */
+               ali_stop();
+       }
+
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Data for PCI driver interface
+ *
+ *     This data only exists for exporting the supported
+ *     PCI ids via MODULE_DEVICE_TABLE.  We do not actually
+ *     register a pci_driver, because someone else might one day
+ *     want to register another driver on the same PCI id.
+ */
+
+static struct pci_device_id ali_pci_tbl[] = {
+       { PCI_VENDOR_ID_AL, 0x1533, PCI_ANY_ID, PCI_ANY_ID,},
+       { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,},
+       { 0, },
+};
+MODULE_DEVICE_TABLE(pci, ali_pci_tbl);
+
+/*
+ *     ali_find_watchdog       -       find a 1535 and 7101
+ *
+ *     Scans the PCI hardware for a 1535 series bridge and matching 7101
+ *     watchdog device. This may be overtight but it is better to be safe
+ */
+
+static int __init ali_find_watchdog(void)
+{
+       struct pci_dev *pdev;
+       u32 wdog;
+
+       /* Check for a 1533/1535 series bridge */
+       pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
+       if (pdev == NULL)
+               pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1533, NULL);
+       if (pdev == NULL)
+               return -ENODEV;
+       pci_dev_put(pdev);
+
+       /* Check for the a 7101 PMU */
+       pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
+       if(pdev == NULL)
+               return -ENODEV;
+
+       if(pci_enable_device(pdev)) {
+               pci_dev_put(pdev);
+               return -EIO;
+       }
+
+       ali_pci = pdev;
+
+       /*
+        *      Initialize the timer bits
+        */
+       pci_read_config_dword(pdev, 0xCC, &wdog);
+
+       wdog &= ~0x3F;          /* Timer bits */
+       wdog &= ~((1<<27)|(1<<26)|(1<<25)|(1<<24));     /* Issued events */
+       wdog &= ~((1<<16)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9));      /* No monitor bits */
+
+       pci_write_config_dword(pdev, 0xCC, wdog);
+
+       return 0;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations ali_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .write =        ali_write,
+       .ioctl =        ali_ioctl,
+       .open =         ali_open,
+       .release =      ali_release,
+};
+
+static struct miscdevice ali_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &ali_fops,
+};
+
+static struct notifier_block ali_notifier = {
+       .notifier_call =        ali_notify_sys,
+};
+
+/*
+ *     watchdog_init   -       module initialiser
+ *
+ *     Scan for a suitable watchdog and if so initialize it. Return an error
+ *     if we cannot, the error causes the module to unload
+ */
+
+static int __init watchdog_init(void)
+{
+       int ret;
+
+       spin_lock_init(&ali_lock);
+
+       /* Check whether or not the hardware watchdog is there */
+       if (ali_find_watchdog() != 0) {
+               return -ENODEV;
+       }
+
+       /* Check that the timeout value is within it's range ; if not reset to the default */
+       if (timeout < 1 || timeout >= 18000) {
+               timeout = WATCHDOG_TIMEOUT;
+               printk(KERN_INFO PFX "timeout value must be 0<timeout<18000, using %d\n",
+                       timeout);
+       }
+
+       /* Calculate the watchdog's timeout */
+       ali_settimer(timeout);
+
+       ret = misc_register(&ali_miscdev);
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto out;
+       }
+
+       ret = register_reboot_notifier(&ali_notifier);
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               goto unreg_miscdev;
+       }
+
+       printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+out:
+       return ret;
+unreg_miscdev:
+       misc_deregister(&ali_miscdev);
+       goto out;
+}
+
+/*
+ *     watchdog_exit   -       module de-initialiser
+ *
+ *     Called while unloading a successfully installed watchdog module.
+ */
+
+static void __exit watchdog_exit(void)
+{
+       /* Stop the timer before we leave */
+       ali_stop();
+
+       /* Deregister */
+       unregister_reboot_notifier(&ali_notifier);
+       misc_deregister(&ali_miscdev);
+       pci_dev_put(ali_pci);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_exit);
+
+MODULE_AUTHOR("Alan Cox");
+MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
new file mode 100644 (file)
index 0000000..67aed9f
--- /dev/null
@@ -0,0 +1,423 @@
+/*
+ *     ALi M7101 PMU Computer Watchdog Timer driver
+ *
+ *     Based on w83877f_wdt.c by Scott Jennings <linuxdrivers@oro.net>
+ *     and the Cobalt kernel WDT timer driver by Tim Hockin
+ *                                           <thockin@cobaltnet.com>
+ *
+ *     (c)2002 Steve Hill <steve@navaho.co.uk>
+ *
+ *  This WDT driver is different from most other Linux WDT
+ *  drivers in that the driver will ping the watchdog by itself,
+ *  because this particular WDT has a very short timeout (1.6
+ *  seconds) and it would be insane to count on any userspace
+ *  daemon always getting scheduled within that time frame.
+ *
+ *  Additions:
+ *   Aug 23, 2004 - Added use_gpio module parameter for use on revision a1d PMUs
+ *                  found on very old cobalt hardware.
+ *                  -- Mike Waychison <michael.waychison@sun.com>
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define OUR_NAME "alim7101_wdt"
+#define PFX OUR_NAME ": "
+
+#define WDT_ENABLE 0x9C
+#define WDT_DISABLE 0x8C
+
+#define ALI_7101_WDT    0x92
+#define ALI_7101_GPIO   0x7D
+#define ALI_7101_GPIO_O 0x7E
+#define ALI_WDT_ARM     0x01
+
+/*
+ * We're going to use a 1 second timeout.
+ * If we reset the watchdog every ~250ms we should be safe.  */
+
+#define WDT_INTERVAL (HZ/4+1)
+
+/*
+ * We must not require too good response from the userspace daemon.
+ * Here we require the userspace daemon to send us a heartbeat
+ * char to /dev/watchdog every 30 seconds.
+ */
+
+#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+static int use_gpio = 0; /* Use the pic (for a1d revision alim7101) */
+module_param(use_gpio, int, 0);
+MODULE_PARM_DESC(use_gpio, "Use the gpio watchdog.  (required by old cobalt boards)");
+
+static void wdt_timer_ping(unsigned long);
+static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
+static unsigned long next_heartbeat;
+static unsigned long wdt_is_open;
+static char wdt_expect_close;
+static struct pci_dev *alim7101_pmu;
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+                __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Whack the dog
+ */
+
+static void wdt_timer_ping(unsigned long data)
+{
+       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
+        * we agree to ping the WDT
+        */
+       char    tmp;
+
+       if(time_before(jiffies, next_heartbeat))
+       {
+               /* Ping the WDT (this is actually a disarm/arm sequence) */
+               pci_read_config_byte(alim7101_pmu, 0x92, &tmp);
+               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp & ~ALI_WDT_ARM));
+               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp | ALI_WDT_ARM));
+               if (use_gpio) {
+                       pci_read_config_byte(alim7101_pmu, ALI_7101_GPIO_O, &tmp);
+                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp
+                                       | 0x20);
+                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp
+                                       & ~0x20);
+               }
+       } else {
+               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
+       }
+       /* Re-set the timer interval */
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+}
+
+/*
+ * Utility routines
+ */
+
+static void wdt_change(int writeval)
+{
+       char    tmp;
+
+       pci_read_config_byte(alim7101_pmu, ALI_7101_WDT, &tmp);
+       if (writeval == WDT_ENABLE) {
+               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp | ALI_WDT_ARM));
+               if (use_gpio) {
+                       pci_read_config_byte(alim7101_pmu, ALI_7101_GPIO_O, &tmp);
+                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp & ~0x20);
+               }
+
+       } else {
+               pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, (tmp & ~ALI_WDT_ARM));
+               if (use_gpio) {
+                       pci_read_config_byte(alim7101_pmu, ALI_7101_GPIO_O, &tmp);
+                       pci_write_config_byte(alim7101_pmu, ALI_7101_GPIO_O, tmp | 0x20);
+               }
+       }
+}
+
+static void wdt_startup(void)
+{
+       next_heartbeat = jiffies + (timeout * HZ);
+
+       /* We must enable before we kick off the timer in case the timer
+          occurs as we ping it */
+
+       wdt_change(WDT_ENABLE);
+
+       /* Start the timer */
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+
+       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
+}
+
+static void wdt_turnoff(void)
+{
+       /* Stop the timer */
+       del_timer_sync(&timer);
+       wdt_change(WDT_DISABLE);
+       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
+}
+
+static void wdt_keepalive(void)
+{
+       /* user land ping */
+       next_heartbeat = jiffies + (timeout * HZ);
+}
+
+/*
+ * /dev/watchdog handling
+ */
+
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if(count) {
+               if (!nowayout) {
+                       size_t ofs;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       wdt_expect_close = 0;
+
+                       /* now scan */
+                       for (ofs = 0; ofs != count; ofs++) {
+                               char c;
+                               if (get_user(c, buf+ofs))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       wdt_expect_close = 42;
+                       }
+               }
+               /* someone wrote to us, we should restart timer */
+               wdt_keepalive();
+       }
+       return count;
+}
+
+static int fop_open(struct inode * inode, struct file * file)
+{
+       /* Just in case we're already talking to someone... */
+       if(test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+       /* Good, fire up the show */
+       wdt_startup();
+       return nonseekable_open(inode, file);
+}
+
+static int fop_close(struct inode * inode, struct file * file)
+{
+       if(wdt_expect_close == 42)
+               wdt_turnoff();
+       else {
+               /* wim: shouldn't there be a: del_timer(&timer); */
+               printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
+       }
+       clear_bit(0, &wdt_is_open);
+       wdt_expect_close = 0;
+       return 0;
+}
+
+static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident =
+       {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "ALiM7101",
+       };
+
+       switch(cmd)
+       {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       wdt_keepalive();
+                       return 0;
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if(get_user(new_options, p))
+                               return -EFAULT;
+
+                       if(new_options & WDIOS_DISABLECARD) {
+                               wdt_turnoff();
+                               retval = 0;
+                       }
+
+                       if(new_options & WDIOS_ENABLECARD) {
+                               wdt_startup();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_timeout;
+
+                       if(get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       wdt_keepalive();
+                       /* Fall through */
+               }
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout, p);
+               default:
+                       return -ENOTTY;
+       }
+}
+
+static const struct file_operations wdt_fops = {
+       .owner=         THIS_MODULE,
+       .llseek=        no_llseek,
+       .write=         fop_write,
+       .open=          fop_open,
+       .release=       fop_close,
+       .ioctl=         fop_ioctl,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor=WATCHDOG_MINOR,
+       .name="watchdog",
+       .fops=&wdt_fops,
+};
+
+/*
+ *     Notifier for system down
+ */
+
+static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code==SYS_DOWN || code==SYS_HALT)
+               wdt_turnoff();
+
+       if (code==SYS_RESTART) {
+               /*
+                * Cobalt devices have no way of rebooting themselves other than
+                * getting the watchdog to pull reset, so we restart the watchdog on
+                * reboot with no heartbeat
+                */
+               wdt_change(WDT_ENABLE);
+               printk(KERN_INFO PFX "Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n");
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier=
+{
+       .notifier_call = wdt_notify_sys,
+};
+
+static void __exit alim7101_wdt_unload(void)
+{
+       wdt_turnoff();
+       /* Deregister */
+       misc_deregister(&wdt_miscdev);
+       unregister_reboot_notifier(&wdt_notifier);
+       pci_dev_put(alim7101_pmu);
+}
+
+static int __init alim7101_wdt_init(void)
+{
+       int rc = -EBUSY;
+       struct pci_dev *ali1543_south;
+       char tmp;
+
+       printk(KERN_INFO PFX "Steve Hill <steve@navaho.co.uk>.\n");
+       alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
+               NULL);
+       if (!alim7101_pmu) {
+               printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n");
+               return -EBUSY;
+       }
+
+       /* Set the WDT in the PMU to 1 second */
+       pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, 0x02);
+
+       ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
+               NULL);
+       if (!ali1543_south) {
+               printk(KERN_INFO PFX "ALi 1543 South-Bridge not present - WDT not set\n");
+               goto err_out;
+       }
+       pci_read_config_byte(ali1543_south, 0x5e, &tmp);
+       pci_dev_put(ali1543_south);
+       if ((tmp & 0x1e) == 0x00) {
+               if (!use_gpio) {
+                       printk(KERN_INFO PFX "Detected old alim7101 revision 'a1d'.  If this is a cobalt board, set the 'use_gpio' module parameter.\n");
+                       goto err_out;
+               } 
+               nowayout = 1;
+       } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) {
+               printk(KERN_INFO PFX "ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n");
+               goto err_out;
+       }
+
+       if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
+       {
+               timeout = WATCHDOG_TIMEOUT;
+               printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
+                       timeout);
+       }
+
+       rc = misc_register(&wdt_miscdev);
+       if (rc) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       wdt_miscdev.minor, rc);
+               goto err_out;
+       }
+
+       rc = register_reboot_notifier(&wdt_notifier);
+       if (rc) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
+               goto err_out_miscdev;
+       }
+
+       if (nowayout) {
+               __module_get(THIS_MODULE);
+       }
+
+       printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+       return 0;
+
+err_out_miscdev:
+       misc_deregister(&wdt_miscdev);
+err_out:
+       pci_dev_put(alim7101_pmu);
+       return rc;
+}
+
+module_init(alim7101_wdt_init);
+module_exit(alim7101_wdt_unload);
+
+static struct pci_device_id alim7101_pci_tbl[] __devinitdata = {
+       { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
+       { }
+};
+
+MODULE_DEVICE_TABLE(pci, alim7101_pci_tbl);
+
+MODULE_AUTHOR("Steve Hill");
+MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c
new file mode 100644 (file)
index 0000000..54a5161
--- /dev/null
@@ -0,0 +1,386 @@
+/*
+ * Watchdog driver for Atmel AT32AP700X devices
+ *
+ * Copyright (C) 2005-2006 Atmel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/miscdevice.h>
+#include <linux/fs.h>
+#include <linux/platform_device.h>
+#include <linux/watchdog.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
+#include <linux/spinlock.h>
+
+#define TIMEOUT_MIN            1
+#define TIMEOUT_MAX            2
+#define TIMEOUT_DEFAULT                TIMEOUT_MAX
+
+/* module parameters */
+static int timeout =  TIMEOUT_DEFAULT;
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout,
+               "Timeout value. Limited to be 1 or 2 seconds. (default="
+               __MODULE_STRING(TIMEOUT_DEFAULT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+               __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/* Watchdog registers and write/read macro */
+#define WDT_CTRL               0x00
+#define WDT_CTRL_EN               0
+#define WDT_CTRL_PSEL             8
+#define WDT_CTRL_KEY             24
+
+#define WDT_CLR                        0x04
+
+#define WDT_BIT(name)          (1 << WDT_##name)
+#define WDT_BF(name, value)    ((value) << WDT_##name)
+
+#define wdt_readl(dev, reg)                            \
+       __raw_readl((dev)->regs + WDT_##reg)
+#define wdt_writel(dev, reg, value)                    \
+       __raw_writel((value), (dev)->regs + WDT_##reg)
+
+struct wdt_at32ap700x {
+       void __iomem            *regs;
+       spinlock_t              io_lock;
+       int                     timeout;
+       unsigned long           users;
+       struct miscdevice       miscdev;
+};
+
+static struct wdt_at32ap700x *wdt;
+static char expect_release;
+
+/*
+ * Disable the watchdog.
+ */
+static inline void at32_wdt_stop(void)
+{
+       unsigned long psel;
+
+       spin_lock(&wdt->io_lock);
+       psel = wdt_readl(wdt, CTRL) & WDT_BF(CTRL_PSEL, 0x0f);
+       wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0x55));
+       wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0xaa));
+       spin_unlock(&wdt->io_lock);
+}
+
+/*
+ * Enable and reset the watchdog.
+ */
+static inline void at32_wdt_start(void)
+{
+       /* 0xf is 2^16 divider = 2 sec, 0xe is 2^15 divider = 1 sec */
+       unsigned long psel = (wdt->timeout > 1) ? 0xf : 0xe;
+
+       spin_lock(&wdt->io_lock);
+       wdt_writel(wdt, CTRL, WDT_BIT(CTRL_EN)
+                       | WDT_BF(CTRL_PSEL, psel)
+                       | WDT_BF(CTRL_KEY, 0x55));
+       wdt_writel(wdt, CTRL, WDT_BIT(CTRL_EN)
+                       | WDT_BF(CTRL_PSEL, psel)
+                       | WDT_BF(CTRL_KEY, 0xaa));
+       spin_unlock(&wdt->io_lock);
+}
+
+/*
+ * Pat the watchdog timer.
+ */
+static inline void at32_wdt_pat(void)
+{
+       spin_lock(&wdt->io_lock);
+       wdt_writel(wdt, CLR, 0x42);
+       spin_unlock(&wdt->io_lock);
+}
+
+/*
+ * Watchdog device is opened, and watchdog starts running.
+ */
+static int at32_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(1, &wdt->users))
+               return -EBUSY;
+
+       at32_wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+/*
+ * Close the watchdog device.
+ */
+static int at32_wdt_close(struct inode *inode, struct file *file)
+{
+       if (expect_release == 42) {
+               at32_wdt_stop();
+       } else {
+               dev_dbg(wdt->miscdev.parent,
+                       "Unexpected close, not stopping watchdog!\n");
+               at32_wdt_pat();
+       }
+       clear_bit(1, &wdt->users);
+       expect_release = 0;
+       return 0;
+}
+
+/*
+ * Change the watchdog time interval.
+ */
+static int at32_wdt_settimeout(int time)
+{
+       /*
+        * All counting occurs at 1 / SLOW_CLOCK (32 kHz) and max prescaler is
+        * 2 ^ 16 allowing up to 2 seconds timeout.
+        */
+       if ((time < TIMEOUT_MIN) || (time > TIMEOUT_MAX))
+               return -EINVAL;
+
+       /*
+        * Set new watchdog time. It will be used when at32_wdt_start() is
+        * called.
+        */
+       wdt->timeout = time;
+       return 0;
+}
+
+static struct watchdog_info at32_wdt_info = {
+       .identity       = "at32ap700x watchdog",
+       .options        = WDIOF_SETTIMEOUT |
+                         WDIOF_KEEPALIVEPING |
+                         WDIOF_MAGICCLOSE,
+};
+
+/*
+ * Handle commands from user-space.
+ */
+static int at32_wdt_ioctl(struct inode *inode, struct file *file,
+               unsigned int cmd, unsigned long arg)
+{
+       int ret = -ENOTTY;
+       int time;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+
+       switch (cmd) {
+       case WDIOC_KEEPALIVE:
+               at32_wdt_pat();
+               ret = 0;
+               break;
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user(argp, &at32_wdt_info,
+                               sizeof(at32_wdt_info)) ? -EFAULT : 0;
+               break;
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(time, p);
+               if (ret)
+                       break;
+               ret = at32_wdt_settimeout(time);
+               if (ret)
+                       break;
+               /* Enable new time value */
+               at32_wdt_start();
+               /* fall through */
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(wdt->timeout, p);
+               break;
+       case WDIOC_GETSTATUS: /* fall through */
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(0, p);
+               break;
+       case WDIOC_SETOPTIONS:
+               ret = get_user(time, p);
+               if (ret)
+                       break;
+               if (time & WDIOS_DISABLECARD)
+                       at32_wdt_stop();
+               if (time & WDIOS_ENABLECARD)
+                       at32_wdt_start();
+               ret = 0;
+               break;
+       }
+
+       return ret;
+}
+
+static ssize_t at32_wdt_write(struct file *file, const char __user *data,
+                               size_t len, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /*
+                        * note: just in case someone wrote the magic
+                        * character five months ago...
+                        */
+                       expect_release = 0;
+
+                       /*
+                        * scan to see whether or not we got the magic
+                        * character
+                        */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_release = 42;
+                       }
+               }
+               /* someone wrote to us, we should pat the watchdog */
+               at32_wdt_pat();
+       }
+       return len;
+}
+
+static const struct file_operations at32_wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .ioctl          = at32_wdt_ioctl,
+       .open           = at32_wdt_open,
+       .release        = at32_wdt_close,
+       .write          = at32_wdt_write,
+};
+
+static int __init at32_wdt_probe(struct platform_device *pdev)
+{
+       struct resource *regs;
+       int ret;
+
+       if (wdt) {
+               dev_dbg(&pdev->dev, "only 1 wdt instance supported.\n");
+               return -EBUSY;
+       }
+
+       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!regs) {
+               dev_dbg(&pdev->dev, "missing mmio resource\n");
+               return -ENXIO;
+       }
+
+       wdt = kzalloc(sizeof(struct wdt_at32ap700x), GFP_KERNEL);
+       if (!wdt) {
+               dev_dbg(&pdev->dev, "no memory for wdt structure\n");
+               return -ENOMEM;
+       }
+
+       wdt->regs = ioremap(regs->start, regs->end - regs->start + 1);
+       if (!wdt->regs) {
+               ret = -ENOMEM;
+               dev_dbg(&pdev->dev, "could not map I/O memory\n");
+               goto err_free;
+       }
+       spin_lock_init(&wdt->io_lock);
+       wdt->users = 0;
+       wdt->miscdev.minor = WATCHDOG_MINOR;
+       wdt->miscdev.name = "watchdog";
+       wdt->miscdev.fops = &at32_wdt_fops;
+
+       if (at32_wdt_settimeout(timeout)) {
+               at32_wdt_settimeout(TIMEOUT_DEFAULT);
+               dev_dbg(&pdev->dev,
+                       "default timeout invalid, set to %d sec.\n",
+                       TIMEOUT_DEFAULT);
+       }
+
+       ret = misc_register(&wdt->miscdev);
+       if (ret) {
+               dev_dbg(&pdev->dev, "failed to register wdt miscdev\n");
+               goto err_iounmap;
+       }
+
+       platform_set_drvdata(pdev, wdt);
+       wdt->miscdev.parent = &pdev->dev;
+       dev_info(&pdev->dev,
+               "AT32AP700X WDT at 0x%p, timeout %d sec (nowayout=%d)\n",
+               wdt->regs, wdt->timeout, nowayout);
+
+       return 0;
+
+err_iounmap:
+       iounmap(wdt->regs);
+err_free:
+       kfree(wdt);
+       wdt = NULL;
+       return ret;
+}
+
+static int __exit at32_wdt_remove(struct platform_device *pdev)
+{
+       if (wdt && platform_get_drvdata(pdev) == wdt) {
+               /* Stop the timer before we leave */
+               if (!nowayout)
+                       at32_wdt_stop();
+
+               misc_deregister(&wdt->miscdev);
+               iounmap(wdt->regs);
+               kfree(wdt);
+               wdt = NULL;
+               platform_set_drvdata(pdev, NULL);
+       }
+
+       return 0;
+}
+
+static void at32_wdt_shutdown(struct platform_device *pdev)
+{
+       at32_wdt_stop();
+}
+
+#ifdef CONFIG_PM
+static int at32_wdt_suspend(struct platform_device *pdev, pm_message_t message)
+{
+       at32_wdt_stop();
+       return 0;
+}
+
+static int at32_wdt_resume(struct platform_device *pdev)
+{
+       if (wdt->users)
+               at32_wdt_start();
+       return 0;
+}
+#else
+#define at32_wdt_suspend NULL
+#define at32_wdt_resume NULL
+#endif
+
+static struct platform_driver at32_wdt_driver = {
+       .remove         = __exit_p(at32_wdt_remove),
+       .suspend        = at32_wdt_suspend,
+       .resume         = at32_wdt_resume,
+       .driver         = {
+               .name   = "at32_wdt",
+               .owner  = THIS_MODULE,
+       },
+       .shutdown       = at32_wdt_shutdown,
+};
+
+static int __init at32_wdt_init(void)
+{
+       return platform_driver_probe(&at32_wdt_driver, at32_wdt_probe);
+}
+module_init(at32_wdt_init);
+
+static void __exit at32_wdt_exit(void)
+{
+       platform_driver_unregister(&at32_wdt_driver);
+}
+module_exit(at32_wdt_exit);
+
+MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>");
+MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c
new file mode 100644 (file)
index 0000000..38bd373
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * Watchdog driver for Atmel AT91RM9200 (Thunder)
+ *
+ *  Copyright (C) 2003 SAN People (Pty) Ltd
+ *
+ * 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.
+ */
+
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+#include <linux/watchdog.h>
+#include <asm/bitops.h>
+#include <asm/uaccess.h>
+#include <asm/arch/at91_st.h>
+
+
+#define WDT_DEFAULT_TIME       5       /* seconds */
+#define WDT_MAX_TIME           256     /* seconds */
+
+static int wdt_time = WDT_DEFAULT_TIME;
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+module_param(wdt_time, int, 0);
+MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="__MODULE_STRING(WDT_DEFAULT_TIME) ")");
+
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+#endif
+
+
+static unsigned long at91wdt_busy;
+
+/* ......................................................................... */
+
+/*
+ * Disable the watchdog.
+ */
+static void inline at91_wdt_stop(void)
+{
+       at91_sys_write(AT91_ST_WDMR, AT91_ST_EXTEN);
+}
+
+/*
+ * Enable and reset the watchdog.
+ */
+static void inline at91_wdt_start(void)
+{
+       at91_sys_write(AT91_ST_WDMR, AT91_ST_EXTEN | AT91_ST_RSTEN | (((65536 * wdt_time) >> 8) & AT91_ST_WDV));
+       at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
+}
+
+/*
+ * Reload the watchdog timer.  (ie, pat the watchdog)
+ */
+static void inline at91_wdt_reload(void)
+{
+       at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
+}
+
+/* ......................................................................... */
+
+/*
+ * Watchdog device is opened, and watchdog starts running.
+ */
+static int at91_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &at91wdt_busy))
+               return -EBUSY;
+
+       at91_wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+/*
+ * Close the watchdog device.
+ * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
+ *  disabled.
+ */
+static int at91_wdt_close(struct inode *inode, struct file *file)
+{
+       if (!nowayout)
+               at91_wdt_stop();        /* Disable the watchdog when file is closed */
+
+       clear_bit(0, &at91wdt_busy);
+       return 0;
+}
+
+/*
+ * Change the watchdog time interval.
+ */
+static int at91_wdt_settimeout(int new_time)
+{
+       /*
+        * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
+        *
+        * Since WDV is a 16-bit counter, the maximum period is
+        * 65536 / 0.256 = 256 seconds.
+        */
+       if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
+               return -EINVAL;
+
+       /* Set new watchdog time. It will be used when at91_wdt_start() is called. */
+       wdt_time = new_time;
+       return 0;
+}
+
+static struct watchdog_info at91_wdt_info = {
+       .identity       = "at91 watchdog",
+       .options        = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+};
+
+/*
+ * Handle commands from user-space.
+ */
+static int at91_wdt_ioctl(struct inode *inode, struct file *file,
+               unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_value;
+
+       switch(cmd) {
+               case WDIOC_KEEPALIVE:
+                       at91_wdt_reload();      /* pat the watchdog */
+                       return 0;
+
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &at91_wdt_info, sizeof(at91_wdt_info)) ? -EFAULT : 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_value, p))
+                               return -EFAULT;
+
+                       if (at91_wdt_settimeout(new_value))
+                               return -EINVAL;
+
+                       /* Enable new time value */
+                       at91_wdt_start();
+
+                       /* Return current value */
+                       return put_user(wdt_time, p);
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(wdt_time, p);
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_SETOPTIONS:
+                       if (get_user(new_value, p))
+                               return -EFAULT;
+
+                       if (new_value & WDIOS_DISABLECARD)
+                               at91_wdt_stop();
+                       if (new_value & WDIOS_ENABLECARD)
+                               at91_wdt_start();
+                       return 0;
+
+               default:
+                       return -ENOTTY;
+       }
+}
+
+/*
+ * Pat the watchdog whenever device is written to.
+ */
+static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       at91_wdt_reload();              /* pat the watchdog */
+       return len;
+}
+
+/* ......................................................................... */
+
+static const struct file_operations at91wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .ioctl          = at91_wdt_ioctl,
+       .open           = at91_wdt_open,
+       .release        = at91_wdt_close,
+       .write          = at91_wdt_write,
+};
+
+static struct miscdevice at91wdt_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &at91wdt_fops,
+};
+
+static int __init at91wdt_probe(struct platform_device *pdev)
+{
+       int res;
+
+       if (at91wdt_miscdev.parent)
+               return -EBUSY;
+       at91wdt_miscdev.parent = &pdev->dev;
+
+       res = misc_register(&at91wdt_miscdev);
+       if (res)
+               return res;
+
+       printk("AT91 Watchdog Timer enabled (%d seconds%s)\n", wdt_time, nowayout ? ", nowayout" : "");
+       return 0;
+}
+
+static int __exit at91wdt_remove(struct platform_device *pdev)
+{
+       int res;
+
+       res = misc_deregister(&at91wdt_miscdev);
+       if (!res)
+               at91wdt_miscdev.parent = NULL;
+
+       return res;
+}
+
+static void at91wdt_shutdown(struct platform_device *pdev)
+{
+       at91_wdt_stop();
+}
+
+#ifdef CONFIG_PM
+
+static int at91wdt_suspend(struct platform_device *pdev, pm_message_t message)
+{
+       at91_wdt_stop();
+       return 0;
+}
+
+static int at91wdt_resume(struct platform_device *pdev)
+{
+       if (at91wdt_busy)
+               at91_wdt_start();
+               return 0;
+}
+
+#else
+#define at91wdt_suspend NULL
+#define at91wdt_resume NULL
+#endif
+
+static struct platform_driver at91wdt_driver = {
+       .probe          = at91wdt_probe,
+       .remove         = __exit_p(at91wdt_remove),
+       .shutdown       = at91wdt_shutdown,
+       .suspend        = at91wdt_suspend,
+       .resume         = at91wdt_resume,
+       .driver         = {
+               .name   = "at91_wdt",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __init at91_wdt_init(void)
+{
+       /* Check that the heartbeat value is within range; if not reset to the default */
+       if (at91_wdt_settimeout(wdt_time)) {
+               at91_wdt_settimeout(WDT_DEFAULT_TIME);
+               pr_info("at91_wdt: wdt_time value must be 1 <= wdt_time <= 256, using %d\n", wdt_time);
+       }
+
+       return platform_driver_register(&at91wdt_driver);
+}
+
+static void __exit at91_wdt_exit(void)
+{
+       platform_driver_unregister(&at91wdt_driver);
+}
+
+module_init(at91_wdt_init);
+module_exit(at91_wdt_exit);
+
+MODULE_AUTHOR("Andrew Victor");
+MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c
new file mode 100644 (file)
index 0000000..309d279
--- /dev/null
@@ -0,0 +1,490 @@
+/*
+ * Blackfin On-Chip Watchdog Driver
+ *  Supports BF53[123]/BF53[467]/BF54[2489]/BF561
+ *
+ * Originally based on softdog.c
+ * Copyright 2006-2007 Analog Devices Inc.
+ * Copyright 2006-2007 Michele d'Amico
+ * Copyright 1996 Alan Cox <alan@redhat.com>
+ *
+ * Enter bugs at http://blackfin.uclinux.org/
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/blackfin.h>
+#include <asm/uaccess.h>
+
+#define stamp(fmt, args...) pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args)
+#define stampit() stamp("here i am")
+
+#define WATCHDOG_NAME "bfin-wdt"
+#define PFX WATCHDOG_NAME ": "
+
+/* The BF561 has two watchdogs (one per core), but since Linux
+ * only runs on core A, we'll just work with that one.
+ */
+#ifdef BF561_FAMILY
+# define bfin_read_WDOG_CTL()    bfin_read_WDOGA_CTL()
+# define bfin_read_WDOG_CNT()    bfin_read_WDOGA_CNT()
+# define bfin_read_WDOG_STAT()   bfin_read_WDOGA_STAT()
+# define bfin_write_WDOG_CTL(x)  bfin_write_WDOGA_CTL(x)
+# define bfin_write_WDOG_CNT(x)  bfin_write_WDOGA_CNT(x)
+# define bfin_write_WDOG_STAT(x) bfin_write_WDOGA_STAT(x)
+#endif
+
+/* Bit in SWRST that indicates boot caused by watchdog */
+#define SWRST_RESET_WDOG 0x4000
+
+/* Bit in WDOG_CTL that indicates watchdog has expired (WDR0) */
+#define WDOG_EXPIRED 0x8000
+
+/* Masks for WDEV field in WDOG_CTL register */
+#define ICTL_RESET   0x0
+#define ICTL_NMI     0x2
+#define ICTL_GPI     0x4
+#define ICTL_NONE    0x6
+#define ICTL_MASK    0x6
+
+/* Masks for WDEN field in WDOG_CTL register */
+#define WDEN_MASK    0x0FF0
+#define WDEN_ENABLE  0x0000
+#define WDEN_DISABLE 0x0AD0
+
+/* some defaults */
+#define WATCHDOG_TIMEOUT 20
+
+static unsigned int timeout = WATCHDOG_TIMEOUT;
+static int nowayout = WATCHDOG_NOWAYOUT;
+static struct watchdog_info bfin_wdt_info;
+static unsigned long open_check;
+static char expect_close;
+static spinlock_t bfin_wdt_spinlock = SPIN_LOCK_UNLOCKED;
+
+/**
+ *     bfin_wdt_keepalive - Keep the Userspace Watchdog Alive
+ *
+ *     The Userspace watchdog got a KeepAlive: schedule the next timeout.
+ */
+static int bfin_wdt_keepalive(void)
+{
+       stampit();
+       bfin_write_WDOG_STAT(0);
+       return 0;
+}
+
+/**
+ *     bfin_wdt_stop - Stop the Watchdog
+ *
+ *     Stops the on-chip watchdog.
+ */
+static int bfin_wdt_stop(void)
+{
+       stampit();
+       bfin_write_WDOG_CTL(WDEN_DISABLE);
+       return 0;
+}
+
+/**
+ *     bfin_wdt_start - Start the Watchdog
+ *
+ *     Starts the on-chip watchdog.  Automatically loads WDOG_CNT
+ *     into WDOG_STAT for us.
+ */
+static int bfin_wdt_start(void)
+{
+       stampit();
+       bfin_write_WDOG_CTL(WDEN_ENABLE | ICTL_RESET);
+       return 0;
+}
+
+/**
+ *     bfin_wdt_running - Check Watchdog status
+ *
+ *     See if the watchdog is running.
+ */
+static int bfin_wdt_running(void)
+{
+       stampit();
+       return ((bfin_read_WDOG_CTL() & WDEN_MASK) != WDEN_DISABLE);
+}
+
+/**
+ *     bfin_wdt_set_timeout - Set the Userspace Watchdog timeout
+ *     @t: new timeout value (in seconds)
+ *
+ *     Translate the specified timeout in seconds into System Clock
+ *     terms which is what the on-chip Watchdog requires.
+ */
+static int bfin_wdt_set_timeout(unsigned long t)
+{
+       u32 cnt;
+       unsigned long flags;
+
+       stampit();
+
+       cnt = t * get_sclk();
+       if (cnt < get_sclk()) {
+               printk(KERN_WARNING PFX "timeout value is too large\n");
+               return -EINVAL;
+       }
+
+       spin_lock_irqsave(&bfin_wdt_spinlock, flags);
+       {
+               int run = bfin_wdt_running();
+               bfin_wdt_stop();
+               bfin_write_WDOG_CNT(cnt);
+               if (run) bfin_wdt_start();
+       }
+       spin_unlock_irqrestore(&bfin_wdt_spinlock, flags);
+
+       timeout = t;
+
+       return 0;
+}
+
+/**
+ *     bfin_wdt_open - Open the Device
+ *     @inode: inode of device
+ *     @file: file handle of device
+ *
+ *     Watchdog device is opened and started.
+ */
+static int bfin_wdt_open(struct inode *inode, struct file *file)
+{
+       stampit();
+
+       if (test_and_set_bit(0, &open_check))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       bfin_wdt_keepalive();
+       bfin_wdt_start();
+
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     bfin_wdt_close - Close the Device
+ *     @inode: inode of device
+ *     @file: file handle of device
+ *
+ *     Watchdog device is closed and stopped.
+ */
+static int bfin_wdt_release(struct inode *inode, struct file *file)
+{
+       stampit();
+
+       if (expect_close == 42) {
+               bfin_wdt_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               bfin_wdt_keepalive();
+       }
+
+       expect_close = 0;
+       clear_bit(0, &open_check);
+
+       return 0;
+}
+
+/**
+ *     bfin_wdt_write - Write to Device
+ *     @file: file handle of device
+ *     @buf: buffer to write
+ *     @count: length of buffer
+ *     @ppos: offset
+ *
+ *     Pings the watchdog on write.
+ */
+static ssize_t bfin_wdt_write(struct file *file, const char __user *data,
+                              size_t len, loff_t *ppos)
+{
+       stampit();
+
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               bfin_wdt_keepalive();
+       }
+
+       return len;
+}
+
+/**
+ *     bfin_wdt_ioctl - Query Device
+ *     @inode: inode of device
+ *     @file: file handle of device
+ *     @cmd: watchdog command
+ *     @arg: argument
+ *
+ *     Query basic information from the device or ping it, as outlined by the
+ *     watchdog API.
+ */
+static int bfin_wdt_ioctl(struct inode *inode, struct file *file,
+                          unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+
+       stampit();
+
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+
+               case WDIOC_GETSUPPORT:
+                       if (copy_to_user(argp, &bfin_wdt_info, sizeof(bfin_wdt_info)))
+                               return -EFAULT;
+                       else
+                               return 0;
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(!!(_bfin_swrst & SWRST_RESET_WDOG), p);
+
+               case WDIOC_KEEPALIVE:
+                       bfin_wdt_keepalive();
+                       return 0;
+
+               case WDIOC_SETTIMEOUT: {
+                       int new_timeout;
+
+                       if (get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       if (bfin_wdt_set_timeout(new_timeout))
+                               return -EINVAL;
+               }
+                       /* Fall */
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout, p);
+
+               case WDIOC_SETOPTIONS: {
+                       unsigned long flags;
+                       int options, ret = -EINVAL;
+
+                       if (get_user(options, p))
+                               return -EFAULT;
+
+                       spin_lock_irqsave(&bfin_wdt_spinlock, flags);
+
+                       if (options & WDIOS_DISABLECARD) {
+                               bfin_wdt_stop();
+                               ret = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               bfin_wdt_start();
+                               ret = 0;
+                       }
+
+                       spin_unlock_irqrestore(&bfin_wdt_spinlock, flags);
+
+                       return ret;
+               }
+       }
+}
+
+/**
+ *     bfin_wdt_notify_sys - Notifier Handler
+ *     @this: notifier block
+ *     @code: notifier event
+ *     @unused: unused
+ *
+ *     Handles specific events, such as turning off the watchdog during a
+ *     shutdown event.
+ */
+static int bfin_wdt_notify_sys(struct notifier_block *this, unsigned long code,
+                               void *unused)
+{
+       stampit();
+
+       if (code == SYS_DOWN || code == SYS_HALT)
+               bfin_wdt_stop();
+
+       return NOTIFY_DONE;
+}
+
+#ifdef CONFIG_PM
+static int state_before_suspend;
+
+/**
+ *     bfin_wdt_suspend - suspend the watchdog
+ *     @pdev: device being suspended
+ *     @state: requested suspend state
+ *
+ *     Remember if the watchdog was running and stop it.
+ *     TODO: is this even right?  Doesn't seem to be any
+ *           standard in the watchdog world ...
+ */
+static int bfin_wdt_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       stampit();
+
+       state_before_suspend = bfin_wdt_running();
+       bfin_wdt_stop();
+
+       return 0;
+}
+
+/**
+ *     bfin_wdt_resume - resume the watchdog
+ *     @pdev: device being resumed
+ *
+ *     If the watchdog was running, turn it back on.
+ */
+static int bfin_wdt_resume(struct platform_device *pdev)
+{
+       stampit();
+
+       if (state_before_suspend) {
+               bfin_wdt_set_timeout(timeout);
+               bfin_wdt_start();
+       }
+
+       return 0;
+}
+#else
+# define bfin_wdt_suspend NULL
+# define bfin_wdt_resume NULL
+#endif
+
+static struct platform_device bfin_wdt_device = {
+       .name          = WATCHDOG_NAME,
+       .id            = -1,
+};
+
+static struct platform_driver bfin_wdt_driver = {
+       .driver    = {
+               .name  = WATCHDOG_NAME,
+               .owner = THIS_MODULE,
+       },
+       .suspend   = bfin_wdt_suspend,
+       .resume    = bfin_wdt_resume,
+};
+
+static struct file_operations bfin_wdt_fops = {
+       .owner    = THIS_MODULE,
+       .llseek   = no_llseek,
+       .write    = bfin_wdt_write,
+       .ioctl    = bfin_wdt_ioctl,
+       .open     = bfin_wdt_open,
+       .release  = bfin_wdt_release,
+};
+
+static struct miscdevice bfin_wdt_miscdev = {
+       .minor    = WATCHDOG_MINOR,
+       .name     = "watchdog",
+       .fops     = &bfin_wdt_fops,
+};
+
+static struct watchdog_info bfin_wdt_info = {
+       .identity = "Blackfin Watchdog",
+       .options  = WDIOF_SETTIMEOUT |
+                   WDIOF_KEEPALIVEPING |
+                   WDIOF_MAGICCLOSE,
+};
+
+static struct notifier_block bfin_wdt_notifier = {
+       .notifier_call = bfin_wdt_notify_sys,
+};
+
+/**
+ *     bfin_wdt_init - Initialize module
+ *
+ *     Registers the device and notifier handler. Actual device
+ *     initialization is handled by bfin_wdt_open().
+ */
+static int __init bfin_wdt_init(void)
+{
+       int ret;
+
+       stampit();
+
+       /* Check that the timeout value is within range */
+       if (bfin_wdt_set_timeout(timeout))
+               return -EINVAL;
+
+       /* Since this is an on-chip device and needs no board-specific
+        * resources, we'll handle all the platform device stuff here.
+        */
+       ret = platform_device_register(&bfin_wdt_device);
+       if (ret)
+               return ret;
+
+       ret = platform_driver_probe(&bfin_wdt_driver, NULL);
+       if (ret)
+               return ret;
+
+       ret = register_reboot_notifier(&bfin_wdt_notifier);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
+               return ret;
+       }
+
+       ret = misc_register(&bfin_wdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                      WATCHDOG_MINOR, ret);
+               unregister_reboot_notifier(&bfin_wdt_notifier);
+               return ret;
+       }
+
+       printk(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n",
+              timeout, nowayout);
+
+       return 0;
+}
+
+/**
+ *     bfin_wdt_exit - Deinitialize module
+ *
+ *     Unregisters the device and notifier handler. Actual device
+ *     deinitialization is handled by bfin_wdt_close().
+ */
+static void __exit bfin_wdt_exit(void)
+{
+       misc_deregister(&bfin_wdt_miscdev);
+       unregister_reboot_notifier(&bfin_wdt_notifier);
+}
+
+module_init(bfin_wdt_init);
+module_exit(bfin_wdt_exit);
+
+MODULE_AUTHOR("Michele d'Amico, Mike Frysinger <vapier@gentoo.org>");
+MODULE_DESCRIPTION("Blackfin Watchdog Device Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+module_param(timeout, uint, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=((2^32)/SCLK), default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
new file mode 100644 (file)
index 0000000..d362f5b
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * drivers/char/watchdog/booke_wdt.c
+ *
+ * Watchdog timer for PowerPC Book-E systems
+ *
+ * Author: Matthew McClintock
+ * Maintainer: Kumar Gala <galak@kernel.crashing.org>
+ *
+ * Copyright 2005 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/notifier.h>
+#include <linux/watchdog.h>
+
+#include <asm/reg_booke.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+/* If the kernel parameter wdt=1, the watchdog will be enabled at boot.
+ * Also, the wdt_period sets the watchdog timer period timeout.
+ * For E500 cpus the wdt_period sets which bit changing from 0->1 will
+ * trigger a watchog timeout. This watchdog timeout will occur 3 times, the
+ * first time nothing will happen, the second time a watchdog exception will
+ * occur, and the final time the board will reset.
+ */
+
+#ifdef CONFIG_FSL_BOOKE
+#define WDT_PERIOD_DEFAULT 63  /* Ex. wdt_period=28 bus=333Mhz , reset=~40sec */
+#else
+#define WDT_PERIOD_DEFAULT 3   /* Refer to the PPC40x and PPC4xx manuals */
+#endif                         /* for timing information */
+
+u32 booke_wdt_enabled = 0;
+u32 booke_wdt_period = WDT_PERIOD_DEFAULT;
+
+#ifdef CONFIG_FSL_BOOKE
+#define WDTP(x)                ((((63-x)&0x3)<<30)|(((63-x)&0x3c)<<15))
+#else
+#define WDTP(x)                (TCR_WP(x))
+#endif
+
+/*
+ * booke_wdt_ping:
+ */
+static __inline__ void booke_wdt_ping(void)
+{
+       mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
+}
+
+/*
+ * booke_wdt_enable:
+ */
+static __inline__ void booke_wdt_enable(void)
+{
+       u32 val;
+
+       /* clear status before enabling watchdog */
+       booke_wdt_ping();
+       val = mfspr(SPRN_TCR);
+       val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
+
+       mtspr(SPRN_TCR, val);
+}
+
+/*
+ * booke_wdt_write:
+ */
+static ssize_t booke_wdt_write (struct file *file, const char __user *buf,
+                               size_t count, loff_t *ppos)
+{
+       booke_wdt_ping();
+       return count;
+}
+
+static struct watchdog_info ident = {
+  .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+  .firmware_version = 0,
+  .identity = "PowerPC Book-E Watchdog",
+};
+
+/*
+ * booke_wdt_ioctl:
+ */
+static int booke_wdt_ioctl (struct inode *inode, struct file *file,
+                           unsigned int cmd, unsigned long arg)
+{
+       u32 tmp = 0;
+       u32 __user *p = (u32 __user *)arg;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user ((struct watchdog_info __user *) arg, &ident,
+                               sizeof(struct watchdog_info)))
+                       return -EFAULT;
+       case WDIOC_GETSTATUS:
+               return put_user(ident.options, p);
+       case WDIOC_GETBOOTSTATUS:
+               /* XXX: something is clearing TSR */
+               tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
+               /* returns 1 if last reset was caused by the WDT */
+               return (tmp ? 1 : 0);
+       case WDIOC_KEEPALIVE:
+               booke_wdt_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(booke_wdt_period, p))
+                       return -EFAULT;
+               mtspr(SPRN_TCR, (mfspr(SPRN_TCR)&~WDTP(0))|WDTP(booke_wdt_period));
+               return 0;
+       case WDIOC_GETTIMEOUT:
+               return put_user(booke_wdt_period, p);
+       case WDIOC_SETOPTIONS:
+               if (get_user(tmp, p))
+                       return -EINVAL;
+               if (tmp == WDIOS_ENABLECARD) {
+                       booke_wdt_ping();
+                       break;
+               } else
+                       return -EINVAL;
+               return 0;
+       default:
+               return -ENOTTY;
+       }
+
+       return 0;
+}
+/*
+ * booke_wdt_open:
+ */
+static int booke_wdt_open (struct inode *inode, struct file *file)
+{
+       if (booke_wdt_enabled == 0) {
+               booke_wdt_enabled = 1;
+               booke_wdt_enable();
+               printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
+                               booke_wdt_period);
+       }
+
+       return nonseekable_open(inode, file);
+}
+
+static const struct file_operations booke_wdt_fops = {
+  .owner = THIS_MODULE,
+  .llseek = no_llseek,
+  .write = booke_wdt_write,
+  .ioctl = booke_wdt_ioctl,
+  .open = booke_wdt_open,
+};
+
+static struct miscdevice booke_wdt_miscdev = {
+  .minor = WATCHDOG_MINOR,
+  .name = "watchdog",
+  .fops = &booke_wdt_fops,
+};
+
+static void __exit booke_wdt_exit(void)
+{
+       misc_deregister(&booke_wdt_miscdev);
+}
+
+/*
+ * booke_wdt_init:
+ */
+static int __init booke_wdt_init(void)
+{
+       int ret = 0;
+
+       printk (KERN_INFO "PowerPC Book-E Watchdog Timer Loaded\n");
+       ident.firmware_version = cur_cpu_spec->pvr_value;
+
+       ret = misc_register(&booke_wdt_miscdev);
+       if (ret) {
+               printk (KERN_CRIT "Cannot register miscdev on minor=%d (err=%d)\n",
+                               WATCHDOG_MINOR, ret);
+               return ret;
+       }
+
+       if (booke_wdt_enabled == 1) {
+               printk (KERN_INFO "PowerPC Book-E Watchdog Timer Enabled (wdt_period=%d)\n",
+                               booke_wdt_period);
+               booke_wdt_enable();
+       }
+
+       return ret;
+}
+device_initcall(booke_wdt_init);
diff --git a/drivers/watchdog/cpu5wdt.c b/drivers/watchdog/cpu5wdt.c
new file mode 100644 (file)
index 0000000..5941ca6
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * sma cpu5 watchdog driver
+ *
+ * Copyright (C) 2003 Heiko Ronsdorf <hero@ihg.uni-duisburg.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/miscdevice.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/timer.h>
+#include <linux/completion.h>
+#include <linux/jiffies.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+#include <linux/watchdog.h>
+
+/* adjustable parameters */
+
+static int verbose = 0;
+static int port = 0x91;
+static int ticks = 10000;
+
+#define PFX                    "cpu5wdt: "
+
+#define CPU5WDT_EXTENT          0x0A
+
+#define CPU5WDT_STATUS_REG      0x00
+#define CPU5WDT_TIME_A_REG      0x02
+#define CPU5WDT_TIME_B_REG      0x03
+#define CPU5WDT_MODE_REG        0x04
+#define CPU5WDT_TRIGGER_REG     0x07
+#define CPU5WDT_ENABLE_REG      0x08
+#define CPU5WDT_RESET_REG       0x09
+
+#define CPU5WDT_INTERVAL       (HZ/10+1)
+
+/* some device data */
+
+static struct {
+       struct completion stop;
+       volatile int running;
+       struct timer_list timer;
+       volatile int queue;
+       int default_ticks;
+       unsigned long inuse;
+} cpu5wdt_device;
+
+/* generic helper functions */
+
+static void cpu5wdt_trigger(unsigned long unused)
+{
+       if ( verbose > 2 )
+               printk(KERN_DEBUG PFX "trigger at %i ticks\n", ticks);
+
+       if( cpu5wdt_device.running )
+               ticks--;
+
+       /* keep watchdog alive */
+       outb(1, port + CPU5WDT_TRIGGER_REG);
+
+       /* requeue?? */
+       if (cpu5wdt_device.queue && ticks)
+               mod_timer(&cpu5wdt_device.timer, jiffies + CPU5WDT_INTERVAL);
+       else {
+               /* ticks doesn't matter anyway */
+               complete(&cpu5wdt_device.stop);
+       }
+
+}
+
+static void cpu5wdt_reset(void)
+{
+       ticks = cpu5wdt_device.default_ticks;
+
+       if ( verbose )
+               printk(KERN_DEBUG PFX "reset (%i ticks)\n", (int) ticks);
+
+}
+
+static void cpu5wdt_start(void)
+{
+       if ( !cpu5wdt_device.queue ) {
+               cpu5wdt_device.queue = 1;
+               outb(0, port + CPU5WDT_TIME_A_REG);
+               outb(0, port + CPU5WDT_TIME_B_REG);
+               outb(1, port + CPU5WDT_MODE_REG);
+               outb(0, port + CPU5WDT_RESET_REG);
+               outb(0, port + CPU5WDT_ENABLE_REG);
+               mod_timer(&cpu5wdt_device.timer, jiffies + CPU5WDT_INTERVAL);
+       }
+       /* if process dies, counter is not decremented */
+       cpu5wdt_device.running++;
+}
+
+static int cpu5wdt_stop(void)
+{
+       if ( cpu5wdt_device.running )
+               cpu5wdt_device.running = 0;
+
+       ticks = cpu5wdt_device.default_ticks;
+
+       if ( verbose )
+               printk(KERN_CRIT PFX "stop not possible\n");
+
+       return -EIO;
+}
+
+/* filesystem operations */
+
+static int cpu5wdt_open(struct inode *inode, struct file *file)
+{
+       if ( test_and_set_bit(0, &cpu5wdt_device.inuse) )
+               return -EBUSY;
+
+       return nonseekable_open(inode, file);
+}
+
+static int cpu5wdt_release(struct inode *inode, struct file *file)
+{
+       clear_bit(0, &cpu5wdt_device.inuse);
+       return 0;
+}
+
+static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       unsigned int value;
+       static struct watchdog_info ident =
+       {
+               .options = WDIOF_CARDRESET,
+               .identity = "CPU5 WDT",
+       };
+
+       switch(cmd) {
+               case WDIOC_KEEPALIVE:
+                       cpu5wdt_reset();
+                       break;
+               case WDIOC_GETSTATUS:
+                       value = inb(port + CPU5WDT_STATUS_REG);
+                       value = (value >> 2) & 1;
+                       if ( copy_to_user(argp, &value, sizeof(int)) )
+                               return -EFAULT;
+                       break;
+               case WDIOC_GETBOOTSTATUS:
+                       if ( copy_to_user(argp, &value, sizeof(int)) )
+                               return -EFAULT;
+                       break;
+               case WDIOC_GETSUPPORT:
+                       if ( copy_to_user(argp, &ident, sizeof(ident)) )
+                               return -EFAULT;
+                       break;
+               case WDIOC_SETOPTIONS:
+                       if ( copy_from_user(&value, argp, sizeof(int)) )
+                               return -EFAULT;
+                       switch(value) {
+                               case WDIOS_ENABLECARD:
+                                       cpu5wdt_start();
+                                       break;
+                               case WDIOS_DISABLECARD:
+                                       return cpu5wdt_stop();
+                               default:
+                                       return -EINVAL;
+                       }
+                       break;
+               default:
+                       return -ENOTTY;
+       }
+       return 0;
+}
+
+static ssize_t cpu5wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if ( !count )
+               return -EIO;
+
+       cpu5wdt_reset();
+
+       return count;
+}
+
+static const struct file_operations cpu5wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .ioctl          = cpu5wdt_ioctl,
+       .open           = cpu5wdt_open,
+       .write          = cpu5wdt_write,
+       .release        = cpu5wdt_release,
+};
+
+static struct miscdevice cpu5wdt_misc = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &cpu5wdt_fops,
+};
+
+/* init/exit function */
+
+static int __devinit cpu5wdt_init(void)
+{
+       unsigned int val;
+       int err;
+
+       if ( verbose )
+               printk(KERN_DEBUG PFX "port=0x%x, verbose=%i\n", port, verbose);
+
+       if ( !request_region(port, CPU5WDT_EXTENT, PFX) ) {
+               printk(KERN_ERR PFX "request_region failed\n");
+               err = -EBUSY;
+               goto no_port;
+       }
+
+       if ( (err = misc_register(&cpu5wdt_misc)) < 0 ) {
+               printk(KERN_ERR PFX "misc_register failed\n");
+               goto no_misc;
+       }
+
+       /* watchdog reboot? */
+       val = inb(port + CPU5WDT_STATUS_REG);
+       val = (val >> 2) & 1;
+       if ( !val )
+               printk(KERN_INFO PFX "sorry, was my fault\n");
+
+       init_completion(&cpu5wdt_device.stop);
+       cpu5wdt_device.queue = 0;
+
+       clear_bit(0, &cpu5wdt_device.inuse);
+
+       setup_timer(&cpu5wdt_device.timer, cpu5wdt_trigger, 0);
+
+       cpu5wdt_device.default_ticks = ticks;
+
+       printk(KERN_INFO PFX "init success\n");
+
+       return 0;
+
+no_misc:
+       release_region(port, CPU5WDT_EXTENT);
+no_port:
+       return err;
+}
+
+static int __devinit cpu5wdt_init_module(void)
+{
+       return cpu5wdt_init();
+}
+
+static void __devexit cpu5wdt_exit(void)
+{
+       if ( cpu5wdt_device.queue ) {
+               cpu5wdt_device.queue = 0;
+               wait_for_completion(&cpu5wdt_device.stop);
+       }
+
+       misc_deregister(&cpu5wdt_misc);
+
+       release_region(port, CPU5WDT_EXTENT);
+
+}
+
+static void __devexit cpu5wdt_exit_module(void)
+{
+       cpu5wdt_exit();
+}
+
+/* module entry points */
+
+module_init(cpu5wdt_init_module);
+module_exit(cpu5wdt_exit_module);
+
+MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>");
+MODULE_DESCRIPTION("sma cpu5 watchdog driver");
+MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+module_param(port, int, 0);
+MODULE_PARM_DESC(port, "base address of watchdog card, default is 0x91");
+
+module_param(verbose, int, 0);
+MODULE_PARM_DESC(verbose, "be verbose, default is 0 (no)");
+
+module_param(ticks, int, 0);
+MODULE_PARM_DESC(ticks, "count down ticks, default is 10000");
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
new file mode 100644 (file)
index 0000000..19db530
--- /dev/null
@@ -0,0 +1,281 @@
+/*
+ * drivers/char/watchdog/davinci_wdt.c
+ *
+ * Watchdog driver for DaVinci DM644x/DM646x processors
+ *
+ * Copyright (C) 2006 Texas Instruments.
+ *
+ * 2007 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/init.h>
+#include <linux/bitops.h>
+#include <linux/platform_device.h>
+#include <linux/spinlock.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define MODULE_NAME "DAVINCI-WDT: "
+
+#define DEFAULT_HEARTBEAT 60
+#define MAX_HEARTBEAT     600  /* really the max margin is 264/27MHz*/
+
+/* Timer register set definition */
+#define PID12  (0x0)
+#define EMUMGT (0x4)
+#define TIM12  (0x10)
+#define TIM34  (0x14)
+#define PRD12  (0x18)
+#define PRD34  (0x1C)
+#define TCR    (0x20)
+#define TGCR   (0x24)
+#define WDTCR  (0x28)
+
+/* TCR bit definitions */
+#define ENAMODE12_DISABLED     (0 << 6)
+#define ENAMODE12_ONESHOT      (1 << 6)
+#define ENAMODE12_PERIODIC     (2 << 6)
+
+/* TGCR bit definitions */
+#define TIM12RS_UNRESET                (1 << 0)
+#define TIM34RS_UNRESET                (1 << 1)
+#define TIMMODE_64BIT_WDOG      (2 << 2)
+
+/* WDTCR bit definitions */
+#define WDEN                   (1 << 14)
+#define WDFLAG                 (1 << 15)
+#define WDKEY_SEQ0             (0xa5c6 << 16)
+#define WDKEY_SEQ1             (0xda7e << 16)
+
+static int heartbeat = DEFAULT_HEARTBEAT;
+
+static spinlock_t io_lock;
+static unsigned long wdt_status;
+#define WDT_IN_USE        0
+#define WDT_OK_TO_CLOSE   1
+#define WDT_REGION_INITED 2
+#define WDT_DEVICE_INITED 3
+
+static struct resource *wdt_mem;
+static void __iomem    *wdt_base;
+
+static void wdt_service(void)
+{
+       spin_lock(&io_lock);
+
+       /* put watchdog in service state */
+       davinci_writel(WDKEY_SEQ0, wdt_base + WDTCR);
+       /* put watchdog in active state */
+       davinci_writel(WDKEY_SEQ1, wdt_base + WDTCR);
+
+       spin_unlock(&io_lock);
+}
+
+static void wdt_enable(void)
+{
+       u32 tgcr;
+       u32 timer_margin;
+
+       spin_lock(&io_lock);
+
+       /* disable, internal clock source */
+       davinci_writel(0, wdt_base + TCR);
+       /* reset timer, set mode to 64-bit watchdog, and unreset */
+       davinci_writel(0, wdt_base + TGCR);
+       tgcr = TIMMODE_64BIT_WDOG | TIM12RS_UNRESET | TIM34RS_UNRESET;
+       davinci_writel(tgcr, wdt_base + TGCR);
+       /* clear counter regs */
+       davinci_writel(0, wdt_base + TIM12);
+       davinci_writel(0, wdt_base + TIM34);
+       /* set timeout period */
+       timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) & 0xffffffff);
+       davinci_writel(timer_margin, wdt_base + PRD12);
+       timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) >> 32);
+       davinci_writel(timer_margin, wdt_base + PRD34);
+       /* enable run continuously */
+       davinci_writel(ENAMODE12_PERIODIC, wdt_base + TCR);
+       /* Once the WDT is in pre-active state write to
+        * TIM12, TIM34, PRD12, PRD34, TCR, TGCR, WDTCR are
+        * write protected (except for the WDKEY field)
+        */
+       /* put watchdog in pre-active state */
+       davinci_writel(WDKEY_SEQ0 | WDEN, wdt_base + WDTCR);
+       /* put watchdog in active state */
+       davinci_writel(WDKEY_SEQ1 | WDEN, wdt_base + WDTCR);
+
+       spin_unlock(&io_lock);
+}
+
+static int davinci_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
+               return -EBUSY;
+
+       wdt_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static ssize_t
+davinci_wdt_write(struct file *file, const char *data, size_t len,
+                 loff_t *ppos)
+{
+       if (len)
+               wdt_service();
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options = WDIOF_KEEPALIVEPING,
+       .identity = "DaVinci Watchdog",
+};
+
+static int
+davinci_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+                 unsigned long arg)
+{
+       int ret = -ENOTTY;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user((struct watchdog_info *)arg, &ident,
+                                  sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(0, (int *)arg);
+               break;
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(heartbeat, (int *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_service();
+               ret = 0;
+               break;
+       }
+       return ret;
+}
+
+static int davinci_wdt_release(struct inode *inode, struct file *file)
+{
+       wdt_service();
+       clear_bit(WDT_IN_USE, &wdt_status);
+
+       return 0;
+}
+
+static const struct file_operations davinci_wdt_fops = {
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = davinci_wdt_write,
+       .ioctl = davinci_wdt_ioctl,
+       .open = davinci_wdt_open,
+       .release = davinci_wdt_release,
+};
+
+static struct miscdevice davinci_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &davinci_wdt_fops,
+};
+
+static int davinci_wdt_probe(struct platform_device *pdev)
+{
+       int ret = 0, size;
+       struct resource *res;
+
+       spin_lock_init(&io_lock);
+
+       if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
+               heartbeat = DEFAULT_HEARTBEAT;
+
+       printk(KERN_INFO MODULE_NAME
+               "DaVinci Watchdog Timer: heartbeat %d sec\n", heartbeat);
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res == NULL) {
+               printk(KERN_INFO MODULE_NAME
+                       "failed to get memory region resource\n");
+               return -ENOENT;
+       }
+
+       size = res->end - res->start + 1;
+       wdt_mem = request_mem_region(res->start, size, pdev->name);
+
+       if (wdt_mem == NULL) {
+               printk(KERN_INFO MODULE_NAME "failed to get memory region\n");
+               return -ENOENT;
+       }
+       wdt_base = (void __iomem *)(res->start);
+
+       ret = misc_register(&davinci_wdt_miscdev);
+       if (ret < 0) {
+               printk(KERN_ERR MODULE_NAME "cannot register misc device\n");
+               release_resource(wdt_mem);
+               kfree(wdt_mem);
+       } else {
+               set_bit(WDT_DEVICE_INITED, &wdt_status);
+       }
+
+       return ret;
+}
+
+static int davinci_wdt_remove(struct platform_device *pdev)
+{
+       misc_deregister(&davinci_wdt_miscdev);
+       if (wdt_mem) {
+               release_resource(wdt_mem);
+               kfree(wdt_mem);
+               wdt_mem = NULL;
+       }
+       return 0;
+}
+
+static struct platform_driver platform_wdt_driver = {
+       .driver = {
+               .name = "watchdog",
+       },
+       .probe = davinci_wdt_probe,
+       .remove = davinci_wdt_remove,
+};
+
+static int __init davinci_wdt_init(void)
+{
+       return platform_driver_register(&platform_wdt_driver);
+}
+
+static void __exit davinci_wdt_exit(void)
+{
+       return platform_driver_unregister(&platform_wdt_driver);
+}
+
+module_init(davinci_wdt_init);
+module_exit(davinci_wdt_exit);
+
+MODULE_AUTHOR("Texas Instruments");
+MODULE_DESCRIPTION("DaVinci Watchdog Driver");
+
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat,
+                "Watchdog heartbeat period in seconds from 1 to "
+                __MODULE_STRING(MAX_HEARTBEAT) ", default "
+                __MODULE_STRING(DEFAULT_HEARTBEAT));
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c
new file mode 100644 (file)
index 0000000..0e4787a
--- /dev/null
@@ -0,0 +1,253 @@
+/*
+ * Watchdog driver for Cirrus Logic EP93xx family of devices.
+ *
+ * Copyright (c) 2004 Ray Lehtiniemi
+ * Copyright (c) 2006 Tower Technologies
+ * Based on ep93xx driver, bits from alim7101_wdt.c
+ *
+ * Authors: Ray Lehtiniemi <rayl@mail.com>,
+ *     Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ *
+ * This watchdog fires after 250msec, which is a too short interval
+ * for us to rely on the user space daemon alone. So we ping the
+ * wdt each ~200msec and eventually stop doing it if the user space
+ * daemon dies.
+ *
+ * TODO:
+ *
+ *     - Test last reset from watchdog status
+ *     - Add a few missing ioctls
+ */
+
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/timer.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+
+#define WDT_VERSION    "0.3"
+#define PFX            "ep93xx_wdt: "
+
+/* default timeout (secs) */
+#define WDT_TIMEOUT 30
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+static int timeout = WDT_TIMEOUT;
+
+static struct timer_list timer;
+static unsigned long next_heartbeat;
+static unsigned long wdt_status;
+static unsigned long boot_status;
+
+#define WDT_IN_USE             0
+#define WDT_OK_TO_CLOSE                1
+
+#define EP93XX_WDT_REG(x)      (EP93XX_WATCHDOG_BASE + (x))
+#define EP93XX_WDT_WATCHDOG    EP93XX_WDT_REG(0x00)
+#define EP93XX_WDT_WDSTATUS    EP93XX_WDT_REG(0x04)
+
+/* reset the wdt every ~200ms */
+#define WDT_INTERVAL (HZ/5)
+
+static void wdt_enable(void)
+{
+       __raw_writew(0xaaaa, EP93XX_WDT_WATCHDOG);
+}
+
+static void wdt_disable(void)
+{
+       __raw_writew(0xaa55, EP93XX_WDT_WATCHDOG);
+}
+
+static inline void wdt_ping(void)
+{
+       __raw_writew(0x5555, EP93XX_WDT_WATCHDOG);
+}
+
+static void wdt_startup(void)
+{
+       next_heartbeat = jiffies + (timeout * HZ);
+
+       wdt_enable();
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+}
+
+static void wdt_shutdown(void)
+{
+       del_timer_sync(&timer);
+       wdt_disable();
+}
+
+static void wdt_keepalive(void)
+{
+       /* user land ping */
+       next_heartbeat = jiffies + (timeout * HZ);
+}
+
+static int ep93xx_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
+               return -EBUSY;
+
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       wdt_startup();
+
+       return nonseekable_open(inode, file);
+}
+
+static ssize_t
+ep93xx_wdt_write(struct file *file, const char __user *data, size_t len,
+                loff_t *ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+
+                               if (c == 'V')
+                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                               else
+                                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                       }
+               }
+               wdt_keepalive();
+       }
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE,
+       .identity = "EP93xx Watchdog",
+};
+
+static int
+ep93xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+                unsigned long arg)
+{
+       int ret = -ENOTTY;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
+                               sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+               ret = put_user(0, (int __user *)arg);
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(boot_status, (int __user *)arg);
+               break;
+
+       case WDIOC_GETTIMEOUT:
+               /* actually, it is 0.250 seconds.... */
+               ret = put_user(1, (int __user *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               ret = 0;
+               break;
+       }
+       return ret;
+}
+
+static int ep93xx_wdt_release(struct inode *inode, struct file *file)
+{
+       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
+               wdt_shutdown();
+       else
+               printk(KERN_CRIT PFX "Device closed unexpectedly - "
+                       "timer will not stop\n");
+
+       clear_bit(WDT_IN_USE, &wdt_status);
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       return 0;
+}
+
+static const struct file_operations ep93xx_wdt_fops = {
+       .owner          = THIS_MODULE,
+       .write          = ep93xx_wdt_write,
+       .ioctl          = ep93xx_wdt_ioctl,
+       .open           = ep93xx_wdt_open,
+       .release        = ep93xx_wdt_release,
+};
+
+static struct miscdevice ep93xx_wdt_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &ep93xx_wdt_fops,
+};
+
+static void ep93xx_timer_ping(unsigned long data)
+{
+       if (time_before(jiffies, next_heartbeat))
+               wdt_ping();
+
+       /* Re-set the timer interval */
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+}
+
+static int __init ep93xx_wdt_init(void)
+{
+       int err;
+
+       err = misc_register(&ep93xx_wdt_miscdev);
+
+       boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0;
+
+       printk(KERN_INFO PFX "EP93XX watchdog, driver version "
+               WDT_VERSION "%s\n",
+               (__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08)
+               ? " (nCS1 disable detected)" : "");
+
+       if (timeout < 1 || timeout > 3600) {
+               timeout = WDT_TIMEOUT;
+               printk(KERN_INFO PFX
+                       "timeout value must be 1<=x<=3600, using %d\n",
+                       timeout);
+       }
+
+       setup_timer(&timer, ep93xx_timer_ping, 1);
+       return err;
+}
+
+static void __exit ep93xx_wdt_exit(void)
+{
+       wdt_shutdown();
+       misc_deregister(&ep93xx_wdt_miscdev);
+}
+
+module_init(ep93xx_wdt_init);
+module_exit(ep93xx_wdt_exit);
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>,"
+               "Alessandro Zummo <a.zummo@towertech.it>");
+MODULE_DESCRIPTION("EP93xx Watchdog");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(WDT_VERSION);
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c
new file mode 100644 (file)
index 0000000..b14e9d1
--- /dev/null
@@ -0,0 +1,473 @@
+/*
+ *     Eurotech CPU-1220/1410/1420 on board WDT driver
+ *
+ *     (c) Copyright 2001 Ascensit <support@ascensit.com>
+ *     (c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com>
+ *     (c) Copyright 2002 Rob Radez <rob@osinvestor.com>
+ *
+ *     Based on wdt.c.
+ *     Original copyright messages:
+ *
+ *      (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                              http://www.redhat.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 the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ *
+ *      Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *      warranty for any of this software. This material is provided
+ *      "AS-IS" and at no charge.
+ *
+ *      (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>*
+ */
+
+/* Changelog:
+ *
+ * 2001 - Rodolfo Giometti
+ *     Initial release
+ *
+ * 2002/04/25 - Rob Radez
+ *     clean up #includes
+ *     clean up locking
+ *     make __setup param unique
+ *     proper options in watchdog_info
+ *     add WDIOC_GETSTATUS and WDIOC_SETOPTIONS ioctls
+ *     add expect_close support
+ *
+ * 2002.05.30 - Joel Becker <joel.becker@oracle.com>
+ *     Added Matt Domsch's nowayout module option.
+ */
+
+/*
+ *     The eurotech CPU-1220/1410/1420's watchdog is a part
+ *     of the on-board SUPER I/O device SMSC FDC 37B782.
+ */
+
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+static unsigned long eurwdt_is_open;
+static int eurwdt_timeout;
+static char eur_expect_close;
+
+/*
+ * You must set these - there is no sane way to probe for this board.
+ * You can use eurwdt=x,y to set these now.
+ */
+
+static int io = 0x3f0;
+static int irq = 10;
+static char *ev = "int";
+
+#define WDT_TIMEOUT            60                /* 1 minute */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * Some symbolic names
+ */
+
+#define WDT_CTRL_REG           0x30
+#define WDT_OUTPIN_CFG         0xe2
+#define WDT_EVENT_INT          0x00
+#define WDT_EVENT_REBOOT       0x08
+#define WDT_UNIT_SEL           0xf1
+#define WDT_UNIT_SECS          0x80
+#define WDT_TIMEOUT_VAL                0xf2
+#define WDT_TIMER_CFG          0xf3
+
+
+module_param(io, int, 0);
+MODULE_PARM_DESC(io, "Eurotech WDT io port (default=0x3f0)");
+module_param(irq, int, 0);
+MODULE_PARM_DESC(irq, "Eurotech WDT irq (default=10)");
+module_param(ev, charp, 0);
+MODULE_PARM_DESC(ev, "Eurotech WDT event type (default is `int')");
+
+
+/*
+ * Programming support
+ */
+
+static inline void eurwdt_write_reg(u8 index, u8 data)
+{
+       outb(index, io);
+       outb(data, io+1);
+}
+
+static inline void eurwdt_lock_chip(void)
+{
+       outb(0xaa, io);
+}
+
+static inline void eurwdt_unlock_chip(void)
+{
+       outb(0x55, io);
+       eurwdt_write_reg(0x07, 0x08);   /* set the logical device */
+}
+
+static inline void eurwdt_set_timeout(int timeout)
+{
+       eurwdt_write_reg(WDT_TIMEOUT_VAL, (u8) timeout);
+}
+
+static inline void eurwdt_disable_timer(void)
+{
+       eurwdt_set_timeout(0);
+}
+
+static void eurwdt_activate_timer(void)
+{
+       eurwdt_disable_timer();
+       eurwdt_write_reg(WDT_CTRL_REG, 0x01);   /* activate the WDT */
+       eurwdt_write_reg(WDT_OUTPIN_CFG, !strcmp("int", ev) ? WDT_EVENT_INT : WDT_EVENT_REBOOT);
+
+       /* Setting interrupt line */
+       if (irq == 2 || irq > 15 || irq < 0) {
+               printk(KERN_ERR ": invalid irq number\n");
+               irq = 0;        /* if invalid we disable interrupt */
+       }
+       if (irq == 0)
+               printk(KERN_INFO ": interrupt disabled\n");
+
+       eurwdt_write_reg(WDT_TIMER_CFG, irq<<4);
+
+       eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS);  /* we use seconds */
+       eurwdt_set_timeout(0);  /* the default timeout */
+}
+
+
+/*
+ * Kernel methods.
+ */
+
+static irqreturn_t eurwdt_interrupt(int irq, void *dev_id)
+{
+       printk(KERN_CRIT "timeout WDT timeout\n");
+
+#ifdef ONLY_TESTING
+       printk(KERN_CRIT "Would Reboot.\n");
+#else
+       printk(KERN_CRIT "Initiating system reboot.\n");
+       emergency_restart();
+#endif
+       return IRQ_HANDLED;
+}
+
+
+/**
+ * eurwdt_ping:
+ *
+ * Reload counter one with the watchdog timeout.
+ */
+
+static void eurwdt_ping(void)
+{
+       /* Write the watchdog default value */
+       eurwdt_set_timeout(eurwdt_timeout);
+}
+
+/**
+ * eurwdt_write:
+ * @file: file handle to the watchdog
+ * @buf: buffer to write (unused as data does not matter here
+ * @count: count of bytes
+ * @ppos: pointer to the position to write. No seeks allowed
+ *
+ * A write to a watchdog device is defined as a keepalive signal. Any
+ * write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t eurwdt_write(struct file *file, const char __user *buf,
+size_t count, loff_t *ppos)
+{
+       if (count)      {
+               if (!nowayout) {
+                       size_t i;
+
+                       eur_expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if(get_user(c, buf+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       eur_expect_close = 42;
+                       }
+               }
+               eurwdt_ping();  /* the default timeout */
+       }
+
+       return count;
+}
+
+/**
+ * eurwdt_ioctl:
+ * @inode: inode of the device
+ * @file: file handle to the device
+ * @cmd: watchdog command
+ * @arg: argument pointer
+ *
+ * The watchdog API defines a common set of functions for all watchdogs
+ * according to their available features.
+ */
+
+static int eurwdt_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options          = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity         = "WDT Eurotech CPU-1220/1410",
+       };
+
+       int time;
+       int options, retval = -EINVAL;
+
+       switch(cmd) {
+       default:
+               return -ENOTTY;
+
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+               eurwdt_ping();
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (copy_from_user(&time, p, sizeof(int)))
+                       return -EFAULT;
+
+               /* Sanity check */
+               if (time < 0 || time > 255)
+                       return -EINVAL;
+
+               eurwdt_timeout = time;
+               eurwdt_set_timeout(time);
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(eurwdt_timeout, p);
+
+       case WDIOC_SETOPTIONS:
+               if (get_user(options, p))
+                       return -EFAULT;
+               if (options & WDIOS_DISABLECARD) {
+                       eurwdt_disable_timer();
+                       retval = 0;
+               }
+               if (options & WDIOS_ENABLECARD) {
+                       eurwdt_activate_timer();
+                       eurwdt_ping();
+                       retval = 0;
+               }
+               return retval;
+       }
+}
+
+/**
+ * eurwdt_open:
+ * @inode: inode of device
+ * @file: file handle to device
+ *
+ * The misc device has been opened. The watchdog device is single
+ * open and on opening we load the counter.
+ */
+
+static int eurwdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &eurwdt_is_open))
+               return -EBUSY;
+       eurwdt_timeout = WDT_TIMEOUT;   /* initial timeout */
+       /* Activate the WDT */
+       eurwdt_activate_timer();
+       return nonseekable_open(inode, file);
+}
+
+/**
+ * eurwdt_release:
+ * @inode: inode to board
+ * @file: file handle to board
+ *
+ * The watchdog has a configurable API. There is a religious dispute
+ * between people who want their watchdog to be able to shut down and
+ * those who want to be sure if the watchdog manager dies the machine
+ * reboots. In the former case we disable the counters, in the latter
+ * case you have to open it again very soon.
+ */
+
+static int eurwdt_release(struct inode *inode, struct file *file)
+{
+       if (eur_expect_close == 42) {
+               eurwdt_disable_timer();
+       } else {
+               printk(KERN_CRIT "eurwdt: Unexpected close, not stopping watchdog!\n");
+               eurwdt_ping();
+       }
+       clear_bit(0, &eurwdt_is_open);
+       eur_expect_close = 0;
+       return 0;
+}
+
+/**
+ * eurwdt_notify_sys:
+ * @this: our notifier block
+ * @code: the event being reported
+ * @unused: unused
+ *
+ * Our notifier is called on system shutdowns. We want to turn the card
+ * off at reboot otherwise the machine will reboot again during memory
+ * test or worse yet during the following fsck. This would suck, in fact
+ * trust me - if it happens it does suck.
+ */
+
+static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT) {
+               /* Turn the card off */
+               eurwdt_disable_timer();
+       }
+
+       return NOTIFY_DONE;
+}
+
+/*
+ * Kernel Interfaces
+ */
+
+
+static const struct file_operations eurwdt_fops = {
+       .owner  = THIS_MODULE,
+       .llseek = no_llseek,
+       .write  = eurwdt_write,
+       .ioctl  = eurwdt_ioctl,
+       .open   = eurwdt_open,
+       .release        = eurwdt_release,
+};
+
+static struct miscdevice eurwdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &eurwdt_fops,
+};
+
+/*
+ * The WDT card needs to learn about soft shutdowns in order to
+ * turn the timebomb registers off.
+ */
+
+static struct notifier_block eurwdt_notifier = {
+       .notifier_call = eurwdt_notify_sys,
+};
+
+/**
+ * cleanup_module:
+ *
+ * Unload the watchdog. You cannot do this with any file handles open.
+ * If your watchdog is set to continue ticking on close and you unload
+ * it, well it keeps ticking. We won't get the interrupt but the board
+ * will not touch PC memory so all is fine. You just have to load a new
+ * module in 60 seconds or reboot.
+ */
+
+static void __exit eurwdt_exit(void)
+{
+       eurwdt_lock_chip();
+
+       misc_deregister(&eurwdt_miscdev);
+
+       unregister_reboot_notifier(&eurwdt_notifier);
+       release_region(io, 2);
+       free_irq(irq, NULL);
+}
+
+/**
+ * eurwdt_init:
+ *
+ * Set up the WDT watchdog board. After grabbing the resources
+ * we require we need also to unlock the device.
+ * The open() function will actually kick the board off.
+ */
+
+static int __init eurwdt_init(void)
+{
+       int ret;
+
+       ret = request_irq(irq, eurwdt_interrupt, IRQF_DISABLED, "eurwdt", NULL);
+       if(ret) {
+               printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq);
+               goto out;
+       }
+
+       if (!request_region(io, 2, "eurwdt")) {
+               printk(KERN_ERR "eurwdt: IO %X is not free.\n", io);
+               ret = -EBUSY;
+               goto outirq;
+       }
+
+       ret = register_reboot_notifier(&eurwdt_notifier);
+       if (ret) {
+               printk(KERN_ERR "eurwdt: can't register reboot notifier (err=%d)\n", ret);
+               goto outreg;
+       }
+
+       ret = misc_register(&eurwdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n",
+               WATCHDOG_MINOR);
+               goto outreboot;
+       }
+
+       eurwdt_unlock_chip();
+
+       ret = 0;
+       printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)"
+               " - timeout event: %s\n",
+               io, irq, (!strcmp("int", ev) ? "int" : "reboot"));
+
+out:
+       return ret;
+
+outreboot:
+       unregister_reboot_notifier(&eurwdt_notifier);
+
+outreg:
+       release_region(io, 2);
+
+outirq:
+       free_irq(irq, NULL);
+       goto out;
+}
+
+module_init(eurwdt_init);
+module_exit(eurwdt_exit);
+
+MODULE_AUTHOR("Rodolfo Giometti");
+MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c
new file mode 100644 (file)
index 0000000..c598250
--- /dev/null
@@ -0,0 +1,527 @@
+/*
+ *     i6300esb:       Watchdog timer driver for Intel 6300ESB chipset
+ *
+ *     (c) Copyright 2004 Google Inc.
+ *     (c) Copyright 2005 David Härdeman <david@2gen.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *      based on i810-tco.c which is in turn based on softdog.c
+ *
+ *     The timer is implemented in the following I/O controller hubs:
+ *     (See the intel documentation on http://developer.intel.com.)
+ *     6300ESB chip : document number 300641-003
+ *
+ *  2004YYZZ Ross Biro
+ *     Initial version 0.01
+ *  2004YYZZ Ross Biro
+ *     Version 0.02
+ *  20050210 David Härdeman <david@2gen.com>
+ *      Ported driver to kernel 2.6
+ */
+
+/*
+ *      Includes, defines, variables, module parameters, ...
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/ioport.h>
+
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+/* Module and version information */
+#define ESB_VERSION "0.03"
+#define ESB_MODULE_NAME "i6300ESB timer"
+#define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION
+#define PFX ESB_MODULE_NAME ": "
+
+/* PCI configuration registers */
+#define ESB_CONFIG_REG  0x60            /* Config register                   */
+#define ESB_LOCK_REG    0x68            /* WDT lock register                 */
+
+/* Memory mapped registers */
+#define ESB_TIMER1_REG  BASEADDR + 0x00 /* Timer1 value after each reset     */
+#define ESB_TIMER2_REG  BASEADDR + 0x04 /* Timer2 value after each reset     */
+#define ESB_GINTSR_REG  BASEADDR + 0x08 /* General Interrupt Status Register */
+#define ESB_RELOAD_REG  BASEADDR + 0x0c /* Reload register                   */
+
+/* Lock register bits */
+#define ESB_WDT_FUNC    ( 0x01 << 2 )   /* Watchdog functionality            */
+#define ESB_WDT_ENABLE  ( 0x01 << 1 )   /* Enable WDT                        */
+#define ESB_WDT_LOCK    ( 0x01 << 0 )   /* Lock (nowayout)                   */
+
+/* Config register bits */
+#define ESB_WDT_REBOOT  ( 0x01 << 5 )   /* Enable reboot on timeout          */
+#define ESB_WDT_FREQ    ( 0x01 << 2 )   /* Decrement frequency               */
+#define ESB_WDT_INTTYPE ( 0x11 << 0 )   /* Interrupt type on timer1 timeout  */
+
+/* Reload register bits */
+#define ESB_WDT_RELOAD ( 0x01 << 8 )    /* prevent timeout                   */
+
+/* Magic constants */
+#define ESB_UNLOCK1     0x80            /* Step 1 to unlock reset registers  */
+#define ESB_UNLOCK2     0x86            /* Step 2 to unlock reset registers  */
+
+/* internal variables */
+static void __iomem *BASEADDR;
+static spinlock_t esb_lock; /* Guards the hardware */
+static unsigned long timer_alive;
+static struct pci_dev *esb_pci;
+static unsigned short triggered; /* The status of the watchdog upon boot */
+static char esb_expect_close;
+
+/* module parameters */
+#define WATCHDOG_HEARTBEAT 30   /* 30 sec default heartbeat (1<heartbeat<2*1023) */
+static int heartbeat = WATCHDOG_HEARTBEAT;  /* in seconds */
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<heartbeat<2046, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * Some i6300ESB specific functions
+ */
+
+/*
+ * Prepare for reloading the timer by unlocking the proper registers.
+ * This is performed by first writing 0x80 followed by 0x86 to the
+ * reload register. After this the appropriate registers can be written
+ * to once before they need to be unlocked again.
+ */
+static inline void esb_unlock_registers(void) {
+        writeb(ESB_UNLOCK1, ESB_RELOAD_REG);
+        writeb(ESB_UNLOCK2, ESB_RELOAD_REG);
+}
+
+static void esb_timer_start(void)
+{
+       u8 val;
+
+       /* Enable or Enable + Lock? */
+       val = 0x02 | (nowayout ? 0x01 : 0x00);
+
+        pci_write_config_byte(esb_pci, ESB_LOCK_REG, val);
+}
+
+static int esb_timer_stop(void)
+{
+       u8 val;
+
+       spin_lock(&esb_lock);
+       /* First, reset timers as suggested by the docs */
+       esb_unlock_registers();
+       writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
+       /* Then disable the WDT */
+       pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x0);
+       pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val);
+       spin_unlock(&esb_lock);
+
+       /* Returns 0 if the timer was disabled, non-zero otherwise */
+       return (val & 0x01);
+}
+
+static void esb_timer_keepalive(void)
+{
+       spin_lock(&esb_lock);
+       esb_unlock_registers();
+       writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
+        /* FIXME: Do we need to flush anything here? */
+       spin_unlock(&esb_lock);
+}
+
+static int esb_timer_set_heartbeat(int time)
+{
+       u32 val;
+
+       if (time < 0x1 || time > (2 * 0x03ff))
+               return -EINVAL;
+
+       spin_lock(&esb_lock);
+
+       /* We shift by 9, so if we are passed a value of 1 sec,
+        * val will be 1 << 9 = 512, then write that to two
+        * timers => 2 * 512 = 1024 (which is decremented at 1KHz)
+        */
+       val = time << 9;
+
+       /* Write timer 1 */
+       esb_unlock_registers();
+       writel(val, ESB_TIMER1_REG);
+
+       /* Write timer 2 */
+       esb_unlock_registers();
+        writel(val, ESB_TIMER2_REG);
+
+        /* Reload */
+       esb_unlock_registers();
+       writew(ESB_WDT_RELOAD, ESB_RELOAD_REG);
+
+       /* FIXME: Do we need to flush everything out? */
+
+       /* Done */
+       heartbeat = time;
+       spin_unlock(&esb_lock);
+       return 0;
+}
+
+static int esb_timer_read (void)
+{
+               u32 count;
+
+       /* This isn't documented, and doesn't take into
+         * acount which stage is running, but it looks
+         * like a 20 bit count down, so we might as well report it.
+         */
+        pci_read_config_dword(esb_pci, 0x64, &count);
+        return (int)count;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int esb_open (struct inode *inode, struct file *file)
+{
+        /* /dev/watchdog can only be opened once */
+        if (test_and_set_bit(0, &timer_alive))
+                return -EBUSY;
+
+        /* Reload and activate timer */
+        esb_timer_keepalive ();
+        esb_timer_start ();
+
+       return nonseekable_open(inode, file);
+}
+
+static int esb_release (struct inode *inode, struct file *file)
+{
+        /* Shut off the timer. */
+        if (esb_expect_close == 42) {
+                esb_timer_stop ();
+        } else {
+                printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+                esb_timer_keepalive ();
+        }
+        clear_bit(0, &timer_alive);
+        esb_expect_close = 0;
+        return 0;
+}
+
+static ssize_t esb_write (struct file *file, const char __user *data,
+                         size_t len, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+        if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       esb_expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if(get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       esb_expect_close = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               esb_timer_keepalive ();
+       }
+       return len;
+}
+
+static int esb_ioctl (struct inode *inode, struct file *file,
+                     unsigned int cmd, unsigned long arg)
+{
+       int new_options, retval = -EINVAL;
+       int new_heartbeat;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_SETTIMEOUT |
+                                       WDIOF_KEEPALIVEPING |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     0,
+               .identity =             ESB_MODULE_NAME,
+       };
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident,
+                                           sizeof (ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+                       return put_user (esb_timer_read(), p);
+
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user (triggered, p);
+
+                case WDIOC_KEEPALIVE:
+                        esb_timer_keepalive ();
+                        return 0;
+
+                case WDIOC_SETOPTIONS:
+                {
+                        if (get_user (new_options, p))
+                                return -EFAULT;
+
+                        if (new_options & WDIOS_DISABLECARD) {
+                                esb_timer_stop ();
+                                retval = 0;
+                        }
+
+                        if (new_options & WDIOS_ENABLECARD) {
+                                esb_timer_keepalive ();
+                                esb_timer_start ();
+                                retval = 0;
+                        }
+
+                        return retval;
+                }
+
+                case WDIOC_SETTIMEOUT:
+                {
+                        if (get_user(new_heartbeat, p))
+                                return -EFAULT;
+
+                        if (esb_timer_set_heartbeat(new_heartbeat))
+                            return -EINVAL;
+
+                        esb_timer_keepalive ();
+                        /* Fall */
+                }
+
+                case WDIOC_GETTIMEOUT:
+                        return put_user(heartbeat, p);
+
+                default:
+                        return -ENOTTY;
+        }
+}
+
+/*
+ *      Notify system
+ */
+
+static int esb_notify_sys (struct notifier_block *this, unsigned long code, void *unused)
+{
+        if (code==SYS_DOWN || code==SYS_HALT) {
+                /* Turn the WDT off */
+                esb_timer_stop ();
+        }
+
+        return NOTIFY_DONE;
+}
+
+/*
+ *      Kernel Interfaces
+ */
+
+static const struct file_operations esb_fops = {
+        .owner =        THIS_MODULE,
+        .llseek =       no_llseek,
+        .write =        esb_write,
+        .ioctl =        esb_ioctl,
+        .open =         esb_open,
+        .release =      esb_release,
+};
+
+static struct miscdevice esb_miscdev = {
+        .minor =        WATCHDOG_MINOR,
+        .name =         "watchdog",
+        .fops =         &esb_fops,
+};
+
+static struct notifier_block esb_notifier = {
+        .notifier_call =        esb_notify_sys,
+};
+
+/*
+ * Data for PCI driver interface
+ *
+ * This data only exists for exporting the supported
+ * PCI ids via MODULE_DEVICE_TABLE.  We do not actually
+ * register a pci_driver, because someone else might one day
+ * want to register another driver on the same PCI id.
+ */
+static struct pci_device_id esb_pci_tbl[] = {
+        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_9), },
+        { 0, },                 /* End of list */
+};
+MODULE_DEVICE_TABLE (pci, esb_pci_tbl);
+
+/*
+ *      Init & exit routines
+ */
+
+static unsigned char __init esb_getdevice (void)
+{
+       u8 val1;
+       unsigned short val2;
+
+        struct pci_dev *dev = NULL;
+        /*
+         *      Find the PCI device
+         */
+
+        for_each_pci_dev(dev) {
+                if (pci_match_id(esb_pci_tbl, dev)) {
+                        esb_pci = dev;
+                        break;
+                }
+       }
+
+        if (esb_pci) {
+               if (pci_enable_device(esb_pci)) {
+                       printk (KERN_ERR PFX "failed to enable device\n");
+                       goto err_devput;
+               }
+
+               if (pci_request_region(esb_pci, 0, ESB_MODULE_NAME)) {
+                       printk (KERN_ERR PFX "failed to request region\n");
+                       goto err_disable;
+               }
+
+               BASEADDR = ioremap(pci_resource_start(esb_pci, 0),
+                                  pci_resource_len(esb_pci, 0));
+               if (BASEADDR == NULL) {
+                       /* Something's wrong here, BASEADDR has to be set */
+                       printk (KERN_ERR PFX "failed to get BASEADDR\n");
+                        goto err_release;
+                }
+
+               /*
+                * The watchdog has two timers, it can be setup so that the
+                * expiry of timer1 results in an interrupt and the expiry of
+                * timer2 results in a reboot. We set it to not generate
+                * any interrupts as there is not much we can do with it
+                * right now.
+                *
+                * We also enable reboots and set the timer frequency to
+                * the PCI clock divided by 2^15 (approx 1KHz).
+                */
+               pci_write_config_word(esb_pci, ESB_CONFIG_REG, 0x0003);
+
+               /* Check that the WDT isn't already locked */
+               pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1);
+               if (val1 & ESB_WDT_LOCK)
+                       printk (KERN_WARNING PFX "nowayout already set\n");
+
+               /* Set the timer to watchdog mode and disable it for now */
+               pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00);
+
+               /* Check if the watchdog was previously triggered */
+               esb_unlock_registers();
+               val2 = readw(ESB_RELOAD_REG);
+               triggered = (val2 & (0x01 << 9) >> 9);
+
+               /* Reset trigger flag and timers */
+               esb_unlock_registers();
+               writew((0x11 << 8), ESB_RELOAD_REG);
+
+               /* Done */
+               return 1;
+
+err_release:
+               pci_release_region(esb_pci, 0);
+err_disable:
+               pci_disable_device(esb_pci);
+err_devput:
+               pci_dev_put(esb_pci);
+       }
+       return 0;
+}
+
+static int __init watchdog_init (void)
+{
+        int ret;
+
+        spin_lock_init(&esb_lock);
+
+        /* Check whether or not the hardware watchdog is there */
+        if (!esb_getdevice () || esb_pci == NULL)
+                return -ENODEV;
+
+        /* Check that the heartbeat value is within it's range ; if not reset to the default */
+        if (esb_timer_set_heartbeat (heartbeat)) {
+                esb_timer_set_heartbeat (WATCHDOG_HEARTBEAT);
+                printk(KERN_INFO PFX "heartbeat value must be 1<heartbeat<2046, using %d\n",
+                      heartbeat);
+        }
+
+        ret = register_reboot_notifier(&esb_notifier);
+        if (ret != 0) {
+                printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                        ret);
+                goto err_unmap;
+        }
+
+        ret = misc_register(&esb_miscdev);
+        if (ret != 0) {
+                printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                        WATCHDOG_MINOR, ret);
+                goto err_notifier;
+        }
+
+        esb_timer_stop ();
+
+        printk (KERN_INFO PFX "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n",
+                BASEADDR, heartbeat, nowayout);
+
+        return 0;
+
+err_notifier:
+        unregister_reboot_notifier(&esb_notifier);
+err_unmap:
+       iounmap(BASEADDR);
+/* err_release: */
+       pci_release_region(esb_pci, 0);
+/* err_disable: */
+       pci_disable_device(esb_pci);
+/* err_devput: */
+       pci_dev_put(esb_pci);
+        return ret;
+}
+
+static void __exit watchdog_cleanup (void)
+{
+       /* Stop the timer before we leave */
+       if (!nowayout)
+               esb_timer_stop ();
+
+       /* Deregister */
+       misc_deregister(&esb_miscdev);
+        unregister_reboot_notifier(&esb_notifier);
+       iounmap(BASEADDR);
+       pci_release_region(esb_pci, 0);
+       pci_disable_device(esb_pci);
+       pci_dev_put(esb_pci);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_cleanup);
+
+MODULE_AUTHOR("Ross Biro and David Härdeman");
+MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/iTCO_vendor_support.c b/drivers/watchdog/iTCO_vendor_support.c
new file mode 100644 (file)
index 0000000..4150839
--- /dev/null
@@ -0,0 +1,307 @@
+/*
+ *     intel TCO vendor specific watchdog driver support
+ *
+ *     (c) Copyright 2006 Wim Van Sebroeck <wim@iguana.be>.
+ *
+ *     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.
+ *
+ *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
+ *     provide warranty for any of this software. This material is
+ *     provided "AS-IS" and at no charge.
+ */
+
+/*
+ *     Includes, defines, variables, module parameters, ...
+ */
+
+/* Module and version information */
+#define DRV_NAME        "iTCO_vendor_support"
+#define DRV_VERSION     "1.01"
+#define DRV_RELDATE     "11-Nov-2006"
+#define PFX            DRV_NAME ": "
+
+/* Includes */
+#include <linux/module.h>              /* For module specific items */
+#include <linux/moduleparam.h>         /* For new moduleparam's */
+#include <linux/types.h>               /* For standard types (like size_t) */
+#include <linux/errno.h>               /* For the -ENODEV/... values */
+#include <linux/kernel.h>              /* For printk/panic/... */
+#include <linux/init.h>                        /* For __init/__exit/... */
+#include <linux/ioport.h>              /* For io-port access */
+
+#include <asm/io.h>                    /* For inb/outb/... */
+
+/* iTCO defines */
+#define        SMI_EN          acpibase + 0x30 /* SMI Control and Enable Register */
+#define        TCOBASE         acpibase + 0x60 /* TCO base address             */
+#define        TCO1_STS        TCOBASE + 0x04  /* TCO1 Status Register         */
+
+/* List of vendor support modes */
+#define SUPERMICRO_OLD_BOARD   1       /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */
+#define SUPERMICRO_NEW_BOARD   2       /* SuperMicro Pentium 4 / Xeon 4 / EMT64T Era Systems */
+
+static int vendorsupport = 0;
+module_param(vendorsupport, int, 0);
+MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+");
+
+/*
+ *     Vendor Specific Support
+ */
+
+/*
+ *     Vendor Support: 1
+ *     Board: Super Micro Computer Inc. 370SSE+-OEM1/P3TSSE
+ *     iTCO chipset: ICH2
+ *
+ *     Code contributed by: R. Seretny <lkpatches@paypc.com>
+ *     Documentation obtained by R. Seretny from SuperMicro Technical Support
+ *
+ *     To enable Watchdog function:
+ *         BIOS setup -> Power -> TCO Logic SMI Enable -> Within5Minutes
+ *         This setting enables SMI to clear the watchdog expired flag.
+ *         If BIOS or CPU fail which may cause SMI hang, then system will
+ *         reboot. When application starts to use watchdog function,
+ *         application has to take over the control from SMI.
+ *
+ *         For P3TSSE, J36 jumper needs to be removed to enable the Watchdog
+ *         function.
+ *
+ *         Note: The system will reboot when Expire Flag is set TWICE.
+ *         So, if the watchdog timer is 20 seconds, then the maximum hang
+ *         time is about 40 seconds, and the minimum hang time is about
+ *         20.6 seconds.
+ */
+
+static void supermicro_old_pre_start(unsigned long acpibase)
+{
+       unsigned long val32;
+
+       val32 = inl(SMI_EN);
+       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
+       outl(val32, SMI_EN);    /* Needed to activate watchdog */
+}
+
+static void supermicro_old_pre_stop(unsigned long acpibase)
+{
+       unsigned long val32;
+
+       val32 = inl(SMI_EN);
+       val32 &= 0x00002000;    /* Turn on SMI clearing watchdog */
+       outl(val32, SMI_EN);    /* Needed to deactivate watchdog */
+}
+
+static void supermicro_old_pre_keepalive(unsigned long acpibase)
+{
+       /* Reload TCO Timer (done in iTCO_wdt_keepalive) + */
+       /* Clear "Expire Flag" (Bit 3 of TC01_STS register) */
+       outb(0x08, TCO1_STS);
+}
+
+/*
+ *     Vendor Support: 2
+ *     Board: Super Micro Computer Inc. P4SBx, P4DPx
+ *     iTCO chipset: ICH4
+ *
+ *     Code contributed by: R. Seretny <lkpatches@paypc.com>
+ *     Documentation obtained by R. Seretny from SuperMicro Technical Support
+ *
+ *     To enable Watchdog function:
+ *      1. BIOS
+ *       For P4SBx:
+ *       BIOS setup -> Advanced -> Integrated Peripherals -> Watch Dog Feature
+ *       For P4DPx:
+ *       BIOS setup -> Advanced -> I/O Device Configuration -> Watch Dog
+ *      This setting enables or disables Watchdog function. When enabled, the
+ *      default watchdog timer is set to be 5 minutes (about 4’35”). It is
+ *      enough to load and run the OS. The application (service or driver) has
+ *      to take over the control once OS is running up and before watchdog
+ *      expires.
+ *
+ *      2. JUMPER
+ *       For P4SBx: JP39
+ *       For P4DPx: JP37
+ *       This jumper is used for safety.  Closed is enabled. This jumper
+ *       prevents user enables watchdog in BIOS by accident.
+ *
+ *      To enable Watch Dog function, both BIOS and JUMPER must be enabled.
+ *
+ *     The documentation lists motherboards P4SBx and P4DPx series as of
+ *     20-March-2002. However, this code works flawlessly with much newer
+ *     motherboards, such as my X6DHR-8G2 (SuperServer 6014H-82).
+ *
+ *     The original iTCO driver as written does not actually reset the
+ *     watchdog timer on these machines, as a result they reboot after five
+ *     minutes.
+ *
+ *     NOTE: You may leave the Watchdog function disabled in the SuperMicro
+ *     BIOS to avoid a "boot-race"... This driver will enable watchdog
+ *     functionality even if it's disabled in the BIOS once the /dev/watchdog
+ *     file is opened.
+ */
+
+/* I/O Port's */
+#define SM_REGINDEX    0x2e            /* SuperMicro ICH4+ Register Index */
+#define SM_DATAIO      0x2f            /* SuperMicro ICH4+ Register Data I/O */
+
+/* Control Register's */
+#define SM_CTLPAGESW   0x07            /* SuperMicro ICH4+ Control Page Switch */
+#define SM_CTLPAGE             0x08    /* SuperMicro ICH4+ Control Page Num */
+
+#define SM_WATCHENABLE 0x30            /* Watchdog enable: Bit 0: 0=off, 1=on */
+
+#define SM_WATCHPAGE   0x87            /* Watchdog unlock control page */
+
+#define SM_ENDWATCH    0xAA            /* Watchdog lock control page */
+
+#define SM_COUNTMODE   0xf5            /* Watchdog count mode select */
+                                       /* (Bit 3: 0 = seconds, 1 = minutes */
+
+#define SM_WATCHTIMER  0xf6            /* 8-bits, Watchdog timer counter (RW) */
+
+#define SM_RESETCONTROL        0xf7            /* Watchdog reset control */
+                                       /* Bit 6: timer is reset by kbd interrupt */
+                                       /* Bit 7: timer is reset by mouse interrupt */
+
+static void supermicro_new_unlock_watchdog(void)
+{
+       outb(SM_WATCHPAGE, SM_REGINDEX);        /* Write 0x87 to port 0x2e twice */
+       outb(SM_WATCHPAGE, SM_REGINDEX);
+
+       outb(SM_CTLPAGESW, SM_REGINDEX);        /* Switch to watchdog control page */
+       outb(SM_CTLPAGE, SM_DATAIO);
+}
+
+static void supermicro_new_lock_watchdog(void)
+{
+       outb(SM_ENDWATCH, SM_REGINDEX);
+}
+
+static void supermicro_new_pre_start(unsigned int heartbeat)
+{
+       unsigned int val;
+
+       supermicro_new_unlock_watchdog();
+
+       /* Watchdog timer setting needs to be in seconds*/
+       outb(SM_COUNTMODE, SM_REGINDEX);
+       val = inb(SM_DATAIO);
+       val &= 0xF7;
+       outb(val, SM_DATAIO);
+
+       /* Write heartbeat interval to WDOG */
+       outb (SM_WATCHTIMER, SM_REGINDEX);
+       outb((heartbeat & 255), SM_DATAIO);
+
+       /* Make sure keyboard/mouse interrupts don't interfere */
+       outb(SM_RESETCONTROL, SM_REGINDEX);
+       val = inb(SM_DATAIO);
+       val &= 0x3f;
+       outb(val, SM_DATAIO);
+
+       /* enable watchdog by setting bit 0 of Watchdog Enable to 1 */
+       outb(SM_WATCHENABLE, SM_REGINDEX);
+       val = inb(SM_DATAIO);
+       val |= 0x01;
+       outb(val, SM_DATAIO);
+
+       supermicro_new_lock_watchdog();
+}
+
+static void supermicro_new_pre_stop(void)
+{
+       unsigned int val;
+
+       supermicro_new_unlock_watchdog();
+
+       /* disable watchdog by setting bit 0 of Watchdog Enable to 0 */
+       outb(SM_WATCHENABLE, SM_REGINDEX);
+       val = inb(SM_DATAIO);
+       val &= 0xFE;
+       outb(val, SM_DATAIO);
+
+       supermicro_new_lock_watchdog();
+}
+
+static void supermicro_new_pre_set_heartbeat(unsigned int heartbeat)
+{
+       supermicro_new_unlock_watchdog();
+
+       /* reset watchdog timeout to heartveat value */
+       outb(SM_WATCHTIMER, SM_REGINDEX);
+       outb((heartbeat & 255), SM_DATAIO);
+
+       supermicro_new_lock_watchdog();
+}
+
+/*
+ *     Generic Support Functions
+ */
+
+void iTCO_vendor_pre_start(unsigned long acpibase,
+                          unsigned int heartbeat)
+{
+       if (vendorsupport == SUPERMICRO_OLD_BOARD)
+               supermicro_old_pre_start(acpibase);
+       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
+               supermicro_new_pre_start(heartbeat);
+}
+EXPORT_SYMBOL(iTCO_vendor_pre_start);
+
+void iTCO_vendor_pre_stop(unsigned long acpibase)
+{
+       if (vendorsupport == SUPERMICRO_OLD_BOARD)
+               supermicro_old_pre_stop(acpibase);
+       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
+               supermicro_new_pre_stop();
+}
+EXPORT_SYMBOL(iTCO_vendor_pre_stop);
+
+void iTCO_vendor_pre_keepalive(unsigned long acpibase, unsigned int heartbeat)
+{
+       if (vendorsupport == SUPERMICRO_OLD_BOARD)
+               supermicro_old_pre_keepalive(acpibase);
+       else if (vendorsupport == SUPERMICRO_NEW_BOARD)
+               supermicro_new_pre_set_heartbeat(heartbeat);
+}
+EXPORT_SYMBOL(iTCO_vendor_pre_keepalive);
+
+void iTCO_vendor_pre_set_heartbeat(unsigned int heartbeat)
+{
+       if (vendorsupport == SUPERMICRO_NEW_BOARD)
+               supermicro_new_pre_set_heartbeat(heartbeat);
+}
+EXPORT_SYMBOL(iTCO_vendor_pre_set_heartbeat);
+
+int iTCO_vendor_check_noreboot_on(void)
+{
+       switch(vendorsupport) {
+       case SUPERMICRO_OLD_BOARD:
+               return 0;
+       default:
+               return 1;
+       }
+}
+EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on);
+
+static int __init iTCO_vendor_init_module(void)
+{
+       printk (KERN_INFO PFX "vendor-support=%d\n", vendorsupport);
+       return 0;
+}
+
+static void __exit iTCO_vendor_exit_module(void)
+{
+       printk (KERN_INFO PFX "Module Unloaded\n");
+}
+
+module_init(iTCO_vendor_init_module);
+module_exit(iTCO_vendor_exit_module);
+
+MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, R. Seretny <lkpatches@paypc.com>");
+MODULE_DESCRIPTION("Intel TCO Vendor Specific WatchDog Timer Driver Support");
+MODULE_VERSION(DRV_VERSION);
+MODULE_LICENSE("GPL");
+
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
new file mode 100644 (file)
index 0000000..cd5a565
--- /dev/null
@@ -0,0 +1,804 @@
+/*
+ *     intel TCO Watchdog Driver (Used in i82801 and i6300ESB chipsets)
+ *
+ *     (c) Copyright 2006-2007 Wim Van Sebroeck <wim@iguana.be>.
+ *
+ *     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.
+ *
+ *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
+ *     provide warranty for any of this software. This material is
+ *     provided "AS-IS" and at no charge.
+ *
+ *     The TCO watchdog is implemented in the following I/O controller hubs:
+ *     (See the intel documentation on http://developer.intel.com.)
+ *     82801AA  (ICH)       : document number 290655-003, 290677-014,
+ *     82801AB  (ICHO)      : document number 290655-003, 290677-014,
+ *     82801BA  (ICH2)      : document number 290687-002, 298242-027,
+ *     82801BAM (ICH2-M)    : document number 290687-002, 298242-027,
+ *     82801CA  (ICH3-S)    : document number 290733-003, 290739-013,
+ *     82801CAM (ICH3-M)    : document number 290716-001, 290718-007,
+ *     82801DB  (ICH4)      : document number 290744-001, 290745-020,
+ *     82801DBM (ICH4-M)    : document number 252337-001, 252663-005,
+ *     82801E   (C-ICH)     : document number 273599-001, 273645-002,
+ *     82801EB  (ICH5)      : document number 252516-001, 252517-003,
+ *     82801ER  (ICH5R)     : document number 252516-001, 252517-003,
+ *     82801FB  (ICH6)      : document number 301473-002, 301474-007,
+ *     82801FR  (ICH6R)     : document number 301473-002, 301474-007,
+ *     82801FBM (ICH6-M)    : document number 301473-002, 301474-007,
+ *     82801FW  (ICH6W)     : document number 301473-001, 301474-007,
+ *     82801FRW (ICH6RW)    : document number 301473-001, 301474-007,
+ *     82801GB  (ICH7)      : document number 307013-002, 307014-009,
+ *     82801GR  (ICH7R)     : document number 307013-002, 307014-009,
+ *     82801GDH (ICH7DH)    : document number 307013-002, 307014-009,
+ *     82801GBM (ICH7-M)    : document number 307013-002, 307014-009,
+ *     82801GHM (ICH7-M DH) : document number 307013-002, 307014-009,
+ *     82801HB  (ICH8)      : document number 313056-002, 313057-004,
+ *     82801HR  (ICH8R)     : document number 313056-002, 313057-004,
+ *     82801HH  (ICH8DH)    : document number 313056-002, 313057-004,
+ *     82801HO  (ICH8DO)    : document number 313056-002, 313057-004,
+ *     82801IB  (ICH9)      : document number 316972-001, 316973-001,
+ *     82801IR  (ICH9R)     : document number 316972-001, 316973-001,
+ *     82801IH  (ICH9DH)    : document number 316972-001, 316973-001,
+ *     6300ESB  (6300ESB)   : document number 300641-003, 300884-010,
+ *     631xESB  (631xESB)   : document number 313082-001, 313075-005,
+ *     632xESB  (632xESB)   : document number 313082-001, 313075-005
+ */
+
+/*
+ *     Includes, defines, variables, module parameters, ...
+ */
+
+/* Module and version information */
+#define DRV_NAME        "iTCO_wdt"
+#define DRV_VERSION     "1.02"
+#define DRV_RELDATE     "26-Jul-2007"
+#define PFX            DRV_NAME ": "
+
+/* Includes */
+#include <linux/module.h>              /* For module specific items */
+#include <linux/moduleparam.h>         /* For new moduleparam's */
+#include <linux/types.h>               /* For standard types (like size_t) */
+#include <linux/errno.h>               /* For the -ENODEV/... values */
+#include <linux/kernel.h>              /* For printk/panic/... */
+#include <linux/miscdevice.h>          /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
+#include <linux/watchdog.h>            /* For the watchdog specific items */
+#include <linux/init.h>                        /* For __init/__exit/... */
+#include <linux/fs.h>                  /* For file operations */
+#include <linux/platform_device.h>     /* For platform_driver framework */
+#include <linux/pci.h>                 /* For pci functions */
+#include <linux/ioport.h>              /* For io-port access */
+#include <linux/spinlock.h>            /* For spin_lock/spin_unlock/... */
+
+#include <asm/uaccess.h>               /* For copy_to_user/put_user/... */
+#include <asm/io.h>                    /* For inb/outb/... */
+
+/* TCO related info */
+enum iTCO_chipsets {
+       TCO_ICH = 0,    /* ICH */
+       TCO_ICH0,       /* ICH0 */
+       TCO_ICH2,       /* ICH2 */
+       TCO_ICH2M,      /* ICH2-M */
+       TCO_ICH3,       /* ICH3-S */
+       TCO_ICH3M,      /* ICH3-M */
+       TCO_ICH4,       /* ICH4 */
+       TCO_ICH4M,      /* ICH4-M */
+       TCO_CICH,       /* C-ICH */
+       TCO_ICH5,       /* ICH5 & ICH5R */
+       TCO_6300ESB,    /* 6300ESB */
+       TCO_ICH6,       /* ICH6 & ICH6R */
+       TCO_ICH6M,      /* ICH6-M */
+       TCO_ICH6W,      /* ICH6W & ICH6RW */
+       TCO_ICH7,       /* ICH7 & ICH7R */
+       TCO_ICH7M,      /* ICH7-M */
+       TCO_ICH7MDH,    /* ICH7-M DH */
+       TCO_ICH8,       /* ICH8 & ICH8R */
+       TCO_ICH8DH,     /* ICH8DH */
+       TCO_ICH8DO,     /* ICH8DO */
+       TCO_ICH9,       /* ICH9 */
+       TCO_ICH9R,      /* ICH9R */
+       TCO_ICH9DH,     /* ICH9DH */
+       TCO_631XESB,    /* 631xESB/632xESB */
+};
+
+static struct {
+       char *name;
+       unsigned int iTCO_version;
+} iTCO_chipset_info[] __devinitdata = {
+       {"ICH", 1},
+       {"ICH0", 1},
+       {"ICH2", 1},
+       {"ICH2-M", 1},
+       {"ICH3-S", 1},
+       {"ICH3-M", 1},
+       {"ICH4", 1},
+       {"ICH4-M", 1},
+       {"C-ICH", 1},
+       {"ICH5 or ICH5R", 1},
+       {"6300ESB", 1},
+       {"ICH6 or ICH6R", 2},
+       {"ICH6-M", 2},
+       {"ICH6W or ICH6RW", 2},
+       {"ICH7 or ICH7R", 2},
+       {"ICH7-M", 2},
+       {"ICH7-M DH", 2},
+       {"ICH8 or ICH8R", 2},
+       {"ICH8DH", 2},
+       {"ICH8DO", 2},
+       {"ICH9", 2},
+       {"ICH9R", 2},
+       {"ICH9DH", 2},
+       {"631xESB/632xESB", 2},
+       {NULL,0}
+};
+
+/*
+ * This data only exists for exporting the supported PCI ids
+ * via MODULE_DEVICE_TABLE.  We do not actually register a
+ * pci_driver, because the I/O Controller Hub has also other
+ * functions that probably will be registered by other drivers.
+ */
+static struct pci_device_id iTCO_wdt_pci_tbl[] = {
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH     },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH0    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH2M   },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH3M   },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH4M   },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0,    PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_CICH    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH5    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1,       PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_6300ESB },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6M   },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH6W   },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M   },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DH  },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DO  },
+       { PCI_VENDOR_ID_INTEL, 0x2918,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9    },
+       { PCI_VENDOR_ID_INTEL, 0x2916,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9R    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH9DH    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2671,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2672,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2673,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2674,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2675,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2676,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2677,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2678,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x2679,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x267a,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x267b,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x267c,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x267d,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x267e,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { PCI_VENDOR_ID_INTEL, 0x267f,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_631XESB },
+       { 0, },                 /* End of list */
+};
+MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl);
+
+/* Address definitions for the TCO */
+#define        TCOBASE         iTCO_wdt_private.ACPIBASE + 0x60        /* TCO base address                */
+#define        SMI_EN          iTCO_wdt_private.ACPIBASE + 0x30        /* SMI Control and Enable Register */
+
+#define TCO_RLD                TCOBASE + 0x00  /* TCO Timer Reload and Current Value */
+#define TCOv1_TMR      TCOBASE + 0x01  /* TCOv1 Timer Initial Value    */
+#define        TCO_DAT_IN      TCOBASE + 0x02  /* TCO Data In Register         */
+#define        TCO_DAT_OUT     TCOBASE + 0x03  /* TCO Data Out Register        */
+#define        TCO1_STS        TCOBASE + 0x04  /* TCO1 Status Register         */
+#define        TCO2_STS        TCOBASE + 0x06  /* TCO2 Status Register         */
+#define TCO1_CNT       TCOBASE + 0x08  /* TCO1 Control Register        */
+#define TCO2_CNT       TCOBASE + 0x0a  /* TCO2 Control Register        */
+#define TCOv2_TMR      TCOBASE + 0x12  /* TCOv2 Timer Initial Value    */
+
+/* internal variables */
+static unsigned long is_active;
+static char expect_release;
+static struct {                                /* this is private data for the iTCO_wdt device */
+       unsigned int iTCO_version;      /* TCO version/generation */
+       unsigned long ACPIBASE;         /* The cards ACPIBASE address (TCOBASE = ACPIBASE+0x60) */
+       unsigned long __iomem *gcs;     /* NO_REBOOT flag is Memory-Mapped GCS register bit 5 (TCO version 2) */
+       spinlock_t io_lock;             /* the lock for io operations */
+       struct pci_dev *pdev;           /* the PCI-device */
+} iTCO_wdt_private;
+
+static struct platform_device *iTCO_wdt_platform_device;       /* the watchdog platform device */
+
+/* module parameters */
+#define WATCHDOG_HEARTBEAT 30  /* 30 sec default heartbeat */
+static int heartbeat = WATCHDOG_HEARTBEAT;  /* in seconds */
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/* iTCO Vendor Specific Support hooks */
+#ifdef CONFIG_ITCO_VENDOR_SUPPORT
+extern void iTCO_vendor_pre_start(unsigned long, unsigned int);
+extern void iTCO_vendor_pre_stop(unsigned long);
+extern void iTCO_vendor_pre_keepalive(unsigned long, unsigned int);
+extern void iTCO_vendor_pre_set_heartbeat(unsigned int);
+extern int iTCO_vendor_check_noreboot_on(void);
+#else
+#define iTCO_vendor_pre_start(acpibase, heartbeat)     {}
+#define iTCO_vendor_pre_stop(acpibase)                 {}
+#define iTCO_vendor_pre_keepalive(acpibase,heartbeat)  {}
+#define iTCO_vendor_pre_set_heartbeat(heartbeat)       {}
+#define iTCO_vendor_check_noreboot_on()                        1       /* 1=check noreboot; 0=don't check */
+#endif
+
+/*
+ * Some TCO specific functions
+ */
+
+static inline unsigned int seconds_to_ticks(int seconds)
+{
+       /* the internal timer is stored as ticks which decrement
+        * every 0.6 seconds */
+       return (seconds * 10) / 6;
+}
+
+static void iTCO_wdt_set_NO_REBOOT_bit(void)
+{
+       u32 val32;
+
+       /* Set the NO_REBOOT bit: this disables reboots */
+       if (iTCO_wdt_private.iTCO_version == 2) {
+               val32 = readl(iTCO_wdt_private.gcs);
+               val32 |= 0x00000020;
+               writel(val32, iTCO_wdt_private.gcs);
+       } else if (iTCO_wdt_private.iTCO_version == 1) {
+               pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
+               val32 |= 0x00000002;
+               pci_write_config_dword(iTCO_wdt_private.pdev, 0xd4, val32);
+       }
+}
+
+static int iTCO_wdt_unset_NO_REBOOT_bit(void)
+{
+       int ret = 0;
+       u32 val32;
+
+       /* Unset the NO_REBOOT bit: this enables reboots */
+       if (iTCO_wdt_private.iTCO_version == 2) {
+               val32 = readl(iTCO_wdt_private.gcs);
+               val32 &= 0xffffffdf;
+               writel(val32, iTCO_wdt_private.gcs);
+
+               val32 = readl(iTCO_wdt_private.gcs);
+               if (val32 & 0x00000020)
+                       ret = -EIO;
+       } else if (iTCO_wdt_private.iTCO_version == 1) {
+               pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
+               val32 &= 0xfffffffd;
+               pci_write_config_dword(iTCO_wdt_private.pdev, 0xd4, val32);
+
+               pci_read_config_dword(iTCO_wdt_private.pdev, 0xd4, &val32);
+               if (val32 & 0x00000002)
+                       ret = -EIO;
+       }
+
+       return ret; /* returns: 0 = OK, -EIO = Error */
+}
+
+static int iTCO_wdt_start(void)
+{
+       unsigned int val;
+
+       spin_lock(&iTCO_wdt_private.io_lock);
+
+       iTCO_vendor_pre_start(iTCO_wdt_private.ACPIBASE, heartbeat);
+
+       /* disable chipset's NO_REBOOT bit */
+       if (iTCO_wdt_unset_NO_REBOOT_bit()) {
+               printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
+               return -EIO;
+       }
+
+       /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */
+       val = inw(TCO1_CNT);
+       val &= 0xf7ff;
+       outw(val, TCO1_CNT);
+       val = inw(TCO1_CNT);
+       spin_unlock(&iTCO_wdt_private.io_lock);
+
+       if (val & 0x0800)
+               return -1;
+       return 0;
+}
+
+static int iTCO_wdt_stop(void)
+{
+       unsigned int val;
+
+       spin_lock(&iTCO_wdt_private.io_lock);
+
+       iTCO_vendor_pre_stop(iTCO_wdt_private.ACPIBASE);
+
+       /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */
+       val = inw(TCO1_CNT);
+       val |= 0x0800;
+       outw(val, TCO1_CNT);
+       val = inw(TCO1_CNT);
+
+       /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
+       iTCO_wdt_set_NO_REBOOT_bit();
+
+       spin_unlock(&iTCO_wdt_private.io_lock);
+
+       if ((val & 0x0800) == 0)
+               return -1;
+       return 0;
+}
+
+static int iTCO_wdt_keepalive(void)
+{
+       spin_lock(&iTCO_wdt_private.io_lock);
+
+       iTCO_vendor_pre_keepalive(iTCO_wdt_private.ACPIBASE, heartbeat);
+
+       /* Reload the timer by writing to the TCO Timer Counter register */
+       if (iTCO_wdt_private.iTCO_version == 2) {
+               outw(0x01, TCO_RLD);
+       } else if (iTCO_wdt_private.iTCO_version == 1) {
+               outb(0x01, TCO_RLD);
+       }
+
+       spin_unlock(&iTCO_wdt_private.io_lock);
+       return 0;
+}
+
+static int iTCO_wdt_set_heartbeat(int t)
+{
+       unsigned int val16;
+       unsigned char val8;
+       unsigned int tmrval;
+
+       tmrval = seconds_to_ticks(t);
+       /* from the specs: */
+       /* "Values of 0h-3h are ignored and should not be attempted" */
+       if (tmrval < 0x04)
+               return -EINVAL;
+       if (((iTCO_wdt_private.iTCO_version == 2) && (tmrval > 0x3ff)) ||
+           ((iTCO_wdt_private.iTCO_version == 1) && (tmrval > 0x03f)))
+               return -EINVAL;
+
+       iTCO_vendor_pre_set_heartbeat(tmrval);
+
+       /* Write new heartbeat to watchdog */
+       if (iTCO_wdt_private.iTCO_version == 2) {
+               spin_lock(&iTCO_wdt_private.io_lock);
+               val16 = inw(TCOv2_TMR);
+               val16 &= 0xfc00;
+               val16 |= tmrval;
+               outw(val16, TCOv2_TMR);
+               val16 = inw(TCOv2_TMR);
+               spin_unlock(&iTCO_wdt_private.io_lock);
+
+               if ((val16 & 0x3ff) != tmrval)
+                       return -EINVAL;
+       } else if (iTCO_wdt_private.iTCO_version == 1) {
+               spin_lock(&iTCO_wdt_private.io_lock);
+               val8 = inb(TCOv1_TMR);
+               val8 &= 0xc0;
+               val8 |= (tmrval & 0xff);
+               outb(val8, TCOv1_TMR);
+               val8 = inb(TCOv1_TMR);
+               spin_unlock(&iTCO_wdt_private.io_lock);
+
+               if ((val8 & 0x3f) != tmrval)
+                       return -EINVAL;
+       }
+
+       heartbeat = t;
+       return 0;
+}
+
+static int iTCO_wdt_get_timeleft (int *time_left)
+{
+       unsigned int val16;
+       unsigned char val8;
+
+       /* read the TCO Timer */
+       if (iTCO_wdt_private.iTCO_version == 2) {
+               spin_lock(&iTCO_wdt_private.io_lock);
+               val16 = inw(TCO_RLD);
+               val16 &= 0x3ff;
+               spin_unlock(&iTCO_wdt_private.io_lock);
+
+               *time_left = (val16 * 6) / 10;
+       } else if (iTCO_wdt_private.iTCO_version == 1) {
+               spin_lock(&iTCO_wdt_private.io_lock);
+               val8 = inb(TCO_RLD);
+               val8 &= 0x3f;
+               spin_unlock(&iTCO_wdt_private.io_lock);
+
+               *time_left = (val8 * 6) / 10;
+       } else
+               return -EINVAL;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int iTCO_wdt_open (struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+       if (test_and_set_bit(0, &is_active))
+               return -EBUSY;
+
+       /*
+        *      Reload and activate timer
+        */
+       iTCO_wdt_keepalive();
+       iTCO_wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+static int iTCO_wdt_release (struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        */
+       if (expect_release == 42) {
+               iTCO_wdt_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               iTCO_wdt_keepalive();
+       }
+       clear_bit(0, &is_active);
+       expect_release = 0;
+       return 0;
+}
+
+static ssize_t iTCO_wdt_write (struct file *file, const char __user *data,
+                             size_t len, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       expect_release = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_release = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               iTCO_wdt_keepalive();
+       }
+       return len;
+}
+
+static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
+                         unsigned int cmd, unsigned long arg)
+{
+       int new_options, retval = -EINVAL;
+       int new_heartbeat;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_SETTIMEOUT |
+                                       WDIOF_KEEPALIVEPING |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     0,
+               .identity =             DRV_NAME,
+       };
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident,
+                               sizeof (ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_KEEPALIVE:
+                       iTCO_wdt_keepalive();
+                       return 0;
+
+               case WDIOC_SETOPTIONS:
+               {
+                       if (get_user(new_options, p))
+                               return -EFAULT;
+
+                       if (new_options & WDIOS_DISABLECARD) {
+                               iTCO_wdt_stop();
+                               retval = 0;
+                       }
+
+                       if (new_options & WDIOS_ENABLECARD) {
+                               iTCO_wdt_keepalive();
+                               iTCO_wdt_start();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+
+               case WDIOC_SETTIMEOUT:
+               {
+                       if (get_user(new_heartbeat, p))
+                               return -EFAULT;
+
+                       if (iTCO_wdt_set_heartbeat(new_heartbeat))
+                               return -EINVAL;
+
+                       iTCO_wdt_keepalive();
+                       /* Fall */
+               }
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(heartbeat, p);
+
+               case WDIOC_GETTIMELEFT:
+               {
+                       int time_left;
+
+                       if (iTCO_wdt_get_timeleft(&time_left))
+                               return -EINVAL;
+
+                       return put_user(time_left, p);
+               }
+
+               default:
+                       return -ENOTTY;
+       }
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations iTCO_wdt_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .write =        iTCO_wdt_write,
+       .ioctl =        iTCO_wdt_ioctl,
+       .open =         iTCO_wdt_open,
+       .release =      iTCO_wdt_release,
+};
+
+static struct miscdevice iTCO_wdt_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &iTCO_wdt_fops,
+};
+
+/*
+ *     Init & exit routines
+ */
+
+static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, struct platform_device *dev)
+{
+       int ret;
+       u32 base_address;
+       unsigned long RCBA;
+       unsigned long val32;
+
+       /*
+        *      Find the ACPI/PM base I/O address which is the base
+        *      for the TCO registers (TCOBASE=ACPIBASE + 0x60)
+        *      ACPIBASE is bits [15:7] from 0x40-0x43
+        */
+       pci_read_config_dword(pdev, 0x40, &base_address);
+       base_address &= 0x0000ff80;
+       if (base_address == 0x00000000) {
+               /* Something's wrong here, ACPIBASE has to be set */
+               printk(KERN_ERR PFX "failed to get TCOBASE address\n");
+               pci_dev_put(pdev);
+               return -ENODEV;
+       }
+       iTCO_wdt_private.iTCO_version = iTCO_chipset_info[ent->driver_data].iTCO_version;
+       iTCO_wdt_private.ACPIBASE = base_address;
+       iTCO_wdt_private.pdev = pdev;
+
+       /* Get the Memory-Mapped GCS register, we need it for the NO_REBOOT flag (TCO v2) */
+       /* To get access to it you have to read RCBA from PCI Config space 0xf0
+          and use it as base. GCS = RCBA + ICH6_GCS(0x3410). */
+       if (iTCO_wdt_private.iTCO_version == 2) {
+               pci_read_config_dword(pdev, 0xf0, &base_address);
+               RCBA = base_address & 0xffffc000;
+               iTCO_wdt_private.gcs = ioremap((RCBA + 0x3410),4);
+       }
+
+       /* Check chipset's NO_REBOOT bit */
+       if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
+               printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
+               ret = -ENODEV;  /* Cannot reset NO_REBOOT bit */
+               goto out;
+       }
+
+       /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
+       iTCO_wdt_set_NO_REBOOT_bit();
+
+       /* Set the TCO_EN bit in SMI_EN register */
+       if (!request_region(SMI_EN, 4, "iTCO_wdt")) {
+               printk(KERN_ERR PFX "I/O address 0x%04lx already in use\n",
+                       SMI_EN );
+               ret = -EIO;
+               goto out;
+       }
+       val32 = inl(SMI_EN);
+       val32 &= 0xffffdfff;    /* Turn off SMI clearing watchdog */
+       outl(val32, SMI_EN);
+       release_region(SMI_EN, 4);
+
+       /* The TCO I/O registers reside in a 32-byte range pointed to by the TCOBASE value */
+       if (!request_region (TCOBASE, 0x20, "iTCO_wdt")) {
+               printk (KERN_ERR PFX "I/O address 0x%04lx already in use\n",
+                       TCOBASE);
+               ret = -EIO;
+               goto out;
+       }
+
+       printk(KERN_INFO PFX "Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n",
+               iTCO_chipset_info[ent->driver_data].name,
+               iTCO_chipset_info[ent->driver_data].iTCO_version,
+               TCOBASE);
+
+       /* Clear out the (probably old) status */
+       outb(0, TCO1_STS);
+       outb(3, TCO2_STS);
+
+       /* Make sure the watchdog is not running */
+       iTCO_wdt_stop();
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (iTCO_wdt_set_heartbeat(heartbeat)) {
+               iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT);
+               printk(KERN_INFO PFX "heartbeat value must be 2<heartbeat<39 (TCO v1) or 613 (TCO v2), using %d\n",
+                       heartbeat);
+       }
+
+       ret = misc_register(&iTCO_wdt_miscdev);
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto unreg_region;
+       }
+
+       printk (KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
+               heartbeat, nowayout);
+
+       return 0;
+
+unreg_region:
+       release_region (TCOBASE, 0x20);
+out:
+       if (iTCO_wdt_private.iTCO_version == 2)
+               iounmap(iTCO_wdt_private.gcs);
+       pci_dev_put(iTCO_wdt_private.pdev);
+       iTCO_wdt_private.ACPIBASE = 0;
+       return ret;
+}
+
+static void iTCO_wdt_cleanup(void)
+{
+       /* Stop the timer before we leave */
+       if (!nowayout)
+               iTCO_wdt_stop();
+
+       /* Deregister */
+       misc_deregister(&iTCO_wdt_miscdev);
+       release_region(TCOBASE, 0x20);
+       if (iTCO_wdt_private.iTCO_version == 2)
+               iounmap(iTCO_wdt_private.gcs);
+       pci_dev_put(iTCO_wdt_private.pdev);
+       iTCO_wdt_private.ACPIBASE = 0;
+}
+
+static int iTCO_wdt_probe(struct platform_device *dev)
+{
+       int found = 0;
+       struct pci_dev *pdev = NULL;
+       const struct pci_device_id *ent;
+
+       spin_lock_init(&iTCO_wdt_private.io_lock);
+
+       for_each_pci_dev(pdev) {
+               ent = pci_match_id(iTCO_wdt_pci_tbl, pdev);
+               if (ent) {
+                       if (!(iTCO_wdt_init(pdev, ent, dev))) {
+                               found++;
+                               break;
+                       }
+               }
+       }
+
+       if (!found) {
+               printk(KERN_INFO PFX "No card detected\n");
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+static int iTCO_wdt_remove(struct platform_device *dev)
+{
+       if (iTCO_wdt_private.ACPIBASE)
+               iTCO_wdt_cleanup();
+
+       return 0;
+}
+
+static void iTCO_wdt_shutdown(struct platform_device *dev)
+{
+       iTCO_wdt_stop();
+}
+
+#define iTCO_wdt_suspend NULL
+#define iTCO_wdt_resume  NULL
+
+static struct platform_driver iTCO_wdt_driver = {
+       .probe          = iTCO_wdt_probe,
+       .remove         = iTCO_wdt_remove,
+       .shutdown       = iTCO_wdt_shutdown,
+       .suspend        = iTCO_wdt_suspend,
+       .resume         = iTCO_wdt_resume,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = DRV_NAME,
+       },
+};
+
+static int __init iTCO_wdt_init_module(void)
+{
+       int err;
+
+       printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s (%s)\n",
+               DRV_VERSION, DRV_RELDATE);
+
+       err = platform_driver_register(&iTCO_wdt_driver);
+       if (err)
+               return err;
+
+       iTCO_wdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
+       if (IS_ERR(iTCO_wdt_platform_device)) {
+               err = PTR_ERR(iTCO_wdt_platform_device);
+               goto unreg_platform_driver;
+       }
+
+       return 0;
+
+unreg_platform_driver:
+       platform_driver_unregister(&iTCO_wdt_driver);
+       return err;
+}
+
+static void __exit iTCO_wdt_cleanup_module(void)
+{
+       platform_device_unregister(iTCO_wdt_platform_device);
+       platform_driver_unregister(&iTCO_wdt_driver);
+       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
+}
+
+module_init(iTCO_wdt_init_module);
+module_exit(iTCO_wdt_cleanup_module);
+
+MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>");
+MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver");
+MODULE_VERSION(DRV_VERSION);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c
new file mode 100644 (file)
index 0000000..c3a60f5
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ *     IB700 Single Board Computer WDT driver
+ *
+ *     (c) Copyright 2001 Charles Howes <chowes@vsol.net>
+ *
+ *     Based on advantechwdt.c which is based on acquirewdt.c which
+ *     is based on wdt.c.
+ *
+ *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
+ *
+ *     Based on acquirewdt.c which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ *
+ *     14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *          Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *          Added timeout module option to override default
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/moduleparam.h>
+#include <linux/platform_device.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+static struct platform_device *ibwdt_platform_device;
+static unsigned long ibwdt_is_open;
+static spinlock_t ibwdt_lock;
+static char expect_close;
+
+/* Module information */
+#define DRV_NAME "ib700wdt"
+#define PFX DRV_NAME ": "
+
+/*
+ *
+ * Watchdog Timer Configuration
+ *
+ * The function of the watchdog timer is to reset the system
+ * automatically and is defined at I/O port 0443H.  To enable the
+ * watchdog timer and allow the system to reset, write I/O port 0443H.
+ * To disable the timer, write I/O port 0441H for the system to stop the
+ * watchdog function.  The timer has a tolerance of 20% for its
+ * intervals.
+ *
+ * The following describes how the timer should be programmed.
+ *
+ * Enabling Watchdog:
+ * MOV AX,000FH (Choose the values from 0 to F)
+ * MOV DX,0443H
+ * OUT DX,AX
+ *
+ * Disabling Watchdog:
+ * MOV AX,000FH (Any value is fine.)
+ * MOV DX,0441H
+ * OUT DX,AX
+ *
+ * Watchdog timer control table:
+ * Level   Value  Time/sec | Level Value Time/sec
+ *   1       F       0     |   9     7      16
+ *   2       E       2     |   10    6      18
+ *   3       D       4     |   11    5      20
+ *   4       C       6     |   12    4      22
+ *   5       B       8     |   13    3      24
+ *   6       A       10    |   14    2      26
+ *   7       9       12    |   15    1      28
+ *   8       8       14    |   16    0      30
+ *
+ */
+
+static int wd_times[] = {
+       30,     /* 0x0 */
+       28,     /* 0x1 */
+       26,     /* 0x2 */
+       24,     /* 0x3 */
+       22,     /* 0x4 */
+       20,     /* 0x5 */
+       18,     /* 0x6 */
+       16,     /* 0x7 */
+       14,     /* 0x8 */
+       12,     /* 0x9 */
+       10,     /* 0xA */
+       8,      /* 0xB */
+       6,      /* 0xC */
+       4,      /* 0xD */
+       2,      /* 0xE */
+       0,      /* 0xF */
+};
+
+#define WDT_STOP 0x441
+#define WDT_START 0x443
+
+/* Default timeout */
+#define WD_TIMO 0              /* 30 seconds +/- 20%, from table */
+
+static int wd_margin = WD_TIMO;
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+
+/*
+ *     Watchdog Operations
+ */
+
+static void
+ibwdt_ping(void)
+{
+       spin_lock(&ibwdt_lock);
+
+       /* Write a watchdog value */
+       outb_p(wd_margin, WDT_START);
+
+       spin_unlock(&ibwdt_lock);
+}
+
+static void
+ibwdt_disable(void)
+{
+       spin_lock(&ibwdt_lock);
+       outb_p(0, WDT_STOP);
+       spin_unlock(&ibwdt_lock);
+}
+
+static int
+ibwdt_set_heartbeat(int t)
+{
+       int i;
+
+       if ((t < 0) || (t > 30))
+               return -EINVAL;
+
+       for (i = 0x0F; i > -1; i--)
+               if (wd_times[i] > t)
+                       break;
+       wd_margin = i;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static ssize_t
+ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               ibwdt_ping();
+       }
+       return count;
+}
+
+static int
+ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+         unsigned long arg)
+{
+       int new_margin;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "IB700 WDT",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+         if (copy_to_user(argp, &ident, sizeof(ident)))
+           return -EFAULT;
+         break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+         return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+         ibwdt_ping();
+         break;
+
+       case WDIOC_SETTIMEOUT:
+         if (get_user(new_margin, p))
+                 return -EFAULT;
+         if (ibwdt_set_heartbeat(new_margin))
+                 return -EINVAL;
+         ibwdt_ping();
+         /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+         return put_user(wd_times[wd_margin], p);
+
+       case WDIOC_SETOPTIONS:
+       {
+         int options, retval = -EINVAL;
+
+         if (get_user(options, p))
+           return -EFAULT;
+
+         if (options & WDIOS_DISABLECARD) {
+           ibwdt_disable();
+           retval = 0;
+         }
+
+         if (options & WDIOS_ENABLECARD) {
+           ibwdt_ping();
+           retval = 0;
+         }
+
+         return retval;
+       }
+
+       default:
+         return -ENOTTY;
+       }
+       return 0;
+}
+
+static int
+ibwdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &ibwdt_is_open)) {
+               return -EBUSY;
+       }
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Activate */
+       ibwdt_ping();
+       return nonseekable_open(inode, file);
+}
+
+static int
+ibwdt_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               ibwdt_disable();
+       } else {
+               printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
+               ibwdt_ping();
+       }
+       clear_bit(0, &ibwdt_is_open);
+       expect_close = 0;
+       return 0;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations ibwdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = ibwdt_write,
+       .ioctl          = ibwdt_ioctl,
+       .open           = ibwdt_open,
+       .release        = ibwdt_close,
+};
+
+static struct miscdevice ibwdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &ibwdt_fops,
+};
+
+/*
+ *     Init & exit routines
+ */
+
+static int __devinit ibwdt_probe(struct platform_device *dev)
+{
+       int res;
+
+       spin_lock_init(&ibwdt_lock);
+
+#if WDT_START != WDT_STOP
+       if (!request_region(WDT_STOP, 1, "IB700 WDT")) {
+               printk (KERN_ERR PFX "STOP method I/O %X is not available.\n", WDT_STOP);
+               res = -EIO;
+               goto out_nostopreg;
+       }
+#endif
+
+       if (!request_region(WDT_START, 1, "IB700 WDT")) {
+               printk (KERN_ERR PFX "START method I/O %X is not available.\n", WDT_START);
+               res = -EIO;
+               goto out_nostartreg;
+       }
+
+       res = misc_register(&ibwdt_miscdev);
+       if (res) {
+               printk (KERN_ERR PFX "failed to register misc device\n");
+               goto out_nomisc;
+       }
+       return 0;
+
+out_nomisc:
+       release_region(WDT_START, 1);
+out_nostartreg:
+#if WDT_START != WDT_STOP
+       release_region(WDT_STOP, 1);
+#endif
+out_nostopreg:
+       return res;
+}
+
+static int __devexit ibwdt_remove(struct platform_device *dev)
+{
+       misc_deregister(&ibwdt_miscdev);
+       release_region(WDT_START,1);
+#if WDT_START != WDT_STOP
+       release_region(WDT_STOP,1);
+#endif
+       return 0;
+}
+
+static void ibwdt_shutdown(struct platform_device *dev)
+{
+       /* Turn the WDT off if we have a soft shutdown */
+       ibwdt_disable();
+}
+
+static struct platform_driver ibwdt_driver = {
+       .probe          = ibwdt_probe,
+       .remove         = __devexit_p(ibwdt_remove),
+       .shutdown       = ibwdt_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = DRV_NAME,
+       },
+};
+
+static int __init ibwdt_init(void)
+{
+       int err;
+
+       printk(KERN_INFO PFX "WDT driver for IB700 single board computer initialising.\n");
+
+       err = platform_driver_register(&ibwdt_driver);
+       if (err)
+               return err;
+
+       ibwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0);
+       if (IS_ERR(ibwdt_platform_device)) {
+               err = PTR_ERR(ibwdt_platform_device);
+               goto unreg_platform_driver;
+       }
+
+       return 0;
+
+unreg_platform_driver:
+       platform_driver_unregister(&ibwdt_driver);
+       return err;
+}
+
+static void __exit ibwdt_exit(void)
+{
+       platform_device_unregister(ibwdt_platform_device);
+       platform_driver_unregister(&ibwdt_driver);
+       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
+}
+
+module_init(ibwdt_init);
+module_exit(ibwdt_exit);
+
+MODULE_AUTHOR("Charles Howes <chowes@vsol.net>");
+MODULE_DESCRIPTION("IB700 SBC watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+/* end of ib700wdt.c */
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c
new file mode 100644 (file)
index 0000000..94155f6
--- /dev/null
@@ -0,0 +1,403 @@
+/*
+ * IBM Automatic Server Restart driver.
+ *
+ * Copyright (c) 2005 Andrey Panin <pazke@donpac.ru>
+ *
+ * Based on driver written by Pete Reynolds.
+ * Copyright (c) IBM Corporation, 1998-2004.
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU Public License, incorporated herein by reference.
+ */
+
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/timer.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/dmi.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+
+enum {
+       ASMTYPE_UNKNOWN,
+       ASMTYPE_TOPAZ,
+       ASMTYPE_JASPER,
+       ASMTYPE_PEARL,
+       ASMTYPE_JUNIPER,
+       ASMTYPE_SPRUCE,
+};
+
+#define PFX "ibmasr: "
+
+#define TOPAZ_ASR_REG_OFFSET   4
+#define TOPAZ_ASR_TOGGLE       0x40
+#define TOPAZ_ASR_DISABLE      0x80
+
+/* PEARL ASR S/W REGISTER SUPERIO PORT ADDRESSES */
+#define PEARL_BASE     0xe04
+#define PEARL_WRITE    0xe06
+#define PEARL_READ     0xe07
+
+#define PEARL_ASR_DISABLE_MASK 0x80    /* bit 7: disable = 1, enable = 0 */
+#define PEARL_ASR_TOGGLE_MASK  0x40    /* bit 6: 0, then 1, then 0 */
+
+/* JASPER OFFSET FROM SIO BASE ADDR TO ASR S/W REGISTERS. */
+#define JASPER_ASR_REG_OFFSET  0x38
+
+#define JASPER_ASR_DISABLE_MASK        0x01    /* bit 0: disable = 1, enable = 0 */
+#define JASPER_ASR_TOGGLE_MASK 0x02    /* bit 1: 0, then 1, then 0 */
+
+#define JUNIPER_BASE_ADDRESS   0x54b   /* Base address of Juniper ASR */
+#define JUNIPER_ASR_DISABLE_MASK 0x01  /* bit 0: disable = 1 enable = 0 */
+#define JUNIPER_ASR_TOGGLE_MASK        0x02    /* bit 1: 0, then 1, then 0 */
+
+#define SPRUCE_BASE_ADDRESS    0x118e  /* Base address of Spruce ASR */
+#define SPRUCE_ASR_DISABLE_MASK        0x01    /* bit 1: disable = 1 enable = 0 */
+#define SPRUCE_ASR_TOGGLE_MASK 0x02    /* bit 0: 0, then 1, then 0 */
+
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+static unsigned long asr_is_open;
+static char asr_expect_close;
+
+static unsigned int asr_type, asr_base, asr_length;
+static unsigned int asr_read_addr, asr_write_addr;
+static unsigned char asr_toggle_mask, asr_disable_mask;
+
+static void asr_toggle(void)
+{
+       unsigned char reg = inb(asr_read_addr);
+
+       outb(reg & ~asr_toggle_mask, asr_write_addr);
+       reg = inb(asr_read_addr);
+
+       outb(reg | asr_toggle_mask, asr_write_addr);
+       reg = inb(asr_read_addr);
+
+       outb(reg & ~asr_toggle_mask, asr_write_addr);
+       reg = inb(asr_read_addr);
+}
+
+static void asr_enable(void)
+{
+       unsigned char reg;
+
+       if (asr_type == ASMTYPE_TOPAZ) {
+               /* asr_write_addr == asr_read_addr */
+               reg = inb(asr_read_addr);
+               outb(reg & ~(TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE),
+                    asr_read_addr);
+       } else {
+               /*
+                * First make sure the hardware timer is reset by toggling
+                * ASR hardware timer line.
+                */
+               asr_toggle();
+
+               reg = inb(asr_read_addr);
+               outb(reg & ~asr_disable_mask, asr_write_addr);
+       }
+       reg = inb(asr_read_addr);
+}
+
+static void asr_disable(void)
+{
+       unsigned char reg = inb(asr_read_addr);
+
+       if (asr_type == ASMTYPE_TOPAZ)
+               /* asr_write_addr == asr_read_addr */
+               outb(reg | TOPAZ_ASR_TOGGLE | TOPAZ_ASR_DISABLE,
+                    asr_read_addr);
+       else {
+               outb(reg | asr_toggle_mask, asr_write_addr);
+               reg = inb(asr_read_addr);
+
+               outb(reg | asr_disable_mask, asr_write_addr);
+       }
+       reg = inb(asr_read_addr);
+}
+
+static int __init asr_get_base_address(void)
+{
+       unsigned char low, high;
+       const char *type = "";
+
+       asr_length = 1;
+
+       switch (asr_type) {
+       case ASMTYPE_TOPAZ:
+               /* SELECT SuperIO CHIP FOR QUERYING (WRITE 0x07 TO BOTH 0x2E and 0x2F) */
+               outb(0x07, 0x2e);
+               outb(0x07, 0x2f);
+
+               /* SELECT AND READ THE HIGH-NIBBLE OF THE GPIO BASE ADDRESS */
+               outb(0x60, 0x2e);
+               high = inb(0x2f);
+
+               /* SELECT AND READ THE LOW-NIBBLE OF THE GPIO BASE ADDRESS */
+               outb(0x61, 0x2e);
+               low = inb(0x2f);
+
+               asr_base = (high << 16) | low;
+               asr_read_addr = asr_write_addr =
+                       asr_base + TOPAZ_ASR_REG_OFFSET;
+               asr_length = 5;
+
+               break;
+
+       case ASMTYPE_JASPER:
+               type = "Jaspers ";
+
+               /* FIXME: need to use pci_config_lock here, but it's not exported */
+
+/*             spin_lock_irqsave(&pci_config_lock, flags);*/
+
+               /* Select the SuperIO chip in the PCI I/O port register */
+               outl(0x8000f858, 0xcf8);
+
+               /*
+                * Read the base address for the SuperIO chip.
+                * Only the lower 16 bits are valid, but the address is word
+                * aligned so the last bit must be masked off.
+                */
+               asr_base = inl(0xcfc) & 0xfffe;
+
+/*             spin_unlock_irqrestore(&pci_config_lock, flags);*/
+
+               asr_read_addr = asr_write_addr =
+                       asr_base + JASPER_ASR_REG_OFFSET;
+               asr_toggle_mask = JASPER_ASR_TOGGLE_MASK;
+               asr_disable_mask = JASPER_ASR_DISABLE_MASK;
+               asr_length = JASPER_ASR_REG_OFFSET + 1;
+
+               break;
+
+       case ASMTYPE_PEARL:
+               type = "Pearls ";
+               asr_base = PEARL_BASE;
+               asr_read_addr = PEARL_READ;
+               asr_write_addr = PEARL_WRITE;
+               asr_toggle_mask = PEARL_ASR_TOGGLE_MASK;
+               asr_disable_mask = PEARL_ASR_DISABLE_MASK;
+               asr_length = 4;
+               break;
+
+       case ASMTYPE_JUNIPER:
+               type = "Junipers ";
+               asr_base = JUNIPER_BASE_ADDRESS;
+               asr_read_addr = asr_write_addr = asr_base;
+               asr_toggle_mask = JUNIPER_ASR_TOGGLE_MASK;
+               asr_disable_mask = JUNIPER_ASR_DISABLE_MASK;
+               break;
+
+       case ASMTYPE_SPRUCE:
+               type = "Spruce's ";
+               asr_base = SPRUCE_BASE_ADDRESS;
+               asr_read_addr = asr_write_addr = asr_base;
+               asr_toggle_mask = SPRUCE_ASR_TOGGLE_MASK;
+               asr_disable_mask = SPRUCE_ASR_DISABLE_MASK;
+               break;
+       }
+
+       if (!request_region(asr_base, asr_length, "ibmasr")) {
+               printk(KERN_ERR PFX "address %#x already in use\n",
+                       asr_base);
+               return -EBUSY;
+       }
+
+       printk(KERN_INFO PFX "found %sASR @ addr %#x\n", type, asr_base);
+
+       return 0;
+}
+
+
+static ssize_t asr_write(struct file *file, const char __user *buf,
+                        size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       asr_expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       asr_expect_close = 42;
+                       }
+               }
+               asr_toggle();
+       }
+       return count;
+}
+
+static int asr_ioctl(struct inode *inode, struct file *file,
+                    unsigned int cmd, unsigned long arg)
+{
+       static const struct watchdog_info ident = {
+               .options =      WDIOF_KEEPALIVEPING | 
+                               WDIOF_MAGICCLOSE,
+               .identity =     "IBM ASR"
+       };
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int heartbeat;
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident)) ?
+                               -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_KEEPALIVE:
+                       asr_toggle();
+                       return 0;
+
+               /*
+                * The hardware has a fixed timeout value, so no WDIOC_SETTIMEOUT
+                * and WDIOC_GETTIMEOUT always returns 256.
+                */
+               case WDIOC_GETTIMEOUT:
+                       heartbeat = 256;
+                       return put_user(heartbeat, p);
+
+               case WDIOC_SETOPTIONS: {
+                       int new_options, retval = -EINVAL;
+
+                       if (get_user(new_options, p))
+                               return -EFAULT;
+
+                       if (new_options & WDIOS_DISABLECARD) {
+                               asr_disable();
+                               retval = 0;
+                       }
+
+                       if (new_options & WDIOS_ENABLECARD) {
+                               asr_enable();
+                               asr_toggle();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+       }
+
+       return -ENOTTY;
+}
+
+static int asr_open(struct inode *inode, struct file *file)
+{
+       if(test_and_set_bit(0, &asr_is_open))
+               return -EBUSY;
+
+       asr_toggle();
+       asr_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static int asr_release(struct inode *inode, struct file *file)
+{
+       if (asr_expect_close == 42)
+               asr_disable();
+       else {
+               printk(KERN_CRIT PFX "unexpected close, not stopping watchdog!\n");
+               asr_toggle();
+       }
+       clear_bit(0, &asr_is_open);
+       asr_expect_close = 0;
+       return 0;
+}
+
+static const struct file_operations asr_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .write =        asr_write,
+       .ioctl =        asr_ioctl,
+       .open =         asr_open,
+       .release =      asr_release,
+};
+
+static struct miscdevice asr_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &asr_fops,
+};
+
+
+struct ibmasr_id {
+       const char *desc;
+       int type;
+};
+
+static struct ibmasr_id __initdata ibmasr_id_table[] = {
+       { "IBM Automatic Server Restart - eserver xSeries 220", ASMTYPE_TOPAZ },
+       { "IBM Automatic Server Restart - Machine Type 8673", ASMTYPE_PEARL },
+       { "IBM Automatic Server Restart - Machine Type 8480", ASMTYPE_JASPER },
+       { "IBM Automatic Server Restart - Machine Type 8482", ASMTYPE_JUNIPER },
+       { "IBM Automatic Server Restart - Machine Type 8648", ASMTYPE_SPRUCE },
+       { NULL }
+};
+
+static int __init ibmasr_init(void)
+{
+       struct ibmasr_id *id;
+       int rc;
+
+       for (id = ibmasr_id_table; id->desc; id++) {
+               if (dmi_find_device(DMI_DEV_TYPE_OTHER, id->desc, NULL)) {
+                       asr_type = id->type;
+                       break;
+               }
+       }
+
+       if (!asr_type)
+               return -ENODEV;
+
+       rc = asr_get_base_address();
+       if (rc)
+               return rc;
+
+       rc = misc_register(&asr_miscdev);
+       if (rc < 0) {
+               release_region(asr_base, asr_length);
+               printk(KERN_ERR PFX "failed to register misc device\n");
+               return rc;
+       }
+
+       return 0;
+}
+
+static void __exit ibmasr_exit(void)
+{
+       if (!nowayout)
+               asr_disable();
+
+       misc_deregister(&asr_miscdev);
+
+       release_region(asr_base, asr_length);
+}
+
+module_init(ibmasr_init);
+module_exit(ibmasr_exit);
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+MODULE_DESCRIPTION("IBM Automatic Server Restart driver");
+MODULE_AUTHOR("Andrey Panin");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c
new file mode 100644 (file)
index 0000000..788245b
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ *     IndyDog 0.3     A Hardware Watchdog Device for SGI IP22
+ *
+ *     (c) Copyright 2002 Guido Guenther <agx@sigxcpu.org>, All Rights Reserved.
+ *
+ *     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.
+ *
+ *     based on softdog.c by Alan Cox <alan@redhat.com>
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <asm/uaccess.h>
+#include <asm/sgi/mc.h>
+
+#define PFX "indydog: "
+static int indydog_alive;
+
+#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static void indydog_start(void)
+{
+       u32 mc_ctrl0 = sgimc->cpuctrl0;
+
+       mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
+       sgimc->cpuctrl0 = mc_ctrl0;
+}
+
+static void indydog_stop(void)
+{
+       u32 mc_ctrl0 = sgimc->cpuctrl0;
+
+       mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
+       sgimc->cpuctrl0 = mc_ctrl0;
+
+       printk(KERN_INFO PFX "Stopped watchdog timer.\n");
+}
+
+static void indydog_ping(void)
+{
+       sgimc->watchdogt = 0;
+}
+
+/*
+ *     Allow only one person to hold it open
+ */
+static int indydog_open(struct inode *inode, struct file *file)
+{
+       if (indydog_alive)
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Activate timer */
+       indydog_start();
+       indydog_ping();
+
+       indydog_alive = 1;
+       printk(KERN_INFO "Started watchdog timer.\n");
+
+       return nonseekable_open(inode, file);
+}
+
+static int indydog_release(struct inode *inode, struct file *file)
+{
+       /* Shut off the timer.
+        * Lock it in if it's a module and we defined ...NOWAYOUT */
+       if (!nowayout)
+               indydog_stop();         /* Turn the WDT off */
+
+       indydog_alive = 0;
+
+       return 0;
+}
+
+static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       /* Refresh the timer. */
+       if (len) {
+               indydog_ping();
+       }
+       return len;
+}
+
+static int indydog_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       int options, retval = -EINVAL;
+       static struct watchdog_info ident = {
+               .options                = WDIOF_KEEPALIVEPING |
+                                         WDIOF_MAGICCLOSE,
+               .firmware_version       = 0,
+               .identity               = "Hardware Watchdog for SGI IP22",
+       };
+
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       if (copy_to_user((struct watchdog_info *)arg,
+                                        &ident, sizeof(ident)))
+                               return -EFAULT;
+                       return 0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0,(int *)arg);
+               case WDIOC_KEEPALIVE:
+                       indydog_ping();
+                       return 0;
+               case WDIOC_GETTIMEOUT:
+                       return put_user(WATCHDOG_TIMEOUT,(int *)arg);
+               case WDIOC_SETOPTIONS:
+               {
+                       if (get_user(options, (int *)arg))
+                               return -EFAULT;
+
+                       if (options & WDIOS_DISABLECARD) {
+                               indydog_stop();
+                               retval = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               indydog_start();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+       }
+}
+
+static int indydog_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+               indydog_stop();         /* Turn the WDT off */
+
+       return NOTIFY_DONE;
+}
+
+static const struct file_operations indydog_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = indydog_write,
+       .ioctl          = indydog_ioctl,
+       .open           = indydog_open,
+       .release        = indydog_release,
+};
+
+static struct miscdevice indydog_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &indydog_fops,
+};
+
+static struct notifier_block indydog_notifier = {
+       .notifier_call = indydog_notify_sys,
+};
+
+static char banner[] __initdata =
+       KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
+
+static int __init watchdog_init(void)
+{
+       int ret;
+
+       ret = register_reboot_notifier(&indydog_notifier);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               return ret;
+       }
+
+       ret = misc_register(&indydog_miscdev);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               unregister_reboot_notifier(&indydog_notifier);
+               return ret;
+       }
+
+       printk(banner);
+
+       return 0;
+}
+
+static void __exit watchdog_exit(void)
+{
+       misc_deregister(&indydog_miscdev);
+       unregister_reboot_notifier(&indydog_notifier);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_exit);
+
+MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>");
+MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/iop_wdt.c b/drivers/watchdog/iop_wdt.c
new file mode 100644 (file)
index 0000000..bbbd91a
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * drivers/char/watchdog/iop_wdt.c
+ *
+ * WDT driver for Intel I/O Processors
+ * Copyright (C) 2005, Intel Corporation.
+ *
+ * Based on ixp4xx driver, Copyright 2004 (c) MontaVista, Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ *     Curt E Bruns <curt.e.bruns@intel.com>
+ *     Peter Milne <peter.milne@d-tacq.com>
+ *     Dan Williams <dan.j.williams@intel.com>
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/uaccess.h>
+#include <asm/hardware.h>
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+static unsigned long wdt_status;
+static unsigned long boot_status;
+
+#define WDT_IN_USE             0
+#define WDT_OK_TO_CLOSE                1
+#define WDT_ENABLED            2
+
+static unsigned long iop_watchdog_timeout(void)
+{
+       return (0xffffffffUL / get_iop_tick_rate());
+}
+
+/**
+ * wdt_supports_disable - determine if we are accessing a iop13xx watchdog
+ * or iop3xx by whether it has a disable command
+ */
+static int wdt_supports_disable(void)
+{
+       int can_disable;
+
+       if (IOP_WDTCR_EN_ARM != IOP_WDTCR_DIS_ARM)
+               can_disable = 1;
+       else
+               can_disable = 0;
+
+       return can_disable;
+}
+
+static void wdt_enable(void)
+{
+       /* Arm and enable the Timer to starting counting down from 0xFFFF.FFFF
+        * Takes approx. 10.7s to timeout
+        */
+       write_wdtcr(IOP_WDTCR_EN_ARM);
+       write_wdtcr(IOP_WDTCR_EN);
+}
+
+/* returns 0 if the timer was successfully disabled */
+static int wdt_disable(void)
+{
+       /* Stop Counting */
+       if (wdt_supports_disable()) {
+               write_wdtcr(IOP_WDTCR_DIS_ARM);
+               write_wdtcr(IOP_WDTCR_DIS);
+               clear_bit(WDT_ENABLED, &wdt_status);
+               printk(KERN_INFO "WATCHDOG: Disabled\n");
+               return 0;
+       } else
+               return 1;
+}
+
+static int iop_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
+               return -EBUSY;
+
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       wdt_enable();
+
+       set_bit(WDT_ENABLED, &wdt_status);
+
+       return nonseekable_open(inode, file);
+}
+
+static ssize_t
+iop_wdt_write(struct file *file, const char *data, size_t len,
+                 loff_t *ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                       }
+               }
+               wdt_enable();
+       }
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
+       .identity = "iop watchdog",
+};
+
+static int
+iop_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+                 unsigned long arg)
+{
+       int options;
+       int ret = -ENOTTY;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user
+                   ((struct watchdog_info *)arg, &ident, sizeof ident))
+                       ret = -EFAULT;
+               else
+                       ret = 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+               ret = put_user(0, (int *)arg);
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(boot_status, (int *)arg);
+               break;
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(iop_watchdog_timeout(), (int *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+
+       case WDIOC_SETOPTIONS:
+               if (get_user(options, (int *)arg))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       if (!nowayout) {
+                               if (wdt_disable() == 0) {
+                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                                       ret = 0;
+                               } else
+                                       ret = -ENXIO;
+                       } else
+                               ret = 0;
+               }
+
+               if (options & WDIOS_ENABLECARD) {
+                       wdt_enable();
+                       ret = 0;
+               }
+               break;
+       }
+
+       return ret;
+}
+
+static int iop_wdt_release(struct inode *inode, struct file *file)
+{
+       int state = 1;
+       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
+               if (test_bit(WDT_ENABLED, &wdt_status))
+                       state = wdt_disable();
+
+       /* if the timer is not disbaled reload and notify that we are still
+        * going down
+        */
+       if (state != 0) {
+               wdt_enable();
+               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
+                      "reset in %lu seconds\n", iop_watchdog_timeout());
+       }
+
+       clear_bit(WDT_IN_USE, &wdt_status);
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       return 0;
+}
+
+static const struct file_operations iop_wdt_fops = {
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = iop_wdt_write,
+       .ioctl = iop_wdt_ioctl,
+       .open = iop_wdt_open,
+       .release = iop_wdt_release,
+};
+
+static struct miscdevice iop_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &iop_wdt_fops,
+};
+
+static int __init iop_wdt_init(void)
+{
+       int ret;
+
+       ret = misc_register(&iop_wdt_miscdev);
+       if (ret == 0)
+               printk("iop watchdog timer: timeout %lu sec\n",
+                      iop_watchdog_timeout());
+
+       /* check if the reset was caused by the watchdog timer */
+       boot_status = (read_rcsr() & IOP_RCSR_WDT) ? WDIOF_CARDRESET : 0;
+
+       /* Configure Watchdog Timeout to cause an Internal Bus (IB) Reset
+        * NOTE: An IB Reset will Reset both cores in the IOP342
+        */
+       write_wdtsr(IOP13XX_WDTCR_IB_RESET);
+
+       return ret;
+}
+
+static void __exit iop_wdt_exit(void)
+{
+       misc_deregister(&iop_wdt_miscdev);
+}
+
+module_init(iop_wdt_init);
+module_exit(iop_wdt_exit);
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
+
+MODULE_AUTHOR("Curt E Bruns <curt.e.bruns@intel.com>");
+MODULE_DESCRIPTION("iop watchdog timer driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/ixp2000_wdt.c b/drivers/watchdog/ixp2000_wdt.c
new file mode 100644 (file)
index 0000000..dc7548d
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * drivers/char/watchdog/ixp2000_wdt.c
+ *
+ * Watchdog driver for Intel IXP2000 network processors
+ *
+ * Adapted from the IXP4xx watchdog driver by Lennert Buytenhek.
+ * The original version carries these notices:
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * Copyright 2004 (c) MontaVista, Software, Inc.
+ * Based on sa1100 driver, Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
+ *
+ * This file is licensed under  the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/init.h>
+#include <linux/bitops.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+static unsigned int heartbeat = 60;    /* (secs) Default is 1 minute */
+static unsigned long wdt_status;
+
+#define        WDT_IN_USE              0
+#define        WDT_OK_TO_CLOSE         1
+
+static unsigned long wdt_tick_rate;
+
+static void
+wdt_enable(void)
+{
+       ixp2000_reg_write(IXP2000_RESET0, *(IXP2000_RESET0) | WDT_RESET_ENABLE);
+       ixp2000_reg_write(IXP2000_TWDE, WDT_ENABLE);
+       ixp2000_reg_write(IXP2000_T4_CLD, heartbeat * wdt_tick_rate);
+       ixp2000_reg_write(IXP2000_T4_CTL, TIMER_DIVIDER_256 | TIMER_ENABLE);
+}
+
+static void
+wdt_disable(void)
+{
+       ixp2000_reg_write(IXP2000_T4_CTL, 0);
+}
+
+static void
+wdt_keepalive(void)
+{
+       ixp2000_reg_write(IXP2000_T4_CLD, heartbeat * wdt_tick_rate);
+}
+
+static int
+ixp2000_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
+               return -EBUSY;
+
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       wdt_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static ssize_t
+ixp2000_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                       }
+               }
+               wdt_keepalive();
+       }
+
+       return len;
+}
+
+
+static struct watchdog_info ident = {
+       .options        = WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT |
+                               WDIOF_KEEPALIVEPING,
+       .identity       = "IXP2000 Watchdog",
+};
+
+static int
+ixp2000_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+                       unsigned long arg)
+{
+       int ret = -ENOTTY;
+       int time;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user((struct watchdog_info *)arg, &ident,
+                                  sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+               ret = put_user(0, (int *)arg);
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(0, (int *)arg);
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(time, (int *)arg);
+               if (ret)
+                       break;
+
+               if (time <= 0 || time > 60) {
+                       ret = -EINVAL;
+                       break;
+               }
+
+               heartbeat = time;
+               wdt_keepalive();
+               /* Fall through */
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(heartbeat, (int *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+       }
+
+       return ret;
+}
+
+static int
+ixp2000_wdt_release(struct inode *inode, struct file *file)
+{
+       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) {
+               wdt_disable();
+       } else {
+               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
+                                       "timer will not stop\n");
+       }
+
+       clear_bit(WDT_IN_USE, &wdt_status);
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       return 0;
+}
+
+
+static const struct file_operations ixp2000_wdt_fops =
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = ixp2000_wdt_write,
+       .ioctl          = ixp2000_wdt_ioctl,
+       .open           = ixp2000_wdt_open,
+       .release        = ixp2000_wdt_release,
+};
+
+static struct miscdevice ixp2000_wdt_miscdev =
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &ixp2000_wdt_fops,
+};
+
+static int __init ixp2000_wdt_init(void)
+{
+       if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) {
+               printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n");
+               return -EIO;
+       }
+
+       wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256;
+
+       return misc_register(&ixp2000_wdt_miscdev);
+}
+
+static void __exit ixp2000_wdt_exit(void)
+{
+       misc_deregister(&ixp2000_wdt_miscdev);
+}
+
+module_init(ixp2000_wdt_init);
+module_exit(ixp2000_wdt_exit);
+
+MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
+MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog");
+
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds (default 60s)");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c
new file mode 100644 (file)
index 0000000..5864bb8
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * drivers/char/watchdog/ixp4xx_wdt.c
+ *
+ * Watchdog driver for Intel IXP4xx network processors
+ *
+ * Author: Deepak Saxena <dsaxena@plexity.net>
+ *
+ * Copyright 2004 (c) MontaVista, Software, Inc.
+ * Based on sa1100 driver, Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
+ *
+ * This file is licensed under  the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/init.h>
+#include <linux/bitops.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+static int heartbeat = 60;     /* (secs) Default is 1 minute */
+static unsigned long wdt_status;
+static unsigned long boot_status;
+
+#define WDT_TICK_RATE (IXP4XX_PERIPHERAL_BUS_CLOCK * 1000000UL)
+
+#define        WDT_IN_USE              0
+#define        WDT_OK_TO_CLOSE         1
+
+static void
+wdt_enable(void)
+{
+       *IXP4XX_OSWK = IXP4XX_WDT_KEY;
+       *IXP4XX_OSWE = 0;
+       *IXP4XX_OSWT = WDT_TICK_RATE * heartbeat;
+       *IXP4XX_OSWE = IXP4XX_WDT_COUNT_ENABLE | IXP4XX_WDT_RESET_ENABLE;
+       *IXP4XX_OSWK = 0;
+}
+
+static void
+wdt_disable(void)
+{
+       *IXP4XX_OSWK = IXP4XX_WDT_KEY;
+       *IXP4XX_OSWE = 0;
+       *IXP4XX_OSWK = 0;
+}
+
+static int
+ixp4xx_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
+               return -EBUSY;
+
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       wdt_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static ssize_t
+ixp4xx_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                       }
+               }
+               wdt_enable();
+       }
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options        = WDIOF_CARDRESET | WDIOF_MAGICCLOSE |
+                         WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+       .identity       = "IXP4xx Watchdog",
+};
+
+
+static int
+ixp4xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+                       unsigned long arg)
+{
+       int ret = -ENOTTY;
+       int time;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user((struct watchdog_info *)arg, &ident,
+                                  sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+               ret = put_user(0, (int *)arg);
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(boot_status, (int *)arg);
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(time, (int *)arg);
+               if (ret)
+                       break;
+
+               if (time <= 0 || time > 60) {
+                       ret = -EINVAL;
+                       break;
+               }
+
+               heartbeat = time;
+               wdt_enable();
+               /* Fall through */
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(heartbeat, (int *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+       }
+       return ret;
+}
+
+static int
+ixp4xx_wdt_release(struct inode *inode, struct file *file)
+{
+       if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) {
+               wdt_disable();
+       } else {
+               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
+                                       "timer will not stop\n");
+       }
+
+       clear_bit(WDT_IN_USE, &wdt_status);
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       return 0;
+}
+
+
+static const struct file_operations ixp4xx_wdt_fops =
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = ixp4xx_wdt_write,
+       .ioctl          = ixp4xx_wdt_ioctl,
+       .open           = ixp4xx_wdt_open,
+       .release        = ixp4xx_wdt_release,
+};
+
+static struct miscdevice ixp4xx_wdt_miscdev =
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &ixp4xx_wdt_fops,
+};
+
+static int __init ixp4xx_wdt_init(void)
+{
+       int ret;
+       unsigned long processor_id;
+
+       asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
+       if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
+               printk("IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected - "
+                       "watchdog disabled\n");
+
+               return -ENODEV;
+       }
+
+       ret = misc_register(&ixp4xx_wdt_miscdev);
+       if (ret == 0)
+               printk("IXP4xx Watchdog Timer: heartbeat %d sec\n", heartbeat);
+
+       boot_status = (*IXP4XX_OSST & IXP4XX_OSST_TIMER_WARM_RESET) ?
+                       WDIOF_CARDRESET : 0;
+
+       return ret;
+}
+
+static void __exit ixp4xx_wdt_exit(void)
+{
+       misc_deregister(&ixp4xx_wdt_miscdev);
+}
+
+
+module_init(ixp4xx_wdt_init);
+module_exit(ixp4xx_wdt_exit);
+
+MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
+MODULE_DESCRIPTION("IXP4xx Network Processor Watchdog");
+
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds (default 60s)");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
new file mode 100644 (file)
index 0000000..7150fb9
--- /dev/null
@@ -0,0 +1,308 @@
+/*
+ * Watchdog driver for Kendin/Micrel KS8695.
+ *
+ * (C) 2007 Andrew Victor
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+#include <linux/watchdog.h>
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/arch/regs-timer.h>
+
+
+#define WDT_DEFAULT_TIME       5       /* seconds */
+#define WDT_MAX_TIME           171     /* seconds */
+
+static int wdt_time = WDT_DEFAULT_TIME;
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+module_param(wdt_time, int, 0);
+MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="__MODULE_STRING(WDT_DEFAULT_TIME) ")");
+
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+#endif
+
+
+static unsigned long ks8695wdt_busy;
+
+/* ......................................................................... */
+
+/*
+ * Disable the watchdog.
+ */
+static void inline ks8695_wdt_stop(void)
+{
+       unsigned long tmcon;
+
+       /* disable timer0 */
+       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
+       __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+}
+
+/*
+ * Enable and reset the watchdog.
+ */
+static void inline ks8695_wdt_start(void)
+{
+       unsigned long tmcon;
+       unsigned long tval = wdt_time * CLOCK_TICK_RATE;
+
+       /* disable timer0 */
+       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
+       __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+
+       /* program timer0 */
+       __raw_writel(tval | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
+
+       /* re-enable timer0 */
+       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
+       __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+}
+
+/*
+ * Reload the watchdog timer.  (ie, pat the watchdog)
+ */
+static void inline ks8695_wdt_reload(void)
+{
+       unsigned long tmcon;
+
+       /* disable, then re-enable timer0 */
+       tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
+       __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+       __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+}
+
+/*
+ * Change the watchdog time interval.
+ */
+static int ks8695_wdt_settimeout(int new_time)
+{
+       /*
+        * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
+        *
+        * Since WDV is a 16-bit counter, the maximum period is
+        * 65536 / 0.256 = 256 seconds.
+        */
+       if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
+               return -EINVAL;
+
+       /* Set new watchdog time. It will be used when ks8695_wdt_start() is called. */
+       wdt_time = new_time;
+       return 0;
+}
+
+/* ......................................................................... */
+
+/*
+ * Watchdog device is opened, and watchdog starts running.
+ */
+static int ks8695_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &ks8695wdt_busy))
+               return -EBUSY;
+
+       ks8695_wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+/*
+ * Close the watchdog device.
+ * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
+ *  disabled.
+ */
+static int ks8695_wdt_close(struct inode *inode, struct file *file)
+{
+       if (!nowayout)
+               ks8695_wdt_stop();      /* Disable the watchdog when file is closed */
+
+       clear_bit(0, &ks8695wdt_busy);
+       return 0;
+}
+
+static struct watchdog_info ks8695_wdt_info = {
+       .identity       = "ks8695 watchdog",
+       .options        = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+};
+
+/*
+ * Handle commands from user-space.
+ */
+static int ks8695_wdt_ioctl(struct inode *inode, struct file *file,
+               unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_value;
+
+       switch(cmd) {
+               case WDIOC_KEEPALIVE:
+                       ks8695_wdt_reload();    /* pat the watchdog */
+                       return 0;
+
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ks8695_wdt_info, sizeof(ks8695_wdt_info)) ? -EFAULT : 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_value, p))
+                               return -EFAULT;
+
+                       if (ks8695_wdt_settimeout(new_value))
+                               return -EINVAL;
+
+                       /* Enable new time value */
+                       ks8695_wdt_start();
+
+                       /* Return current value */
+                       return put_user(wdt_time, p);
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(wdt_time, p);
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_SETOPTIONS:
+                       if (get_user(new_value, p))
+                               return -EFAULT;
+
+                       if (new_value & WDIOS_DISABLECARD)
+                               ks8695_wdt_stop();
+                       if (new_value & WDIOS_ENABLECARD)
+                               ks8695_wdt_start();
+                       return 0;
+
+               default:
+                       return -ENOTTY;
+       }
+}
+
+/*
+ * Pat the watchdog whenever device is written to.
+ */
+static ssize_t ks8695_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       ks8695_wdt_reload();            /* pat the watchdog */
+       return len;
+}
+
+/* ......................................................................... */
+
+static const struct file_operations ks8695wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .ioctl          = ks8695_wdt_ioctl,
+       .open           = ks8695_wdt_open,
+       .release        = ks8695_wdt_close,
+       .write          = ks8695_wdt_write,
+};
+
+static struct miscdevice ks8695wdt_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &ks8695wdt_fops,
+};
+
+static int __init ks8695wdt_probe(struct platform_device *pdev)
+{
+       int res;
+
+       if (ks8695wdt_miscdev.parent)
+               return -EBUSY;
+       ks8695wdt_miscdev.parent = &pdev->dev;
+
+       res = misc_register(&ks8695wdt_miscdev);
+       if (res)
+               return res;
+
+       printk("KS8695 Watchdog Timer enabled (%d seconds%s)\n", wdt_time, nowayout ? ", nowayout" : "");
+       return 0;
+}
+
+static int __exit ks8695wdt_remove(struct platform_device *pdev)
+{
+       int res;
+
+       res = misc_deregister(&ks8695wdt_miscdev);
+       if (!res)
+               ks8695wdt_miscdev.parent = NULL;
+
+       return res;
+}
+
+static void ks8695wdt_shutdown(struct platform_device *pdev)
+{
+       ks8695_wdt_stop();
+}
+
+#ifdef CONFIG_PM
+
+static int ks8695wdt_suspend(struct platform_device *pdev, pm_message_t message)
+{
+       ks8695_wdt_stop();
+       return 0;
+}
+
+static int ks8695wdt_resume(struct platform_device *pdev)
+{
+       if (ks8695wdt_busy)
+               ks8695_wdt_start();
+       return 0;
+}
+
+#else
+#define ks8695wdt_suspend NULL
+#define ks8695wdt_resume       NULL
+#endif
+
+static struct platform_driver ks8695wdt_driver = {
+       .probe          = ks8695wdt_probe,
+       .remove         = __exit_p(ks8695wdt_remove),
+       .shutdown       = ks8695wdt_shutdown,
+       .suspend        = ks8695wdt_suspend,
+       .resume         = ks8695wdt_resume,
+       .driver         = {
+               .name   = "ks8695_wdt",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __init ks8695_wdt_init(void)
+{
+       /* Check that the heartbeat value is within range; if not reset to the default */
+       if (ks8695_wdt_settimeout(wdt_time)) {
+               ks8695_wdt_settimeout(WDT_DEFAULT_TIME);
+               pr_info("ks8695_wdt: wdt_time value must be 1 <= wdt_time <= %i, using %d\n", wdt_time, WDT_MAX_TIME);
+       }
+
+       return platform_driver_register(&ks8695wdt_driver);
+}
+
+static void __exit ks8695_wdt_exit(void)
+{
+       platform_driver_unregister(&ks8695wdt_driver);
+}
+
+module_init(ks8695_wdt_init);
+module_exit(ks8695_wdt_exit);
+
+MODULE_AUTHOR("Andrew Victor");
+MODULE_DESCRIPTION("Watchdog driver for KS8695");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
new file mode 100644 (file)
index 0000000..6d35bb1
--- /dev/null
@@ -0,0 +1,489 @@
+/*
+ *  MachZ ZF-Logic Watchdog Timer driver for Linux
+ *
+ *
+ *  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 author does NOT admit liability nor provide warranty for
+ *  any of this software. This material is provided "AS-IS" in
+ *  the hope that it may be useful for others.
+ *
+ *  Author: Fernando Fuganti <fuganti@conectiva.com.br>
+ *
+ *  Based on sbc60xxwdt.c by Jakob Oestergaard
+ *
+ *
+ *  We have two timers (wd#1, wd#2) driven by a 32 KHz clock with the
+ *  following periods:
+ *      wd#1 - 2 seconds;
+ *      wd#2 - 7.2 ms;
+ *  After the expiration of wd#1, it can generate a NMI, SCI, SMI, or
+ *  a system RESET and it starts wd#2 that unconditionaly will RESET
+ *  the system when the counter reaches zero.
+ *
+ *  14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *      Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+/* ports */
+#define ZF_IOBASE      0x218
+#define INDEX          0x218
+#define DATA_B         0x219
+#define DATA_W         0x21A
+#define DATA_D         0x21A
+
+/* indexes */                  /* size */
+#define ZFL_VERSION    0x02    /* 16   */
+#define CONTROL        0x10    /* 16   */
+#define STATUS         0x12    /* 8    */
+#define COUNTER_1      0x0C    /* 16   */
+#define COUNTER_2      0x0E    /* 8    */
+#define PULSE_LEN      0x0F    /* 8    */
+
+/* controls */
+#define ENABLE_WD1     0x0001
+#define ENABLE_WD2     0x0002
+#define RESET_WD1      0x0010
+#define RESET_WD2      0x0020
+#define GEN_SCI                0x0100
+#define GEN_NMI                0x0200
+#define GEN_SMI                0x0400
+#define GEN_RESET      0x0800
+
+
+/* utilities */
+
+#define WD1    0
+#define WD2    1
+
+#define zf_writew(port, data)  { outb(port, INDEX); outw(data, DATA_W); }
+#define zf_writeb(port, data)  { outb(port, INDEX); outb(data, DATA_B); }
+#define zf_get_ZFL_version()   zf_readw(ZFL_VERSION)
+
+
+static unsigned short zf_readw(unsigned char port)
+{
+       outb(port, INDEX);
+       return inw(DATA_W);
+}
+
+
+MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>");
+MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+#define PFX "machzwd"
+
+static struct watchdog_info zf_info = {
+       .options                = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
+       .firmware_version       = 1,
+       .identity               = "ZF-Logic watchdog",
+};
+
+
+/*
+ * action refers to action taken when watchdog resets
+ * 0 = GEN_RESET
+ * 1 = GEN_SMI
+ * 2 = GEN_NMI
+ * 3 = GEN_SCI
+ * defaults to GEN_RESET (0)
+ */
+static int action = 0;
+module_param(action, int, 0);
+MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*)  1 = SMI  2 = NMI  3 = SCI");
+
+static void zf_ping(unsigned long data);
+
+static int zf_action = GEN_RESET;
+static unsigned long zf_is_open;
+static char zf_expect_close;
+static spinlock_t zf_lock;
+static spinlock_t zf_port_lock;
+static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
+static unsigned long next_heartbeat = 0;
+
+
+/* timeout for user land heart beat (10 seconds) */
+#define ZF_USER_TIMEO (HZ*10)
+
+/* timeout for hardware watchdog (~500ms) */
+#define ZF_HW_TIMEO (HZ/2)
+
+/* number of ticks on WD#1 (driven by a 32KHz clock, 2s) */
+#define ZF_CTIMEOUT 0xffff
+
+#ifndef ZF_DEBUG
+#      define dprintk(format, args...)
+#else
+#      define dprintk(format, args...) printk(KERN_DEBUG PFX ":%s:%d: " format, __FUNCTION__, __LINE__ , ## args)
+#endif
+
+
+static inline void zf_set_status(unsigned char new)
+{
+       zf_writeb(STATUS, new);
+}
+
+
+/* CONTROL register functions */
+
+static inline unsigned short zf_get_control(void)
+{
+       return zf_readw(CONTROL);
+}
+
+static inline void zf_set_control(unsigned short new)
+{
+       zf_writew(CONTROL, new);
+}
+
+
+/* WD#? counter functions */
+/*
+ *     Just set counter value
+ */
+
+static inline void zf_set_timer(unsigned short new, unsigned char n)
+{
+       switch(n){
+               case WD1:
+                       zf_writew(COUNTER_1, new);
+               case WD2:
+                       zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
+               default:
+                       return;
+       }
+}
+
+/*
+ * stop hardware timer
+ */
+static void zf_timer_off(void)
+{
+       unsigned int ctrl_reg = 0;
+       unsigned long flags;
+
+       /* stop internal ping */
+       del_timer_sync(&zf_timer);
+
+       spin_lock_irqsave(&zf_port_lock, flags);
+       /* stop watchdog timer */
+       ctrl_reg = zf_get_control();
+       ctrl_reg |= (ENABLE_WD1|ENABLE_WD2);    /* disable wd1 and wd2 */
+       ctrl_reg &= ~(ENABLE_WD1|ENABLE_WD2);
+       zf_set_control(ctrl_reg);
+       spin_unlock_irqrestore(&zf_port_lock, flags);
+
+       printk(KERN_INFO PFX ": Watchdog timer is now disabled\n");
+}
+
+
+/*
+ * start hardware timer
+ */
+static void zf_timer_on(void)
+{
+       unsigned int ctrl_reg = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&zf_port_lock, flags);
+
+       zf_writeb(PULSE_LEN, 0xff);
+
+       zf_set_timer(ZF_CTIMEOUT, WD1);
+
+       /* user land ping */
+       next_heartbeat = jiffies + ZF_USER_TIMEO;
+
+       /* start the timer for internal ping */
+       mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
+
+       /* start watchdog timer */
+       ctrl_reg = zf_get_control();
+       ctrl_reg |= (ENABLE_WD1|zf_action);
+       zf_set_control(ctrl_reg);
+       spin_unlock_irqrestore(&zf_port_lock, flags);
+
+       printk(KERN_INFO PFX ": Watchdog timer is now enabled\n");
+}
+
+
+static void zf_ping(unsigned long data)
+{
+       unsigned int ctrl_reg = 0;
+       unsigned long flags;
+
+       zf_writeb(COUNTER_2, 0xff);
+
+       if(time_before(jiffies, next_heartbeat)){
+
+               dprintk("time_before: %ld\n", next_heartbeat - jiffies);
+
+               /*
+                * reset event is activated by transition from 0 to 1 on
+                * RESET_WD1 bit and we assume that it is already zero...
+                */
+
+               spin_lock_irqsave(&zf_port_lock, flags);
+               ctrl_reg = zf_get_control();
+               ctrl_reg |= RESET_WD1;
+               zf_set_control(ctrl_reg);
+
+               /* ...and nothing changes until here */
+               ctrl_reg &= ~(RESET_WD1);
+               zf_set_control(ctrl_reg);
+               spin_unlock_irqrestore(&zf_port_lock, flags);
+
+               mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
+       }else{
+               printk(KERN_CRIT PFX ": I will reset your machine\n");
+       }
+}
+
+static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
+                                                               loff_t *ppos)
+{
+       /* See if we got the magic character */
+       if(count){
+
+               /*
+                * no need to check for close confirmation
+                * no way to disable watchdog ;)
+                */
+               if (!nowayout) {
+                       size_t ofs;
+
+                       /*
+                        * note: just in case someone wrote the magic character
+                        * five months ago...
+                        */
+                       zf_expect_close = 0;
+
+                       /* now scan */
+                       for (ofs = 0; ofs != count; ofs++){
+                               char c;
+                               if (get_user(c, buf + ofs))
+                                       return -EFAULT;
+                               if (c == 'V'){
+                                       zf_expect_close = 42;
+                                       dprintk("zf_expect_close = 42\n");
+                               }
+                       }
+               }
+
+               /*
+                * Well, anyhow someone wrote to us,
+                * we should return that favour
+                */
+               next_heartbeat = jiffies + ZF_USER_TIMEO;
+               dprintk("user ping at %ld\n", jiffies);
+
+       }
+
+       return count;
+}
+
+static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &zf_info, sizeof(zf_info)))
+                       return -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+               zf_ping(0);
+               break;
+
+       default:
+               return -ENOTTY;
+       }
+
+       return 0;
+}
+
+static int zf_open(struct inode *inode, struct file *file)
+{
+       spin_lock(&zf_lock);
+       if(test_and_set_bit(0, &zf_is_open)) {
+               spin_unlock(&zf_lock);
+               return -EBUSY;
+       }
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       spin_unlock(&zf_lock);
+
+       zf_timer_on();
+
+       return nonseekable_open(inode, file);
+}
+
+static int zf_close(struct inode *inode, struct file *file)
+{
+       if(zf_expect_close == 42){
+               zf_timer_off();
+       } else {
+               del_timer(&zf_timer);
+               printk(KERN_ERR PFX ": device file closed unexpectedly. Will not stop the WDT!\n");
+       }
+
+       spin_lock(&zf_lock);
+       clear_bit(0, &zf_is_open);
+       spin_unlock(&zf_lock);
+
+       zf_expect_close = 0;
+
+       return 0;
+}
+
+/*
+ * Notifier for system down
+ */
+
+static int zf_notify_sys(struct notifier_block *this, unsigned long code,
+                                                               void *unused)
+{
+       if(code == SYS_DOWN || code == SYS_HALT){
+               zf_timer_off();
+       }
+
+       return NOTIFY_DONE;
+}
+
+
+
+
+static const struct file_operations zf_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = zf_write,
+       .ioctl          = zf_ioctl,
+       .open           = zf_open,
+       .release        = zf_close,
+};
+
+static struct miscdevice zf_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &zf_fops,
+};
+
+/*
+ * The device needs to learn about soft shutdowns in order to
+ * turn the timebomb registers off.
+ */
+static struct notifier_block zf_notifier = {
+       .notifier_call = zf_notify_sys,
+};
+
+static void __init zf_show_action(int act)
+{
+       char *str[] = { "RESET", "SMI", "NMI", "SCI" };
+
+       printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]);
+}
+
+static int __init zf_init(void)
+{
+       int ret;
+
+       printk(KERN_INFO PFX ": MachZ ZF-Logic Watchdog driver initializing.\n");
+
+       ret = zf_get_ZFL_version();
+       if ((!ret) || (ret == 0xffff)) {
+               printk(KERN_WARNING PFX ": no ZF-Logic found\n");
+               return -ENODEV;
+       }
+
+       if((action <= 3) && (action >= 0)){
+               zf_action = zf_action>>action;
+       } else
+               action = 0;
+
+       zf_show_action(action);
+
+       spin_lock_init(&zf_lock);
+       spin_lock_init(&zf_port_lock);
+
+       if(!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")){
+               printk(KERN_ERR "cannot reserve I/O ports at %d\n",
+                                                       ZF_IOBASE);
+               ret = -EBUSY;
+               goto no_region;
+       }
+
+       ret = register_reboot_notifier(&zf_notifier);
+       if(ret){
+               printk(KERN_ERR "can't register reboot notifier (err=%d)\n",
+                                                                       ret);
+               goto no_reboot;
+       }
+
+       ret = misc_register(&zf_miscdev);
+       if (ret){
+               printk(KERN_ERR "can't misc_register on minor=%d\n",
+                                                       WATCHDOG_MINOR);
+               goto no_misc;
+       }
+
+       zf_set_status(0);
+       zf_set_control(0);
+
+       return 0;
+
+no_misc:
+       unregister_reboot_notifier(&zf_notifier);
+no_reboot:
+       release_region(ZF_IOBASE, 3);
+no_region:
+       return ret;
+}
+
+
+static void __exit zf_exit(void)
+{
+       zf_timer_off();
+
+       misc_deregister(&zf_miscdev);
+       unregister_reboot_notifier(&zf_notifier);
+       release_region(ZF_IOBASE, 3);
+}
+
+module_init(zf_init);
+module_exit(zf_exit);
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
new file mode 100644 (file)
index 0000000..1adf1d5
--- /dev/null
@@ -0,0 +1,330 @@
+/*
+ * MixCom Watchdog: A Simple Hardware Watchdog Device
+ * Based on Softdog driver by Alan Cox and PC Watchdog driver by Ken Hollis
+ *
+ * Author: Gergely Madarasz <gorgo@itc.hu>
+ *
+ * Copyright (c) 1999 ITConsult-Pro Co. <info@itc.hu>
+ *
+ * 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.
+ *
+ * Version 0.1 (99/04/15):
+ *             - first version
+ *
+ * Version 0.2 (99/06/16):
+ *             - added kernel timer watchdog ping after close
+ *               since the hardware does not support watchdog shutdown
+ *
+ * Version 0.3 (99/06/21):
+ *             - added WDIOC_GETSTATUS and WDIOC_GETSUPPORT ioctl calls
+ *
+ * Version 0.3.1 (99/06/22):
+ *             - allow module removal while internal timer is active,
+ *               print warning about probable reset
+ *
+ * Version 0.4 (99/11/15):
+ *             - support for one more type board
+ *
+ * Version 0.5 (2001/12/14) Matt Domsch <Matt_Domsch@dell.com>
+ *             - added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *
+ * Version 0.6 (2002/04/12): Rob Radez <rob@osinvestor.com>
+ *             - make mixcomwd_opened unsigned,
+ *               removed lock_kernel/unlock_kernel from mixcomwd_release,
+ *               modified ioctl a bit to conform to API
+ *
+ */
+
+#define VERSION "0.6"
+#define WATCHDOG_NAME "mixcomwd"
+#define PFX WATCHDOG_NAME ": "
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/ioport.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+/*
+ * We have two types of cards that can be probed:
+ * 1) The Mixcom cards: these cards can be found at addresses
+ *    0x180, 0x280, 0x380 with an additional offset of 0xc10.
+ *    (Or 0xd90, 0xe90, 0xf90).
+ * 2) The FlashCOM cards: these cards can be set up at
+ *    0x300 -> 0x378, in 0x8 jumps with an offset of 0x04.
+ *    (Or 0x304 -> 0x37c in 0x8 jumps).
+ *    Each card has it's own ID.
+ */
+#define MIXCOM_ID 0x11
+#define FLASHCOM_ID 0x18
+static struct {
+       int ioport;
+       int id;
+} mixcomwd_io_info[] __devinitdata = {
+       /* The Mixcom cards */
+       {0x0d90, MIXCOM_ID},
+       {0x0e90, MIXCOM_ID},
+       {0x0f90, MIXCOM_ID},
+       /* The FlashCOM cards */
+       {0x0304, FLASHCOM_ID},
+       {0x030c, FLASHCOM_ID},
+       {0x0314, FLASHCOM_ID},
+       {0x031c, FLASHCOM_ID},
+       {0x0324, FLASHCOM_ID},
+       {0x032c, FLASHCOM_ID},
+       {0x0334, FLASHCOM_ID},
+       {0x033c, FLASHCOM_ID},
+       {0x0344, FLASHCOM_ID},
+       {0x034c, FLASHCOM_ID},
+       {0x0354, FLASHCOM_ID},
+       {0x035c, FLASHCOM_ID},
+       {0x0364, FLASHCOM_ID},
+       {0x036c, FLASHCOM_ID},
+       {0x0374, FLASHCOM_ID},
+       {0x037c, FLASHCOM_ID},
+       /* The end of the list */
+       {0x0000, 0},
+};
+
+static void mixcomwd_timerfun(unsigned long d);
+
+static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
+
+static int watchdog_port;
+static int mixcomwd_timer_alive;
+static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0);
+static char expect_close;
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static void mixcomwd_ping(void)
+{
+       outb_p(55,watchdog_port);
+       return;
+}
+
+static void mixcomwd_timerfun(unsigned long d)
+{
+       mixcomwd_ping();
+
+       mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
+}
+
+/*
+ *     Allow only one person to hold it open
+ */
+
+static int mixcomwd_open(struct inode *inode, struct file *file)
+{
+       if(test_and_set_bit(0,&mixcomwd_opened)) {
+               return -EBUSY;
+       }
+       mixcomwd_ping();
+
+       if (nowayout) {
+               /*
+                * fops_get() code via open() has already done
+                * a try_module_get() so it is safe to do the
+                * __module_get().
+                */
+               __module_get(THIS_MODULE);
+       } else {
+               if(mixcomwd_timer_alive) {
+                       del_timer(&mixcomwd_timer);
+                       mixcomwd_timer_alive=0;
+               }
+       }
+       return nonseekable_open(inode, file);
+}
+
+static int mixcomwd_release(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               if(mixcomwd_timer_alive) {
+                       printk(KERN_ERR PFX "release called while internal timer alive");
+                       return -EBUSY;
+               }
+               mixcomwd_timer_alive=1;
+               mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
+       } else {
+               printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
+       }
+
+       clear_bit(0,&mixcomwd_opened);
+       expect_close=0;
+       return 0;
+}
+
+
+static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
+{
+       if(len)
+       {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               mixcomwd_ping();
+       }
+       return len;
+}
+
+static int mixcomwd_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int status;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "MixCOM watchdog",
+       };
+
+       switch(cmd)
+       {
+               case WDIOC_GETSTATUS:
+                       status=mixcomwd_opened;
+                       if (!nowayout) {
+                               status|=mixcomwd_timer_alive;
+                       }
+                       if (copy_to_user(p, &status, sizeof(int))) {
+                               return -EFAULT;
+                       }
+                       break;
+               case WDIOC_GETBOOTSTATUS:
+                       if (copy_to_user(p, &status, sizeof(int))) {
+                               return -EFAULT;
+                       }
+                       break;
+               case WDIOC_GETSUPPORT:
+                       if (copy_to_user(argp, &ident, sizeof(ident))) {
+                               return -EFAULT;
+                       }
+                       break;
+               case WDIOC_KEEPALIVE:
+                       mixcomwd_ping();
+                       break;
+               default:
+                       return -ENOTTY;
+       }
+       return 0;
+}
+
+static const struct file_operations mixcomwd_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = mixcomwd_write,
+       .ioctl          = mixcomwd_ioctl,
+       .open           = mixcomwd_open,
+       .release        = mixcomwd_release,
+};
+
+static struct miscdevice mixcomwd_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &mixcomwd_fops,
+};
+
+static int __init checkcard(int port, int card_id)
+{
+       int id;
+
+       if (!request_region(port, 1, "MixCOM watchdog")) {
+               return 0;
+       }
+
+       id=inb_p(port);
+       if (card_id==MIXCOM_ID)
+               id &= 0x3f;
+
+       if (id!=card_id) {
+               release_region(port, 1);
+               return 0;
+       }
+       return 1;
+}
+
+static int __init mixcomwd_init(void)
+{
+       int i;
+       int ret;
+       int found=0;
+
+       for (i = 0; !found && mixcomwd_io_info[i].ioport != 0; i++) {
+               if (checkcard(mixcomwd_io_info[i].ioport,
+                             mixcomwd_io_info[i].id)) {
+                       found = 1;
+                       watchdog_port = mixcomwd_io_info[i].ioport;
+               }
+       }
+
+       if (!found) {
+               printk(KERN_ERR PFX "No card detected, or port not available.\n");
+               return -ENODEV;
+       }
+
+       ret = misc_register(&mixcomwd_miscdev);
+       if (ret)
+       {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto error_misc_register_watchdog;
+       }
+
+       printk(KERN_INFO "MixCOM watchdog driver v%s, watchdog port at 0x%3x\n",
+               VERSION, watchdog_port);
+
+       return 0;
+
+error_misc_register_watchdog:
+       release_region(watchdog_port, 1);
+       watchdog_port = 0x0000;
+       return ret;
+}
+
+static void __exit mixcomwd_exit(void)
+{
+       if (!nowayout) {
+               if(mixcomwd_timer_alive) {
+                       printk(KERN_WARNING PFX "I quit now, hardware will"
+                              " probably reboot!\n");
+                       del_timer_sync(&mixcomwd_timer);
+                       mixcomwd_timer_alive=0;
+               }
+       }
+       misc_deregister(&mixcomwd_miscdev);
+       release_region(watchdog_port,1);
+}
+
+module_init(mixcomwd_init);
+module_exit(mixcomwd_exit);
+
+MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>");
+MODULE_DESCRIPTION("MixCom Watchdog driver");
+MODULE_VERSION(VERSION);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wdt.c
new file mode 100644 (file)
index 0000000..9cfb975
--- /dev/null
@@ -0,0 +1,286 @@
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/io.h>
+#include <linux/spinlock.h>
+#include <asm/of_platform.h>
+#include <asm/uaccess.h>
+#include <asm/mpc52xx.h>
+
+
+#define GPT_MODE_WDT           (1<<15)
+#define GPT_MODE_CE            (1<<12)
+#define GPT_MODE_MS_TIMER      (0x4)
+
+
+struct mpc5200_wdt {
+       unsigned count; /* timer ticks before watchdog kicks in */
+       long ipb_freq;
+       struct miscdevice miscdev;
+       struct resource mem;
+       struct mpc52xx_gpt __iomem *regs;
+       spinlock_t io_lock;
+};
+
+/* is_active stores wether or not the /dev/watchdog device is opened */
+static unsigned long is_active;
+
+/* misc devices don't provide a way, to get back to 'dev' or 'miscdev' from
+ * file operations, which sucks. But there can be max 1 watchdog anyway, so...
+ */
+static struct mpc5200_wdt *wdt_global;
+
+
+/* helper to calculate timeout in timer counts */
+static void mpc5200_wdt_set_timeout(struct mpc5200_wdt *wdt, int timeout)
+{
+       /* use biggest prescaler of 64k */
+       wdt->count = (wdt->ipb_freq + 0xffff) / 0x10000 * timeout;
+
+       if (wdt->count > 0xffff)
+               wdt->count = 0xffff;
+}
+/* return timeout in seconds (calculated from timer count) */
+static int mpc5200_wdt_get_timeout(struct mpc5200_wdt *wdt)
+{
+       return wdt->count * 0x10000 / wdt->ipb_freq;
+}
+
+
+/* watchdog operations */
+static int mpc5200_wdt_start(struct mpc5200_wdt *wdt)
+{
+       spin_lock(&wdt->io_lock);
+       /* disable */
+       out_be32(&wdt->regs->mode, 0);
+       /* set timeout, with maximum prescaler */
+       out_be32(&wdt->regs->count, 0x0 | wdt->count);
+       /* enable watchdog */
+       out_be32(&wdt->regs->mode, GPT_MODE_CE | GPT_MODE_WDT | GPT_MODE_MS_TIMER);
+       spin_unlock(&wdt->io_lock);
+
+       return 0;
+}
+static int mpc5200_wdt_ping(struct mpc5200_wdt *wdt)
+{
+       spin_lock(&wdt->io_lock);
+       /* writing A5 to OCPW resets the watchdog */
+       out_be32(&wdt->regs->mode, 0xA5000000 | (0xffffff & in_be32(&wdt->regs->mode)));
+       spin_unlock(&wdt->io_lock);
+       return 0;
+}
+static int mpc5200_wdt_stop(struct mpc5200_wdt *wdt)
+{
+       spin_lock(&wdt->io_lock);
+       /* disable */
+       out_be32(&wdt->regs->mode, 0);
+       spin_unlock(&wdt->io_lock);
+       return 0;
+}
+
+
+/* file operations */
+static ssize_t mpc5200_wdt_write(struct file *file, const char __user *data,
+               size_t len, loff_t *ppos)
+{
+       struct mpc5200_wdt *wdt = file->private_data;
+       mpc5200_wdt_ping(wdt);
+       return 0;
+}
+static struct watchdog_info mpc5200_wdt_info = {
+       .options        = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+       .identity       = "mpc5200 watchdog on GPT0",
+};
+static int mpc5200_wdt_ioctl(struct inode *inode, struct file *file,
+               unsigned int cmd, unsigned long arg)
+{
+       struct mpc5200_wdt *wdt = file->private_data;
+       int __user *data = (int __user *)arg;
+       int timeout;
+       int ret = 0;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user(data, &mpc5200_wdt_info,
+                       sizeof(mpc5200_wdt_info));
+               if (ret)
+                       ret = -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(0, data);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               mpc5200_wdt_ping(wdt);
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(timeout, data);
+               if (ret)
+                       break;
+               mpc5200_wdt_set_timeout(wdt, timeout);
+               mpc5200_wdt_start(wdt);
+               /* fall through and return the timeout */
+
+       case WDIOC_GETTIMEOUT:
+               timeout = mpc5200_wdt_get_timeout(wdt);
+               ret = put_user(timeout, data);
+               break;
+
+       default:
+               ret = -ENOTTY;
+       }
+       return ret;
+}
+static int mpc5200_wdt_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+       if (test_and_set_bit(0, &is_active))
+               return -EBUSY;
+
+       /* Set and activate the watchdog */
+       mpc5200_wdt_set_timeout(wdt_global, 30);
+       mpc5200_wdt_start(wdt_global);
+       file->private_data = wdt_global;
+       return nonseekable_open(inode, file);
+}
+static int mpc5200_wdt_release(struct inode *inode, struct file *file)
+{
+#if WATCHDOG_NOWAYOUT == 0
+       struct mpc5200_wdt *wdt = file->private_data;
+       mpc5200_wdt_stop(wdt);
+       wdt->count = 0;         /* == disabled */
+#endif
+       clear_bit(0, &is_active);
+       return 0;
+}
+
+static struct file_operations mpc5200_wdt_fops = {
+       .owner  = THIS_MODULE,
+       .write  = mpc5200_wdt_write,
+       .ioctl  = mpc5200_wdt_ioctl,
+       .open   = mpc5200_wdt_open,
+       .release = mpc5200_wdt_release,
+};
+
+/* module operations */
+static int mpc5200_wdt_probe(struct of_device *op, const struct of_device_id *match)
+{
+       struct mpc5200_wdt *wdt;
+       int err;
+       const void *has_wdt;
+       int size;
+
+       has_wdt = of_get_property(op->node, "has-wdt", NULL);
+       if (!has_wdt)
+               return -ENODEV;
+
+       wdt = kzalloc(sizeof(*wdt), GFP_KERNEL);
+       if (!wdt)
+               return -ENOMEM;
+
+       wdt->ipb_freq = mpc52xx_find_ipb_freq(op->node);
+
+       err = of_address_to_resource(op->node, 0, &wdt->mem);
+       if (err)
+               goto out_free;
+       size = wdt->mem.end - wdt->mem.start + 1;
+       if (!request_mem_region(wdt->mem.start, size, "mpc5200_wdt")) {
+               err = -ENODEV;
+               goto out_free;
+       }
+       wdt->regs = ioremap(wdt->mem.start, size);
+       if (!wdt->regs) {
+               err = -ENODEV;
+               goto out_release;
+       }
+
+       dev_set_drvdata(&op->dev, wdt);
+       spin_lock_init(&wdt->io_lock);
+
+       wdt->miscdev = (struct miscdevice) {
+               .minor  = WATCHDOG_MINOR,
+               .name   = "watchdog",
+               .fops   = &mpc5200_wdt_fops,
+               .parent = &op->dev,
+       };
+       wdt_global = wdt;
+       err = misc_register(&wdt->miscdev);
+       if (!err)
+               return 0;
+
+       iounmap(wdt->regs);
+ out_release:
+       release_mem_region(wdt->mem.start, size);
+ out_free:
+       kfree(wdt);
+       return err;
+}
+
+static int mpc5200_wdt_remove(struct of_device *op)
+{
+       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
+
+       mpc5200_wdt_stop(wdt);
+       misc_deregister(&wdt->miscdev);
+       iounmap(wdt->regs);
+       release_mem_region(wdt->mem.start, wdt->mem.end - wdt->mem.start + 1);
+       kfree(wdt);
+
+       return 0;
+}
+static int mpc5200_wdt_suspend(struct of_device *op, pm_message_t state)
+{
+       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
+       mpc5200_wdt_stop(wdt);
+       return 0;
+}
+static int mpc5200_wdt_resume(struct of_device *op)
+{
+       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
+       if (wdt->count)
+               mpc5200_wdt_start(wdt);
+       return 0;
+}
+static int mpc5200_wdt_shutdown(struct of_device *op)
+{
+       struct mpc5200_wdt *wdt = dev_get_drvdata(&op->dev);
+       mpc5200_wdt_stop(wdt);
+       return 0;
+}
+
+static struct of_device_id mpc5200_wdt_match[] = {
+       { .compatible = "mpc5200-gpt", },
+       {},
+};
+static struct of_platform_driver mpc5200_wdt_driver = {
+       .owner          = THIS_MODULE,
+       .name           = "mpc5200-gpt-wdt",
+       .match_table    = mpc5200_wdt_match,
+       .probe          = mpc5200_wdt_probe,
+       .remove         = mpc5200_wdt_remove,
+       .suspend        = mpc5200_wdt_suspend,
+       .resume         = mpc5200_wdt_resume,
+       .shutdown       = mpc5200_wdt_shutdown,
+};
+
+
+static int __init mpc5200_wdt_init(void)
+{
+       return of_register_platform_driver(&mpc5200_wdt_driver);
+}
+
+static void __exit mpc5200_wdt_exit(void)
+{
+       of_unregister_platform_driver(&mpc5200_wdt_driver);
+}
+
+module_init(mpc5200_wdt_init);
+module_exit(mpc5200_wdt_exit);
+
+MODULE_AUTHOR("Domen Puncer <domen.puncer@telargo.com>");
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/mpc83xx_wdt.c b/drivers/watchdog/mpc83xx_wdt.c
new file mode 100644 (file)
index 0000000..a0bf95f
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * mpc83xx_wdt.c - MPC83xx watchdog userspace interface
+ *
+ * Authors: Dave Updegraff <dave@cray.org>
+ *         Kumar Gala <galak@kernel.crashing.org>
+ *             Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org>
+ *                             ..and from sc520_wdt
+ *
+ * Note: it appears that you can only actually ENABLE or DISABLE the thing
+ * once after POR. Once enabled, you cannot disable, and vice versa.
+ *
+ * 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.
+ */
+
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+struct mpc83xx_wdt {
+       __be32 res0;
+       __be32 swcrr; /* System watchdog control register */
+#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */
+#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */
+#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/
+#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */
+       __be32 swcnr; /* System watchdog count register */
+       u8 res1[2];
+       __be16 swsrr; /* System watchdog service register */
+       u8 res2[0xF0];
+};
+
+static struct mpc83xx_wdt __iomem *wd_base;
+
+static u16 timeout = 0xffff;
+module_param(timeout, ushort, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
+
+static int reset = 1;
+module_param(reset, bool, 0);
+MODULE_PARM_DESC(reset, "Watchdog Interrupt/Reset Mode. 0 = interrupt, 1 = reset");
+
+/*
+ * We always prescale, but if someone really doesn't want to they can set this
+ * to 0
+ */
+static int prescale = 1;
+static unsigned int timeout_sec;
+
+static unsigned long wdt_is_open;
+static spinlock_t wdt_spinlock;
+
+static void mpc83xx_wdt_keepalive(void)
+{
+       /* Ping the WDT */
+       spin_lock(&wdt_spinlock);
+       out_be16(&wd_base->swsrr, 0x556c);
+       out_be16(&wd_base->swsrr, 0xaa39);
+       spin_unlock(&wdt_spinlock);
+}
+
+static ssize_t mpc83xx_wdt_write(struct file *file, const char __user *buf,
+                                size_t count, loff_t *ppos)
+{
+       if (count)
+               mpc83xx_wdt_keepalive();
+       return count;
+}
+
+static int mpc83xx_wdt_open(struct inode *inode, struct file *file)
+{
+       u32 tmp = SWCRR_SWEN;
+       if (test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+
+       /* Once we start the watchdog we can't stop it */
+       __module_get(THIS_MODULE);
+
+       /* Good, fire up the show */
+       if (prescale)
+               tmp |= SWCRR_SWPR;
+       if (reset)
+               tmp |= SWCRR_SWRI;
+
+       tmp |= timeout << 16;
+
+       out_be32(&wd_base->swcrr, tmp);
+
+       return nonseekable_open(inode, file);
+}
+
+static int mpc83xx_wdt_release(struct inode *inode, struct file *file)
+{
+       printk(KERN_CRIT "Unexpected close, not stopping watchdog!\n");
+       mpc83xx_wdt_keepalive();
+       clear_bit(0, &wdt_is_open);
+       return 0;
+}
+
+static int mpc83xx_wdt_ioctl(struct inode *inode, struct file *file,
+                               unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING,
+               .firmware_version = 1,
+               .identity = "MPC83xx",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+       case WDIOC_KEEPALIVE:
+               mpc83xx_wdt_keepalive();
+               return 0;
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout_sec, p);
+       default:
+               return -ENOTTY;
+       }
+}
+
+static const struct file_operations mpc83xx_wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = mpc83xx_wdt_write,
+       .ioctl          = mpc83xx_wdt_ioctl,
+       .open           = mpc83xx_wdt_open,
+       .release        = mpc83xx_wdt_release,
+};
+
+static struct miscdevice mpc83xx_wdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &mpc83xx_wdt_fops,
+};
+
+static int __devinit mpc83xx_wdt_probe(struct platform_device *dev)
+{
+       struct resource *r;
+       int ret;
+       unsigned int *freq = dev->dev.platform_data;
+
+       /* get a pointer to the register memory */
+       r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+
+       if (!r) {
+               ret = -ENODEV;
+               goto err_out;
+       }
+
+       wd_base = ioremap(r->start, sizeof (struct mpc83xx_wdt));
+
+       if (wd_base == NULL) {
+               ret = -ENOMEM;
+               goto err_out;
+       }
+
+       ret = misc_register(&mpc83xx_wdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR "cannot register miscdev on minor=%d "
+                               "(err=%d)\n",
+                               WATCHDOG_MINOR, ret);
+               goto err_unmap;
+       }
+
+       /* Calculate the timeout in seconds */
+       if (prescale)
+               timeout_sec = (timeout * 0x10000) / (*freq);
+       else
+               timeout_sec = timeout / (*freq);
+
+       printk(KERN_INFO "WDT driver for MPC83xx initialized. "
+               "mode:%s timeout=%d (%d seconds)\n",
+               reset ? "reset":"interrupt", timeout, timeout_sec);
+
+       spin_lock_init(&wdt_spinlock);
+
+       return 0;
+
+err_unmap:
+       iounmap(wd_base);
+err_out:
+       return ret;
+}
+
+static int __devexit mpc83xx_wdt_remove(struct platform_device *dev)
+{
+       misc_deregister(&mpc83xx_wdt_miscdev);
+       iounmap(wd_base);
+
+       return 0;
+}
+
+static struct platform_driver mpc83xx_wdt_driver = {
+       .probe          = mpc83xx_wdt_probe,
+       .remove         = __devexit_p(mpc83xx_wdt_remove),
+       .driver         = {
+               .name   = "mpc83xx_wdt",
+       },
+};
+
+static int __init mpc83xx_wdt_init(void)
+{
+       return platform_driver_register(&mpc83xx_wdt_driver);
+}
+
+static void __exit mpc83xx_wdt_exit(void)
+{
+       platform_driver_unregister(&mpc83xx_wdt_driver);
+}
+
+module_init(mpc83xx_wdt_init);
+module_exit(mpc83xx_wdt_exit);
+
+MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
+MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c
new file mode 100644 (file)
index 0000000..85b5734
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * mpc8xx_wdt.c - MPC8xx watchdog userspace interface
+ *
+ * Author: Florian Schirmer <jolt@tuxbox.org>
+ *
+ * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <asm/8xx_immap.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+#include <syslib/m8xx_wdt.h>
+
+static unsigned long wdt_opened;
+static int wdt_status;
+
+static void mpc8xx_wdt_handler_disable(void)
+{
+       volatile uint __iomem *piscr;
+       piscr = (uint *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;
+
+       if (!m8xx_has_internal_rtc)
+               m8xx_wdt_stop_timer();
+       else
+               out_be32(piscr, in_be32(piscr) & ~(PISCR_PIE | PISCR_PTE));
+
+       printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n");
+}
+
+static void mpc8xx_wdt_handler_enable(void)
+{
+       volatile uint __iomem *piscr;
+       piscr = (uint *)&((immap_t*)IMAP_ADDR)->im_sit.sit_piscr;
+
+       if (!m8xx_has_internal_rtc)
+               m8xx_wdt_install_timer();
+       else
+               out_be32(piscr, in_be32(piscr) | PISCR_PIE | PISCR_PTE);
+
+       printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n");
+}
+
+static int mpc8xx_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &wdt_opened))
+               return -EBUSY;
+
+       m8xx_wdt_reset();
+       mpc8xx_wdt_handler_disable();
+
+       return nonseekable_open(inode, file);
+}
+
+static int mpc8xx_wdt_release(struct inode *inode, struct file *file)
+{
+       m8xx_wdt_reset();
+
+#if !defined(CONFIG_WATCHDOG_NOWAYOUT)
+       mpc8xx_wdt_handler_enable();
+#endif
+
+       clear_bit(0, &wdt_opened);
+
+       return 0;
+}
+
+static ssize_t mpc8xx_wdt_write(struct file *file, const char *data, size_t len,
+                               loff_t * ppos)
+{
+       if (len)
+               m8xx_wdt_reset();
+
+       return len;
+}
+
+static int mpc8xx_wdt_ioctl(struct inode *inode, struct file *file,
+                           unsigned int cmd, unsigned long arg)
+{
+       int timeout;
+       static struct watchdog_info info = {
+               .options = WDIOF_KEEPALIVEPING,
+               .firmware_version = 0,
+               .identity = "MPC8xx watchdog",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user((void *)arg, &info, sizeof(info)))
+                       return -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               if (put_user(wdt_status, (int *)arg))
+                       return -EFAULT;
+               wdt_status &= ~WDIOF_KEEPALIVEPING;
+               break;
+
+       case WDIOC_GETTEMP:
+               return -EOPNOTSUPP;
+
+       case WDIOC_SETOPTIONS:
+               return -EOPNOTSUPP;
+
+       case WDIOC_KEEPALIVE:
+               m8xx_wdt_reset();
+               wdt_status |= WDIOF_KEEPALIVEPING;
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               return -EOPNOTSUPP;
+
+       case WDIOC_GETTIMEOUT:
+               timeout = m8xx_wdt_get_timeout();
+               if (put_user(timeout, (int *)arg))
+                       return -EFAULT;
+               break;
+
+       default:
+               return -ENOTTY;
+       }
+
+       return 0;
+}
+
+static const struct file_operations mpc8xx_wdt_fops = {
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = mpc8xx_wdt_write,
+       .ioctl = mpc8xx_wdt_ioctl,
+       .open = mpc8xx_wdt_open,
+       .release = mpc8xx_wdt_release,
+};
+
+static struct miscdevice mpc8xx_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &mpc8xx_wdt_fops,
+};
+
+static int __init mpc8xx_wdt_init(void)
+{
+       return misc_register(&mpc8xx_wdt_miscdev);
+}
+
+static void __exit mpc8xx_wdt_exit(void)
+{
+       misc_deregister(&mpc8xx_wdt_miscdev);
+
+       m8xx_wdt_reset();
+       mpc8xx_wdt_handler_enable();
+}
+
+module_init(mpc8xx_wdt_init);
+module_exit(mpc8xx_wdt_exit);
+
+MODULE_AUTHOR("Florian Schirmer <jolt@tuxbox.org>");
+MODULE_DESCRIPTION("MPC8xx watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
new file mode 100644 (file)
index 0000000..0d2b277
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ *     Watchdog driver for the mpcore watchdog timer
+ *
+ *     (c) Copyright 2004 ARM Limited
+ *
+ *     Based on the SoftDog driver:
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ */
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+
+#include <asm/hardware/arm_twd.h>
+#include <asm/uaccess.h>
+
+struct mpcore_wdt {
+       unsigned long   timer_alive;
+       struct device   *dev;
+       void __iomem    *base;
+       int             irq;
+       unsigned int    perturb;
+       char            expect_close;
+};
+
+static struct platform_device *mpcore_wdt_dev;
+
+extern unsigned int mpcore_timer_rate;
+
+#define TIMER_MARGIN   60
+static int mpcore_margin = TIMER_MARGIN;
+module_param(mpcore_margin, int, 0);
+MODULE_PARM_DESC(mpcore_margin, "MPcore timer margin in seconds. (0<mpcore_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+#define ONLY_TESTING   0
+static int mpcore_noboot = ONLY_TESTING;
+module_param(mpcore_noboot, int, 0);
+MODULE_PARM_DESC(mpcore_noboot, "MPcore watchdog action, set to 1 to ignore reboots, 0 to reboot (default=" __MODULE_STRING(ONLY_TESTING) ")");
+
+/*
+ *     This is the interrupt handler.  Note that we only use this
+ *     in testing mode, so don't actually do a reboot here.
+ */
+static irqreturn_t mpcore_wdt_fire(int irq, void *arg)
+{
+       struct mpcore_wdt *wdt = arg;
+
+       /* Check it really was our interrupt */
+       if (readl(wdt->base + TWD_WDOG_INTSTAT)) {
+               dev_printk(KERN_CRIT, wdt->dev, "Triggered - Reboot ignored.\n");
+
+               /* Clear the interrupt on the watchdog */
+               writel(1, wdt->base + TWD_WDOG_INTSTAT);
+
+               return IRQ_HANDLED;
+       }
+
+       return IRQ_NONE;
+}
+
+/*
+ *     mpcore_wdt_keepalive - reload the timer
+ *
+ *     Note that the spec says a DIFFERENT value must be written to the reload
+ *     register each time.  The "perturb" variable deals with this by adding 1
+ *     to the count every other time the function is called.
+ */
+static void mpcore_wdt_keepalive(struct mpcore_wdt *wdt)
+{
+       unsigned int count;
+
+       /* Assume prescale is set to 256 */
+       count = (mpcore_timer_rate / 256) * mpcore_margin;
+
+       /* Reload the counter */
+       writel(count + wdt->perturb, wdt->base + TWD_WDOG_LOAD);
+
+       wdt->perturb = wdt->perturb ? 0 : 1;
+}
+
+static void mpcore_wdt_stop(struct mpcore_wdt *wdt)
+{
+       writel(0x12345678, wdt->base + TWD_WDOG_DISABLE);
+       writel(0x87654321, wdt->base + TWD_WDOG_DISABLE);
+       writel(0x0, wdt->base + TWD_WDOG_CONTROL);
+}
+
+static void mpcore_wdt_start(struct mpcore_wdt *wdt)
+{
+       dev_printk(KERN_INFO, wdt->dev, "enabling watchdog.\n");
+
+       /* This loads the count register but does NOT start the count yet */
+       mpcore_wdt_keepalive(wdt);
+
+       if (mpcore_noboot) {
+               /* Enable watchdog - prescale=256, watchdog mode=0, enable=1 */
+               writel(0x0000FF01, wdt->base + TWD_WDOG_CONTROL);
+       } else {
+               /* Enable watchdog - prescale=256, watchdog mode=1, enable=1 */
+               writel(0x0000FF09, wdt->base + TWD_WDOG_CONTROL);
+       }
+}
+
+static int mpcore_wdt_set_heartbeat(int t)
+{
+       if (t < 0x0001 || t > 0xFFFF)
+               return -EINVAL;
+
+       mpcore_margin = t;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+static int mpcore_wdt_open(struct inode *inode, struct file *file)
+{
+       struct mpcore_wdt *wdt = platform_get_drvdata(mpcore_wdt_dev);
+
+       if (test_and_set_bit(0, &wdt->timer_alive))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       file->private_data = wdt;
+
+       /*
+        *      Activate timer
+        */
+       mpcore_wdt_start(wdt);
+
+       return nonseekable_open(inode, file);
+}
+
+static int mpcore_wdt_release(struct inode *inode, struct file *file)
+{
+       struct mpcore_wdt *wdt = file->private_data;
+
+       /*
+        *      Shut off the timer.
+        *      Lock it in if it's a module and we set nowayout
+        */
+       if (wdt->expect_close == 42) {
+               mpcore_wdt_stop(wdt);
+       } else {
+               dev_printk(KERN_CRIT, wdt->dev, "unexpected close, not stopping watchdog!\n");
+               mpcore_wdt_keepalive(wdt);
+       }
+       clear_bit(0, &wdt->timer_alive);
+       wdt->expect_close = 0;
+       return 0;
+}
+
+static ssize_t mpcore_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       struct mpcore_wdt *wdt = file->private_data;
+
+       /*
+        *      Refresh the timer.
+        */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       wdt->expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       wdt->expect_close = 42;
+                       }
+               }
+               mpcore_wdt_keepalive(wdt);
+       }
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options                = WDIOF_SETTIMEOUT |
+                                 WDIOF_KEEPALIVEPING |
+                                 WDIOF_MAGICCLOSE,
+       .identity               = "MPcore Watchdog",
+};
+
+static int mpcore_wdt_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg)
+{
+       struct mpcore_wdt *wdt = file->private_data;
+       int ret;
+       union {
+               struct watchdog_info ident;
+               int i;
+       } uarg;
+
+       if (_IOC_DIR(cmd) && _IOC_SIZE(cmd) > sizeof(uarg))
+               return -ENOTTY;
+
+       if (_IOC_DIR(cmd) & _IOC_WRITE) {
+               ret = copy_from_user(&uarg, (void __user *)arg, _IOC_SIZE(cmd));
+               if (ret)
+                       return -EFAULT;
+       }
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               uarg.ident = ident;
+               ret = 0;
+               break;
+
+       case WDIOC_SETOPTIONS:
+               ret = -EINVAL;
+               if (uarg.i & WDIOS_DISABLECARD) {
+                       mpcore_wdt_stop(wdt);
+                       ret = 0;
+               }
+               if (uarg.i & WDIOS_ENABLECARD) {
+                       mpcore_wdt_start(wdt);
+                       ret = 0;
+               }
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               uarg.i = 0;
+               ret = 0;
+               break;
+
+       case WDIOC_KEEPALIVE:
+               mpcore_wdt_keepalive(wdt);
+               ret = 0;
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = mpcore_wdt_set_heartbeat(uarg.i);
+               if (ret)
+                       break;
+
+               mpcore_wdt_keepalive(wdt);
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               uarg.i = mpcore_margin;
+               ret = 0;
+               break;
+
+       default:
+               return -ENOTTY;
+       }
+
+       if (ret == 0 && _IOC_DIR(cmd) & _IOC_READ) {
+               ret = copy_to_user((void __user *)arg, &uarg, _IOC_SIZE(cmd));
+               if (ret)
+                       ret = -EFAULT;
+       }
+       return ret;
+}
+
+/*
+ *     System shutdown handler.  Turn off the watchdog if we're
+ *     restarting or halting the system.
+ */
+static void mpcore_wdt_shutdown(struct platform_device *dev)
+{
+       struct mpcore_wdt *wdt = platform_get_drvdata(dev);
+
+       if (system_state == SYSTEM_RESTART || system_state == SYSTEM_HALT)
+               mpcore_wdt_stop(wdt);
+}
+
+/*
+ *     Kernel Interfaces
+ */
+static const struct file_operations mpcore_wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = mpcore_wdt_write,
+       .ioctl          = mpcore_wdt_ioctl,
+       .open           = mpcore_wdt_open,
+       .release        = mpcore_wdt_release,
+};
+
+static struct miscdevice mpcore_wdt_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &mpcore_wdt_fops,
+};
+
+static int __devinit mpcore_wdt_probe(struct platform_device *dev)
+{
+       struct mpcore_wdt *wdt;
+       struct resource *res;
+       int ret;
+
+       /* We only accept one device, and it must have an id of -1 */
+       if (dev->id != -1)
+               return -ENODEV;
+
+       res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+       if (!res) {
+               ret = -ENODEV;
+               goto err_out;
+       }
+
+       wdt = kzalloc(sizeof(struct mpcore_wdt), GFP_KERNEL);
+       if (!wdt) {
+               ret = -ENOMEM;
+               goto err_out;
+       }
+
+       wdt->dev = &dev->dev;
+       wdt->irq = platform_get_irq(dev, 0);
+       if (wdt->irq < 0) {
+               ret = -ENXIO;
+               goto err_free;
+       }
+       wdt->base = ioremap(res->start, res->end - res->start + 1);
+       if (!wdt->base) {
+               ret = -ENOMEM;
+               goto err_free;
+       }
+
+       mpcore_wdt_miscdev.parent = &dev->dev;
+       ret = misc_register(&mpcore_wdt_miscdev);
+       if (ret) {
+               dev_printk(KERN_ERR, _dev, "cannot register miscdev on minor=%d (err=%d)\n",
+                          WATCHDOG_MINOR, ret);
+               goto err_misc;
+       }
+
+       ret = request_irq(wdt->irq, mpcore_wdt_fire, IRQF_DISABLED, "mpcore_wdt", wdt);
+       if (ret) {
+               dev_printk(KERN_ERR, _dev, "cannot register IRQ%d for watchdog\n", wdt->irq);
+               goto err_irq;
+       }
+
+       mpcore_wdt_stop(wdt);
+       platform_set_drvdata(&dev->dev, wdt);
+       mpcore_wdt_dev = dev;
+
+       return 0;
+
+ err_irq:
+       misc_deregister(&mpcore_wdt_miscdev);
+ err_misc:
+       iounmap(wdt->base);
+ err_free:
+       kfree(wdt);
+ err_out:
+       return ret;
+}
+
+static int __devexit mpcore_wdt_remove(struct platform_device *dev)
+{
+       struct mpcore_wdt *wdt = platform_get_drvdata(dev);
+
+       platform_set_drvdata(dev, NULL);
+
+       misc_deregister(&mpcore_wdt_miscdev);
+
+       mpcore_wdt_dev = NULL;
+
+       free_irq(wdt->irq, wdt);
+       iounmap(wdt->base);
+       kfree(wdt);
+       return 0;
+}
+
+static struct platform_driver mpcore_wdt_driver = {
+       .probe          = mpcore_wdt_probe,
+       .remove         = __devexit_p(mpcore_wdt_remove),
+       .shutdown       = mpcore_wdt_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = "mpcore_wdt",
+       },
+};
+
+static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n";
+
+static int __init mpcore_wdt_init(void)
+{
+       /*
+        * Check that the margin value is within it's range;
+        * if not reset to the default
+        */
+       if (mpcore_wdt_set_heartbeat(mpcore_margin)) {
+               mpcore_wdt_set_heartbeat(TIMER_MARGIN);
+               printk(KERN_INFO "mpcore_margin value must be 0<mpcore_margin<65536, using %d\n",
+                       TIMER_MARGIN);
+       }
+
+       printk(banner, mpcore_noboot, mpcore_margin, nowayout);
+
+       return platform_driver_register(&mpcore_wdt_driver);
+}
+
+static void __exit mpcore_wdt_exit(void)
+{
+       platform_driver_unregister(&mpcore_wdt_driver);
+}
+
+module_init(mpcore_wdt_init);
+module_exit(mpcore_wdt_exit);
+
+MODULE_AUTHOR("ARM Limited");
+MODULE_DESCRIPTION("MPcore Watchdog Device Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c
new file mode 100644 (file)
index 0000000..dcfd401
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ *      Driver for the MTX-1 Watchdog.
+ *
+ *      (C) Copyright 2005 4G Systems <info@4g-systems.biz>, All Rights Reserved.
+ *                              http://www.4g-systems.biz
+ *
+ *     (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
+ *
+ *      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.
+ *
+ *      Neither Michael Stickel nor 4G Systems admit liability nor provide
+ *      warranty for any of this software. This material is provided
+ *      "AS-IS" and at no charge.
+ *
+ *      (c) Copyright 2005    4G Systems <info@4g-systems.biz>
+ *
+ *      Release 0.01.
+ *      Author: Michael Stickel  michael.stickel@4g-systems.biz
+ *
+ *      Release 0.02.
+ *     Author: Florian Fainelli florian@openwrt.org
+ *             use the Linux watchdog/timer APIs
+ *
+ *      The Watchdog is configured to reset the MTX-1
+ *      if it is not triggered for 100 seconds.
+ *      It should not be triggered more often than 1.6 seconds.
+ *
+ *      A timer triggers the watchdog every 5 seconds, until
+ *      it is opened for the first time. After the first open
+ *      it MUST be triggered every 2..95 seconds.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/miscdevice.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/timer.h>
+#include <linux/completion.h>
+#include <linux/jiffies.h>
+#include <linux/watchdog.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+#include <asm/mach-au1x00/au1000.h>
+
+#define MTX1_WDT_INTERVAL      (5 * HZ)
+
+static int ticks = 100 * HZ;
+
+static struct {
+       struct completion stop;
+       volatile int running;
+       struct timer_list timer;
+       volatile int queue;
+       int default_ticks;
+       unsigned long inuse;
+} mtx1_wdt_device;
+
+static void mtx1_wdt_trigger(unsigned long unused)
+{
+       u32 tmp;
+
+       if (mtx1_wdt_device.running)
+               ticks--;
+       /*
+        * toggle GPIO2_15
+        */
+       tmp = au_readl(GPIO2_DIR);
+       tmp = (tmp & ~(1<<15)) | ((~tmp) & (1<<15));
+       au_writel (tmp, GPIO2_DIR);
+
+       if (mtx1_wdt_device.queue && ticks)
+               mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
+       else {
+               complete(&mtx1_wdt_device.stop);
+       }
+}
+
+static void mtx1_wdt_reset(void)
+{
+       ticks = mtx1_wdt_device.default_ticks;
+}
+
+
+static void mtx1_wdt_start(void)
+{
+       if (!mtx1_wdt_device.queue) {
+               mtx1_wdt_device.queue = 1;
+               au_writel (au_readl(GPIO2_DIR) | (u32)(1<<15), GPIO2_DIR);
+               mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
+       }
+       mtx1_wdt_device.running++;
+}
+
+static int mtx1_wdt_stop(void)
+{
+       if (mtx1_wdt_device.queue) {
+               mtx1_wdt_device.queue = 0;
+               au_writel (au_readl(GPIO2_DIR) & ~((u32)(1<<15)), GPIO2_DIR);
+       }
+
+       ticks = mtx1_wdt_device.default_ticks;
+
+       return 0;
+}
+
+/* Filesystem functions */
+
+static int mtx1_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &mtx1_wdt_device.inuse))
+               return -EBUSY;
+
+       return nonseekable_open(inode, file);
+}
+
+
+static int mtx1_wdt_release(struct inode *inode, struct file *file)
+{
+       clear_bit(0, &mtx1_wdt_device.inuse);
+       return 0;
+}
+
+static int mtx1_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       unsigned int value;
+       static struct watchdog_info ident =
+       {
+               .options = WDIOF_CARDRESET,
+               .identity = "MTX-1 WDT",
+       };
+
+       switch(cmd) {
+               case WDIOC_KEEPALIVE:
+                       mtx1_wdt_reset();
+                       break;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       if ( copy_to_user(argp, &value, sizeof(int)) )
+                               return -EFAULT;
+                       break;
+               case WDIOC_GETSUPPORT:
+                       if ( copy_to_user(argp, &ident, sizeof(ident)) )
+                               return -EFAULT;
+                       break;
+               case WDIOC_SETOPTIONS:
+                       if ( copy_from_user(&value, argp, sizeof(int)) )
+                               return -EFAULT;
+                       switch(value) {
+                               case WDIOS_ENABLECARD:
+                                       mtx1_wdt_start();
+                                       break;
+                               case WDIOS_DISABLECARD:
+                                       return mtx1_wdt_stop();
+                               default:
+                                       return -EINVAL;
+                       }
+                       break;
+               default:
+                       return -ENOTTY;
+       }
+       return 0;
+}
+
+
+static ssize_t mtx1_wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+{
+       if (!count)
+               return -EIO;
+
+       mtx1_wdt_reset();
+       return count;
+}
+
+static struct file_operations mtx1_wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .ioctl          = mtx1_wdt_ioctl,
+       .open           = mtx1_wdt_open,
+       .write          = mtx1_wdt_write,
+       .release        = mtx1_wdt_release
+};
+
+
+static struct miscdevice mtx1_wdt_misc = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &mtx1_wdt_fops
+};
+
+
+static int __init mtx1_wdt_init(void)
+{
+       int ret;
+
+       if ((ret = misc_register(&mtx1_wdt_misc)) < 0) {
+               printk(KERN_ERR " mtx-1_wdt : failed to register\n");
+               return ret;
+       }
+
+       init_completion(&mtx1_wdt_device.stop);
+       mtx1_wdt_device.queue = 0;
+
+       clear_bit(0, &mtx1_wdt_device.inuse);
+
+       setup_timer(&mtx1_wdt_device.timer, mtx1_wdt_trigger, 0L);
+
+       mtx1_wdt_device.default_ticks = ticks;
+
+       mtx1_wdt_start();
+
+       printk(KERN_INFO "MTX-1 Watchdog driver\n");
+
+       return 0;
+}
+
+static void __exit mtx1_wdt_exit(void)
+{
+       if (mtx1_wdt_device.queue) {
+               mtx1_wdt_device.queue = 0;
+               wait_for_completion(&mtx1_wdt_device.stop);
+       }
+       misc_deregister(&mtx1_wdt_misc);
+}
+
+module_init(mtx1_wdt_init);
+module_exit(mtx1_wdt_exit);
+
+MODULE_AUTHOR("Michael Stickel, Florian Fainelli");
+MODULE_DESCRIPTION("Driver for the MTX-1 watchdog");
+MODULE_LICENSE("GPL");
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c
new file mode 100644 (file)
index 0000000..0365c31
--- /dev/null
@@ -0,0 +1,326 @@
+/*
+ * mv64x60_wdt.c - MV64X60 (Marvell Discovery) watchdog userspace interface
+ *
+ * Author: James Chapman <jchapman@katalix.com>
+ *
+ * Platform-specific setup code should configure the dog to generate
+ * interrupt or reset as required.  This code only enables/disables
+ * and services the watchdog.
+ *
+ * Derived from mpc8xx_wdt.c, with the following copyright.
+ * 
+ * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <linux/platform_device.h>
+
+#include <linux/mv643xx.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define MV64x60_WDT_WDC_OFFSET 0
+
+/*
+ * The watchdog configuration register contains a pair of 2-bit fields,
+ *   1.  a reload field, bits 27-26, which triggers a reload of
+ *       the countdown register, and
+ *   2.  an enable field, bits 25-24, which toggles between
+ *       enabling and disabling the watchdog timer.
+ * Bit 31 is a read-only field which indicates whether the
+ * watchdog timer is currently enabled.
+ *
+ * The low 24 bits contain the timer reload value.
+ */
+#define MV64x60_WDC_ENABLE_SHIFT       24
+#define MV64x60_WDC_SERVICE_SHIFT      26
+#define MV64x60_WDC_ENABLED_SHIFT      31
+
+#define MV64x60_WDC_ENABLED_TRUE       1
+#define MV64x60_WDC_ENABLED_FALSE      0
+
+/* Flags bits */
+#define MV64x60_WDOG_FLAG_OPENED       0
+
+static unsigned long wdt_flags;
+static int wdt_status;
+static void __iomem *mv64x60_wdt_regs;
+static int mv64x60_wdt_timeout;
+static int mv64x60_wdt_count;
+static unsigned int bus_clk;
+static char expect_close;
+static DEFINE_SPINLOCK(mv64x60_wdt_spinlock);
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift)
+{
+       u32 data;
+       u32 enabled;
+       int ret = 0;
+
+       spin_lock(&mv64x60_wdt_spinlock);
+       data = readl(mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
+       enabled = (data >> MV64x60_WDC_ENABLED_SHIFT) & 1;
+
+       /* only toggle the requested field if enabled state matches predicate */
+       if ((enabled ^ enabled_predicate) == 0) {
+               /* We write a 1, then a 2 -- to the appropriate field */
+               data = (1 << field_shift) | mv64x60_wdt_count;
+               writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
+
+               data = (2 << field_shift) | mv64x60_wdt_count;
+               writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET);
+               ret = 1;
+       }
+       spin_unlock(&mv64x60_wdt_spinlock);
+
+       return ret;
+}
+
+static void mv64x60_wdt_service(void)
+{
+       mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE,
+                              MV64x60_WDC_SERVICE_SHIFT);
+}
+
+static void mv64x60_wdt_handler_enable(void)
+{
+       if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE,
+                                  MV64x60_WDC_ENABLE_SHIFT)) {
+               mv64x60_wdt_service();
+               printk(KERN_NOTICE "mv64x60_wdt: watchdog activated\n");
+       }
+}
+
+static void mv64x60_wdt_handler_disable(void)
+{
+       if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE,
+                                  MV64x60_WDC_ENABLE_SHIFT))
+               printk(KERN_NOTICE "mv64x60_wdt: watchdog deactivated\n");
+}
+
+static void mv64x60_wdt_set_timeout(unsigned int timeout)
+{
+       /* maximum bus cycle count is 0xFFFFFFFF */
+       if (timeout > 0xFFFFFFFF / bus_clk)
+               timeout = 0xFFFFFFFF / bus_clk;
+
+       mv64x60_wdt_count = timeout * bus_clk >> 8;
+       mv64x60_wdt_timeout = timeout;
+}
+
+static int mv64x60_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       mv64x60_wdt_handler_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static int mv64x60_wdt_release(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42)
+               mv64x60_wdt_handler_disable();
+       else {
+               printk(KERN_CRIT
+                      "mv64x60_wdt: unexpected close, not stopping timer!\n");
+               mv64x60_wdt_service();
+       }
+       expect_close = 0;
+
+       clear_bit(MV64x60_WDOG_FLAG_OPENED, &wdt_flags);
+
+       return 0;
+}
+
+static ssize_t mv64x60_wdt_write(struct file *file, const char __user *data,
+                                size_t len, loff_t * ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if(get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               mv64x60_wdt_service();
+       }
+
+       return len;
+}
+
+static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg)
+{
+       int timeout;
+       int options;
+       void __user *argp = (void __user *)arg;
+       static struct watchdog_info info = {
+               .options =      WDIOF_SETTIMEOUT        |
+                               WDIOF_MAGICCLOSE        |
+                               WDIOF_KEEPALIVEPING,
+               .firmware_version = 0,
+               .identity = "MV64x60 watchdog",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &info, sizeof(info)))
+                       return -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               if (put_user(wdt_status, (int __user *)argp))
+                       return -EFAULT;
+               wdt_status &= ~WDIOF_KEEPALIVEPING;
+               break;
+
+       case WDIOC_GETTEMP:
+               return -EOPNOTSUPP;
+
+       case WDIOC_SETOPTIONS:
+               if (get_user(options, (int __user *)argp))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD)
+                       mv64x60_wdt_handler_disable();
+
+               if (options & WDIOS_ENABLECARD)
+                       mv64x60_wdt_handler_enable();
+               break;
+
+       case WDIOC_KEEPALIVE:
+               mv64x60_wdt_service();
+               wdt_status |= WDIOF_KEEPALIVEPING;
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(timeout, (int __user *)argp))
+                       return -EFAULT;
+               mv64x60_wdt_set_timeout(timeout);
+               /* Fall through */
+
+       case WDIOC_GETTIMEOUT:
+               if (put_user(mv64x60_wdt_timeout, (int __user *)argp))
+                       return -EFAULT;
+               break;
+
+       default:
+               return -ENOTTY;
+       }
+
+       return 0;
+}
+
+static const struct file_operations mv64x60_wdt_fops = {
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = mv64x60_wdt_write,
+       .ioctl = mv64x60_wdt_ioctl,
+       .open = mv64x60_wdt_open,
+       .release = mv64x60_wdt_release,
+};
+
+static struct miscdevice mv64x60_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &mv64x60_wdt_fops,
+};
+
+static int __devinit mv64x60_wdt_probe(struct platform_device *dev)
+{
+       struct mv64x60_wdt_pdata *pdata = dev->dev.platform_data;
+       struct resource *r;
+       int timeout = 10;
+
+       bus_clk = 133;                  /* in MHz */
+       if (pdata) {
+               timeout = pdata->timeout;
+               bus_clk = pdata->bus_clk;
+       }
+
+       /* Since bus_clk is truncated MHz, actual frequency could be
+        * up to 1MHz higher.  Round up, since it's better to time out
+        * too late than too soon.
+        */
+       bus_clk++;
+       bus_clk *= 1000000;             /* convert to Hz */
+
+       r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+       if (!r)
+               return -ENODEV;
+
+       mv64x60_wdt_regs = ioremap(r->start, r->end - r->start + 1);
+       if (mv64x60_wdt_regs == NULL)
+               return -ENOMEM;
+
+       mv64x60_wdt_set_timeout(timeout);
+
+       mv64x60_wdt_handler_disable();  /* in case timer was already running */
+
+       return misc_register(&mv64x60_wdt_miscdev);
+}
+
+static int __devexit mv64x60_wdt_remove(struct platform_device *dev)
+{
+       misc_deregister(&mv64x60_wdt_miscdev);
+
+       mv64x60_wdt_handler_disable();
+
+       iounmap(mv64x60_wdt_regs);
+
+       return 0;
+}
+
+static struct platform_driver mv64x60_wdt_driver = {
+       .probe = mv64x60_wdt_probe,
+       .remove = __devexit_p(mv64x60_wdt_remove),
+       .driver = {
+               .owner = THIS_MODULE,
+               .name = MV64x60_WDT_NAME,
+       },
+};
+
+static int __init mv64x60_wdt_init(void)
+{
+       printk(KERN_INFO "MV64x60 watchdog driver\n");
+
+       return platform_driver_register(&mv64x60_wdt_driver);
+}
+
+static void __exit mv64x60_wdt_exit(void)
+{
+       platform_driver_unregister(&mv64x60_wdt_driver);
+}
+
+module_init(mv64x60_wdt_init);
+module_exit(mv64x60_wdt_exit);
+
+MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
+MODULE_DESCRIPTION("MV64x60 watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
new file mode 100644 (file)
index 0000000..719b066
--- /dev/null
@@ -0,0 +1,389 @@
+/*
+ * linux/drivers/char/watchdog/omap_wdt.c
+ *
+ * Watchdog driver for the TI OMAP 16xx & 24xx 32KHz (non-secure) watchdog
+ *
+ * Author: MontaVista Software, Inc.
+ *      <gdavis@mvista.com> or <source@mvista.com>
+ *
+ * 2003 (c) MontaVista Software, Inc. This file is licensed under the
+ * terms of the GNU General Public License version 2. This program is
+ * licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ * History:
+ *
+ * 20030527: George G. Davis <gdavis@mvista.com>
+ *     Initially based on linux-2.4.19-rmk7-pxa1/drivers/char/sa1100_wdt.c
+ *     (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
+ *     Based on SoftDog driver by Alan Cox <alan@redhat.com>
+ *
+ * Copyright (c) 2004 Texas Instruments.
+ *     1. Modified to support OMAP1610 32-KHz watchdog timer
+ *     2. Ported to 2.6 kernel
+ *
+ * Copyright (c) 2005 David Brownell
+ *     Use the driver model and standard identifiers; handle bigger timeouts.
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/moduleparam.h>
+#include <linux/clk.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/hardware.h>
+#include <asm/bitops.h>
+
+#include <asm/arch/prcm.h>
+
+#include "omap_wdt.h"
+
+static unsigned timer_margin;
+module_param(timer_margin, uint, 0);
+MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
+
+static int omap_wdt_users;
+static struct clk *armwdt_ck = NULL;
+static struct clk *mpu_wdt_ick = NULL;
+static struct clk *mpu_wdt_fck = NULL;
+
+static unsigned int wdt_trgr_pattern = 0x1234;
+
+static void omap_wdt_ping(void)
+{
+       /* wait for posted write to complete */
+       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x08)
+               cpu_relax();
+       wdt_trgr_pattern = ~wdt_trgr_pattern;
+       omap_writel(wdt_trgr_pattern, (OMAP_WATCHDOG_TGR));
+       /* wait for posted write to complete */
+       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x08)
+               cpu_relax();
+       /* reloaded WCRR from WLDR */
+}
+
+static void omap_wdt_enable(void)
+{
+       /* Sequence to enable the watchdog */
+       omap_writel(0xBBBB, OMAP_WATCHDOG_SPR);
+       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x10)
+               cpu_relax();
+       omap_writel(0x4444, OMAP_WATCHDOG_SPR);
+       while ((omap_readl(OMAP_WATCHDOG_WPS)) & 0x10)
+               cpu_relax();
+}
+
+static void omap_wdt_disable(void)
+{
+       /* sequence required to disable watchdog */
+       omap_writel(0xAAAA, OMAP_WATCHDOG_SPR); /* TIMER_MODE */
+       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x10)
+               cpu_relax();
+       omap_writel(0x5555, OMAP_WATCHDOG_SPR); /* TIMER_MODE */
+       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x10)
+               cpu_relax();
+}
+
+static void omap_wdt_adjust_timeout(unsigned new_timeout)
+{
+       if (new_timeout < TIMER_MARGIN_MIN)
+               new_timeout = TIMER_MARGIN_DEFAULT;
+       if (new_timeout > TIMER_MARGIN_MAX)
+               new_timeout = TIMER_MARGIN_MAX;
+       timer_margin = new_timeout;
+}
+
+static void omap_wdt_set_timeout(void)
+{
+       u32 pre_margin = GET_WLDR_VAL(timer_margin);
+
+       /* just count up at 32 KHz */
+       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x04)
+               cpu_relax();
+       omap_writel(pre_margin, OMAP_WATCHDOG_LDR);
+       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x04)
+               cpu_relax();
+}
+
+/*
+ *     Allow only one task to hold it open
+ */
+
+static int omap_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(1, (unsigned long *)&omap_wdt_users))
+               return -EBUSY;
+
+       if (cpu_is_omap16xx())
+               clk_enable(armwdt_ck);  /* Enable the clock */
+
+       if (cpu_is_omap24xx()) {
+               clk_enable(mpu_wdt_ick);    /* Enable the interface clock */
+               clk_enable(mpu_wdt_fck);    /* Enable the functional clock */
+       }
+
+       /* initialize prescaler */
+       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x01)
+               cpu_relax();
+       omap_writel((1 << 5) | (PTV << 2), OMAP_WATCHDOG_CNTRL);
+       while (omap_readl(OMAP_WATCHDOG_WPS) & 0x01)
+               cpu_relax();
+
+       omap_wdt_set_timeout();
+       omap_wdt_enable();
+       return nonseekable_open(inode, file);
+}
+
+static int omap_wdt_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer unless NOWAYOUT is defined.
+        */
+#ifndef CONFIG_WATCHDOG_NOWAYOUT
+       omap_wdt_disable();
+
+       if (cpu_is_omap16xx()) {
+               clk_disable(armwdt_ck); /* Disable the clock */
+               clk_put(armwdt_ck);
+               armwdt_ck = NULL;
+       }
+
+       if (cpu_is_omap24xx()) {
+               clk_disable(mpu_wdt_ick);       /* Disable the clock */
+               clk_disable(mpu_wdt_fck);       /* Disable the clock */
+               clk_put(mpu_wdt_ick);
+               clk_put(mpu_wdt_fck);
+               mpu_wdt_ick = NULL;
+               mpu_wdt_fck = NULL;
+       }
+#else
+       printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n");
+#endif
+       omap_wdt_users = 0;
+       return 0;
+}
+
+static ssize_t
+omap_wdt_write(struct file *file, const char __user *data,
+               size_t len, loff_t *ppos)
+{
+       /* Refresh LOAD_TIME. */
+       if (len)
+               omap_wdt_ping();
+       return len;
+}
+
+static int
+omap_wdt_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       int new_margin;
+       static struct watchdog_info ident = {
+               .identity = "OMAP Watchdog",
+               .options = WDIOF_SETTIMEOUT,
+               .firmware_version = 0,
+       };
+
+       switch (cmd) {
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user((struct watchdog_info __user *)arg, &ident,
+                               sizeof(ident));
+       case WDIOC_GETSTATUS:
+               return put_user(0, (int __user *)arg);
+       case WDIOC_GETBOOTSTATUS:
+               if (cpu_is_omap16xx())
+                       return put_user(omap_readw(ARM_SYSST),
+                                       (int __user *)arg);
+               if (cpu_is_omap24xx())
+                       return put_user(omap_prcm_get_reset_sources(),
+                                       (int __user *)arg);
+       case WDIOC_KEEPALIVE:
+               omap_wdt_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_margin, (int __user *)arg))
+                       return -EFAULT;
+               omap_wdt_adjust_timeout(new_margin);
+
+               omap_wdt_disable();
+               omap_wdt_set_timeout();
+               omap_wdt_enable();
+
+               omap_wdt_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timer_margin, (int __user *)arg);
+       }
+}
+
+static const struct file_operations omap_wdt_fops = {
+       .owner = THIS_MODULE,
+       .write = omap_wdt_write,
+       .ioctl = omap_wdt_ioctl,
+       .open = omap_wdt_open,
+       .release = omap_wdt_release,
+};
+
+static struct miscdevice omap_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &omap_wdt_fops
+};
+
+static int __init omap_wdt_probe(struct platform_device *pdev)
+{
+       struct resource *res, *mem;
+       int ret;
+
+       /* reserve static register mappings */
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res)
+               return -ENOENT;
+
+       mem = request_mem_region(res->start, res->end - res->start + 1,
+                                pdev->name);
+       if (mem == NULL)
+               return -EBUSY;
+
+       platform_set_drvdata(pdev, mem);
+
+       omap_wdt_users = 0;
+
+       if (cpu_is_omap16xx()) {
+               armwdt_ck = clk_get(&pdev->dev, "armwdt_ck");
+               if (IS_ERR(armwdt_ck)) {
+                       ret = PTR_ERR(armwdt_ck);
+                       armwdt_ck = NULL;
+                       goto fail;
+               }
+       }
+
+       if (cpu_is_omap24xx()) {
+               mpu_wdt_ick = clk_get(&pdev->dev, "mpu_wdt_ick");
+               if (IS_ERR(mpu_wdt_ick)) {
+                       ret = PTR_ERR(mpu_wdt_ick);
+                       mpu_wdt_ick = NULL;
+                       goto fail;
+               }
+               mpu_wdt_fck = clk_get(&pdev->dev, "mpu_wdt_fck");
+               if (IS_ERR(mpu_wdt_fck)) {
+                       ret = PTR_ERR(mpu_wdt_fck);
+                       mpu_wdt_fck = NULL;
+                       goto fail;
+               }
+       }
+
+       omap_wdt_disable();
+       omap_wdt_adjust_timeout(timer_margin);
+
+       omap_wdt_miscdev.parent = &pdev->dev;
+       ret = misc_register(&omap_wdt_miscdev);
+       if (ret)
+               goto fail;
+
+       pr_info("OMAP Watchdog Timer: initial timeout %d sec\n", timer_margin);
+
+       /* autogate OCP interface clock */
+       omap_writel(0x01, OMAP_WATCHDOG_SYS_CONFIG);
+       return 0;
+
+fail:
+       if (armwdt_ck)
+               clk_put(armwdt_ck);
+       if (mpu_wdt_ick)
+               clk_put(mpu_wdt_ick);
+       if (mpu_wdt_fck)
+               clk_put(mpu_wdt_fck);
+       release_resource(mem);
+       return ret;
+}
+
+static void omap_wdt_shutdown(struct platform_device *pdev)
+{
+       omap_wdt_disable();
+}
+
+static int omap_wdt_remove(struct platform_device *pdev)
+{
+       struct resource *mem = platform_get_drvdata(pdev);
+       misc_deregister(&omap_wdt_miscdev);
+       release_resource(mem);
+       if (armwdt_ck)
+               clk_put(armwdt_ck);
+       if (mpu_wdt_ick)
+               clk_put(mpu_wdt_ick);
+       if (mpu_wdt_fck)
+               clk_put(mpu_wdt_fck);
+       return 0;
+}
+
+#ifdef CONFIG_PM
+
+/* REVISIT ... not clear this is the best way to handle system suspend; and
+ * it's very inappropriate for selective device suspend (e.g. suspending this
+ * through sysfs rather than by stopping the watchdog daemon).  Also, this
+ * may not play well enough with NOWAYOUT...
+ */
+
+static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       if (omap_wdt_users)
+               omap_wdt_disable();
+       return 0;
+}
+
+static int omap_wdt_resume(struct platform_device *pdev)
+{
+       if (omap_wdt_users) {
+               omap_wdt_enable();
+               omap_wdt_ping();
+       }
+       return 0;
+}
+
+#else
+#define        omap_wdt_suspend        NULL
+#define        omap_wdt_resume         NULL
+#endif
+
+static struct platform_driver omap_wdt_driver = {
+       .probe          = omap_wdt_probe,
+       .remove         = omap_wdt_remove,
+       .shutdown       = omap_wdt_shutdown,
+       .suspend        = omap_wdt_suspend,
+       .resume         = omap_wdt_resume,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = "omap_wdt",
+       },
+};
+
+static int __init omap_wdt_init(void)
+{
+       return platform_driver_register(&omap_wdt_driver);
+}
+
+static void __exit omap_wdt_exit(void)
+{
+       platform_driver_unregister(&omap_wdt_driver);
+}
+
+module_init(omap_wdt_init);
+module_exit(omap_wdt_exit);
+
+MODULE_AUTHOR("George G. Davis");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/omap_wdt.h b/drivers/watchdog/omap_wdt.h
new file mode 100644 (file)
index 0000000..52a532a
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ *  linux/drivers/char/watchdog/omap_wdt.h
+ *
+ *  BRIEF MODULE DESCRIPTION
+ *      OMAP Watchdog timer register definitions
+ *
+ *  Copyright (C) 2004 Texas Instruments.
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _OMAP_WATCHDOG_H
+#define _OMAP_WATCHDOG_H
+
+#define OMAP1610_WATCHDOG_BASE         0xfffeb000
+#define OMAP2420_WATCHDOG_BASE         0x48022000      /*WDT Timer 2 */
+
+#ifdef CONFIG_ARCH_OMAP24XX
+#define OMAP_WATCHDOG_BASE             OMAP2420_WATCHDOG_BASE
+#else
+#define OMAP_WATCHDOG_BASE             OMAP1610_WATCHDOG_BASE
+#define RM_RSTST_WKUP                  0
+#endif
+
+#define OMAP_WATCHDOG_REV              (OMAP_WATCHDOG_BASE + 0x00)
+#define OMAP_WATCHDOG_SYS_CONFIG       (OMAP_WATCHDOG_BASE + 0x10)
+#define OMAP_WATCHDOG_STATUS           (OMAP_WATCHDOG_BASE + 0x14)
+#define OMAP_WATCHDOG_CNTRL            (OMAP_WATCHDOG_BASE + 0x24)
+#define OMAP_WATCHDOG_CRR              (OMAP_WATCHDOG_BASE + 0x28)
+#define OMAP_WATCHDOG_LDR              (OMAP_WATCHDOG_BASE + 0x2c)
+#define OMAP_WATCHDOG_TGR              (OMAP_WATCHDOG_BASE + 0x30)
+#define OMAP_WATCHDOG_WPS              (OMAP_WATCHDOG_BASE + 0x34)
+#define OMAP_WATCHDOG_SPR              (OMAP_WATCHDOG_BASE + 0x48)
+
+/* Using the prescaler, the OMAP watchdog could go for many
+ * months before firing.  These limits work without scaling,
+ * with the 60 second default assumed by most tools and docs.
+ */
+#define TIMER_MARGIN_MAX       (24 * 60 * 60)  /* 1 day */
+#define TIMER_MARGIN_DEFAULT   60      /* 60 secs */
+#define TIMER_MARGIN_MIN       1
+
+#define PTV                    0       /* prescale */
+#define GET_WLDR_VAL(secs)     (0xffffffff - ((secs) * (32768/(1<<PTV))) + 1)
+
+#endif                         /* _OMAP_WATCHDOG_H */
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c
new file mode 100644 (file)
index 0000000..3d3deae
--- /dev/null
@@ -0,0 +1,635 @@
+/*
+ *      NS pc87413-wdt Watchdog Timer driver for Linux 2.6.x.x
+ *
+ *      This code is based on wdt.c with original copyright.
+ *
+ *      (C) Copyright 2006 Sven Anders, <anders@anduras.de>
+ *                     and Marcus Junker, <junker@anduras.de>
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ *
+ *      Neither Sven Anders, Marcus Junker nor ANDURAS AG
+ *      admit liability nor provide warranty for any of this software.
+ *      This material is provided "AS-IS" and at no charge.
+ *
+ *      Release 1.1
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/notifier.h>
+#include <linux/fs.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/moduleparam.h>
+#include <linux/version.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+/* #define DEBUG 1 */
+
+#define DEFAULT_TIMEOUT     1            /* 1 minute */
+#define MAX_TIMEOUT         255
+
+#define VERSION             "1.1"
+#define MODNAME             "pc87413 WDT"
+#define PFX                 MODNAME ": "
+#define DPFX                MODNAME " - DEBUG: "
+
+#define WDT_INDEX_IO_PORT   (io+0)       /* I/O port base (index register) */
+#define WDT_DATA_IO_PORT    (WDT_INDEX_IO_PORT+1)
+#define SWC_LDN             0x04
+#define SIOCFG2             0x22         /* Serial IO register */
+#define WDCTL               0x10         /* Watchdog-Timer-Controll-Register */
+#define WDTO                0x11         /* Watchdog timeout register */
+#define WDCFG               0x12         /* Watchdog config register */
+
+static int io = 0x2E;                   /* Address used on Portwell Boards */
+
+static int timeout = DEFAULT_TIMEOUT;    /* timeout value */
+static unsigned long timer_enabled = 0;  /* is the timer enabled? */
+
+static char expect_close;                /* is the close expected? */
+
+static spinlock_t io_lock;               /* to guard the watchdog from io races */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+/* -- Low level function ----------------------------------------*/
+
+/* Select pins for Watchdog output */
+
+static inline void pc87413_select_wdt_out (void)
+{
+       unsigned int cr_data = 0;
+
+       /* Step 1: Select multiple pin,pin55,as WDT output */
+
+       outb_p(SIOCFG2, WDT_INDEX_IO_PORT);
+
+       cr_data = inb (WDT_DATA_IO_PORT);
+
+       cr_data |= 0x80; /* Set Bit7 to 1*/
+       outb_p(SIOCFG2, WDT_INDEX_IO_PORT);
+
+       outb_p(cr_data, WDT_DATA_IO_PORT);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Select multiple pin,pin55,as WDT output:"
+                             " Bit7 to 1: %d\n", cr_data);
+#endif
+}
+
+/* Enable SWC functions */
+
+static inline void pc87413_enable_swc(void)
+{
+       unsigned int cr_data=0;
+
+       /* Step 2: Enable SWC functions */
+
+       outb_p(0x07, WDT_INDEX_IO_PORT);        /* Point SWC_LDN (LDN=4) */
+       outb_p(SWC_LDN, WDT_DATA_IO_PORT);
+
+       outb_p(0x30, WDT_INDEX_IO_PORT);        /* Read Index 0x30 First */
+       cr_data = inb(WDT_DATA_IO_PORT);
+       cr_data |= 0x01;                        /* Set Bit0 to 1 */
+       outb_p(0x30, WDT_INDEX_IO_PORT);
+       outb_p(cr_data, WDT_DATA_IO_PORT);      /* Index0x30_bit0P1 */
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n");
+#endif
+}
+
+/* Read SWC I/O base address */
+
+static inline unsigned int pc87413_get_swc_base(void)
+{
+       unsigned int  swc_base_addr = 0;
+       unsigned char addr_l, addr_h = 0;
+
+       /* Step 3: Read SWC I/O Base Address */
+
+       outb_p(0x60, WDT_INDEX_IO_PORT);        /* Read Index 0x60 */
+       addr_h = inb(WDT_DATA_IO_PORT);
+
+       outb_p(0x61, WDT_INDEX_IO_PORT);        /* Read Index 0x61 */
+
+       addr_l = inb(WDT_DATA_IO_PORT);
+
+       swc_base_addr = (addr_h << 8) + addr_l;
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Read SWC I/O Base Address: low %d, high %d,"
+                             " res %d\n", addr_l, addr_h, swc_base_addr);
+#endif
+
+       return swc_base_addr;
+}
+
+/* Select Bank 3 of SWC */
+
+static inline void pc87413_swc_bank3(unsigned int swc_base_addr)
+{
+       /* Step 4: Select Bank3 of SWC */
+
+       outb_p(inb(swc_base_addr + 0x0f) | 0x03, swc_base_addr + 0x0f);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Select Bank3 of SWC\n");
+#endif
+}
+
+/* Set watchdog timeout to x minutes */
+
+static inline void pc87413_programm_wdto(unsigned int swc_base_addr,
+                                        char pc87413_time)
+{
+       /* Step 5: Programm WDTO, Twd. */
+
+       outb_p(pc87413_time, swc_base_addr + WDTO);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Set WDTO to %d minutes\n", pc87413_time);
+#endif
+}
+
+/* Enable WDEN */
+
+static inline void pc87413_enable_wden(unsigned int swc_base_addr)
+{
+       /* Step 6: Enable WDEN */
+
+       outb_p(inb (swc_base_addr + WDCTL) | 0x01, swc_base_addr + WDCTL);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Enable WDEN\n");
+#endif
+}
+
+/* Enable SW_WD_TREN */
+static inline void pc87413_enable_sw_wd_tren(unsigned int swc_base_addr)
+{
+       /* Enable SW_WD_TREN */
+
+       outb_p(inb (swc_base_addr + WDCFG) | 0x80, swc_base_addr + WDCFG);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Enable SW_WD_TREN\n");
+#endif
+}
+
+/* Disable SW_WD_TREN */
+
+static inline void pc87413_disable_sw_wd_tren(unsigned int swc_base_addr)
+{
+       /* Disable SW_WD_TREN */
+
+       outb_p(inb (swc_base_addr + WDCFG) & 0x7f, swc_base_addr + WDCFG);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "pc87413 - Disable SW_WD_TREN\n");
+#endif
+}
+
+/* Enable SW_WD_TRG */
+
+static inline void pc87413_enable_sw_wd_trg(unsigned int swc_base_addr)
+{
+       /* Enable SW_WD_TRG */
+
+       outb_p(inb (swc_base_addr + WDCTL) | 0x80, swc_base_addr + WDCTL);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "pc87413 - Enable SW_WD_TRG\n");
+#endif
+}
+
+/* Disable SW_WD_TRG */
+
+static inline void pc87413_disable_sw_wd_trg(unsigned int swc_base_addr)
+{
+       /* Disable SW_WD_TRG */
+
+       outb_p(inb (swc_base_addr + WDCTL) & 0x7f, swc_base_addr + WDCTL);
+
+#ifdef DEBUG
+       printk(KERN_INFO DPFX "Disable SW_WD_TRG\n");
+#endif
+}
+
+/* -- Higher level functions ------------------------------------*/
+
+/* Enable the watchdog */
+
+static void pc87413_enable(void)
+{
+       unsigned int swc_base_addr;
+
+       spin_lock(&io_lock);
+
+       pc87413_select_wdt_out();
+       pc87413_enable_swc();
+       swc_base_addr = pc87413_get_swc_base();
+       pc87413_swc_bank3(swc_base_addr);
+       pc87413_programm_wdto(swc_base_addr, timeout);
+       pc87413_enable_wden(swc_base_addr);
+       pc87413_enable_sw_wd_tren(swc_base_addr);
+       pc87413_enable_sw_wd_trg(swc_base_addr);
+
+       spin_unlock(&io_lock);
+}
+
+/* Disable the watchdog */
+
+static void pc87413_disable(void)
+{
+       unsigned int swc_base_addr;
+
+       spin_lock(&io_lock);
+
+       pc87413_select_wdt_out();
+       pc87413_enable_swc();
+       swc_base_addr = pc87413_get_swc_base();
+       pc87413_swc_bank3(swc_base_addr);
+       pc87413_disable_sw_wd_tren(swc_base_addr);
+       pc87413_disable_sw_wd_trg(swc_base_addr);
+       pc87413_programm_wdto(swc_base_addr, 0);
+
+       spin_unlock(&io_lock);
+}
+
+/* Refresh the watchdog */
+
+static void pc87413_refresh(void)
+{
+       unsigned int swc_base_addr;
+
+       spin_lock(&io_lock);
+
+       pc87413_select_wdt_out();
+       pc87413_enable_swc();
+       swc_base_addr = pc87413_get_swc_base();
+       pc87413_swc_bank3(swc_base_addr);
+       pc87413_disable_sw_wd_tren(swc_base_addr);
+       pc87413_disable_sw_wd_trg(swc_base_addr);
+       pc87413_programm_wdto(swc_base_addr, timeout);
+       pc87413_enable_wden(swc_base_addr);
+       pc87413_enable_sw_wd_tren(swc_base_addr);
+       pc87413_enable_sw_wd_trg(swc_base_addr);
+
+       spin_unlock(&io_lock);
+}
+
+/* -- File operations -------------------------------------------*/
+
+/**
+ *     pc87413_open:
+ *     @inode: inode of device
+ *     @file: file handle to device
+ *
+ */
+
+static int pc87413_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+
+       if (test_and_set_bit(0, &timer_enabled))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Reload and activate timer */
+       pc87413_refresh();
+
+       printk(KERN_INFO MODNAME "Watchdog enabled. Timeout set to"
+                                " %d minute(s).\n", timeout);
+
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     pc87413_release:
+ *     @inode: inode to board
+ *     @file: file handle to board
+ *
+ *     The watchdog has a configurable API. There is a religious dispute
+ *     between people who want their watchdog to be able to shut down and
+ *     those who want to be sure if the watchdog manager dies the machine
+ *     reboots. In the former case we disable the counters, in the latter
+ *     case you have to open it again very soon.
+ */
+
+static int pc87413_release(struct inode *inode, struct file *file)
+{
+       /* Shut off the timer. */
+
+       if (expect_close == 42) {
+               pc87413_disable();
+               printk(KERN_INFO MODNAME "Watchdog disabled,"
+                                        " sleeping again...\n");
+       } else {
+               printk(KERN_CRIT MODNAME "Unexpected close, not stopping"
+                                        " watchdog!\n");
+               pc87413_refresh();
+       }
+
+       clear_bit(0, &timer_enabled);
+       expect_close = 0;
+
+       return 0;
+}
+
+/**
+ *     pc87413_status:
+ *
+ *      return, if the watchdog is enabled (timeout is set...)
+ */
+
+
+static int pc87413_status(void)
+{
+         return 0; /* currently not supported */
+}
+
+/**
+ *     pc87413_write:
+ *     @file: file handle to the watchdog
+ *     @data: data buffer to write
+ *     @len: length in bytes
+ *     @ppos: pointer to the position to write. No seeks allowed
+ *
+ *     A write to a watchdog device is defined as a keepalive signal. Any
+ *     write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t pc87413_write(struct file *file, const char __user *data,
+                            size_t len, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* reset expect flag */
+                       expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               pc87413_refresh();
+       }
+       return len;
+}
+
+/**
+ *     pc87413_ioctl:
+ *     @inode: inode of the device
+ *     @file: file handle to the device
+ *     @cmd: watchdog command
+ *     @arg: argument pointer
+ *
+ *     The watchdog API defines a common set of functions for all watchdogs
+ *     according to their available features. We only actually usefully support
+ *     querying capabilities and current status.
+ */
+
+static int pc87413_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg)
+{
+       int new_timeout;
+
+       union {
+               struct watchdog_info __user *ident;
+               int __user *i;
+       } uarg;
+
+       static struct watchdog_info ident = {
+               .options          = WDIOF_KEEPALIVEPING |
+                                   WDIOF_SETTIMEOUT |
+                                   WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity         = "PC87413(HF/F) watchdog"
+       };
+
+       uarg.i = (int __user *)arg;
+
+       switch(cmd) {
+               default:
+                       return -ENOTTY;
+
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(uarg.ident, &ident,
+                               sizeof(ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+                       return put_user(pc87413_status(), uarg.i);
+
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, uarg.i);
+
+               case WDIOC_KEEPALIVE:
+                       pc87413_refresh();
+#ifdef DEBUG
+                       printk(KERN_INFO DPFX "keepalive\n");
+#endif
+                       return 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_timeout, uarg.i))
+                               return -EFAULT;
+
+                       // the API states this is given in secs
+                       new_timeout /= 60;
+
+                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       pc87413_refresh();
+
+                       // fall through and return the new timeout...
+
+               case WDIOC_GETTIMEOUT:
+
+                       new_timeout = timeout * 60;
+
+                       return put_user(new_timeout, uarg.i);
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int options, retval = -EINVAL;
+
+                       if (get_user(options, uarg.i))
+                               return -EFAULT;
+
+                       if (options & WDIOS_DISABLECARD) {
+                               pc87413_disable();
+                               retval = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               pc87413_enable();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+       }
+}
+
+/* -- Notifier funtions -----------------------------------------*/
+
+/**
+ *     notify_sys:
+ *     @this: our notifier block
+ *     @code: the event being reported
+ *     @unused: unused
+ *
+ *     Our notifier is called on system shutdowns. We want to turn the card
+ *     off at reboot otherwise the machine will reboot again during memory
+ *     test or worse yet during the following fsck. This would suck, in fact
+ *     trust me - if it happens it does suck.
+ */
+
+static int pc87413_notify_sys(struct notifier_block *this,
+                             unsigned long code,
+                             void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+       {
+               /* Turn the card off */
+               pc87413_disable();
+       }
+       return NOTIFY_DONE;
+}
+
+/* -- Module's structures ---------------------------------------*/
+
+static const struct file_operations pc87413_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = pc87413_write,
+       .ioctl          = pc87413_ioctl,
+       .open           = pc87413_open,
+       .release        = pc87413_release,
+};
+
+static struct notifier_block pc87413_notifier =
+{
+       .notifier_call  = pc87413_notify_sys,
+};
+
+static struct miscdevice pc87413_miscdev=
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &pc87413_fops
+};
+
+/* -- Module init functions -------------------------------------*/
+
+/**
+ *     pc87413_init: module's "constructor"
+ *
+ *     Set up the WDT watchdog board. All we have to do is grab the
+ *     resources we require and bitch if anyone beat us to them.
+ *     The open() function will actually kick the board off.
+ */
+
+static int __init pc87413_init(void)
+{
+       int ret;
+
+       spin_lock_init(&io_lock);
+
+       printk(KERN_INFO PFX "Version " VERSION " at io 0x%X\n", WDT_INDEX_IO_PORT);
+
+       /* request_region(io, 2, "pc87413"); */
+
+       ret = register_reboot_notifier(&pc87413_notifier);
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+       }
+
+       ret = misc_register(&pc87413_miscdev);
+
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               unregister_reboot_notifier(&pc87413_notifier);
+               return ret;
+       }
+
+       printk(KERN_INFO PFX "initialized. timeout=%d min \n", timeout);
+
+       pc87413_enable();
+
+       return 0;
+}
+
+/**
+ *     pc87413_exit: module's "destructor"
+ *
+ *     Unload the watchdog. You cannot do this with any file handles open.
+ *     If your watchdog is set to continue ticking on close and you unload
+ *     it, well it keeps ticking. We won't get the interrupt but the board
+ *     will not touch PC memory so all is fine. You just have to load a new
+ *     module in 60 seconds or reboot.
+ */
+
+static void __exit pc87413_exit(void)
+{
+       /* Stop the timer before we leave */
+       if (!nowayout)
+       {
+               pc87413_disable();
+               printk(KERN_INFO MODNAME "Watchdog disabled.\n");
+       }
+
+       misc_deregister(&pc87413_miscdev);
+       unregister_reboot_notifier(&pc87413_notifier);
+       /* release_region(io,2); */
+
+       printk(MODNAME " watchdog component driver removed.\n");
+}
+
+module_init(pc87413_init);
+module_exit(pc87413_exit);
+
+MODULE_AUTHOR("Sven Anders <anders@anduras.de>, Marcus Junker <junker@anduras.de>,");
+MODULE_DESCRIPTION("PC87413 WDT driver");
+MODULE_LICENSE("GPL");
+
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+module_param(io, int, 0);
+MODULE_PARM_DESC(io, MODNAME " I/O port (default: " __MODULE_STRING(io) ").");
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes (default=" __MODULE_STRING(timeout) ").");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c
new file mode 100644 (file)
index 0000000..7b41434
--- /dev/null
@@ -0,0 +1,1013 @@
+/*
+ * PC Watchdog Driver
+ * by Ken Hollis (khollis@bitgate.com)
+ *
+ * Permission granted from Simon Machell (smachell@berkprod.com)
+ * Written for the Linux Kernel, and GPLed by Ken Hollis
+ *
+ * 960107      Added request_region routines, modulized the whole thing.
+ * 960108      Fixed end-of-file pointer (Thanks to Dan Hollis), added
+ *             WD_TIMEOUT define.
+ * 960216      Added eof marker on the file, and changed verbose messages.
+ * 960716      Made functional and cosmetic changes to the source for
+ *             inclusion in Linux 2.0.x kernels, thanks to Alan Cox.
+ * 960717      Removed read/seek routines, replaced with ioctl.  Also, added
+ *             check_region command due to Alan's suggestion.
+ * 960821      Made changes to compile in newer 2.0.x kernels.  Added
+ *             "cold reboot sense" entry.
+ * 960825      Made a few changes to code, deleted some defines and made
+ *             typedefs to replace them.  Made heartbeat reset only available
+ *             via ioctl, and removed the write routine.
+ * 960828      Added new items for PC Watchdog Rev.C card.
+ * 960829      Changed around all of the IOCTLs, added new features,
+ *             added watchdog disable/re-enable routines.  Added firmware
+ *             version reporting.  Added read routine for temperature.
+ *             Removed some extra defines, added an autodetect Revision
+ *             routine.
+ * 961006       Revised some documentation, fixed some cosmetic bugs.  Made
+ *              drivers to panic the system if it's overheating at bootup.
+ * 961118      Changed some verbiage on some of the output, tidied up
+ *             code bits, and added compatibility to 2.1.x.
+ * 970912       Enabled board on open and disable on close.
+ * 971107      Took account of recent VFS changes (broke read).
+ * 971210       Disable board on initialisation in case board already ticking.
+ * 971222       Changed open/close for temperature handling
+ *              Michael Meskes <meskes@debian.org>.
+ * 980112       Used minor numbers from include/linux/miscdevice.h
+ * 990403       Clear reset status after reading control status register in
+ *              pcwd_showprevstate(). [Marc Boucher <marc@mbsi.ca>]
+ * 990605      Made changes to code to support Firmware 1.22a, added
+ *             fairly useless proc entry.
+ * 990610      removed said useless proc code for the merge <alan>
+ * 000403      Removed last traces of proc code. <davej>
+ * 011214      Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT <Matt_Domsch@dell.com>
+ *              Added timeout module option to override default
+ */
+
+/*
+ *     A bells and whistles driver is available from http://www.pcwd.de/
+ *     More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
+ */
+
+#include <linux/module.h>      /* For module specific items */
+#include <linux/moduleparam.h> /* For new moduleparam's */
+#include <linux/types.h>       /* For standard types (like size_t) */
+#include <linux/errno.h>       /* For the -ENODEV/... values */
+#include <linux/kernel.h>      /* For printk/panic/... */
+#include <linux/delay.h>       /* For mdelay function */
+#include <linux/timer.h>       /* For timer related operations */
+#include <linux/jiffies.h>     /* For jiffies stuff */
+#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
+#include <linux/watchdog.h>    /* For the watchdog specific items */
+#include <linux/reboot.h>      /* For kernel_power_off() */
+#include <linux/init.h>                /* For __init/__exit/... */
+#include <linux/fs.h>          /* For file operations */
+#include <linux/isa.h>         /* For isa devices */
+#include <linux/ioport.h>      /* For io-port access */
+#include <linux/spinlock.h>    /* For spin_lock/spin_unlock/... */
+
+#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
+#include <asm/io.h>            /* For inb/outb/... */
+
+/* Module and version information */
+#define WATCHDOG_VERSION "1.20"
+#define WATCHDOG_DATE "18 Feb 2007"
+#define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
+#define WATCHDOG_NAME "pcwd"
+#define PFX WATCHDOG_NAME ": "
+#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n"
+#define WD_VER WATCHDOG_VERSION " (" WATCHDOG_DATE ")"
+
+/*
+ * It should be noted that PCWD_REVISION_B was removed because A and B
+ * are essentially the same types of card, with the exception that B
+ * has temperature reporting.  Since I didn't receive a Rev.B card,
+ * the Rev.B card is not supported.  (It's a good thing too, as they
+ * are no longer in production.)
+ */
+#define        PCWD_REVISION_A         1
+#define        PCWD_REVISION_C         2
+
+/*
+ * These are the auto-probe addresses available.
+ *
+ * Revision A only uses ports 0x270 and 0x370.  Revision C introduced 0x350.
+ * Revision A has an address range of 2 addresses, while Revision C has 4.
+ */
+#define PCWD_ISA_NR_CARDS      3
+static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 };
+
+/*
+ * These are the defines that describe the control status bits for the
+ * PCI-PC Watchdog card.
+*/
+/* Port 1 : Control Status #1 for the PC Watchdog card, revision A. */
+#define WD_WDRST               0x01    /* Previously reset state */
+#define WD_T110                        0x02    /* Temperature overheat sense */
+#define WD_HRTBT               0x04    /* Heartbeat sense */
+#define WD_RLY2                        0x08    /* External relay triggered */
+#define WD_SRLY2               0x80    /* Software external relay triggered */
+/* Port 1 : Control Status #1 for the PC Watchdog card, revision C. */
+#define WD_REVC_WTRP           0x01    /* Watchdog Trip status */
+#define WD_REVC_HRBT           0x02    /* Watchdog Heartbeat */
+#define WD_REVC_TTRP           0x04    /* Temperature Trip status */
+#define WD_REVC_RL2A           0x08    /* Relay 2 activated by on-board processor */
+#define WD_REVC_RL1A           0x10    /* Relay 1 active */
+#define WD_REVC_R2DS           0x40    /* Relay 2 disable */
+#define WD_REVC_RLY2           0x80    /* Relay 2 activated? */
+/* Port 2 : Control Status #2 */
+#define WD_WDIS                        0x10    /* Watchdog Disabled */
+#define WD_ENTP                        0x20    /* Watchdog Enable Temperature Trip */
+#define WD_SSEL                        0x40    /* Watchdog Switch Select (1:SW1 <-> 0:SW2) */
+#define WD_WCMD                        0x80    /* Watchdog Command Mode */
+
+/* max. time we give an ISA watchdog card to process a command */
+/* 500ms for each 4 bit response (according to spec.) */
+#define ISA_COMMAND_TIMEOUT     1000
+
+/* Watchdog's internal commands */
+#define CMD_ISA_IDLE                   0x00
+#define CMD_ISA_VERSION_INTEGER                0x01
+#define CMD_ISA_VERSION_TENTH          0x02
+#define CMD_ISA_VERSION_HUNDRETH       0x03
+#define CMD_ISA_VERSION_MINOR          0x04
+#define CMD_ISA_SWITCH_SETTINGS                0x05
+#define CMD_ISA_RESET_PC               0x06
+#define CMD_ISA_ARM_0                  0x07
+#define CMD_ISA_ARM_30                 0x08
+#define CMD_ISA_ARM_60                 0x09
+#define CMD_ISA_DELAY_TIME_2SECS       0x0A
+#define CMD_ISA_DELAY_TIME_4SECS       0x0B
+#define CMD_ISA_DELAY_TIME_8SECS       0x0C
+#define CMD_ISA_RESET_RELAYS           0x0D
+
+/* Watchdog's Dip Switch heartbeat values */
+static const int heartbeat_tbl [] = {
+       20,     /* OFF-OFF-OFF  = 20 Sec  */
+       40,     /* OFF-OFF-ON   = 40 Sec  */
+       60,     /* OFF-ON-OFF   =  1 Min  */
+       300,    /* OFF-ON-ON    =  5 Min  */
+       600,    /* ON-OFF-OFF   = 10 Min  */
+       1800,   /* ON-OFF-ON    = 30 Min  */
+       3600,   /* ON-ON-OFF    =  1 Hour */
+       7200,   /* ON-ON-ON     =  2 hour */
+};
+
+/*
+ * We are using an kernel timer to do the pinging of the watchdog
+ * every ~500ms. We try to set the internal heartbeat of the
+ * watchdog to 2 ms.
+ */
+
+#define WDT_INTERVAL (HZ/2+1)
+
+/* We can only use 1 card due to the /dev/watchdog restriction */
+static int cards_found;
+
+/* internal variables */
+static atomic_t open_allowed = ATOMIC_INIT(1);
+static char expect_close;
+static int temp_panic;
+static struct {                                /* this is private data for each ISA-PC watchdog card */
+       char fw_ver_str[6];             /* The cards firmware version */
+       int revision;                   /* The card's revision */
+       int supports_temp;              /* Wether or not the card has a temperature device */
+       int command_mode;               /* Wether or not the card is in command mode */
+       int boot_status;                /* The card's boot status */
+       int io_addr;                    /* The cards I/O address */
+       spinlock_t io_lock;             /* the lock for io operations */
+       struct timer_list timer;        /* The timer that pings the watchdog */
+       unsigned long next_heartbeat;   /* the next_heartbeat for the timer */
+} pcwd_private;
+
+/* module parameters */
+#define QUIET  0       /* Default */
+#define VERBOSE        1       /* Verbose */
+#define DEBUG  2       /* print fancy stuff too */
+static int debug = QUIET;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");
+
+#define WATCHDOG_HEARTBEAT 0           /* default heartbeat = delay-time from dip-switches */
+static int heartbeat = WATCHDOG_HEARTBEAT;
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Internal functions
+ */
+
+static int send_isa_command(int cmd)
+{
+       int i;
+       int control_status;
+       int port0, last_port0;  /* Double read for stabilising */
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "sending following data cmd=0x%02x\n",
+                       cmd);
+
+       /* The WCMD bit must be 1 and the command is only 4 bits in size */
+       control_status = (cmd & 0x0F) | WD_WCMD;
+       outb_p(control_status, pcwd_private.io_addr + 2);
+       udelay(ISA_COMMAND_TIMEOUT);
+
+       port0 = inb_p(pcwd_private.io_addr);
+       for (i = 0; i < 25; ++i) {
+               last_port0 = port0;
+               port0 = inb_p(pcwd_private.io_addr);
+
+               if (port0 == last_port0)
+                       break;  /* Data is stable */
+
+               udelay (250);
+       }
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n",
+                       cmd, port0, last_port0);
+
+       return port0;
+}
+
+static int set_command_mode(void)
+{
+       int i, found=0, count=0;
+
+       /* Set the card into command mode */
+       spin_lock(&pcwd_private.io_lock);
+       while ((!found) && (count < 3)) {
+               i = send_isa_command(CMD_ISA_IDLE);
+
+               if (i == 0x00)
+                       found = 1;
+               else if (i == 0xF3) {
+                       /* Card does not like what we've done to it */
+                       outb_p(0x00, pcwd_private.io_addr + 2);
+                       udelay(1200);   /* Spec says wait 1ms */
+                       outb_p(0x00, pcwd_private.io_addr + 2);
+                       udelay(ISA_COMMAND_TIMEOUT);
+               }
+               count++;
+       }
+       spin_unlock(&pcwd_private.io_lock);
+       pcwd_private.command_mode = found;
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "command_mode=%d\n",
+                               pcwd_private.command_mode);
+
+       return(found);
+}
+
+static void unset_command_mode(void)
+{
+       /* Set the card into normal mode */
+       spin_lock(&pcwd_private.io_lock);
+       outb_p(0x00, pcwd_private.io_addr + 2);
+       udelay(ISA_COMMAND_TIMEOUT);
+       spin_unlock(&pcwd_private.io_lock);
+
+       pcwd_private.command_mode = 0;
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "command_mode=%d\n",
+                               pcwd_private.command_mode);
+}
+
+static inline void pcwd_check_temperature_support(void)
+{
+       if (inb(pcwd_private.io_addr) != 0xF0)
+               pcwd_private.supports_temp = 1;
+}
+
+static inline void pcwd_get_firmware(void)
+{
+       int one, ten, hund, minor;
+
+       strcpy(pcwd_private.fw_ver_str, "ERROR");
+
+       if (set_command_mode()) {
+               one = send_isa_command(CMD_ISA_VERSION_INTEGER);
+               ten = send_isa_command(CMD_ISA_VERSION_TENTH);
+               hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH);
+               minor = send_isa_command(CMD_ISA_VERSION_MINOR);
+               sprintf(pcwd_private.fw_ver_str, "%c.%c%c%c", one, ten, hund, minor);
+       }
+       unset_command_mode();
+
+       return;
+}
+
+static inline int pcwd_get_option_switches(void)
+{
+       int option_switches=0;
+
+       if (set_command_mode()) {
+               /* Get switch settings */
+               option_switches = send_isa_command(CMD_ISA_SWITCH_SETTINGS);
+       }
+
+       unset_command_mode();
+       return(option_switches);
+}
+
+static void pcwd_show_card_info(void)
+{
+       int option_switches;
+
+       /* Get some extra info from the hardware (in command/debug/diag mode) */
+       if (pcwd_private.revision == PCWD_REVISION_A)
+               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", pcwd_private.io_addr);
+       else if (pcwd_private.revision == PCWD_REVISION_C) {
+               pcwd_get_firmware();
+               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n",
+                       pcwd_private.io_addr, pcwd_private.fw_ver_str);
+               option_switches = pcwd_get_option_switches();
+               printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
+                       option_switches,
+                       ((option_switches & 0x10) ? "ON" : "OFF"),
+                       ((option_switches & 0x08) ? "ON" : "OFF"));
+
+               /* Reprogram internal heartbeat to 2 seconds */
+               if (set_command_mode()) {
+                       send_isa_command(CMD_ISA_DELAY_TIME_2SECS);
+                       unset_command_mode();
+               }
+       }
+
+       if (pcwd_private.supports_temp)
+               printk(KERN_INFO PFX "Temperature Option Detected\n");
+
+       if (pcwd_private.boot_status & WDIOF_CARDRESET)
+               printk(KERN_INFO PFX "Previous reboot was caused by the card\n");
+
+       if (pcwd_private.boot_status & WDIOF_OVERHEAT) {
+               printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n");
+               printk(KERN_EMERG PFX "CPU Overheat\n");
+       }
+
+       if (pcwd_private.boot_status == 0)
+               printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
+}
+
+static void pcwd_timer_ping(unsigned long data)
+{
+       int wdrst_stat;
+
+       /* If we got a heartbeat pulse within the WDT_INTERVAL
+        * we agree to ping the WDT */
+       if(time_before(jiffies, pcwd_private.next_heartbeat)) {
+               /* Ping the watchdog */
+               spin_lock(&pcwd_private.io_lock);
+               if (pcwd_private.revision == PCWD_REVISION_A) {
+                       /*  Rev A cards are reset by setting the WD_WDRST bit in register 1 */
+                       wdrst_stat = inb_p(pcwd_private.io_addr);
+                       wdrst_stat &= 0x0F;
+                       wdrst_stat |= WD_WDRST;
+
+                       outb_p(wdrst_stat, pcwd_private.io_addr + 1);
+               } else {
+                       /* Re-trigger watchdog by writing to port 0 */
+                       outb_p(0x00, pcwd_private.io_addr);
+               }
+
+               /* Re-set the timer interval */
+               mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
+
+               spin_unlock(&pcwd_private.io_lock);
+       } else {
+               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
+       }
+}
+
+static int pcwd_start(void)
+{
+       int stat_reg;
+
+       pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
+
+       /* Start the timer */
+       mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
+
+       /* Enable the port */
+       if (pcwd_private.revision == PCWD_REVISION_C) {
+               spin_lock(&pcwd_private.io_lock);
+               outb_p(0x00, pcwd_private.io_addr + 3);
+               udelay(ISA_COMMAND_TIMEOUT);
+               stat_reg = inb_p(pcwd_private.io_addr + 2);
+               spin_unlock(&pcwd_private.io_lock);
+               if (stat_reg & WD_WDIS) {
+                       printk(KERN_INFO PFX "Could not start watchdog\n");
+                       return -EIO;
+               }
+       }
+
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "Watchdog started\n");
+
+       return 0;
+}
+
+static int pcwd_stop(void)
+{
+       int stat_reg;
+
+       /* Stop the timer */
+       del_timer(&pcwd_private.timer);
+
+       /*  Disable the board  */
+       if (pcwd_private.revision == PCWD_REVISION_C) {
+               spin_lock(&pcwd_private.io_lock);
+               outb_p(0xA5, pcwd_private.io_addr + 3);
+               udelay(ISA_COMMAND_TIMEOUT);
+               outb_p(0xA5, pcwd_private.io_addr + 3);
+               udelay(ISA_COMMAND_TIMEOUT);
+               stat_reg = inb_p(pcwd_private.io_addr + 2);
+               spin_unlock(&pcwd_private.io_lock);
+               if ((stat_reg & WD_WDIS) == 0) {
+                       printk(KERN_INFO PFX "Could not stop watchdog\n");
+                       return -EIO;
+               }
+       }
+
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "Watchdog stopped\n");
+
+       return 0;
+}
+
+static int pcwd_keepalive(void)
+{
+       /* user land ping */
+       pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n");
+
+       return 0;
+}
+
+static int pcwd_set_heartbeat(int t)
+{
+       if ((t < 2) || (t > 7200)) /* arbitrary upper limit */
+               return -EINVAL;
+
+       heartbeat = t;
+
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "New heartbeat: %d\n",
+                      heartbeat);
+
+       return 0;
+}
+
+static int pcwd_get_status(int *status)
+{
+       int control_status;
+
+       *status=0;
+       spin_lock(&pcwd_private.io_lock);
+       if (pcwd_private.revision == PCWD_REVISION_A)
+               /* Rev A cards return status information from
+                * the base register, which is used for the
+                * temperature in other cards. */
+               control_status = inb(pcwd_private.io_addr);
+       else {
+               /* Rev C cards return card status in the base
+                * address + 1 register. And use different bits
+                * to indicate a card initiated reset, and an
+                * over-temperature condition. And the reboot
+                * status can be reset. */
+               control_status = inb(pcwd_private.io_addr + 1);
+       }
+       spin_unlock(&pcwd_private.io_lock);
+
+       if (pcwd_private.revision == PCWD_REVISION_A) {
+               if (control_status & WD_WDRST)
+                       *status |= WDIOF_CARDRESET;
+
+               if (control_status & WD_T110) {
+                       *status |= WDIOF_OVERHEAT;
+                       if (temp_panic) {
+                               printk(KERN_INFO PFX "Temperature overheat trip!\n");
+                               kernel_power_off();
+                               /* or should we just do a: panic(PFX "Temperature overheat trip!\n"); */
+                       }
+               }
+       } else {
+               if (control_status & WD_REVC_WTRP)
+                       *status |= WDIOF_CARDRESET;
+
+               if (control_status & WD_REVC_TTRP) {
+                       *status |= WDIOF_OVERHEAT;
+                       if (temp_panic) {
+                               printk(KERN_INFO PFX "Temperature overheat trip!\n");
+                               kernel_power_off();
+                               /* or should we just do a: panic(PFX "Temperature overheat trip!\n"); */
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static int pcwd_clear_status(void)
+{
+       int control_status;
+
+       if (pcwd_private.revision == PCWD_REVISION_C) {
+               spin_lock(&pcwd_private.io_lock);
+
+               if (debug >= VERBOSE)
+                       printk(KERN_INFO PFX "clearing watchdog trip status\n");
+
+               control_status = inb_p(pcwd_private.io_addr + 1);
+
+               if (debug >= DEBUG) {
+                       printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status);
+                       printk(KERN_DEBUG PFX "sending: 0x%02x\n",
+                               (control_status & WD_REVC_R2DS));
+               }
+
+               /* clear reset status & Keep Relay 2 disable state as it is */
+               outb_p((control_status & WD_REVC_R2DS), pcwd_private.io_addr + 1);
+
+               spin_unlock(&pcwd_private.io_lock);
+       }
+       return 0;
+}
+
+static int pcwd_get_temperature(int *temperature)
+{
+       /* check that port 0 gives temperature info and no command results */
+       if (pcwd_private.command_mode)
+               return -1;
+
+       *temperature = 0;
+       if (!pcwd_private.supports_temp)
+               return -ENODEV;
+
+       /*
+        * Convert celsius to fahrenheit, since this was
+        * the decided 'standard' for this return value.
+        */
+       spin_lock(&pcwd_private.io_lock);
+       *temperature = ((inb(pcwd_private.io_addr)) * 9 / 5) + 32;
+       spin_unlock(&pcwd_private.io_lock);
+
+       if (debug >= DEBUG) {
+               printk(KERN_DEBUG PFX "temperature is: %d F\n",
+                       *temperature);
+       }
+
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int pcwd_ioctl(struct inode *inode, struct file *file,
+                     unsigned int cmd, unsigned long arg)
+{
+       int rv;
+       int status;
+       int temperature;
+       int new_heartbeat;
+       int __user *argp = (int __user *)arg;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_OVERHEAT |
+                                       WDIOF_CARDRESET |
+                                       WDIOF_KEEPALIVEPING |
+                                       WDIOF_SETTIMEOUT |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     1,
+               .identity =             "PCWD",
+       };
+
+       switch(cmd) {
+       default:
+               return -ENOTTY;
+
+       case WDIOC_GETSUPPORT:
+               if(copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
+               return 0;
+
+       case WDIOC_GETSTATUS:
+               pcwd_get_status(&status);
+               return put_user(status, argp);
+
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(pcwd_private.boot_status, argp);
+
+       case WDIOC_GETTEMP:
+               if (pcwd_get_temperature(&temperature))
+                       return -EFAULT;
+
+               return put_user(temperature, argp);
+
+       case WDIOC_SETOPTIONS:
+               if (pcwd_private.revision == PCWD_REVISION_C)
+               {
+                       if(copy_from_user(&rv, argp, sizeof(int)))
+                               return -EFAULT;
+
+                       if (rv & WDIOS_DISABLECARD)
+                       {
+                               return pcwd_stop();
+                       }
+
+                       if (rv & WDIOS_ENABLECARD)
+                       {
+                               return pcwd_start();
+                       }
+
+                       if (rv & WDIOS_TEMPPANIC)
+                       {
+                               temp_panic = 1;
+                       }
+               }
+               return -EINVAL;
+
+       case WDIOC_KEEPALIVE:
+               pcwd_keepalive();
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_heartbeat, argp))
+                       return -EFAULT;
+
+               if (pcwd_set_heartbeat(new_heartbeat))
+                       return -EINVAL;
+
+               pcwd_keepalive();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, argp);
+       }
+
+       return 0;
+}
+
+static ssize_t pcwd_write(struct file *file, const char __user *buf, size_t len,
+                         loff_t *ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               pcwd_keepalive();
+       }
+       return len;
+}
+
+static int pcwd_open(struct inode *inode, struct file *file)
+{
+       if (!atomic_dec_and_test(&open_allowed) ) {
+               if (debug >= VERBOSE)
+                       printk(KERN_ERR PFX "Attempt to open already opened device.\n");
+               atomic_inc( &open_allowed );
+               return -EBUSY;
+       }
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Activate */
+       pcwd_start();
+       pcwd_keepalive();
+       return nonseekable_open(inode, file);
+}
+
+static int pcwd_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               pcwd_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               pcwd_keepalive();
+       }
+       expect_close = 0;
+       atomic_inc( &open_allowed );
+       return 0;
+}
+
+/*
+ *     /dev/temperature handling
+ */
+
+static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
+                        loff_t *ppos)
+{
+       int temperature;
+
+       if (pcwd_get_temperature(&temperature))
+               return -EFAULT;
+
+       if (copy_to_user(buf, &temperature, 1))
+               return -EFAULT;
+
+       return 1;
+}
+
+static int pcwd_temp_open(struct inode *inode, struct file *file)
+{
+       if (!pcwd_private.supports_temp)
+               return -ENODEV;
+
+       return nonseekable_open(inode, file);
+}
+
+static int pcwd_temp_close(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations pcwd_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = pcwd_write,
+       .ioctl          = pcwd_ioctl,
+       .open           = pcwd_open,
+       .release        = pcwd_close,
+};
+
+static struct miscdevice pcwd_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &pcwd_fops,
+};
+
+static const struct file_operations pcwd_temp_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .read           = pcwd_temp_read,
+       .open           = pcwd_temp_open,
+       .release        = pcwd_temp_close,
+};
+
+static struct miscdevice temp_miscdev = {
+       .minor =        TEMP_MINOR,
+       .name =         "temperature",
+       .fops =         &pcwd_temp_fops,
+};
+
+/*
+ *     Init & exit routines
+ */
+
+static inline int get_revision(void)
+{
+       int r = PCWD_REVISION_C;
+
+       spin_lock(&pcwd_private.io_lock);
+       /* REV A cards use only 2 io ports; test
+        * presumes a floating bus reads as 0xff. */
+       if ((inb(pcwd_private.io_addr + 2) == 0xFF) ||
+           (inb(pcwd_private.io_addr + 3) == 0xFF))
+               r=PCWD_REVISION_A;
+       spin_unlock(&pcwd_private.io_lock);
+
+       return r;
+}
+
+/*
+ *  The ISA cards have a heartbeat bit in one of the registers, which
+ *  register is card dependent.  The heartbeat bit is monitored, and if
+ *  found, is considered proof that a Berkshire card has been found.
+ *  The initial rate is once per second at board start up, then twice
+ *  per second for normal operation.
+ */
+static int __devinit pcwd_isa_match(struct device *dev, unsigned int id)
+{
+       int base_addr=pcwd_ioports[id];
+       int port0, last_port0;  /* Reg 0, in case it's REV A */
+       int port1, last_port1;  /* Register 1 for REV C cards */
+       int i;
+       int retval;
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "pcwd_isa_match id=%d\n",
+                       id);
+
+       if (!request_region (base_addr, 4, "PCWD")) {
+               printk(KERN_INFO PFX "Port 0x%04x unavailable\n", base_addr);
+               return 0;
+       }
+
+       retval = 0;
+
+       port0 = inb_p(base_addr);       /* For REV A boards */
+       port1 = inb_p(base_addr + 1);   /* For REV C boards */
+       if (port0 != 0xff || port1 != 0xff) {
+               /* Not an 'ff' from a floating bus, so must be a card! */
+               for (i = 0; i < 4; ++i) {
+
+                       msleep(500);
+
+                       last_port0 = port0;
+                       last_port1 = port1;
+
+                       port0 = inb_p(base_addr);
+                       port1 = inb_p(base_addr + 1);
+
+                       /* Has either hearbeat bit changed?  */
+                       if ((port0 ^ last_port0) & WD_HRTBT ||
+                           (port1 ^ last_port1) & WD_REVC_HRBT) {
+                               retval = 1;
+                               break;
+                       }
+               }
+       }
+       release_region (base_addr, 4);
+
+       return retval;
+}
+
+static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id)
+{
+       int ret;
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "pcwd_isa_probe id=%d\n",
+                       id);
+
+       cards_found++;
+       if (cards_found == 1)
+               printk(KERN_INFO PFX "v%s Ken Hollis (kenji@bitgate.com)\n", WD_VER);
+
+       if (cards_found > 1) {
+               printk(KERN_ERR PFX "This driver only supports 1 device\n");
+               return -ENODEV;
+       }
+
+       if (pcwd_ioports[id] == 0x0000) {
+               printk(KERN_ERR PFX "No I/O-Address for card detected\n");
+               return -ENODEV;
+       }
+       pcwd_private.io_addr = pcwd_ioports[id];
+
+       spin_lock_init(&pcwd_private.io_lock);
+
+       /* Check card's revision */
+       pcwd_private.revision = get_revision();
+
+       if (!request_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       pcwd_private.io_addr);
+               ret=-EIO;
+               goto error_request_region;
+       }
+
+       /* Initial variables */
+       pcwd_private.supports_temp = 0;
+       temp_panic = 0;
+       pcwd_private.boot_status = 0x0000;
+
+       /* get the boot_status */
+       pcwd_get_status(&pcwd_private.boot_status);
+
+       /* clear the "card caused reboot" flag */
+       pcwd_clear_status();
+
+       setup_timer(&pcwd_private.timer, pcwd_timer_ping, 0);
+
+       /*  Disable the board  */
+       pcwd_stop();
+
+       /*  Check whether or not the card supports the temperature device */
+       pcwd_check_temperature_support();
+
+       /* Show info about the card itself */
+       pcwd_show_card_info();
+
+       /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
+       if (heartbeat == 0)
+               heartbeat = heartbeat_tbl[(pcwd_get_option_switches() & 0x07)];
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (pcwd_set_heartbeat(heartbeat)) {
+               pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
+               printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",
+                       WATCHDOG_HEARTBEAT);
+       }
+
+       if (pcwd_private.supports_temp) {
+               ret = misc_register(&temp_miscdev);
+               if (ret) {
+                       printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                               TEMP_MINOR, ret);
+                       goto error_misc_register_temp;
+               }
+       }
+
+       ret = misc_register(&pcwd_miscdev);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto error_misc_register_watchdog;
+       }
+
+       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
+               heartbeat, nowayout);
+
+       return 0;
+
+error_misc_register_watchdog:
+       if (pcwd_private.supports_temp)
+               misc_deregister(&temp_miscdev);
+error_misc_register_temp:
+       release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
+error_request_region:
+       pcwd_private.io_addr = 0x0000;
+       cards_found--;
+       return ret;
+}
+
+static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id)
+{
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "pcwd_isa_remove id=%d\n",
+                       id);
+
+       if (!pcwd_private.io_addr)
+               return 1;
+
+       /*  Disable the board  */
+       if (!nowayout)
+               pcwd_stop();
+
+       /* Deregister */
+       misc_deregister(&pcwd_miscdev);
+       if (pcwd_private.supports_temp)
+               misc_deregister(&temp_miscdev);
+       release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
+       pcwd_private.io_addr = 0x0000;
+       cards_found--;
+
+       return 0;
+}
+
+static void pcwd_isa_shutdown(struct device *dev, unsigned int id)
+{
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "pcwd_isa_shutdown id=%d\n",
+                       id);
+
+       pcwd_stop();
+}
+
+static struct isa_driver pcwd_isa_driver = {
+       .match          = pcwd_isa_match,
+       .probe          = pcwd_isa_probe,
+       .remove         = __devexit_p(pcwd_isa_remove),
+       .shutdown       = pcwd_isa_shutdown,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = WATCHDOG_NAME,
+       },
+};
+
+static int __init pcwd_init_module(void)
+{
+       return isa_register_driver(&pcwd_isa_driver, PCWD_ISA_NR_CARDS);
+}
+
+static void __exit pcwd_cleanup_module(void)
+{
+       isa_unregister_driver(&pcwd_isa_driver);
+       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
+}
+
+module_init(pcwd_init_module);
+module_exit(pcwd_cleanup_module);
+
+MODULE_AUTHOR("Ken Hollis <kenji@bitgate.com>, Wim Van Sebroeck <wim@iguana.be>");
+MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver");
+MODULE_VERSION(WATCHDOG_VERSION);
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c
new file mode 100644 (file)
index 0000000..61a89e9
--- /dev/null
@@ -0,0 +1,832 @@
+/*
+ *     Berkshire PCI-PC Watchdog Card Driver
+ *
+ *     (c) Copyright 2003-2007 Wim Van Sebroeck <wim@iguana.be>.
+ *
+ *     Based on source code of the following authors:
+ *       Ken Hollis <kenji@bitgate.com>,
+ *       Lindsay Harris <lindsay@bluegum.com>,
+ *       Alan Cox <alan@redhat.com>,
+ *       Matt Domsch <Matt_Domsch@dell.com>,
+ *       Rob Radez <rob@osinvestor.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
+ *     provide warranty for any of this software. This material is
+ *     provided "AS-IS" and at no charge.
+ */
+
+/*
+ *     A bells and whistles driver is available from:
+ *     http://www.kernel.org/pub/linux/kernel/people/wim/pcwd/pcwd_pci/
+ *
+ *     More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
+ */
+
+/*
+ *     Includes, defines, variables, module parameters, ...
+ */
+
+#include <linux/module.h>      /* For module specific items */
+#include <linux/moduleparam.h> /* For new moduleparam's */
+#include <linux/types.h>       /* For standard types (like size_t) */
+#include <linux/errno.h>       /* For the -ENODEV/... values */
+#include <linux/kernel.h>      /* For printk/panic/... */
+#include <linux/delay.h>       /* For mdelay function */
+#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
+#include <linux/watchdog.h>    /* For the watchdog specific items */
+#include <linux/notifier.h>    /* For notifier support */
+#include <linux/reboot.h>      /* For reboot_notifier stuff */
+#include <linux/init.h>                /* For __init/__exit/... */
+#include <linux/fs.h>          /* For file operations */
+#include <linux/pci.h>         /* For pci functions */
+#include <linux/ioport.h>      /* For io-port access */
+#include <linux/spinlock.h>    /* For spin_lock/spin_unlock/... */
+
+#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
+#include <asm/io.h>            /* For inb/outb/... */
+
+/* Module and version information */
+#define WATCHDOG_VERSION "1.03"
+#define WATCHDOG_DATE "21 Jan 2007"
+#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
+#define WATCHDOG_NAME "pcwd_pci"
+#define PFX WATCHDOG_NAME ": "
+#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n"
+
+/* Stuff for the PCI ID's  */
+#ifndef PCI_VENDOR_ID_QUICKLOGIC
+#define PCI_VENDOR_ID_QUICKLOGIC    0x11e3
+#endif
+
+#ifndef PCI_DEVICE_ID_WATCHDOG_PCIPCWD
+#define PCI_DEVICE_ID_WATCHDOG_PCIPCWD 0x5030
+#endif
+
+/*
+ * These are the defines that describe the control status bits for the
+ * PCI-PC Watchdog card.
+ */
+/* Port 1 : Control Status #1 */
+#define WD_PCI_WTRP            0x01    /* Watchdog Trip status */
+#define WD_PCI_HRBT            0x02    /* Watchdog Heartbeat */
+#define WD_PCI_TTRP            0x04    /* Temperature Trip status */
+#define WD_PCI_RL2A            0x08    /* Relay 2 Active */
+#define WD_PCI_RL1A            0x10    /* Relay 1 Active */
+#define WD_PCI_R2DS            0x40    /* Relay 2 Disable Temperature-trip/reset */
+#define WD_PCI_RLY2            0x80    /* Activate Relay 2 on the board */
+/* Port 2 : Control Status #2 */
+#define WD_PCI_WDIS            0x10    /* Watchdog Disable */
+#define WD_PCI_ENTP            0x20    /* Enable Temperature Trip Reset */
+#define WD_PCI_WRSP            0x40    /* Watchdog wrote response */
+#define WD_PCI_PCMD            0x80    /* PC has sent command */
+
+/* according to documentation max. time to process a command for the pci
+ * watchdog card is 100 ms, so we give it 150 ms to do it's job */
+#define PCI_COMMAND_TIMEOUT    150
+
+/* Watchdog's internal commands */
+#define CMD_GET_STATUS                         0x04
+#define CMD_GET_FIRMWARE_VERSION               0x08
+#define CMD_READ_WATCHDOG_TIMEOUT              0x18
+#define CMD_WRITE_WATCHDOG_TIMEOUT             0x19
+#define CMD_GET_CLEAR_RESET_COUNT              0x84
+
+/* Watchdog's Dip Switch heartbeat values */
+static const int heartbeat_tbl [] = {
+       5,      /* OFF-OFF-OFF  =  5 Sec  */
+       10,     /* OFF-OFF-ON   = 10 Sec  */
+       30,     /* OFF-ON-OFF   = 30 Sec  */
+       60,     /* OFF-ON-ON    =  1 Min  */
+       300,    /* ON-OFF-OFF   =  5 Min  */
+       600,    /* ON-OFF-ON    = 10 Min  */
+       1800,   /* ON-ON-OFF    = 30 Min  */
+       3600,   /* ON-ON-ON     =  1 hour */
+};
+
+/* We can only use 1 card due to the /dev/watchdog restriction */
+static int cards_found;
+
+/* internal variables */
+static int temp_panic;
+static unsigned long is_active;
+static char expect_release;
+static struct {                                /* this is private data for each PCI-PC watchdog card */
+       int supports_temp;              /* Wether or not the card has a temperature device */
+       int boot_status;                /* The card's boot status */
+       unsigned long io_addr;          /* The cards I/O address */
+       spinlock_t io_lock;             /* the lock for io operations */
+       struct pci_dev *pdev;           /* the PCI-device */
+} pcipcwd_private;
+
+/* module parameters */
+#define QUIET  0       /* Default */
+#define VERBOSE        1       /* Verbose */
+#define DEBUG  2       /* print fancy stuff too */
+static int debug = QUIET;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");
+
+#define WATCHDOG_HEARTBEAT 0   /* default heartbeat = delay-time from dip-switches */
+static int heartbeat = WATCHDOG_HEARTBEAT;
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Internal functions
+ */
+
+static int send_command(int cmd, int *msb, int *lsb)
+{
+       int got_response, count;
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n",
+               cmd, *msb, *lsb);
+
+       spin_lock(&pcipcwd_private.io_lock);
+       /* If a command requires data it should be written first.
+        * Data for commands with 8 bits of data should be written to port 4.
+        * Commands with 16 bits of data, should be written as LSB to port 4
+        * and MSB to port 5.
+        * After the required data has been written then write the command to
+        * port 6. */
+       outb_p(*lsb, pcipcwd_private.io_addr + 4);
+       outb_p(*msb, pcipcwd_private.io_addr + 5);
+       outb_p(cmd, pcipcwd_private.io_addr + 6);
+
+       /* wait till the pci card processed the command, signaled by
+        * the WRSP bit in port 2 and give it a max. timeout of
+        * PCI_COMMAND_TIMEOUT to process */
+       got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
+       for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) {
+               mdelay(1);
+               got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
+       }
+
+       if (debug >= DEBUG) {
+               if (got_response) {
+                       printk(KERN_DEBUG PFX "time to process command was: %d ms\n",
+                               count);
+               } else {
+                       printk(KERN_DEBUG PFX "card did not respond on command!\n");
+               }
+       }
+
+       if (got_response) {
+               /* read back response */
+               *lsb = inb_p(pcipcwd_private.io_addr + 4);
+               *msb = inb_p(pcipcwd_private.io_addr + 5);
+
+               /* clear WRSP bit */
+               inb_p(pcipcwd_private.io_addr + 6);
+
+               if (debug >= DEBUG)
+                       printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n",
+                               cmd, *msb, *lsb);
+       }
+
+       spin_unlock(&pcipcwd_private.io_lock);
+
+       return got_response;
+}
+
+static inline void pcipcwd_check_temperature_support(void)
+{
+       if (inb_p(pcipcwd_private.io_addr) != 0xF0)
+               pcipcwd_private.supports_temp = 1;
+}
+
+static int pcipcwd_get_option_switches(void)
+{
+       int option_switches;
+
+       option_switches = inb_p(pcipcwd_private.io_addr + 3);
+       return option_switches;
+}
+
+static void pcipcwd_show_card_info(void)
+{
+       int got_fw_rev, fw_rev_major, fw_rev_minor;
+       char fw_ver_str[20];            /* The cards firmware version */
+       int option_switches;
+
+       got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
+       if (got_fw_rev) {
+               sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
+       } else {
+               sprintf(fw_ver_str, "<card no answer>");
+       }
+
+       /* Get switch settings */
+       option_switches = pcipcwd_get_option_switches();
+
+       printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n",
+               (int) pcipcwd_private.io_addr, fw_ver_str,
+               (pcipcwd_private.supports_temp ? "with" : "without"));
+
+       printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
+               option_switches,
+               ((option_switches & 0x10) ? "ON" : "OFF"),
+               ((option_switches & 0x08) ? "ON" : "OFF"));
+
+       if (pcipcwd_private.boot_status & WDIOF_CARDRESET)
+               printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n");
+
+       if (pcipcwd_private.boot_status & WDIOF_OVERHEAT)
+               printk(KERN_INFO PFX "Card sensed a CPU Overheat\n");
+
+       if (pcipcwd_private.boot_status == 0)
+               printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
+}
+
+static int pcipcwd_start(void)
+{
+       int stat_reg;
+
+       spin_lock(&pcipcwd_private.io_lock);
+       outb_p(0x00, pcipcwd_private.io_addr + 3);
+       udelay(1000);
+
+       stat_reg = inb_p(pcipcwd_private.io_addr + 2);
+       spin_unlock(&pcipcwd_private.io_lock);
+
+       if (stat_reg & WD_PCI_WDIS) {
+               printk(KERN_ERR PFX "Card timer not enabled\n");
+               return -1;
+       }
+
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "Watchdog started\n");
+
+       return 0;
+}
+
+static int pcipcwd_stop(void)
+{
+       int stat_reg;
+
+       spin_lock(&pcipcwd_private.io_lock);
+       outb_p(0xA5, pcipcwd_private.io_addr + 3);
+       udelay(1000);
+
+       outb_p(0xA5, pcipcwd_private.io_addr + 3);
+       udelay(1000);
+
+       stat_reg = inb_p(pcipcwd_private.io_addr + 2);
+       spin_unlock(&pcipcwd_private.io_lock);
+
+       if (!(stat_reg & WD_PCI_WDIS)) {
+               printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n");
+               return -1;
+       }
+
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "Watchdog stopped\n");
+
+       return 0;
+}
+
+static int pcipcwd_keepalive(void)
+{
+       /* Re-trigger watchdog by writing to port 0 */
+       spin_lock(&pcipcwd_private.io_lock);
+       outb_p(0x42, pcipcwd_private.io_addr);  /* send out any data */
+       spin_unlock(&pcipcwd_private.io_lock);
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n");
+
+       return 0;
+}
+
+static int pcipcwd_set_heartbeat(int t)
+{
+       int t_msb = t / 256;
+       int t_lsb = t % 256;
+
+       if ((t < 0x0001) || (t > 0xFFFF))
+               return -EINVAL;
+
+       /* Write new heartbeat to watchdog */
+       send_command(CMD_WRITE_WATCHDOG_TIMEOUT, &t_msb, &t_lsb);
+
+       heartbeat = t;
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "New heartbeat: %d\n",
+                      heartbeat);
+
+       return 0;
+}
+
+static int pcipcwd_get_status(int *status)
+{
+       int control_status;
+
+       *status=0;
+       control_status = inb_p(pcipcwd_private.io_addr + 1);
+       if (control_status & WD_PCI_WTRP)
+               *status |= WDIOF_CARDRESET;
+       if (control_status & WD_PCI_TTRP) {
+               *status |= WDIOF_OVERHEAT;
+               if (temp_panic)
+                       panic(PFX "Temperature overheat trip!\n");
+       }
+
+       if (debug >= DEBUG)
+               printk(KERN_DEBUG PFX "Control Status #1: 0x%02x\n",
+                      control_status);
+
+       return 0;
+}
+
+static int pcipcwd_clear_status(void)
+{
+       int control_status;
+       int msb;
+       int reset_counter;
+
+       if (debug >= VERBOSE)
+               printk(KERN_INFO PFX "clearing watchdog trip status & LED\n");
+
+       control_status = inb_p(pcipcwd_private.io_addr + 1);
+
+       if (debug >= DEBUG) {
+               printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status);
+               printk(KERN_DEBUG PFX "sending: 0x%02x\n",
+                      (control_status & WD_PCI_R2DS) | WD_PCI_WTRP);
+       }
+
+       /* clear trip status & LED and keep mode of relay 2 */
+       outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1);
+
+       /* clear reset counter */
+       msb=0;
+       reset_counter=0xff;
+       send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter);
+
+       if (debug >= DEBUG) {
+               printk(KERN_DEBUG PFX "reset count was: 0x%02x\n",
+                      reset_counter);
+       }
+
+       return 0;
+}
+
+static int pcipcwd_get_temperature(int *temperature)
+{
+       *temperature = 0;
+       if (!pcipcwd_private.supports_temp)
+               return -ENODEV;
+
+       spin_lock(&pcipcwd_private.io_lock);
+       *temperature = inb_p(pcipcwd_private.io_addr);
+       spin_unlock(&pcipcwd_private.io_lock);
+
+       /*
+        * Convert celsius to fahrenheit, since this was
+        * the decided 'standard' for this return value.
+        */
+       *temperature = (*temperature * 9 / 5) + 32;
+
+       if (debug >= DEBUG) {
+               printk(KERN_DEBUG PFX "temperature is: %d F\n",
+                      *temperature);
+       }
+
+       return 0;
+}
+
+static int pcipcwd_get_timeleft(int *time_left)
+{
+       int msb;
+       int lsb;
+
+       /* Read the time that's left before rebooting */
+       /* Note: if the board is not yet armed then we will read 0xFFFF */
+       send_command(CMD_READ_WATCHDOG_TIMEOUT, &msb, &lsb);
+
+       *time_left = (msb << 8) + lsb;
+
+       if (debug >= VERBOSE)
+               printk(KERN_DEBUG PFX "Time left before next reboot: %d\n",
+                      *time_left);
+
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static ssize_t pcipcwd_write(struct file *file, const char __user *data,
+                            size_t len, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       expect_release = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if(get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_release = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               pcipcwd_keepalive();
+       }
+       return len;
+}
+
+static int pcipcwd_ioctl(struct inode *inode, struct file *file,
+                         unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_OVERHEAT |
+                                       WDIOF_CARDRESET |
+                                       WDIOF_KEEPALIVEPING |
+                                       WDIOF_SETTIMEOUT |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     1,
+               .identity =             WATCHDOG_DRIVER_NAME,
+       };
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident,
+                               sizeof (ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+               {
+                       int status;
+
+                       pcipcwd_get_status(&status);
+
+                       return put_user(status, p);
+               }
+
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(pcipcwd_private.boot_status, p);
+
+               case WDIOC_GETTEMP:
+               {
+                       int temperature;
+
+                       if (pcipcwd_get_temperature(&temperature))
+                               return -EFAULT;
+
+                       return put_user(temperature, p);
+               }
+
+               case WDIOC_KEEPALIVE:
+                       pcipcwd_keepalive();
+                       return 0;
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if (get_user (new_options, p))
+                               return -EFAULT;
+
+                       if (new_options & WDIOS_DISABLECARD) {
+                               if (pcipcwd_stop())
+                                       return -EIO;
+                               retval = 0;
+                       }
+
+                       if (new_options & WDIOS_ENABLECARD) {
+                               if (pcipcwd_start())
+                                       return -EIO;
+                               retval = 0;
+                       }
+
+                       if (new_options & WDIOS_TEMPPANIC) {
+                               temp_panic = 1;
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_heartbeat;
+
+                       if (get_user(new_heartbeat, p))
+                               return -EFAULT;
+
+                       if (pcipcwd_set_heartbeat(new_heartbeat))
+                           return -EINVAL;
+
+                       pcipcwd_keepalive();
+                       /* Fall */
+               }
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(heartbeat, p);
+
+               case WDIOC_GETTIMELEFT:
+               {
+                       int time_left;
+
+                       if (pcipcwd_get_timeleft(&time_left))
+                               return -EFAULT;
+
+                       return put_user(time_left, p);
+               }
+
+               default:
+                       return -ENOTTY;
+       }
+}
+
+static int pcipcwd_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+       if (test_and_set_bit(0, &is_active)) {
+               if (debug >= VERBOSE)
+                       printk(KERN_ERR PFX "Attempt to open already opened device.\n");
+               return -EBUSY;
+       }
+
+       /* Activate */
+       pcipcwd_start();
+       pcipcwd_keepalive();
+       return nonseekable_open(inode, file);
+}
+
+static int pcipcwd_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        */
+       if (expect_release == 42) {
+               pcipcwd_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               pcipcwd_keepalive();
+       }
+       expect_release = 0;
+       clear_bit(0, &is_active);
+       return 0;
+}
+
+/*
+ *     /dev/temperature handling
+ */
+
+static ssize_t pcipcwd_temp_read(struct file *file, char __user *data,
+                               size_t len, loff_t *ppos)
+{
+       int temperature;
+
+       if (pcipcwd_get_temperature(&temperature))
+               return -EFAULT;
+
+       if (copy_to_user (data, &temperature, 1))
+               return -EFAULT;
+
+       return 1;
+}
+
+static int pcipcwd_temp_open(struct inode *inode, struct file *file)
+{
+       if (!pcipcwd_private.supports_temp)
+               return -ENODEV;
+
+       return nonseekable_open(inode, file);
+}
+
+static int pcipcwd_temp_release(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+
+/*
+ *     Notify system
+ */
+
+static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code==SYS_DOWN || code==SYS_HALT) {
+               /* Turn the WDT off */
+               pcipcwd_stop();
+       }
+
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations pcipcwd_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .write =        pcipcwd_write,
+       .ioctl =        pcipcwd_ioctl,
+       .open =         pcipcwd_open,
+       .release =      pcipcwd_release,
+};
+
+static struct miscdevice pcipcwd_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &pcipcwd_fops,
+};
+
+static const struct file_operations pcipcwd_temp_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .read =         pcipcwd_temp_read,
+       .open =         pcipcwd_temp_open,
+       .release =      pcipcwd_temp_release,
+};
+
+static struct miscdevice pcipcwd_temp_miscdev = {
+       .minor =        TEMP_MINOR,
+       .name =         "temperature",
+       .fops =         &pcipcwd_temp_fops,
+};
+
+static struct notifier_block pcipcwd_notifier = {
+       .notifier_call =        pcipcwd_notify_sys,
+};
+
+/*
+ *     Init & exit routines
+ */
+
+static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
+               const struct pci_device_id *ent)
+{
+       int ret = -EIO;
+
+       cards_found++;
+       if (cards_found == 1)
+               printk(KERN_INFO PFX DRIVER_VERSION);
+
+       if (cards_found > 1) {
+               printk(KERN_ERR PFX "This driver only supports 1 device\n");
+               return -ENODEV;
+       }
+
+       if (pci_enable_device(pdev)) {
+               printk(KERN_ERR PFX "Not possible to enable PCI Device\n");
+               return -ENODEV;
+       }
+
+       if (pci_resource_start(pdev, 0) == 0x0000) {
+               printk(KERN_ERR PFX "No I/O-Address for card detected\n");
+               ret = -ENODEV;
+               goto err_out_disable_device;
+       }
+
+       pcipcwd_private.pdev = pdev;
+       pcipcwd_private.io_addr = pci_resource_start(pdev, 0);
+
+       if (pci_request_regions(pdev, WATCHDOG_NAME)) {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       (int) pcipcwd_private.io_addr);
+               ret = -EIO;
+               goto err_out_disable_device;
+       }
+
+       /* get the boot_status */
+       pcipcwd_get_status(&pcipcwd_private.boot_status);
+
+       /* clear the "card caused reboot" flag */
+       pcipcwd_clear_status();
+
+       /* disable card */
+       pcipcwd_stop();
+
+       /* Check whether or not the card supports the temperature device */
+       pcipcwd_check_temperature_support();
+
+       /* Show info about the card itself */
+       pcipcwd_show_card_info();
+
+       /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
+       if (heartbeat == 0)
+               heartbeat = heartbeat_tbl[(pcipcwd_get_option_switches() & 0x07)];
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (pcipcwd_set_heartbeat(heartbeat)) {
+               pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
+               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
+                       WATCHDOG_HEARTBEAT);
+       }
+
+       ret = register_reboot_notifier(&pcipcwd_notifier);
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               goto err_out_release_region;
+       }
+
+       if (pcipcwd_private.supports_temp) {
+               ret = misc_register(&pcipcwd_temp_miscdev);
+               if (ret != 0) {
+                       printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                               TEMP_MINOR, ret);
+                       goto err_out_unregister_reboot;
+               }
+       }
+
+       ret = misc_register(&pcipcwd_miscdev);
+       if (ret != 0) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto err_out_misc_deregister;
+       }
+
+       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
+               heartbeat, nowayout);
+
+       return 0;
+
+err_out_misc_deregister:
+       if (pcipcwd_private.supports_temp)
+               misc_deregister(&pcipcwd_temp_miscdev);
+err_out_unregister_reboot:
+       unregister_reboot_notifier(&pcipcwd_notifier);
+err_out_release_region:
+       pci_release_regions(pdev);
+err_out_disable_device:
+       pci_disable_device(pdev);
+       return ret;
+}
+
+static void __devexit pcipcwd_card_exit(struct pci_dev *pdev)
+{
+       /* Stop the timer before we leave */
+       if (!nowayout)
+               pcipcwd_stop();
+
+       /* Deregister */
+       misc_deregister(&pcipcwd_miscdev);
+       if (pcipcwd_private.supports_temp)
+               misc_deregister(&pcipcwd_temp_miscdev);
+       unregister_reboot_notifier(&pcipcwd_notifier);
+       pci_release_regions(pdev);
+       pci_disable_device(pdev);
+       cards_found--;
+}
+
+static struct pci_device_id pcipcwd_pci_tbl[] = {
+       { PCI_VENDOR_ID_QUICKLOGIC, PCI_DEVICE_ID_WATCHDOG_PCIPCWD,
+               PCI_ANY_ID, PCI_ANY_ID, },
+       { 0 },                  /* End of list */
+};
+MODULE_DEVICE_TABLE(pci, pcipcwd_pci_tbl);
+
+static struct pci_driver pcipcwd_driver = {
+       .name           = WATCHDOG_NAME,
+       .id_table       = pcipcwd_pci_tbl,
+       .probe          = pcipcwd_card_init,
+       .remove         = __devexit_p(pcipcwd_card_exit),
+};
+
+static int __init pcipcwd_init_module(void)
+{
+       spin_lock_init(&pcipcwd_private.io_lock);
+
+       return pci_register_driver(&pcipcwd_driver);
+}
+
+static void __exit pcipcwd_cleanup_module(void)
+{
+       pci_unregister_driver(&pcipcwd_driver);
+
+       printk(KERN_INFO PFX "Watchdog Module Unloaded.\n");
+}
+
+module_init(pcipcwd_init_module);
+module_exit(pcipcwd_cleanup_module);
+
+MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>");
+MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
new file mode 100644 (file)
index 0000000..0f3fd6c
--- /dev/null
@@ -0,0 +1,824 @@
+/*
+ *     Berkshire USB-PC Watchdog Card Driver
+ *
+ *     (c) Copyright 2004-2007 Wim Van Sebroeck <wim@iguana.be>.
+ *
+ *     Based on source code of the following authors:
+ *       Ken Hollis <kenji@bitgate.com>,
+ *       Alan Cox <alan@redhat.com>,
+ *       Matt Domsch <Matt_Domsch@dell.com>,
+ *       Rob Radez <rob@osinvestor.com>,
+ *       Greg Kroah-Hartman <greg@kroah.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Wim Van Sebroeck nor Iguana vzw. admit liability nor
+ *     provide warranty for any of this software. This material is
+ *     provided "AS-IS" and at no charge.
+ *
+ *     Thanks also to Simon Machell at Berkshire Products Inc. for
+ *     providing the test hardware. More info is available at
+ *     http://www.berkprod.com/ or http://www.pcwatchdog.com/
+ */
+
+#include <linux/module.h>      /* For module specific items */
+#include <linux/moduleparam.h> /* For new moduleparam's */
+#include <linux/types.h>       /* For standard types (like size_t) */
+#include <linux/errno.h>       /* For the -ENODEV/... values */
+#include <linux/kernel.h>      /* For printk/panic/... */
+#include <linux/delay.h>       /* For mdelay function */
+#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
+#include <linux/watchdog.h>    /* For the watchdog specific items */
+#include <linux/notifier.h>    /* For notifier support */
+#include <linux/reboot.h>      /* For reboot_notifier stuff */
+#include <linux/init.h>                /* For __init/__exit/... */
+#include <linux/fs.h>          /* For file operations */
+#include <linux/usb.h>         /* For USB functions */
+#include <linux/slab.h>                /* For kmalloc, ... */
+#include <linux/mutex.h>       /* For mutex locking */
+#include <linux/hid.h>         /* For HID_REQ_SET_REPORT & HID_DT_REPORT */
+
+#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
+
+
+#ifdef CONFIG_USB_DEBUG
+       static int debug = 1;
+#else
+       static int debug;
+#endif
+
+/* Use our own dbg macro */
+#undef dbg
+#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG PFX format "\n" , ## arg); } while (0)
+
+
+/* Module and Version Information */
+#define DRIVER_VERSION "1.02"
+#define DRIVER_DATE "21 Jan 2007"
+#define DRIVER_AUTHOR "Wim Van Sebroeck <wim@iguana.be>"
+#define DRIVER_DESC "Berkshire USB-PC Watchdog driver"
+#define DRIVER_LICENSE "GPL"
+#define DRIVER_NAME "pcwd_usb"
+#define PFX DRIVER_NAME ": "
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE(DRIVER_LICENSE);
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
+
+/* Module Parameters */
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
+
+#define WATCHDOG_HEARTBEAT 0   /* default heartbeat = delay-time from dip-switches */
+static int heartbeat = WATCHDOG_HEARTBEAT;
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/* The vendor and product id's for the USB-PC Watchdog card */
+#define USB_PCWD_VENDOR_ID     0x0c98
+#define USB_PCWD_PRODUCT_ID    0x1140
+
+/* table of devices that work with this driver */
+static struct usb_device_id usb_pcwd_table [] = {
+       { USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) },
+       { }                                     /* Terminating entry */
+};
+MODULE_DEVICE_TABLE (usb, usb_pcwd_table);
+
+/* according to documentation max. time to process a command for the USB
+ * watchdog card is 100 or 200 ms, so we give it 250 ms to do it's job */
+#define USB_COMMAND_TIMEOUT    250
+
+/* Watchdog's internal commands */
+#define CMD_READ_TEMP                  0x02    /* Read Temperature; Re-trigger Watchdog */
+#define CMD_TRIGGER                    CMD_READ_TEMP
+#define CMD_GET_STATUS                 0x04    /* Get Status Information */
+#define CMD_GET_FIRMWARE_VERSION       0x08    /* Get Firmware Version */
+#define CMD_GET_DIP_SWITCH_SETTINGS    0x0c    /* Get Dip Switch Settings */
+#define CMD_READ_WATCHDOG_TIMEOUT      0x18    /* Read Current Watchdog Time */
+#define CMD_WRITE_WATCHDOG_TIMEOUT     0x19    /* Write Current Watchdog Time */
+#define CMD_ENABLE_WATCHDOG            0x30    /* Enable / Disable Watchdog */
+#define CMD_DISABLE_WATCHDOG           CMD_ENABLE_WATCHDOG
+
+/* Watchdog's Dip Switch heartbeat values */
+static const int heartbeat_tbl [] = {
+       5,      /* OFF-OFF-OFF  =  5 Sec  */
+       10,     /* OFF-OFF-ON   = 10 Sec  */
+       30,     /* OFF-ON-OFF   = 30 Sec  */
+       60,     /* OFF-ON-ON    =  1 Min  */
+       300,    /* ON-OFF-OFF   =  5 Min  */
+       600,    /* ON-OFF-ON    = 10 Min  */
+       1800,   /* ON-ON-OFF    = 30 Min  */
+       3600,   /* ON-ON-ON     =  1 hour */
+};
+
+/* We can only use 1 card due to the /dev/watchdog restriction */
+static int cards_found;
+
+/* some internal variables */
+static unsigned long is_active;
+static char expect_release;
+
+/* Structure to hold all of our device specific stuff */
+struct usb_pcwd_private {
+       struct usb_device *     udev;                   /* save off the usb device pointer */
+       struct usb_interface *  interface;              /* the interface for this device */
+
+       unsigned int            interface_number;       /* the interface number used for cmd's */
+
+       unsigned char *         intr_buffer;            /* the buffer to intr data */
+       dma_addr_t              intr_dma;               /* the dma address for the intr buffer */
+       size_t                  intr_size;              /* the size of the intr buffer */
+       struct urb *            intr_urb;               /* the urb used for the intr pipe */
+
+       unsigned char           cmd_command;            /* The command that is reported back */
+       unsigned char           cmd_data_msb;           /* The data MSB that is reported back */
+       unsigned char           cmd_data_lsb;           /* The data LSB that is reported back */
+       atomic_t                cmd_received;           /* true if we received a report after a command */
+
+       int                     exists;                 /* Wether or not the device exists */
+       struct mutex            mtx;                    /* locks this structure */
+};
+static struct usb_pcwd_private *usb_pcwd_device;
+
+/* prevent races between open() and disconnect() */
+static DEFINE_MUTEX(disconnect_mutex);
+
+/* local function prototypes */
+static int usb_pcwd_probe      (struct usb_interface *interface, const struct usb_device_id *id);
+static void usb_pcwd_disconnect        (struct usb_interface *interface);
+
+/* usb specific object needed to register this driver with the usb subsystem */
+static struct usb_driver usb_pcwd_driver = {
+       .name =         DRIVER_NAME,
+       .probe =        usb_pcwd_probe,
+       .disconnect =   usb_pcwd_disconnect,
+       .id_table =     usb_pcwd_table,
+};
+
+
+static void usb_pcwd_intr_done(struct urb *urb)
+{
+       struct usb_pcwd_private *usb_pcwd = (struct usb_pcwd_private *)urb->context;
+       unsigned char *data = usb_pcwd->intr_buffer;
+       int retval;
+
+       switch (urb->status) {
+       case 0:                 /* success */
+               break;
+       case -ECONNRESET:       /* unlink */
+       case -ENOENT:
+       case -ESHUTDOWN:
+               /* this urb is terminated, clean up */
+               dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
+               return;
+       /* -EPIPE:  should clear the halt */
+       default:                /* error */
+               dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
+               goto resubmit;
+       }
+
+       dbg("received following data cmd=0x%02x msb=0x%02x lsb=0x%02x",
+               data[0], data[1], data[2]);
+
+       usb_pcwd->cmd_command  = data[0];
+       usb_pcwd->cmd_data_msb = data[1];
+       usb_pcwd->cmd_data_lsb = data[2];
+
+       /* notify anyone waiting that the cmd has finished */
+       atomic_set (&usb_pcwd->cmd_received, 1);
+
+resubmit:
+       retval = usb_submit_urb (urb, GFP_ATOMIC);
+       if (retval)
+               printk(KERN_ERR PFX "can't resubmit intr, usb_submit_urb failed with result %d\n",
+                       retval);
+}
+
+static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, unsigned char cmd,
+       unsigned char *msb, unsigned char *lsb)
+{
+       int got_response, count;
+       unsigned char buf[6];
+
+       /* We will not send any commands if the USB PCWD device does not exist */
+       if ((!usb_pcwd) || (!usb_pcwd->exists))
+               return -1;
+
+       /* The USB PC Watchdog uses a 6 byte report format. The board currently uses
+        * only 3 of the six bytes of the report. */
+       buf[0] = cmd;                   /* Byte 0 = CMD */
+       buf[1] = *msb;                  /* Byte 1 = Data MSB */
+       buf[2] = *lsb;                  /* Byte 2 = Data LSB */
+       buf[3] = buf[4] = buf[5] = 0;   /* All other bytes not used */
+
+       dbg("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x",
+               buf[0], buf[1], buf[2]);
+
+       atomic_set (&usb_pcwd->cmd_received, 0);
+
+       if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
+                       HID_REQ_SET_REPORT, HID_DT_REPORT,
+                       0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
+                       USB_COMMAND_TIMEOUT) != sizeof(buf)) {
+               dbg("usb_pcwd_send_command: error in usb_control_msg for cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
+       }
+       /* wait till the usb card processed the command,
+        * with a max. timeout of USB_COMMAND_TIMEOUT */
+       got_response = 0;
+       for (count = 0; (count < USB_COMMAND_TIMEOUT) && (!got_response); count++) {
+               mdelay(1);
+               if (atomic_read (&usb_pcwd->cmd_received))
+                       got_response = 1;
+       }
+
+       if ((got_response) && (cmd == usb_pcwd->cmd_command)) {
+               /* read back response */
+               *msb = usb_pcwd->cmd_data_msb;
+               *lsb = usb_pcwd->cmd_data_lsb;
+       }
+
+       return got_response;
+}
+
+static int usb_pcwd_start(struct usb_pcwd_private *usb_pcwd)
+{
+       unsigned char msb = 0x00;
+       unsigned char lsb = 0x00;
+       int retval;
+
+       /* Enable Watchdog */
+       retval = usb_pcwd_send_command(usb_pcwd, CMD_ENABLE_WATCHDOG, &msb, &lsb);
+
+       if ((retval == 0) || (lsb == 0)) {
+               printk(KERN_ERR PFX "Card did not acknowledge enable attempt\n");
+               return -1;
+       }
+
+       return 0;
+}
+
+static int usb_pcwd_stop(struct usb_pcwd_private *usb_pcwd)
+{
+       unsigned char msb = 0xA5;
+       unsigned char lsb = 0xC3;
+       int retval;
+
+       /* Disable Watchdog */
+       retval = usb_pcwd_send_command(usb_pcwd, CMD_DISABLE_WATCHDOG, &msb, &lsb);
+
+       if ((retval == 0) || (lsb != 0)) {
+               printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n");
+               return -1;
+       }
+
+       return 0;
+}
+
+static int usb_pcwd_keepalive(struct usb_pcwd_private *usb_pcwd)
+{
+       unsigned char dummy;
+
+       /* Re-trigger Watchdog */
+       usb_pcwd_send_command(usb_pcwd, CMD_TRIGGER, &dummy, &dummy);
+
+       return 0;
+}
+
+static int usb_pcwd_set_heartbeat(struct usb_pcwd_private *usb_pcwd, int t)
+{
+       unsigned char msb = t / 256;
+       unsigned char lsb = t % 256;
+
+       if ((t < 0x0001) || (t > 0xFFFF))
+               return -EINVAL;
+
+       /* Write new heartbeat to watchdog */
+       usb_pcwd_send_command(usb_pcwd, CMD_WRITE_WATCHDOG_TIMEOUT, &msb, &lsb);
+
+       heartbeat = t;
+       return 0;
+}
+
+static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, int *temperature)
+{
+       unsigned char msb, lsb;
+
+       usb_pcwd_send_command(usb_pcwd, CMD_READ_TEMP, &msb, &lsb);
+
+       /*
+        * Convert celsius to fahrenheit, since this was
+        * the decided 'standard' for this return value.
+        */
+       *temperature = (lsb * 9 / 5) + 32;
+
+       return 0;
+}
+
+static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd, int *time_left)
+{
+       unsigned char msb, lsb;
+
+       /* Read the time that's left before rebooting */
+       /* Note: if the board is not yet armed then we will read 0xFFFF */
+       usb_pcwd_send_command(usb_pcwd, CMD_READ_WATCHDOG_TIMEOUT, &msb, &lsb);
+
+       *time_left = (msb << 8) + lsb;
+
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
+                             size_t len, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       expect_release = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if(get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_release = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               usb_pcwd_keepalive(usb_pcwd_device);
+       }
+       return len;
+}
+
+static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
+                         unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_KEEPALIVEPING |
+                                       WDIOF_SETTIMEOUT |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     1,
+               .identity =             DRIVER_NAME,
+       };
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident,
+                               sizeof (ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_GETTEMP:
+               {
+                       int temperature;
+
+                       if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
+                               return -EFAULT;
+
+                       return put_user(temperature, p);
+               }
+
+               case WDIOC_KEEPALIVE:
+                       usb_pcwd_keepalive(usb_pcwd_device);
+                       return 0;
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if (get_user (new_options, p))
+                               return -EFAULT;
+
+                       if (new_options & WDIOS_DISABLECARD) {
+                               usb_pcwd_stop(usb_pcwd_device);
+                               retval = 0;
+                       }
+
+                       if (new_options & WDIOS_ENABLECARD) {
+                               usb_pcwd_start(usb_pcwd_device);
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_heartbeat;
+
+                       if (get_user(new_heartbeat, p))
+                               return -EFAULT;
+
+                       if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
+                           return -EINVAL;
+
+                       usb_pcwd_keepalive(usb_pcwd_device);
+                       /* Fall */
+               }
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(heartbeat, p);
+
+               case WDIOC_GETTIMELEFT:
+               {
+                       int time_left;
+
+                       if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left))
+                               return -EFAULT;
+
+                       return put_user(time_left, p);
+               }
+
+               default:
+                       return -ENOTTY;
+       }
+}
+
+static int usb_pcwd_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+       if (test_and_set_bit(0, &is_active))
+               return -EBUSY;
+
+       /* Activate */
+       usb_pcwd_start(usb_pcwd_device);
+       usb_pcwd_keepalive(usb_pcwd_device);
+       return nonseekable_open(inode, file);
+}
+
+static int usb_pcwd_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        */
+       if (expect_release == 42) {
+               usb_pcwd_stop(usb_pcwd_device);
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               usb_pcwd_keepalive(usb_pcwd_device);
+       }
+       expect_release = 0;
+       clear_bit(0, &is_active);
+       return 0;
+}
+
+/*
+ *     /dev/temperature handling
+ */
+
+static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data,
+                               size_t len, loff_t *ppos)
+{
+       int temperature;
+
+       if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
+               return -EFAULT;
+
+       if (copy_to_user(data, &temperature, 1))
+               return -EFAULT;
+
+       return 1;
+}
+
+static int usb_pcwd_temperature_open(struct inode *inode, struct file *file)
+{
+       return nonseekable_open(inode, file);
+}
+
+static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+
+/*
+ *     Notify system
+ */
+
+static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code==SYS_DOWN || code==SYS_HALT) {
+               /* Turn the WDT off */
+               usb_pcwd_stop(usb_pcwd_device);
+       }
+
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations usb_pcwd_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .write =        usb_pcwd_write,
+       .ioctl =        usb_pcwd_ioctl,
+       .open =         usb_pcwd_open,
+       .release =      usb_pcwd_release,
+};
+
+static struct miscdevice usb_pcwd_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &usb_pcwd_fops,
+};
+
+static const struct file_operations usb_pcwd_temperature_fops = {
+       .owner =        THIS_MODULE,
+       .llseek =       no_llseek,
+       .read =         usb_pcwd_temperature_read,
+       .open =         usb_pcwd_temperature_open,
+       .release =      usb_pcwd_temperature_release,
+};
+
+static struct miscdevice usb_pcwd_temperature_miscdev = {
+       .minor =        TEMP_MINOR,
+       .name =         "temperature",
+       .fops =         &usb_pcwd_temperature_fops,
+};
+
+static struct notifier_block usb_pcwd_notifier = {
+       .notifier_call =        usb_pcwd_notify_sys,
+};
+
+/**
+ *     usb_pcwd_delete
+ */
+static inline void usb_pcwd_delete (struct usb_pcwd_private *usb_pcwd)
+{
+       usb_free_urb(usb_pcwd->intr_urb);
+       if (usb_pcwd->intr_buffer != NULL)
+               usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size,
+                               usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
+       kfree (usb_pcwd);
+}
+
+/**
+ *     usb_pcwd_probe
+ *
+ *     Called by the usb core when a new device is connected that it thinks
+ *     this driver might be interested in.
+ */
+static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_device_id *id)
+{
+       struct usb_device *udev = interface_to_usbdev(interface);
+       struct usb_host_interface *iface_desc;
+       struct usb_endpoint_descriptor *endpoint;
+       struct usb_pcwd_private *usb_pcwd = NULL;
+       int pipe, maxp;
+       int retval = -ENOMEM;
+       int got_fw_rev;
+       unsigned char fw_rev_major, fw_rev_minor;
+       char fw_ver_str[20];
+       unsigned char option_switches, dummy;
+
+       cards_found++;
+       if (cards_found > 1) {
+               printk(KERN_ERR PFX "This driver only supports 1 device\n");
+               return -ENODEV;
+       }
+
+       /* get the active interface descriptor */
+       iface_desc = interface->cur_altsetting;
+
+       /* check out that we have a HID device */
+       if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) {
+               printk(KERN_ERR PFX "The device isn't a Human Interface Device\n");
+               return -ENODEV;
+       }
+
+       /* check out the endpoint: it has to be Interrupt & IN */
+       endpoint = &iface_desc->endpoint[0].desc;
+
+       if (!((endpoint->bEndpointAddress & USB_DIR_IN) &&
+            ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
+                               == USB_ENDPOINT_XFER_INT))) {
+               /* we didn't find a Interrupt endpoint with direction IN */
+               printk(KERN_ERR PFX "Couldn't find an INTR & IN endpoint\n");
+               return -ENODEV;
+       }
+
+       /* get a handle to the interrupt data pipe */
+       pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
+       maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
+
+       /* allocate memory for our device and initialize it */
+       usb_pcwd = kzalloc (sizeof(struct usb_pcwd_private), GFP_KERNEL);
+       if (usb_pcwd == NULL) {
+               printk(KERN_ERR PFX "Out of memory\n");
+               goto error;
+       }
+
+       usb_pcwd_device = usb_pcwd;
+
+       mutex_init(&usb_pcwd->mtx);
+       usb_pcwd->udev = udev;
+       usb_pcwd->interface = interface;
+       usb_pcwd->interface_number = iface_desc->desc.bInterfaceNumber;
+       usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8);
+
+       /* set up the memory buffer's */
+       if (!(usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma))) {
+               printk(KERN_ERR PFX "Out of memory\n");
+               goto error;
+       }
+
+       /* allocate the urb's */
+       usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
+       if (!usb_pcwd->intr_urb) {
+               printk(KERN_ERR PFX "Out of memory\n");
+               goto error;
+       }
+
+       /* initialise the intr urb's */
+       usb_fill_int_urb(usb_pcwd->intr_urb, udev, pipe,
+                       usb_pcwd->intr_buffer, usb_pcwd->intr_size,
+                       usb_pcwd_intr_done, usb_pcwd, endpoint->bInterval);
+       usb_pcwd->intr_urb->transfer_dma = usb_pcwd->intr_dma;
+       usb_pcwd->intr_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+       /* register our interrupt URB with the USB system */
+       if (usb_submit_urb(usb_pcwd->intr_urb, GFP_KERNEL)) {
+               printk(KERN_ERR PFX "Problem registering interrupt URB\n");
+               retval = -EIO; /* failure */
+               goto error;
+       }
+
+       /* The device exists and can be communicated with */
+       usb_pcwd->exists = 1;
+
+       /* disable card */
+       usb_pcwd_stop(usb_pcwd);
+
+       /* Get the Firmware Version */
+       got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
+       if (got_fw_rev) {
+               sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
+       } else {
+               sprintf(fw_ver_str, "<card no answer>");
+       }
+
+       printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n",
+               fw_ver_str);
+
+       /* Get switch settings */
+       usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy, &option_switches);
+
+       printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
+               option_switches,
+               ((option_switches & 0x10) ? "ON" : "OFF"),
+               ((option_switches & 0x08) ? "ON" : "OFF"));
+
+       /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
+       if (heartbeat == 0)
+               heartbeat = heartbeat_tbl[(option_switches & 0x07)];
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) {
+               usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT);
+               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
+                       WATCHDOG_HEARTBEAT);
+       }
+
+       retval = register_reboot_notifier(&usb_pcwd_notifier);
+       if (retval != 0) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       retval);
+               goto error;
+       }
+
+       retval = misc_register(&usb_pcwd_temperature_miscdev);
+       if (retval != 0) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       TEMP_MINOR, retval);
+               goto err_out_unregister_reboot;
+       }
+
+       retval = misc_register(&usb_pcwd_miscdev);
+       if (retval != 0) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, retval);
+               goto err_out_misc_deregister;
+       }
+
+       /* we can register the device now, as it is ready */
+       usb_set_intfdata (interface, usb_pcwd);
+
+       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
+               heartbeat, nowayout);
+
+       return 0;
+
+err_out_misc_deregister:
+       misc_deregister(&usb_pcwd_temperature_miscdev);
+err_out_unregister_reboot:
+       unregister_reboot_notifier(&usb_pcwd_notifier);
+error:
+       if (usb_pcwd)
+               usb_pcwd_delete(usb_pcwd);
+       usb_pcwd_device = NULL;
+       return retval;
+}
+
+
+/**
+ *     usb_pcwd_disconnect
+ *
+ *     Called by the usb core when the device is removed from the system.
+ *
+ *     This routine guarantees that the driver will not submit any more urbs
+ *     by clearing dev->udev.
+ */
+static void usb_pcwd_disconnect(struct usb_interface *interface)
+{
+       struct usb_pcwd_private *usb_pcwd;
+
+       /* prevent races with open() */
+       mutex_lock(&disconnect_mutex);
+
+       usb_pcwd = usb_get_intfdata (interface);
+       usb_set_intfdata (interface, NULL);
+
+       mutex_lock(&usb_pcwd->mtx);
+
+       /* Stop the timer before we leave */
+       if (!nowayout)
+               usb_pcwd_stop(usb_pcwd);
+
+       /* We should now stop communicating with the USB PCWD device */
+       usb_pcwd->exists = 0;
+
+       /* Deregister */
+       misc_deregister(&usb_pcwd_miscdev);
+       misc_deregister(&usb_pcwd_temperature_miscdev);
+       unregister_reboot_notifier(&usb_pcwd_notifier);
+
+       mutex_unlock(&usb_pcwd->mtx);
+
+       /* Delete the USB PCWD device */
+       usb_pcwd_delete(usb_pcwd);
+
+       cards_found--;
+
+       mutex_unlock(&disconnect_mutex);
+
+       printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
+}
+
+
+
+/**
+ *     usb_pcwd_init
+ */
+static int __init usb_pcwd_init(void)
+{
+       int result;
+
+       /* register this driver with the USB subsystem */
+       result = usb_register(&usb_pcwd_driver);
+       if (result) {
+               printk(KERN_ERR PFX "usb_register failed. Error number %d\n",
+                   result);
+               return result;
+       }
+
+       printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION " (" DRIVER_DATE ")\n");
+       return 0;
+}
+
+
+/**
+ *     usb_pcwd_exit
+ */
+static void __exit usb_pcwd_exit(void)
+{
+       /* deregister this driver with the USB subsystem */
+       usb_deregister(&usb_pcwd_driver);
+}
+
+
+module_init (usb_pcwd_init);
+module_exit (usb_pcwd_exit);
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
new file mode 100644 (file)
index 0000000..22f8873
--- /dev/null
@@ -0,0 +1,358 @@
+/*
+ * drivers/char/watchdog/pnx4008_wdt.c
+ *
+ * Watchdog driver for PNX4008 board
+ *
+ * Authors: Dmitry Chigirev <source@mvista.com>,
+ *         Vitaly Wool <vitalywool@gmail.com>
+ * Based on sa1100 driver,
+ * Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
+ *
+ * 2005-2006 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/init.h>
+#include <linux/bitops.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/spinlock.h>
+
+#include <asm/hardware.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define MODULE_NAME "PNX4008-WDT: "
+
+/* WatchDog Timer - Chapter 23 Page 207 */
+
+#define DEFAULT_HEARTBEAT 19
+#define MAX_HEARTBEAT     60
+
+/* Watchdog timer register set definition */
+#define WDTIM_INT(p)     ((p) + 0x0)
+#define WDTIM_CTRL(p)    ((p) + 0x4)
+#define WDTIM_COUNTER(p) ((p) + 0x8)
+#define WDTIM_MCTRL(p)   ((p) + 0xC)
+#define WDTIM_MATCH0(p)  ((p) + 0x10)
+#define WDTIM_EMR(p)     ((p) + 0x14)
+#define WDTIM_PULSE(p)   ((p) + 0x18)
+#define WDTIM_RES(p)     ((p) + 0x1C)
+
+/* WDTIM_INT bit definitions */
+#define MATCH_INT      1
+
+/* WDTIM_CTRL bit definitions */
+#define COUNT_ENAB     1
+#define RESET_COUNT    (1<<1)
+#define DEBUG_EN       (1<<2)
+
+/* WDTIM_MCTRL bit definitions */
+#define MR0_INT        1
+#undef  RESET_COUNT0
+#define RESET_COUNT0   (1<<2)
+#define STOP_COUNT0    (1<<2)
+#define M_RES1         (1<<3)
+#define M_RES2         (1<<4)
+#define RESFRC1        (1<<5)
+#define RESFRC2        (1<<6)
+
+/* WDTIM_EMR bit definitions */
+#define EXT_MATCH0      1
+#define MATCH_OUTPUT_HIGH (2<<4)       /*a MATCH_CTRL setting */
+
+/* WDTIM_RES bit definitions */
+#define WDOG_RESET      1      /* read only */
+
+#define WDOG_COUNTER_RATE 13000000     /*the counter clock is 13 MHz fixed */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+static int heartbeat = DEFAULT_HEARTBEAT;
+
+static spinlock_t io_lock;
+static unsigned long wdt_status;
+#define WDT_IN_USE        0
+#define WDT_OK_TO_CLOSE   1
+#define WDT_REGION_INITED 2
+#define WDT_DEVICE_INITED 3
+
+static unsigned long boot_status;
+
+static struct resource *wdt_mem;
+static void __iomem    *wdt_base;
+struct clk             *wdt_clk;
+
+static void wdt_enable(void)
+{
+       spin_lock(&io_lock);
+
+       if (wdt_clk)
+               clk_set_rate(wdt_clk, 1);
+
+       /* stop counter, initiate counter reset */
+       __raw_writel(RESET_COUNT, WDTIM_CTRL(wdt_base));
+       /*wait for reset to complete. 100% guarantee event */
+       while (__raw_readl(WDTIM_COUNTER(wdt_base)))
+               cpu_relax();
+       /* internal and external reset, stop after that */
+       __raw_writel(M_RES2 | STOP_COUNT0 | RESET_COUNT0,
+               WDTIM_MCTRL(wdt_base));
+       /* configure match output */
+       __raw_writel(MATCH_OUTPUT_HIGH, WDTIM_EMR(wdt_base));
+       /* clear interrupt, just in case */
+       __raw_writel(MATCH_INT, WDTIM_INT(wdt_base));
+       /* the longest pulse period 65541/(13*10^6) seconds ~ 5 ms. */
+       __raw_writel(0xFFFF, WDTIM_PULSE(wdt_base));
+       __raw_writel(heartbeat * WDOG_COUNTER_RATE, WDTIM_MATCH0(wdt_base));
+       /*enable counter, stop when debugger active */
+       __raw_writel(COUNT_ENAB | DEBUG_EN, WDTIM_CTRL(wdt_base));
+
+       spin_unlock(&io_lock);
+}
+
+static void wdt_disable(void)
+{
+       spin_lock(&io_lock);
+
+       __raw_writel(0, WDTIM_CTRL(wdt_base));  /*stop counter */
+       if (wdt_clk)
+               clk_set_rate(wdt_clk, 0);
+
+       spin_unlock(&io_lock);
+}
+
+static int pnx4008_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(WDT_IN_USE, &wdt_status))
+               return -EBUSY;
+
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       wdt_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static ssize_t
+pnx4008_wdt_write(struct file *file, const char *data, size_t len,
+                 loff_t * ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       set_bit(WDT_OK_TO_CLOSE, &wdt_status);
+                       }
+               }
+               wdt_enable();
+       }
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE |
+           WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+       .identity = "PNX4008 Watchdog",
+};
+
+static int
+pnx4008_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+                 unsigned long arg)
+{
+       int ret = -ENOTTY;
+       int time;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user((struct watchdog_info *)arg, &ident,
+                                  sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+               ret = put_user(0, (int *)arg);
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(boot_status, (int *)arg);
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(time, (int *)arg);
+               if (ret)
+                       break;
+
+               if (time <= 0 || time > MAX_HEARTBEAT) {
+                       ret = -EINVAL;
+                       break;
+               }
+
+               heartbeat = time;
+               wdt_enable();
+               /* Fall through */
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(heartbeat, (int *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_enable();
+               ret = 0;
+               break;
+       }
+       return ret;
+}
+
+static int pnx4008_wdt_release(struct inode *inode, struct file *file)
+{
+       if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status))
+               printk(KERN_WARNING "WATCHDOG: Device closed unexpectdly\n");
+
+       wdt_disable();
+       clear_bit(WDT_IN_USE, &wdt_status);
+       clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
+
+       return 0;
+}
+
+static const struct file_operations pnx4008_wdt_fops = {
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = pnx4008_wdt_write,
+       .ioctl = pnx4008_wdt_ioctl,
+       .open = pnx4008_wdt_open,
+       .release = pnx4008_wdt_release,
+};
+
+static struct miscdevice pnx4008_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &pnx4008_wdt_fops,
+};
+
+static int pnx4008_wdt_probe(struct platform_device *pdev)
+{
+       int ret = 0, size;
+       struct resource *res;
+
+       spin_lock_init(&io_lock);
+
+       if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
+               heartbeat = DEFAULT_HEARTBEAT;
+
+       printk(KERN_INFO MODULE_NAME
+               "PNX4008 Watchdog Timer: heartbeat %d sec\n", heartbeat);
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res == NULL) {
+               printk(KERN_INFO MODULE_NAME
+                       "failed to get memory region resouce\n");
+               return -ENOENT;
+       }
+
+       size = res->end - res->start + 1;
+       wdt_mem = request_mem_region(res->start, size, pdev->name);
+
+       if (wdt_mem == NULL) {
+               printk(KERN_INFO MODULE_NAME "failed to get memory region\n");
+               return -ENOENT;
+       }
+       wdt_base = (void __iomem *)IO_ADDRESS(res->start);
+
+       wdt_clk = clk_get(&pdev->dev, "wdt_ck");
+       if (IS_ERR(wdt_clk)) {
+               ret = PTR_ERR(wdt_clk);
+               release_resource(wdt_mem);
+               kfree(wdt_mem);
+               goto out;
+       } else
+               clk_set_rate(wdt_clk, 1);
+
+       ret = misc_register(&pnx4008_wdt_miscdev);
+       if (ret < 0) {
+               printk(KERN_ERR MODULE_NAME "cannot register misc device\n");
+               release_resource(wdt_mem);
+               kfree(wdt_mem);
+               clk_set_rate(wdt_clk, 0);
+       } else {
+               boot_status = (__raw_readl(WDTIM_RES(wdt_base)) & WDOG_RESET) ?
+                   WDIOF_CARDRESET : 0;
+               wdt_disable();          /*disable for now */
+               set_bit(WDT_DEVICE_INITED, &wdt_status);
+       }
+
+out:
+       return ret;
+}
+
+static int pnx4008_wdt_remove(struct platform_device *pdev)
+{
+       misc_deregister(&pnx4008_wdt_miscdev);
+       if (wdt_clk) {
+               clk_set_rate(wdt_clk, 0);
+               clk_put(wdt_clk);
+               wdt_clk = NULL;
+       }
+       if (wdt_mem) {
+               release_resource(wdt_mem);
+               kfree(wdt_mem);
+               wdt_mem = NULL;
+       }
+       return 0;
+}
+
+static struct platform_driver platform_wdt_driver = {
+       .driver = {
+               .name = "watchdog",
+       },
+       .probe = pnx4008_wdt_probe,
+       .remove = pnx4008_wdt_remove,
+};
+
+static int __init pnx4008_wdt_init(void)
+{
+       return platform_driver_register(&platform_wdt_driver);
+}
+
+static void __exit pnx4008_wdt_exit(void)
+{
+       return platform_driver_unregister(&platform_wdt_driver);
+}
+
+module_init(pnx4008_wdt_init);
+module_exit(pnx4008_wdt_exit);
+
+MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
+MODULE_DESCRIPTION("PNX4008 Watchdog Driver");
+
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat,
+                "Watchdog heartbeat period in seconds from 1 to "
+                __MODULE_STRING(MAX_HEARTBEAT) ", default "
+                __MODULE_STRING(DEFAULT_HEARTBEAT));
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout,
+                "Set to 1 to keep watchdog running after device release");
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/rm9k_wdt.c b/drivers/watchdog/rm9k_wdt.c
new file mode 100644 (file)
index 0000000..5c921e4
--- /dev/null
@@ -0,0 +1,420 @@
+/*
+ *  Watchdog implementation for GPI h/w found on PMC-Sierra RM9xxx
+ *  chips.
+ *
+ *  Copyright (C) 2004 by Basler Vision Technologies AG
+ *  Author: Thomas Koeller <thomas.koeller@baslerweb.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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/interrupt.h>
+#include <linux/fs.h>
+#include <linux/reboot.h>
+#include <linux/notifier.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <asm/io.h>
+#include <asm/atomic.h>
+#include <asm/processor.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <asm/rm9k-ocd.h>
+
+#include <rm9k_wdt.h>
+
+
+#define CLOCK                  125000000
+#define MAX_TIMEOUT_SECONDS    32
+#define CPCCR                  0x0080
+#define CPGIG1SR               0x0044
+#define CPGIG1ER               0x0054
+
+
+/* Function prototypes */
+static irqreturn_t wdt_gpi_irqhdl(int, void *);
+static void wdt_gpi_start(void);
+static void wdt_gpi_stop(void);
+static void wdt_gpi_set_timeout(unsigned int);
+static int wdt_gpi_open(struct inode *, struct file *);
+static int wdt_gpi_release(struct inode *, struct file *);
+static ssize_t wdt_gpi_write(struct file *, const char __user *, size_t, loff_t *);
+static long wdt_gpi_ioctl(struct file *, unsigned int, unsigned long);
+static int wdt_gpi_notify(struct notifier_block *, unsigned long, void *);
+static const struct resource *wdt_gpi_get_resource(struct platform_device *, const char *, unsigned int);
+static int __init wdt_gpi_probe(struct device *);
+static int __exit wdt_gpi_remove(struct device *);
+
+
+static const char wdt_gpi_name[] = "wdt_gpi";
+static atomic_t opencnt;
+static int expect_close;
+static int locked;
+
+
+/* These are set from device resources */
+static void __iomem * wd_regs;
+static unsigned int wd_irq, wd_ctr;
+
+
+/* Module arguments */
+static int timeout = MAX_TIMEOUT_SECONDS;
+module_param(timeout, int, 0444);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds");
+
+static unsigned long resetaddr = 0xbffdc200;
+module_param(resetaddr, ulong, 0444);
+MODULE_PARM_DESC(resetaddr, "Address to write to to force a reset");
+
+static unsigned long flagaddr = 0xbffdc104;
+module_param(flagaddr, ulong, 0444);
+MODULE_PARM_DESC(flagaddr, "Address to write to boot flags to");
+
+static int powercycle;
+module_param(powercycle, bool, 0444);
+MODULE_PARM_DESC(powercycle, "Cycle power if watchdog expires");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0444);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started");
+
+
+/* Kernel interfaces */
+static const struct file_operations fops = {
+       .owner          = THIS_MODULE,
+       .open           = wdt_gpi_open,
+       .release        = wdt_gpi_release,
+       .write          = wdt_gpi_write,
+       .unlocked_ioctl = wdt_gpi_ioctl,
+};
+
+static struct miscdevice miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = wdt_gpi_name,
+       .fops           = &fops,
+};
+
+static struct notifier_block wdt_gpi_shutdown = {
+       .notifier_call  = wdt_gpi_notify,
+};
+
+
+/* Interrupt handler */
+static irqreturn_t wdt_gpi_irqhdl(int irq, void *ctxt)
+{
+       if (!unlikely(__raw_readl(wd_regs + 0x0008) & 0x1))
+               return IRQ_NONE;
+       __raw_writel(0x1, wd_regs + 0x0008);
+
+
+       printk(KERN_CRIT "%s: watchdog expired - resetting system\n",
+               wdt_gpi_name);
+
+       *(volatile char *) flagaddr |= 0x01;
+       *(volatile char *) resetaddr = powercycle ? 0x01 : 0x2;
+       iob();
+       while (1)
+               cpu_relax();
+}
+
+
+/* Watchdog functions */
+static void wdt_gpi_start(void)
+{
+       u32 reg;
+
+       lock_titan_regs();
+       reg = titan_readl(CPGIG1ER);
+       titan_writel(reg | (0x100 << wd_ctr), CPGIG1ER);
+       iob();
+       unlock_titan_regs();
+}
+
+static void wdt_gpi_stop(void)
+{
+       u32 reg;
+
+       lock_titan_regs();
+       reg = titan_readl(CPCCR) & ~(0xf << (wd_ctr * 4));
+       titan_writel(reg, CPCCR);
+       reg = titan_readl(CPGIG1ER);
+       titan_writel(reg & ~(0x100 << wd_ctr), CPGIG1ER);
+       iob();
+       unlock_titan_regs();
+}
+
+static void wdt_gpi_set_timeout(unsigned int to)
+{
+       u32 reg;
+       const u32 wdval = (to * CLOCK) & ~0x0000000f;
+
+       lock_titan_regs();
+       reg = titan_readl(CPCCR) & ~(0xf << (wd_ctr * 4));
+       titan_writel(reg, CPCCR);
+       wmb();
+       __raw_writel(wdval, wd_regs + 0x0000);
+       wmb();
+       titan_writel(reg | (0x2 << (wd_ctr * 4)), CPCCR);
+       wmb();
+       titan_writel(reg | (0x5 << (wd_ctr * 4)), CPCCR);
+       iob();
+       unlock_titan_regs();
+}
+
+
+/* /dev/watchdog operations */
+static int wdt_gpi_open(struct inode *inode, struct file *file)
+{
+       int res;
+
+       if (unlikely(atomic_dec_if_positive(&opencnt) < 0))
+               return -EBUSY;
+
+       expect_close = 0;
+       if (locked) {
+               module_put(THIS_MODULE);
+               free_irq(wd_irq, &miscdev);
+               locked = 0;
+       }
+
+       res = request_irq(wd_irq, wdt_gpi_irqhdl, IRQF_SHARED | IRQF_DISABLED,
+                         wdt_gpi_name, &miscdev);
+       if (unlikely(res))
+               return res;
+
+       wdt_gpi_set_timeout(timeout);
+       wdt_gpi_start();
+
+       printk(KERN_INFO "%s: watchdog started, timeout = %u seconds\n",
+               wdt_gpi_name, timeout);
+       return nonseekable_open(inode, file);
+}
+
+static int wdt_gpi_release(struct inode *inode, struct file *file)
+{
+       if (nowayout) {
+               printk(KERN_INFO "%s: no way out - watchdog left running\n",
+                       wdt_gpi_name);
+               __module_get(THIS_MODULE);
+               locked = 1;
+       } else {
+               if (expect_close) {
+                       wdt_gpi_stop();
+                       free_irq(wd_irq, &miscdev);
+                       printk(KERN_INFO "%s: watchdog stopped\n", wdt_gpi_name);
+               } else {
+                       printk(KERN_CRIT "%s: unexpected close() -"
+                               " watchdog left running\n",
+                               wdt_gpi_name);
+                       wdt_gpi_set_timeout(timeout);
+                       __module_get(THIS_MODULE);
+                       locked = 1;
+               }
+       }
+
+       atomic_inc(&opencnt);
+       return 0;
+}
+
+static ssize_t
+wdt_gpi_write(struct file *f, const char __user *d, size_t s, loff_t *o)
+{
+       char val;
+
+       wdt_gpi_set_timeout(timeout);
+       expect_close = (s > 0) && !get_user(val, d) && (val == 'V');
+       return s ? 1 : 0;
+}
+
+static long
+wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
+{
+       long res = -ENOTTY;
+       const long size = _IOC_SIZE(cmd);
+       int stat;
+       void __user *argp = (void __user *)arg;
+       static struct watchdog_info wdinfo = {
+               .identity               = "RM9xxx/GPI watchdog",
+               .firmware_version       = 0,
+               .options                = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING
+       };
+
+       if (unlikely(_IOC_TYPE(cmd) != WATCHDOG_IOCTL_BASE))
+               return -ENOTTY;
+
+       if ((_IOC_DIR(cmd) & _IOC_READ)
+           && !access_ok(VERIFY_WRITE, arg, size))
+               return -EFAULT;
+
+       if ((_IOC_DIR(cmd) & _IOC_WRITE)
+           && !access_ok(VERIFY_READ, arg, size))
+               return -EFAULT;
+
+       expect_close = 0;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               wdinfo.options = nowayout ?
+                       WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING :
+                       WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE;
+               res = __copy_to_user(argp, &wdinfo, size) ?  -EFAULT : size;
+               break;
+
+       case WDIOC_GETSTATUS:
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               stat = (*(volatile char *) flagaddr & 0x01)
+                       ? WDIOF_CARDRESET : 0;
+               res = __copy_to_user(argp, &stat, size) ?
+                       -EFAULT : size;
+               break;
+
+       case WDIOC_SETOPTIONS:
+               break;
+
+       case WDIOC_KEEPALIVE:
+               wdt_gpi_set_timeout(timeout);
+               res = size;
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               {
+                       int val;
+                       if (unlikely(__copy_from_user(&val, argp, size))) {
+                               res = -EFAULT;
+                               break;
+                       }
+
+                       if (val > MAX_TIMEOUT_SECONDS)
+                               val = MAX_TIMEOUT_SECONDS;
+                       timeout = val;
+                       wdt_gpi_set_timeout(val);
+                       res = size;
+                       printk(KERN_INFO "%s: timeout set to %u seconds\n",
+                               wdt_gpi_name, timeout);
+               }
+               break;
+
+       case WDIOC_GETTIMEOUT:
+               res = __copy_to_user(argp, &timeout, size) ?
+                       -EFAULT : size;
+               break;
+       }
+
+       return res;
+}
+
+
+/* Shutdown notifier */
+static int
+wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+               wdt_gpi_stop();
+
+       return NOTIFY_DONE;
+}
+
+
+/* Init & exit procedures */
+static const struct resource *
+wdt_gpi_get_resource(struct platform_device *pdv, const char *name,
+                     unsigned int type)
+{
+       char buf[80];
+       if (snprintf(buf, sizeof buf, "%s_0", name) >= sizeof buf)
+               return NULL;
+       return platform_get_resource_byname(pdv, type, buf);
+}
+
+/* No hotplugging on the platform bus - use __init */
+static int __init wdt_gpi_probe(struct device *dev)
+{
+       int res;
+       struct platform_device * const pdv = to_platform_device(dev);
+       const struct resource
+               * const rr = wdt_gpi_get_resource(pdv, WDT_RESOURCE_REGS,
+                                                 IORESOURCE_MEM),
+               * const ri = wdt_gpi_get_resource(pdv, WDT_RESOURCE_IRQ,
+                                                 IORESOURCE_IRQ),
+               * const rc = wdt_gpi_get_resource(pdv, WDT_RESOURCE_COUNTER,
+                                                 0);
+
+       if (unlikely(!rr || !ri || !rc))
+               return -ENXIO;
+
+       wd_regs = ioremap_nocache(rr->start, rr->end + 1 - rr->start);
+       if (unlikely(!wd_regs))
+               return -ENOMEM;
+       wd_irq = ri->start;
+       wd_ctr = rc->start;
+       res = misc_register(&miscdev);
+       if (res)
+               iounmap(wd_regs);
+       else
+               register_reboot_notifier(&wdt_gpi_shutdown);
+       return res;
+}
+
+static int __exit wdt_gpi_remove(struct device *dev)
+{
+       int res;
+
+       unregister_reboot_notifier(&wdt_gpi_shutdown);
+       res = misc_deregister(&miscdev);
+       iounmap(wd_regs);
+       wd_regs = NULL;
+       return res;
+}
+
+
+/* Device driver init & exit */
+static struct device_driver wdt_gpi_driver = {
+       .name           = (char *) wdt_gpi_name,
+       .bus            = &platform_bus_type,
+       .owner          = THIS_MODULE,
+       .probe          = wdt_gpi_probe,
+       .remove         = __exit_p(wdt_gpi_remove),
+       .shutdown       = NULL,
+       .suspend        = NULL,
+       .resume         = NULL,
+};
+
+static int __init wdt_gpi_init_module(void)
+{
+       atomic_set(&opencnt, 1);
+       if (timeout > MAX_TIMEOUT_SECONDS)
+               timeout = MAX_TIMEOUT_SECONDS;
+       return driver_register(&wdt_gpi_driver);
+}
+
+static void __exit wdt_gpi_cleanup_module(void)
+{
+       driver_unregister(&wdt_gpi_driver);
+}
+
+module_init(wdt_gpi_init_module);
+module_exit(wdt_gpi_cleanup_module);
+
+MODULE_AUTHOR("Thomas Koeller <thomas.koeller@baslerweb.com>");
+MODULE_DESCRIPTION("Basler eXcite watchdog driver for gpi devices");
+MODULE_VERSION("0.1");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
new file mode 100644 (file)
index 0000000..5d1c15f
--- /dev/null
@@ -0,0 +1,563 @@
+/* linux/drivers/char/watchdog/s3c2410_wdt.c
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2410 Watchdog Timer Support
+ *
+ * Based on, softdog.c by Alan Cox,
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Changelog:
+ *     05-Oct-2004     BJD     Added semaphore init to stop crashes on open
+ *                             Fixed tmr_count / wdt_count confusion
+ *                             Added configurable debug
+ *
+ *     11-Jan-2005     BJD     Fixed divide-by-2 in timeout code
+ *
+ *     25-Jan-2005     DA      Added suspend/resume support
+ *                             Replaced reboot notifier with .shutdown method
+ *
+ *     10-Mar-2005     LCVR    Changed S3C2410_VA to S3C24XX_VA
+*/
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/clk.h>
+
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#include <asm/arch/map.h>
+
+#undef S3C_VA_WATCHDOG
+#define S3C_VA_WATCHDOG (0)
+
+#include <asm/plat-s3c/regs-watchdog.h>
+
+#define PFX "s3c2410-wdt: "
+
+#define CONFIG_S3C2410_WATCHDOG_ATBOOT         (0)
+#define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME   (15)
+
+static int nowayout    = WATCHDOG_NOWAYOUT;
+static int tmr_margin  = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME;
+static int tmr_atboot  = CONFIG_S3C2410_WATCHDOG_ATBOOT;
+static int soft_noboot = 0;
+static int debug       = 0;
+
+module_param(tmr_margin,  int, 0);
+module_param(tmr_atboot,  int, 0);
+module_param(nowayout,    int, 0);
+module_param(soft_noboot, int, 0);
+module_param(debug,      int, 0);
+
+MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
+
+MODULE_PARM_DESC(tmr_atboot, "Watchdog is started at boot time if set to 1, default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT));
+
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
+
+MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)");
+
+
+typedef enum close_state {
+       CLOSE_STATE_NOT,
+       CLOSE_STATE_ALLOW=0x4021
+} close_state_t;
+
+static DECLARE_MUTEX(open_lock);
+
+static struct device    *wdt_dev;      /* platform device attached to */
+static struct resource *wdt_mem;
+static struct resource *wdt_irq;
+static struct clk      *wdt_clock;
+static void __iomem    *wdt_base;
+static unsigned int     wdt_count;
+static close_state_t    allow_close;
+
+/* watchdog control routines */
+
+#define DBG(msg...) do { \
+       if (debug) \
+               printk(KERN_INFO msg); \
+       } while(0)
+
+/* functions */
+
+static int s3c2410wdt_keepalive(void)
+{
+       writel(wdt_count, wdt_base + S3C2410_WTCNT);
+       return 0;
+}
+
+static int s3c2410wdt_stop(void)
+{
+       unsigned long wtcon;
+
+       wtcon = readl(wdt_base + S3C2410_WTCON);
+       wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN);
+       writel(wtcon, wdt_base + S3C2410_WTCON);
+
+       return 0;
+}
+
+static int s3c2410wdt_start(void)
+{
+       unsigned long wtcon;
+
+       s3c2410wdt_stop();
+
+       wtcon = readl(wdt_base + S3C2410_WTCON);
+       wtcon |= S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128;
+
+       if (soft_noboot) {
+               wtcon |= S3C2410_WTCON_INTEN;
+               wtcon &= ~S3C2410_WTCON_RSTEN;
+       } else {
+               wtcon &= ~S3C2410_WTCON_INTEN;
+               wtcon |= S3C2410_WTCON_RSTEN;
+       }
+
+       DBG("%s: wdt_count=0x%08x, wtcon=%08lx\n",
+           __FUNCTION__, wdt_count, wtcon);
+
+       writel(wdt_count, wdt_base + S3C2410_WTDAT);
+       writel(wdt_count, wdt_base + S3C2410_WTCNT);
+       writel(wtcon, wdt_base + S3C2410_WTCON);
+
+       return 0;
+}
+
+static int s3c2410wdt_set_heartbeat(int timeout)
+{
+       unsigned int freq = clk_get_rate(wdt_clock);
+       unsigned int count;
+       unsigned int divisor = 1;
+       unsigned long wtcon;
+
+       if (timeout < 1)
+               return -EINVAL;
+
+       freq /= 128;
+       count = timeout * freq;
+
+       DBG("%s: count=%d, timeout=%d, freq=%d\n",
+           __FUNCTION__, count, timeout, freq);
+
+       /* if the count is bigger than the watchdog register,
+          then work out what we need to do (and if) we can
+          actually make this value
+       */
+
+       if (count >= 0x10000) {
+               for (divisor = 1; divisor <= 0x100; divisor++) {
+                       if ((count / divisor) < 0x10000)
+                               break;
+               }
+
+               if ((count / divisor) >= 0x10000) {
+                       dev_err(wdt_dev, "timeout %d too big\n", timeout);
+                       return -EINVAL;
+               }
+       }
+
+       tmr_margin = timeout;
+
+       DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n",
+           __FUNCTION__, timeout, divisor, count, count/divisor);
+
+       count /= divisor;
+       wdt_count = count;
+
+       /* update the pre-scaler */
+       wtcon = readl(wdt_base + S3C2410_WTCON);
+       wtcon &= ~S3C2410_WTCON_PRESCALE_MASK;
+       wtcon |= S3C2410_WTCON_PRESCALE(divisor-1);
+
+       writel(count, wdt_base + S3C2410_WTDAT);
+       writel(wtcon, wdt_base + S3C2410_WTCON);
+
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int s3c2410wdt_open(struct inode *inode, struct file *file)
+{
+       if(down_trylock(&open_lock))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       allow_close = CLOSE_STATE_NOT;
+
+       /* start the timer */
+       s3c2410wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+static int s3c2410wdt_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        *      Lock it in if it's a module and we set nowayout
+        */
+
+       if (allow_close == CLOSE_STATE_ALLOW) {
+               s3c2410wdt_stop();
+       } else {
+               dev_err(wdt_dev, "Unexpected close, not stopping watchdog\n");
+               s3c2410wdt_keepalive();
+       }
+
+       allow_close = CLOSE_STATE_NOT;
+       up(&open_lock);
+       return 0;
+}
+
+static ssize_t s3c2410wdt_write(struct file *file, const char __user *data,
+                               size_t len, loff_t *ppos)
+{
+       /*
+        *      Refresh the timer.
+        */
+       if(len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       allow_close = CLOSE_STATE_NOT;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       allow_close = CLOSE_STATE_ALLOW;
+                       }
+               }
+
+               s3c2410wdt_keepalive();
+       }
+       return len;
+}
+
+#define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE
+
+static struct watchdog_info s3c2410_wdt_ident = {
+       .options          =     OPTIONS,
+       .firmware_version =     0,
+       .identity         =     "S3C2410 Watchdog",
+};
+
+
+static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_margin;
+
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &s3c2410_wdt_ident,
+                               sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_KEEPALIVE:
+                       s3c2410wdt_keepalive();
+                       return 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_margin, p))
+                               return -EFAULT;
+
+                       if (s3c2410wdt_set_heartbeat(new_margin))
+                               return -EINVAL;
+
+                       s3c2410wdt_keepalive();
+                       return put_user(tmr_margin, p);
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(tmr_margin, p);
+       }
+}
+
+/* kernel interface */
+
+static const struct file_operations s3c2410wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = s3c2410wdt_write,
+       .ioctl          = s3c2410wdt_ioctl,
+       .open           = s3c2410wdt_open,
+       .release        = s3c2410wdt_release,
+};
+
+static struct miscdevice s3c2410wdt_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &s3c2410wdt_fops,
+};
+
+/* interrupt handler code */
+
+static irqreturn_t s3c2410wdt_irq(int irqno, void *param)
+{
+       dev_info(wdt_dev, "watchdog timer expired (irq)\n");
+
+       s3c2410wdt_keepalive();
+       return IRQ_HANDLED;
+}
+/* device interface */
+
+static int s3c2410wdt_probe(struct platform_device *pdev)
+{
+       struct resource *res;
+       struct device *dev;
+       unsigned int wtcon;
+       int started = 0;
+       int ret;
+       int size;
+
+       DBG("%s: probe=%p\n", __FUNCTION__, pdev);
+
+       dev = &pdev->dev;
+       wdt_dev = &pdev->dev;
+
+       /* get the memory region for the watchdog timer */
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res == NULL) {
+               dev_err(dev, "no memory resource specified\n");
+               return -ENOENT;
+       }
+
+       size = (res->end-res->start)+1;
+       wdt_mem = request_mem_region(res->start, size, pdev->name);
+       if (wdt_mem == NULL) {
+               dev_err(dev, "failed to get memory region\n");
+               ret = -ENOENT;
+               goto err_req;
+       }
+
+       wdt_base = ioremap(res->start, size);
+       if (wdt_base == 0) {
+               dev_err(dev, "failed to ioremap() region\n");
+               ret = -EINVAL;
+               goto err_req;
+       }
+
+       DBG("probe: mapped wdt_base=%p\n", wdt_base);
+
+       wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+       if (wdt_irq == NULL) {
+               dev_err(dev, "no irq resource specified\n");
+               ret = -ENOENT;
+               goto err_map;
+       }
+
+       ret = request_irq(wdt_irq->start, s3c2410wdt_irq, 0, pdev->name, pdev);
+       if (ret != 0) {
+               dev_err(dev, "failed to install irq (%d)\n", ret);
+               goto err_map;
+       }
+
+       wdt_clock = clk_get(&pdev->dev, "watchdog");
+       if (IS_ERR(wdt_clock)) {
+               dev_err(dev, "failed to find watchdog clock source\n");
+               ret = PTR_ERR(wdt_clock);
+               goto err_irq;
+       }
+
+       clk_enable(wdt_clock);
+
+       /* see if we can actually set the requested timer margin, and if
+        * not, try the default value */
+
+       if (s3c2410wdt_set_heartbeat(tmr_margin)) {
+               started = s3c2410wdt_set_heartbeat(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
+
+               if (started == 0) {
+                       dev_info(dev,"tmr_margin value out of range, default %d used\n",
+                              CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME);
+               } else {
+                       dev_info(dev, "default timer value is out of range, cannot start\n");
+               }
+       }
+
+       ret = misc_register(&s3c2410wdt_miscdev);
+       if (ret) {
+               dev_err(dev, "cannot register miscdev on minor=%d (%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto err_clk;
+       }
+
+       if (tmr_atboot && started == 0) {
+               dev_info(dev, "starting watchdog timer\n");
+               s3c2410wdt_start();
+       } else if (!tmr_atboot) {
+               /* if we're not enabling the watchdog, then ensure it is
+                * disabled if it has been left running from the bootloader
+                * or other source */
+
+               s3c2410wdt_stop();
+       }
+
+       /* print out a statement of readiness */
+
+       wtcon = readl(wdt_base + S3C2410_WTCON);
+
+       dev_info(dev, "watchdog %sactive, reset %sabled, irq %sabled\n",
+                (wtcon & S3C2410_WTCON_ENABLE) ?  "" : "in",
+                (wtcon & S3C2410_WTCON_RSTEN) ? "" : "dis",
+                (wtcon & S3C2410_WTCON_INTEN) ? "" : "en");
+       
+       return 0;
+
+ err_clk:
+       clk_disable(wdt_clock);
+       clk_put(wdt_clock);
+
+ err_irq:
+       free_irq(wdt_irq->start, pdev);
+
+ err_map:
+       iounmap(wdt_base);
+
+ err_req:
+       release_resource(wdt_mem);
+       kfree(wdt_mem);
+
+       return ret;
+}
+
+static int s3c2410wdt_remove(struct platform_device *dev)
+{
+       release_resource(wdt_mem);
+       kfree(wdt_mem);
+       wdt_mem = NULL;
+
+       free_irq(wdt_irq->start, dev);
+       wdt_irq = NULL;
+
+       clk_disable(wdt_clock);
+       clk_put(wdt_clock);
+       wdt_clock = NULL;
+
+       iounmap(wdt_base);
+       misc_deregister(&s3c2410wdt_miscdev);
+       return 0;
+}
+
+static void s3c2410wdt_shutdown(struct platform_device *dev)
+{
+       s3c2410wdt_stop();      
+}
+
+#ifdef CONFIG_PM
+
+static unsigned long wtcon_save;
+static unsigned long wtdat_save;
+
+static int s3c2410wdt_suspend(struct platform_device *dev, pm_message_t state)
+{
+       /* Save watchdog state, and turn it off. */
+       wtcon_save = readl(wdt_base + S3C2410_WTCON);
+       wtdat_save = readl(wdt_base + S3C2410_WTDAT);
+
+       /* Note that WTCNT doesn't need to be saved. */
+       s3c2410wdt_stop();
+
+       return 0;
+}
+
+static int s3c2410wdt_resume(struct platform_device *dev)
+{
+       /* Restore watchdog state. */
+
+       writel(wtdat_save, wdt_base + S3C2410_WTDAT);
+       writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
+       writel(wtcon_save, wdt_base + S3C2410_WTCON);
+
+       printk(KERN_INFO PFX "watchdog %sabled\n",
+              (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
+
+       return 0;
+}
+
+#else
+#define s3c2410wdt_suspend NULL
+#define s3c2410wdt_resume  NULL
+#endif /* CONFIG_PM */
+
+
+static struct platform_driver s3c2410wdt_driver = {
+       .probe          = s3c2410wdt_probe,
+       .remove         = s3c2410wdt_remove,
+       .shutdown       = s3c2410wdt_shutdown,
+       .suspend        = s3c2410wdt_suspend,
+       .resume         = s3c2410wdt_resume,
+       .driver         = {
+               .owner  = THIS_MODULE,
+               .name   = "s3c2410-wdt",
+       },
+};
+
+
+static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n";
+
+static int __init watchdog_init(void)
+{
+       printk(banner);
+       return platform_driver_register(&s3c2410wdt_driver);
+}
+
+static void __exit watchdog_exit(void)
+{
+       platform_driver_unregister(&s3c2410wdt_driver);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_exit);
+
+MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, "
+             "Dimitry Andric <dimitry.andric@tomtom.com>");
+MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
new file mode 100644 (file)
index 0000000..3475f47
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ *     Watchdog driver for the SA11x0/PXA2xx
+ *
+ *      (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
+ *          Based on SoftDog driver by Alan Cox <alan@redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Oleg Drokin nor iXcelerator.com admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 2000           Oleg Drokin <green@crimea.edu>
+ *
+ *      27/11/2000 Initial release
+ */
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/init.h>
+
+#ifdef CONFIG_ARCH_PXA
+#include <asm/arch/pxa-regs.h>
+#endif
+
+#include <asm/hardware.h>
+#include <asm/bitops.h>
+#include <asm/uaccess.h>
+
+#define OSCR_FREQ              CLOCK_TICK_RATE
+
+static unsigned long sa1100wdt_users;
+static int pre_margin;
+static int boot_status;
+
+/*
+ *     Allow only one person to hold it open
+ */
+static int sa1100dog_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(1,&sa1100wdt_users))
+               return -EBUSY;
+
+       /* Activate SA1100 Watchdog timer */
+       OSMR3 = OSCR + pre_margin;
+       OSSR = OSSR_M3;
+       OWER = OWER_WME;
+       OIER |= OIER_E3;
+       return nonseekable_open(inode, file);
+}
+
+/*
+ * The watchdog cannot be disabled.
+ *
+ * Previous comments suggested that turning off the interrupt by
+ * clearing OIER[E3] would prevent the watchdog timing out but this
+ * does not appear to be true (at least on the PXA255).
+ */
+static int sa1100dog_release(struct inode *inode, struct file *file)
+{
+       printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n");
+
+       clear_bit(1, &sa1100wdt_users);
+
+       return 0;
+}
+
+static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
+{
+       if (len)
+               /* Refresh OSMR3 timer. */
+               OSMR3 = OSCR + pre_margin;
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options        = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+       .identity       = "SA1100/PXA255 Watchdog",
+};
+
+static int sa1100dog_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       int ret = -ENOTTY;
+       int time;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = copy_to_user(argp, &ident,
+                                  sizeof(ident)) ? -EFAULT : 0;
+               break;
+
+       case WDIOC_GETSTATUS:
+               ret = put_user(0, p);
+               break;
+
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(boot_status, p);
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(time, p);
+               if (ret)
+                       break;
+
+               if (time <= 0 || time > 255) {
+                       ret = -EINVAL;
+                       break;
+               }
+
+               pre_margin = OSCR_FREQ * time;
+               OSMR3 = OSCR + pre_margin;
+               /*fall through*/
+
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(pre_margin / OSCR_FREQ, p);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               OSMR3 = OSCR + pre_margin;
+               ret = 0;
+               break;
+       }
+       return ret;
+}
+
+static const struct file_operations sa1100dog_fops =
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = sa1100dog_write,
+       .ioctl          = sa1100dog_ioctl,
+       .open           = sa1100dog_open,
+       .release        = sa1100dog_release,
+};
+
+static struct miscdevice sa1100dog_miscdev =
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &sa1100dog_fops,
+};
+
+static int margin __initdata = 60;             /* (secs) Default is 1 minute */
+
+static int __init sa1100dog_init(void)
+{
+       int ret;
+
+       /*
+        * Read the reset status, and save it for later.  If
+        * we suspend, RCSR will be cleared, and the watchdog
+        * reset reason will be lost.
+        */
+       boot_status = (RCSR & RCSR_WDR) ? WDIOF_CARDRESET : 0;
+       pre_margin = OSCR_FREQ * margin;
+
+       ret = misc_register(&sa1100dog_miscdev);
+       if (ret == 0)
+               printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
+                      margin);
+       return ret;
+}
+
+static void __exit sa1100dog_exit(void)
+{
+       misc_deregister(&sa1100dog_miscdev);
+}
+
+module_init(sa1100dog_init);
+module_exit(sa1100dog_exit);
+
+MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
+MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog");
+
+module_param(margin, int, 0);
+MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
+
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
new file mode 100644 (file)
index 0000000..e4f3cb6
--- /dev/null
@@ -0,0 +1,400 @@
+/*
+ *     60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x
+ *
+ *      Based on acquirewdt.c by Alan Cox.
+ *
+ *     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 author does NOT admit liability nor provide warranty for
+ *     any of this software. This material is provided "AS-IS" in
+ *     the hope that it may be useful for others.
+ *
+ *     (c) Copyright 2000    Jakob Oestergaard <jakob@unthought.net>
+ *
+ *           12/4 - 2000      [Initial revision]
+ *           25/4 - 2000      Added /dev/watchdog support
+ *           09/5 - 2001      [smj@oro.net] fixed fop_write to "return 1" on success
+ *           12/4 - 2002      [rob@osinvestor.com] eliminate fop_read
+ *                            fix possible wdt_is_open race
+ *                            add CONFIG_WATCHDOG_NOWAYOUT support
+ *                            remove lock_kernel/unlock_kernel pairs
+ *                            added KERN_* to printk's
+ *                            got rid of extraneous comments
+ *                            changed watchdog_info to correctly reflect what the driver offers
+ *                            added WDIOC_GETSTATUS, WDIOC_GETBOOTSTATUS, WDIOC_SETTIMEOUT,
+ *                            WDIOC_GETTIMEOUT, and WDIOC_SETOPTIONS ioctls
+ *           09/8 - 2003      [wim@iguana.be] cleanup of trailing spaces
+ *                            use module_param
+ *                            made timeout (the emulated heartbeat) a module_param
+ *                            made the keepalive ping an internal subroutine
+ *                            made wdt_stop and wdt_start module params
+ *                            added extra printk's for startup problems
+ *                            added MODULE_AUTHOR and MODULE_DESCRIPTION info
+ *
+ *
+ *  This WDT driver is different from the other Linux WDT
+ *  drivers in the following ways:
+ *  *)  The driver will ping the watchdog by itself, because this
+ *      particular WDT has a very short timeout (one second) and it
+ *      would be insane to count on any userspace daemon always
+ *      getting scheduled within that time frame.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define OUR_NAME "sbc60xxwdt"
+#define PFX OUR_NAME ": "
+
+/*
+ * You must set these - The driver cannot probe for the settings
+ */
+
+static int wdt_stop = 0x45;
+module_param(wdt_stop, int, 0);
+MODULE_PARM_DESC(wdt_stop, "SBC60xx WDT 'stop' io port (default 0x45)");
+
+static int wdt_start = 0x443;
+module_param(wdt_start, int, 0);
+MODULE_PARM_DESC(wdt_start, "SBC60xx WDT 'start' io port (default 0x443)");
+
+/*
+ * The 60xx board can use watchdog timeout values from one second
+ * to several minutes.  The default is one second, so if we reset
+ * the watchdog every ~250ms we should be safe.
+ */
+
+#define WDT_INTERVAL (HZ/4+1)
+
+/*
+ * We must not require too good response from the userspace daemon.
+ * Here we require the userspace daemon to send us a heartbeat
+ * char to /dev/watchdog every 30 seconds.
+ * If the daemon pulses us every 25 seconds, we can still afford
+ * a 5 second scheduling delay on the (high priority) daemon. That
+ * should be sufficient for a box under any load.
+ */
+
+#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static void wdt_timer_ping(unsigned long);
+static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
+static unsigned long next_heartbeat;
+static unsigned long wdt_is_open;
+static char wdt_expect_close;
+
+/*
+ *     Whack the dog
+ */
+
+static void wdt_timer_ping(unsigned long data)
+{
+       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
+        * we agree to ping the WDT
+        */
+       if(time_before(jiffies, next_heartbeat))
+       {
+               /* Ping the WDT by reading from wdt_start */
+               inb_p(wdt_start);
+               /* Re-set the timer interval */
+               mod_timer(&timer, jiffies + WDT_INTERVAL);
+       } else {
+               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
+       }
+}
+
+/*
+ * Utility routines
+ */
+
+static void wdt_startup(void)
+{
+       next_heartbeat = jiffies + (timeout * HZ);
+
+       /* Start the timer */
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
+}
+
+static void wdt_turnoff(void)
+{
+       /* Stop the timer */
+       del_timer(&timer);
+       inb_p(wdt_stop);
+       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
+}
+
+static void wdt_keepalive(void)
+{
+       /* user land ping */
+       next_heartbeat = jiffies + (timeout * HZ);
+}
+
+/*
+ * /dev/watchdog handling
+ */
+
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if(count)
+       {
+               if (!nowayout)
+               {
+                       size_t ofs;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       wdt_expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for(ofs = 0; ofs != count; ofs++)
+                       {
+                               char c;
+                               if(get_user(c, buf+ofs))
+                                       return -EFAULT;
+                               if(c == 'V')
+                                       wdt_expect_close = 42;
+                       }
+               }
+
+               /* Well, anyhow someone wrote to us, we should return that favour */
+               wdt_keepalive();
+       }
+       return count;
+}
+
+static int fop_open(struct inode * inode, struct file * file)
+{
+       /* Just in case we're already talking to someone... */
+       if(test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Good, fire up the show */
+       wdt_startup();
+       return nonseekable_open(inode, file);
+}
+
+static int fop_close(struct inode * inode, struct file * file)
+{
+       if(wdt_expect_close == 42)
+               wdt_turnoff();
+       else {
+               del_timer(&timer);
+               printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
+       }
+       clear_bit(0, &wdt_is_open);
+       wdt_expect_close = 0;
+       return 0;
+}
+
+static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident=
+       {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "SBC60xx",
+       };
+
+       switch(cmd)
+       {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       wdt_keepalive();
+                       return 0;
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if(get_user(new_options, p))
+                               return -EFAULT;
+
+                       if(new_options & WDIOS_DISABLECARD) {
+                               wdt_turnoff();
+                               retval = 0;
+                       }
+
+                       if(new_options & WDIOS_ENABLECARD) {
+                               wdt_startup();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_timeout;
+
+                       if(get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       wdt_keepalive();
+                       /* Fall through */
+               }
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout, p);
+       }
+}
+
+static const struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = fop_write,
+       .open           = fop_open,
+       .release        = fop_close,
+       .ioctl          = fop_ioctl,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &wdt_fops,
+};
+
+/*
+ *     Notifier for system down
+ */
+
+static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if(code==SYS_DOWN || code==SYS_HALT)
+               wdt_turnoff();
+       return NOTIFY_DONE;
+}
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier=
+{
+       .notifier_call = wdt_notify_sys,
+};
+
+static void __exit sbc60xxwdt_unload(void)
+{
+       wdt_turnoff();
+
+       /* Deregister */
+       misc_deregister(&wdt_miscdev);
+
+       unregister_reboot_notifier(&wdt_notifier);
+       if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
+               release_region(wdt_stop,1);
+       release_region(wdt_start,1);
+}
+
+static int __init sbc60xxwdt_init(void)
+{
+       int rc = -EBUSY;
+
+       if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
+       {
+               timeout = WATCHDOG_TIMEOUT;
+               printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
+                       timeout);
+       }
+
+       if (!request_region(wdt_start, 1, "SBC 60XX WDT"))
+       {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       wdt_start);
+               rc = -EIO;
+               goto err_out;
+       }
+
+       /* We cannot reserve 0x45 - the kernel already has! */
+       if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
+       {
+               if (!request_region(wdt_stop, 1, "SBC 60XX WDT"))
+               {
+                       printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                               wdt_stop);
+                       rc = -EIO;
+                       goto err_out_region1;
+               }
+       }
+
+       rc = misc_register(&wdt_miscdev);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       wdt_miscdev.minor, rc);
+               goto err_out_region2;
+       }
+
+       rc = register_reboot_notifier(&wdt_notifier);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
+               goto err_out_miscdev;
+       }
+
+       printk(KERN_INFO PFX "WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+       return 0;
+
+err_out_miscdev:
+       misc_deregister(&wdt_miscdev);
+err_out_region2:
+       if ((wdt_stop != 0x45) && (wdt_stop != wdt_start))
+               release_region(wdt_stop,1);
+err_out_region1:
+       release_region(wdt_start,1);
+err_out:
+       return rc;
+}
+
+module_init(sbc60xxwdt_init);
+module_exit(sbc60xxwdt_unload);
+
+MODULE_AUTHOR("Jakob Oestergaard <jakob@unthought.net>");
+MODULE_DESCRIPTION("60xx Single Board Computer Watchdog Timer driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c
new file mode 100644 (file)
index 0000000..285d852
--- /dev/null
@@ -0,0 +1,413 @@
+/*
+ *     SBC8360 Watchdog driver
+ *
+ *     (c) Copyright 2005 Webcon, Inc.
+ *
+ *     Based on ib700wdt.c, which is based on advantechwdt.c which is based
+ *      on acquirewdt.c which is based on wdt.c.
+ *
+ *     (c) Copyright 2001 Charles Howes <chowes@vsol.net>
+ *
+ *      Based on advantechwdt.c which is based on acquirewdt.c which
+ *       is based on wdt.c.
+ *
+ *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
+ *
+ *     Based on acquirewdt.c which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ *
+ *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *           Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *           Added timeout module option to override default
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <linux/notifier.h>
+#include <linux/fs.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/moduleparam.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+static unsigned long sbc8360_is_open;
+static spinlock_t sbc8360_lock;
+static char expect_close;
+
+#define PFX "sbc8360: "
+
+/*
+ *
+ * Watchdog Timer Configuration
+ *
+ * The function of the watchdog timer is to reset the system automatically
+ * and is defined at I/O port 0120H and 0121H.  To enable the watchdog timer
+ * and allow the system to reset, write appropriate values from the table
+ * below to I/O port 0120H and 0121H.  To disable the timer, write a zero
+ * value to I/O port 0121H for the system to stop the watchdog function.
+ *
+ * The following describes how the timer should be programmed (according to
+ * the vendor documentation)
+ *
+ * Enabling Watchdog:
+ * MOV AX,000AH (enable, phase I)
+ * MOV DX,0120H
+ * OUT DX,AX
+ * MOV AX,000BH (enable, phase II)
+ * MOV DX,0120H
+ * OUT DX,AX
+ * MOV AX,000nH (set multiplier n, from 1-4)
+ * MOV DX,0120H
+ * OUT DX,AX
+ * MOV AX,000mH (set base timer m, from 0-F)
+ * MOV DX,0121H
+ * OUT DX,AX
+ *
+ * Reset timer:
+ * MOV AX,000mH (same as set base timer, above)
+ * MOV DX,0121H
+ * OUT DX,AX
+ *
+ * Disabling Watchdog:
+ * MOV AX,0000H (a zero value)
+ * MOV DX,0120H
+ * OUT DX,AX
+ *
+ * Watchdog timeout configuration values:
+ *             N
+ *     M |     1       2       3       4
+ *     --|----------------------------------
+ *     0 |     0.5s    5s      50s     100s
+ *     1 |     1s      10s     100s    200s
+ *     2 |     1.5s    15s     150s    300s
+ *     3 |     2s      20s     200s    400s
+ *     4 |     2.5s    25s     250s    500s
+ *     5 |     3s      30s     300s    600s
+ *     6 |     3.5s    35s     350s    700s
+ *     7 |     4s      40s     400s    800s
+ *     8 |     4.5s    45s     450s    900s
+ *     9 |     5s      50s     500s    1000s
+ *     A |     5.5s    55s     550s    1100s
+ *     B |     6s      60s     600s    1200s
+ *     C |     6.5s    65s     650s    1300s
+ *     D |     7s      70s     700s    1400s
+ *     E |     7.5s    75s     750s    1500s
+ *     F |     8s      80s     800s    1600s
+ *
+ * Another way to say the same things is:
+ *  For N=1, Timeout = (M+1) * 0.5s
+ *  For N=2, Timeout = (M+1) * 5s
+ *  For N=3, Timeout = (M+1) * 50s
+ *  For N=4, Timeout = (M+1) * 100s
+ *
+ */
+
+static int wd_times[64][2] = {
+       {0, 1},                 /* 0  = 0.5s */
+       {1, 1},                 /* 1  = 1s   */
+       {2, 1},                 /* 2  = 1.5s */
+       {3, 1},                 /* 3  = 2s   */
+       {4, 1},                 /* 4  = 2.5s */
+       {5, 1},                 /* 5  = 3s   */
+       {6, 1},                 /* 6  = 3.5s */
+       {7, 1},                 /* 7  = 4s   */
+       {8, 1},                 /* 8  = 4.5s */
+       {9, 1},                 /* 9  = 5s   */
+       {0xA, 1},               /* 10 = 5.5s */
+       {0xB, 1},               /* 11 = 6s   */
+       {0xC, 1},               /* 12 = 6.5s */
+       {0xD, 1},               /* 13 = 7s   */
+       {0xE, 1},               /* 14 = 7.5s */
+       {0xF, 1},               /* 15 = 8s   */
+       {0, 2},                 /* 16 = 5s  */
+       {1, 2},                 /* 17 = 10s */
+       {2, 2},                 /* 18 = 15s */
+       {3, 2},                 /* 19 = 20s */
+       {4, 2},                 /* 20 = 25s */
+       {5, 2},                 /* 21 = 30s */
+       {6, 2},                 /* 22 = 35s */
+       {7, 2},                 /* 23 = 40s */
+       {8, 2},                 /* 24 = 45s */
+       {9, 2},                 /* 25 = 50s */
+       {0xA, 2},               /* 26 = 55s */
+       {0xB, 2},               /* 27 = 60s */
+       {0xC, 2},               /* 28 = 65s */
+       {0xD, 2},               /* 29 = 70s */
+       {0xE, 2},               /* 30 = 75s */
+       {0xF, 2},               /* 31 = 80s */
+       {0, 3},                 /* 32 = 50s  */
+       {1, 3},                 /* 33 = 100s */
+       {2, 3},                 /* 34 = 150s */
+       {3, 3},                 /* 35 = 200s */
+       {4, 3},                 /* 36 = 250s */
+       {5, 3},                 /* 37 = 300s */
+       {6, 3},                 /* 38 = 350s */
+       {7, 3},                 /* 39 = 400s */
+       {8, 3},                 /* 40 = 450s */
+       {9, 3},                 /* 41 = 500s */
+       {0xA, 3},               /* 42 = 550s */
+       {0xB, 3},               /* 43 = 600s */
+       {0xC, 3},               /* 44 = 650s */
+       {0xD, 3},               /* 45 = 700s */
+       {0xE, 3},               /* 46 = 750s */
+       {0xF, 3},               /* 47 = 800s */
+       {0, 4},                 /* 48 = 100s */
+       {1, 4},                 /* 49 = 200s */
+       {2, 4},                 /* 50 = 300s */
+       {3, 4},                 /* 51 = 400s */
+       {4, 4},                 /* 52 = 500s */
+       {5, 4},                 /* 53 = 600s */
+       {6, 4},                 /* 54 = 700s */
+       {7, 4},                 /* 55 = 800s */
+       {8, 4},                 /* 56 = 900s */
+       {9, 4},                 /* 57 = 1000s */
+       {0xA, 4},               /* 58 = 1100s */
+       {0xB, 4},               /* 59 = 1200s */
+       {0xC, 4},               /* 60 = 1300s */
+       {0xD, 4},               /* 61 = 1400s */
+       {0xE, 4},               /* 62 = 1500s */
+       {0xF, 4}                /* 63 = 1600s */
+};
+
+#define SBC8360_ENABLE 0x120
+#define SBC8360_BASETIME 0x121
+
+static int timeout = 27;
+static int wd_margin = 0xB;
+static int wd_multiplier = 2;
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))");
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout,
+                "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Kernel methods.
+ */
+
+/* Activate and pre-configure watchdog */
+static void sbc8360_activate(void)
+{
+       /* Enable the watchdog */
+       outb(0x0A, SBC8360_ENABLE);
+       msleep_interruptible(100);
+       outb(0x0B, SBC8360_ENABLE);
+       msleep_interruptible(100);
+       /* Set timeout multiplier */
+       outb(wd_multiplier, SBC8360_ENABLE);
+       msleep_interruptible(100);
+       /* Nothing happens until first sbc8360_ping() */
+}
+
+/* Kernel pings watchdog */
+static void sbc8360_ping(void)
+{
+       /* Write the base timer register */
+       outb(wd_margin, SBC8360_BASETIME);
+}
+
+/* Userspace pings kernel driver, or requests clean close */
+static ssize_t sbc8360_write(struct file *file, const char __user * buf,
+                            size_t count, loff_t * ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               sbc8360_ping();
+       }
+       return count;
+}
+
+static int sbc8360_open(struct inode *inode, struct file *file)
+{
+       spin_lock(&sbc8360_lock);
+       if (test_and_set_bit(0, &sbc8360_is_open)) {
+               spin_unlock(&sbc8360_lock);
+               return -EBUSY;
+       }
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Activate and ping once to start the countdown */
+       spin_unlock(&sbc8360_lock);
+       sbc8360_activate();
+       sbc8360_ping();
+       return nonseekable_open(inode, file);
+}
+
+static int sbc8360_close(struct inode *inode, struct file *file)
+{
+       spin_lock(&sbc8360_lock);
+       if (expect_close == 42)
+               outb(0, SBC8360_ENABLE);
+       else
+               printk(KERN_CRIT PFX
+                      "SBC8360 device closed unexpectedly.  SBC8360 will not stop!\n");
+
+       clear_bit(0, &sbc8360_is_open);
+       expect_close = 0;
+       spin_unlock(&sbc8360_lock);
+       return 0;
+}
+
+/*
+ *     Notifier for system down
+ */
+
+static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code,
+                             void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT) {
+               /* Disable the SBC8360 Watchdog */
+               outb(0, SBC8360_ENABLE);
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations sbc8360_fops = {
+       .owner = THIS_MODULE,
+       .llseek = no_llseek,
+       .write = sbc8360_write,
+       .open = sbc8360_open,
+       .release = sbc8360_close,
+};
+
+static struct miscdevice sbc8360_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &sbc8360_fops,
+};
+
+/*
+ *     The SBC8360 needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block sbc8360_notifier = {
+       .notifier_call = sbc8360_notify_sys,
+};
+
+static int __init sbc8360_init(void)
+{
+       int res;
+       unsigned long int mseconds = 60000;
+
+       if (timeout < 0 || timeout > 63) {
+               printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n");
+               res = -EINVAL;
+               goto out;
+       }
+
+       if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) {
+               printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n",
+                      SBC8360_ENABLE);
+               res = -EIO;
+               goto out;
+       }
+       if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) {
+               printk(KERN_ERR PFX
+                      "BASETIME method I/O %X is not available.\n",
+                      SBC8360_BASETIME);
+               res = -EIO;
+               goto out_nobasetimereg;
+       }
+
+       res = register_reboot_notifier(&sbc8360_notifier);
+       if (res) {
+               printk(KERN_ERR PFX "Failed to register reboot notifier.\n");
+               goto out_noreboot;
+       }
+
+       spin_lock_init(&sbc8360_lock);
+       res = misc_register(&sbc8360_miscdev);
+       if (res) {
+               printk(KERN_ERR PFX "failed to register misc device\n");
+               goto out_nomisc;
+       }
+
+       wd_margin = wd_times[timeout][0];
+       wd_multiplier = wd_times[timeout][1];
+
+       if (wd_multiplier == 1)
+               mseconds = (wd_margin + 1) * 500;
+       else if (wd_multiplier == 2)
+               mseconds = (wd_margin + 1) * 5000;
+       else if (wd_multiplier == 3)
+               mseconds = (wd_margin + 1) * 50000;
+       else if (wd_multiplier == 4)
+               mseconds = (wd_margin + 1) * 100000;
+
+       /* My kingdom for the ability to print "0.5 seconds" in the kernel! */
+       printk(KERN_INFO PFX "Timeout set at %ld ms.\n", mseconds);
+
+       return 0;
+
+      out_nomisc:
+       unregister_reboot_notifier(&sbc8360_notifier);
+      out_noreboot:
+       release_region(SBC8360_BASETIME, 1);
+      out_nobasetimereg:
+       release_region(SBC8360_ENABLE, 1);
+      out:
+       return res;
+}
+
+static void __exit sbc8360_exit(void)
+{
+       misc_deregister(&sbc8360_miscdev);
+       unregister_reboot_notifier(&sbc8360_notifier);
+       release_region(SBC8360_ENABLE, 1);
+       release_region(SBC8360_BASETIME, 1);
+}
+
+module_init(sbc8360_init);
+module_exit(sbc8360_exit);
+
+MODULE_AUTHOR("Ian E. Morgan <imorgan@webcon.ca>");
+MODULE_DESCRIPTION("SBC8360 watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_VERSION("1.01");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+/* end of sbc8360.c */
diff --git a/drivers/watchdog/sbc_epx_c3.c b/drivers/watchdog/sbc_epx_c3.c
new file mode 100644 (file)
index 0000000..82cbd88
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ *     SBC EPX C3 0.1  A Hardware Watchdog Device for the Winsystems EPX-C3
+ *     single board computer
+ *
+ *     (c) Copyright 2006 Calin A. Culianu <calin@ajvar.org>, All Rights
+ *     Reserved.
+ *
+ *     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.
+ *
+ *     based on softdog.c by Alan Cox <alan@redhat.com>
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define PFX "epx_c3: "
+static int epx_c3_alive;
+
+#define WATCHDOG_TIMEOUT 1             /* 1 sec default timeout */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+#define EPXC3_WATCHDOG_CTL_REG 0x1ee /* write 1 to enable, 0 to disable */
+#define EPXC3_WATCHDOG_PET_REG 0x1ef /* write anything to pet once enabled */
+
+static void epx_c3_start(void)
+{
+       outb(1, EPXC3_WATCHDOG_CTL_REG);
+}
+
+static void epx_c3_stop(void)
+{
+
+       outb(0, EPXC3_WATCHDOG_CTL_REG);
+
+       printk(KERN_INFO PFX "Stopped watchdog timer.\n");
+}
+
+static void epx_c3_pet(void)
+{
+       outb(1, EPXC3_WATCHDOG_PET_REG);
+}
+
+/*
+ *     Allow only one person to hold it open
+ */
+static int epx_c3_open(struct inode *inode, struct file *file)
+{
+       if (epx_c3_alive)
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Activate timer */
+       epx_c3_start();
+       epx_c3_pet();
+
+       epx_c3_alive = 1;
+       printk(KERN_INFO "Started watchdog timer.\n");
+
+       return nonseekable_open(inode, file);
+}
+
+static int epx_c3_release(struct inode *inode, struct file *file)
+{
+       /* Shut off the timer.
+        * Lock it in if it's a module and we defined ...NOWAYOUT */
+       if (!nowayout)
+               epx_c3_stop();          /* Turn the WDT off */
+
+       epx_c3_alive = 0;
+
+       return 0;
+}
+
+static ssize_t epx_c3_write(struct file *file, const char __user *data,
+                       size_t len, loff_t *ppos)
+{
+       /* Refresh the timer. */
+       if (len)
+               epx_c3_pet();
+       return len;
+}
+
+static int epx_c3_ioctl(struct inode *inode, struct file *file,
+                       unsigned int cmd, unsigned long arg)
+{
+       int options, retval = -EINVAL;
+       int __user *argp = (void __user *)arg;
+       static struct watchdog_info ident = {
+               .options                = WDIOF_KEEPALIVEPING |
+                                         WDIOF_MAGICCLOSE,
+               .firmware_version       = 0,
+               .identity               = "Winsystems EPX-C3 H/W Watchdog",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
+               return 0;
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, argp);
+       case WDIOC_KEEPALIVE:
+               epx_c3_pet();
+               return 0;
+       case WDIOC_GETTIMEOUT:
+               return put_user(WATCHDOG_TIMEOUT, argp);
+       case WDIOC_SETOPTIONS:
+               if (get_user(options, argp))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       epx_c3_stop();
+                       retval = 0;
+               }
+
+               if (options & WDIOS_ENABLECARD) {
+                       epx_c3_start();
+                       retval = 0;
+               }
+
+               return retval;
+       default:
+               return -ENOTTY;
+       }
+}
+
+static int epx_c3_notify_sys(struct notifier_block *this, unsigned long code,
+                               void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+               epx_c3_stop();          /* Turn the WDT off */
+
+       return NOTIFY_DONE;
+}
+
+static const struct file_operations epx_c3_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = epx_c3_write,
+       .ioctl          = epx_c3_ioctl,
+       .open           = epx_c3_open,
+       .release        = epx_c3_release,
+};
+
+static struct miscdevice epx_c3_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &epx_c3_fops,
+};
+
+static struct notifier_block epx_c3_notifier = {
+       .notifier_call = epx_c3_notify_sys,
+};
+
+static const char banner[] __initdata =
+    KERN_INFO PFX "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n";
+
+static int __init watchdog_init(void)
+{
+       int ret;
+
+       if (!request_region(EPXC3_WATCHDOG_CTL_REG, 2, "epxc3_watchdog"))
+               return -EBUSY;
+
+       ret = register_reboot_notifier(&epx_c3_notifier);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register reboot notifier "
+                       "(err=%d)\n", ret);
+               goto out;
+       }
+
+       ret = misc_register(&epx_c3_miscdev);
+       if (ret) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d "
+                       "(err=%d)\n", WATCHDOG_MINOR, ret);
+               unregister_reboot_notifier(&epx_c3_notifier);
+               goto out;
+       }
+
+       printk(banner);
+
+       return 0;
+
+out:
+       release_region(EPXC3_WATCHDOG_CTL_REG, 2);
+       return ret;
+}
+
+static void __exit watchdog_exit(void)
+{
+       misc_deregister(&epx_c3_miscdev);
+       unregister_reboot_notifier(&epx_c3_notifier);
+       release_region(EPXC3_WATCHDOG_CTL_REG, 2);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_exit);
+
+MODULE_AUTHOR("Calin A. Culianu <calin@ajvar.org>");
+MODULE_DESCRIPTION("Hardware Watchdog Device for Winsystems EPX-C3 SBC.  Note that there is no way to probe for this device -- so only use it if you are *sure* you are runnning on this specific SBC system from Winsystems!  It writes to IO ports 0x1ee and 0x1ef!");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c
new file mode 100644 (file)
index 0000000..9670d47
--- /dev/null
@@ -0,0 +1,463 @@
+/*
+ *     National Semiconductor PC87307/PC97307 (ala SC1200) WDT driver
+ *     (c) Copyright 2002 Zwane Mwaikambo <zwane@commfireservices.com>,
+ *                     All Rights Reserved.
+ *     Based on wdt.c and wdt977.c by Alan Cox and Woody Suwalski respectively.
+ *
+ *     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 author(s) of this software shall not be held liable for damages
+ *     of any nature resulting due to the use of this software. This
+ *     software is provided AS-IS with no warranties.
+ *
+ *     Changelog:
+ *     20020220 Zwane Mwaikambo        Code based on datasheet, no hardware.
+ *     20020221 Zwane Mwaikambo        Cleanups as suggested by Jeff Garzik and Alan Cox.
+ *     20020222 Zwane Mwaikambo        Added probing.
+ *     20020225 Zwane Mwaikambo        Added ISAPNP support.
+ *     20020412 Rob Radez              Broke out start/stop functions
+ *              <rob@osinvestor.com>   Return proper status instead of temperature warning
+ *                                     Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls
+ *                                     Fix CONFIG_WATCHDOG_NOWAYOUT
+ *     20020530 Joel Becker            Add Matt Domsch's nowayout module option
+ *     20030116 Adam Belay             Updated to the latest pnp code
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/spinlock.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/pnp.h>
+#include <linux/fs.h>
+
+#include <asm/semaphore.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+#define SC1200_MODULE_VER      "build 20020303"
+#define SC1200_MODULE_NAME     "sc1200wdt"
+#define PFX                    SC1200_MODULE_NAME ": "
+
+#define        MAX_TIMEOUT     255     /* 255 minutes */
+#define PMIR           (io)    /* Power Management Index Register */
+#define PMDR           (io+1)  /* Power Management Data Register */
+
+/* Data Register indexes */
+#define FER1           0x00    /* Function enable register 1 */
+#define FER2           0x01    /* Function enable register 2 */
+#define PMC1           0x02    /* Power Management Ctrl 1 */
+#define PMC2           0x03    /* Power Management Ctrl 2 */
+#define PMC3           0x04    /* Power Management Ctrl 3 */
+#define WDTO           0x05    /* Watchdog timeout register */
+#define        WDCF            0x06    /* Watchdog config register */
+#define WDST           0x07    /* Watchdog status register */
+
+/* WDCF bitfields - which devices assert WDO */
+#define KBC_IRQ                0x01    /* Keyboard Controller */
+#define MSE_IRQ                0x02    /* Mouse */
+#define UART1_IRQ      0x03    /* Serial0 */
+#define UART2_IRQ      0x04    /* Serial1 */
+/* 5 -7 are reserved */
+
+static char banner[] __initdata = KERN_INFO PFX SC1200_MODULE_VER;
+static int timeout = 1;
+static int io = -1;
+static int io_len = 2;         /* for non plug and play */
+static struct semaphore open_sem;
+static char expect_close;
+static spinlock_t sc1200wdt_lock;      /* io port access serialisation */
+
+#if defined CONFIG_PNP
+static int isapnp = 1;
+static struct pnp_dev *wdt_dev;
+
+module_param(isapnp, int, 0);
+MODULE_PARM_DESC(isapnp, "When set to 0 driver ISA PnP support will be disabled");
+#endif
+
+module_param(io, int, 0);
+MODULE_PARM_DESC(io, "io port");
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+
+
+/* Read from Data Register */
+static inline void sc1200wdt_read_data(unsigned char index, unsigned char *data)
+{
+       spin_lock(&sc1200wdt_lock);
+       outb_p(index, PMIR);
+       *data = inb(PMDR);
+       spin_unlock(&sc1200wdt_lock);
+}
+
+
+/* Write to Data Register */
+static inline void sc1200wdt_write_data(unsigned char index, unsigned char data)
+{
+       spin_lock(&sc1200wdt_lock);
+       outb_p(index, PMIR);
+       outb(data, PMDR);
+       spin_unlock(&sc1200wdt_lock);
+}
+
+
+static void sc1200wdt_start(void)
+{
+       unsigned char reg;
+
+       sc1200wdt_read_data(WDCF, &reg);
+       /* assert WDO when any of the following interrupts are triggered too */
+       reg |= (KBC_IRQ | MSE_IRQ | UART1_IRQ | UART2_IRQ);
+       sc1200wdt_write_data(WDCF, reg);
+       /* set the timeout and get the ball rolling */
+       sc1200wdt_write_data(WDTO, timeout);
+}
+
+
+static void sc1200wdt_stop(void)
+{
+       sc1200wdt_write_data(WDTO, 0);
+}
+
+
+/* This returns the status of the WDO signal, inactive high. */
+static inline int sc1200wdt_status(void)
+{
+       unsigned char ret;
+
+       sc1200wdt_read_data(WDST, &ret);
+       /* If the bit is inactive, the watchdog is enabled, so return
+        * KEEPALIVEPING which is a bit of a kludge because there's nothing
+        * else for enabled/disabled status
+        */
+       return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING;  /* bits 1 - 7 are undefined */
+}
+
+
+static int sc1200wdt_open(struct inode *inode, struct file *file)
+{
+       /* allow one at a time */
+       if (down_trylock(&open_sem))
+               return -EBUSY;
+
+       if (timeout > MAX_TIMEOUT)
+               timeout = MAX_TIMEOUT;
+
+       sc1200wdt_start();
+       printk(KERN_INFO PFX "Watchdog enabled, timeout = %d min(s)", timeout);
+
+       return nonseekable_open(inode, file);
+}
+
+
+static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+{
+       int new_timeout;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 0,
+               .identity = "PC87307/PC97307",
+       };
+
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+
+               case WDIOC_GETSUPPORT:
+                       if (copy_to_user(argp, &ident, sizeof ident))
+                               return -EFAULT;
+                       return 0;
+
+               case WDIOC_GETSTATUS:
+                       return put_user(sc1200wdt_status(), p);
+
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+
+               case WDIOC_KEEPALIVE:
+                       sc1200wdt_write_data(WDTO, timeout);
+                       return 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       /* the API states this is given in secs */
+                       new_timeout /= 60;
+                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       sc1200wdt_write_data(WDTO, timeout);
+                       /* fall through and return the new timeout */
+
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout * 60, p);
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int options, retval = -EINVAL;
+
+                       if (get_user(options, p))
+                               return -EFAULT;
+
+                       if (options & WDIOS_DISABLECARD) {
+                               sc1200wdt_stop();
+                               retval = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               sc1200wdt_start();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+       }
+}
+
+
+static int sc1200wdt_release(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               sc1200wdt_stop();
+               printk(KERN_INFO PFX "Watchdog disabled\n");
+       } else {
+               sc1200wdt_write_data(WDTO, timeout);
+               printk(KERN_CRIT PFX "Unexpected close!, timeout = %d min(s)\n", timeout);
+       }
+       up(&open_sem);
+       expect_close = 0;
+
+       return 0;
+}
+
+
+static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
+{
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+
+               sc1200wdt_write_data(WDTO, timeout);
+               return len;
+       }
+
+       return 0;
+}
+
+
+static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+               sc1200wdt_stop();
+
+       return NOTIFY_DONE;
+}
+
+
+static struct notifier_block sc1200wdt_notifier =
+{
+       .notifier_call =        sc1200wdt_notify_sys,
+};
+
+static const struct file_operations sc1200wdt_fops =
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = sc1200wdt_write,
+       .ioctl          = sc1200wdt_ioctl,
+       .open           = sc1200wdt_open,
+       .release        = sc1200wdt_release,
+};
+
+static struct miscdevice sc1200wdt_miscdev =
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &sc1200wdt_fops,
+};
+
+
+static int __init sc1200wdt_probe(void)
+{
+       /* The probe works by reading the PMC3 register's default value of 0x0e
+        * there is one caveat, if the device disables the parallel port or any
+        * of the UARTs we won't be able to detect it.
+        * Nb. This could be done with accuracy by reading the SID registers, but
+        * we don't have access to those io regions.
+        */
+
+       unsigned char reg;
+
+       sc1200wdt_read_data(PMC3, &reg);
+       reg &= 0x0f;                            /* we don't want the UART busy bits */
+       return (reg == 0x0e) ? 0 : -ENODEV;
+}
+
+
+#if defined CONFIG_PNP
+
+static struct pnp_device_id scl200wdt_pnp_devices[] = {
+       /* National Semiconductor PC87307/PC97307 watchdog component */
+       {.id = "NSC0800", .driver_data = 0},
+       {.id = ""},
+};
+
+static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
+{
+       /* this driver only supports one card at a time */
+       if (wdt_dev || !isapnp)
+               return -EBUSY;
+
+       wdt_dev = dev;
+       io = pnp_port_start(wdt_dev, 0);
+       io_len = pnp_port_len(wdt_dev, 0);
+
+       if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
+               printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
+               return -EBUSY;
+       }
+
+       printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", io, io_len);
+       return 0;
+}
+
+static void scl200wdt_pnp_remove(struct pnp_dev * dev)
+{
+       if (wdt_dev){
+               release_region(io, io_len);
+               wdt_dev = NULL;
+       }
+}
+
+static struct pnp_driver scl200wdt_pnp_driver = {
+       .name           = "scl200wdt",
+       .id_table       = scl200wdt_pnp_devices,
+       .probe          = scl200wdt_pnp_probe,
+       .remove         = scl200wdt_pnp_remove,
+};
+
+#endif /* CONFIG_PNP */
+
+
+static int __init sc1200wdt_init(void)
+{
+       int ret;
+
+       printk("%s\n", banner);
+
+       spin_lock_init(&sc1200wdt_lock);
+       sema_init(&open_sem, 1);
+
+#if defined CONFIG_PNP
+       if (isapnp) {
+               ret = pnp_register_driver(&scl200wdt_pnp_driver);
+               if (ret)
+                       goto out_clean;
+       }
+#endif
+
+       if (io == -1) {
+               printk(KERN_ERR PFX "io parameter must be specified\n");
+               ret = -EINVAL;
+               goto out_pnp;
+       }
+
+#if defined CONFIG_PNP
+       /* now that the user has specified an IO port and we haven't detected
+        * any devices, disable pnp support */
+       isapnp = 0;
+       pnp_unregister_driver(&scl200wdt_pnp_driver);
+#endif
+
+       if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
+               printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
+               ret = -EBUSY;
+               goto out_pnp;
+       }
+
+       ret = sc1200wdt_probe();
+       if (ret)
+               goto out_io;
+
+       ret = register_reboot_notifier(&sc1200wdt_notifier);
+       if (ret) {
+               printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret);
+               goto out_io;
+       }
+
+       ret = misc_register(&sc1200wdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
+               goto out_rbt;
+       }
+
+       /* ret = 0 */
+
+out_clean:
+       return ret;
+
+out_rbt:
+       unregister_reboot_notifier(&sc1200wdt_notifier);
+
+out_io:
+       release_region(io, io_len);
+
+out_pnp:
+#if defined CONFIG_PNP
+       if (isapnp)
+               pnp_unregister_driver(&scl200wdt_pnp_driver);
+#endif
+       goto out_clean;
+}
+
+
+static void __exit sc1200wdt_exit(void)
+{
+       misc_deregister(&sc1200wdt_miscdev);
+       unregister_reboot_notifier(&sc1200wdt_notifier);
+
+#if defined CONFIG_PNP
+       if(isapnp)
+               pnp_unregister_driver(&scl200wdt_pnp_driver);
+       else
+#endif
+       release_region(io, io_len);
+}
+
+module_init(sc1200wdt_init);
+module_exit(sc1200wdt_exit);
+
+MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>");
+MODULE_DESCRIPTION("Driver for National Semiconductor PC87307/PC97307 watchdog component");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
new file mode 100644 (file)
index 0000000..e8594c6
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ *     AMD Elan SC520 processor Watchdog Timer driver
+ *
+ *      Based on acquirewdt.c by Alan Cox,
+ *           and sbc60xxwdt.c by Jakob Oestergaard <jakob@unthought.net>
+ *
+ *     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 authors do NOT admit liability nor provide warranty for
+ *     any of this software. This material is provided "AS-IS" in
+ *      the hope that it may be useful for others.
+ *
+ *     (c) Copyright 2001    Scott Jennings <linuxdrivers@oro.net>
+ *           9/27 - 2001      [Initial release]
+ *
+ *     Additional fixes Alan Cox
+ *     -       Fixed formatting
+ *     -       Removed debug printks
+ *     -       Fixed SMP built kernel deadlock
+ *     -       Switched to private locks not lock_kernel
+ *     -       Used ioremap/writew/readw
+ *     -       Added NOWAYOUT support
+ *     4/12 - 2002 Changes by Rob Radez <rob@osinvestor.com>
+ *     -       Change comments
+ *     -       Eliminate fop_llseek
+ *     -       Change CONFIG_WATCHDOG_NOWAYOUT semantics
+ *     -       Add KERN_* tags to printks
+ *     -       fix possible wdt_is_open race
+ *     -       Report proper capabilities in watchdog_info
+ *     -       Add WDIOC_{GETSTATUS, GETBOOTSTATUS, SETTIMEOUT,
+ *             GETTIMEOUT, SETOPTIONS} ioctls
+ *     09/8 - 2003 Changes by Wim Van Sebroeck <wim@iguana.be>
+ *     -       cleanup of trailing spaces
+ *     -       added extra printk's for startup problems
+ *     -       use module_param
+ *     -       made timeout (the emulated heartbeat) a module_param
+ *     -       made the keepalive ping an internal subroutine
+ *     3/27 - 2004 Changes by Sean Young <sean@mess.org>
+ *     -       set MMCR_BASE to 0xfffef000
+ *     -       CBAR does not need to be read
+ *     -       removed debugging printks
+ *
+ *  This WDT driver is different from most other Linux WDT
+ *  drivers in that the driver will ping the watchdog by itself,
+ *  because this particular WDT has a very short timeout (1.6
+ *  seconds) and it would be insane to count on any userspace
+ *  daemon always getting scheduled within that time frame.
+ *
+ *  This driver uses memory mapped IO, and spinlock.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define OUR_NAME "sc520_wdt"
+#define PFX OUR_NAME ": "
+
+/*
+ * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7)
+ *
+ *   0: 492us    2: 1.01s    4: 4.03s   6: 16.22s
+ *   1: 503ms    3: 2.01s    5: 8.05s   7: 32.21s
+ *
+ * We will program the SC520 watchdog for a timeout of 2.01s.
+ * If we reset the watchdog every ~250ms we should be safe.
+ */
+
+#define WDT_INTERVAL (HZ/4+1)
+
+/*
+ * We must not require too good response from the userspace daemon.
+ * Here we require the userspace daemon to send us a heartbeat
+ * char to /dev/watchdog every 30 seconds.
+ */
+
+#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * AMD Elan SC520 - Watchdog Timer Registers
+ */
+#define MMCR_BASE      0xfffef000      /* The default base address */
+#define OFFS_WDTMRCTL  0xCB0   /* Watchdog Timer Control Register */
+
+/* WDT Control Register bit definitions */
+#define WDT_EXP_SEL_01 0x0001  /* [01] Time-out = 496 us (with 33 Mhz clk). */
+#define WDT_EXP_SEL_02 0x0002  /* [02] Time-out = 508 ms (with 33 Mhz clk). */
+#define WDT_EXP_SEL_03 0x0004  /* [03] Time-out = 1.02 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_04 0x0008  /* [04] Time-out = 2.03 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_05 0x0010  /* [05] Time-out = 4.07 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_06 0x0020  /* [06] Time-out = 8.13 s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_07 0x0040  /* [07] Time-out = 16.27s (with 33 Mhz clk). */
+#define WDT_EXP_SEL_08 0x0080  /* [08] Time-out = 32.54s (with 33 Mhz clk). */
+#define WDT_IRQ_FLG    0x1000  /* [12] Interrupt Request Flag */
+#define WDT_WRST_ENB   0x4000  /* [14] Watchdog Timer Reset Enable */
+#define WDT_ENB                0x8000  /* [15] Watchdog Timer Enable */
+
+static __u16 __iomem *wdtmrctl;
+
+static void wdt_timer_ping(unsigned long);
+static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
+static unsigned long next_heartbeat;
+static unsigned long wdt_is_open;
+static char wdt_expect_close;
+static spinlock_t wdt_spinlock;
+
+/*
+ *     Whack the dog
+ */
+
+static void wdt_timer_ping(unsigned long data)
+{
+       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
+        * we agree to ping the WDT
+        */
+       if(time_before(jiffies, next_heartbeat))
+       {
+               /* Ping the WDT */
+               spin_lock(&wdt_spinlock);
+               writew(0xAAAA, wdtmrctl);
+               writew(0x5555, wdtmrctl);
+               spin_unlock(&wdt_spinlock);
+
+               /* Re-set the timer interval */
+               mod_timer(&timer, jiffies + WDT_INTERVAL);
+       } else {
+               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
+       }
+}
+
+/*
+ *     Utility routines
+ */
+
+static void wdt_config(int writeval)
+{
+       __u16 dummy;
+       unsigned long flags;
+
+       /* buy some time (ping) */
+       spin_lock_irqsave(&wdt_spinlock, flags);
+       dummy=readw(wdtmrctl);  /* ensure write synchronization */
+       writew(0xAAAA, wdtmrctl);
+       writew(0x5555, wdtmrctl);
+       /* unlock WDT = make WDT configuration register writable one time */
+       writew(0x3333, wdtmrctl);
+       writew(0xCCCC, wdtmrctl);
+       /* write WDT configuration register */
+       writew(writeval, wdtmrctl);
+       spin_unlock_irqrestore(&wdt_spinlock, flags);
+}
+
+static int wdt_startup(void)
+{
+       next_heartbeat = jiffies + (timeout * HZ);
+
+       /* Start the timer */
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+
+       /* Start the watchdog */
+       wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04);
+
+       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
+       return 0;
+}
+
+static int wdt_turnoff(void)
+{
+       /* Stop the timer */
+       del_timer(&timer);
+
+       /* Stop the watchdog */
+       wdt_config(0);
+
+       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
+       return 0;
+}
+
+static int wdt_keepalive(void)
+{
+       /* user land ping */
+       next_heartbeat = jiffies + (timeout * HZ);
+       return 0;
+}
+
+static int wdt_set_heartbeat(int t)
+{
+       if ((t < 1) || (t > 3600))      /* arbitrary upper limit */
+               return -EINVAL;
+
+       timeout = t;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if(count) {
+               if (!nowayout) {
+                       size_t ofs;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       wdt_expect_close = 0;
+
+                       /* now scan */
+                       for(ofs = 0; ofs != count; ofs++) {
+                               char c;
+                               if (get_user(c, buf + ofs))
+                                       return -EFAULT;
+                               if(c == 'V')
+                                       wdt_expect_close = 42;
+                       }
+               }
+
+               /* Well, anyhow someone wrote to us, we should return that favour */
+               wdt_keepalive();
+       }
+       return count;
+}
+
+static int fop_open(struct inode * inode, struct file * file)
+{
+       /* Just in case we're already talking to someone... */
+       if(test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Good, fire up the show */
+       wdt_startup();
+       return nonseekable_open(inode, file);
+}
+
+static int fop_close(struct inode * inode, struct file * file)
+{
+       if(wdt_expect_close == 42) {
+               wdt_turnoff();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               wdt_keepalive();
+       }
+       clear_bit(0, &wdt_is_open);
+       wdt_expect_close = 0;
+       return 0;
+}
+
+static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "SC520",
+       };
+
+       switch(cmd)
+       {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       wdt_keepalive();
+                       return 0;
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if(get_user(new_options, p))
+                               return -EFAULT;
+
+                       if(new_options & WDIOS_DISABLECARD) {
+                               wdt_turnoff();
+                               retval = 0;
+                       }
+
+                       if(new_options & WDIOS_ENABLECARD) {
+                               wdt_startup();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_timeout;
+
+                       if(get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       if(wdt_set_heartbeat(new_timeout))
+                               return -EINVAL;
+
+                       wdt_keepalive();
+                       /* Fall through */
+               }
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout, p);
+       }
+}
+
+static const struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = fop_write,
+       .open           = fop_open,
+       .release        = fop_close,
+       .ioctl          = fop_ioctl,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &wdt_fops,
+};
+
+/*
+ *     Notifier for system down
+ */
+
+static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if(code==SYS_DOWN || code==SYS_HALT)
+               wdt_turnoff();
+       return NOTIFY_DONE;
+}
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier = {
+       .notifier_call = wdt_notify_sys,
+};
+
+static void __exit sc520_wdt_unload(void)
+{
+       if (!nowayout)
+               wdt_turnoff();
+
+       /* Deregister */
+       misc_deregister(&wdt_miscdev);
+       unregister_reboot_notifier(&wdt_notifier);
+       iounmap(wdtmrctl);
+}
+
+static int __init sc520_wdt_init(void)
+{
+       int rc = -EBUSY;
+
+       spin_lock_init(&wdt_spinlock);
+
+       /* Check that the timeout value is within it's range ; if not reset to the default */
+       if (wdt_set_heartbeat(timeout)) {
+               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
+               printk(KERN_INFO PFX "timeout value must be 1<=timeout<=3600, using %d\n",
+                       WATCHDOG_TIMEOUT);
+       }
+
+       wdtmrctl = ioremap((unsigned long)(MMCR_BASE + OFFS_WDTMRCTL), 2);
+       if (!wdtmrctl) {
+               printk(KERN_ERR PFX "Unable to remap memory\n");
+               rc = -ENOMEM;
+               goto err_out_region2;
+       }
+
+       rc = register_reboot_notifier(&wdt_notifier);
+       if (rc) {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
+               goto err_out_ioremap;
+       }
+
+       rc = misc_register(&wdt_miscdev);
+       if (rc) {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, rc);
+               goto err_out_notifier;
+       }
+
+       printk(KERN_INFO PFX "WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n",
+               timeout,nowayout);
+
+       return 0;
+
+err_out_notifier:
+       unregister_reboot_notifier(&wdt_notifier);
+err_out_ioremap:
+       iounmap(wdtmrctl);
+err_out_region2:
+       return rc;
+}
+
+module_init(sc520_wdt_init);
+module_exit(sc520_wdt_unload);
+
+MODULE_AUTHOR("Scott and Bill Jennings");
+MODULE_DESCRIPTION("Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c
new file mode 100644 (file)
index 0000000..d4fd0fa
--- /dev/null
@@ -0,0 +1,269 @@
+/* drivers/char/watchdog/scx200_wdt.c
+
+   National Semiconductor SCx200 Watchdog support
+
+   Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
+
+   Some code taken from:
+   National Semiconductor PC87307/PC97307 (ala SC1200) WDT driver
+   (c) Copyright 2002 Zwane Mwaikambo <zwane@commfireservices.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 the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The author(s) of this software shall not be held liable for damages
+   of any nature resulting due to the use of this software. This
+   software is provided AS-IS with no warranties. */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/scx200.h>
+
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define NAME "scx200_wdt"
+
+MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>");
+MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+static int margin = 60;                /* in seconds */
+module_param(margin, int, 0);
+MODULE_PARM_DESC(margin, "Watchdog margin in seconds");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close");
+
+static u16 wdto_restart;
+static struct semaphore open_semaphore;
+static char expect_close;
+
+/* Bits of the WDCNFG register */
+#define W_ENABLE 0x00fa                /* Enable watchdog */
+#define W_DISABLE 0x0000       /* Disable watchdog */
+
+/* The scaling factor for the timer, this depends on the value of W_ENABLE */
+#define W_SCALE (32768/1024)
+
+static void scx200_wdt_ping(void)
+{
+       outw(wdto_restart, scx200_cb_base + SCx200_WDT_WDTO);
+}
+
+static void scx200_wdt_update_margin(void)
+{
+       printk(KERN_INFO NAME ": timer margin %d seconds\n", margin);
+       wdto_restart = margin * W_SCALE;
+}
+
+static void scx200_wdt_enable(void)
+{
+       printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n",
+              wdto_restart);
+
+       outw(0, scx200_cb_base + SCx200_WDT_WDTO);
+       outb(SCx200_WDT_WDSTS_WDOVF, scx200_cb_base + SCx200_WDT_WDSTS);
+       outw(W_ENABLE, scx200_cb_base + SCx200_WDT_WDCNFG);
+
+       scx200_wdt_ping();
+}
+
+static void scx200_wdt_disable(void)
+{
+       printk(KERN_DEBUG NAME ": disabling watchdog timer\n");
+
+       outw(0, scx200_cb_base + SCx200_WDT_WDTO);
+       outb(SCx200_WDT_WDSTS_WDOVF, scx200_cb_base + SCx200_WDT_WDSTS);
+       outw(W_DISABLE, scx200_cb_base + SCx200_WDT_WDCNFG);
+}
+
+static int scx200_wdt_open(struct inode *inode, struct file *file)
+{
+       /* only allow one at a time */
+       if (down_trylock(&open_semaphore))
+               return -EBUSY;
+       scx200_wdt_enable();
+
+       return nonseekable_open(inode, file);
+}
+
+static int scx200_wdt_release(struct inode *inode, struct file *file)
+{
+       if (expect_close != 42) {
+               printk(KERN_WARNING NAME ": watchdog device closed unexpectedly, will not disable the watchdog timer\n");
+       } else if (!nowayout) {
+               scx200_wdt_disable();
+       }
+       expect_close = 0;
+       up(&open_semaphore);
+
+       return 0;
+}
+
+static int scx200_wdt_notify_sys(struct notifier_block *this,
+                                     unsigned long code, void *unused)
+{
+       if (code == SYS_HALT || code == SYS_POWER_OFF)
+               if (!nowayout)
+                       scx200_wdt_disable();
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block scx200_wdt_notifier =
+{
+       .notifier_call = scx200_wdt_notify_sys,
+};
+
+static ssize_t scx200_wdt_write(struct file *file, const char __user *data,
+                                    size_t len, loff_t *ppos)
+{
+       /* check for a magic close character */
+       if (len)
+       {
+               size_t i;
+
+               scx200_wdt_ping();
+
+               expect_close = 0;
+               for (i = 0; i < len; ++i) {
+                       char c;
+                       if (get_user(c, data+i))
+                               return -EFAULT;
+                       if (c == 'V')
+                               expect_close = 42;
+               }
+
+               return len;
+       }
+
+       return 0;
+}
+
+static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .identity = "NatSemi SCx200 Watchdog",
+               .firmware_version = 1,
+               .options = (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING),
+       };
+       int new_margin;
+
+       switch (cmd) {
+       default:
+               return -ENOTTY;
+       case WDIOC_GETSUPPORT:
+               if(copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
+               return 0;
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               if (put_user(0, p))
+                       return -EFAULT;
+               return 0;
+       case WDIOC_KEEPALIVE:
+               scx200_wdt_ping();
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_margin, p))
+                       return -EFAULT;
+               if (new_margin < 1)
+                       return -EINVAL;
+               margin = new_margin;
+               scx200_wdt_update_margin();
+               scx200_wdt_ping();
+       case WDIOC_GETTIMEOUT:
+               if (put_user(margin, p))
+                       return -EFAULT;
+               return 0;
+       }
+}
+
+static const struct file_operations scx200_wdt_fops = {
+       .owner   = THIS_MODULE,
+       .llseek  = no_llseek,
+       .write   = scx200_wdt_write,
+       .ioctl   = scx200_wdt_ioctl,
+       .open    = scx200_wdt_open,
+       .release = scx200_wdt_release,
+};
+
+static struct miscdevice scx200_wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name  = "watchdog",
+       .fops  = &scx200_wdt_fops,
+};
+
+static int __init scx200_wdt_init(void)
+{
+       int r;
+
+       printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n");
+
+       /* check that we have found the configuration block */
+       if (!scx200_cb_present())
+               return -ENODEV;
+
+       if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET,
+                           SCx200_WDT_SIZE,
+                           "NatSemi SCx200 Watchdog")) {
+               printk(KERN_WARNING NAME ": watchdog I/O region busy\n");
+               return -EBUSY;
+       }
+
+       scx200_wdt_update_margin();
+       scx200_wdt_disable();
+
+       sema_init(&open_semaphore, 1);
+
+       r = misc_register(&scx200_wdt_miscdev);
+       if (r) {
+               release_region(scx200_cb_base + SCx200_WDT_OFFSET,
+                               SCx200_WDT_SIZE);
+               return r;
+       }
+
+       r = register_reboot_notifier(&scx200_wdt_notifier);
+       if (r) {
+               printk(KERN_ERR NAME ": unable to register reboot notifier");
+               misc_deregister(&scx200_wdt_miscdev);
+               release_region(scx200_cb_base + SCx200_WDT_OFFSET,
+                               SCx200_WDT_SIZE);
+               return r;
+       }
+
+       return 0;
+}
+
+static void __exit scx200_wdt_cleanup(void)
+{
+       unregister_reboot_notifier(&scx200_wdt_notifier);
+       misc_deregister(&scx200_wdt_miscdev);
+       release_region(scx200_cb_base + SCx200_WDT_OFFSET,
+                      SCx200_WDT_SIZE);
+}
+
+module_init(scx200_wdt_init);
+module_exit(scx200_wdt_cleanup);
+
+/*
+    Local variables:
+        compile-command: "make -k -C ../.. SUBDIRS=drivers/char modules"
+        c-basic-offset: 8
+    End:
+*/
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
new file mode 100644 (file)
index 0000000..cecbedd
--- /dev/null
@@ -0,0 +1,485 @@
+/*
+ * drivers/char/watchdog/shwdt.c
+ *
+ * Watchdog driver for integrated watchdog in the SuperH processors.
+ *
+ * Copyright (C) 2001, 2002, 2003 Paul Mundt <lethal@linux-sh.org>
+ *
+ * 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.
+ *
+ * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *     Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *
+ * 19-Apr-2002 Rob Radez <rob@osinvestor.com>
+ *     Added expect close support, made emulated timeout runtime changeable
+ *     general cleanups, add some ioctls
+ */
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/reboot.h>
+#include <linux/notifier.h>
+#include <linux/ioport.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/watchdog.h>
+
+#define PFX "shwdt: "
+
+/*
+ * Default clock division ratio is 5.25 msecs. For an additional table of
+ * values, consult the asm-sh/watchdog.h. Overload this at module load
+ * time.
+ *
+ * In order for this to work reliably we need to have HZ set to 1000 or
+ * something quite higher than 100 (or we need a proper high-res timer
+ * implementation that will deal with this properly), otherwise the 10ms
+ * resolution of a jiffy is enough to trigger the overflow. For things like
+ * the SH-4 and SH-5, this isn't necessarily that big of a problem, though
+ * for the SH-2 and SH-3, this isn't recommended unless the WDT is absolutely
+ * necssary.
+ *
+ * As a result of this timing problem, the only modes that are particularly
+ * feasible are the 4096 and the 2048 divisors, which yeild 5.25 and 2.62ms
+ * overflow periods respectively.
+ *
+ * Also, since we can't really expect userspace to be responsive enough
+ * before the overflow happens, we maintain two seperate timers .. One in
+ * the kernel for clearing out WOVF every 2ms or so (again, this depends on
+ * HZ == 1000), and another for monitoring userspace writes to the WDT device.
+ *
+ * As such, we currently use a configurable heartbeat interval which defaults
+ * to 30s. In this case, the userspace daemon is only responsible for periodic
+ * writes to the device before the next heartbeat is scheduled. If the daemon
+ * misses its deadline, the kernel timer will allow the WDT to overflow.
+ */
+static int clock_division_ratio = WTCSR_CKS_4096;
+
+#define next_ping_period(cks)  msecs_to_jiffies(cks - 4)
+
+static void sh_wdt_ping(unsigned long data);
+
+static unsigned long shwdt_is_open;
+static struct watchdog_info sh_wdt_info;
+static char shwdt_expect_close;
+static DEFINE_TIMER(timer, sh_wdt_ping, 0, 0);
+static unsigned long next_heartbeat;
+
+#define WATCHDOG_HEARTBEAT 30                  /* 30 sec default heartbeat */
+static int heartbeat = WATCHDOG_HEARTBEAT;     /* in seconds */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+/**
+ *     sh_wdt_start - Start the Watchdog
+ *
+ *     Starts the watchdog.
+ */
+static void sh_wdt_start(void)
+{
+       __u8 csr;
+
+       next_heartbeat = jiffies + (heartbeat * HZ);
+       mod_timer(&timer, next_ping_period(clock_division_ratio));
+
+       csr = sh_wdt_read_csr();
+       csr |= WTCSR_WT | clock_division_ratio;
+       sh_wdt_write_csr(csr);
+
+       sh_wdt_write_cnt(0);
+
+       /*
+        * These processors have a bit of an inconsistent initialization
+        * process.. starting with SH-3, RSTS was moved to WTCSR, and the
+        * RSTCSR register was removed.
+        *
+        * On the SH-2 however, in addition with bits being in different
+        * locations, we must deal with RSTCSR outright..
+        */
+       csr = sh_wdt_read_csr();
+       csr |= WTCSR_TME;
+       csr &= ~WTCSR_RSTS;
+       sh_wdt_write_csr(csr);
+
+#ifdef CONFIG_CPU_SH2
+       /*
+        * Whoever came up with the RSTCSR semantics must've been smoking
+        * some of the good stuff, since in addition to the WTCSR/WTCNT write
+        * brain-damage, it's managed to fuck things up one step further..
+        *
+        * If we need to clear the WOVF bit, the upper byte has to be 0xa5..
+        * but if we want to touch RSTE or RSTS, the upper byte has to be
+        * 0x5a..
+        */
+       csr = sh_wdt_read_rstcsr();
+       csr &= ~RSTCSR_RSTS;
+       sh_wdt_write_rstcsr(csr);
+#endif
+}
+
+/**
+ *     sh_wdt_stop - Stop the Watchdog
+ *     Stops the watchdog.
+ */
+static void sh_wdt_stop(void)
+{
+       __u8 csr;
+
+       del_timer(&timer);
+
+       csr = sh_wdt_read_csr();
+       csr &= ~WTCSR_TME;
+       sh_wdt_write_csr(csr);
+}
+
+/**
+ *     sh_wdt_keepalive - Keep the Userspace Watchdog Alive
+ *     The Userspace watchdog got a KeepAlive: schedule the next heartbeat.
+ */
+static inline void sh_wdt_keepalive(void)
+{
+       next_heartbeat = jiffies + (heartbeat * HZ);
+}
+
+/**
+ *     sh_wdt_set_heartbeat - Set the Userspace Watchdog heartbeat
+ *     Set the Userspace Watchdog heartbeat
+ */
+static int sh_wdt_set_heartbeat(int t)
+{
+       if (unlikely((t < 1) || (t > 3600))) /* arbitrary upper limit */
+               return -EINVAL;
+
+       heartbeat = t;
+       return 0;
+}
+
+/**
+ *     sh_wdt_ping - Ping the Watchdog
+ *     @data: Unused
+ *
+ *     Clears overflow bit, resets timer counter.
+ */
+static void sh_wdt_ping(unsigned long data)
+{
+       if (time_before(jiffies, next_heartbeat)) {
+               __u8 csr;
+
+               csr = sh_wdt_read_csr();
+               csr &= ~WTCSR_IOVF;
+               sh_wdt_write_csr(csr);
+
+               sh_wdt_write_cnt(0);
+
+               mod_timer(&timer, next_ping_period(clock_division_ratio));
+       } else
+               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping "
+                      "the watchdog\n");
+}
+
+/**
+ *     sh_wdt_open - Open the Device
+ *     @inode: inode of device
+ *     @file: file handle of device
+ *
+ *     Watchdog device is opened and started.
+ */
+static int sh_wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &shwdt_is_open))
+               return -EBUSY;
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       sh_wdt_start();
+
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     sh_wdt_close - Close the Device
+ *     @inode: inode of device
+ *     @file: file handle of device
+ *
+ *     Watchdog device is closed and stopped.
+ */
+static int sh_wdt_close(struct inode *inode, struct file *file)
+{
+       if (shwdt_expect_close == 42) {
+               sh_wdt_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not "
+                      "stopping watchdog!\n");
+               sh_wdt_keepalive();
+       }
+
+       clear_bit(0, &shwdt_is_open);
+       shwdt_expect_close = 0;
+
+       return 0;
+}
+
+/**
+ *     sh_wdt_write - Write to Device
+ *     @file: file handle of device
+ *     @buf: buffer to write
+ *     @count: length of buffer
+ *     @ppos: offset
+ *
+ *     Pings the watchdog on write.
+ */
+static ssize_t sh_wdt_write(struct file *file, const char *buf,
+                           size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       shwdt_expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       shwdt_expect_close = 42;
+                       }
+               }
+               sh_wdt_keepalive();
+       }
+
+       return count;
+}
+
+/**
+ *     sh_wdt_mmap - map WDT/CPG registers into userspace
+ *     @file: file structure for the device
+ *     @vma: VMA to map the registers into
+ *
+ *     A simple mmap() implementation for the corner cases where the counter
+ *     needs to be mapped in userspace directly. Due to the relatively small
+ *     size of the area, neighbouring registers not necessarily tied to the
+ *     CPG will also be accessible through the register page, so this remains
+ *     configurable for users that really know what they're doing.
+ *
+ *     Additionaly, the register page maps in the CPG register base relative
+ *     to the nearest page-aligned boundary, which requires that userspace do
+ *     the appropriate CPU subtype math for calculating the page offset for
+ *     the counter value.
+ */
+static int sh_wdt_mmap(struct file *file, struct vm_area_struct *vma)
+{
+       int ret = -ENOSYS;
+
+#ifdef CONFIG_SH_WDT_MMAP
+       unsigned long addr;
+
+       /* Only support the simple cases where we map in a register page. */
+       if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff)
+               return -EINVAL;
+
+       /*
+        * Pick WTCNT as the start, it's usually the first register after the
+        * FRQCR, and neither one are generally page-aligned out of the box.
+        */
+       addr = WTCNT & ~(PAGE_SIZE - 1);
+
+       vma->vm_flags |= VM_IO;
+       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+       if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
+                              PAGE_SIZE, vma->vm_page_prot)) {
+               printk(KERN_ERR PFX "%s: io_remap_pfn_range failed\n",
+                      __FUNCTION__);
+               return -EAGAIN;
+       }
+
+       ret = 0;
+#endif
+
+       return ret;
+}
+
+/**
+ *     sh_wdt_ioctl - Query Device
+ *     @inode: inode of device
+ *     @file: file handle of device
+ *     @cmd: watchdog command
+ *     @arg: argument
+ *
+ *     Query basic information from the device or ping it, as outlined by the
+ *     watchdog API.
+ */
+static int sh_wdt_ioctl(struct inode *inode, struct file *file,
+                       unsigned int cmd, unsigned long arg)
+{
+       int new_heartbeat;
+       int options, retval = -EINVAL;
+
+       switch (cmd) {
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user((struct watchdog_info *)arg,
+                                         &sh_wdt_info,
+                                         sizeof(sh_wdt_info)) ? -EFAULT : 0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, (int *)arg);
+               case WDIOC_KEEPALIVE:
+                       sh_wdt_keepalive();
+                       return 0;
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_heartbeat, (int *)arg))
+                               return -EFAULT;
+
+                       if (sh_wdt_set_heartbeat(new_heartbeat))
+                               return -EINVAL;
+
+                       sh_wdt_keepalive();
+                       /* Fall */
+               case WDIOC_GETTIMEOUT:
+                       return put_user(heartbeat, (int *)arg);
+               case WDIOC_SETOPTIONS:
+                       if (get_user(options, (int *)arg))
+                               return -EFAULT;
+
+                       if (options & WDIOS_DISABLECARD) {
+                               sh_wdt_stop();
+                               retval = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               sh_wdt_start();
+                               retval = 0;
+                       }
+
+                       return retval;
+               default:
+                       return -ENOTTY;
+       }
+
+       return 0;
+}
+
+/**
+ *     sh_wdt_notify_sys - Notifier Handler
+ *     @this: notifier block
+ *     @code: notifier event
+ *     @unused: unused
+ *
+ *     Handles specific events, such as turning off the watchdog during a
+ *     shutdown event.
+ */
+static int sh_wdt_notify_sys(struct notifier_block *this,
+                            unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+               sh_wdt_stop();
+
+       return NOTIFY_DONE;
+}
+
+static const struct file_operations sh_wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = sh_wdt_write,
+       .ioctl          = sh_wdt_ioctl,
+       .open           = sh_wdt_open,
+       .release        = sh_wdt_close,
+       .mmap           = sh_wdt_mmap,
+};
+
+static struct watchdog_info sh_wdt_info = {
+       .options                = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
+                                 WDIOF_MAGICCLOSE,
+       .firmware_version       = 1,
+       .identity               = "SH WDT",
+};
+
+static struct notifier_block sh_wdt_notifier = {
+       .notifier_call          = sh_wdt_notify_sys,
+};
+
+static struct miscdevice sh_wdt_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &sh_wdt_fops,
+};
+
+/**
+ *     sh_wdt_init - Initialize module
+ *     Registers the device and notifier handler. Actual device
+ *     initialization is handled by sh_wdt_open().
+ */
+static int __init sh_wdt_init(void)
+{
+       int rc;
+
+       if ((clock_division_ratio < 0x5) || (clock_division_ratio > 0x7)) {
+               clock_division_ratio = WTCSR_CKS_4096;
+               printk(KERN_INFO PFX "clock_division_ratio value must "
+                      "be 0x5<=x<=0x7, using %d\n", clock_division_ratio);
+       }
+
+       rc = sh_wdt_set_heartbeat(heartbeat);
+       if (unlikely(rc)) {
+               heartbeat = WATCHDOG_HEARTBEAT;
+               printk(KERN_INFO PFX "heartbeat value must "
+                      "be 1<=x<=3600, using %d\n", heartbeat);
+       }
+
+       rc = register_reboot_notifier(&sh_wdt_notifier);
+       if (unlikely(rc)) {
+               printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n",
+                      rc);
+               return rc;
+       }
+
+       rc = misc_register(&sh_wdt_miscdev);
+       if (unlikely(rc)) {
+               printk(KERN_ERR PFX "Can't register miscdev on "
+                      "minor=%d (err=%d)\n", sh_wdt_miscdev.minor, rc);
+               unregister_reboot_notifier(&sh_wdt_notifier);
+               return rc;
+       }
+
+       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
+               heartbeat, nowayout);
+
+       return 0;
+}
+
+/**
+ *     sh_wdt_exit - Deinitialize module
+ *     Unregisters the device and notifier handler. Actual device
+ *     deinitialization is handled by sh_wdt_close().
+ */
+static void __exit sh_wdt_exit(void)
+{
+       misc_deregister(&sh_wdt_miscdev);
+       unregister_reboot_notifier(&sh_wdt_notifier);
+}
+
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
+MODULE_DESCRIPTION("SuperH watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+module_param(clock_division_ratio, int, 0);
+MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). (default=" __MODULE_STRING(clock_division_ratio) ")");
+
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<=heartbeat<=3600, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+module_init(sh_wdt_init);
+module_exit(sh_wdt_exit);
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c
new file mode 100644 (file)
index 0000000..d3cb0a7
--- /dev/null
@@ -0,0 +1,627 @@
+/*
+ *     SMsC 37B787 Watchdog Timer driver for Linux 2.6.x.x
+ *
+ *      Based on acquirewdt.c by Alan Cox <alan@redhat.com>
+ *       and some other existing drivers
+ *
+ *     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 authors do NOT admit liability nor provide warranty for
+ *     any of this software. This material is provided "AS-IS" in
+ *      the hope that it may be useful for others.
+ *
+ *     (C) Copyright 2003-2006  Sven Anders <anders@anduras.de>
+ *
+ *  History:
+ *     2003 - Created version 1.0 for Linux 2.4.x.
+ *     2006 - Ported to Linux 2.6, added nowayout and MAGICCLOSE
+ *             features. Released version 1.1
+ *
+ *  Theory of operation:
+ *
+ *      A Watchdog Timer (WDT) is a hardware circuit that can
+ *      reset the computer system in case of a software fault.
+ *      You probably knew that already.
+ *
+ *      Usually a userspace daemon will notify the kernel WDT driver
+ *      via the /dev/watchdog special device file that userspace is
+ *      still alive, at regular intervals.  When such a notification
+ *      occurs, the driver will usually tell the hardware watchdog
+ *      that everything is in order, and that the watchdog should wait
+ *      for yet another little while to reset the system.
+ *      If userspace fails (RAM error, kernel bug, whatever), the
+ *      notifications cease to occur, and the hardware watchdog will
+ *      reset the system (causing a reboot) after the timeout occurs.
+ *
+ * Create device with:
+ *  mknod /dev/watchdog c 10 130
+ *
+ * For an example userspace keep-alive daemon, see:
+ *   Documentation/watchdog/watchdog.txt
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+/* enable support for minutes as units? */
+/* (does not always work correctly, so disabled by default!) */
+#define SMSC_SUPPORT_MINUTES
+#undef SMSC_SUPPORT_MINUTES
+
+#define MAX_TIMEOUT     255
+
+#define UNIT_SECOND     0
+#define UNIT_MINUTE     1
+
+#define MODNAME                "smsc37b787_wdt: "
+#define VERSION         "1.1"
+
+#define IOPORT          0x3F0
+#define IOPORT_SIZE     2
+#define IODEV_NO        8
+
+static int unit = UNIT_SECOND;  /* timer's unit */
+static int timeout = 60;        /* timeout value: default is 60 "units" */
+static unsigned long timer_enabled = 0;   /* is the timer enabled? */
+
+static char expect_close;       /* is the close expected? */
+
+static spinlock_t io_lock;     /* to guard the watchdog from io races */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+/* -- Low level function ----------------------------------------*/
+
+/* unlock the IO chip */
+
+static inline void open_io_config(void)
+{
+        outb(0x55, IOPORT);
+       mdelay(1);
+        outb(0x55, IOPORT);
+}
+
+/* lock the IO chip */
+static inline void close_io_config(void)
+{
+        outb(0xAA, IOPORT);
+}
+
+/* select the IO device */
+static inline void select_io_device(unsigned char devno)
+{
+        outb(0x07, IOPORT);
+        outb(devno, IOPORT+1);
+}
+
+/* write to the control register */
+static inline void write_io_cr(unsigned char reg, unsigned char data)
+{
+        outb(reg, IOPORT);
+        outb(data, IOPORT+1);
+}
+
+/* read from the control register */
+static inline char read_io_cr(unsigned char reg)
+{
+        outb(reg, IOPORT);
+        return inb(IOPORT+1);
+}
+
+/* -- Medium level functions ------------------------------------*/
+
+static inline void gpio_bit12(unsigned char reg)
+{
+       // -- General Purpose I/O Bit 1.2 --
+       // Bit 0,   In/Out: 0 = Output, 1 = Input
+       // Bit 1,   Polarity: 0 = No Invert, 1 = Invert
+       // Bit 2,   Group Enable Intr.: 0 = Disable, 1 = Enable
+       // Bit 3/4, Function select: 00 = GPI/O, 01 = WDT, 10 = P17,
+       //                           11 = Either Edge Triggered Intr. 2
+        // Bit 5/6  (Reserved)
+       // Bit 7,   Output Type: 0 = Push Pull Bit, 1 = Open Drain
+        write_io_cr(0xE2, reg);
+}
+
+static inline void gpio_bit13(unsigned char reg)
+{
+       // -- General Purpose I/O Bit 1.3 --
+       // Bit 0,  In/Out: 0 = Output, 1 = Input
+       // Bit 1,  Polarity: 0 = No Invert, 1 = Invert
+       // Bit 2,  Group Enable Intr.: 0 = Disable, 1 = Enable
+       // Bit 3,  Function select: 0 = GPI/O, 1 = LED
+        // Bit 4-6 (Reserved)
+       // Bit 7,  Output Type: 0 = Push Pull Bit, 1 = Open Drain
+        write_io_cr(0xE3, reg);
+}
+
+static inline void wdt_timer_units(unsigned char new_units)
+{
+       // -- Watchdog timer units --
+       // Bit 0-6 (Reserved)
+       // Bit 7,  WDT Time-out Value Units Select
+       //         (0 = Minutes, 1 = Seconds)
+        write_io_cr(0xF1, new_units);
+}
+
+static inline void wdt_timeout_value(unsigned char new_timeout)
+{
+       // -- Watchdog Timer Time-out Value --
+       // Bit 0-7 Binary coded units (0=Disabled, 1..255)
+        write_io_cr(0xF2, new_timeout);
+}
+
+static inline void wdt_timer_conf(unsigned char conf)
+{
+       // -- Watchdog timer configuration --
+       // Bit 0   Joystick enable: 0* = No Reset, 1 = Reset WDT upon Gameport I/O
+       // Bit 1   Keyboard enable: 0* = No Reset, 1 = Reset WDT upon KBD Intr.
+       // Bit 2   Mouse enable: 0* = No Reset, 1 = Reset WDT upon Mouse Intr.
+        // Bit 3   Reset the timer
+        //         (Wrong in SMsC documentation? Given as: PowerLED Timout Enabled)
+       // Bit 4-7 WDT Interrupt Mapping: (0000* = Disabled,
+       //            0001=IRQ1, 0010=(Invalid), 0011=IRQ3 to 1111=IRQ15)
+        write_io_cr(0xF3, conf);
+}
+
+static inline void wdt_timer_ctrl(unsigned char reg)
+{
+       // -- Watchdog timer control --
+       // Bit 0   Status Bit: 0 = Timer counting, 1 = Timeout occured
+       // Bit 1   Power LED Toggle: 0 = Disable Toggle, 1 = Toggle at 1 Hz
+       // Bit 2   Force Timeout: 1 = Forces WD timeout event (self-cleaning)
+       // Bit 3   P20 Force Timeout enabled:
+       //          0 = P20 activity does not generate the WD timeout event
+       //          1 = P20 Allows rising edge of P20, from the keyboard
+       //              controller, to force the WD timeout event.
+       // Bit 4   (Reserved)
+       // -- Soft power management --
+       // Bit 5   Stop Counter: 1 = Stop software power down counter
+       //            set via register 0xB8, (self-cleaning)
+       //            (Upon read: 0 = Counter running, 1 = Counter stopped)
+       // Bit 6   Restart Counter: 1 = Restart software power down counter
+       //            set via register 0xB8, (self-cleaning)
+       // Bit 7   SPOFF: 1 = Force software power down (self-cleaning)
+
+        write_io_cr(0xF4, reg);
+}
+
+/* -- Higher level functions ------------------------------------*/
+
+/* initialize watchdog */
+
+static void wb_smsc_wdt_initialize(void)
+{
+        unsigned char old;
+
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // enable the watchdog
+       gpio_bit13(0x08);  // Select pin 80 = LED not GPIO
+       gpio_bit12(0x0A);  // Set pin 79 = WDT not GPIO/Output/Polarity=Invert
+
+       // disable the timeout
+        wdt_timeout_value(0);
+
+       // reset control register
+        wdt_timer_ctrl(0x00);
+
+       // reset configuration register
+       wdt_timer_conf(0x00);
+
+       // read old (timer units) register
+        old = read_io_cr(0xF1) & 0x7F;
+        if (unit == UNIT_SECOND) old |= 0x80; // set to seconds
+
+       // set the watchdog timer units
+        wdt_timer_units(old);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* shutdown the watchdog */
+
+static void wb_smsc_wdt_shutdown(void)
+{
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // disable the watchdog
+        gpio_bit13(0x09);
+        gpio_bit12(0x09);
+
+       // reset watchdog config register
+       wdt_timer_conf(0x00);
+
+       // reset watchdog control register
+        wdt_timer_ctrl(0x00);
+
+       // disable timeout
+        wdt_timeout_value(0x00);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* set timeout => enable watchdog */
+
+static void wb_smsc_wdt_set_timeout(unsigned char new_timeout)
+{
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // set Power LED to blink, if we enable the timeout
+        wdt_timer_ctrl((new_timeout == 0) ? 0x00 : 0x02);
+
+       // set timeout value
+        wdt_timeout_value(new_timeout);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* get timeout */
+
+static unsigned char wb_smsc_wdt_get_timeout(void)
+{
+        unsigned char set_timeout;
+
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+        set_timeout = read_io_cr(0xF2);
+        close_io_config();
+       spin_unlock(&io_lock);
+
+        return set_timeout;
+}
+
+/* disable watchdog */
+
+static void wb_smsc_wdt_disable(void)
+{
+        // set the timeout to 0 to disable the watchdog
+        wb_smsc_wdt_set_timeout(0);
+}
+
+/* enable watchdog by setting the current timeout */
+
+static void wb_smsc_wdt_enable(void)
+{
+        // set the current timeout...
+        wb_smsc_wdt_set_timeout(timeout);
+}
+
+/* reset the timer */
+
+static void wb_smsc_wdt_reset_timer(void)
+{
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // reset the timer
+       wdt_timeout_value(timeout);
+       wdt_timer_conf(0x08);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* return, if the watchdog is enabled (timeout is set...) */
+
+static int wb_smsc_wdt_status(void)
+{
+       return (wb_smsc_wdt_get_timeout() == 0) ? 0 : WDIOF_KEEPALIVEPING;
+}
+
+
+/* -- File operations -------------------------------------------*/
+
+/* open => enable watchdog and set initial timeout */
+
+static int wb_smsc_wdt_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+
+       if (test_and_set_bit(0, &timer_enabled))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Reload and activate timer */
+       wb_smsc_wdt_enable();
+
+       printk(KERN_INFO MODNAME "Watchdog enabled. Timeout set to %d %s.\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)");
+
+       return nonseekable_open(inode, file);
+}
+
+/* close => shut off the timer */
+
+static int wb_smsc_wdt_release(struct inode *inode, struct file *file)
+{
+       /* Shut off the timer. */
+
+       if (expect_close == 42) {
+               wb_smsc_wdt_disable();
+               printk(KERN_INFO MODNAME "Watchdog disabled, sleeping again...\n");
+       } else {
+               printk(KERN_CRIT MODNAME "Unexpected close, not stopping watchdog!\n");
+               wb_smsc_wdt_reset_timer();
+       }
+
+       clear_bit(0, &timer_enabled);
+       expect_close = 0;
+       return 0;
+}
+
+/* write => update the timer to keep the machine alive */
+
+static ssize_t wb_smsc_wdt_write(struct file *file, const char __user *data,
+                                size_t len, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* reset expect flag */
+                       expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               wb_smsc_wdt_reset_timer();
+       }
+       return len;
+}
+
+/* ioctl => control interface */
+
+static int wb_smsc_wdt_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg)
+{
+       int new_timeout;
+
+       union {
+               struct watchdog_info __user *ident;
+               int __user *i;
+       } uarg;
+
+       static struct watchdog_info ident = {
+               .options =              WDIOF_KEEPALIVEPING |
+                                       WDIOF_SETTIMEOUT |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     0,
+               .identity =             "SMsC 37B787 Watchdog"
+       };
+
+       uarg.i = (int __user *)arg;
+
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(uarg.ident, &ident,
+                               sizeof(ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+                       return put_user(wb_smsc_wdt_status(), uarg.i);
+
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, uarg.i);
+
+               case WDIOC_KEEPALIVE:
+                       wb_smsc_wdt_reset_timer();
+                       return 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_timeout, uarg.i))
+                               return -EFAULT;
+
+                       // the API states this is given in secs
+                       if (unit == UNIT_MINUTE)
+                         new_timeout /= 60;
+
+                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       wb_smsc_wdt_set_timeout(timeout);
+
+                       // fall through and return the new timeout...
+
+               case WDIOC_GETTIMEOUT:
+
+                       new_timeout = timeout;
+
+                       if (unit == UNIT_MINUTE)
+                         new_timeout *= 60;
+
+                       return put_user(new_timeout, uarg.i);
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int options, retval = -EINVAL;
+
+                       if (get_user(options, uarg.i))
+                               return -EFAULT;
+
+                       if (options & WDIOS_DISABLECARD) {
+                               wb_smsc_wdt_disable();
+                               retval = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               wb_smsc_wdt_enable();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+       }
+}
+
+/* -- Notifier funtions -----------------------------------------*/
+
+static int wb_smsc_wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+       {
+                // set timeout to 0, to avoid possible race-condition
+               timeout = 0;
+               wb_smsc_wdt_disable();
+       }
+       return NOTIFY_DONE;
+}
+
+/* -- Module's structures ---------------------------------------*/
+
+static const struct file_operations wb_smsc_wdt_fops =
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wb_smsc_wdt_write,
+       .ioctl          = wb_smsc_wdt_ioctl,
+       .open           = wb_smsc_wdt_open,
+       .release        = wb_smsc_wdt_release,
+};
+
+static struct notifier_block wb_smsc_wdt_notifier =
+{
+       .notifier_call  = wb_smsc_wdt_notify_sys,
+};
+
+static struct miscdevice wb_smsc_wdt_miscdev =
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &wb_smsc_wdt_fops,
+};
+
+/* -- Module init functions -------------------------------------*/
+
+/* module's "constructor" */
+
+static int __init wb_smsc_wdt_init(void)
+{
+       int ret;
+
+       spin_lock_init(&io_lock);
+
+       printk("SMsC 37B787 watchdog component driver " VERSION " initialising...\n");
+
+       if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) {
+               printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", IOPORT);
+               ret = -EBUSY;
+               goto out_pnp;
+       }
+
+        // set new maximum, if it's too big
+        if (timeout > MAX_TIMEOUT)
+               timeout = MAX_TIMEOUT;
+
+        // init the watchdog timer
+        wb_smsc_wdt_initialize();
+
+       ret = register_reboot_notifier(&wb_smsc_wdt_notifier);
+       if (ret) {
+               printk(KERN_ERR MODNAME "Unable to register reboot notifier err = %d\n", ret);
+               goto out_io;
+       }
+
+       ret = misc_register(&wb_smsc_wdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR MODNAME "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
+               goto out_rbt;
+       }
+
+       // output info
+       printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)");
+       printk(KERN_INFO MODNAME "Watchdog initialized and sleeping (nowayout=%d)...\n", nowayout);
+
+       // ret = 0
+
+out_clean:
+       return ret;
+
+out_rbt:
+       unregister_reboot_notifier(&wb_smsc_wdt_notifier);
+
+out_io:
+       release_region(IOPORT, IOPORT_SIZE);
+
+out_pnp:
+       goto out_clean;
+}
+
+/* module's "destructor" */
+
+static void __exit wb_smsc_wdt_exit(void)
+{
+       /* Stop the timer before we leave */
+       if (!nowayout)
+       {
+               wb_smsc_wdt_shutdown();
+               printk(KERN_INFO MODNAME "Watchdog disabled.\n");
+       }
+
+       misc_deregister(&wb_smsc_wdt_miscdev);
+       unregister_reboot_notifier(&wb_smsc_wdt_notifier);
+       release_region(IOPORT, IOPORT_SIZE);
+
+       printk("SMsC 37B787 watchdog component driver removed.\n");
+}
+
+module_init(wb_smsc_wdt_init);
+module_exit(wb_smsc_wdt_exit);
+
+MODULE_AUTHOR("Sven Anders <anders@anduras.de>");
+MODULE_DESCRIPTION("Driver for SMsC 37B787 watchdog component (Version " VERSION ")");
+MODULE_LICENSE("GPL");
+
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+#ifdef SMSC_SUPPORT_MINUTES
+module_param(unit, int, 0);
+MODULE_PARM_DESC(unit, "set unit to use, 0=seconds or 1=minutes, default is 0");
+#endif
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c
new file mode 100644 (file)
index 0000000..9c36949
--- /dev/null
@@ -0,0 +1,310 @@
+/*
+ *     SoftDog 0.07:   A Software Watchdog Device
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ *     Software only watchdog driver. Unlike its big brother the WDT501P
+ *     driver this won't always recover a failed machine.
+ *
+ *  03/96: Angelo Haritsis <ah@doc.ic.ac.uk> :
+ *     Modularised.
+ *     Added soft_margin; use upon insmod to change the timer delay.
+ *     NB: uses same minor as wdt (WATCHDOG_MINOR); we could use separate
+ *         minors.
+ *
+ *  19980911 Alan Cox
+ *     Made SMP safe for 2.3.x
+ *
+ *  20011127 Joel Becker (jlbec@evilplan.org>
+ *     Added soft_noboot; Allows testing the softdog trigger without
+ *     requiring a recompile.
+ *     Added WDIOC_GETTIMEOUT and WDIOC_SETTIMOUT.
+ *
+ *  20020530 Joel Becker <joel.becker@oracle.com>
+ *     Added Matt Domsch's nowayout module option.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/jiffies.h>
+
+#include <asm/uaccess.h>
+
+#define PFX "SoftDog: "
+
+#define TIMER_MARGIN   60              /* Default is 60 seconds */
+static int soft_margin = TIMER_MARGIN; /* in seconds */
+module_param(soft_margin, int, 0);
+MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+#ifdef ONLY_TESTING
+static int soft_noboot = 1;
+#else
+static int soft_noboot = 0;
+#endif  /* ONLY_TESTING */
+
+module_param(soft_noboot, int, 0);
+MODULE_PARM_DESC(soft_noboot, "Softdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)");
+
+/*
+ *     Our timer
+ */
+
+static void watchdog_fire(unsigned long);
+
+static struct timer_list watchdog_ticktock =
+               TIMER_INITIALIZER(watchdog_fire, 0, 0);
+static unsigned long driver_open, orphan_timer;
+static char expect_close;
+
+
+/*
+ *     If the timer expires..
+ */
+
+static void watchdog_fire(unsigned long data)
+{
+       if (test_and_clear_bit(0, &orphan_timer))
+               module_put(THIS_MODULE);
+
+       if (soft_noboot)
+               printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n");
+       else
+       {
+               printk(KERN_CRIT PFX "Initiating system reboot.\n");
+               emergency_restart();
+               printk(KERN_CRIT PFX "Reboot didn't ?????\n");
+       }
+}
+
+/*
+ *     Softdog operations
+ */
+
+static int softdog_keepalive(void)
+{
+       mod_timer(&watchdog_ticktock, jiffies+(soft_margin*HZ));
+       return 0;
+}
+
+static int softdog_stop(void)
+{
+       del_timer(&watchdog_ticktock);
+       return 0;
+}
+
+static int softdog_set_heartbeat(int t)
+{
+       if ((t < 0x0001) || (t > 0xFFFF))
+               return -EINVAL;
+
+       soft_margin = t;
+       return 0;
+}
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int softdog_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &driver_open))
+               return -EBUSY;
+       if (!test_and_clear_bit(0, &orphan_timer))
+               __module_get(THIS_MODULE);
+       /*
+        *      Activate timer
+        */
+       softdog_keepalive();
+       return nonseekable_open(inode, file);
+}
+
+static int softdog_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        *      Lock it in if it's a module and we set nowayout
+        */
+       if (expect_close == 42) {
+               softdog_stop();
+               module_put(THIS_MODULE);
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               set_bit(0, &orphan_timer);
+               softdog_keepalive();
+       }
+       clear_bit(0, &driver_open);
+       expect_close = 0;
+       return 0;
+}
+
+static ssize_t softdog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
+{
+       /*
+        *      Refresh the timer.
+        */
+       if(len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != len; i++) {
+                               char c;
+
+                               if (get_user(c, data + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               softdog_keepalive();
+       }
+       return len;
+}
+
+static int softdog_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_margin;
+       static struct watchdog_info ident = {
+               .options =              WDIOF_SETTIMEOUT |
+                                       WDIOF_KEEPALIVEPING |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     0,
+               .identity =             "Software Watchdog",
+       };
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident,
+                               sizeof(ident)) ? -EFAULT : 0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       softdog_keepalive();
+                       return 0;
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_margin, p))
+                               return -EFAULT;
+                       if (softdog_set_heartbeat(new_margin))
+                               return -EINVAL;
+                       softdog_keepalive();
+                       /* Fall */
+               case WDIOC_GETTIMEOUT:
+                       return put_user(soft_margin, p);
+       }
+}
+
+/*
+ *     Notifier for system down
+ */
+
+static int softdog_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if(code==SYS_DOWN || code==SYS_HALT) {
+               /* Turn the WDT off */
+               softdog_stop();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations softdog_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = softdog_write,
+       .ioctl          = softdog_ioctl,
+       .open           = softdog_open,
+       .release        = softdog_release,
+};
+
+static struct miscdevice softdog_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &softdog_fops,
+};
+
+static struct notifier_block softdog_notifier = {
+       .notifier_call  = softdog_notify_sys,
+};
+
+static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 initialized. soft_noboot=%d soft_margin=%d sec (nowayout= %d)\n";
+
+static int __init watchdog_init(void)
+{
+       int ret;
+
+       /* Check that the soft_margin value is within it's range ; if not reset to the default */
+       if (softdog_set_heartbeat(soft_margin)) {
+               softdog_set_heartbeat(TIMER_MARGIN);
+               printk(KERN_INFO PFX "soft_margin value must be 0<soft_margin<65536, using %d\n",
+                       TIMER_MARGIN);
+       }
+
+       ret = register_reboot_notifier(&softdog_notifier);
+       if (ret) {
+               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               return ret;
+       }
+
+       ret = misc_register(&softdog_miscdev);
+       if (ret) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               unregister_reboot_notifier(&softdog_notifier);
+               return ret;
+       }
+
+       printk(banner, soft_noboot, soft_margin, nowayout);
+
+       return 0;
+}
+
+static void __exit watchdog_exit(void)
+{
+       misc_deregister(&softdog_miscdev);
+       unregister_reboot_notifier(&softdog_notifier);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_exit);
+
+MODULE_AUTHOR("Alan Cox");
+MODULE_DESCRIPTION("Software Watchdog Device Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
new file mode 100644 (file)
index 0000000..df33b3b
--- /dev/null
@@ -0,0 +1,390 @@
+/*
+ *     w83627hf/thf WDT driver
+ *
+ *     (c) Copyright 2007 Vlad Drukker <vlad@storewiz.com>
+ *             added support for W83627THF.
+ *
+ *     (c) Copyright 2003,2007 Pádraig Brady <P@draigBrady.com>
+ *
+ *     Based on advantechwdt.c which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define WATCHDOG_NAME "w83627hf/thf/hg WDT"
+#define PFX WATCHDOG_NAME ": "
+#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
+
+static unsigned long wdt_is_open;
+static char expect_close;
+static spinlock_t io_lock;
+
+/* You must set this - there is no sane way to probe for this board. */
+static int wdt_io = 0x2E;
+module_param(wdt_io, int, 0);
+MODULE_PARM_DESC(wdt_io, "w83627hf/thf WDT io port (default 0x2E)");
+
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Kernel methods.
+ */
+
+#define WDT_EFER (wdt_io+0)   /* Extended Function Enable Registers */
+#define WDT_EFIR (wdt_io+0)   /* Extended Function Index Register (same as EFER) */
+#define WDT_EFDR (WDT_EFIR+1) /* Extended Function Data Register */
+
+static void
+w83627hf_select_wd_register(void)
+{
+       unsigned char c;
+       outb_p(0x87, WDT_EFER); /* Enter extended function mode */
+       outb_p(0x87, WDT_EFER); /* Again according to manual */
+
+       outb(0x20, WDT_EFER);   /* check chip version   */
+       c = inb(WDT_EFDR);
+       if (c == 0x82) {        /* W83627THF            */
+               outb_p(0x2b, WDT_EFER); /* select GPIO3 */
+               c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */
+               outb_p(0x2b, WDT_EFER);
+               outb_p(c, WDT_EFDR);    /* set GPIO3 to WDT0 */
+       }
+
+       outb_p(0x07, WDT_EFER); /* point to logical device number reg */
+       outb_p(0x08, WDT_EFDR); /* select logical device 8 (GPIO2) */
+       outb_p(0x30, WDT_EFER); /* select CR30 */
+       outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
+}
+
+static void
+w83627hf_unselect_wd_register(void)
+{
+       outb_p(0xAA, WDT_EFER); /* Leave extended function mode */
+}
+
+/* tyan motherboards seem to set F5 to 0x4C ?
+ * So explicitly init to appropriate value. */
+static void
+w83627hf_init(void)
+{
+       unsigned char t;
+
+       w83627hf_select_wd_register();
+
+       outb_p(0xF6, WDT_EFER); /* Select CRF6 */
+       t=inb_p(WDT_EFDR);      /* read CRF6 */
+       if (t != 0) {
+               printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
+               outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
+       }
+
+       outb_p(0xF5, WDT_EFER); /* Select CRF5 */
+       t=inb_p(WDT_EFDR);      /* read CRF5 */
+       t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */
+       outb_p(t, WDT_EFDR);    /* Write back to CRF5 */
+
+       outb_p(0xF7, WDT_EFER); /* Select CRF7 */
+       t=inb_p(WDT_EFDR);      /* read CRF7 */
+       t&=~0xC0;               /* disable keyboard & mouse turning off watchdog */
+       outb_p(t, WDT_EFDR);    /* Write back to CRF7 */
+
+       w83627hf_unselect_wd_register();
+}
+
+static void
+wdt_ctrl(int timeout)
+{
+       spin_lock(&io_lock);
+
+       w83627hf_select_wd_register();
+
+       outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
+       outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */
+
+       w83627hf_unselect_wd_register();
+
+       spin_unlock(&io_lock);
+}
+
+static int
+wdt_ping(void)
+{
+       wdt_ctrl(timeout);
+       return 0;
+}
+
+static int
+wdt_disable(void)
+{
+       wdt_ctrl(0);
+       return 0;
+}
+
+static int
+wdt_set_heartbeat(int t)
+{
+       if ((t < 1) || (t > 255))
+               return -EINVAL;
+
+       timeout = t;
+       return 0;
+}
+
+static ssize_t
+wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               wdt_ping();
+       }
+       return count;
+}
+
+static int
+wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+         unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_timeout;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "W83627HF WDT",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+         if (copy_to_user(argp, &ident, sizeof(ident)))
+           return -EFAULT;
+         break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+         return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+         wdt_ping();
+         break;
+
+       case WDIOC_SETTIMEOUT:
+         if (get_user(new_timeout, p))
+                 return -EFAULT;
+         if (wdt_set_heartbeat(new_timeout))
+                 return -EINVAL;
+         wdt_ping();
+         /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+         return put_user(timeout, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+         int options, retval = -EINVAL;
+
+         if (get_user(options, p))
+           return -EFAULT;
+
+         if (options & WDIOS_DISABLECARD) {
+           wdt_disable();
+           retval = 0;
+         }
+
+         if (options & WDIOS_ENABLECARD) {
+           wdt_ping();
+           retval = 0;
+         }
+
+         return retval;
+       }
+
+       default:
+         return -ENOTTY;
+       }
+       return 0;
+}
+
+static int
+wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+       /*
+        *      Activate
+        */
+
+       wdt_ping();
+       return nonseekable_open(inode, file);
+}
+
+static int
+wdt_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               wdt_disable();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               wdt_ping();
+       }
+       expect_close = 0;
+       clear_bit(0, &wdt_is_open);
+       return 0;
+}
+
+/*
+ *     Notifier for system down
+ */
+
+static int
+wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT) {
+               /* Turn the WDT off */
+               wdt_disable();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdt_write,
+       .ioctl          = wdt_ioctl,
+       .open           = wdt_open,
+       .release        = wdt_close,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &wdt_fops,
+};
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier = {
+       .notifier_call = wdt_notify_sys,
+};
+
+static int __init
+wdt_init(void)
+{
+       int ret;
+
+       spin_lock_init(&io_lock);
+
+       printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG Super I/O chip initialising.\n");
+
+       if (wdt_set_heartbeat(timeout)) {
+               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
+               printk (KERN_INFO PFX "timeout value must be 1<=timeout<=255, using %d\n",
+                       WATCHDOG_TIMEOUT);
+       }
+
+       if (!request_region(wdt_io, 1, WATCHDOG_NAME)) {
+               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       wdt_io);
+               ret = -EIO;
+               goto out;
+       }
+
+       w83627hf_init();
+
+       ret = register_reboot_notifier(&wdt_notifier);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               goto unreg_regions;
+       }
+
+       ret = misc_register(&wdt_miscdev);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto unreg_reboot;
+       }
+
+       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+out:
+       return ret;
+unreg_reboot:
+       unregister_reboot_notifier(&wdt_notifier);
+unreg_regions:
+       release_region(wdt_io, 1);
+       goto out;
+}
+
+static void __exit
+wdt_exit(void)
+{
+       misc_deregister(&wdt_miscdev);
+       unregister_reboot_notifier(&wdt_notifier);
+       release_region(wdt_io,1);
+}
+
+module_init(wdt_init);
+module_exit(wdt_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Pádraig Brady <P@draigBrady.com>");
+MODULE_DESCRIPTION("w83627hf/thf WDT driver");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c
new file mode 100644 (file)
index 0000000..d9e821d
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ *     w83697hf/hg WDT driver
+ *
+ *     (c) Copyright 2006 Samuel Tardieu <sam@rfc1149.net>
+ *     (c) Copyright 2006 Marcus Junker <junker@anduras.de>
+ *
+ *     Based on w83627hf_wdt.c which is based on advantechwdt.c
+ *     which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 2003 Pádraig Brady <P@draigBrady.com>
+ *
+ *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Marcus Junker nor ANDURAS AG admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define WATCHDOG_NAME "w83697hf/hg WDT"
+#define PFX WATCHDOG_NAME ": "
+#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
+
+static unsigned long wdt_is_open;
+static char expect_close;
+static spinlock_t io_lock;
+
+/* You must set this - there is no sane way to probe for this board. */
+static int wdt_io = 0x2e;
+module_param(wdt_io, int, 0);
+MODULE_PARM_DESC(wdt_io, "w83697hf/hg WDT io port (default 0x2e, 0 = autodetect)");
+
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ *     Kernel methods.
+ */
+
+#define W83697HF_EFER (wdt_io+0)       /* Extended Function Enable Register */
+#define W83697HF_EFIR (wdt_io+0)       /* Extended Function Index Register (same as EFER) */
+#define W83697HF_EFDR (wdt_io+1)       /* Extended Function Data Register */
+
+static inline void
+w83697hf_unlock(void)
+{
+       outb_p(0x87, W83697HF_EFER);    /* Enter extended function mode */
+       outb_p(0x87, W83697HF_EFER);    /* Again according to manual */
+}
+
+static inline void
+w83697hf_lock(void)
+{
+       outb_p(0xAA, W83697HF_EFER);    /* Leave extended function mode */
+}
+
+/*
+ *     The three functions w83697hf_get_reg(), w83697hf_set_reg() and
+ *     w83697hf_write_timeout() must be called with the device unlocked.
+ */
+
+static unsigned char
+w83697hf_get_reg(unsigned char reg)
+{
+       outb_p(reg, W83697HF_EFIR);
+       return inb_p(W83697HF_EFDR);
+}
+
+static void
+w83697hf_set_reg(unsigned char reg, unsigned char data)
+{
+       outb_p(reg, W83697HF_EFIR);
+       outb_p(data, W83697HF_EFDR);
+}
+
+static void
+w83697hf_write_timeout(int timeout)
+{
+       w83697hf_set_reg(0xF4, timeout);        /* Write Timeout counter to CRF4 */
+}
+
+static void
+w83697hf_select_wdt(void)
+{
+       w83697hf_unlock();
+       w83697hf_set_reg(0x07, 0x08);   /* Switch to logic device 8 (GPIO2) */
+}
+
+static inline void
+w83697hf_deselect_wdt(void)
+{
+       w83697hf_lock();
+}
+
+static void
+w83697hf_init(void)
+{
+       unsigned char bbuf;
+
+       w83697hf_select_wdt();
+
+       bbuf = w83697hf_get_reg(0x29);
+       bbuf &= ~0x60;
+       bbuf |= 0x20;
+       w83697hf_set_reg(0x29, bbuf);   /* Set pin 119 to WDTO# mode (= CR29, WDT0) */
+
+       bbuf = w83697hf_get_reg(0xF3);
+       bbuf &= ~0x04;
+       w83697hf_set_reg(0xF3, bbuf);   /* Count mode is seconds */
+
+       w83697hf_deselect_wdt();
+}
+
+static int
+wdt_ping(void)
+{
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       w83697hf_write_timeout(timeout);
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+       return 0;
+}
+
+static int
+wdt_enable(void)
+{
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       w83697hf_write_timeout(timeout);
+       w83697hf_set_reg(0x30, 1);      /* Enable timer */
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+       return 0;
+}
+
+static int
+wdt_disable(void)
+{
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       w83697hf_set_reg(0x30, 0);      /* Disable timer */
+       w83697hf_write_timeout(0);
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+       return 0;
+}
+
+static int
+wdt_set_heartbeat(int t)
+{
+       if ((t < 1) || (t > 255))
+               return -EINVAL;
+
+       timeout = t;
+       return 0;
+}
+
+static ssize_t
+wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               wdt_ping();
+       }
+       return count;
+}
+
+static int
+wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+         unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_timeout;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "W83697HF WDT",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+               wdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (wdt_set_heartbeat(new_timeout))
+                       return -EINVAL;
+               wdt_ping();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
+
+               if (get_user(options, p))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       wdt_disable();
+                       retval = 0;
+               }
+
+               if (options & WDIOS_ENABLECARD) {
+                       wdt_enable();
+                       retval = 0;
+               }
+
+               return retval;
+       }
+
+       default:
+               return -ENOTTY;
+       }
+       return 0;
+}
+
+static int
+wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+       /*
+        *      Activate
+        */
+
+       wdt_enable();
+       return nonseekable_open(inode, file);
+}
+
+static int
+wdt_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               wdt_disable();
+       } else {
+               printk (KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               wdt_ping();
+       }
+       expect_close = 0;
+       clear_bit(0, &wdt_is_open);
+       return 0;
+}
+
+/*
+ *     Notifier for system down
+ */
+
+static int
+wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT) {
+               /* Turn the WDT off */
+               wdt_disable();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdt_write,
+       .ioctl          = wdt_ioctl,
+       .open           = wdt_open,
+       .release        = wdt_close,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &wdt_fops,
+};
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier = {
+       .notifier_call = wdt_notify_sys,
+};
+
+static int
+w83697hf_check_wdt(void)
+{
+       if (!request_region(wdt_io, 2, WATCHDOG_NAME)) {
+               printk (KERN_ERR PFX "I/O address 0x%x already in use\n", wdt_io);
+               return -EIO;
+       }
+
+       printk (KERN_DEBUG PFX "Looking for watchdog at address 0x%x\n", wdt_io);
+       w83697hf_unlock();
+       if (w83697hf_get_reg(0x20) == 0x60) {
+               printk (KERN_INFO PFX "watchdog found at address 0x%x\n", wdt_io);
+               w83697hf_lock();
+               return 0;
+       }
+       w83697hf_lock();        /* Reprotect in case it was a compatible device */
+
+       printk (KERN_INFO PFX "watchdog not found at address 0x%x\n", wdt_io);
+       release_region(wdt_io, 2);
+       return -EIO;
+}
+
+static int w83697hf_ioports[] = { 0x2e, 0x4e, 0x00 };
+
+static int __init
+wdt_init(void)
+{
+       int ret, i, found = 0;
+
+       spin_lock_init(&io_lock);
+
+       printk (KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n");
+
+       if (wdt_io == 0) {
+               /* we will autodetect the W83697HF/HG watchdog */
+               for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) {
+                       wdt_io = w83697hf_ioports[i];
+                       if (!w83697hf_check_wdt())
+                               found++;
+               }
+       } else {
+               if (!w83697hf_check_wdt())
+                       found++;
+       }
+
+       if (!found) {
+               printk (KERN_ERR PFX "No W83697HF/HG could be found\n");
+               ret = -EIO;
+               goto out;
+       }
+
+       w83697hf_init();
+       wdt_disable();  /* Disable watchdog until first use */
+
+       if (wdt_set_heartbeat(timeout)) {
+               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
+               printk (KERN_INFO PFX "timeout value must be 1<=timeout<=255, using %d\n",
+                       WATCHDOG_TIMEOUT);
+       }
+
+       ret = register_reboot_notifier(&wdt_notifier);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               goto unreg_regions;
+       }
+
+       ret = misc_register(&wdt_miscdev);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto unreg_reboot;
+       }
+
+       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+out:
+       return ret;
+unreg_reboot:
+       unregister_reboot_notifier(&wdt_notifier);
+unreg_regions:
+       release_region(wdt_io, 2);
+       goto out;
+}
+
+static void __exit
+wdt_exit(void)
+{
+       misc_deregister(&wdt_miscdev);
+       unregister_reboot_notifier(&wdt_notifier);
+       release_region(wdt_io, 2);
+}
+
+module_init(wdt_init);
+module_exit(wdt_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, Samuel Tardieu <sam@rfc1149.net>");
+MODULE_DESCRIPTION("w83697hf/hg WDT driver");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
new file mode 100644 (file)
index 0000000..3c88fe1
--- /dev/null
@@ -0,0 +1,415 @@
+/*
+ *     W83877F Computer Watchdog Timer driver
+ *
+ *      Based on acquirewdt.c by Alan Cox,
+ *           and sbc60xxwdt.c by Jakob Oestergaard <jakob@unthought.net>
+ *
+ *     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 authors do NOT admit liability nor provide warranty for
+ *     any of this software. This material is provided "AS-IS" in
+ *      the hope that it may be useful for others.
+ *
+ *     (c) Copyright 2001    Scott Jennings <linuxdrivers@oro.net>
+ *
+ *           4/19 - 2001      [Initial revision]
+ *           9/27 - 2001      Added spinlocking
+ *           4/12 - 2002      [rob@osinvestor.com] Eliminate extra comments
+ *                            Eliminate fop_read
+ *                            Eliminate extra spin_unlock
+ *                            Added KERN_* tags to printks
+ *                            add CONFIG_WATCHDOG_NOWAYOUT support
+ *                            fix possible wdt_is_open race
+ *                            changed watchdog_info to correctly reflect what the driver offers
+ *                            added WDIOC_GETSTATUS, WDIOC_GETBOOTSTATUS, WDIOC_SETTIMEOUT,
+ *                            WDIOC_GETTIMEOUT, and WDIOC_SETOPTIONS ioctls
+ *           09/8 - 2003      [wim@iguana.be] cleanup of trailing spaces
+ *                            added extra printk's for startup problems
+ *                            use module_param
+ *                            made timeout (the emulated heartbeat) a module_param
+ *                            made the keepalive ping an internal subroutine
+ *
+ *  This WDT driver is different from most other Linux WDT
+ *  drivers in that the driver will ping the watchdog by itself,
+ *  because this particular WDT has a very short timeout (1.6
+ *  seconds) and it would be insane to count on any userspace
+ *  daemon always getting scheduled within that time frame.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/timer.h>
+#include <linux/jiffies.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define OUR_NAME "w83877f_wdt"
+#define PFX OUR_NAME ": "
+
+#define ENABLE_W83877F_PORT 0x3F0
+#define ENABLE_W83877F 0x87
+#define DISABLE_W83877F 0xAA
+#define WDT_PING 0x443
+#define WDT_REGISTER 0x14
+#define WDT_ENABLE 0x9C
+#define WDT_DISABLE 0x8C
+
+/*
+ * The W83877F seems to be fixed at 1.6s timeout (at least on the
+ * EMACS PC-104 board I'm using). If we reset the watchdog every
+ * ~250ms we should be safe.  */
+
+#define WDT_INTERVAL (HZ/4+1)
+
+/*
+ * We must not require too good response from the userspace daemon.
+ * Here we require the userspace daemon to send us a heartbeat
+ * char to /dev/watchdog every 30 seconds.
+ */
+
+#define WATCHDOG_TIMEOUT 30            /* 30 sec default timeout */
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ to get seconds to wait for a ping */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
+
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static void wdt_timer_ping(unsigned long);
+static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
+static unsigned long next_heartbeat;
+static unsigned long wdt_is_open;
+static char wdt_expect_close;
+static spinlock_t wdt_spinlock;
+
+/*
+ *     Whack the dog
+ */
+
+static void wdt_timer_ping(unsigned long data)
+{
+       /* If we got a heartbeat pulse within the WDT_US_INTERVAL
+        * we agree to ping the WDT
+        */
+       if(time_before(jiffies, next_heartbeat))
+       {
+               /* Ping the WDT */
+               spin_lock(&wdt_spinlock);
+
+               /* Ping the WDT by reading from WDT_PING */
+               inb_p(WDT_PING);
+
+               /* Re-set the timer interval */
+               mod_timer(&timer, jiffies + WDT_INTERVAL);
+
+               spin_unlock(&wdt_spinlock);
+
+       } else {
+               printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
+       }
+}
+
+/*
+ * Utility routines
+ */
+
+static void wdt_change(int writeval)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&wdt_spinlock, flags);
+
+       /* buy some time */
+       inb_p(WDT_PING);
+
+       /* make W83877F available */
+       outb_p(ENABLE_W83877F,  ENABLE_W83877F_PORT);
+       outb_p(ENABLE_W83877F,  ENABLE_W83877F_PORT);
+
+       /* enable watchdog */
+       outb_p(WDT_REGISTER,    ENABLE_W83877F_PORT);
+       outb_p(writeval,        ENABLE_W83877F_PORT+1);
+
+       /* lock the W8387FF away */
+       outb_p(DISABLE_W83877F, ENABLE_W83877F_PORT);
+
+       spin_unlock_irqrestore(&wdt_spinlock, flags);
+}
+
+static void wdt_startup(void)
+{
+       next_heartbeat = jiffies + (timeout * HZ);
+
+       /* Start the timer */
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
+
+       wdt_change(WDT_ENABLE);
+
+       printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
+}
+
+static void wdt_turnoff(void)
+{
+       /* Stop the timer */
+       del_timer(&timer);
+
+       wdt_change(WDT_DISABLE);
+
+       printk(KERN_INFO PFX "Watchdog timer is now disabled...\n");
+}
+
+static void wdt_keepalive(void)
+{
+       /* user land ping */
+       next_heartbeat = jiffies + (timeout * HZ);
+}
+
+/*
+ * /dev/watchdog handling
+ */
+
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if(count)
+       {
+               if (!nowayout)
+               {
+                       size_t ofs;
+
+                       /* note: just in case someone wrote the magic character
+                        * five months ago... */
+                       wdt_expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for(ofs = 0; ofs != count; ofs++)
+                       {
+                               char c;
+                               if (get_user(c, buf + ofs))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       wdt_expect_close = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should restart timer */
+               wdt_keepalive();
+       }
+       return count;
+}
+
+static int fop_open(struct inode * inode, struct file * file)
+{
+       /* Just in case we're already talking to someone... */
+       if(test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+
+       /* Good, fire up the show */
+       wdt_startup();
+       return nonseekable_open(inode, file);
+}
+
+static int fop_close(struct inode * inode, struct file * file)
+{
+       if(wdt_expect_close == 42)
+               wdt_turnoff();
+       else {
+               del_timer(&timer);
+               printk(KERN_CRIT PFX "device file closed unexpectedly. Will not stop the WDT!\n");
+       }
+       clear_bit(0, &wdt_is_open);
+       wdt_expect_close = 0;
+       return 0;
+}
+
+static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident=
+       {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "W83877F",
+       };
+
+       switch(cmd)
+       {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+               case WDIOC_GETSTATUS:
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       wdt_keepalive();
+                       return 0;
+               case WDIOC_SETOPTIONS:
+               {
+                       int new_options, retval = -EINVAL;
+
+                       if(get_user(new_options, p))
+                               return -EFAULT;
+
+                       if(new_options & WDIOS_DISABLECARD) {
+                               wdt_turnoff();
+                               retval = 0;
+                       }
+
+                       if(new_options & WDIOS_ENABLECARD) {
+                               wdt_startup();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+               case WDIOC_SETTIMEOUT:
+               {
+                       int new_timeout;
+
+                       if(get_user(new_timeout, p))
+                               return -EFAULT;
+
+                       if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       wdt_keepalive();
+                       /* Fall through */
+               }
+               case WDIOC_GETTIMEOUT:
+                       return put_user(timeout, p);
+       }
+}
+
+static const struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = fop_write,
+       .open           = fop_open,
+       .release        = fop_close,
+       .ioctl          = fop_ioctl,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &wdt_fops,
+};
+
+/*
+ *     Notifier for system down
+ */
+
+static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if(code==SYS_DOWN || code==SYS_HALT)
+               wdt_turnoff();
+       return NOTIFY_DONE;
+}
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier=
+{
+       .notifier_call = wdt_notify_sys,
+};
+
+static void __exit w83877f_wdt_unload(void)
+{
+       wdt_turnoff();
+
+       /* Deregister */
+       misc_deregister(&wdt_miscdev);
+
+       unregister_reboot_notifier(&wdt_notifier);
+       release_region(WDT_PING,1);
+       release_region(ENABLE_W83877F_PORT,2);
+}
+
+static int __init w83877f_wdt_init(void)
+{
+       int rc = -EBUSY;
+
+       spin_lock_init(&wdt_spinlock);
+
+       if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
+       {
+               timeout = WATCHDOG_TIMEOUT;
+               printk(KERN_INFO PFX "timeout value must be 1<=x<=3600, using %d\n",
+                       timeout);
+       }
+
+       if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT"))
+       {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       ENABLE_W83877F_PORT);
+               rc = -EIO;
+               goto err_out;
+       }
+
+       if (!request_region(WDT_PING, 1, "W8387FF WDT"))
+       {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       WDT_PING);
+               rc = -EIO;
+               goto err_out_region1;
+       }
+
+       rc = misc_register(&wdt_miscdev);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       wdt_miscdev.minor, rc);
+               goto err_out_region2;
+       }
+
+       rc = register_reboot_notifier(&wdt_notifier);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
+               goto err_out_miscdev;
+       }
+
+       printk(KERN_INFO PFX "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+       return 0;
+
+err_out_miscdev:
+       misc_deregister(&wdt_miscdev);
+err_out_region2:
+       release_region(WDT_PING,1);
+err_out_region1:
+       release_region(ENABLE_W83877F_PORT,2);
+err_out:
+       return rc;
+}
+
+module_init(w83877f_wdt_init);
+module_exit(w83877f_wdt_unload);
+
+MODULE_AUTHOR("Scott and Bill Jennings");
+MODULE_DESCRIPTION("Driver for watchdog timer in w83877f chip");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c
new file mode 100644 (file)
index 0000000..1579684
--- /dev/null
@@ -0,0 +1,542 @@
+/*
+ *     W83977F Watchdog Timer Driver for Winbond W83977F I/O Chip
+ *
+ *     (c) Copyright 2005  Jose Goncalves <jose.goncalves@inov.pt>
+ *
+ *      Based on w83877f_wdt.c by Scott Jennings,
+ *           and wdt977.c by Woody Suwalski
+ *
+ *                     -----------------------
+ *
+ *     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.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/watchdog.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+#define WATCHDOG_VERSION  "1.00"
+#define WATCHDOG_NAME     "W83977F WDT"
+#define PFX WATCHDOG_NAME ": "
+#define DRIVER_VERSION    WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
+
+#define IO_INDEX_PORT     0x3F0
+#define IO_DATA_PORT      (IO_INDEX_PORT+1)
+
+#define UNLOCK_DATA       0x87
+#define LOCK_DATA         0xAA
+#define DEVICE_REGISTER   0x07
+
+#define        DEFAULT_TIMEOUT   45            /* default timeout in seconds */
+
+static int timeout = DEFAULT_TIMEOUT;
+static int timeoutW;                   /* timeout in watchdog counter units */
+static unsigned long timer_alive;
+static int testmode;
+static char expect_close;
+static spinlock_t spinlock;
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (15..7635), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")");
+module_param(testmode, int, 0);
+MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * Start the watchdog
+ */
+
+static int wdt_start(void)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* Unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+
+       /*
+        * Select device Aux2 (device=8) to set watchdog regs F2, F3 and F4.
+        * F2 has the timeout in watchdog counter units.
+        * F3 is set to enable watchdog LED blink at timeout.
+        * F4 is used to just clear the TIMEOUT'ed state (bit 0).
+        */
+       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
+       outb_p(0x08,IO_DATA_PORT);
+       outb_p(0xF2,IO_INDEX_PORT);
+       outb_p(timeoutW,IO_DATA_PORT);
+       outb_p(0xF3,IO_INDEX_PORT);
+       outb_p(0x08,IO_DATA_PORT);
+       outb_p(0xF4,IO_INDEX_PORT);
+       outb_p(0x00,IO_DATA_PORT);
+
+       /* Set device Aux2 active */
+       outb_p(0x30,IO_INDEX_PORT);
+       outb_p(0x01,IO_DATA_PORT);
+
+       /* 
+        * Select device Aux1 (dev=7) to set GP16 as the watchdog output
+        * (in reg E6) and GP13 as the watchdog LED output (in reg E3).
+        * Map GP16 at pin 119.
+        * In test mode watch the bit 0 on F4 to indicate "triggered" or
+        * check watchdog LED on SBC.
+        */
+       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
+       outb_p(0x07,IO_DATA_PORT);
+       if (!testmode)
+       {
+               unsigned pin_map;
+
+               outb_p(0xE6,IO_INDEX_PORT);
+               outb_p(0x0A,IO_DATA_PORT);
+               outb_p(0x2C,IO_INDEX_PORT);
+               pin_map = inb_p(IO_DATA_PORT);
+               pin_map |= 0x10;
+               pin_map &= ~(0x20);
+               outb_p(0x2C,IO_INDEX_PORT);
+               outb_p(pin_map,IO_DATA_PORT);
+       }
+       outb_p(0xE3,IO_INDEX_PORT);
+       outb_p(0x08,IO_DATA_PORT);
+
+       /* Set device Aux1 active */
+       outb_p(0x30,IO_INDEX_PORT);
+       outb_p(0x01,IO_DATA_PORT);
+
+       /* Lock the SuperIO chip */
+       outb_p(LOCK_DATA,IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+
+       printk(KERN_INFO PFX "activated.\n");
+
+       return 0;
+}
+
+/*
+ * Stop the watchdog
+ */
+
+static int wdt_stop(void)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* Unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+
+       /* 
+        * Select device Aux2 (device=8) to set watchdog regs F2, F3 and F4.
+        * F2 is reset to its default value (watchdog timer disabled).
+        * F3 is reset to its default state.
+        * F4 clears the TIMEOUT'ed state (bit 0) - back to default.
+        */
+       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
+       outb_p(0x08,IO_DATA_PORT);
+       outb_p(0xF2,IO_INDEX_PORT);
+       outb_p(0xFF,IO_DATA_PORT);
+       outb_p(0xF3,IO_INDEX_PORT);
+       outb_p(0x00,IO_DATA_PORT);
+       outb_p(0xF4,IO_INDEX_PORT);
+       outb_p(0x00,IO_DATA_PORT);
+       outb_p(0xF2,IO_INDEX_PORT);
+       outb_p(0x00,IO_DATA_PORT);
+
+       /*
+        * Select device Aux1 (dev=7) to set GP16 (in reg E6) and 
+        * Gp13 (in reg E3) as inputs.
+        */
+       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
+       outb_p(0x07,IO_DATA_PORT);
+       if (!testmode)
+       {
+               outb_p(0xE6,IO_INDEX_PORT);
+               outb_p(0x01,IO_DATA_PORT);
+       }
+       outb_p(0xE3,IO_INDEX_PORT);
+       outb_p(0x01,IO_DATA_PORT);
+
+       /* Lock the SuperIO chip */
+       outb_p(LOCK_DATA,IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+
+       printk(KERN_INFO PFX "shutdown.\n");
+
+       return 0;
+}
+
+/*
+ * Send a keepalive ping to the watchdog
+ * This is done by simply re-writing the timeout to reg. 0xF2
+ */
+
+static int wdt_keepalive(void)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* Unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+
+       /* Select device Aux2 (device=8) to kick watchdog reg F2 */
+       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
+       outb_p(0x08,IO_DATA_PORT);
+       outb_p(0xF2,IO_INDEX_PORT);
+       outb_p(timeoutW,IO_DATA_PORT);
+
+       /* Lock the SuperIO chip */
+       outb_p(LOCK_DATA,IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+
+       return 0;
+}
+
+/*
+ * Set the watchdog timeout value
+ */
+
+static int wdt_set_timeout(int t)
+{
+       int tmrval;
+
+       /*
+        * Convert seconds to watchdog counter time units, rounding up.
+        * On PCM-5335 watchdog units are 30 seconds/step with 15 sec startup 
+        * value. This information is supplied in the PCM-5335 manual and was
+        * checked by me on a real board. This is a bit strange because W83977f
+        * datasheet says counter unit is in minutes!
+        */
+       if (t < 15)
+               return -EINVAL;
+
+       tmrval = ((t + 15) + 29) / 30;
+
+       if (tmrval > 255)
+               return -EINVAL;
+
+       /*
+        * timeout is the timeout in seconds, 
+        * timeoutW is the timeout in watchdog counter units.
+        */
+       timeoutW = tmrval;
+       timeout = (timeoutW * 30) - 15;
+       return 0;
+}
+
+/*
+ * Get the watchdog status
+ */
+
+static int wdt_get_status(int *status)
+{
+       int new_status;
+       unsigned long flags;
+
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* Unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA,IO_INDEX_PORT);
+
+       /* Select device Aux2 (device=8) to read watchdog reg F4 */
+       outb_p(DEVICE_REGISTER,IO_INDEX_PORT);
+       outb_p(0x08,IO_DATA_PORT);
+       outb_p(0xF4,IO_INDEX_PORT);
+       new_status = inb_p(IO_DATA_PORT);
+
+       /* Lock the SuperIO chip */
+       outb_p(LOCK_DATA,IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+
+       *status = 0;
+       if (new_status & 1)
+               *status |= WDIOF_CARDRESET;
+
+       return 0;
+}
+
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int wdt_open(struct inode *inode, struct file *file)
+{
+       /* If the watchdog is alive we don't need to start it again */
+       if( test_and_set_bit(0, &timer_alive) )
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+static int wdt_release(struct inode *inode, struct file *file)
+{
+       /*
+        * Shut off the timer.
+        * Lock it in if it's a module and we set nowayout
+        */
+       if (expect_close == 42)
+       {
+               wdt_stop();
+               clear_bit(0, &timer_alive);
+       } else {
+               wdt_keepalive();
+               printk(KERN_CRIT PFX "unexpected close, not stopping watchdog!\n");
+       }
+       expect_close = 0;
+       return 0;
+}
+
+/*
+ *      wdt_write:
+ *      @file: file handle to the watchdog
+ *      @buf: buffer to write (unused as data does not matter here
+ *      @count: count of bytes
+ *      @ppos: pointer to the position to write. No seeks allowed
+ *
+ *      A write to a watchdog device is defined as a keepalive signal. Any
+ *      write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t wdt_write(struct file *file, const char __user *buf,
+                           size_t count, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if(count)
+       {
+               if (!nowayout)
+               {
+                       size_t ofs;
+
+                       /* note: just in case someone wrote the magic character long ago */
+                       expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for(ofs = 0; ofs != count; ofs++)
+                       {
+                               char c;
+                               if (get_user(c, buf + ofs))
+                                       return -EFAULT;
+                               if (c == 'V') {
+                                       expect_close = 42;
+                               }
+                       }
+               }
+
+               /* someone wrote to us, we should restart timer */
+               wdt_keepalive();
+       }
+       return count;
+}
+
+/*
+ *      wdt_ioctl:
+ *      @inode: inode of the device
+ *      @file: file handle to the device
+ *      @cmd: watchdog command
+ *      @arg: argument pointer
+ *
+ *      The watchdog API defines a common set of functions for all watchdogs
+ *      according to their available features.
+ */
+
+static struct watchdog_info ident = {
+       .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
+       .firmware_version =     1,
+       .identity = WATCHDOG_NAME,
+};
+
+static int wdt_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       int status;
+       int new_options, retval = -EINVAL;
+       int new_timeout;
+       union {
+               struct watchdog_info __user *ident;
+               int __user *i;
+       } uarg;
+
+       uarg.i = (int __user *)arg;
+
+       switch(cmd)
+       {
+       default:
+               return -ENOTTY;
+
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(uarg.ident, &ident, sizeof(ident)) ? -EFAULT : 0;
+
+       case WDIOC_GETSTATUS:
+               wdt_get_status(&status);
+               return put_user(status, uarg.i);
+
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, uarg.i);
+
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
+
+       case WDIOC_SETOPTIONS:
+               if (get_user (new_options, uarg.i))
+                       return -EFAULT;
+
+               if (new_options & WDIOS_DISABLECARD) {
+                       wdt_stop();
+                       retval = 0;
+               }
+
+               if (new_options & WDIOS_ENABLECARD) {
+                       wdt_start();
+                       retval = 0;
+               }
+
+               return retval;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, uarg.i))
+                       return -EFAULT;
+
+               if (wdt_set_timeout(new_timeout))
+                   return -EINVAL;
+
+               wdt_keepalive();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, uarg.i);
+
+       }
+}
+
+static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if (code==SYS_DOWN || code==SYS_HALT)
+               wdt_stop();
+       return NOTIFY_DONE;
+}
+
+static const struct file_operations wdt_fops=
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdt_write,
+       .ioctl          = wdt_ioctl,
+       .open           = wdt_open,
+       .release        = wdt_release,
+};
+
+static struct miscdevice wdt_miscdev=
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &wdt_fops,
+};
+
+static struct notifier_block wdt_notifier = {
+       .notifier_call = wdt_notify_sys,
+};
+
+static int __init w83977f_wdt_init(void)
+{
+       int rc;
+
+        printk(KERN_INFO PFX DRIVER_VERSION);
+
+       spin_lock_init(&spinlock);
+
+       /*
+        * Check that the timeout value is within it's range ; 
+        * if not reset to the default
+        */
+       if (wdt_set_timeout(timeout)) {
+               wdt_set_timeout(DEFAULT_TIMEOUT);
+               printk(KERN_INFO PFX "timeout value must be 15<=timeout<=7635, using %d\n",
+                       DEFAULT_TIMEOUT);
+       }
+
+       if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME))
+       {
+               printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       IO_INDEX_PORT);
+               rc = -EIO;
+               goto err_out;
+       }
+
+       rc = misc_register(&wdt_miscdev);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       wdt_miscdev.minor, rc);
+               goto err_out_region;
+       }
+
+       rc = register_reboot_notifier(&wdt_notifier);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
+               goto err_out_miscdev;
+       }
+
+       printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n",
+               timeout, nowayout, testmode);
+
+       return 0;
+
+err_out_miscdev:
+       misc_deregister(&wdt_miscdev);
+err_out_region:
+       release_region(IO_INDEX_PORT,2);
+err_out:
+       return rc;
+}
+
+static void __exit w83977f_wdt_exit(void)
+{
+       wdt_stop();
+       misc_deregister(&wdt_miscdev);
+       unregister_reboot_notifier(&wdt_notifier);
+       release_region(IO_INDEX_PORT,2);
+}
+
+module_init(w83977f_wdt_init);
+module_exit(w83977f_wdt_exit);
+
+MODULE_AUTHOR("Jose Goncalves <jose.goncalves@inov.pt>");
+MODULE_DESCRIPTION("Driver for watchdog timer in W83977F I/O chip");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c
new file mode 100644 (file)
index 0000000..950905d
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ *     ICP Wafer 5823 Single Board Computer WDT driver
+ *      http://www.icpamerica.com/wafer_5823.php
+ *      May also work on other similar models
+ *
+ *     (c) Copyright 2002 Justin Cormack <justin@street-vision.com>
+ *
+ *      Release 0.02
+ *
+ *     Based on advantechwdt.c which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <asm/io.h>
+#include <asm/uaccess.h>
+
+#define WATCHDOG_NAME "Wafer 5823 WDT"
+#define PFX WATCHDOG_NAME ": "
+#define WD_TIMO 60                     /* 60 sec default timeout */
+
+static unsigned long wafwdt_is_open;
+static char expect_close;
+static spinlock_t wafwdt_lock;
+
+/*
+ *     You must set these - there is no sane way to probe for this board.
+ *
+ *      To enable, write the timeout value in seconds (1 to 255) to I/O
+ *      port WDT_START, then read the port to start the watchdog. To pat
+ *      the dog, read port WDT_STOP to stop the timer, then read WDT_START
+ *      to restart it again.
+ */
+
+static int wdt_stop = 0x843;
+static int wdt_start = 0x443;
+
+static int timeout = WD_TIMO;  /* in seconds */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) ".");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+static void wafwdt_ping(void)
+{
+       /* pat watchdog */
+       spin_lock(&wafwdt_lock);
+       inb_p(wdt_stop);
+       inb_p(wdt_start);
+       spin_unlock(&wafwdt_lock);
+}
+
+static void wafwdt_start(void)
+{
+       /* start up watchdog */
+       outb_p(timeout, wdt_start);
+       inb_p(wdt_start);
+}
+
+static void
+wafwdt_stop(void)
+{
+       /* stop watchdog */
+       inb_p(wdt_stop);
+}
+
+static ssize_t wafwdt_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               /* Well, anyhow someone wrote to us, we should return that favour */
+               wafwdt_ping();
+       }
+       return count;
+}
+
+static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+            unsigned long arg)
+{
+       int new_timeout;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "Wafer 5823 WDT",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof (ident)))
+                       return -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+               wafwdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if ((new_timeout < 1) || (new_timeout > 255))
+                       return -EINVAL;
+               timeout = new_timeout;
+               wafwdt_stop();
+               wafwdt_start();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
+
+               if (get_user(options, p))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       wafwdt_start();
+                       retval = 0;
+               }
+
+               if (options & WDIOS_ENABLECARD) {
+                       wafwdt_stop();
+                       retval = 0;
+               }
+
+               return retval;
+       }
+
+       default:
+               return -ENOTTY;
+       }
+       return 0;
+}
+
+static int wafwdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &wafwdt_is_open))
+               return -EBUSY;
+
+       /*
+        *      Activate
+        */
+       wafwdt_start();
+       return nonseekable_open(inode, file);
+}
+
+static int
+wafwdt_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               wafwdt_stop();
+       } else {
+               printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
+               wafwdt_ping();
+       }
+       clear_bit(0, &wafwdt_is_open);
+       expect_close = 0;
+       return 0;
+}
+
+/*
+ *     Notifier for system down
+ */
+
+static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT) {
+               /* Turn the WDT off */
+               wafwdt_stop();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static const struct file_operations wafwdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wafwdt_write,
+       .ioctl          = wafwdt_ioctl,
+       .open           = wafwdt_open,
+       .release        = wafwdt_close,
+};
+
+static struct miscdevice wafwdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &wafwdt_fops,
+};
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wafwdt_notifier = {
+       .notifier_call = wafwdt_notify_sys,
+};
+
+static int __init wafwdt_init(void)
+{
+       int ret;
+
+       printk(KERN_INFO "WDT driver for Wafer 5823 single board computer initialising.\n");
+
+       spin_lock_init(&wafwdt_lock);
+
+       if (timeout < 1 || timeout > 255) {
+               timeout = WD_TIMO;
+               printk (KERN_INFO PFX "timeout value must be 1<=x<=255, using %d\n",
+                       timeout);
+       }
+
+       if (wdt_stop != wdt_start) {
+               if(!request_region(wdt_stop, 1, "Wafer 5823 WDT")) {
+                       printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       wdt_stop);
+                       ret = -EIO;
+                       goto error;
+               }
+       }
+
+       if(!request_region(wdt_start, 1, "Wafer 5823 WDT")) {
+               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                       wdt_start);
+               ret = -EIO;
+               goto error2;
+       }
+
+       ret = register_reboot_notifier(&wafwdt_notifier);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               goto error3;
+       }
+
+       ret = misc_register(&wafwdt_miscdev);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto error4;
+       }
+
+       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+       return ret;
+error4:
+       unregister_reboot_notifier(&wafwdt_notifier);
+error3:
+       release_region(wdt_start, 1);
+error2:
+       if (wdt_stop != wdt_start)
+               release_region(wdt_stop, 1);
+error:
+       return ret;
+}
+
+static void __exit wafwdt_exit(void)
+{
+       misc_deregister(&wafwdt_miscdev);
+       unregister_reboot_notifier(&wafwdt_notifier);
+       if(wdt_stop != wdt_start)
+               release_region(wdt_stop, 1);
+       release_region(wdt_start, 1);
+}
+
+module_init(wafwdt_init);
+module_exit(wafwdt_exit);
+
+MODULE_AUTHOR("Justin Cormack");
+MODULE_DESCRIPTION("ICP Wafer 5823 Single Board Computer WDT driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+/* end of wafer5823wdt.c */
diff --git a/drivers/watchdog/wd501p.h b/drivers/watchdog/wd501p.h
new file mode 100644 (file)
index 0000000..a4504f4
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ *     Industrial Computer Source WDT500/501 driver
+ *
+ *     (c) Copyright 1995      CymruNET Ltd
+ *                             Innovation Centre
+ *                             Singleton Park
+ *                             Swansea
+ *                             Wales
+ *                             UK
+ *                             SA2 8PP
+ *
+ *     http://www.cymru.net
+ *
+ *     This driver is provided under the GNU General Public License, incorporated
+ *     herein by reference. The driver is provided without warranty or 
+ *     support.
+ *
+ *     Release 0.04.
+ *
+ */
+
+
+#define WDT_COUNT0             (io+0)
+#define WDT_COUNT1             (io+1)
+#define WDT_COUNT2             (io+2)
+#define WDT_CR                 (io+3)
+#define WDT_SR                 (io+4)  /* Start buzzer on PCI write */
+#define WDT_RT                 (io+5)  /* Stop buzzer on PCI write */
+#define WDT_BUZZER             (io+6)  /* PCI only: rd=disable, wr=enable */
+#define WDT_DC                 (io+7)
+
+/* The following are only on the PCI card, they're outside of I/O space on
+ * the ISA card: */
+#define WDT_CLOCK              (io+12) /* COUNT2: rd=16.67MHz, wr=2.0833MHz */
+/* inverted opto isolated reset output: */
+#define WDT_OPTONOTRST         (io+13) /* wr=enable, rd=disable */
+/* opto isolated reset output: */
+#define WDT_OPTORST            (io+14) /* wr=enable, rd=disable */
+/* programmable outputs: */
+#define WDT_PROGOUT            (io+15) /* wr=enable, rd=disable */
+
+                                                               /* FAN 501 500 */
+#define WDC_SR_WCCR            1       /* Active low */        /*  X   X   X  */
+#define WDC_SR_TGOOD           2                               /*  X   X   -  */
+#define WDC_SR_ISOI0           4                               /*  X   X   X  */
+#define WDC_SR_ISII1           8                               /*  X   X   X  */
+#define WDC_SR_FANGOOD         16                              /*  X   -   -  */
+#define WDC_SR_PSUOVER         32      /* Active low */        /*  X   X   -  */
+#define WDC_SR_PSUUNDR         64      /* Active low */        /*  X   X   -  */
+#define WDC_SR_IRQ             128     /* Active low */        /*  X   X   X  */
+
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c
new file mode 100644 (file)
index 0000000..1d64e27
--- /dev/null
@@ -0,0 +1,695 @@
+/*
+ * FIXME: add wdrtas_get_status and wdrtas_get_boot_status as soon as
+ * RTAS calls are available
+ */
+
+/*
+ * RTAS watchdog driver
+ *
+ * (C) Copyright IBM Corp. 2005
+ * device driver to exploit watchdog RTAS functions
+ *
+ * Authors : Utz Bacher <utz.bacher@de.ibm.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
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/types.h>
+#include <linux/watchdog.h>
+
+#include <asm/rtas.h>
+#include <asm/uaccess.h>
+
+#define WDRTAS_MAGIC_CHAR              42
+#define WDRTAS_SUPPORTED_MASK          (WDIOF_SETTIMEOUT | \
+                                        WDIOF_MAGICCLOSE)
+
+MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>");
+MODULE_DESCRIPTION("RTAS watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
+
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+static int wdrtas_nowayout = 1;
+#else
+static int wdrtas_nowayout = 0;
+#endif
+
+static atomic_t wdrtas_miscdev_open = ATOMIC_INIT(0);
+static char wdrtas_expect_close = 0;
+
+static int wdrtas_interval;
+
+#define WDRTAS_THERMAL_SENSOR          3
+static int wdrtas_token_get_sensor_state;
+#define WDRTAS_SURVEILLANCE_IND                9000
+static int wdrtas_token_set_indicator;
+#define WDRTAS_SP_SPI                  28
+static int wdrtas_token_get_sp;
+static int wdrtas_token_event_scan;
+
+#define WDRTAS_DEFAULT_INTERVAL                300
+
+#define WDRTAS_LOGBUFFER_LEN           128
+static char wdrtas_logbuffer[WDRTAS_LOGBUFFER_LEN];
+
+
+/*** watchdog access functions */
+
+/**
+ * wdrtas_set_interval - sets the watchdog interval
+ * @interval: new interval
+ *
+ * returns 0 on success, <0 on failures
+ *
+ * wdrtas_set_interval sets the watchdog keepalive interval by calling the
+ * RTAS function set-indicator (surveillance). The unit of interval is
+ * seconds.
+ */
+static int
+wdrtas_set_interval(int interval)
+{
+       long result;
+       static int print_msg = 10;
+
+       /* rtas uses minutes */
+       interval = (interval + 59) / 60;
+
+       result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL,
+                          WDRTAS_SURVEILLANCE_IND, 0, interval);
+       if ( (result < 0) && (print_msg) ) {
+               printk(KERN_ERR "wdrtas: setting the watchdog to %i "
+                      "timeout failed: %li\n", interval, result);
+               print_msg--;
+       }
+
+       return result;
+}
+
+/**
+ * wdrtas_get_interval - returns the current watchdog interval
+ * @fallback_value: value (in seconds) to use, if the RTAS call fails
+ *
+ * returns the interval
+ *
+ * wdrtas_get_interval returns the current watchdog keepalive interval
+ * as reported by the RTAS function ibm,get-system-parameter. The unit
+ * of the return value is seconds.
+ */
+static int
+wdrtas_get_interval(int fallback_value)
+{
+       long result;
+       char value[4];
+
+       result = rtas_call(wdrtas_token_get_sp, 3, 1, NULL,
+                          WDRTAS_SP_SPI, (void *)__pa(&value), 4);
+       if ( (value[0] != 0) || (value[1] != 2) || (value[3] != 0) ||
+            (result < 0) ) {
+               printk(KERN_WARNING "wdrtas: could not get sp_spi watchdog "
+                      "timeout (%li). Continuing\n", result);
+               return fallback_value;
+       }
+
+       /* rtas uses minutes */
+       return ((int)value[2]) * 60;
+}
+
+/**
+ * wdrtas_timer_start - starts watchdog
+ *
+ * wdrtas_timer_start starts the watchdog by calling the RTAS function
+ * set-interval (surveillance)
+ */
+static void
+wdrtas_timer_start(void)
+{
+       wdrtas_set_interval(wdrtas_interval);
+}
+
+/**
+ * wdrtas_timer_stop - stops watchdog
+ *
+ * wdrtas_timer_stop stops the watchdog timer by calling the RTAS function
+ * set-interval (surveillance)
+ */
+static void
+wdrtas_timer_stop(void)
+{
+       wdrtas_set_interval(0);
+}
+
+/**
+ * wdrtas_log_scanned_event - logs an event we received during keepalive
+ *
+ * wdrtas_log_scanned_event prints a message to the log buffer dumping
+ * the results of the last event-scan call
+ */
+static void
+wdrtas_log_scanned_event(void)
+{
+       int i;
+
+       for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16)
+               printk(KERN_INFO "wdrtas: dumping event (line %i/%i), data = "
+                      "%02x %02x %02x %02x  %02x %02x %02x %02x   "
+                      "%02x %02x %02x %02x  %02x %02x %02x %02x\n",
+                      (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16),
+                      wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], 
+                      wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], 
+                      wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], 
+                      wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], 
+                      wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], 
+                      wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], 
+                      wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], 
+                      wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]);
+}
+
+/**
+ * wdrtas_timer_keepalive - resets watchdog timer to keep system alive
+ *
+ * wdrtas_timer_keepalive restarts the watchdog timer by calling the
+ * RTAS function event-scan and repeats these calls as long as there are
+ * events available. All events will be dumped.
+ */
+static void
+wdrtas_timer_keepalive(void)
+{
+       long result;
+
+       do {
+               result = rtas_call(wdrtas_token_event_scan, 4, 1, NULL,
+                                  RTAS_EVENT_SCAN_ALL_EVENTS, 0,
+                                  (void *)__pa(wdrtas_logbuffer),
+                                  WDRTAS_LOGBUFFER_LEN);
+               if (result < 0)
+                       printk(KERN_ERR "wdrtas: event-scan failed: %li\n",
+                              result);
+               if (result == 0)
+                       wdrtas_log_scanned_event();
+       } while (result == 0);
+}
+
+/**
+ * wdrtas_get_temperature - returns current temperature
+ *
+ * returns temperature or <0 on failures
+ *
+ * wdrtas_get_temperature returns the current temperature in Fahrenheit. It
+ * uses the RTAS call get-sensor-state, token 3 to do so
+ */
+static int
+wdrtas_get_temperature(void)
+{
+       long result;
+       int temperature = 0;
+
+       result = rtas_call(wdrtas_token_get_sensor_state, 2, 2,
+                          (void *)__pa(&temperature),
+                          WDRTAS_THERMAL_SENSOR, 0);
+
+       if (result < 0)
+               printk(KERN_WARNING "wdrtas: reading the thermal sensor "
+                      "faild: %li\n", result);
+       else
+               temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */
+
+       return temperature;
+}
+
+/**
+ * wdrtas_get_status - returns the status of the watchdog
+ *
+ * returns a bitmask of defines WDIOF_... as defined in
+ * include/linux/watchdog.h
+ */
+static int
+wdrtas_get_status(void)
+{
+       return 0; /* TODO */
+}
+
+/**
+ * wdrtas_get_boot_status - returns the reason for the last boot
+ *
+ * returns a bitmask of defines WDIOF_... as defined in
+ * include/linux/watchdog.h, indicating why the watchdog rebooted the system
+ */
+static int
+wdrtas_get_boot_status(void)
+{
+       return 0; /* TODO */
+}
+
+/*** watchdog API and operations stuff */
+
+/* wdrtas_write - called when watchdog device is written to
+ * @file: file structure
+ * @buf: user buffer with data
+ * @len: amount to data written
+ * @ppos: position in file
+ *
+ * returns the number of successfully processed characters, which is always
+ * the number of bytes passed to this function
+ *
+ * wdrtas_write processes all the data given to it and looks for the magic
+ * character 'V'. This character allows the watchdog device to be closed
+ * properly.
+ */
+static ssize_t
+wdrtas_write(struct file *file, const char __user *buf,
+            size_t len, loff_t *ppos)
+{
+       int i;
+       char c;
+
+       if (!len)
+               goto out;
+
+       if (!wdrtas_nowayout) {
+               wdrtas_expect_close = 0;
+               /* look for 'V' */
+               for (i = 0; i < len; i++) {
+                       if (get_user(c, buf + i))
+                               return -EFAULT;
+                       /* allow to close device */
+                       if (c == 'V')
+                               wdrtas_expect_close = WDRTAS_MAGIC_CHAR;
+               }
+       }
+
+       wdrtas_timer_keepalive();
+
+out:
+       return len;
+}
+
+/**
+ * wdrtas_ioctl - ioctl function for the watchdog device
+ * @inode: inode structure
+ * @file: file structure
+ * @cmd: command for ioctl
+ * @arg: argument pointer
+ *
+ * returns 0 on success, <0 on failure
+ *
+ * wdrtas_ioctl implements the watchdog API ioctls
+ */
+static int
+wdrtas_ioctl(struct inode *inode, struct file *file,
+            unsigned int cmd, unsigned long arg)
+{
+       int __user *argp = (void __user *)arg;
+       int i;
+       static struct watchdog_info wdinfo = {
+               .options = WDRTAS_SUPPORTED_MASK,
+               .firmware_version = 0,
+               .identity = "wdrtas"
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &wdinfo, sizeof(wdinfo)))
+                       return -EFAULT;
+               return 0;
+
+       case WDIOC_GETSTATUS:
+               i = wdrtas_get_status();
+               return put_user(i, argp);
+
+       case WDIOC_GETBOOTSTATUS:
+               i = wdrtas_get_boot_status();
+               return put_user(i, argp);
+
+       case WDIOC_GETTEMP:
+               if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE)
+                       return -EOPNOTSUPP;
+
+               i = wdrtas_get_temperature();
+               return put_user(i, argp);
+
+       case WDIOC_SETOPTIONS:
+               if (get_user(i, argp))
+                       return -EFAULT;
+               if (i & WDIOS_DISABLECARD)
+                       wdrtas_timer_stop();
+               if (i & WDIOS_ENABLECARD) {
+                       wdrtas_timer_keepalive();
+                       wdrtas_timer_start();
+               }
+               if (i & WDIOS_TEMPPANIC) {
+                       /* not implemented. Done by H8 */
+               }
+               return 0;
+
+       case WDIOC_KEEPALIVE:
+               wdrtas_timer_keepalive();
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(i, argp))
+                       return -EFAULT;
+
+               if (wdrtas_set_interval(i))
+                       return -EINVAL;
+
+               wdrtas_timer_keepalive();
+
+               if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE)
+                       wdrtas_interval = i;
+               else
+                       wdrtas_interval = wdrtas_get_interval(i);
+               /* fallthrough */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(wdrtas_interval, argp);
+
+       default:
+               return -ENOTTY;
+       }
+}
+
+/**
+ * wdrtas_open - open function of watchdog device
+ * @inode: inode structure
+ * @file: file structure
+ *
+ * returns 0 on success, -EBUSY if the file has been opened already, <0 on
+ * other failures
+ *
+ * function called when watchdog device is opened
+ */
+static int
+wdrtas_open(struct inode *inode, struct file *file)
+{
+       /* only open once */
+       if (atomic_inc_return(&wdrtas_miscdev_open) > 1) {
+               atomic_dec(&wdrtas_miscdev_open);
+               return -EBUSY;
+       }
+
+       wdrtas_timer_start();
+       wdrtas_timer_keepalive();
+
+       return nonseekable_open(inode, file);
+}
+
+/**
+ * wdrtas_close - close function of watchdog device
+ * @inode: inode structure
+ * @file: file structure
+ *
+ * returns 0 on success
+ *
+ * close function. Always succeeds
+ */
+static int
+wdrtas_close(struct inode *inode, struct file *file)
+{
+       /* only stop watchdog, if this was announced using 'V' before */
+       if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR)
+               wdrtas_timer_stop();
+       else {
+               printk(KERN_WARNING "wdrtas: got unexpected close. Watchdog "
+                      "not stopped.\n");
+               wdrtas_timer_keepalive();
+       }
+
+       wdrtas_expect_close = 0;
+       atomic_dec(&wdrtas_miscdev_open);
+       return 0;
+}
+
+/**
+ * wdrtas_temp_read - gives back the temperature in fahrenheit
+ * @file: file structure
+ * @buf: user buffer
+ * @count: number of bytes to be read
+ * @ppos: position in file
+ *
+ * returns always 1 or -EFAULT in case of user space copy failures, <0 on
+ * other failures
+ *
+ * wdrtas_temp_read gives the temperature to the users by copying this
+ * value as one byte into the user space buffer. The unit is Fahrenheit...
+ */
+static ssize_t
+wdrtas_temp_read(struct file *file, char __user *buf,
+                size_t count, loff_t *ppos)
+{
+       int temperature = 0;
+
+       temperature = wdrtas_get_temperature();
+       if (temperature < 0)
+               return temperature;
+
+       if (copy_to_user(buf, &temperature, 1))
+               return -EFAULT;
+
+       return 1;
+}
+
+/**
+ * wdrtas_temp_open - open function of temperature device
+ * @inode: inode structure
+ * @file: file structure
+ *
+ * returns 0 on success, <0 on failure
+ *
+ * function called when temperature device is opened
+ */
+static int
+wdrtas_temp_open(struct inode *inode, struct file *file)
+{
+       return nonseekable_open(inode, file);
+}
+
+/**
+ * wdrtas_temp_close - close function of temperature device
+ * @inode: inode structure
+ * @file: file structure
+ *
+ * returns 0 on success
+ *
+ * close function. Always succeeds
+ */
+static int
+wdrtas_temp_close(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+
+/**
+ * wdrtas_reboot - reboot notifier function
+ * @nb: notifier block structure
+ * @code: reboot code
+ * @ptr: unused
+ *
+ * returns NOTIFY_DONE
+ *
+ * wdrtas_reboot stops the watchdog in case of a reboot
+ */
+static int
+wdrtas_reboot(struct notifier_block *this, unsigned long code, void *ptr)
+{
+       if ( (code==SYS_DOWN) || (code==SYS_HALT) )
+               wdrtas_timer_stop();
+
+       return NOTIFY_DONE;
+}
+
+/*** initialization stuff */
+
+static const struct file_operations wdrtas_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdrtas_write,
+       .ioctl          = wdrtas_ioctl,
+       .open           = wdrtas_open,
+       .release        = wdrtas_close,
+};
+
+static struct miscdevice wdrtas_miscdev = {
+       .minor =        WATCHDOG_MINOR,
+       .name =         "watchdog",
+       .fops =         &wdrtas_fops,
+};
+
+static const struct file_operations wdrtas_temp_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .read           = wdrtas_temp_read,
+       .open           = wdrtas_temp_open,
+       .release        = wdrtas_temp_close,
+};
+
+static struct miscdevice wdrtas_tempdev = {
+       .minor =        TEMP_MINOR,
+       .name =         "temperature",
+       .fops =         &wdrtas_temp_fops,
+};
+
+static struct notifier_block wdrtas_notifier = {
+       .notifier_call =        wdrtas_reboot,
+};
+
+/**
+ * wdrtas_get_tokens - reads in RTAS tokens
+ *
+ * returns 0 on succes, <0 on failure
+ *
+ * wdrtas_get_tokens reads in the tokens for the RTAS calls used in
+ * this watchdog driver. It tolerates, if "get-sensor-state" and
+ * "ibm,get-system-parameter" are not available.
+ */
+static int
+wdrtas_get_tokens(void)
+{
+       wdrtas_token_get_sensor_state = rtas_token("get-sensor-state");
+       if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) {
+               printk(KERN_WARNING "wdrtas: couldn't get token for "
+                      "get-sensor-state. Trying to continue without "
+                      "temperature support.\n");
+       }
+
+       wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter");
+       if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) {
+               printk(KERN_WARNING "wdrtas: couldn't get token for "
+                      "ibm,get-system-parameter. Trying to continue with "
+                      "a default timeout value of %i seconds.\n",
+                      WDRTAS_DEFAULT_INTERVAL);
+       }
+
+       wdrtas_token_set_indicator = rtas_token("set-indicator");
+       if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) {
+               printk(KERN_ERR "wdrtas: couldn't get token for "
+                      "set-indicator. Terminating watchdog code.\n");
+               return -EIO;
+       }
+
+       wdrtas_token_event_scan = rtas_token("event-scan");
+       if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) {
+               printk(KERN_ERR "wdrtas: couldn't get token for event-scan. "
+                      "Terminating watchdog code.\n");
+               return -EIO;
+       }
+
+       return 0;
+}
+
+/**
+ * wdrtas_unregister_devs - unregisters the misc dev handlers
+ *
+ * wdrtas_register_devs unregisters the watchdog and temperature watchdog
+ * misc devs
+ */
+static void
+wdrtas_unregister_devs(void)
+{
+       misc_deregister(&wdrtas_miscdev);
+       if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE)
+               misc_deregister(&wdrtas_tempdev);
+}
+
+/**
+ * wdrtas_register_devs - registers the misc dev handlers
+ *
+ * returns 0 on succes, <0 on failure
+ *
+ * wdrtas_register_devs registers the watchdog and temperature watchdog
+ * misc devs
+ */
+static int
+wdrtas_register_devs(void)
+{
+       int result;
+
+       result = misc_register(&wdrtas_miscdev);
+       if (result) {
+               printk(KERN_ERR "wdrtas: couldn't register watchdog misc "
+                      "device. Terminating watchdog code.\n");
+               return result;
+       }
+
+       if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) {
+               result = misc_register(&wdrtas_tempdev);
+               if (result) {
+                       printk(KERN_WARNING "wdrtas: couldn't register "
+                              "watchdog temperature misc device. Continuing "
+                              "without temperature support.\n");
+                       wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE;
+               }
+       }
+
+       return 0;
+}
+
+/**
+ * wdrtas_init - init function of the watchdog driver
+ *
+ * returns 0 on succes, <0 on failure
+ *
+ * registers the file handlers and the reboot notifier
+ */
+static int __init
+wdrtas_init(void)
+{
+       if (wdrtas_get_tokens())
+               return -ENODEV;
+
+       if (wdrtas_register_devs())
+               return -ENODEV;
+
+       if (register_reboot_notifier(&wdrtas_notifier)) {
+               printk(KERN_ERR "wdrtas: could not register reboot notifier. "
+                      "Terminating watchdog code.\n");
+               wdrtas_unregister_devs();
+               return -ENODEV;
+       }
+
+       if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE)
+               wdrtas_interval = WDRTAS_DEFAULT_INTERVAL;
+       else
+               wdrtas_interval = wdrtas_get_interval(WDRTAS_DEFAULT_INTERVAL);
+
+       return 0;
+}
+
+/**
+ * wdrtas_exit - exit function of the watchdog driver
+ *
+ * unregisters the file handlers and the reboot notifier
+ */
+static void __exit
+wdrtas_exit(void)
+{
+       if (!wdrtas_nowayout)
+               wdrtas_timer_stop();
+
+       wdrtas_unregister_devs();
+
+       unregister_reboot_notifier(&wdrtas_notifier);
+}
+
+module_init(wdrtas_init);
+module_exit(wdrtas_exit);
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c
new file mode 100644 (file)
index 0000000..0a3de6a
--- /dev/null
@@ -0,0 +1,640 @@
+/*
+ *     Industrial Computer Source WDT500/501 driver
+ *
+ *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ *     Release 0.10.
+ *
+ *     Fixes
+ *             Dave Gregorich  :       Modularisation and minor bugs
+ *             Alan Cox        :       Added the watchdog ioctl() stuff
+ *             Alan Cox        :       Fixed the reboot problem (as noted by
+ *                                     Matt Crocker).
+ *             Alan Cox        :       Added wdt= boot option
+ *             Alan Cox        :       Cleaned up copy/user stuff
+ *             Tim Hockin      :       Added insmod parameters, comment cleanup
+ *                                     Parameterized timeout
+ *             Tigran Aivazian :       Restructured wdt_init() to handle failures
+ *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
+ *             Matt Domsch     :       Added nowayout module option
+ */
+
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include "wd501p.h"
+
+static unsigned long wdt_is_open;
+static char expect_close;
+
+/*
+ *     Module parameters
+ */
+
+#define WD_TIMO 60                     /* Default heartbeat = 60 seconds */
+
+static int heartbeat = WD_TIMO;
+static int wd_heartbeat;
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/* You must set these - there is no sane way to probe for this board. */
+static int io=0x240;
+static int irq=11;
+
+module_param(io, int, 0);
+MODULE_PARM_DESC(io, "WDT io port (default=0x240)");
+module_param(irq, int, 0);
+MODULE_PARM_DESC(irq, "WDT irq (default=11)");
+
+#ifdef CONFIG_WDT_501
+/* Support for the Fan Tachometer on the WDT501-P */
+static int tachometer;
+
+module_param(tachometer, int, 0);
+MODULE_PARM_DESC(tachometer, "WDT501-P Fan Tachometer support (0=disable, default=0)");
+#endif /* CONFIG_WDT_501 */
+
+/*
+ *     Programming support
+ */
+
+static void wdt_ctr_mode(int ctr, int mode)
+{
+       ctr<<=6;
+       ctr|=0x30;
+       ctr|=(mode<<1);
+       outb_p(ctr, WDT_CR);
+}
+
+static void wdt_ctr_load(int ctr, int val)
+{
+       outb_p(val&0xFF, WDT_COUNT0+ctr);
+       outb_p(val>>8, WDT_COUNT0+ctr);
+}
+
+/**
+ *     wdt_start:
+ *
+ *     Start the watchdog driver.
+ */
+
+static int wdt_start(void)
+{
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       wdt_ctr_mode(0,3);              /* Program CTR0 for Mode 3: Square Wave Generator */
+       wdt_ctr_mode(1,2);              /* Program CTR1 for Mode 2: Rate Generator */
+       wdt_ctr_mode(2,0);              /* Program CTR2 for Mode 0: Pulse on Terminal Count */
+       wdt_ctr_load(0, 8948);          /* Count at 100Hz */
+       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
+       wdt_ctr_load(2,65535);          /* Length of reset pulse */
+       outb_p(0, WDT_DC);              /* Enable watchdog */
+       return 0;
+}
+
+/**
+ *     wdt_stop:
+ *
+ *     Stop the watchdog driver.
+ */
+
+static int wdt_stop (void)
+{
+       /* Turn the card off */
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       wdt_ctr_load(2,0);              /* 0 length reset pulses now */
+       return 0;
+}
+
+/**
+ *     wdt_ping:
+ *
+ *     Reload counter one with the watchdog heartbeat. We don't bother reloading
+ *     the cascade counter.
+ */
+
+static int wdt_ping(void)
+{
+       /* Write a watchdog value */
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       wdt_ctr_mode(1,2);              /* Re-Program CTR1 for Mode 2: Rate Generator */
+       wdt_ctr_load(1,wd_heartbeat);   /* Heartbeat */
+       outb_p(0, WDT_DC);              /* Enable watchdog */
+       return 0;
+}
+
+/**
+ *     wdt_set_heartbeat:
+ *     @t:             the new heartbeat value that needs to be set.
+ *
+ *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
+ *     incorrect we keep the old value and return -EINVAL. If successfull we
+ *     return 0.
+ */
+static int wdt_set_heartbeat(int t)
+{
+       if ((t < 1) || (t > 65535))
+               return -EINVAL;
+
+       heartbeat = t;
+       wd_heartbeat = t * 100;
+       return 0;
+}
+
+/**
+ *     wdt_get_status:
+ *     @status:                the new status.
+ *
+ *     Extract the status information from a WDT watchdog device. There are
+ *     several board variants so we have to know which bits are valid. Some
+ *     bits default to one and some to zero in order to be maximally painful.
+ *
+ *     we then map the bits onto the status ioctl flags.
+ */
+
+static int wdt_get_status(int *status)
+{
+       unsigned char new_status=inb_p(WDT_SR);
+
+       *status=0;
+       if (new_status & WDC_SR_ISOI0)
+               *status |= WDIOF_EXTERN1;
+       if (new_status & WDC_SR_ISII1)
+               *status |= WDIOF_EXTERN2;
+#ifdef CONFIG_WDT_501
+       if (!(new_status & WDC_SR_TGOOD))
+               *status |= WDIOF_OVERHEAT;
+       if (!(new_status & WDC_SR_PSUOVER))
+               *status |= WDIOF_POWEROVER;
+       if (!(new_status & WDC_SR_PSUUNDR))
+               *status |= WDIOF_POWERUNDER;
+       if (tachometer) {
+               if (!(new_status & WDC_SR_FANGOOD))
+                       *status |= WDIOF_FANFAULT;
+       }
+#endif /* CONFIG_WDT_501 */
+       return 0;
+}
+
+#ifdef CONFIG_WDT_501
+/**
+ *     wdt_get_temperature:
+ *
+ *     Reports the temperature in degrees Fahrenheit. The API is in
+ *     farenheit. It was designed by an imperial measurement luddite.
+ */
+
+static int wdt_get_temperature(int *temperature)
+{
+       unsigned short c=inb_p(WDT_RT);
+
+       *temperature = (c * 11 / 15) + 7;
+       return 0;
+}
+#endif /* CONFIG_WDT_501 */
+
+/**
+ *     wdt_interrupt:
+ *     @irq:           Interrupt number
+ *     @dev_id:        Unused as we don't allow multiple devices.
+ *
+ *     Handle an interrupt from the board. These are raised when the status
+ *     map changes in what the board considers an interesting way. That means
+ *     a failure condition occurring.
+ */
+
+static irqreturn_t wdt_interrupt(int irq, void *dev_id)
+{
+       /*
+        *      Read the status register see what is up and
+        *      then printk it.
+        */
+       unsigned char status=inb_p(WDT_SR);
+
+       printk(KERN_CRIT "WDT status %d\n", status);
+
+#ifdef CONFIG_WDT_501
+       if (!(status & WDC_SR_TGOOD))
+               printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT));
+       if (!(status & WDC_SR_PSUOVER))
+               printk(KERN_CRIT "PSU over voltage.\n");
+       if (!(status & WDC_SR_PSUUNDR))
+               printk(KERN_CRIT "PSU under voltage.\n");
+       if (tachometer) {
+               if (!(status & WDC_SR_FANGOOD))
+                       printk(KERN_CRIT "Possible fan fault.\n");
+       }
+#endif /* CONFIG_WDT_501 */
+       if (!(status & WDC_SR_WCCR))
+#ifdef SOFTWARE_REBOOT
+#ifdef ONLY_TESTING
+               printk(KERN_CRIT "Would Reboot.\n");
+#else
+               printk(KERN_CRIT "Initiating system reboot.\n");
+               emergency_restart();
+#endif
+#else
+               printk(KERN_CRIT "Reset in 5ms.\n");
+#endif
+       return IRQ_HANDLED;
+}
+
+
+/**
+ *     wdt_write:
+ *     @file: file handle to the watchdog
+ *     @buf: buffer to write (unused as data does not matter here
+ *     @count: count of bytes
+ *     @ppos: pointer to the position to write. No seeks allowed
+ *
+ *     A write to a watchdog device is defined as a keepalive signal. Any
+ *     write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if(count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               wdt_ping();
+       }
+       return count;
+}
+
+/**
+ *     wdt_ioctl:
+ *     @inode: inode of the device
+ *     @file: file handle to the device
+ *     @cmd: watchdog command
+ *     @arg: argument pointer
+ *
+ *     The watchdog API defines a common set of functions for all watchdogs
+ *     according to their available features. We only actually usefully support
+ *     querying capabilities and current status.
+ */
+
+static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_heartbeat;
+       int status;
+
+       static struct watchdog_info ident = {
+               .options =              WDIOF_SETTIMEOUT|
+                                       WDIOF_MAGICCLOSE|
+                                       WDIOF_KEEPALIVEPING,
+               .firmware_version =     1,
+               .identity =             "WDT500/501",
+       };
+
+       /* Add options according to the card we have */
+       ident.options |= (WDIOF_EXTERN1|WDIOF_EXTERN2);
+#ifdef CONFIG_WDT_501
+       ident.options |= (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER);
+       if (tachometer)
+               ident.options |= WDIOF_FANFAULT;
+#endif /* CONFIG_WDT_501 */
+
+       switch(cmd)
+       {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+
+               case WDIOC_GETSTATUS:
+                       wdt_get_status(&status);
+                       return put_user(status, p);
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       wdt_ping();
+                       return 0;
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_heartbeat, p))
+                               return -EFAULT;
+
+                       if (wdt_set_heartbeat(new_heartbeat))
+                               return -EINVAL;
+
+                       wdt_ping();
+                       /* Fall */
+               case WDIOC_GETTIMEOUT:
+                       return put_user(heartbeat, p);
+       }
+}
+
+/**
+ *     wdt_open:
+ *     @inode: inode of device
+ *     @file: file handle to device
+ *
+ *     The watchdog device has been opened. The watchdog device is single
+ *     open and on opening we load the counters. Counter zero is a 100Hz
+ *     cascade, into counter 1 which downcounts to reboot. When the counter
+ *     triggers counter 2 downcounts the length of the reset pulse which
+ *     set set to be as long as possible.
+ */
+
+static int wdt_open(struct inode *inode, struct file *file)
+{
+       if(test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+       /*
+        *      Activate
+        */
+       wdt_start();
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     wdt_release:
+ *     @inode: inode to board
+ *     @file: file handle to board
+ *
+ *     The watchdog has a configurable API. There is a religious dispute
+ *     between people who want their watchdog to be able to shut down and
+ *     those who want to be sure if the watchdog manager dies the machine
+ *     reboots. In the former case we disable the counters, in the latter
+ *     case you have to open it again very soon.
+ */
+
+static int wdt_release(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               wdt_stop();
+               clear_bit(0, &wdt_is_open);
+       } else {
+               printk(KERN_CRIT "wdt: WDT device closed unexpectedly.  WDT will not stop!\n");
+               wdt_ping();
+       }
+       expect_close = 0;
+       return 0;
+}
+
+#ifdef CONFIG_WDT_501
+/**
+ *     wdt_temp_read:
+ *     @file: file handle to the watchdog board
+ *     @buf: buffer to write 1 byte into
+ *     @count: length of buffer
+ *     @ptr: offset (no seek allowed)
+ *
+ *     Temp_read reports the temperature in degrees Fahrenheit. The API is in
+ *     farenheit. It was designed by an imperial measurement luddite.
+ */
+
+static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+{
+       int temperature;
+
+       if (wdt_get_temperature(&temperature))
+               return -EFAULT;
+
+       if (copy_to_user (buf, &temperature, 1))
+               return -EFAULT;
+
+       return 1;
+}
+
+/**
+ *     wdt_temp_open:
+ *     @inode: inode of device
+ *     @file: file handle to device
+ *
+ *     The temperature device has been opened.
+ */
+
+static int wdt_temp_open(struct inode *inode, struct file *file)
+{
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     wdt_temp_release:
+ *     @inode: inode to board
+ *     @file: file handle to board
+ *
+ *     The temperature device has been closed.
+ */
+
+static int wdt_temp_release(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+#endif /* CONFIG_WDT_501 */
+
+/**
+ *     notify_sys:
+ *     @this: our notifier block
+ *     @code: the event being reported
+ *     @unused: unused
+ *
+ *     Our notifier is called on system shutdowns. We want to turn the card
+ *     off at reboot otherwise the machine will reboot again during memory
+ *     test or worse yet during the following fsck. This would suck, in fact
+ *     trust me - if it happens it does suck.
+ */
+
+static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if(code==SYS_DOWN || code==SYS_HALT) {
+               /* Turn the card off */
+               wdt_stop();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+
+static const struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdt_write,
+       .ioctl          = wdt_ioctl,
+       .open           = wdt_open,
+       .release        = wdt_release,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &wdt_fops,
+};
+
+#ifdef CONFIG_WDT_501
+static const struct file_operations wdt_temp_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .read           = wdt_temp_read,
+       .open           = wdt_temp_open,
+       .release        = wdt_temp_release,
+};
+
+static struct miscdevice temp_miscdev = {
+       .minor  = TEMP_MINOR,
+       .name   = "temperature",
+       .fops   = &wdt_temp_fops,
+};
+#endif /* CONFIG_WDT_501 */
+
+/*
+ *     The WDT card needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier = {
+       .notifier_call = wdt_notify_sys,
+};
+
+/**
+ *     cleanup_module:
+ *
+ *     Unload the watchdog. You cannot do this with any file handles open.
+ *     If your watchdog is set to continue ticking on close and you unload
+ *     it, well it keeps ticking. We won't get the interrupt but the board
+ *     will not touch PC memory so all is fine. You just have to load a new
+ *     module in 60 seconds or reboot.
+ */
+
+static void __exit wdt_exit(void)
+{
+       misc_deregister(&wdt_miscdev);
+#ifdef CONFIG_WDT_501
+       misc_deregister(&temp_miscdev);
+#endif /* CONFIG_WDT_501 */
+       unregister_reboot_notifier(&wdt_notifier);
+       free_irq(irq, NULL);
+       release_region(io,8);
+}
+
+/**
+ *     wdt_init:
+ *
+ *     Set up the WDT watchdog board. All we have to do is grab the
+ *     resources we require and bitch if anyone beat us to them.
+ *     The open() function will actually kick the board off.
+ */
+
+static int __init wdt_init(void)
+{
+       int ret;
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (wdt_set_heartbeat(heartbeat)) {
+               wdt_set_heartbeat(WD_TIMO);
+               printk(KERN_INFO "wdt: heartbeat value must be 0<heartbeat<65536, using %d\n",
+                       WD_TIMO);
+       }
+
+       if (!request_region(io, 8, "wdt501p")) {
+               printk(KERN_ERR "wdt: I/O address 0x%04x already in use\n", io);
+               ret = -EBUSY;
+               goto out;
+       }
+
+       ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL);
+       if(ret) {
+               printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq);
+               goto outreg;
+       }
+
+       ret = register_reboot_notifier(&wdt_notifier);
+       if(ret) {
+               printk(KERN_ERR "wdt: cannot register reboot notifier (err=%d)\n", ret);
+               goto outirq;
+       }
+
+#ifdef CONFIG_WDT_501
+       ret = misc_register(&temp_miscdev);
+       if (ret) {
+               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+                       TEMP_MINOR, ret);
+               goto outrbt;
+       }
+#endif /* CONFIG_WDT_501 */
+
+       ret = misc_register(&wdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR "wdt: cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto outmisc;
+       }
+
+       ret = 0;
+       printk(KERN_INFO "WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n",
+               io, irq, heartbeat, nowayout);
+#ifdef CONFIG_WDT_501
+       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
+#endif /* CONFIG_WDT_501 */
+
+out:
+       return ret;
+
+outmisc:
+#ifdef CONFIG_WDT_501
+       misc_deregister(&temp_miscdev);
+outrbt:
+#endif /* CONFIG_WDT_501 */
+       unregister_reboot_notifier(&wdt_notifier);
+outirq:
+       free_irq(irq, NULL);
+outreg:
+       release_region(io,8);
+       goto out;
+}
+
+module_init(wdt_init);
+module_exit(wdt_exit);
+
+MODULE_AUTHOR("Alan Cox");
+MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
+MODULE_LICENSE("GPL");
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c
new file mode 100644 (file)
index 0000000..e4cf661
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+ *     Intel 21285 watchdog driver
+ *     Copyright (c) Phil Blundell <pb@nexus.co.uk>, 1998
+ *
+ *     based on
+ *
+ *     SoftDog 0.05:   A Software Watchdog Device
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *
+ *     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.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+
+#include <asm/irq.h>
+#include <asm/uaccess.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/hardware/dec21285.h>
+
+/*
+ * Define this to stop the watchdog actually rebooting the machine.
+ */
+#undef ONLY_TESTING
+
+static unsigned int soft_margin = 60;          /* in seconds */
+static unsigned int reload;
+static unsigned long timer_alive;
+
+#ifdef ONLY_TESTING
+/*
+ *     If the timer expires..
+ */
+static void watchdog_fire(int irq, void *dev_id)
+{
+       printk(KERN_CRIT "Watchdog: Would Reboot.\n");
+       *CSR_TIMER4_CNTL = 0;
+       *CSR_TIMER4_CLR = 0;
+}
+#endif
+
+/*
+ *     Refresh the timer.
+ */
+static void watchdog_ping(void)
+{
+       *CSR_TIMER4_LOAD = reload;
+}
+
+/*
+ *     Allow only one person to hold it open
+ */
+static int watchdog_open(struct inode *inode, struct file *file)
+{
+       int ret;
+
+       if (*CSR_SA110_CNTL & (1 << 13))
+               return -EBUSY;
+
+       if (test_and_set_bit(1, &timer_alive))
+               return -EBUSY;
+
+       reload = soft_margin * (mem_fclk_21285 / 256);
+
+       *CSR_TIMER4_CLR = 0;
+       watchdog_ping();
+       *CSR_TIMER4_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD
+               | TIMER_CNTL_DIV256;
+
+#ifdef ONLY_TESTING
+       ret = request_irq(IRQ_TIMER4, watchdog_fire, 0, "watchdog", NULL);
+       if (ret) {
+               *CSR_TIMER4_CNTL = 0;
+               clear_bit(1, &timer_alive);
+       }
+#else
+       /*
+        * Setting this bit is irreversible; once enabled, there is
+        * no way to disable the watchdog.
+        */
+       *CSR_SA110_CNTL |= 1 << 13;
+
+       ret = 0;
+#endif
+       nonseekable_open(inode, file);
+       return ret;
+}
+
+/*
+ *     Shut off the timer.
+ *     Note: if we really have enabled the watchdog, there
+ *     is no way to turn off.
+ */
+static int watchdog_release(struct inode *inode, struct file *file)
+{
+#ifdef ONLY_TESTING
+       free_irq(IRQ_TIMER4, NULL);
+       clear_bit(1, &timer_alive);
+#endif
+       return 0;
+}
+
+static ssize_t
+watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+{
+       /*
+        *      Refresh the timer.
+        */
+       if (len)
+               watchdog_ping();
+
+       return len;
+}
+
+static struct watchdog_info ident = {
+       .options        = WDIOF_SETTIMEOUT,
+       .identity       = "Footbridge Watchdog",
+};
+
+static int
+watchdog_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+              unsigned long arg)
+{
+       unsigned int new_margin;
+       int ret = -ENOTTY;
+
+       switch(cmd) {
+       case WDIOC_GETSUPPORT:
+               ret = 0;
+               if (copy_to_user((void *)arg, &ident, sizeof(ident)))
+                       ret = -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               ret = put_user(0,(int *)arg);
+               break;
+
+       case WDIOC_KEEPALIVE:
+               watchdog_ping();
+               ret = 0;
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               ret = get_user(new_margin, (int *)arg);
+               if (ret)
+                       break;
+
+               /* Arbitrary, can't find the card's limits */
+               if (new_margin < 0 || new_margin > 60) {
+                       ret = -EINVAL;
+                       break;
+               }
+
+               soft_margin = new_margin;
+               reload = soft_margin * (mem_fclk_21285 / 256);
+               watchdog_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               ret = put_user(soft_margin, (int *)arg);
+               break;
+       }
+       return ret;
+}
+
+static const struct file_operations watchdog_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = watchdog_write,
+       .ioctl          = watchdog_ioctl,
+       .open           = watchdog_open,
+       .release        = watchdog_release,
+};
+
+static struct miscdevice watchdog_miscdev = {
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &watchdog_fops,
+};
+
+static int __init footbridge_watchdog_init(void)
+{
+       int retval;
+
+       if (machine_is_netwinder())
+               return -ENODEV;
+
+       retval = misc_register(&watchdog_miscdev);
+       if (retval < 0)
+               return retval;
+
+       printk("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
+              soft_margin);
+
+       if (machine_is_cats())
+               printk("Warning: Watchdog reset may not work on this machine.\n");
+       return 0;
+}
+
+static void __exit footbridge_watchdog_exit(void)
+{
+       misc_deregister(&watchdog_miscdev);
+}
+
+MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>");
+MODULE_DESCRIPTION("Footbridge watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+module_param(soft_margin, int, 0);
+MODULE_PARM_DESC(soft_margin,"Watchdog timeout in seconds");
+
+module_init(footbridge_watchdog_init);
+module_exit(footbridge_watchdog_exit);
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c
new file mode 100644 (file)
index 0000000..7d300ff
--- /dev/null
@@ -0,0 +1,519 @@
+/*
+ *     Wdt977  0.04:   A Watchdog Device for Netwinder W83977AF chip
+ *
+ *     (c) Copyright 1998 Rebel.com (Woody Suwalski <woody@netwinder.org>)
+ *
+ *                     -----------------------
+ *
+ *     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.
+ *
+ *                     -----------------------
+ *      14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
+ *           Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
+ *     19-Dec-2001 Woody Suwalski: Netwinder fixes, ioctl interface
+ *     06-Jan-2002 Woody Suwalski: For compatibility, convert all timeouts
+ *                                 from minutes to seconds.
+ *      07-Jul-2003 Daniele Bellucci: Audit return code of misc_register in
+ *                                    nwwatchdog_init.
+ *      25-Oct-2005 Woody Suwalski: Convert addresses to #defs, add spinlocks
+ *                                 remove limitiation to be used on Netwinders only
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/watchdog.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/mach-types.h>
+#include <asm/uaccess.h>
+
+#define WATCHDOG_VERSION  "0.04"
+#define WATCHDOG_NAME     "Wdt977"
+#define PFX WATCHDOG_NAME ": "
+#define DRIVER_VERSION    WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n"
+
+#define IO_INDEX_PORT  0x370           /* on some systems it can be 0x3F0 */
+#define IO_DATA_PORT   (IO_INDEX_PORT+1)
+
+#define UNLOCK_DATA    0x87
+#define LOCK_DATA      0xAA
+#define DEVICE_REGISTER        0x07
+
+
+#define        DEFAULT_TIMEOUT 60                      /* default timeout in seconds */
+
+static int timeout = DEFAULT_TIMEOUT;
+static int timeoutM;                           /* timeout in minutes */
+static unsigned long timer_alive;
+static int testmode;
+static char expect_close;
+static spinlock_t spinlock;
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")");
+module_param(testmode, int, 0);
+MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+/*
+ * Start the watchdog
+ */
+
+static int wdt977_start(void)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+
+       /* select device Aux2 (device=8) and set watchdog regs F2, F3 and F4
+        * F2 has the timeout in minutes
+        * F3 could be set to the POWER LED blink (with GP17 set to PowerLed)
+        *   at timeout, and to reset timer on kbd/mouse activity (not impl.)
+        * F4 is used to just clear the TIMEOUT'ed state (bit 0)
+        */
+       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
+       outb_p(0x08, IO_DATA_PORT);
+       outb_p(0xF2, IO_INDEX_PORT);
+       outb_p(timeoutM, IO_DATA_PORT);
+       outb_p(0xF3, IO_INDEX_PORT);
+       outb_p(0x00, IO_DATA_PORT);     /* another setting is 0E for kbd/mouse/LED */
+       outb_p(0xF4, IO_INDEX_PORT);
+       outb_p(0x00, IO_DATA_PORT);
+
+       /* at last select device Aux1 (dev=7) and set GP16 as a watchdog output */
+       /* in test mode watch the bit 1 on F4 to indicate "triggered" */
+       if (!testmode)
+       {
+               outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
+               outb_p(0x07, IO_DATA_PORT);
+               outb_p(0xE6, IO_INDEX_PORT);
+               outb_p(0x08, IO_DATA_PORT);
+       }
+
+       /* lock the SuperIO chip */
+       outb_p(LOCK_DATA, IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+       printk(KERN_INFO PFX "activated.\n");
+
+       return 0;
+}
+
+/*
+ * Stop the watchdog
+ */
+
+static int wdt977_stop(void)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+
+       /* select device Aux2 (device=8) and set watchdog regs F2,F3 and F4
+       * F3 is reset to its default state
+       * F4 can clear the TIMEOUT'ed state (bit 0) - back to default
+       * We can not use GP17 as a PowerLed, as we use its usage as a RedLed
+       */
+       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
+       outb_p(0x08, IO_DATA_PORT);
+       outb_p(0xF2, IO_INDEX_PORT);
+       outb_p(0xFF, IO_DATA_PORT);
+       outb_p(0xF3, IO_INDEX_PORT);
+       outb_p(0x00, IO_DATA_PORT);
+       outb_p(0xF4, IO_INDEX_PORT);
+       outb_p(0x00, IO_DATA_PORT);
+       outb_p(0xF2, IO_INDEX_PORT);
+       outb_p(0x00, IO_DATA_PORT);
+
+       /* at last select device Aux1 (dev=7) and set GP16 as a watchdog output */
+       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
+       outb_p(0x07, IO_DATA_PORT);
+       outb_p(0xE6, IO_INDEX_PORT);
+       outb_p(0x08, IO_DATA_PORT);
+
+       /* lock the SuperIO chip */
+       outb_p(LOCK_DATA, IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+       printk(KERN_INFO PFX "shutdown.\n");
+
+       return 0;
+}
+
+/*
+ * Send a keepalive ping to the watchdog
+ * This is done by simply re-writing the timeout to reg. 0xF2
+ */
+
+static int wdt977_keepalive(void)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+
+       /* select device Aux2 (device=8) and kicks watchdog reg F2 */
+       /* F2 has the timeout in minutes */
+       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
+       outb_p(0x08, IO_DATA_PORT);
+       outb_p(0xF2, IO_INDEX_PORT);
+       outb_p(timeoutM, IO_DATA_PORT);
+
+       /* lock the SuperIO chip */
+       outb_p(LOCK_DATA, IO_INDEX_PORT);
+       spin_unlock_irqrestore(&spinlock, flags);
+
+       return 0;
+}
+
+/*
+ * Set the watchdog timeout value
+ */
+
+static int wdt977_set_timeout(int t)
+{
+       int tmrval;
+
+       /* convert seconds to minutes, rounding up */
+       tmrval = (t + 59) / 60;
+
+       if (machine_is_netwinder()) {
+               /* we have a hw bug somewhere, so each 977 minute is actually only 30sec
+                *  this limits the max timeout to half of device max of 255 minutes...
+                */
+               tmrval += tmrval;
+       }
+
+       if ((tmrval < 1) || (tmrval > 255))
+               return -EINVAL;
+
+       /* timeout is the timeout in seconds, timeoutM is the timeout in minutes) */
+       timeout = t;
+       timeoutM = tmrval;
+       return 0;
+}
+
+/*
+ * Get the watchdog status
+ */
+
+static int wdt977_get_status(int *status)
+{
+       int new_status;
+       unsigned long flags;
+
+       spin_lock_irqsave(&spinlock, flags);
+
+       /* unlock the SuperIO chip */
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+       outb_p(UNLOCK_DATA, IO_INDEX_PORT);
+
+       /* select device Aux2 (device=8) and read watchdog reg F4 */
+       outb_p(DEVICE_REGISTER, IO_INDEX_PORT);
+       outb_p(0x08, IO_DATA_PORT);
+       outb_p(0xF4, IO_INDEX_PORT);
+       new_status = inb_p(IO_DATA_PORT);
+
+       /* lock the SuperIO chip */
+       outb_p(LOCK_DATA, IO_INDEX_PORT);
+
+       spin_unlock_irqrestore(&spinlock, flags);
+
+       *status=0;
+       if (new_status & 1)
+               *status |= WDIOF_CARDRESET;
+
+       return 0;
+}
+
+
+/*
+ *     /dev/watchdog handling
+ */
+
+static int wdt977_open(struct inode *inode, struct file *file)
+{
+       /* If the watchdog is alive we don't need to start it again */
+       if( test_and_set_bit(0,&timer_alive) )
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       wdt977_start();
+       return nonseekable_open(inode, file);
+}
+
+static int wdt977_release(struct inode *inode, struct file *file)
+{
+       /*
+        *      Shut off the timer.
+        *      Lock it in if it's a module and we set nowayout
+        */
+       if (expect_close == 42)
+       {
+               wdt977_stop();
+               clear_bit(0,&timer_alive);
+       } else {
+               wdt977_keepalive();
+               printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+       }
+       expect_close = 0;
+       return 0;
+}
+
+
+/*
+ *      wdt977_write:
+ *      @file: file handle to the watchdog
+ *      @buf: buffer to write (unused as data does not matter here
+ *      @count: count of bytes
+ *      @ppos: pointer to the position to write. No seeks allowed
+ *
+ *      A write to a watchdog device is defined as a keepalive signal. Any
+ *      write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t wdt977_write(struct file *file, const char __user *buf,
+                           size_t count, loff_t *ppos)
+{
+       if (count)
+       {
+               if (!nowayout)
+               {
+                       size_t i;
+
+                       /* In case it was set long ago */
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++)
+                       {
+                               char c;
+                               if (get_user(c, buf + i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should restart timer */
+               wdt977_keepalive();
+       }
+       return count;
+}
+
+/*
+ *      wdt977_ioctl:
+ *      @inode: inode of the device
+ *      @file: file handle to the device
+ *      @cmd: watchdog command
+ *      @arg: argument pointer
+ *
+ *      The watchdog API defines a common set of functions for all watchdogs
+ *      according to their available features.
+ */
+
+static struct watchdog_info ident = {
+       .options =              WDIOF_SETTIMEOUT |
+                               WDIOF_MAGICCLOSE |
+                               WDIOF_KEEPALIVEPING,
+       .firmware_version =     1,
+       .identity =             WATCHDOG_NAME,
+};
+
+static int wdt977_ioctl(struct inode *inode, struct file *file,
+       unsigned int cmd, unsigned long arg)
+{
+       int status;
+       int new_options, retval = -EINVAL;
+       int new_timeout;
+       union {
+               struct watchdog_info __user *ident;
+               int __user *i;
+       } uarg;
+
+       uarg.i = (int __user *)arg;
+
+       switch(cmd)
+       {
+       default:
+               return -ENOTTY;
+
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(uarg.ident, &ident,
+                       sizeof(ident)) ? -EFAULT : 0;
+
+       case WDIOC_GETSTATUS:
+               wdt977_get_status(&status);
+               return put_user(status, uarg.i);
+
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, uarg.i);
+
+       case WDIOC_KEEPALIVE:
+               wdt977_keepalive();
+               return 0;
+
+       case WDIOC_SETOPTIONS:
+               if (get_user (new_options, uarg.i))
+                       return -EFAULT;
+
+               if (new_options & WDIOS_DISABLECARD) {
+                       wdt977_stop();
+                       retval = 0;
+               }
+
+               if (new_options & WDIOS_ENABLECARD) {
+                       wdt977_start();
+                       retval = 0;
+               }
+
+               return retval;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, uarg.i))
+                       return -EFAULT;
+
+               if (wdt977_set_timeout(new_timeout))
+                   return -EINVAL;
+
+               wdt977_keepalive();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, uarg.i);
+
+       }
+}
+
+static int wdt977_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if(code==SYS_DOWN || code==SYS_HALT)
+               wdt977_stop();
+       return NOTIFY_DONE;
+}
+
+static const struct file_operations wdt977_fops=
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdt977_write,
+       .ioctl          = wdt977_ioctl,
+       .open           = wdt977_open,
+       .release        = wdt977_release,
+};
+
+static struct miscdevice wdt977_miscdev=
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &wdt977_fops,
+};
+
+static struct notifier_block wdt977_notifier = {
+       .notifier_call = wdt977_notify_sys,
+};
+
+static int __init wd977_init(void)
+{
+       int rc;
+
+       //if (!machine_is_netwinder())
+       //      return -ENODEV;
+
+       printk(KERN_INFO PFX DRIVER_VERSION);
+
+       spin_lock_init(&spinlock);
+
+       /* Check that the timeout value is within it's range ; if not reset to the default */
+       if (wdt977_set_timeout(timeout))
+       {
+               wdt977_set_timeout(DEFAULT_TIMEOUT);
+               printk(KERN_INFO PFX "timeout value must be 60<timeout<15300, using %d\n",
+                       DEFAULT_TIMEOUT);
+       }
+
+       /* on Netwinder the IOports are already reserved by
+        * arch/arm/mach-footbridge/netwinder-hw.c
+        */
+       if (!machine_is_netwinder())
+       {
+               if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME))
+               {
+                       printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
+                               IO_INDEX_PORT);
+                       rc = -EIO;
+                       goto err_out;
+               }
+       }
+
+       rc = misc_register(&wdt977_miscdev);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       wdt977_miscdev.minor, rc);
+               goto err_out_region;
+       }
+
+       rc = register_reboot_notifier(&wdt977_notifier);
+       if (rc)
+       {
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
+               goto err_out_miscdev;
+       }
+
+       printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n",
+               timeout, nowayout, testmode);
+
+       return 0;
+
+err_out_miscdev:
+        misc_deregister(&wdt977_miscdev);
+err_out_region:
+       if (!machine_is_netwinder())
+               release_region(IO_INDEX_PORT,2);
+err_out:
+       return rc;
+}
+
+static void __exit wd977_exit(void)
+{
+       wdt977_stop();
+       misc_deregister(&wdt977_miscdev);
+       unregister_reboot_notifier(&wdt977_notifier);
+       release_region(IO_INDEX_PORT,2);
+}
+
+module_init(wd977_init);
+module_exit(wd977_exit);
+
+MODULE_AUTHOR("Woody Suwalski <woodys@xandros.com>");
+MODULE_DESCRIPTION("W83977AF Watchdog driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c
new file mode 100644 (file)
index 0000000..6baf4ae
--- /dev/null
@@ -0,0 +1,756 @@
+/*
+ *     Industrial Computer Source PCI-WDT500/501 driver
+ *
+ *     (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.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 the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ *
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
+ *
+ *     Release 0.10.
+ *
+ *     Fixes
+ *             Dave Gregorich  :       Modularisation and minor bugs
+ *             Alan Cox        :       Added the watchdog ioctl() stuff
+ *             Alan Cox        :       Fixed the reboot problem (as noted by
+ *                                     Matt Crocker).
+ *             Alan Cox        :       Added wdt= boot option
+ *             Alan Cox        :       Cleaned up copy/user stuff
+ *             Tim Hockin      :       Added insmod parameters, comment cleanup
+ *                                     Parameterized timeout
+ *             JP Nollmann     :       Added support for PCI wdt501p
+ *             Alan Cox        :       Split ISA and PCI cards into two drivers
+ *             Jeff Garzik     :       PCI cleanups
+ *             Tigran Aivazian :       Restructured wdtpci_init_one() to handle failures
+ *             Joel Becker     :       Added WDIOC_GET/SETTIMEOUT
+ *             Zwane Mwaikambo :       Magic char closing, locking changes, cleanups
+ *             Matt Domsch     :       nowayout module option
+ */
+
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/pci.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define WDT_IS_PCI
+#include "wd501p.h"
+
+#define PFX "wdt_pci: "
+
+/*
+ * Until Access I/O gets their application for a PCI vendor ID approved,
+ * I don't think that it's appropriate to move these constants into the
+ * regular pci_ids.h file. -- JPN 2000/01/18
+ */
+
+#ifndef PCI_VENDOR_ID_ACCESSIO
+#define PCI_VENDOR_ID_ACCESSIO 0x494f
+#endif
+#ifndef PCI_DEVICE_ID_WDG_CSM
+#define PCI_DEVICE_ID_WDG_CSM 0x22c0
+#endif
+
+/* We can only use 1 card due to the /dev/watchdog restriction */
+static int dev_count;
+
+static struct semaphore open_sem;
+static spinlock_t wdtpci_lock;
+static char expect_close;
+
+static int io;
+static int irq;
+
+/* Default timeout */
+#define WD_TIMO 60                     /* Default heartbeat = 60 seconds */
+
+static int heartbeat = WD_TIMO;
+static int wd_heartbeat;
+module_param(heartbeat, int, 0);
+MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+#ifdef CONFIG_WDT_501_PCI
+/* Support for the Fan Tachometer on the PCI-WDT501 */
+static int tachometer;
+
+module_param(tachometer, int, 0);
+MODULE_PARM_DESC(tachometer, "PCI-WDT501 Fan Tachometer support (0=disable, default=0)");
+#endif /* CONFIG_WDT_501_PCI */
+
+/*
+ *     Programming support
+ */
+
+static void wdtpci_ctr_mode(int ctr, int mode)
+{
+       ctr<<=6;
+       ctr|=0x30;
+       ctr|=(mode<<1);
+       outb_p(ctr, WDT_CR);
+}
+
+static void wdtpci_ctr_load(int ctr, int val)
+{
+       outb_p(val&0xFF, WDT_COUNT0+ctr);
+       outb_p(val>>8, WDT_COUNT0+ctr);
+}
+
+/**
+ *     wdtpci_start:
+ *
+ *     Start the watchdog driver.
+ */
+
+static int wdtpci_start(void)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&wdtpci_lock, flags);
+
+       /*
+        * "pet" the watchdog, as Access says.
+        * This resets the clock outputs.
+        */
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       wdtpci_ctr_mode(2,0);           /* Program CTR2 for Mode 0: Pulse on Terminal Count */
+       outb_p(0, WDT_DC);              /* Enable watchdog */
+
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       outb_p(0, WDT_CLOCK);           /* 2.0833MHz clock */
+       inb_p(WDT_BUZZER);              /* disable */
+       inb_p(WDT_OPTONOTRST);          /* disable */
+       inb_p(WDT_OPTORST);             /* disable */
+       inb_p(WDT_PROGOUT);             /* disable */
+       wdtpci_ctr_mode(0,3);           /* Program CTR0 for Mode 3: Square Wave Generator */
+       wdtpci_ctr_mode(1,2);           /* Program CTR1 for Mode 2: Rate Generator */
+       wdtpci_ctr_mode(2,1);           /* Program CTR2 for Mode 1: Retriggerable One-Shot */
+       wdtpci_ctr_load(0,20833);       /* count at 100Hz */
+       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
+       /* DO NOT LOAD CTR2 on PCI card! -- JPN */
+       outb_p(0, WDT_DC);              /* Enable watchdog */
+
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
+       return 0;
+}
+
+/**
+ *     wdtpci_stop:
+ *
+ *     Stop the watchdog driver.
+ */
+
+static int wdtpci_stop (void)
+{
+       unsigned long flags;
+
+       /* Turn the card off */
+       spin_lock_irqsave(&wdtpci_lock, flags);
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       wdtpci_ctr_load(2,0);           /* 0 length reset pulses now */
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
+       return 0;
+}
+
+/**
+ *     wdtpci_ping:
+ *
+ *     Reload counter one with the watchdog heartbeat. We don't bother reloading
+ *     the cascade counter.
+ */
+
+static int wdtpci_ping(void)
+{
+       unsigned long flags;
+
+       /* Write a watchdog value */
+       spin_lock_irqsave(&wdtpci_lock, flags);
+       inb_p(WDT_DC);                  /* Disable watchdog */
+       wdtpci_ctr_mode(1,2);           /* Re-Program CTR1 for Mode 2: Rate Generator */
+       wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */
+       outb_p(0, WDT_DC);              /* Enable watchdog */
+       spin_unlock_irqrestore(&wdtpci_lock, flags);
+       return 0;
+}
+
+/**
+ *     wdtpci_set_heartbeat:
+ *     @t:             the new heartbeat value that needs to be set.
+ *
+ *     Set a new heartbeat value for the watchdog device. If the heartbeat value is
+ *     incorrect we keep the old value and return -EINVAL. If successfull we
+ *     return 0.
+ */
+static int wdtpci_set_heartbeat(int t)
+{
+       /* Arbitrary, can't find the card's limits */
+       if ((t < 1) || (t > 65535))
+               return -EINVAL;
+
+       heartbeat = t;
+       wd_heartbeat = t * 100;
+       return 0;
+}
+
+/**
+ *     wdtpci_get_status:
+ *     @status:                the new status.
+ *
+ *     Extract the status information from a WDT watchdog device. There are
+ *     several board variants so we have to know which bits are valid. Some
+ *     bits default to one and some to zero in order to be maximally painful.
+ *
+ *     we then map the bits onto the status ioctl flags.
+ */
+
+static int wdtpci_get_status(int *status)
+{
+       unsigned char new_status=inb_p(WDT_SR);
+
+       *status=0;
+       if (new_status & WDC_SR_ISOI0)
+               *status |= WDIOF_EXTERN1;
+       if (new_status & WDC_SR_ISII1)
+               *status |= WDIOF_EXTERN2;
+#ifdef CONFIG_WDT_501_PCI
+       if (!(new_status & WDC_SR_TGOOD))
+               *status |= WDIOF_OVERHEAT;
+       if (!(new_status & WDC_SR_PSUOVER))
+               *status |= WDIOF_POWEROVER;
+       if (!(new_status & WDC_SR_PSUUNDR))
+               *status |= WDIOF_POWERUNDER;
+       if (tachometer) {
+               if (!(new_status & WDC_SR_FANGOOD))
+                       *status |= WDIOF_FANFAULT;
+       }
+#endif /* CONFIG_WDT_501_PCI */
+       return 0;
+}
+
+#ifdef CONFIG_WDT_501_PCI
+/**
+ *     wdtpci_get_temperature:
+ *
+ *     Reports the temperature in degrees Fahrenheit. The API is in
+ *     farenheit. It was designed by an imperial measurement luddite.
+ */
+
+static int wdtpci_get_temperature(int *temperature)
+{
+       unsigned short c=inb_p(WDT_RT);
+
+       *temperature = (c * 11 / 15) + 7;
+       return 0;
+}
+#endif /* CONFIG_WDT_501_PCI */
+
+/**
+ *     wdtpci_interrupt:
+ *     @irq:           Interrupt number
+ *     @dev_id:        Unused as we don't allow multiple devices.
+ *
+ *     Handle an interrupt from the board. These are raised when the status
+ *     map changes in what the board considers an interesting way. That means
+ *     a failure condition occurring.
+ */
+
+static irqreturn_t wdtpci_interrupt(int irq, void *dev_id)
+{
+       /*
+        *      Read the status register see what is up and
+        *      then printk it.
+        */
+       unsigned char status=inb_p(WDT_SR);
+
+       printk(KERN_CRIT PFX "status %d\n", status);
+
+#ifdef CONFIG_WDT_501_PCI
+       if (!(status & WDC_SR_TGOOD))
+               printk(KERN_CRIT PFX "Overheat alarm.(%d)\n",inb_p(WDT_RT));
+       if (!(status & WDC_SR_PSUOVER))
+               printk(KERN_CRIT PFX "PSU over voltage.\n");
+       if (!(status & WDC_SR_PSUUNDR))
+               printk(KERN_CRIT PFX "PSU under voltage.\n");
+       if (tachometer) {
+               if (!(status & WDC_SR_FANGOOD))
+                       printk(KERN_CRIT PFX "Possible fan fault.\n");
+       }
+#endif /* CONFIG_WDT_501_PCI */
+       if (!(status&WDC_SR_WCCR))
+#ifdef SOFTWARE_REBOOT
+#ifdef ONLY_TESTING
+               printk(KERN_CRIT PFX "Would Reboot.\n");
+#else
+               printk(KERN_CRIT PFX "Initiating system reboot.\n");
+               emergency_restart(NULL);
+#endif
+#else
+               printk(KERN_CRIT PFX "Reset in 5ms.\n");
+#endif
+       return IRQ_HANDLED;
+}
+
+
+/**
+ *     wdtpci_write:
+ *     @file: file handle to the watchdog
+ *     @buf: buffer to write (unused as data does not matter here
+ *     @count: count of bytes
+ *     @ppos: pointer to the position to write. No seeks allowed
+ *
+ *     A write to a watchdog device is defined as a keepalive signal. Any
+ *     write of data will do, as we we don't define content meaning.
+ */
+
+static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if(get_user(c, buf+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               wdtpci_ping();
+       }
+
+       return count;
+}
+
+/**
+ *     wdtpci_ioctl:
+ *     @inode: inode of the device
+ *     @file: file handle to the device
+ *     @cmd: watchdog command
+ *     @arg: argument pointer
+ *
+ *     The watchdog API defines a common set of functions for all watchdogs
+ *     according to their available features. We only actually usefully support
+ *     querying capabilities and current status.
+ */
+
+static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+       unsigned long arg)
+{
+       int new_heartbeat;
+       int status;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+
+       static struct watchdog_info ident = {
+               .options =              WDIOF_SETTIMEOUT|
+                                       WDIOF_MAGICCLOSE|
+                                       WDIOF_KEEPALIVEPING,
+               .firmware_version =     1,
+               .identity =             "PCI-WDT500/501",
+       };
+
+       /* Add options according to the card we have */
+       ident.options |= (WDIOF_EXTERN1|WDIOF_EXTERN2);
+#ifdef CONFIG_WDT_501_PCI
+       ident.options |= (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER);
+       if (tachometer)
+               ident.options |= WDIOF_FANFAULT;
+#endif /* CONFIG_WDT_501_PCI */
+
+       switch(cmd)
+       {
+               default:
+                       return -ENOTTY;
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
+
+               case WDIOC_GETSTATUS:
+                       wdtpci_get_status(&status);
+                       return put_user(status, p);
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, p);
+               case WDIOC_KEEPALIVE:
+                       wdtpci_ping();
+                       return 0;
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_heartbeat, p))
+                               return -EFAULT;
+
+                       if (wdtpci_set_heartbeat(new_heartbeat))
+                               return -EINVAL;
+
+                       wdtpci_ping();
+                       /* Fall */
+               case WDIOC_GETTIMEOUT:
+                       return put_user(heartbeat, p);
+       }
+}
+
+/**
+ *     wdtpci_open:
+ *     @inode: inode of device
+ *     @file: file handle to device
+ *
+ *     The watchdog device has been opened. The watchdog device is single
+ *     open and on opening we load the counters. Counter zero is a 100Hz
+ *     cascade, into counter 1 which downcounts to reboot. When the counter
+ *     triggers counter 2 downcounts the length of the reset pulse which
+ *     set set to be as long as possible.
+ */
+
+static int wdtpci_open(struct inode *inode, struct file *file)
+{
+       if (down_trylock(&open_sem))
+               return -EBUSY;
+
+       if (nowayout) {
+               __module_get(THIS_MODULE);
+       }
+       /*
+        *      Activate
+        */
+       wdtpci_start();
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     wdtpci_release:
+ *     @inode: inode to board
+ *     @file: file handle to board
+ *
+ *     The watchdog has a configurable API. There is a religious dispute
+ *     between people who want their watchdog to be able to shut down and
+ *     those who want to be sure if the watchdog manager dies the machine
+ *     reboots. In the former case we disable the counters, in the latter
+ *     case you have to open it again very soon.
+ */
+
+static int wdtpci_release(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               wdtpci_stop();
+       } else {
+               printk(KERN_CRIT PFX "Unexpected close, not stopping timer!");
+               wdtpci_ping();
+       }
+       expect_close = 0;
+       up(&open_sem);
+       return 0;
+}
+
+#ifdef CONFIG_WDT_501_PCI
+/**
+ *     wdtpci_temp_read:
+ *     @file: file handle to the watchdog board
+ *     @buf: buffer to write 1 byte into
+ *     @count: length of buffer
+ *     @ptr: offset (no seek allowed)
+ *
+ *     Read reports the temperature in degrees Fahrenheit. The API is in
+ *     fahrenheit. It was designed by an imperial measurement luddite.
+ */
+
+static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+{
+       int temperature;
+
+       if (wdtpci_get_temperature(&temperature))
+               return -EFAULT;
+
+       if (copy_to_user (buf, &temperature, 1))
+               return -EFAULT;
+
+       return 1;
+}
+
+/**
+ *     wdtpci_temp_open:
+ *     @inode: inode of device
+ *     @file: file handle to device
+ *
+ *     The temperature device has been opened.
+ */
+
+static int wdtpci_temp_open(struct inode *inode, struct file *file)
+{
+       return nonseekable_open(inode, file);
+}
+
+/**
+ *     wdtpci_temp_release:
+ *     @inode: inode to board
+ *     @file: file handle to board
+ *
+ *     The temperature device has been closed.
+ */
+
+static int wdtpci_temp_release(struct inode *inode, struct file *file)
+{
+       return 0;
+}
+#endif /* CONFIG_WDT_501_PCI */
+
+/**
+ *     notify_sys:
+ *     @this: our notifier block
+ *     @code: the event being reported
+ *     @unused: unused
+ *
+ *     Our notifier is called on system shutdowns. We want to turn the card
+ *     off at reboot otherwise the machine will reboot again during memory
+ *     test or worse yet during the following fsck. This would suck, in fact
+ *     trust me - if it happens it does suck.
+ */
+
+static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if (code==SYS_DOWN || code==SYS_HALT) {
+               /* Turn the card off */
+               wdtpci_stop();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+
+static const struct file_operations wdtpci_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdtpci_write,
+       .ioctl          = wdtpci_ioctl,
+       .open           = wdtpci_open,
+       .release        = wdtpci_release,
+};
+
+static struct miscdevice wdtpci_miscdev = {
+       .minor  = WATCHDOG_MINOR,
+       .name   = "watchdog",
+       .fops   = &wdtpci_fops,
+};
+
+#ifdef CONFIG_WDT_501_PCI
+static const struct file_operations wdtpci_temp_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .read           = wdtpci_temp_read,
+       .open           = wdtpci_temp_open,
+       .release        = wdtpci_temp_release,
+};
+
+static struct miscdevice temp_miscdev = {
+       .minor  = TEMP_MINOR,
+       .name   = "temperature",
+       .fops   = &wdtpci_temp_fops,
+};
+#endif /* CONFIG_WDT_501_PCI */
+
+/*
+ *     The WDT card needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdtpci_notifier = {
+       .notifier_call = wdtpci_notify_sys,
+};
+
+
+static int __devinit wdtpci_init_one (struct pci_dev *dev,
+                                  const struct pci_device_id *ent)
+{
+       int ret = -EIO;
+
+       dev_count++;
+       if (dev_count > 1) {
+               printk (KERN_ERR PFX "this driver only supports 1 device\n");
+               return -ENODEV;
+       }
+
+       if (pci_enable_device (dev)) {
+               printk (KERN_ERR PFX "Not possible to enable PCI Device\n");
+               return -ENODEV;
+       }
+
+       if (pci_resource_start (dev, 2) == 0x0000) {
+               printk (KERN_ERR PFX "No I/O-Address for card detected\n");
+               ret = -ENODEV;
+               goto out_pci;
+       }
+
+       sema_init(&open_sem, 1);
+       spin_lock_init(&wdtpci_lock);
+
+       irq = dev->irq;
+       io = pci_resource_start (dev, 2);
+
+       if (request_region (io, 16, "wdt_pci") == NULL) {
+               printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", io);
+               goto out_pci;
+       }
+
+       if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED,
+                        "wdt_pci", &wdtpci_miscdev)) {
+               printk (KERN_ERR PFX "IRQ %d is not free\n", irq);
+               goto out_reg;
+       }
+
+       printk ("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n",
+               io, irq);
+
+       /* Check that the heartbeat value is within it's range ; if not reset to the default */
+       if (wdtpci_set_heartbeat(heartbeat)) {
+               wdtpci_set_heartbeat(WD_TIMO);
+               printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n",
+                       WD_TIMO);
+       }
+
+       ret = register_reboot_notifier (&wdtpci_notifier);
+       if (ret) {
+               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", ret);
+               goto out_irq;
+       }
+
+#ifdef CONFIG_WDT_501_PCI
+       ret = misc_register (&temp_miscdev);
+       if (ret) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       TEMP_MINOR, ret);
+               goto out_rbt;
+       }
+#endif /* CONFIG_WDT_501_PCI */
+
+       ret = misc_register (&wdtpci_miscdev);
+       if (ret) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto out_misc;
+       }
+
+       printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
+               heartbeat, nowayout);
+#ifdef CONFIG_WDT_501_PCI
+       printk(KERN_INFO "wdt: Fan Tachometer is %s\n", (tachometer ? "Enabled" : "Disabled"));
+#endif /* CONFIG_WDT_501_PCI */
+
+       ret = 0;
+out:
+       return ret;
+
+out_misc:
+#ifdef CONFIG_WDT_501_PCI
+       misc_deregister(&temp_miscdev);
+out_rbt:
+#endif /* CONFIG_WDT_501_PCI */
+       unregister_reboot_notifier(&wdtpci_notifier);
+out_irq:
+       free_irq(irq, &wdtpci_miscdev);
+out_reg:
+       release_region (io, 16);
+out_pci:
+       pci_disable_device(dev);
+       goto out;
+}
+
+
+static void __devexit wdtpci_remove_one (struct pci_dev *pdev)
+{
+       /* here we assume only one device will ever have
+        * been picked up and registered by probe function */
+       misc_deregister(&wdtpci_miscdev);
+#ifdef CONFIG_WDT_501_PCI
+       misc_deregister(&temp_miscdev);
+#endif /* CONFIG_WDT_501_PCI */
+       unregister_reboot_notifier(&wdtpci_notifier);
+       free_irq(irq, &wdtpci_miscdev);
+       release_region(io, 16);
+       pci_disable_device(pdev);
+       dev_count--;
+}
+
+
+static struct pci_device_id wdtpci_pci_tbl[] = {
+       {
+               .vendor    = PCI_VENDOR_ID_ACCESSIO,
+               .device    = PCI_DEVICE_ID_WDG_CSM,
+               .subvendor = PCI_ANY_ID,
+               .subdevice = PCI_ANY_ID,
+       },
+       { 0, }, /* terminate list */
+};
+MODULE_DEVICE_TABLE(pci, wdtpci_pci_tbl);
+
+
+static struct pci_driver wdtpci_driver = {
+       .name           = "wdt_pci",
+       .id_table       = wdtpci_pci_tbl,
+       .probe          = wdtpci_init_one,
+       .remove         = __devexit_p(wdtpci_remove_one),
+};
+
+
+/**
+ *     wdtpci_cleanup:
+ *
+ *     Unload the watchdog. You cannot do this with any file handles open.
+ *     If your watchdog is set to continue ticking on close and you unload
+ *     it, well it keeps ticking. We won't get the interrupt but the board
+ *     will not touch PC memory so all is fine. You just have to load a new
+ *     module in xx seconds or reboot.
+ */
+
+static void __exit wdtpci_cleanup(void)
+{
+       pci_unregister_driver (&wdtpci_driver);
+}
+
+
+/**
+ *     wdtpci_init:
+ *
+ *     Set up the WDT watchdog board. All we have to do is grab the
+ *     resources we require and bitch if anyone beat us to them.
+ *     The open() function will actually kick the board off.
+ */
+
+static int __init wdtpci_init(void)
+{
+       return pci_register_driver (&wdtpci_driver);
+}
+
+
+module_init(wdtpci_init);
+module_exit(wdtpci_cleanup);
+
+MODULE_AUTHOR("JP Nollmann, Alan Cox");
+MODULE_DESCRIPTION("Driver for the ICS PCI-WDT500/501 watchdog cards");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
index 0b769f7c4a483bda7c77b40289c413511999b196..4750de316ad36fbde50524d81beac8f10cfd424f 100644 (file)
@@ -185,13 +185,14 @@ static void otherend_changed(struct xenbus_watch *watch,
        if (!dev->otherend ||
            strncmp(dev->otherend, vec[XS_WATCH_PATH],
                    strlen(dev->otherend))) {
-               dev_dbg(&dev->dev, "Ignoring watch at %s", vec[XS_WATCH_PATH]);
+               dev_dbg(&dev->dev, "Ignoring watch at %s\n",
+                       vec[XS_WATCH_PATH]);
                return;
        }
 
        state = xenbus_read_driver_state(dev->otherend);
 
-       dev_dbg(&dev->dev, "state is %d, (%s), %s, %s",
+       dev_dbg(&dev->dev, "state is %d, (%s), %s, %s\n",
                state, xenbus_strstate(state), dev->otherend_watch.node,
                vec[XS_WATCH_PATH]);
 
index d8062745716ae407fee7948a12a88a6370e5e9aa..e31f3691b151248ee8d3e58d3c24948a61dbe637 100644 (file)
@@ -140,6 +140,7 @@ config EXT4DEV_FS
        tristate "Ext4dev/ext4 extended fs support development (EXPERIMENTAL)"
        depends on EXPERIMENTAL
        select JBD2
+       select CRC16
        help
          Ext4dev is a predecessor filesystem of the next generation
          extended fs ext4, based on ext3 filesystem code. It will be
index d02f43b50a3d83e9fb6e20c8c64bb83df05eb1a3..f12db415c0f6aa7b2776bdbcec1279a35c17da7f 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -710,18 +710,9 @@ static ssize_t aio_run_iocb(struct kiocb *iocb)
 
        /*
         * Now we are all set to call the retry method in async
-        * context. By setting this thread's io_wait context
-        * to point to the wait queue entry inside the currently
-        * running iocb for the duration of the retry, we ensure
-        * that async notification wakeups are queued by the
-        * operation instead of blocking waits, and when notified,
-        * cause the iocb to be kicked for continuation (through
-        * the aio_wake_function callback).
+        * context.
         */
-       BUG_ON(current->io_wait != NULL);
-       current->io_wait = &iocb->ki_wait;
        ret = retry(iocb);
-       current->io_wait = NULL;
 
        if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
                BUG_ON(!list_empty(&iocb->ki_wait.task_list));
@@ -1508,10 +1499,7 @@ static ssize_t aio_setup_iocb(struct kiocb *kiocb)
  *     Simply triggers a retry of the operation via kick_iocb.
  *
  *     This callback is specified in the wait queue entry in
- *     a kiocb (current->io_wait points to this wait queue
- *     entry when an aio operation executes; it is used
- *     instead of a synchronous wait when an i/o blocking
- *     condition is encountered during aio).
+ *     a kiocb.
  *
  * Note:
  * This routine is executed with the wait queue lock held.
index ae58bd3f875f9c92c9599bacebbab85ebdf2c800..966b73e25f82e06f69ad0eca22a3f6fe268c4cd0 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -103,12 +103,11 @@ EXPORT_SYMBOL(inode_setattr);
 int notify_change(struct dentry * dentry, struct iattr * attr)
 {
        struct inode *inode = dentry->d_inode;
-       mode_t mode;
+       mode_t mode = inode->i_mode;
        int error;
        struct timespec now;
        unsigned int ia_valid = attr->ia_valid;
 
-       mode = inode->i_mode;
        now = current_fs_time(inode->i_sb);
 
        attr->ia_ctime = now;
@@ -125,18 +124,25 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
                if (error)
                        return error;
        }
+
+       /*
+        * We now pass ATTR_KILL_S*ID to the lower level setattr function so
+        * that the function has the ability to reinterpret a mode change
+        * that's due to these bits. This adds an implicit restriction that
+        * no function will ever call notify_change with both ATTR_MODE and
+        * ATTR_KILL_S*ID set.
+        */
+       if ((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) &&
+           (ia_valid & ATTR_MODE))
+               BUG();
+
        if (ia_valid & ATTR_KILL_SUID) {
-               attr->ia_valid &= ~ATTR_KILL_SUID;
                if (mode & S_ISUID) {
-                       if (!(ia_valid & ATTR_MODE)) {
-                               ia_valid = attr->ia_valid |= ATTR_MODE;
-                               attr->ia_mode = inode->i_mode;
-                       }
-                       attr->ia_mode &= ~S_ISUID;
+                       ia_valid = attr->ia_valid |= ATTR_MODE;
+                       attr->ia_mode = (inode->i_mode & ~S_ISUID);
                }
        }
        if (ia_valid & ATTR_KILL_SGID) {
-               attr->ia_valid &= ~ ATTR_KILL_SGID;
                if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
                        if (!(ia_valid & ATTR_MODE)) {
                                ia_valid = attr->ia_valid |= ATTR_MODE;
@@ -145,7 +151,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
                        attr->ia_mode &= ~S_ISGID;
                }
        }
-       if (!attr->ia_valid)
+       if (!(attr->ia_valid & ~(ATTR_KILL_SUID | ATTR_KILL_SGID)))
                return 0;
 
        if (ia_valid & ATTR_SIZE)
index 19a9cafb5ddf169ae44183171dfde5db3d243581..be46805972f0b9fc589f6d4dfae59e703f9413cb 100644 (file)
@@ -182,7 +182,7 @@ int autofs_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_toke
 {
        struct autofs_wait_queue *wq, **wql;
 
-       for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
+       for (wql = &sbi->queues; (wq = *wql) != NULL; wql = &wq->next) {
                if ( wq->wait_queue_token == wait_queue_token )
                        break;
        }
index 0d041a9cb348efe59dd71e1d8079e10ae86fa11b..1fe28e4754c2c7b44fc3516d4f633bc1c8d4351c 100644 (file)
@@ -376,7 +376,7 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
        struct autofs_wait_queue *wq, **wql;
 
        mutex_lock(&sbi->wq_mutex);
-       for (wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next) {
+       for (wql = &sbi->queues; (wq = *wql) != NULL; wql = &wq->next) {
                if (wq->wait_queue_token == wait_queue_token)
                        break;
        }
index dd4167762a8edaf847913027a9265e3c293144ac..279f3c5e0ce316bf72e9ddb166a50586da206cfb 100644 (file)
@@ -1538,6 +1538,11 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
        }
 
        time_buf.Attributes = 0;
+
+       /* skip mode change if it's just for clearing setuid/setgid */
+       if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID))
+               attrs->ia_valid &= ~ATTR_MODE;
+
        if (attrs->ia_valid & ATTR_MODE) {
                cFYI(1, ("Mode changed to 0x%x", attrs->ia_mode));
                mode = attrs->ia_mode;
index 6dacd39bf04842c89a53f42de5117fa2ac67bcc3..a4284ccac1f98a41becf824a638819222e1b5ae0 100644 (file)
@@ -3001,7 +3001,7 @@ static int __init init_sys32_ioctl(void)
        int i;
 
        for (i = 0; i < ARRAY_SIZE(ioctl_start); i++) {
-               if (ioctl_start[i].next != 0) {
+               if (ioctl_start[i].next) {
                        printk("ioctl translation %d bad\n",i);
                        return -1;
                }
index 5c817bd0838980c1089ca38d13505c864fb878dc..350680fd7da7db367f7f8699a2dc78a50dce6696 100644 (file)
@@ -148,7 +148,7 @@ static void *cramfs_read(struct super_block *sb, unsigned int offset, unsigned i
 {
        struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping;
        struct page *pages[BLKS_PER_BUF];
-       unsigned i, blocknr, buffer, unread;
+       unsigned i, blocknr, buffer;
        unsigned long devsize;
        char *data;
 
@@ -175,7 +175,6 @@ static void *cramfs_read(struct super_block *sb, unsigned int offset, unsigned i
        devsize = mapping->host->i_size >> PAGE_CACHE_SHIFT;
 
        /* Ok, read in BLKS_PER_BUF pages completely first. */
-       unread = 0;
        for (i = 0; i < BLKS_PER_BUF; i++) {
                struct page *page = NULL;
 
@@ -362,7 +361,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
        if (offset & 3)
                return -EINVAL;
 
-       buf = kmalloc(256, GFP_KERNEL);
+       buf = kmalloc(CRAMFS_MAXPATHLEN, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;
 
@@ -376,7 +375,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                int namelen, error;
 
                mutex_lock(&read_mutex);
-               de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+256);
+               de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
                name = (char *)(de+1);
 
                /*
@@ -426,7 +425,7 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
                char *name;
                int namelen, retval;
 
-               de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+256);
+               de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
                name = (char *)(de+1);
 
                /* Try to take advantage of sorted directories */
index 5701f816faf47e30975b4d2a46baeb6d21c05a38..0b1ab016fa2e513589c004373323c376af1de9ba 100644 (file)
@@ -914,6 +914,14 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
                if (rc < 0)
                        goto out;
        }
+
+       /*
+        * mode change is for clearing setuid/setgid bits. Allow lower fs
+        * to interpret this in its own way.
+        */
+       if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
+               ia->ia_valid &= ~ATTR_MODE;
+
        rc = notify_change(lower_dentry, ia);
 out:
        fsstack_copy_attr_all(inode, lower_inode, NULL);
index 77b9953624f480e37d80fb13010fb3e1bc8b3c51..de61892919549d84d2add0d7db5b8c16de1ca521 100644 (file)
@@ -463,7 +463,7 @@ static void ep_free(struct eventpoll *ep)
         * holding "epmutex" we can be sure that no file cleanup code will hit
         * us during this operation. So we can avoid the lock on "ep->lock".
         */
-       while ((rbp = rb_first(&ep->rbr)) != 0) {
+       while ((rbp = rb_first(&ep->rbr)) != NULL) {
                epi = rb_entry(rbp, struct epitem, rbn);
                ep_remove(ep, epi);
        }
index dd1fd3c0fc05c1bf4593decf9cd692df28558079..a588e23841d4e68323d2604e70ad92ec227923c6 100644 (file)
@@ -47,7 +47,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
        struct inode *inode = dentry->d_inode;
        int ret = 0;
 
-       J_ASSERT(ext3_journal_current_handle() == 0);
+       J_ASSERT(ext3_journal_current_handle() == NULL);
 
        /*
         * data=writeback:
index 2f2b6864db10608c412e8eac665f9c30344324d1..3dec003b773edb069b1269a7e4927fc19aa56040 100644 (file)
@@ -1028,7 +1028,7 @@ struct buffer_head *ext3_getblk(handle_t *handle, struct inode *inode,
                }
                if (buffer_new(&dummy)) {
                        J_ASSERT(create != 0);
-                       J_ASSERT(handle != 0);
+                       J_ASSERT(handle != NULL);
 
                        /*
                         * Now that we do not always journal data, we should
index 771f7ada15d9a9b516fd0782f8ab3ee793cba48d..44de1453c30158e5bc742d2cfc54cf56d5ec0724 100644 (file)
@@ -245,10 +245,10 @@ static int setup_new_group_blocks(struct super_block *sb,
                        brelse(gdb);
                        goto exit_bh;
                }
-               lock_buffer(bh);
-               memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size);
+               lock_buffer(gdb);
+               memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, gdb->b_size);
                set_buffer_uptodate(gdb);
-               unlock_buffer(bh);
+               unlock_buffer(gdb);
                ext3_journal_dirty_metadata(handle, gdb);
                ext3_set_bit(bit, bh->b_data);
                brelse(gdb);
index 141573de7a9a4ca69416c24c0a84aa00e8e1674d..81868c0bc40ef33a236e393234da056089c641c4 100644 (file)
@@ -1620,7 +1620,11 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
                }
 
                brelse (bh);
-               sb_set_blocksize(sb, blocksize);
+               if (!sb_set_blocksize(sb, blocksize)) {
+                       printk(KERN_ERR "EXT3-fs: bad blocksize %d.\n",
+                               blocksize);
+                       goto out_fail;
+               }
                logic_sb_block = (sb_block * EXT3_MIN_BLOCK_SIZE) / blocksize;
                offset = (sb_block * EXT3_MIN_BLOCK_SIZE) % blocksize;
                bh = sb_bread(sb, logic_sb_block);
index b74bf436844187c32cce9cc31ecdce1031a1cc1e..e906b65448e2ed9da721f68056333eacf4386e98 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/quotaops.h>
 #include <linux/buffer_head.h>
 
+#include "group.h"
 /*
  * balloc.c contains the blocks allocation and deallocation routines
  */
@@ -42,6 +43,94 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
 
 }
 
+/* Initializes an uninitialized block bitmap if given, and returns the
+ * number of blocks free in the group. */
+unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
+                               int block_group, struct ext4_group_desc *gdp)
+{
+       unsigned long start;
+       int bit, bit_max;
+       unsigned free_blocks, group_blocks;
+       struct ext4_sb_info *sbi = EXT4_SB(sb);
+
+       if (bh) {
+               J_ASSERT_BH(bh, buffer_locked(bh));
+
+               /* If checksum is bad mark all blocks used to prevent allocation
+                * essentially implementing a per-group read-only flag. */
+               if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
+                       ext4_error(sb, __FUNCTION__,
+                                  "Checksum bad for group %u\n", block_group);
+                       gdp->bg_free_blocks_count = 0;
+                       gdp->bg_free_inodes_count = 0;
+                       gdp->bg_itable_unused = 0;
+                       memset(bh->b_data, 0xff, sb->s_blocksize);
+                       return 0;
+               }
+               memset(bh->b_data, 0, sb->s_blocksize);
+       }
+
+       /* Check for superblock and gdt backups in this group */
+       bit_max = ext4_bg_has_super(sb, block_group);
+
+       if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_META_BG) ||
+           block_group < le32_to_cpu(sbi->s_es->s_first_meta_bg) *
+                         sbi->s_desc_per_block) {
+               if (bit_max) {
+                       bit_max += ext4_bg_num_gdb(sb, block_group);
+                       bit_max +=
+                               le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks);
+               }
+       } else { /* For META_BG_BLOCK_GROUPS */
+               int group_rel = (block_group -
+                                le32_to_cpu(sbi->s_es->s_first_meta_bg)) %
+                               EXT4_DESC_PER_BLOCK(sb);
+               if (group_rel == 0 || group_rel == 1 ||
+                   (group_rel == EXT4_DESC_PER_BLOCK(sb) - 1))
+                       bit_max += 1;
+       }
+
+       if (block_group == sbi->s_groups_count - 1) {
+               /*
+                * Even though mke2fs always initialize first and last group
+                * if some other tool enabled the EXT4_BG_BLOCK_UNINIT we need
+                * to make sure we calculate the right free blocks
+                */
+               group_blocks = ext4_blocks_count(sbi->s_es) -
+                       le32_to_cpu(sbi->s_es->s_first_data_block) -
+                       (EXT4_BLOCKS_PER_GROUP(sb) * (sbi->s_groups_count -1));
+       } else {
+               group_blocks = EXT4_BLOCKS_PER_GROUP(sb);
+       }
+
+       free_blocks = group_blocks - bit_max;
+
+       if (bh) {
+               for (bit = 0; bit < bit_max; bit++)
+                       ext4_set_bit(bit, bh->b_data);
+
+               start = block_group * EXT4_BLOCKS_PER_GROUP(sb) +
+                       le32_to_cpu(sbi->s_es->s_first_data_block);
+
+               /* Set bits for block and inode bitmaps, and inode table */
+               ext4_set_bit(ext4_block_bitmap(sb, gdp) - start, bh->b_data);
+               ext4_set_bit(ext4_inode_bitmap(sb, gdp) - start, bh->b_data);
+               for (bit = (ext4_inode_table(sb, gdp) - start),
+                    bit_max = bit + sbi->s_itb_per_group; bit < bit_max; bit++)
+                       ext4_set_bit(bit, bh->b_data);
+
+               /*
+                * Also if the number of blocks within the group is
+                * less than the blocksize * 8 ( which is the size
+                * of bitmap ), set rest of the block bitmap to 1
+                */
+               mark_bitmap_end(group_blocks, sb->s_blocksize * 8, bh->b_data);
+       }
+
+       return free_blocks - sbi->s_itb_per_group - 2;
+}
+
+
 /*
  * The free blocks are managed by bitmaps.  A file system contains several
  * blocks groups.  Each group contains 1 bitmap block for blocks, 1 bitmap
@@ -119,7 +208,7 @@ block_in_use(ext4_fsblk_t block, struct super_block *sb, unsigned char *map)
  *
  * Return buffer_head on success or NULL in case of failure.
  */
-static struct buffer_head *
+struct buffer_head *
 read_block_bitmap(struct super_block *sb, unsigned int block_group)
 {
        int i;
@@ -127,11 +216,24 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
        struct buffer_head * bh = NULL;
        ext4_fsblk_t bitmap_blk;
 
-       desc = ext4_get_group_desc (sb, block_group, NULL);
+       desc = ext4_get_group_desc(sb, block_group, NULL);
        if (!desc)
                return NULL;
        bitmap_blk = ext4_block_bitmap(sb, desc);
-       bh = sb_bread(sb, bitmap_blk);
+       if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
+               bh = sb_getblk(sb, bitmap_blk);
+               if (!buffer_uptodate(bh)) {
+                       lock_buffer(bh);
+                       if (!buffer_uptodate(bh)) {
+                               ext4_init_block_bitmap(sb, bh, block_group,
+                                                      desc);
+                               set_buffer_uptodate(bh);
+                       }
+                       unlock_buffer(bh);
+               }
+       } else {
+               bh = sb_bread(sb, bitmap_blk);
+       }
        if (!bh)
                ext4_error (sb, __FUNCTION__,
                            "Cannot read block bitmap - "
@@ -627,6 +729,7 @@ do_more:
        desc->bg_free_blocks_count =
                cpu_to_le16(le16_to_cpu(desc->bg_free_blocks_count) +
                        group_freed);
+       desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc);
        spin_unlock(sb_bgl_lock(sbi, block_group));
        percpu_counter_add(&sbi->s_freeblocks_counter, count);
 
@@ -1685,8 +1788,11 @@ allocated:
                        ret_block, goal_hits, goal_attempts);
 
        spin_lock(sb_bgl_lock(sbi, group_no));
+       if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))
+               gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
        gdp->bg_free_blocks_count =
                        cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count)-num);
+       gdp->bg_checksum = ext4_group_desc_csum(sbi, group_no, gdp);
        spin_unlock(sb_bgl_lock(sbi, group_no));
        percpu_counter_sub(&sbi->s_freeblocks_counter, num);
 
index 0fb1e62b20d09e25d89c9cfbf00495212f051afe..f612bef983158f4a82c3d2a4b1211a94e713019a 100644 (file)
@@ -47,9 +47,7 @@ const struct file_operations ext4_dir_operations = {
        .compat_ioctl   = ext4_compat_ioctl,
 #endif
        .fsync          = ext4_sync_file,       /* BKL held */
-#ifdef CONFIG_EXT4_INDEX
        .release        = ext4_release_dir,
-#endif
 };
 
 
@@ -107,7 +105,6 @@ static int ext4_readdir(struct file * filp,
 
        sb = inode->i_sb;
 
-#ifdef CONFIG_EXT4_INDEX
        if (EXT4_HAS_COMPAT_FEATURE(inode->i_sb,
                                    EXT4_FEATURE_COMPAT_DIR_INDEX) &&
            ((EXT4_I(inode)->i_flags & EXT4_INDEX_FL) ||
@@ -123,7 +120,6 @@ static int ext4_readdir(struct file * filp,
                 */
                EXT4_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL;
        }
-#endif
        stored = 0;
        offset = filp->f_pos & (sb->s_blocksize - 1);
 
@@ -232,7 +228,6 @@ out:
        return ret;
 }
 
-#ifdef CONFIG_EXT4_INDEX
 /*
  * These functions convert from the major/minor hash to an f_pos
  * value.
@@ -518,5 +513,3 @@ static int ext4_release_dir (struct inode * inode, struct file * filp)
 
        return 0;
 }
-
-#endif
index 78beb096f57dd616d39d294b681930c4959bfc89..85287742f2ae487562be3a8ac39e40774a5de9d3 100644 (file)
@@ -33,7 +33,7 @@
 #include <linux/fs.h>
 #include <linux/time.h>
 #include <linux/ext4_jbd2.h>
-#include <linux/jbd.h>
+#include <linux/jbd2.h>
 #include <linux/highuid.h>
 #include <linux/pagemap.h>
 #include <linux/quotaops.h>
@@ -52,7 +52,7 @@ static ext4_fsblk_t ext_pblock(struct ext4_extent *ex)
 {
        ext4_fsblk_t block;
 
-       block = le32_to_cpu(ex->ee_start);
+       block = le32_to_cpu(ex->ee_start_lo);
        block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;
        return block;
 }
@@ -65,7 +65,7 @@ static ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
 {
        ext4_fsblk_t block;
 
-       block = le32_to_cpu(ix->ei_leaf);
+       block = le32_to_cpu(ix->ei_leaf_lo);
        block |= ((ext4_fsblk_t) le16_to_cpu(ix->ei_leaf_hi) << 31) << 1;
        return block;
 }
@@ -77,7 +77,7 @@ static ext4_fsblk_t idx_pblock(struct ext4_extent_idx *ix)
  */
 static void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
 {
-       ex->ee_start = cpu_to_le32((unsigned long) (pb & 0xffffffff));
+       ex->ee_start_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
        ex->ee_start_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff);
 }
 
@@ -88,7 +88,7 @@ static void ext4_ext_store_pblock(struct ext4_extent *ex, ext4_fsblk_t pb)
  */
 static void ext4_idx_store_pblock(struct ext4_extent_idx *ix, ext4_fsblk_t pb)
 {
-       ix->ei_leaf = cpu_to_le32((unsigned long) (pb & 0xffffffff));
+       ix->ei_leaf_lo = cpu_to_le32((unsigned long) (pb & 0xffffffff));
        ix->ei_leaf_hi = cpu_to_le16((unsigned long) ((pb >> 31) >> 1) & 0xffff);
 }
 
@@ -1409,8 +1409,7 @@ has_space:
        eh->eh_entries = cpu_to_le16(le16_to_cpu(eh->eh_entries)+1);
        nearex = path[depth].p_ext;
        nearex->ee_block = newext->ee_block;
-       nearex->ee_start = newext->ee_start;
-       nearex->ee_start_hi = newext->ee_start_hi;
+       ext4_ext_store_pblock(nearex, ext_pblock(newext));
        nearex->ee_len = newext->ee_len;
 
 merge:
@@ -2177,7 +2176,6 @@ int ext4_ext_convert_to_initialized(handle_t *handle, struct inode *inode,
        }
        /* ex2: iblock to iblock + maxblocks-1 : initialised */
        ex2->ee_block = cpu_to_le32(iblock);
-       ex2->ee_start = cpu_to_le32(newblock);
        ext4_ext_store_pblock(ex2, newblock);
        ex2->ee_len = cpu_to_le16(allocated);
        if (ex2 != ex)
index 2a167d7131fa38feec17d647bbbdefbb98b6b601..8d50879d1c2c68f23284314ff4fc7c5afe3c0a8e 100644 (file)
@@ -47,7 +47,7 @@ int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync)
        struct inode *inode = dentry->d_inode;
        int ret = 0;
 
-       J_ASSERT(ext4_journal_current_handle() == 0);
+       J_ASSERT(ext4_journal_current_handle() == NULL);
 
        /*
         * data=writeback:
diff --git a/fs/ext4/group.h b/fs/ext4/group.h
new file mode 100644 (file)
index 0000000..1577910
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *  linux/fs/ext4/group.h
+ *
+ * Copyright (C) 2007 Cluster File Systems, Inc
+ *
+ * Author: Andreas Dilger <adilger@clusterfs.com>
+ */
+
+#ifndef _LINUX_EXT4_GROUP_H
+#define _LINUX_EXT4_GROUP_H
+
+extern __le16 ext4_group_desc_csum(struct ext4_sb_info *sbi, __u32 group,
+                                  struct ext4_group_desc *gdp);
+extern int ext4_group_desc_csum_verify(struct ext4_sb_info *sbi, __u32 group,
+                                      struct ext4_group_desc *gdp);
+struct buffer_head *read_block_bitmap(struct super_block *sb,
+                                     unsigned int block_group);
+extern unsigned ext4_init_block_bitmap(struct super_block *sb,
+                                      struct buffer_head *bh, int group,
+                                      struct ext4_group_desc *desc);
+#define ext4_free_blocks_after_init(sb, group, desc)                   \
+               ext4_init_block_bitmap(sb, NULL, group, desc)
+extern unsigned ext4_init_inode_bitmap(struct super_block *sb,
+                                      struct buffer_head *bh, int group,
+                                      struct ext4_group_desc *desc);
+extern void mark_bitmap_end(int start_bit, int end_bit, char *bitmap);
+#endif /* _LINUX_EXT4_GROUP_H */
index d0c7793d939395c2500def60e7aa01a680cf2704..c61f37fd3f05e4d72061791d79600024c858df97 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "xattr.h"
 #include "acl.h"
+#include "group.h"
 
 /*
  * ialloc.c contains the inodes allocation and deallocation routines
  * the free blocks count in the block.
  */
 
+/*
+ * To avoid calling the atomic setbit hundreds or thousands of times, we only
+ * need to use it within a single byte (to ensure we get endianness right).
+ * We can use memset for the rest of the bitmap as there are no other users.
+ */
+void mark_bitmap_end(int start_bit, int end_bit, char *bitmap)
+{
+       int i;
+
+       if (start_bit >= end_bit)
+               return;
+
+       ext4_debug("mark end bits +%d through +%d used\n", start_bit, end_bit);
+       for (i = start_bit; i < ((start_bit + 7) & ~7UL); i++)
+               ext4_set_bit(i, bitmap);
+       if (i < end_bit)
+               memset(bitmap + (i >> 3), 0xff, (end_bit - i) >> 3);
+}
+
+/* Initializes an uninitialized inode bitmap */
+unsigned ext4_init_inode_bitmap(struct super_block *sb,
+                               struct buffer_head *bh, int block_group,
+                               struct ext4_group_desc *gdp)
+{
+       struct ext4_sb_info *sbi = EXT4_SB(sb);
+
+       J_ASSERT_BH(bh, buffer_locked(bh));
+
+       /* If checksum is bad mark all blocks and inodes use to prevent
+        * allocation, essentially implementing a per-group read-only flag. */
+       if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
+               ext4_error(sb, __FUNCTION__, "Checksum bad for group %u\n",
+                          block_group);
+               gdp->bg_free_blocks_count = 0;
+               gdp->bg_free_inodes_count = 0;
+               gdp->bg_itable_unused = 0;
+               memset(bh->b_data, 0xff, sb->s_blocksize);
+               return 0;
+       }
+
+       memset(bh->b_data, 0, (EXT4_INODES_PER_GROUP(sb) + 7) / 8);
+       mark_bitmap_end(EXT4_INODES_PER_GROUP(sb), EXT4_BLOCKS_PER_GROUP(sb),
+                       bh->b_data);
+
+       return EXT4_INODES_PER_GROUP(sb);
+}
 
 /*
  * Read the inode allocation bitmap for a given block_group, reading
@@ -59,8 +106,20 @@ read_inode_bitmap(struct super_block * sb, unsigned long block_group)
        desc = ext4_get_group_desc(sb, block_group, NULL);
        if (!desc)
                goto error_out;
-
-       bh = sb_bread(sb, ext4_inode_bitmap(sb, desc));
+       if (desc->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {
+               bh = sb_getblk(sb, ext4_inode_bitmap(sb, desc));
+               if (!buffer_uptodate(bh)) {
+                       lock_buffer(bh);
+                       if (!buffer_uptodate(bh)) {
+                               ext4_init_inode_bitmap(sb, bh, block_group,
+                                                      desc);
+                               set_buffer_uptodate(bh);
+                       }
+                       unlock_buffer(bh);
+               }
+       } else {
+               bh = sb_bread(sb, ext4_inode_bitmap(sb, desc));
+       }
        if (!bh)
                ext4_error(sb, "read_inode_bitmap",
                            "Cannot read inode bitmap - "
@@ -169,6 +228,8 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
                        if (is_directory)
                                gdp->bg_used_dirs_count = cpu_to_le16(
                                  le16_to_cpu(gdp->bg_used_dirs_count) - 1);
+                       gdp->bg_checksum = ext4_group_desc_csum(sbi,
+                                                       block_group, gdp);
                        spin_unlock(sb_bgl_lock(sbi, block_group));
                        percpu_counter_inc(&sbi->s_freeinodes_counter);
                        if (is_directory)
@@ -435,7 +496,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
        struct ext4_sb_info *sbi;
        int err = 0;
        struct inode *ret;
-       int i;
+       int i, free = 0;
 
        /* Cannot create files in a deleted directory */
        if (!dir || !dir->i_nlink)
@@ -517,11 +578,13 @@ repeat_in_this_group:
        goto out;
 
 got:
-       ino += group * EXT4_INODES_PER_GROUP(sb) + 1;
-       if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
-               ext4_error (sb, "ext4_new_inode",
-                           "reserved inode or inode > inodes count - "
-                           "block_group = %d, inode=%lu", group, ino);
+       ino++;
+       if ((group == 0 && ino < EXT4_FIRST_INO(sb)) ||
+           ino > EXT4_INODES_PER_GROUP(sb)) {
+               ext4_error(sb, __FUNCTION__,
+                          "reserved inode or inode > inodes count - "
+                          "block_group = %d, inode=%lu", group,
+                          ino + group * EXT4_INODES_PER_GROUP(sb));
                err = -EIO;
                goto fail;
        }
@@ -529,13 +592,78 @@ got:
        BUFFER_TRACE(bh2, "get_write_access");
        err = ext4_journal_get_write_access(handle, bh2);
        if (err) goto fail;
+
+       /* We may have to initialize the block bitmap if it isn't already */
+       if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
+           gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
+               struct buffer_head *block_bh = read_block_bitmap(sb, group);
+
+               BUFFER_TRACE(block_bh, "get block bitmap access");
+               err = ext4_journal_get_write_access(handle, block_bh);
+               if (err) {
+                       brelse(block_bh);
+                       goto fail;
+               }
+
+               free = 0;
+               spin_lock(sb_bgl_lock(sbi, group));
+               /* recheck and clear flag under lock if we still need to */
+               if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
+                       gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
+                       free = ext4_free_blocks_after_init(sb, group, gdp);
+                       gdp->bg_free_blocks_count = cpu_to_le16(free);
+               }
+               spin_unlock(sb_bgl_lock(sbi, group));
+
+               /* Don't need to dirty bitmap block if we didn't change it */
+               if (free) {
+                       BUFFER_TRACE(block_bh, "dirty block bitmap");
+                       err = ext4_journal_dirty_metadata(handle, block_bh);
+               }
+
+               brelse(block_bh);
+               if (err)
+                       goto fail;
+       }
+
        spin_lock(sb_bgl_lock(sbi, group));
+       /* If we didn't allocate from within the initialized part of the inode
+        * table then we need to initialize up to this inode. */
+       if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+               if (gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_UNINIT)) {
+                       gdp->bg_flags &= cpu_to_le16(~EXT4_BG_INODE_UNINIT);
+
+                       /* When marking the block group with
+                        * ~EXT4_BG_INODE_UNINIT we don't want to depend
+                        * on the value of bg_itable_unsed even though
+                        * mke2fs could have initialized the same for us.
+                        * Instead we calculated the value below
+                        */
+
+                       free = 0;
+               } else {
+                       free = EXT4_INODES_PER_GROUP(sb) -
+                               le16_to_cpu(gdp->bg_itable_unused);
+               }
+
+               /*
+                * Check the relative inode number against the last used
+                * relative inode number in this group. if it is greater
+                * we need to  update the bg_itable_unused count
+                *
+                */
+               if (ino > free)
+                       gdp->bg_itable_unused =
+                               cpu_to_le16(EXT4_INODES_PER_GROUP(sb) - ino);
+       }
+
        gdp->bg_free_inodes_count =
                cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
        if (S_ISDIR(mode)) {
                gdp->bg_used_dirs_count =
                        cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
        }
+       gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp);
        spin_unlock(sb_bgl_lock(sbi, group));
        BUFFER_TRACE(bh2, "call ext4_journal_dirty_metadata");
        err = ext4_journal_dirty_metadata(handle, bh2);
@@ -557,7 +685,7 @@ got:
                inode->i_gid = current->fsgid;
        inode->i_mode = mode;
 
-       inode->i_ino = ino;
+       inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb);
        /* This is the optimal IO size (for stat), not the fs block size */
        inode->i_blocks = 0;
        inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime =
@@ -573,11 +701,6 @@ got:
        /* dirsync only applies to directories */
        if (!S_ISDIR(mode))
                ei->i_flags &= ~EXT4_DIRSYNC_FL;
-#ifdef EXT4_FRAGMENTS
-       ei->i_faddr = 0;
-       ei->i_frag_no = 0;
-       ei->i_frag_size = 0;
-#endif
        ei->i_file_acl = 0;
        ei->i_dir_acl = 0;
        ei->i_dtime = 0;
index 0df2b1e06d0b75be46a211b24085ea6485c7b7a6..5489703d95738ffb075ed7cb275aab94eb4d74e6 100644 (file)
@@ -1027,7 +1027,7 @@ struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode,
                }
                if (buffer_new(&dummy)) {
                        J_ASSERT(create != 0);
-                       J_ASSERT(handle != 0);
+                       J_ASSERT(handle != NULL);
 
                        /*
                         * Now that we do not always journal data, we should
@@ -2711,11 +2711,6 @@ void ext4_read_inode(struct inode * inode)
        }
        inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
        ei->i_flags = le32_to_cpu(raw_inode->i_flags);
-#ifdef EXT4_FRAGMENTS
-       ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
-       ei->i_frag_no = raw_inode->i_frag;
-       ei->i_frag_size = raw_inode->i_fsize;
-#endif
        ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
        if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
            cpu_to_le32(EXT4_OS_HURD))
@@ -2860,11 +2855,6 @@ static int ext4_do_update_inode(handle_t *handle,
        raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
        raw_inode->i_dtime = cpu_to_le32(ei->i_dtime);
        raw_inode->i_flags = cpu_to_le32(ei->i_flags);
-#ifdef EXT4_FRAGMENTS
-       raw_inode->i_faddr = cpu_to_le32(ei->i_faddr);
-       raw_inode->i_frag = ei->i_frag_no;
-       raw_inode->i_fsize = ei->i_frag_size;
-#endif
        if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
            cpu_to_le32(EXT4_OS_HURD))
                raw_inode->i_file_acl_high =
@@ -3243,12 +3233,14 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
                                                      iloc, handle);
                        if (ret) {
                                EXT4_I(inode)->i_state |= EXT4_STATE_NO_EXPAND;
-                               if (mnt_count != sbi->s_es->s_mnt_count) {
+                               if (mnt_count !=
+                                       le16_to_cpu(sbi->s_es->s_mnt_count)) {
                                        ext4_warning(inode->i_sb, __FUNCTION__,
                                        "Unable to expand inode %lu. Delete"
                                        " some EAs or run e2fsck.",
                                        inode->i_ino);
-                                       mnt_count = sbi->s_es->s_mnt_count;
+                                       mnt_count =
+                                         le16_to_cpu(sbi->s_es->s_mnt_count);
                                }
                        }
                }
index 5fdb862e71c47fb8df885e87e93090141227154a..94ee6f315dc17580c6de82f65d3f58735a29b870 100644 (file)
@@ -144,7 +144,6 @@ struct dx_map_entry
        u16 size;
 };
 
-#ifdef CONFIG_EXT4_INDEX
 static inline unsigned dx_get_block (struct dx_entry *entry);
 static void dx_set_block (struct dx_entry *entry, unsigned value);
 static inline unsigned dx_get_hash (struct dx_entry *entry);
@@ -766,8 +765,6 @@ static void dx_insert_block(struct dx_frame *frame, u32 hash, u32 block)
        dx_set_block(new, block);
        dx_set_count(entries, count + 1);
 }
-#endif
-
 
 static void ext4_update_dx_flag(struct inode *inode)
 {
@@ -869,7 +866,6 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
        name = dentry->d_name.name;
        if (namelen > EXT4_NAME_LEN)
                return NULL;
-#ifdef CONFIG_EXT4_INDEX
        if (is_dx(dir)) {
                bh = ext4_dx_find_entry(dentry, res_dir, &err);
                /*
@@ -881,7 +877,6 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
                        return bh;
                dxtrace(printk("ext4_find_entry: dx failed, falling back\n"));
        }
-#endif
        nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
        start = EXT4_I(dir)->i_dir_start_lookup;
        if (start >= nblocks)
@@ -957,7 +952,6 @@ cleanup_and_exit:
        return ret;
 }
 
-#ifdef CONFIG_EXT4_INDEX
 static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
                       struct ext4_dir_entry_2 **res_dir, int *err)
 {
@@ -1025,7 +1019,6 @@ errout:
        dx_release (frames);
        return NULL;
 }
-#endif
 
 static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd)
 {
@@ -1121,7 +1114,6 @@ static inline void ext4_set_de_type(struct super_block *sb,
                de->file_type = ext4_type_by_mode[(mode & S_IFMT)>>S_SHIFT];
 }
 
-#ifdef CONFIG_EXT4_INDEX
 /*
  * Move count entries from end of map between two memory locations.
  * Returns pointer to last entry moved.
@@ -1266,8 +1258,6 @@ errout:
        *error = err;
        return NULL;
 }
-#endif
-
 
 /*
  * Add a new entry into a directory (leaf) block.  If de is non-NULL,
@@ -1364,7 +1354,6 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
        return 0;
 }
 
-#ifdef CONFIG_EXT4_INDEX
 /*
  * This converts a one block unindexed directory to a 3 block indexed
  * directory, and adds the dentry to the indexed directory.
@@ -1443,7 +1432,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
 
        return add_dirent_to_buf(handle, dentry, inode, de, bh);
 }
-#endif
 
 /*
  *     ext4_add_entry()
@@ -1464,9 +1452,7 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
        struct ext4_dir_entry_2 *de;
        struct super_block * sb;
        int     retval;
-#ifdef CONFIG_EXT4_INDEX
        int     dx_fallback=0;
-#endif
        unsigned blocksize;
        u32 block, blocks;
 
@@ -1474,7 +1460,6 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
        blocksize = sb->s_blocksize;
        if (!dentry->d_name.len)
                return -EINVAL;
-#ifdef CONFIG_EXT4_INDEX
        if (is_dx(dir)) {
                retval = ext4_dx_add_entry(handle, dentry, inode);
                if (!retval || (retval != ERR_BAD_DX_DIR))
@@ -1483,7 +1468,6 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
                dx_fallback++;
                ext4_mark_inode_dirty(handle, dir);
        }
-#endif
        blocks = dir->i_size >> sb->s_blocksize_bits;
        for (block = 0, offset = 0; block < blocks; block++) {
                bh = ext4_bread(handle, dir, block, 0, &retval);
@@ -1493,11 +1477,9 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
                if (retval != -ENOSPC)
                        return retval;
 
-#ifdef CONFIG_EXT4_INDEX
                if (blocks == 1 && !dx_fallback &&
                    EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX))
                        return make_indexed_dir(handle, dentry, inode, bh);
-#endif
                brelse(bh);
        }
        bh = ext4_append(handle, dir, &block, &retval);
@@ -1509,7 +1491,6 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
        return add_dirent_to_buf(handle, dentry, inode, de, bh);
 }
 
-#ifdef CONFIG_EXT4_INDEX
 /*
  * Returns 0 for success, or a negative error value
  */
@@ -1644,7 +1625,6 @@ cleanup:
        dx_release(frames);
        return err;
 }
-#endif
 
 /*
  * ext4_delete_entry deletes a directory entry by merging it with the
index 472fc0d3e1c0776de5e4594321e66b69795bd1ed..bd8a52bb39997576ab2d93e7f3c795262640503e 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 
+#include "group.h"
 
 #define outside(b, first, last)        ((b) < (first) || (b) >= (last))
 #define inside(b, first, last) ((b) >= (first) && (b) < (last))
@@ -140,22 +141,29 @@ static struct buffer_head *bclean(handle_t *handle, struct super_block *sb,
 }
 
 /*
- * To avoid calling the atomic setbit hundreds or thousands of times, we only
- * need to use it within a single byte (to ensure we get endianness right).
- * We can use memset for the rest of the bitmap as there are no other users.
+ * If we have fewer than thresh credits, extend by EXT4_MAX_TRANS_DATA.
+ * If that fails, restart the transaction & regain write access for the
+ * buffer head which is used for block_bitmap modifications.
  */
-static void mark_bitmap_end(int start_bit, int end_bit, char *bitmap)
+static int extend_or_restart_transaction(handle_t *handle, int thresh,
+                                        struct buffer_head *bh)
 {
-       int i;
+       int err;
+
+       if (handle->h_buffer_credits >= thresh)
+               return 0;
 
-       if (start_bit >= end_bit)
-               return;
+       err = ext4_journal_extend(handle, EXT4_MAX_TRANS_DATA);
+       if (err < 0)
+               return err;
+       if (err) {
+               if ((err = ext4_journal_restart(handle, EXT4_MAX_TRANS_DATA)))
+                       return err;
+               if ((err = ext4_journal_get_write_access(handle, bh)))
+                       return err;
+        }
 
-       ext4_debug("mark end bits +%d through +%d used\n", start_bit, end_bit);
-       for (i = start_bit; i < ((start_bit + 7) & ~7UL); i++)
-               ext4_set_bit(i, bitmap);
-       if (i < end_bit)
-               memset(bitmap + (i >> 3), 0xff, (end_bit - i) >> 3);
+       return 0;
 }
 
 /*
@@ -180,8 +188,9 @@ static int setup_new_group_blocks(struct super_block *sb,
        int i;
        int err = 0, err2;
 
-       handle = ext4_journal_start_sb(sb, reserved_gdb + gdblocks +
-                                      2 + sbi->s_itb_per_group);
+       /* This transaction may be extended/restarted along the way */
+       handle = ext4_journal_start_sb(sb, EXT4_MAX_TRANS_DATA);
+
        if (IS_ERR(handle))
                return PTR_ERR(handle);
 
@@ -208,6 +217,9 @@ static int setup_new_group_blocks(struct super_block *sb,
 
                ext4_debug("update backup group %#04lx (+%d)\n", block, bit);
 
+               if ((err = extend_or_restart_transaction(handle, 1, bh)))
+                       goto exit_bh;
+
                gdb = sb_getblk(sb, block);
                if (!gdb) {
                        err = -EIO;
@@ -217,10 +229,10 @@ static int setup_new_group_blocks(struct super_block *sb,
                        brelse(gdb);
                        goto exit_bh;
                }
-               lock_buffer(bh);
-               memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size);
+               lock_buffer(gdb);
+               memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, gdb->b_size);
                set_buffer_uptodate(gdb);
-               unlock_buffer(bh);
+               unlock_buffer(gdb);
                ext4_journal_dirty_metadata(handle, gdb);
                ext4_set_bit(bit, bh->b_data);
                brelse(gdb);
@@ -233,6 +245,9 @@ static int setup_new_group_blocks(struct super_block *sb,
 
                ext4_debug("clear reserved block %#04lx (+%d)\n", block, bit);
 
+               if ((err = extend_or_restart_transaction(handle, 1, bh)))
+                       goto exit_bh;
+
                if (IS_ERR(gdb = bclean(handle, sb, block))) {
                        err = PTR_ERR(bh);
                        goto exit_bh;
@@ -254,6 +269,10 @@ static int setup_new_group_blocks(struct super_block *sb,
                struct buffer_head *it;
 
                ext4_debug("clear inode block %#04lx (+%d)\n", block, bit);
+
+               if ((err = extend_or_restart_transaction(handle, 1, bh)))
+                       goto exit_bh;
+
                if (IS_ERR(it = bclean(handle, sb, block))) {
                        err = PTR_ERR(it);
                        goto exit_bh;
@@ -262,6 +281,10 @@ static int setup_new_group_blocks(struct super_block *sb,
                brelse(it);
                ext4_set_bit(bit, bh->b_data);
        }
+
+       if ((err = extend_or_restart_transaction(handle, 2, bh)))
+               goto exit_bh;
+
        mark_bitmap_end(input->blocks_count, EXT4_BLOCKS_PER_GROUP(sb),
                        bh->b_data);
        ext4_journal_dirty_metadata(handle, bh);
@@ -289,7 +312,6 @@ exit_journal:
        return err;
 }
 
-
 /*
  * Iterate through the groups which hold BACKUP superblock/GDT copies in an
  * ext4 filesystem.  The counters should be initialized to 1, 5, and 7 before
@@ -842,6 +864,7 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
        ext4_inode_table_set(sb, gdp, input->inode_table); /* LV FIXME */
        gdp->bg_free_blocks_count = cpu_to_le16(input->free_blocks_count);
        gdp->bg_free_inodes_count = cpu_to_le16(EXT4_INODES_PER_GROUP(sb));
+       gdp->bg_checksum = ext4_group_desc_csum(sbi, input->group, gdp);
 
        /*
         * Make the new blocks and inodes valid next.  We do this before
index 4c8d31c6145442e3236aa9785b2b6889100bdcad..b11e9e2bcd0117ee80c728c9170a0d2b8b7b6fb5 100644 (file)
 #include <linux/quotaops.h>
 #include <linux/seq_file.h>
 #include <linux/log2.h>
+#include <linux/crc16.h>
 
 #include <asm/uaccess.h>
 
 #include "xattr.h"
 #include "acl.h"
 #include "namei.h"
+#include "group.h"
 
 static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
                             unsigned long journal_devnum);
@@ -68,31 +70,31 @@ static void ext4_write_super_lockfs(struct super_block *sb);
 ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
                               struct ext4_group_desc *bg)
 {
-       return le32_to_cpu(bg->bg_block_bitmap) |
+       return le32_to_cpu(bg->bg_block_bitmap_lo) |
                (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ?
-                (ext4_fsblk_t)le32_to_cpu(bg->bg_block_bitmap_hi) << 32 : 0);
+               (ext4_fsblk_t)le32_to_cpu(bg->bg_block_bitmap_hi) << 32 : 0);
 }
 
 ext4_fsblk_t ext4_inode_bitmap(struct super_block *sb,
                               struct ext4_group_desc *bg)
 {
-       return le32_to_cpu(bg->bg_inode_bitmap) |
+       return le32_to_cpu(bg->bg_inode_bitmap_lo) |
                (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ?
-                (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_bitmap_hi) << 32 : 0);
+               (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_bitmap_hi) << 32 : 0);
 }
 
 ext4_fsblk_t ext4_inode_table(struct super_block *sb,
                              struct ext4_group_desc *bg)
 {
-       return le32_to_cpu(bg->bg_inode_table) |
+       return le32_to_cpu(bg->bg_inode_table_lo) |
                (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ?
-                (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_table_hi) << 32 : 0);
+               (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_table_hi) << 32 : 0);
 }
 
 void ext4_block_bitmap_set(struct super_block *sb,
                           struct ext4_group_desc *bg, ext4_fsblk_t blk)
 {
-       bg->bg_block_bitmap = cpu_to_le32((u32)blk);
+       bg->bg_block_bitmap_lo = cpu_to_le32((u32)blk);
        if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT)
                bg->bg_block_bitmap_hi = cpu_to_le32(blk >> 32);
 }
@@ -100,7 +102,7 @@ void ext4_block_bitmap_set(struct super_block *sb,
 void ext4_inode_bitmap_set(struct super_block *sb,
                           struct ext4_group_desc *bg, ext4_fsblk_t blk)
 {
-       bg->bg_inode_bitmap  = cpu_to_le32((u32)blk);
+       bg->bg_inode_bitmap_lo  = cpu_to_le32((u32)blk);
        if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT)
                bg->bg_inode_bitmap_hi = cpu_to_le32(blk >> 32);
 }
@@ -108,7 +110,7 @@ void ext4_inode_bitmap_set(struct super_block *sb,
 void ext4_inode_table_set(struct super_block *sb,
                          struct ext4_group_desc *bg, ext4_fsblk_t blk)
 {
-       bg->bg_inode_table = cpu_to_le32((u32)blk);
+       bg->bg_inode_table_lo = cpu_to_le32((u32)blk);
        if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT)
                bg->bg_inode_table_hi = cpu_to_le32(blk >> 32);
 }
@@ -1037,7 +1039,7 @@ static int parse_options (char *options, struct super_block *sb,
                        if (option < 0)
                                return 0;
                        if (option == 0)
-                               option = JBD_DEFAULT_MAX_COMMIT_AGE;
+                               option = JBD2_DEFAULT_MAX_COMMIT_AGE;
                        sbi->s_commit_interval = HZ * option;
                        break;
                case Opt_data_journal:
@@ -1308,6 +1310,43 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
        return res;
 }
 
+__le16 ext4_group_desc_csum(struct ext4_sb_info *sbi, __u32 block_group,
+                           struct ext4_group_desc *gdp)
+{
+       __u16 crc = 0;
+
+       if (sbi->s_es->s_feature_ro_compat &
+           cpu_to_le32(EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+               int offset = offsetof(struct ext4_group_desc, bg_checksum);
+               __le32 le_group = cpu_to_le32(block_group);
+
+               crc = crc16(~0, sbi->s_es->s_uuid, sizeof(sbi->s_es->s_uuid));
+               crc = crc16(crc, (__u8 *)&le_group, sizeof(le_group));
+               crc = crc16(crc, (__u8 *)gdp, offset);
+               offset += sizeof(gdp->bg_checksum); /* skip checksum */
+               /* for checksum of struct ext4_group_desc do the rest...*/
+               if ((sbi->s_es->s_feature_incompat &
+                    cpu_to_le32(EXT4_FEATURE_INCOMPAT_64BIT)) &&
+                   offset < le16_to_cpu(sbi->s_es->s_desc_size))
+                       crc = crc16(crc, (__u8 *)gdp + offset,
+                                   le16_to_cpu(sbi->s_es->s_desc_size) -
+                                       offset);
+       }
+
+       return cpu_to_le16(crc);
+}
+
+int ext4_group_desc_csum_verify(struct ext4_sb_info *sbi, __u32 block_group,
+                               struct ext4_group_desc *gdp)
+{
+       if ((sbi->s_es->s_feature_ro_compat &
+            cpu_to_le32(EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) &&
+           (gdp->bg_checksum != ext4_group_desc_csum(sbi, block_group, gdp)))
+               return 0;
+
+       return 1;
+}
+
 /* Called at mount-time, super-block is locked */
 static int ext4_check_descriptors (struct super_block * sb)
 {
@@ -1319,13 +1358,17 @@ static int ext4_check_descriptors (struct super_block * sb)
        ext4_fsblk_t inode_table;
        struct ext4_group_desc * gdp = NULL;
        int desc_block = 0;
+       int flexbg_flag = 0;
        int i;
 
+       if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
+               flexbg_flag = 1;
+
        ext4_debug ("Checking group descriptors");
 
        for (i = 0; i < sbi->s_groups_count; i++)
        {
-               if (i == sbi->s_groups_count - 1)
+               if (i == sbi->s_groups_count - 1 || flexbg_flag)
                        last_block = ext4_blocks_count(sbi->s_es) - 1;
                else
                        last_block = first_block +
@@ -1362,7 +1405,16 @@ static int ext4_check_descriptors (struct super_block * sb)
                                    i, inode_table);
                        return 0;
                }
-               first_block += EXT4_BLOCKS_PER_GROUP(sb);
+               if (!ext4_group_desc_csum_verify(sbi, i, gdp)) {
+                       ext4_error(sb, __FUNCTION__,
+                                  "Checksum for group %d failed (%u!=%u)\n", i,
+                                  le16_to_cpu(ext4_group_desc_csum(sbi, i,
+                                                                   gdp)),
+                                  le16_to_cpu(gdp->bg_checksum));
+                       return 0;
+               }
+               if (!flexbg_flag)
+                       first_block += EXT4_BLOCKS_PER_GROUP(sb);
                gdp = (struct ext4_group_desc *)
                        ((__u8 *)gdp + EXT4_DESC_SIZE(sb));
        }
@@ -1726,14 +1778,6 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE)
                        sb->s_time_gran = 1 << (EXT4_EPOCH_BITS - 2);
        }
-       sbi->s_frag_size = EXT4_MIN_FRAG_SIZE <<
-                                  le32_to_cpu(es->s_log_frag_size);
-       if (blocksize != sbi->s_frag_size) {
-               printk(KERN_ERR
-                      "EXT4-fs: fragsize %lu != blocksize %u (unsupported)\n",
-                      sbi->s_frag_size, blocksize);
-               goto failed_mount;
-       }
        sbi->s_desc_size = le16_to_cpu(es->s_desc_size);
        if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) {
                if (sbi->s_desc_size < EXT4_MIN_DESC_SIZE_64BIT ||
@@ -1747,7 +1791,6 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
        } else
                sbi->s_desc_size = EXT4_MIN_DESC_SIZE;
        sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group);
-       sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
        sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
        if (EXT4_INODE_SIZE(sb) == 0)
                goto cantfind_ext4;
@@ -1771,12 +1814,6 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
                        sbi->s_blocks_per_group);
                goto failed_mount;
        }
-       if (sbi->s_frags_per_group > blocksize * 8) {
-               printk (KERN_ERR
-                       "EXT4-fs: #fragments per group too big: %lu\n",
-                       sbi->s_frags_per_group);
-               goto failed_mount;
-       }
        if (sbi->s_inodes_per_group > blocksize * 8) {
                printk (KERN_ERR
                        "EXT4-fs: #inodes per group too big: %lu\n",
@@ -2630,7 +2667,7 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
 
        if (test_opt(sb, MINIX_DF)) {
                sbi->s_overhead_last = 0;
-       } else if (sbi->s_blocks_last != le32_to_cpu(es->s_blocks_count)) {
+       } else if (sbi->s_blocks_last != ext4_blocks_count(es)) {
                unsigned long ngroups = sbi->s_groups_count, i;
                ext4_fsblk_t overhead = 0;
                smp_rmb();
@@ -2665,14 +2702,14 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
                overhead += ngroups * (2 + sbi->s_itb_per_group);
                sbi->s_overhead_last = overhead;
                smp_wmb();
-               sbi->s_blocks_last = le32_to_cpu(es->s_blocks_count);
+               sbi->s_blocks_last = ext4_blocks_count(es);
        }
 
        buf->f_type = EXT4_SUPER_MAGIC;
        buf->f_bsize = sb->s_blocksize;
        buf->f_blocks = ext4_blocks_count(es) - sbi->s_overhead_last;
        buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter);
-       es->s_free_blocks_count = cpu_to_le32(buf->f_bfree);
+       ext4_free_blocks_count_set(es, buf->f_bfree);
        buf->f_bavail = buf->f_bfree - ext4_r_blocks_count(es);
        if (buf->f_bfree < ext4_r_blocks_count(es))
                buf->f_bavail = 0;
index b10d68fffb551d7b70b8797bfcd41b6de3bfaed4..86387302c2a9b45591e71c8e6900fdde92c09eaf 100644 (file)
@@ -750,12 +750,11 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
                }
        } else {
                /* Allocate a buffer where we construct the new block. */
-               s->base = kmalloc(sb->s_blocksize, GFP_KERNEL);
+               s->base = kzalloc(sb->s_blocksize, GFP_KERNEL);
                /* assert(header == s->base) */
                error = -ENOMEM;
                if (s->base == NULL)
                        goto cleanup;
-               memset(s->base, 0, sb->s_blocksize);
                header(s->base)->h_magic = cpu_to_le32(EXT4_XATTR_MAGIC);
                header(s->base)->h_blocks = cpu_to_le32(1);
                header(s->base)->h_refcount = cpu_to_le32(1);
@@ -1121,7 +1120,7 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
        int total_ino, total_blk;
        void *base, *start, *end;
        int extra_isize = 0, error = 0, tried_min_extra_isize = 0;
-       int s_min_extra_isize = EXT4_SB(inode->i_sb)->s_es->s_min_extra_isize;
+       int s_min_extra_isize = le16_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_min_extra_isize);
 
        down_write(&EXT4_I(inode)->xattr_sem);
 retry:
@@ -1293,7 +1292,7 @@ retry:
 
                i.name = b_entry_name;
                i.value = buffer;
-               i.value_len = cpu_to_le32(size);
+               i.value_len = size;
                error = ext4_xattr_block_find(inode, &i, bs);
                if (error)
                        goto cleanup;
index d1acab931330ba8744058482c1ff5a50e753c62d..3763757f9fe704f088aa83810289929a33b17ad7 100644 (file)
@@ -63,13 +63,21 @@ static u64 time_to_jiffies(unsigned long sec, unsigned long nsec)
  * Set dentry and possibly attribute timeouts from the lookup/mk*
  * replies
  */
-static void fuse_change_timeout(struct dentry *entry, struct fuse_entry_out *o)
+static void fuse_change_entry_timeout(struct dentry *entry,
+                                     struct fuse_entry_out *o)
 {
        fuse_dentry_settime(entry,
                time_to_jiffies(o->entry_valid, o->entry_valid_nsec));
-       if (entry->d_inode)
-               get_fuse_inode(entry->d_inode)->i_time =
-                       time_to_jiffies(o->attr_valid, o->attr_valid_nsec);
+}
+
+static u64 attr_timeout(struct fuse_attr_out *o)
+{
+       return time_to_jiffies(o->attr_valid, o->attr_valid_nsec);
+}
+
+static u64 entry_attr_timeout(struct fuse_entry_out *o)
+{
+       return time_to_jiffies(o->attr_valid, o->attr_valid_nsec);
 }
 
 /*
@@ -108,13 +116,19 @@ static void fuse_lookup_init(struct fuse_req *req, struct inode *dir,
                             struct dentry *entry,
                             struct fuse_entry_out *outarg)
 {
+       struct fuse_conn *fc = get_fuse_conn(dir);
+
+       memset(outarg, 0, sizeof(struct fuse_entry_out));
        req->in.h.opcode = FUSE_LOOKUP;
        req->in.h.nodeid = get_node_id(dir);
        req->in.numargs = 1;
        req->in.args[0].size = entry->d_name.len + 1;
        req->in.args[0].value = entry->d_name.name;
        req->out.numargs = 1;
-       req->out.args[0].size = sizeof(struct fuse_entry_out);
+       if (fc->minor < 9)
+               req->out.args[0].size = FUSE_COMPAT_ENTRY_OUT_SIZE;
+       else
+               req->out.args[0].size = sizeof(struct fuse_entry_out);
        req->out.args[0].value = outarg;
 }
 
@@ -140,6 +154,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                struct fuse_req *req;
                struct fuse_req *forget_req;
                struct dentry *parent;
+               u64 attr_version;
 
                /* For negative dentries, always do a fresh lookup */
                if (!inode)
@@ -156,6 +171,10 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                        return 0;
                }
 
+               spin_lock(&fc->lock);
+               attr_version = fc->attr_version;
+               spin_unlock(&fc->lock);
+
                parent = dget_parent(entry);
                fuse_lookup_init(req, parent->d_inode, entry, &outarg);
                request_send(fc, req);
@@ -180,8 +199,10 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
                        return 0;
 
-               fuse_change_attributes(inode, &outarg.attr);
-               fuse_change_timeout(entry, &outarg);
+               fuse_change_attributes(inode, &outarg.attr,
+                                      entry_attr_timeout(&outarg),
+                                      attr_version);
+               fuse_change_entry_timeout(entry, &outarg);
        }
        return 1;
 }
@@ -228,6 +249,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
        struct fuse_conn *fc = get_fuse_conn(dir);
        struct fuse_req *req;
        struct fuse_req *forget_req;
+       u64 attr_version;
 
        if (entry->d_name.len > FUSE_NAME_MAX)
                return ERR_PTR(-ENAMETOOLONG);
@@ -242,6 +264,10 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
                return ERR_PTR(PTR_ERR(forget_req));
        }
 
+       spin_lock(&fc->lock);
+       attr_version = fc->attr_version;
+       spin_unlock(&fc->lock);
+
        fuse_lookup_init(req, dir, entry, &outarg);
        request_send(fc, req);
        err = req->out.h.error;
@@ -253,7 +279,8 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
                err = -EIO;
        if (!err && outarg.nodeid) {
                inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
-                                 &outarg.attr);
+                                 &outarg.attr, entry_attr_timeout(&outarg),
+                                 attr_version);
                if (!inode) {
                        fuse_send_forget(fc, forget_req, outarg.nodeid, 1);
                        return ERR_PTR(-ENOMEM);
@@ -276,7 +303,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
 
        entry->d_op = &fuse_dentry_operations;
        if (!err)
-               fuse_change_timeout(entry, &outarg);
+               fuse_change_entry_timeout(entry, &outarg);
        else
                fuse_invalidate_entry_cache(entry);
        return NULL;
@@ -335,6 +362,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
 
        flags &= ~O_NOCTTY;
        memset(&inarg, 0, sizeof(inarg));
+       memset(&outentry, 0, sizeof(outentry));
        inarg.flags = flags;
        inarg.mode = mode;
        req->in.h.opcode = FUSE_CREATE;
@@ -345,7 +373,10 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
        req->in.args[1].size = entry->d_name.len + 1;
        req->in.args[1].value = entry->d_name.name;
        req->out.numargs = 2;
-       req->out.args[0].size = sizeof(outentry);
+       if (fc->minor < 9)
+               req->out.args[0].size = FUSE_COMPAT_ENTRY_OUT_SIZE;
+       else
+               req->out.args[0].size = sizeof(outentry);
        req->out.args[0].value = &outentry;
        req->out.args[1].size = sizeof(outopen);
        req->out.args[1].value = &outopen;
@@ -363,7 +394,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
 
        fuse_put_request(fc, req);
        inode = fuse_iget(dir->i_sb, outentry.nodeid, outentry.generation,
-                         &outentry.attr);
+                         &outentry.attr, entry_attr_timeout(&outentry), 0);
        if (!inode) {
                flags &= ~(O_CREAT | O_EXCL | O_TRUNC);
                ff->fh = outopen.fh;
@@ -373,7 +404,7 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
        }
        fuse_put_request(fc, forget_req);
        d_instantiate(entry, inode);
-       fuse_change_timeout(entry, &outentry);
+       fuse_change_entry_timeout(entry, &outentry);
        file = lookup_instantiate_filp(nd, entry, generic_file_open);
        if (IS_ERR(file)) {
                ff->fh = outopen.fh;
@@ -410,9 +441,13 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
                return PTR_ERR(forget_req);
        }
 
+       memset(&outarg, 0, sizeof(outarg));
        req->in.h.nodeid = get_node_id(dir);
        req->out.numargs = 1;
-       req->out.args[0].size = sizeof(outarg);
+       if (fc->minor < 9)
+               req->out.args[0].size = FUSE_COMPAT_ENTRY_OUT_SIZE;
+       else
+               req->out.args[0].size = sizeof(outarg);
        req->out.args[0].value = &outarg;
        request_send(fc, req);
        err = req->out.h.error;
@@ -428,7 +463,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
                goto out_put_forget_req;
 
        inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
-                         &outarg.attr);
+                         &outarg.attr, entry_attr_timeout(&outarg), 0);
        if (!inode) {
                fuse_send_forget(fc, forget_req, outarg.nodeid, 1);
                return -ENOMEM;
@@ -451,7 +486,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
        } else
                d_instantiate(entry, inode);
 
-       fuse_change_timeout(entry, &outarg);
+       fuse_change_entry_timeout(entry, &outarg);
        fuse_invalidate_attr(dir);
        return 0;
 
@@ -663,51 +698,83 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
        return err;
 }
 
-static int fuse_do_getattr(struct inode *inode)
+static void fuse_fillattr(struct inode *inode, struct fuse_attr *attr,
+                         struct kstat *stat)
+{
+       stat->dev = inode->i_sb->s_dev;
+       stat->ino = attr->ino;
+       stat->mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777);
+       stat->nlink = attr->nlink;
+       stat->uid = attr->uid;
+       stat->gid = attr->gid;
+       stat->rdev = inode->i_rdev;
+       stat->atime.tv_sec = attr->atime;
+       stat->atime.tv_nsec = attr->atimensec;
+       stat->mtime.tv_sec = attr->mtime;
+       stat->mtime.tv_nsec = attr->mtimensec;
+       stat->ctime.tv_sec = attr->ctime;
+       stat->ctime.tv_nsec = attr->ctimensec;
+       stat->size = attr->size;
+       stat->blocks = attr->blocks;
+       stat->blksize = (1 << inode->i_blkbits);
+}
+
+static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
+                          struct file *file)
 {
        int err;
-       struct fuse_attr_out arg;
+       struct fuse_getattr_in inarg;
+       struct fuse_attr_out outarg;
        struct fuse_conn *fc = get_fuse_conn(inode);
-       struct fuse_req *req = fuse_get_req(fc);
+       struct fuse_req *req;
+       u64 attr_version;
+
+       req = fuse_get_req(fc);
        if (IS_ERR(req))
                return PTR_ERR(req);
 
+       spin_lock(&fc->lock);
+       attr_version = fc->attr_version;
+       spin_unlock(&fc->lock);
+
+       memset(&inarg, 0, sizeof(inarg));
+       memset(&outarg, 0, sizeof(outarg));
+       /* Directories have separate file-handle space */
+       if (file && S_ISREG(inode->i_mode)) {
+               struct fuse_file *ff = file->private_data;
+
+               inarg.getattr_flags |= FUSE_GETATTR_FH;
+               inarg.fh = ff->fh;
+       }
        req->in.h.opcode = FUSE_GETATTR;
        req->in.h.nodeid = get_node_id(inode);
+       req->in.numargs = 1;
+       req->in.args[0].size = sizeof(inarg);
+       req->in.args[0].value = &inarg;
        req->out.numargs = 1;
-       req->out.args[0].size = sizeof(arg);
-       req->out.args[0].value = &arg;
+       if (fc->minor < 9)
+               req->out.args[0].size = FUSE_COMPAT_ATTR_OUT_SIZE;
+       else
+               req->out.args[0].size = sizeof(outarg);
+       req->out.args[0].value = &outarg;
        request_send(fc, req);
        err = req->out.h.error;
        fuse_put_request(fc, req);
        if (!err) {
-               if ((inode->i_mode ^ arg.attr.mode) & S_IFMT) {
+               if ((inode->i_mode ^ outarg.attr.mode) & S_IFMT) {
                        make_bad_inode(inode);
                        err = -EIO;
                } else {
-                       struct fuse_inode *fi = get_fuse_inode(inode);
-                       fuse_change_attributes(inode, &arg.attr);
-                       fi->i_time = time_to_jiffies(arg.attr_valid,
-                                                    arg.attr_valid_nsec);
+                       fuse_change_attributes(inode, &outarg.attr,
+                                              attr_timeout(&outarg),
+                                              attr_version);
+                       if (stat)
+                               fuse_fillattr(inode, &outarg.attr, stat);
                }
        }
        return err;
 }
 
-/*
- * Check if attributes are still valid, and if not send a GETATTR
- * request to refresh them.
- */
-static int fuse_refresh_attributes(struct inode *inode)
-{
-       struct fuse_inode *fi = get_fuse_inode(inode);
-
-       if (fi->i_time < get_jiffies_64())
-               return fuse_do_getattr(inode);
-       else
-               return 0;
-}
-
 /*
  * Calling into a user-controlled filesystem gives the filesystem
  * daemon ptrace-like capabilities over the requester process.  This
@@ -721,7 +788,7 @@ static int fuse_refresh_attributes(struct inode *inode)
  * for which the owner of the mount has ptrace privilege.  This
  * excludes processes started by other users, suid or sgid processes.
  */
-static int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task)
+int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task)
 {
        if (fc->flags & FUSE_ALLOW_OTHER)
                return 1;
@@ -795,11 +862,14 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
         */
        if ((fc->flags & FUSE_DEFAULT_PERMISSIONS) ||
            ((mask & MAY_EXEC) && S_ISREG(inode->i_mode))) {
-               err = fuse_refresh_attributes(inode);
-               if (err)
-                       return err;
+               struct fuse_inode *fi = get_fuse_inode(inode);
+               if (fi->i_time < get_jiffies_64()) {
+                       err = fuse_do_getattr(inode, NULL, NULL);
+                       if (err)
+                               return err;
 
-               refreshed = true;
+                       refreshed = true;
+               }
        }
 
        if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
@@ -809,7 +879,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
                   attributes.  This is also needed, because the root
                   node will at first have no permissions */
                if (err == -EACCES && !refreshed) {
-                       err = fuse_do_getattr(inode);
+                       err = fuse_do_getattr(inode, NULL, NULL);
                        if (!err)
                                err = generic_permission(inode, mask, NULL);
                }
@@ -825,7 +895,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
                        if (refreshed)
                                return -EACCES;
 
-                       err = fuse_do_getattr(inode);
+                       err = fuse_do_getattr(inode, NULL, NULL);
                        if (!err && !(inode->i_mode & S_IXUGO))
                                return -EACCES;
                }
@@ -962,6 +1032,20 @@ static int fuse_dir_fsync(struct file *file, struct dentry *de, int datasync)
        return file ? fuse_fsync_common(file, de, datasync, 1) : 0;
 }
 
+static bool update_mtime(unsigned ivalid)
+{
+       /* Always update if mtime is explicitly set  */
+       if (ivalid & ATTR_MTIME_SET)
+               return true;
+
+       /* If it's an open(O_TRUNC) or an ftruncate(), don't update */
+       if ((ivalid & ATTR_SIZE) && (ivalid & (ATTR_OPEN | ATTR_FILE)))
+               return false;
+
+       /* In all other cases update */
+       return true;
+}
+
 static void iattr_to_fattr(struct iattr *iattr, struct fuse_setattr_in *arg)
 {
        unsigned ivalid = iattr->ia_valid;
@@ -974,16 +1058,19 @@ static void iattr_to_fattr(struct iattr *iattr, struct fuse_setattr_in *arg)
                arg->valid |= FATTR_GID,    arg->gid = iattr->ia_gid;
        if (ivalid & ATTR_SIZE)
                arg->valid |= FATTR_SIZE,   arg->size = iattr->ia_size;
-       /* You can only _set_ these together (they may change by themselves) */
-       if ((ivalid & (ATTR_ATIME | ATTR_MTIME)) == (ATTR_ATIME | ATTR_MTIME)) {
-               arg->valid |= FATTR_ATIME | FATTR_MTIME;
+       if (ivalid & ATTR_ATIME) {
+               arg->valid |= FATTR_ATIME;
                arg->atime = iattr->ia_atime.tv_sec;
-               arg->mtime = iattr->ia_mtime.tv_sec;
+               arg->atimensec = iattr->ia_atime.tv_nsec;
+               if (!(ivalid & ATTR_ATIME_SET))
+                       arg->valid |= FATTR_ATIME_NOW;
        }
-       if (ivalid & ATTR_FILE) {
-               struct fuse_file *ff = iattr->ia_file->private_data;
-               arg->valid |= FATTR_FH;
-               arg->fh = ff->fh;
+       if ((ivalid & ATTR_MTIME) && update_mtime(ivalid)) {
+               arg->valid |= FATTR_MTIME;
+               arg->mtime = iattr->ia_mtime.tv_sec;
+               arg->mtimensec = iattr->ia_mtime.tv_nsec;
+               if (!(ivalid & ATTR_MTIME_SET))
+                       arg->valid |= FATTR_MTIME_NOW;
        }
 }
 
@@ -995,22 +1082,28 @@ static void iattr_to_fattr(struct iattr *iattr, struct fuse_setattr_in *arg)
  * vmtruncate() doesn't allow for this case, so do the rlimit checking
  * and the actual truncation by hand.
  */
-static int fuse_setattr(struct dentry *entry, struct iattr *attr)
+static int fuse_do_setattr(struct dentry *entry, struct iattr *attr,
+                          struct file *file)
 {
        struct inode *inode = entry->d_inode;
        struct fuse_conn *fc = get_fuse_conn(inode);
-       struct fuse_inode *fi = get_fuse_inode(inode);
        struct fuse_req *req;
        struct fuse_setattr_in inarg;
        struct fuse_attr_out outarg;
        int err;
 
+       if (!fuse_allow_task(fc, current))
+               return -EACCES;
+
        if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
                err = inode_change_ok(inode, attr);
                if (err)
                        return err;
        }
 
+       if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc)
+               return 0;
+
        if (attr->ia_valid & ATTR_SIZE) {
                unsigned long limit;
                if (IS_SWAPFILE(inode))
@@ -1027,14 +1120,28 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
                return PTR_ERR(req);
 
        memset(&inarg, 0, sizeof(inarg));
+       memset(&outarg, 0, sizeof(outarg));
        iattr_to_fattr(attr, &inarg);
+       if (file) {
+               struct fuse_file *ff = file->private_data;
+               inarg.valid |= FATTR_FH;
+               inarg.fh = ff->fh;
+       }
+       if (attr->ia_valid & ATTR_SIZE) {
+               /* For mandatory locking in truncate */
+               inarg.valid |= FATTR_LOCKOWNER;
+               inarg.lock_owner = fuse_lock_owner_id(fc, current->files);
+       }
        req->in.h.opcode = FUSE_SETATTR;
        req->in.h.nodeid = get_node_id(inode);
        req->in.numargs = 1;
        req->in.args[0].size = sizeof(inarg);
        req->in.args[0].value = &inarg;
        req->out.numargs = 1;
-       req->out.args[0].size = sizeof(outarg);
+       if (fc->minor < 9)
+               req->out.args[0].size = FUSE_COMPAT_ATTR_OUT_SIZE;
+       else
+               req->out.args[0].size = sizeof(outarg);
        req->out.args[0].value = &outarg;
        request_send(fc, req);
        err = req->out.h.error;
@@ -1050,11 +1157,18 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
                return -EIO;
        }
 
-       fuse_change_attributes(inode, &outarg.attr);
-       fi->i_time = time_to_jiffies(outarg.attr_valid, outarg.attr_valid_nsec);
+       fuse_change_attributes(inode, &outarg.attr, attr_timeout(&outarg), 0);
        return 0;
 }
 
+static int fuse_setattr(struct dentry *entry, struct iattr *attr)
+{
+       if (attr->ia_valid & ATTR_FILE)
+               return fuse_do_setattr(entry, attr, attr->ia_file);
+       else
+               return fuse_do_setattr(entry, attr, NULL);
+}
+
 static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry,
                        struct kstat *stat)
 {
@@ -1066,8 +1180,10 @@ static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry,
        if (!fuse_allow_task(fc, current))
                return -EACCES;
 
-       err = fuse_refresh_attributes(inode);
-       if (!err) {
+       if (fi->i_time < get_jiffies_64())
+               err = fuse_do_getattr(inode, stat, NULL);
+       else {
+               err = 0;
                generic_fillattr(inode, stat);
                stat->mode = fi->orig_i_mode;
        }
@@ -1172,6 +1288,9 @@ static ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size)
        struct fuse_getxattr_out outarg;
        ssize_t ret;
 
+       if (!fuse_allow_task(fc, current))
+               return -EACCES;
+
        if (fc->no_listxattr)
                return -EOPNOTSUPP;
 
index c4b98c03a46ef7c24761e70a723486067e3a9806..0fcdba9d47c090ba5b6dae59abfdc41897d5b7f1 100644 (file)
@@ -28,7 +28,9 @@ static int fuse_send_open(struct inode *inode, struct file *file, int isdir,
                return PTR_ERR(req);
 
        memset(&inarg, 0, sizeof(inarg));
-       inarg.flags = file->f_flags & ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
+       inarg.flags = file->f_flags & ~(O_CREAT | O_EXCL | O_NOCTTY);
+       if (!fc->atomic_o_trunc)
+               inarg.flags &= ~O_TRUNC;
        req->in.h.opcode = isdir ? FUSE_OPENDIR : FUSE_OPEN;
        req->in.h.nodeid = get_node_id(inode);
        req->in.numargs = 1;
@@ -54,6 +56,7 @@ struct fuse_file *fuse_file_alloc(void)
                        kfree(ff);
                        ff = NULL;
                }
+               INIT_LIST_HEAD(&ff->write_entry);
                atomic_set(&ff->count, 0);
        }
        return ff;
@@ -148,12 +151,18 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir)
 {
        struct fuse_file *ff = file->private_data;
        if (ff) {
+               struct fuse_conn *fc = get_fuse_conn(inode);
+
                fuse_release_fill(ff, get_node_id(inode), file->f_flags,
                                  isdir ? FUSE_RELEASEDIR : FUSE_RELEASE);
 
                /* Hold vfsmount and dentry until release is finished */
                ff->reserved_req->vfsmount = mntget(file->f_path.mnt);
                ff->reserved_req->dentry = dget(file->f_path.dentry);
+
+               spin_lock(&fc->lock);
+               list_del(&ff->write_entry);
+               spin_unlock(&fc->lock);
                /*
                 * Normally this will send the RELEASE request,
                 * however if some asynchronous READ or WRITE requests
@@ -180,7 +189,7 @@ static int fuse_release(struct inode *inode, struct file *file)
  * Scramble the ID space with XTEA, so that the value of the files_struct
  * pointer is not exposed to userspace.
  */
-static u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id)
+u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id)
 {
        u32 *k = fc->scramble_key;
        u64 v = (unsigned long) id;
@@ -299,11 +308,19 @@ void fuse_read_fill(struct fuse_req *req, struct fuse_file *ff,
 }
 
 static size_t fuse_send_read(struct fuse_req *req, struct file *file,
-                            struct inode *inode, loff_t pos, size_t count)
+                            struct inode *inode, loff_t pos, size_t count,
+                            fl_owner_t owner)
 {
        struct fuse_conn *fc = get_fuse_conn(inode);
        struct fuse_file *ff = file->private_data;
+
        fuse_read_fill(req, ff, inode, pos, count, FUSE_READ);
+       if (owner != NULL) {
+               struct fuse_read_in *inarg = &req->misc.read_in;
+
+               inarg->read_flags |= FUSE_READ_LOCKOWNER;
+               inarg->lock_owner = fuse_lock_owner_id(fc, owner);
+       }
        request_send(fc, req);
        return req->out.args[0].size;
 }
@@ -327,7 +344,8 @@ static int fuse_readpage(struct file *file, struct page *page)
        req->out.page_zeroing = 1;
        req->num_pages = 1;
        req->pages[0] = page;
-       fuse_send_read(req, file, inode, page_offset(page), PAGE_CACHE_SIZE);
+       fuse_send_read(req, file, inode, page_offset(page), PAGE_CACHE_SIZE,
+                      NULL);
        err = req->out.h.error;
        fuse_put_request(fc, req);
        if (!err)
@@ -434,30 +452,47 @@ out:
        return err;
 }
 
-static size_t fuse_send_write(struct fuse_req *req, struct file *file,
-                             struct inode *inode, loff_t pos, size_t count)
+static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff,
+                           struct inode *inode, loff_t pos, size_t count,
+                           int writepage)
 {
        struct fuse_conn *fc = get_fuse_conn(inode);
-       struct fuse_file *ff = file->private_data;
-       struct fuse_write_in inarg;
-       struct fuse_write_out outarg;
+       struct fuse_write_in *inarg = &req->misc.write.in;
+       struct fuse_write_out *outarg = &req->misc.write.out;
 
-       memset(&inarg, 0, sizeof(struct fuse_write_in));
-       inarg.fh = ff->fh;
-       inarg.offset = pos;
-       inarg.size = count;
+       memset(inarg, 0, sizeof(struct fuse_write_in));
+       inarg->fh = ff->fh;
+       inarg->offset = pos;
+       inarg->size = count;
+       inarg->write_flags = writepage ? FUSE_WRITE_CACHE : 0;
        req->in.h.opcode = FUSE_WRITE;
        req->in.h.nodeid = get_node_id(inode);
        req->in.argpages = 1;
        req->in.numargs = 2;
-       req->in.args[0].size = sizeof(struct fuse_write_in);
-       req->in.args[0].value = &inarg;
+       if (fc->minor < 9)
+               req->in.args[0].size = FUSE_COMPAT_WRITE_IN_SIZE;
+       else
+               req->in.args[0].size = sizeof(struct fuse_write_in);
+       req->in.args[0].value = inarg;
        req->in.args[1].size = count;
        req->out.numargs = 1;
        req->out.args[0].size = sizeof(struct fuse_write_out);
-       req->out.args[0].value = &outarg;
+       req->out.args[0].value = outarg;
+}
+
+static size_t fuse_send_write(struct fuse_req *req, struct file *file,
+                             struct inode *inode, loff_t pos, size_t count,
+                             fl_owner_t owner)
+{
+       struct fuse_conn *fc = get_fuse_conn(inode);
+       fuse_write_fill(req, file->private_data, inode, pos, count, 0);
+       if (owner != NULL) {
+               struct fuse_write_in *inarg = &req->misc.write.in;
+               inarg->write_flags |= FUSE_WRITE_LOCKOWNER;
+               inarg->lock_owner = fuse_lock_owner_id(fc, owner);
+       }
        request_send(fc, req);
-       return outarg.size;
+       return req->misc.write.out.size;
 }
 
 static int fuse_write_begin(struct file *file, struct address_space *mapping,
@@ -478,6 +513,7 @@ static int fuse_buffered_write(struct file *file, struct inode *inode,
        int err;
        size_t nres;
        struct fuse_conn *fc = get_fuse_conn(inode);
+       struct fuse_inode *fi = get_fuse_inode(inode);
        unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
        struct fuse_req *req;
 
@@ -491,7 +527,7 @@ static int fuse_buffered_write(struct file *file, struct inode *inode,
        req->num_pages = 1;
        req->pages[0] = page;
        req->page_offset = offset;
-       nres = fuse_send_write(req, file, inode, pos, count);
+       nres = fuse_send_write(req, file, inode, pos, count, NULL);
        err = req->out.h.error;
        fuse_put_request(fc, req);
        if (!err && !nres)
@@ -499,6 +535,7 @@ static int fuse_buffered_write(struct file *file, struct inode *inode,
        if (!err) {
                pos += nres;
                spin_lock(&fc->lock);
+               fi->attr_version = ++fc->attr_version;
                if (pos > inode->i_size)
                        i_size_write(inode, pos);
                spin_unlock(&fc->lock);
@@ -591,9 +628,11 @@ static ssize_t fuse_direct_io(struct file *file, const char __user *buf,
                nbytes = (req->num_pages << PAGE_SHIFT) - req->page_offset;
                nbytes = min(count, nbytes);
                if (write)
-                       nres = fuse_send_write(req, file, inode, pos, nbytes);
+                       nres = fuse_send_write(req, file, inode, pos, nbytes,
+                                              current->files);
                else
-                       nres = fuse_send_read(req, file, inode, pos, nbytes);
+                       nres = fuse_send_read(req, file, inode, pos, nbytes,
+                                             current->files);
                fuse_release_user_pages(req, !write);
                if (req->out.h.error) {
                        if (!res)
@@ -695,7 +734,8 @@ static int convert_fuse_file_lock(const struct fuse_file_lock *ffl,
 }
 
 static void fuse_lk_fill(struct fuse_req *req, struct file *file,
-                        const struct file_lock *fl, int opcode, pid_t pid)
+                        const struct file_lock *fl, int opcode, pid_t pid,
+                        int flock)
 {
        struct inode *inode = file->f_path.dentry->d_inode;
        struct fuse_conn *fc = get_fuse_conn(inode);
@@ -708,6 +748,8 @@ static void fuse_lk_fill(struct fuse_req *req, struct file *file,
        arg->lk.end = fl->fl_end;
        arg->lk.type = fl->fl_type;
        arg->lk.pid = pid;
+       if (flock)
+               arg->lk_flags |= FUSE_LK_FLOCK;
        req->in.h.opcode = opcode;
        req->in.h.nodeid = get_node_id(inode);
        req->in.numargs = 1;
@@ -727,7 +769,7 @@ static int fuse_getlk(struct file *file, struct file_lock *fl)
        if (IS_ERR(req))
                return PTR_ERR(req);
 
-       fuse_lk_fill(req, file, fl, FUSE_GETLK, 0);
+       fuse_lk_fill(req, file, fl, FUSE_GETLK, 0, 0);
        req->out.numargs = 1;
        req->out.args[0].size = sizeof(outarg);
        req->out.args[0].value = &outarg;
@@ -740,7 +782,7 @@ static int fuse_getlk(struct file *file, struct file_lock *fl)
        return err;
 }
 
-static int fuse_setlk(struct file *file, struct file_lock *fl)
+static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
 {
        struct inode *inode = file->f_path.dentry->d_inode;
        struct fuse_conn *fc = get_fuse_conn(inode);
@@ -757,7 +799,7 @@ static int fuse_setlk(struct file *file, struct file_lock *fl)
        if (IS_ERR(req))
                return PTR_ERR(req);
 
-       fuse_lk_fill(req, file, fl, opcode, pid);
+       fuse_lk_fill(req, file, fl, opcode, pid, flock);
        request_send(fc, req);
        err = req->out.h.error;
        /* locking is restartable */
@@ -783,8 +825,25 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl)
                if (fc->no_lock)
                        err = posix_lock_file_wait(file, fl);
                else
-                       err = fuse_setlk(file, fl);
+                       err = fuse_setlk(file, fl, 0);
+       }
+       return err;
+}
+
+static int fuse_file_flock(struct file *file, int cmd, struct file_lock *fl)
+{
+       struct inode *inode = file->f_path.dentry->d_inode;
+       struct fuse_conn *fc = get_fuse_conn(inode);
+       int err;
+
+       if (fc->no_lock) {
+               err = flock_lock_file_wait(file, fl);
+       } else {
+               /* emulate flock with POSIX locks */
+               fl->fl_owner = (fl_owner_t) file;
+               err = fuse_setlk(file, fl, 1);
        }
+
        return err;
 }
 
@@ -836,6 +895,7 @@ static const struct file_operations fuse_file_operations = {
        .release        = fuse_release,
        .fsync          = fuse_fsync,
        .lock           = fuse_file_lock,
+       .flock          = fuse_file_flock,
        .splice_read    = generic_file_splice_read,
 };
 
@@ -848,6 +908,7 @@ static const struct file_operations fuse_direct_io_file_operations = {
        .release        = fuse_release,
        .fsync          = fuse_fsync,
        .lock           = fuse_file_lock,
+       .flock          = fuse_file_flock,
        /* no mmap and splice_read */
 };
 
index 1764506fdd11bc4da0e89a658c9a0bbdaa2a51b0..6c5461de1a5fd5c4cbbf806fddb6d12a948841fa 100644 (file)
@@ -67,6 +67,12 @@ struct fuse_inode {
        /** The sticky bit in inode->i_mode may have been removed, so
            preserve the original mode */
        mode_t orig_i_mode;
+
+       /** Version of last attribute change */
+       u64 attr_version;
+
+       /** Files usable in writepage.  Protected by fc->lock */
+       struct list_head write_files;
 };
 
 /** FUSE specific file data */
@@ -79,6 +85,9 @@ struct fuse_file {
 
        /** Refcount */
        atomic_t count;
+
+       /** Entry on inode's write_files list */
+       struct list_head write_entry;
 };
 
 /** One input argument of a request */
@@ -210,6 +219,10 @@ struct fuse_req {
                struct fuse_init_in init_in;
                struct fuse_init_out init_out;
                struct fuse_read_in read_in;
+               struct {
+                       struct fuse_write_in in;
+                       struct fuse_write_out out;
+               } write;
                struct fuse_lk_in lk_in;
        } misc;
 
@@ -317,6 +330,9 @@ struct fuse_conn {
        /** Do readpages asynchronously?  Only set in INIT */
        unsigned async_read : 1;
 
+       /** Do not send separate SETATTR request before open(O_TRUNC)  */
+       unsigned atomic_o_trunc : 1;
+
        /*
         * The following bitfields are only for optimization purposes
         * and hence races in setting them will not cause malfunction
@@ -387,6 +403,9 @@ struct fuse_conn {
 
        /** Reserved request for the DESTROY message */
        struct fuse_req *destroy_req;
+
+       /** Version counter for attribute changes */
+       u64 attr_version;
 };
 
 static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb)
@@ -416,7 +435,8 @@ extern const struct file_operations fuse_dev_operations;
  * Get a filled in inode
  */
 struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
-                       int generation, struct fuse_attr *attr);
+                       int generation, struct fuse_attr *attr,
+                       u64 attr_valid, u64 attr_version);
 
 /**
  * Send FORGET command
@@ -477,7 +497,8 @@ void fuse_init_symlink(struct inode *inode);
 /**
  * Change attributes of an inode
  */
-void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr);
+void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr,
+                           u64 attr_valid, u64 attr_version);
 
 /**
  * Initialize the client device
@@ -565,3 +586,10 @@ void fuse_ctl_remove_conn(struct fuse_conn *fc);
  * Is file type valid?
  */
 int fuse_valid_type(int m);
+
+/**
+ * Is task allowed to perform filesystem operation?
+ */
+int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task);
+
+u64 fuse_lock_owner_id(struct fuse_conn *fc, fl_owner_t id);
index fd0735715c14e7f1943c905cb104f101fac73139..9a68d69708457c5ecd387895e77cba73e51e7efb 100644 (file)
@@ -56,6 +56,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
        fi->i_time = 0;
        fi->nodeid = 0;
        fi->nlookup = 0;
+       INIT_LIST_HEAD(&fi->write_files);
        fi->forget_req = fuse_request_alloc();
        if (!fi->forget_req) {
                kmem_cache_free(fuse_inode_cachep, inode);
@@ -68,6 +69,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
 static void fuse_destroy_inode(struct inode *inode)
 {
        struct fuse_inode *fi = get_fuse_inode(inode);
+       BUG_ON(!list_empty(&fi->write_files));
        if (fi->forget_req)
                fuse_request_free(fi->forget_req);
        kmem_cache_free(fuse_inode_cachep, inode);
@@ -117,12 +119,22 @@ static void fuse_truncate(struct address_space *mapping, loff_t offset)
        unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
 }
 
-void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
+
+void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr,
+                           u64 attr_valid, u64 attr_version)
 {
        struct fuse_conn *fc = get_fuse_conn(inode);
        struct fuse_inode *fi = get_fuse_inode(inode);
        loff_t oldsize;
 
+       spin_lock(&fc->lock);
+       if (attr_version != 0 && fi->attr_version > attr_version) {
+               spin_unlock(&fc->lock);
+               return;
+       }
+       fi->attr_version = ++fc->attr_version;
+       fi->i_time = attr_valid;
+
        inode->i_ino     = attr->ino;
        inode->i_mode    = (inode->i_mode & S_IFMT) | (attr->mode & 07777);
        inode->i_nlink   = attr->nlink;
@@ -136,6 +148,11 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
        inode->i_ctime.tv_sec   = attr->ctime;
        inode->i_ctime.tv_nsec  = attr->ctimensec;
 
+       if (attr->blksize != 0)
+               inode->i_blkbits = ilog2(attr->blksize);
+       else
+               inode->i_blkbits = inode->i_sb->s_blocksize_bits;
+
        /*
         * Don't set the sticky bit in i_mode, unless we want the VFS
         * to check permissions.  This prevents failures due to the
@@ -145,7 +162,6 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr)
        if (!(fc->flags & FUSE_DEFAULT_PERMISSIONS))
                inode->i_mode &= ~S_ISVTX;
 
-       spin_lock(&fc->lock);
        oldsize = inode->i_size;
        i_size_write(inode, attr->size);
        spin_unlock(&fc->lock);
@@ -194,7 +210,8 @@ static int fuse_inode_set(struct inode *inode, void *_nodeidp)
 }
 
 struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
-                       int generation, struct fuse_attr *attr)
+                       int generation, struct fuse_attr *attr,
+                       u64 attr_valid, u64 attr_version)
 {
        struct inode *inode;
        struct fuse_inode *fi;
@@ -222,7 +239,8 @@ struct inode *fuse_iget(struct super_block *sb, unsigned long nodeid,
        spin_lock(&fc->lock);
        fi->nlookup ++;
        spin_unlock(&fc->lock);
-       fuse_change_attributes(inode, attr);
+       fuse_change_attributes(inode, attr, attr_valid, attr_version);
+
        return inode;
 }
 
@@ -287,6 +305,11 @@ static int fuse_statfs(struct dentry *dentry, struct kstatfs *buf)
        struct fuse_statfs_out outarg;
        int err;
 
+       if (!fuse_allow_task(fc, current)) {
+               buf->f_type = FUSE_SUPER_MAGIC;
+               return 0;
+       }
+
        req = fuse_get_req(fc);
        if (IS_ERR(req))
                return PTR_ERR(req);
@@ -452,6 +475,7 @@ static struct fuse_conn *new_conn(void)
                }
                fc->reqctr = 0;
                fc->blocked = 1;
+               fc->attr_version = 1;
                get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
        }
 out:
@@ -483,7 +507,7 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned mode)
        attr.mode = mode;
        attr.ino = FUSE_ROOT_ID;
        attr.nlink = 1;
-       return fuse_iget(sb, 1, 0, &attr);
+       return fuse_iget(sb, 1, 0, &attr, 0, 0);
 }
 
 static const struct super_operations fuse_super_operations = {
@@ -514,6 +538,8 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
                                fc->async_read = 1;
                        if (!(arg->flags & FUSE_POSIX_LOCKS))
                                fc->no_lock = 1;
+                       if (arg->flags & FUSE_ATOMIC_O_TRUNC)
+                               fc->atomic_o_trunc = 1;
                } else {
                        ra_pages = fc->max_read / PAGE_CACHE_SIZE;
                        fc->no_lock = 1;
@@ -536,7 +562,8 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
        arg->major = FUSE_KERNEL_VERSION;
        arg->minor = FUSE_KERNEL_MINOR_VERSION;
        arg->max_readahead = fc->bdi.ra_pages * PAGE_CACHE_SIZE;
-       arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS;
+       arg->flags |= FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_FILE_OPS |
+               FUSE_ATOMIC_O_TRUNC;
        req->in.h.opcode = FUSE_INIT;
        req->in.numargs = 1;
        req->in.args[0].size = sizeof(*arg);
index a003d50edcdbdc1fe45a7627e83191cd55df378c..a263d82761dfdc3fcf63be7900ed47a803b9b3b2 100644 (file)
@@ -375,7 +375,7 @@ void journal_commit_transaction(journal_t *journal)
                        struct buffer_head *bh = jh2bh(jh);
 
                        jbd_lock_bh_state(bh);
-                       jbd_slab_free(jh->b_committed_data, bh->b_size);
+                       jbd_free(jh->b_committed_data, bh->b_size);
                        jh->b_committed_data = NULL;
                        jbd_unlock_bh_state(bh);
                }
@@ -792,14 +792,14 @@ restart_loop:
                 * Otherwise, we can just throw away the frozen data now.
                 */
                if (jh->b_committed_data) {
-                       jbd_slab_free(jh->b_committed_data, bh->b_size);
+                       jbd_free(jh->b_committed_data, bh->b_size);
                        jh->b_committed_data = NULL;
                        if (jh->b_frozen_data) {
                                jh->b_committed_data = jh->b_frozen_data;
                                jh->b_frozen_data = NULL;
                        }
                } else if (jh->b_frozen_data) {
-                       jbd_slab_free(jh->b_frozen_data, bh->b_size);
+                       jbd_free(jh->b_frozen_data, bh->b_size);
                        jh->b_frozen_data = NULL;
                }
 
index a6be78c05dce50420fdf1c08fad3cd80ac5120cd..5d9fec0b7ebd561501ed7973ff0c226c1db1aa2d 100644 (file)
@@ -83,7 +83,6 @@ EXPORT_SYMBOL(journal_force_commit);
 
 static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
 static void __journal_abort_soft (journal_t *journal, int errno);
-static int journal_create_jbd_slab(size_t slab_size);
 
 /*
  * Helper function used to manage commit timeouts
@@ -218,7 +217,7 @@ static int journal_start_thread(journal_t *journal)
        if (IS_ERR(t))
                return PTR_ERR(t);
 
-       wait_event(journal->j_wait_done_commit, journal->j_task != 0);
+       wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
        return 0;
 }
 
@@ -230,7 +229,8 @@ static void journal_kill_thread(journal_t *journal)
        while (journal->j_task) {
                wake_up(&journal->j_wait_commit);
                spin_unlock(&journal->j_state_lock);
-               wait_event(journal->j_wait_done_commit, journal->j_task == 0);
+               wait_event(journal->j_wait_done_commit,
+                               journal->j_task == NULL);
                spin_lock(&journal->j_state_lock);
        }
        spin_unlock(&journal->j_state_lock);
@@ -334,10 +334,10 @@ repeat:
                char *tmp;
 
                jbd_unlock_bh_state(bh_in);
-               tmp = jbd_slab_alloc(bh_in->b_size, GFP_NOFS);
+               tmp = jbd_alloc(bh_in->b_size, GFP_NOFS);
                jbd_lock_bh_state(bh_in);
                if (jh_in->b_frozen_data) {
-                       jbd_slab_free(tmp, bh_in->b_size);
+                       jbd_free(tmp, bh_in->b_size);
                        goto repeat;
                }
 
@@ -654,7 +654,7 @@ static journal_t * journal_init_common (void)
        journal_t *journal;
        int err;
 
-       journal = jbd_kmalloc(sizeof(*journal), GFP_KERNEL);
+       journal = kmalloc(sizeof(*journal), GFP_KERNEL);
        if (!journal)
                goto fail;
        memset(journal, 0, sizeof(*journal));
@@ -1095,13 +1095,6 @@ int journal_load(journal_t *journal)
                }
        }
 
-       /*
-        * Create a slab for this blocksize
-        */
-       err = journal_create_jbd_slab(be32_to_cpu(sb->s_blocksize));
-       if (err)
-               return err;
-
        /* Let the recovery code check whether it needs to recover any
         * data from the journal. */
        if (journal_recover(journal))
@@ -1614,86 +1607,6 @@ int journal_blocks_per_page(struct inode *inode)
        return 1 << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits);
 }
 
-/*
- * Simple support for retrying memory allocations.  Introduced to help to
- * debug different VM deadlock avoidance strategies.
- */
-void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry)
-{
-       return kmalloc(size, flags | (retry ? __GFP_NOFAIL : 0));
-}
-
-/*
- * jbd slab management: create 1k, 2k, 4k, 8k slabs as needed
- * and allocate frozen and commit buffers from these slabs.
- *
- * Reason for doing this is to avoid, SLAB_DEBUG - since it could
- * cause bh to cross page boundary.
- */
-
-#define JBD_MAX_SLABS 5
-#define JBD_SLAB_INDEX(size)  (size >> 11)
-
-static struct kmem_cache *jbd_slab[JBD_MAX_SLABS];
-static const char *jbd_slab_names[JBD_MAX_SLABS] = {
-       "jbd_1k", "jbd_2k", "jbd_4k", NULL, "jbd_8k"
-};
-
-static void journal_destroy_jbd_slabs(void)
-{
-       int i;
-
-       for (i = 0; i < JBD_MAX_SLABS; i++) {
-               if (jbd_slab[i])
-                       kmem_cache_destroy(jbd_slab[i]);
-               jbd_slab[i] = NULL;
-       }
-}
-
-static int journal_create_jbd_slab(size_t slab_size)
-{
-       int i = JBD_SLAB_INDEX(slab_size);
-
-       BUG_ON(i >= JBD_MAX_SLABS);
-
-       /*
-        * Check if we already have a slab created for this size
-        */
-       if (jbd_slab[i])
-               return 0;
-
-       /*
-        * Create a slab and force alignment to be same as slabsize -
-        * this will make sure that allocations won't cross the page
-        * boundary.
-        */
-       jbd_slab[i] = kmem_cache_create(jbd_slab_names[i],
-                               slab_size, slab_size, 0, NULL);
-       if (!jbd_slab[i]) {
-               printk(KERN_EMERG "JBD: no memory for jbd_slab cache\n");
-               return -ENOMEM;
-       }
-       return 0;
-}
-
-void * jbd_slab_alloc(size_t size, gfp_t flags)
-{
-       int idx;
-
-       idx = JBD_SLAB_INDEX(size);
-       BUG_ON(jbd_slab[idx] == NULL);
-       return kmem_cache_alloc(jbd_slab[idx], flags | __GFP_NOFAIL);
-}
-
-void jbd_slab_free(void *ptr,  size_t size)
-{
-       int idx;
-
-       idx = JBD_SLAB_INDEX(size);
-       BUG_ON(jbd_slab[idx] == NULL);
-       kmem_cache_free(jbd_slab[idx], ptr);
-}
-
 /*
  * Journal_head storage management
  */
@@ -1739,14 +1652,14 @@ static struct journal_head *journal_alloc_journal_head(void)
        atomic_inc(&nr_journal_heads);
 #endif
        ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
-       if (ret == 0) {
+       if (ret == NULL) {
                jbd_debug(1, "out of memory for journal_head\n");
                if (time_after(jiffies, last_warning + 5*HZ)) {
                        printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
                               __FUNCTION__);
                        last_warning = jiffies;
                }
-               while (ret == 0) {
+               while (ret == NULL) {
                        yield();
                        ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
                }
@@ -1881,13 +1794,13 @@ static void __journal_remove_journal_head(struct buffer_head *bh)
                                printk(KERN_WARNING "%s: freeing "
                                                "b_frozen_data\n",
                                                __FUNCTION__);
-                               jbd_slab_free(jh->b_frozen_data, bh->b_size);
+                               jbd_free(jh->b_frozen_data, bh->b_size);
                        }
                        if (jh->b_committed_data) {
                                printk(KERN_WARNING "%s: freeing "
                                                "b_committed_data\n",
                                                __FUNCTION__);
-                               jbd_slab_free(jh->b_committed_data, bh->b_size);
+                               jbd_free(jh->b_committed_data, bh->b_size);
                        }
                        bh->b_private = NULL;
                        jh->b_bh = NULL;        /* debug, really */
@@ -2042,7 +1955,6 @@ static void journal_destroy_caches(void)
        journal_destroy_revoke_caches();
        journal_destroy_journal_head_cache();
        journal_destroy_handle_cache();
-       journal_destroy_jbd_slabs();
 }
 
 static int __init journal_init(void)
index 8df5bac0b7a52a5402116745ce3eb341e89e8a3f..9841b1e5af0367dbfc9cb751421425317e1a59df 100644 (file)
@@ -96,8 +96,8 @@ static int start_this_handle(journal_t *journal, handle_t *handle)
 
 alloc_transaction:
        if (!journal->j_running_transaction) {
-               new_transaction = jbd_kmalloc(sizeof(*new_transaction),
-                                               GFP_NOFS);
+               new_transaction = kmalloc(sizeof(*new_transaction),
+                                               GFP_NOFS|__GFP_NOFAIL);
                if (!new_transaction) {
                        ret = -ENOMEM;
                        goto out;
@@ -675,7 +675,7 @@ repeat:
                                JBUFFER_TRACE(jh, "allocate memory for buffer");
                                jbd_unlock_bh_state(bh);
                                frozen_buffer =
-                                       jbd_slab_alloc(jh2bh(jh)->b_size,
+                                       jbd_alloc(jh2bh(jh)->b_size,
                                                         GFP_NOFS);
                                if (!frozen_buffer) {
                                        printk(KERN_EMERG
@@ -735,7 +735,7 @@ done:
 
 out:
        if (unlikely(frozen_buffer))    /* It's usually NULL */
-               jbd_slab_free(frozen_buffer, bh->b_size);
+               jbd_free(frozen_buffer, bh->b_size);
 
        JBUFFER_TRACE(jh, "exit");
        return error;
@@ -888,7 +888,7 @@ int journal_get_undo_access(handle_t *handle, struct buffer_head *bh)
 
 repeat:
        if (!jh->b_committed_data) {
-               committed_data = jbd_slab_alloc(jh2bh(jh)->b_size, GFP_NOFS);
+               committed_data = jbd_alloc(jh2bh(jh)->b_size, GFP_NOFS);
                if (!committed_data) {
                        printk(KERN_EMERG "%s: No memory for committed data\n",
                                __FUNCTION__);
@@ -915,7 +915,7 @@ repeat:
 out:
        journal_put_journal_head(jh);
        if (unlikely(committed_data))
-               jbd_slab_free(committed_data, bh->b_size);
+               jbd_free(committed_data, bh->b_size);
        return err;
 }
 
@@ -1172,7 +1172,7 @@ int journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
        }
 
        /* That test should have eliminated the following case: */
-       J_ASSERT_JH(jh, jh->b_frozen_data == 0);
+       J_ASSERT_JH(jh, jh->b_frozen_data == NULL);
 
        JBUFFER_TRACE(jh, "file as BJ_Metadata");
        spin_lock(&journal->j_list_lock);
@@ -1522,7 +1522,7 @@ static void __journal_temp_unlink_buffer(struct journal_head *jh)
 
        J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);
        if (jh->b_jlist != BJ_None)
-               J_ASSERT_JH(jh, transaction != 0);
+               J_ASSERT_JH(jh, transaction != NULL);
 
        switch (jh->b_jlist) {
        case BJ_None:
@@ -1591,11 +1591,11 @@ __journal_try_to_free_buffer(journal_t *journal, struct buffer_head *bh)
        if (buffer_locked(bh) || buffer_dirty(bh))
                goto out;
 
-       if (jh->b_next_transaction != 0)
+       if (jh->b_next_transaction != NULL)
                goto out;
 
        spin_lock(&journal->j_list_lock);
-       if (jh->b_transaction != 0 && jh->b_cp_transaction == 0) {
+       if (jh->b_transaction != NULL && jh->b_cp_transaction == NULL) {
                if (jh->b_jlist == BJ_SyncData || jh->b_jlist == BJ_Locked) {
                        /* A written-back ordered data buffer */
                        JBUFFER_TRACE(jh, "release data");
@@ -1603,7 +1603,7 @@ __journal_try_to_free_buffer(journal_t *journal, struct buffer_head *bh)
                        journal_remove_journal_head(bh);
                        __brelse(bh);
                }
-       } else if (jh->b_cp_transaction != 0 && jh->b_transaction == 0) {
+       } else if (jh->b_cp_transaction != NULL && jh->b_transaction == NULL) {
                /* written-back checkpointed metadata buffer */
                if (jh->b_jlist == BJ_None) {
                        JBUFFER_TRACE(jh, "remove from checkpoint list");
@@ -1963,7 +1963,7 @@ void __journal_file_buffer(struct journal_head *jh,
 
        J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);
        J_ASSERT_JH(jh, jh->b_transaction == transaction ||
-                               jh->b_transaction == 0);
+                               jh->b_transaction == NULL);
 
        if (jh->b_transaction && jh->b_jlist == jlist)
                return;
index c0f59d1b13dc336f82e490810f928f5e7b6b1a70..6986f334c643291181cd56c01c42a8820ad110f0 100644 (file)
@@ -278,7 +278,7 @@ static inline void write_tag_block(int tag_bytes, journal_block_tag_t *tag,
                                   unsigned long long block)
 {
        tag->t_blocknr = cpu_to_be32(block & (u32)~0);
-       if (tag_bytes > JBD_TAG_SIZE32)
+       if (tag_bytes > JBD2_TAG_SIZE32)
                tag->t_blocknr_high = cpu_to_be32((block >> 31) >> 1);
 }
 
@@ -384,7 +384,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                        struct buffer_head *bh = jh2bh(jh);
 
                        jbd_lock_bh_state(bh);
-                       jbd2_slab_free(jh->b_committed_data, bh->b_size);
+                       jbd2_free(jh->b_committed_data, bh->b_size);
                        jh->b_committed_data = NULL;
                        jbd_unlock_bh_state(bh);
                }
@@ -475,7 +475,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
        spin_unlock(&journal->j_list_lock);
 
        if (err)
-               __jbd2_journal_abort_hard(journal);
+               jbd2_journal_abort(journal, err);
 
        jbd2_journal_write_revoke_records(journal, commit_transaction);
 
@@ -533,7 +533,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
 
                        descriptor = jbd2_journal_get_descriptor_buffer(journal);
                        if (!descriptor) {
-                               __jbd2_journal_abort_hard(journal);
+                               jbd2_journal_abort(journal, -EIO);
                                continue;
                        }
 
@@ -566,7 +566,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
                   and repeat this loop: we'll fall into the
                   refile-on-abort condition above. */
                if (err) {
-                       __jbd2_journal_abort_hard(journal);
+                       jbd2_journal_abort(journal, err);
                        continue;
                }
 
@@ -757,7 +757,7 @@ wait_for_iobuf:
                err = -EIO;
 
        if (err)
-               __jbd2_journal_abort_hard(journal);
+               jbd2_journal_abort(journal, err);
 
        /* End of a transaction!  Finally, we can do checkpoint
            processing: any buffers committed as a result of this
@@ -801,14 +801,14 @@ restart_loop:
                 * Otherwise, we can just throw away the frozen data now.
                 */
                if (jh->b_committed_data) {
-                       jbd2_slab_free(jh->b_committed_data, bh->b_size);
+                       jbd2_free(jh->b_committed_data, bh->b_size);
                        jh->b_committed_data = NULL;
                        if (jh->b_frozen_data) {
                                jh->b_committed_data = jh->b_frozen_data;
                                jh->b_frozen_data = NULL;
                        }
                } else if (jh->b_frozen_data) {
-                       jbd2_slab_free(jh->b_frozen_data, bh->b_size);
+                       jbd2_free(jh->b_frozen_data, bh->b_size);
                        jh->b_frozen_data = NULL;
                }
 
index f37324aee817c9181fee667ba334c9df293f8666..6ddc5531587c7c6598180f105e46645f13d74337 100644 (file)
@@ -84,7 +84,6 @@ EXPORT_SYMBOL(jbd2_journal_force_commit);
 
 static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
 static void __journal_abort_soft (journal_t *journal, int errno);
-static int jbd2_journal_create_jbd_slab(size_t slab_size);
 
 /*
  * Helper function used to manage commit timeouts
@@ -335,10 +334,10 @@ repeat:
                char *tmp;
 
                jbd_unlock_bh_state(bh_in);
-               tmp = jbd2_slab_alloc(bh_in->b_size, GFP_NOFS);
+               tmp = jbd2_alloc(bh_in->b_size, GFP_NOFS);
                jbd_lock_bh_state(bh_in);
                if (jh_in->b_frozen_data) {
-                       jbd2_slab_free(tmp, bh_in->b_size);
+                       jbd2_free(tmp, bh_in->b_size);
                        goto repeat;
                }
 
@@ -655,10 +654,9 @@ static journal_t * journal_init_common (void)
        journal_t *journal;
        int err;
 
-       journal = jbd_kmalloc(sizeof(*journal), GFP_KERNEL);
+       journal = kzalloc(sizeof(*journal), GFP_KERNEL|__GFP_NOFAIL);
        if (!journal)
                goto fail;
-       memset(journal, 0, sizeof(*journal));
 
        init_waitqueue_head(&journal->j_wait_transaction_locked);
        init_waitqueue_head(&journal->j_wait_logspace);
@@ -672,7 +670,7 @@ static journal_t * journal_init_common (void)
        spin_lock_init(&journal->j_list_lock);
        spin_lock_init(&journal->j_state_lock);
 
-       journal->j_commit_interval = (HZ * JBD_DEFAULT_MAX_COMMIT_AGE);
+       journal->j_commit_interval = (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE);
 
        /* The journal is marked for error until we succeed with recovery! */
        journal->j_flags = JBD2_ABORT;
@@ -1096,13 +1094,6 @@ int jbd2_journal_load(journal_t *journal)
                }
        }
 
-       /*
-        * Create a slab for this blocksize
-        */
-       err = jbd2_journal_create_jbd_slab(be32_to_cpu(sb->s_blocksize));
-       if (err)
-               return err;
-
        /* Let the recovery code check whether it needs to recover any
         * data from the journal. */
        if (jbd2_journal_recover(journal))
@@ -1621,89 +1612,9 @@ int jbd2_journal_blocks_per_page(struct inode *inode)
 size_t journal_tag_bytes(journal_t *journal)
 {
        if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
-               return JBD_TAG_SIZE64;
+               return JBD2_TAG_SIZE64;
        else
-               return JBD_TAG_SIZE32;
-}
-
-/*
- * Simple support for retrying memory allocations.  Introduced to help to
- * debug different VM deadlock avoidance strategies.
- */
-void * __jbd2_kmalloc (const char *where, size_t size, gfp_t flags, int retry)
-{
-       return kmalloc(size, flags | (retry ? __GFP_NOFAIL : 0));
-}
-
-/*
- * jbd slab management: create 1k, 2k, 4k, 8k slabs as needed
- * and allocate frozen and commit buffers from these slabs.
- *
- * Reason for doing this is to avoid, SLAB_DEBUG - since it could
- * cause bh to cross page boundary.
- */
-
-#define JBD_MAX_SLABS 5
-#define JBD_SLAB_INDEX(size)  (size >> 11)
-
-static struct kmem_cache *jbd_slab[JBD_MAX_SLABS];
-static const char *jbd_slab_names[JBD_MAX_SLABS] = {
-       "jbd2_1k", "jbd2_2k", "jbd2_4k", NULL, "jbd2_8k"
-};
-
-static void jbd2_journal_destroy_jbd_slabs(void)
-{
-       int i;
-
-       for (i = 0; i < JBD_MAX_SLABS; i++) {
-               if (jbd_slab[i])
-                       kmem_cache_destroy(jbd_slab[i]);
-               jbd_slab[i] = NULL;
-       }
-}
-
-static int jbd2_journal_create_jbd_slab(size_t slab_size)
-{
-       int i = JBD_SLAB_INDEX(slab_size);
-
-       BUG_ON(i >= JBD_MAX_SLABS);
-
-       /*
-        * Check if we already have a slab created for this size
-        */
-       if (jbd_slab[i])
-               return 0;
-
-       /*
-        * Create a slab and force alignment to be same as slabsize -
-        * this will make sure that allocations won't cross the page
-        * boundary.
-        */
-       jbd_slab[i] = kmem_cache_create(jbd_slab_names[i],
-                               slab_size, slab_size, 0, NULL);
-       if (!jbd_slab[i]) {
-               printk(KERN_EMERG "JBD: no memory for jbd_slab cache\n");
-               return -ENOMEM;
-       }
-       return 0;
-}
-
-void * jbd2_slab_alloc(size_t size, gfp_t flags)
-{
-       int idx;
-
-       idx = JBD_SLAB_INDEX(size);
-       BUG_ON(jbd_slab[idx] == NULL);
-       return kmem_cache_alloc(jbd_slab[idx], flags | __GFP_NOFAIL);
-}
-
-void jbd2_slab_free(void *ptr,  size_t size)
-{
-       int idx;
-
-       idx = JBD_SLAB_INDEX(size);
-       BUG_ON(jbd_slab[idx] == NULL);
-       kmem_cache_free(jbd_slab[idx], ptr);
+               return JBD2_TAG_SIZE32;
 }
 
 /*
@@ -1770,7 +1681,7 @@ static void journal_free_journal_head(struct journal_head *jh)
 {
 #ifdef CONFIG_JBD2_DEBUG
        atomic_dec(&nr_journal_heads);
-       memset(jh, JBD_POISON_FREE, sizeof(*jh));
+       memset(jh, JBD2_POISON_FREE, sizeof(*jh));
 #endif
        kmem_cache_free(jbd2_journal_head_cache, jh);
 }
@@ -1893,13 +1804,13 @@ static void __journal_remove_journal_head(struct buffer_head *bh)
                                printk(KERN_WARNING "%s: freeing "
                                                "b_frozen_data\n",
                                                __FUNCTION__);
-                               jbd2_slab_free(jh->b_frozen_data, bh->b_size);
+                               jbd2_free(jh->b_frozen_data, bh->b_size);
                        }
                        if (jh->b_committed_data) {
                                printk(KERN_WARNING "%s: freeing "
                                                "b_committed_data\n",
                                                __FUNCTION__);
-                               jbd2_slab_free(jh->b_committed_data, bh->b_size);
+                               jbd2_free(jh->b_committed_data, bh->b_size);
                        }
                        bh->b_private = NULL;
                        jh->b_bh = NULL;        /* debug, really */
@@ -1953,16 +1864,14 @@ void jbd2_journal_put_journal_head(struct journal_head *jh)
 /*
  * debugfs tunables
  */
-#if defined(CONFIG_JBD2_DEBUG)
-u8 jbd2_journal_enable_debug;
+#ifdef CONFIG_JBD2_DEBUG
+u8 jbd2_journal_enable_debug __read_mostly;
 EXPORT_SYMBOL(jbd2_journal_enable_debug);
-#endif
-
-#if defined(CONFIG_JBD2_DEBUG) && defined(CONFIG_DEBUG_FS)
 
 #define JBD2_DEBUG_NAME "jbd2-debug"
 
-struct dentry *jbd2_debugfs_dir, *jbd2_debug;
+static struct dentry *jbd2_debugfs_dir;
+static struct dentry *jbd2_debug;
 
 static void __init jbd2_create_debugfs_entry(void)
 {
@@ -1975,24 +1884,18 @@ static void __init jbd2_create_debugfs_entry(void)
 
 static void __exit jbd2_remove_debugfs_entry(void)
 {
-       if (jbd2_debug)
-               debugfs_remove(jbd2_debug);
-       if (jbd2_debugfs_dir)
-               debugfs_remove(jbd2_debugfs_dir);
+       debugfs_remove(jbd2_debug);
+       debugfs_remove(jbd2_debugfs_dir);
 }
 
 #else
 
 static void __init jbd2_create_debugfs_entry(void)
 {
-       do {
-       } while (0);
 }
 
 static void __exit jbd2_remove_debugfs_entry(void)
 {
-       do {
-       } while (0);
 }
 
 #endif
@@ -2040,7 +1943,6 @@ static void jbd2_journal_destroy_caches(void)
        jbd2_journal_destroy_revoke_caches();
        jbd2_journal_destroy_jbd2_journal_head_cache();
        jbd2_journal_destroy_handle_cache();
-       jbd2_journal_destroy_jbd_slabs();
 }
 
 static int __init journal_init(void)
index b50be8a044eb8d8bb8849bedc662d516bfa971bb..d0ce627539ef11710993c0c4236dc4821e0eacdf 100644 (file)
@@ -311,7 +311,7 @@ int jbd2_journal_skip_recovery(journal_t *journal)
 static inline unsigned long long read_tag_block(int tag_bytes, journal_block_tag_t *tag)
 {
        unsigned long long block = be32_to_cpu(tag->t_blocknr);
-       if (tag_bytes > JBD_TAG_SIZE32)
+       if (tag_bytes > JBD2_TAG_SIZE32)
                block |= (u64)be32_to_cpu(tag->t_blocknr_high) << 32;
        return block;
 }
index 01d88975e0c5641101921ef8e0901fd631446c78..3595fd432d5b55b25806e0bf48d03a2756de040a 100644 (file)
@@ -352,7 +352,7 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr,
                if (bh)
                        BUFFER_TRACE(bh, "found on hash");
        }
-#ifdef JBD_EXPENSIVE_CHECKING
+#ifdef JBD2_EXPENSIVE_CHECKING
        else {
                struct buffer_head *bh2;
 
@@ -453,7 +453,7 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
                }
        }
 
-#ifdef JBD_EXPENSIVE_CHECKING
+#ifdef JBD2_EXPENSIVE_CHECKING
        /* There better not be one left behind by now! */
        record = find_revoke_record(journal, bh->b_blocknr);
        J_ASSERT_JH(jh, record == NULL);
index 7946ff43fc40b5d91290efe2d5401e3aa3bf0d07..b1fcf2b3dca3e9154c2f1aa4ded8c796e1cbaac3 100644 (file)
@@ -96,13 +96,12 @@ static int start_this_handle(journal_t *journal, handle_t *handle)
 
 alloc_transaction:
        if (!journal->j_running_transaction) {
-               new_transaction = jbd_kmalloc(sizeof(*new_transaction),
-                                               GFP_NOFS);
+               new_transaction = kzalloc(sizeof(*new_transaction),
+                                               GFP_NOFS|__GFP_NOFAIL);
                if (!new_transaction) {
                        ret = -ENOMEM;
                        goto out;
                }
-               memset(new_transaction, 0, sizeof(*new_transaction));
        }
 
        jbd_debug(3, "New handle %p going live.\n", handle);
@@ -236,7 +235,7 @@ out:
 /* Allocate a new handle.  This should probably be in a slab... */
 static handle_t *new_handle(int nblocks)
 {
-       handle_t *handle = jbd_alloc_handle(GFP_NOFS);
+       handle_t *handle = jbd2_alloc_handle(GFP_NOFS);
        if (!handle)
                return NULL;
        memset(handle, 0, sizeof(*handle));
@@ -282,7 +281,7 @@ handle_t *jbd2_journal_start(journal_t *journal, int nblocks)
 
        err = start_this_handle(journal, handle);
        if (err < 0) {
-               jbd_free_handle(handle);
+               jbd2_free_handle(handle);
                current->journal_info = NULL;
                handle = ERR_PTR(err);
        }
@@ -668,7 +667,7 @@ repeat:
                                JBUFFER_TRACE(jh, "allocate memory for buffer");
                                jbd_unlock_bh_state(bh);
                                frozen_buffer =
-                                       jbd2_slab_alloc(jh2bh(jh)->b_size,
+                                       jbd2_alloc(jh2bh(jh)->b_size,
                                                         GFP_NOFS);
                                if (!frozen_buffer) {
                                        printk(KERN_EMERG
@@ -728,7 +727,7 @@ done:
 
 out:
        if (unlikely(frozen_buffer))    /* It's usually NULL */
-               jbd2_slab_free(frozen_buffer, bh->b_size);
+               jbd2_free(frozen_buffer, bh->b_size);
 
        JBUFFER_TRACE(jh, "exit");
        return error;
@@ -881,7 +880,7 @@ int jbd2_journal_get_undo_access(handle_t *handle, struct buffer_head *bh)
 
 repeat:
        if (!jh->b_committed_data) {
-               committed_data = jbd2_slab_alloc(jh2bh(jh)->b_size, GFP_NOFS);
+               committed_data = jbd2_alloc(jh2bh(jh)->b_size, GFP_NOFS);
                if (!committed_data) {
                        printk(KERN_EMERG "%s: No memory for committed data\n",
                                __FUNCTION__);
@@ -908,7 +907,7 @@ repeat:
 out:
        jbd2_journal_put_journal_head(jh);
        if (unlikely(committed_data))
-               jbd2_slab_free(committed_data, bh->b_size);
+               jbd2_free(committed_data, bh->b_size);
        return err;
 }
 
@@ -1411,7 +1410,7 @@ int jbd2_journal_stop(handle_t *handle)
                spin_unlock(&journal->j_state_lock);
        }
 
-       jbd_free_handle(handle);
+       jbd2_free_handle(handle);
        return err;
 }
 
index 464eeccb675be82378a7d9d7a69b7498cf5b106a..1e5c7166916415b53abf5908e045dcb28f6bc072 100644 (file)
@@ -1659,8 +1659,10 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
                error = locks_verify_locked(inode);
                if (!error) {
                        DQUOT_INIT(inode);
-                       
-                       error = do_truncate(dentry, 0, ATTR_MTIME|ATTR_CTIME, NULL);
+
+                       error = do_truncate(dentry, 0,
+                                           ATTR_MTIME|ATTR_CTIME|ATTR_OPEN,
+                                           NULL);
                }
                put_write_access(inode);
                if (error)
index 6c22453d77aea6071622f6d2d104d1b6c258d223..6d2f2a3eccf878d5cdd1e45fcbc794c7e63e9af3 100644 (file)
@@ -357,6 +357,10 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr)
 
        nfs_inc_stats(inode, NFSIOS_VFSSETATTR);
 
+       /* skip mode change if it's just for clearing setuid/setgid */
+       if (attr->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
+               attr->ia_valid &= ~ATTR_MODE;
+
        if (attr->ia_valid & ATTR_SIZE) {
                if (!S_ISREG(inode->i_mode) || attr->ia_size == i_size_read(inode))
                        attr->ia_valid &= ~ATTR_SIZE;
index 819545d216706be7447392a482328b37d4d3cb5c..46934c97f8f7fe30c915aa24e0cee144c390657b 100644 (file)
@@ -364,14 +364,23 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
        if (iap->ia_valid & ATTR_MODE) {
                iap->ia_mode &= S_IALLUGO;
                imode = iap->ia_mode |= (imode & ~S_IALLUGO);
+               /* if changing uid/gid revoke setuid/setgid in mode */
+               if ((iap->ia_valid & ATTR_UID) && iap->ia_uid != inode->i_uid) {
+                       iap->ia_valid |= ATTR_KILL_PRIV;
+                       iap->ia_mode &= ~S_ISUID;
+               }
+               if ((iap->ia_valid & ATTR_GID) && iap->ia_gid != inode->i_gid)
+                       iap->ia_mode &= ~S_ISGID;
+       } else {
+               /*
+                * Revoke setuid/setgid bit on chown/chgrp
+                */
+               if ((iap->ia_valid & ATTR_UID) && iap->ia_uid != inode->i_uid)
+                       iap->ia_valid |= ATTR_KILL_SUID | ATTR_KILL_PRIV;
+               if ((iap->ia_valid & ATTR_GID) && iap->ia_gid != inode->i_gid)
+                       iap->ia_valid |= ATTR_KILL_SGID;
        }
 
-       /* Revoke setuid/setgid bit on chown/chgrp */
-       if ((iap->ia_valid & ATTR_UID) && iap->ia_uid != inode->i_uid)
-               iap->ia_valid |= ATTR_KILL_SUID | ATTR_KILL_PRIV;
-       if ((iap->ia_valid & ATTR_GID) && iap->ia_gid != inode->i_gid)
-               iap->ia_valid |= ATTR_KILL_SGID;
-
        /* Change the attributes. */
 
        iap->ia_valid |= ATTR_CTIME;
index e7905816c4caa1dce9b471bced589051e53da3e7..64965e1c21c46ca2dcb9aae20611a0725e9d4f4b 100644 (file)
@@ -111,7 +111,7 @@ utf8_wctomb(__u8 *s, wchar_t wc, int maxlen)
        int c, nc;
        const struct utf8_table *t;
   
-       if (s == 0)
+       if (!s)
                return 0;
   
        l = wc;
index 9ea12004fa57e6ecbe44abb357ee2599cbed9daf..0804289d355d9dc94f7d2630c0ae812bb24e9563 100644 (file)
@@ -3061,7 +3061,11 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = dentry->d_inode;
        int error;
-       unsigned int ia_valid = attr->ia_valid;
+       unsigned int ia_valid;
+
+       /* must be turned off for recursive notify_change calls */
+       ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID);
+
        reiserfs_write_lock(inode->i_sb);
        if (attr->ia_valid & ATTR_SIZE) {
                /* version 2 items will be caught by the s_maxbytes check
index 9e71201000d58eb8943650bc14c938aca1850513..381b4f5b4d5dfb9c25a5ce84ca43d651710da9f2 100644 (file)
@@ -2,6 +2,7 @@
 #define _ALPHA_BITOPS_H
 
 #include <asm/compiler.h>
+#include <asm/barrier.h>
 
 /*
  * Copyright 1994, Linus Torvalds.
@@ -69,6 +70,13 @@ clear_bit(unsigned long nr, volatile void * addr)
        :"Ir" (1UL << (nr & 31)), "m" (*m));
 }
 
+static inline void
+clear_bit_unlock(unsigned long nr, volatile void * addr)
+{
+       smp_mb();
+       clear_bit(nr, addr);
+}
+
 /*
  * WARNING: non atomic version.
  */
@@ -80,6 +88,13 @@ __clear_bit(unsigned long nr, volatile void * addr)
        *m &= ~(1 << (nr & 31));
 }
 
+static inline void
+__clear_bit_unlock(unsigned long nr, volatile void * addr)
+{
+       smp_mb();
+       __clear_bit(nr, addr);
+}
+
 static inline void
 change_bit(unsigned long nr, volatile void * addr)
 {
@@ -116,6 +131,36 @@ test_and_set_bit(unsigned long nr, volatile void *addr)
        unsigned long temp;
        int *m = ((int *) addr) + (nr >> 5);
 
+       __asm__ __volatile__(
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "1:     ldl_l %0,%4\n"
+       "       and %0,%3,%2\n"
+       "       bne %2,2f\n"
+       "       xor %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,3f\n"
+       "2:\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+       return oldbit != 0;
+}
+
+static inline int
+test_and_set_bit_lock(unsigned long nr, volatile void *addr)
+{
+       unsigned long oldbit;
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
        __asm__ __volatile__(
        "1:     ldl_l %0,%4\n"
        "       and %0,%3,%2\n"
@@ -158,6 +203,9 @@ test_and_clear_bit(unsigned long nr, volatile void * addr)
        int *m = ((int *) addr) + (nr >> 5);
 
        __asm__ __volatile__(
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
        "1:     ldl_l %0,%4\n"
        "       and %0,%3,%2\n"
        "       beq %2,2f\n"
@@ -199,6 +247,9 @@ test_and_change_bit(unsigned long nr, volatile void * addr)
        int *m = ((int *) addr) + (nr >> 5);
 
        __asm__ __volatile__(
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
        "1:     ldl_l %0,%4\n"
        "       and %0,%3,%2\n"
        "       xor %0,%3,%0\n"
index 6903db7fae154b15b5490e4ba2d8154a7690d869..9d9f4b54b2ce6f20013c6e5f39f69980b308288f 100644 (file)
@@ -7,6 +7,8 @@
  *
  */
 
+#include <linux/suspend.h>
+
 struct pxa_cpu_pm_fns {
        int     save_size;
        void    (*save)(unsigned long *);
index b41831b6432fb44f7967720b31e892e58005ed82..52fe05895debb77159a13f1eb68f05f907799aee 100644 (file)
@@ -286,6 +286,7 @@ static inline int constant_fls(int x)
 
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 /*
  * Ext2 is defined to use little-endian byte ordering.
index 5299f8c8e11dc71d99c068d66a2848fb1c73b7f3..f3faddfd46a8b924bd40ef7eb544797fc56bd229 100644 (file)
@@ -288,6 +288,7 @@ static inline int ffs(unsigned long word)
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
index 27c2d0e48e1b6b314e88f18b274dd15c41541017..03ecedc1f2a74089838768efc21ba495b62f2a67 100644 (file)
@@ -199,6 +199,7 @@ static __inline__ int __test_bit(int nr, const void *addr)
 
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
index 6bb3e0d4705db8ab8234524a0e757cb22f6acc12..c571e958558cde4876c663a7a084ffa74883f489 100644 (file)
@@ -104,13 +104,13 @@ unsigned long get_wchan(struct task_struct *p);
 #define cpu_relax()            barrier()
 
 /* Get the Silicon Revision of the chip */
-static inline __attribute_pure__ uint32_t bfin_revid(void)
+static inline uint32_t __pure bfin_revid(void)
 {
        /* stored in the upper 4 bits */
        return bfin_read_CHIPID() >> 28;
 }
 
-static inline __attribute_pure__ uint32_t bfin_compiled_revid(void)
+static inline uint32_t __pure bfin_compiled_revid(void)
 {
 #if defined(CONFIG_BF_REV_0_0)
        return 0;
index a569065113d916671f7562c946a8c7690de60fd7..617151b9b72bb52cde9433c825ac0829b879ba7b 100644 (file)
@@ -154,6 +154,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
 #include <asm-generic/bitops/find.h>
+#include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
 
index f8560edf59ff8f30859b78c7142f461803bee1ee..8dba74b1a2549e10a520ae9766151f4e613c77a6 100644 (file)
@@ -302,6 +302,7 @@ int __ilog2_u64(u64 n)
 
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
 
index 1f9d99193df8ef368c70d8abb18ddcf3a885f91a..e022a0f59e6bb8707268466922adcb849e9e284e 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/ffs.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h
new file mode 100644 (file)
index 0000000..308a9e2
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef _ASM_GENERIC_BITOPS_LOCK_H_
+#define _ASM_GENERIC_BITOPS_LOCK_H_
+
+/**
+ * test_and_set_bit_lock - Set a bit and return its old value, for lock
+ * @nr: Bit to set
+ * @addr: Address to count from
+ *
+ * This operation is atomic and provides acquire barrier semantics.
+ * It can be used to implement bit locks.
+ */
+#define test_and_set_bit_lock(nr, addr)        test_and_set_bit(nr, addr)
+
+/**
+ * clear_bit_unlock - Clear a bit in memory, for unlock
+ * @nr: the bit to set
+ * @addr: the address to start counting from
+ *
+ * This operation is atomic and provides release barrier semantics.
+ */
+#define clear_bit_unlock(nr, addr)     \
+do {                                   \
+       smp_mb__before_clear_bit();     \
+       clear_bit(nr, addr);            \
+} while (0)
+
+/**
+ * __clear_bit_unlock - Clear a bit in memory, for unlock
+ * @nr: the bit to set
+ * @addr: the address to start counting from
+ *
+ * This operation is like clear_bit_unlock, however it is not atomic.
+ * It does provide release barrier semantics so it can be used to unlock
+ * a bit lock, however it would only be used if no other CPU can modify
+ * any bits in the memory until the lock is released (a good example is
+ * if the bit lock itself protects access to the other bits in the word).
+ */
+#define __clear_bit_unlock(nr, addr)   \
+do {                                   \
+       smp_mb();                       \
+       __clear_bit(nr, addr);          \
+} while (0)
+
+#endif /* _ASM_GENERIC_BITOPS_LOCK_H_ */
+
index d76299c98b817ad0c492a276f79262bb22fea8d8..e64ad315656dfea57dbe90bfb14eb775b25657a2 100644 (file)
@@ -194,6 +194,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
 #include <asm-generic/bitops/minix.h>
index 6cc517e212a92ee94e461c2e1944f3fe9af0c627..2144f1a8ed6f7f89793858c9cab1d4f73b37be95 100644 (file)
@@ -93,6 +93,38 @@ clear_bit (int nr, volatile void *addr)
        } while (cmpxchg_acq(m, old, new) != old);
 }
 
+/**
+ * clear_bit_unlock - Clears a bit in memory with release
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ *
+ * clear_bit_unlock() is atomic and may not be reordered.  It does
+ * contain a memory barrier suitable for unlock type operations.
+ */
+static __inline__ void
+clear_bit_unlock (int nr, volatile void *addr)
+{
+       __u32 mask, old, new;
+       volatile __u32 *m;
+       CMPXCHG_BUGCHECK_DECL
+
+       m = (volatile __u32 *) addr + (nr >> 5);
+       mask = ~(1 << (nr & 31));
+       do {
+               CMPXCHG_BUGCHECK(m);
+               old = *m;
+               new = old & mask;
+       } while (cmpxchg_rel(m, old, new) != old);
+}
+
+/**
+ * __clear_bit_unlock - Non-atomically clear a bit with release
+ *
+ * This is like clear_bit_unlock, but the implementation may use a non-atomic
+ * store (this one uses an atomic, however).
+ */
+#define __clear_bit_unlock clear_bit_unlock
+
 /**
  * __clear_bit - Clears a bit in memory (non-atomic version)
  */
@@ -169,6 +201,15 @@ test_and_set_bit (int nr, volatile void *addr)
        return (old & bit) != 0;
 }
 
+/**
+ * test_and_set_bit_lock - Set a bit and return its old value for lock
+ * @nr: Bit to set
+ * @addr: Address to count from
+ *
+ * This is the same as test_and_set_bit on ia64
+ */
+#define test_and_set_bit_lock test_and_set_bit
+
 /**
  * __test_and_set_bit - Set a bit and return its old value
  * @nr: Bit to set
index 66ab672162cdc42b8f2b5725d64508e07aea1fb6..313a02c4a88923cbd1003833835df45ee980993d 100644 (file)
@@ -255,6 +255,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/ffs.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #endif /* __KERNEL__ */
 
index 1a61fdb56aaf671dc82e669d009d6fb6f3e64324..da151f70cdc6389a245590245863029129e12075 100644 (file)
@@ -314,6 +314,7 @@ static inline int fls(int x)
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 /* Bitmap functions for the minix filesystem */
 
index 7d6075d9b5cb8998faa785d68a8392dd2115ab00..b8b2770d6870965de40edcf112b405aadd2f881e 100644 (file)
@@ -160,6 +160,7 @@ static __inline__ int __test_bit(int nr, const volatile unsigned long * addr)
 
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 static __inline__ int ext2_set_bit(int nr, volatile void * addr)
 {
index 899357a72ac4e15faab61c77a89ae20e34e9dcc5..77ed0c79830b6335dbb1c86fb4244091d63e7608 100644 (file)
@@ -171,6 +171,20 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
        }
 }
 
+/*
+ * clear_bit_unlock - Clears a bit in memory
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ *
+ * clear_bit() is atomic and implies release semantics before the memory
+ * operation. It can be used for an unlock.
+ */
+static inline void clear_bit_unlock(unsigned long nr, volatile unsigned long *addr)
+{
+       smp_mb__before_clear_bit();
+       clear_bit(nr, addr);
+}
+
 /*
  * change_bit - Toggle a bit in memory
  * @nr: Bit to change
@@ -240,6 +254,8 @@ static inline int test_and_set_bit(unsigned long nr,
        unsigned short bit = nr & SZLONG_MASK;
        unsigned long res;
 
+       smp_llsc_mb();
+
        if (cpu_has_llsc && R10000_LLSC_WAR) {
                unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
                unsigned long temp;
@@ -294,6 +310,73 @@ static inline int test_and_set_bit(unsigned long nr,
        return res != 0;
 }
 
+/*
+ * test_and_set_bit_lock - Set a bit and return its old value
+ * @nr: Bit to set
+ * @addr: Address to count from
+ *
+ * This operation is atomic and implies acquire ordering semantics
+ * after the memory operation.
+ */
+static inline int test_and_set_bit_lock(unsigned long nr,
+       volatile unsigned long *addr)
+{
+       unsigned short bit = nr & SZLONG_MASK;
+       unsigned long res;
+
+       if (cpu_has_llsc && R10000_LLSC_WAR) {
+               unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
+               unsigned long temp;
+
+               __asm__ __volatile__(
+               "       .set    mips3                                   \n"
+               "1:     " __LL "%0, %1          # test_and_set_bit      \n"
+               "       or      %2, %0, %3                              \n"
+               "       " __SC  "%2, %1                                 \n"
+               "       beqzl   %2, 1b                                  \n"
+               "       and     %2, %0, %3                              \n"
+               "       .set    mips0                                   \n"
+               : "=&r" (temp), "=m" (*m), "=&r" (res)
+               : "r" (1UL << bit), "m" (*m)
+               : "memory");
+       } else if (cpu_has_llsc) {
+               unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
+               unsigned long temp;
+
+               __asm__ __volatile__(
+               "       .set    push                                    \n"
+               "       .set    noreorder                               \n"
+               "       .set    mips3                                   \n"
+               "1:     " __LL "%0, %1          # test_and_set_bit      \n"
+               "       or      %2, %0, %3                              \n"
+               "       " __SC  "%2, %1                                 \n"
+               "       beqz    %2, 2f                                  \n"
+               "        and    %2, %0, %3                              \n"
+               "       .subsection 2                                   \n"
+               "2:     b       1b                                      \n"
+               "        nop                                            \n"
+               "       .previous                                       \n"
+               "       .set    pop                                     \n"
+               : "=&r" (temp), "=m" (*m), "=&r" (res)
+               : "r" (1UL << bit), "m" (*m)
+               : "memory");
+       } else {
+               volatile unsigned long *a = addr;
+               unsigned long mask;
+               unsigned long flags;
+
+               a += nr >> SZLONG_LOG;
+               mask = 1UL << bit;
+               raw_local_irq_save(flags);
+               res = (mask & *a);
+               *a |= mask;
+               raw_local_irq_restore(flags);
+       }
+
+       smp_llsc_mb();
+
+       return res != 0;
+}
 /*
  * test_and_clear_bit - Clear a bit and return its old value
  * @nr: Bit to clear
@@ -308,6 +391,8 @@ static inline int test_and_clear_bit(unsigned long nr,
        unsigned short bit = nr & SZLONG_MASK;
        unsigned long res;
 
+       smp_llsc_mb();
+
        if (cpu_has_llsc && R10000_LLSC_WAR) {
                unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
                unsigned long temp;
@@ -396,6 +481,8 @@ static inline int test_and_change_bit(unsigned long nr,
        unsigned short bit = nr & SZLONG_MASK;
        unsigned long res;
 
+       smp_llsc_mb();
+
        if (cpu_has_llsc && R10000_LLSC_WAR) {
                unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
                unsigned long temp;
@@ -452,6 +539,21 @@ static inline int test_and_change_bit(unsigned long nr,
 
 #include <asm-generic/bitops/non-atomic.h>
 
+/*
+ * __clear_bit_unlock - Clears a bit in memory
+ * @nr: Bit to clear
+ * @addr: Address to start counting from
+ *
+ * __clear_bit() is non-atomic and implies release semantics before the memory
+ * operation. It can be used for an unlock if no other CPUs can concurrently
+ * modify other bits in the word.
+ */
+static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *addr)
+{
+       smp_mb();
+       __clear_bit(nr, addr);
+}
+
 /*
  * Return the bit position (0..63) of the most significant 1 bit in a word
  * Returns -1 if no 1 bit exists
index c1a10314b317ccf441b6a2aba38220e35c3e117a..624d66c7f290268d08916f056d43451c124aeefc 100644 (file)
        lh      t1, KV_RO_NASID_OFFSET(t0)
        lh      t2, KV_RW_NASID_OFFSET(t0)
        MAPPED_KERNEL_SETUP_TLB
-       ARC64_TWIDDLE_PC
+
+       /*
+        * We might not get launched at the address the kernel is linked to,
+        * so we jump there.
+        */
+       PTR_LA  t0, 0f
+       jr      t0
+0:
        .endm
 
 #endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */
index 35555bd5c52d529a0720f216be336177ceef5620..cf76f4f7435f09e96d02ffb9a80522b99be48103 100644 (file)
@@ -40,7 +40,6 @@ extern int rtc_mips_set_mmss(unsigned long);
  * mips_timer_ack may be NULL if the interrupt is self-recoverable.
  */
 extern int (*mips_timer_state)(void);
-extern void (*mips_timer_ack)(void);
 
 /*
  * High precision timer clocksource.
@@ -76,6 +75,12 @@ extern int (*perf_irq)(void);
 /*
  * Initialize the calling CPU's compare interrupt as clockevent device
  */
+#ifdef CONFIG_CEVT_R4K
 extern void mips_clockevent_init(void);
+#else
+static inline void mips_clockevent_init(void)
+{
+}
+#endif
 
 #endif /* _ASM_TIME_H */
index 015cb0d379bd991d42c719d32bd2111f9573b63f..03ae287baf89ccd6bd81d10692d14616f9e18ca5 100644 (file)
@@ -208,6 +208,7 @@ static __inline__ int fls(int x)
 
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/sched.h>
 
 #endif /* __KERNEL__ */
index 8144a2788db67bc101e47b20545d8fecf03ded35..e85c3e078ba29be59f7d4f0425844de39d24461a 100644 (file)
@@ -86,6 +86,24 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
        : "cc" );
 }
 
+static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr)
+{
+       unsigned long old;
+       unsigned long mask = BITOP_MASK(nr);
+       unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
+
+       __asm__ __volatile__(
+       LWSYNC_ON_SMP
+"1:"   PPC_LLARX "%0,0,%3      # clear_bit_unlock\n"
+       "andc   %0,%0,%2\n"
+       PPC405_ERR77(0,%3)
+       PPC_STLCX "%0,0,%3\n"
+       "bne-   1b"
+       : "=&r" (old), "+m" (*p)
+       : "r" (mask), "r" (p)
+       : "cc", "memory");
+}
+
 static __inline__ void change_bit(int nr, volatile unsigned long *addr)
 {
        unsigned long old;
@@ -125,6 +143,27 @@ static __inline__ int test_and_set_bit(unsigned long nr,
        return (old & mask) != 0;
 }
 
+static __inline__ int test_and_set_bit_lock(unsigned long nr,
+                                      volatile unsigned long *addr)
+{
+       unsigned long old, t;
+       unsigned long mask = BITOP_MASK(nr);
+       unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
+
+       __asm__ __volatile__(
+"1:"   PPC_LLARX "%0,0,%3              # test_and_set_bit_lock\n"
+       "or     %1,%0,%2 \n"
+       PPC405_ERR77(0,%3)
+       PPC_STLCX "%1,0,%3 \n"
+       "bne-   1b"
+       ISYNC_ON_SMP
+       : "=&r" (old), "=&r" (t)
+       : "r" (mask), "r" (p)
+       : "cc", "memory");
+
+       return (old & mask) != 0;
+}
+
 static __inline__ int test_and_clear_bit(unsigned long nr,
                                         volatile unsigned long *addr)
 {
@@ -185,6 +224,12 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
 
 #include <asm-generic/bitops/non-atomic.h>
 
+static __inline__ void __clear_bit_unlock(int nr, volatile unsigned long *addr)
+{
+       __asm__ __volatile__(LWSYNC_ON_SMP "" ::: "memory");
+       __clear_bit(nr, addr);
+}
+
 /*
  * Return the zero-based bit position (LE, not IBM bit numbering) of
  * the most significant 1-bit in a double word.
index 24751df791ac603519dc00d77175f99587a37948..568135fe52ea8f2ec003c88b23646fc5fac62746 100644 (file)
@@ -18,6 +18,8 @@
 #include <asm/prom.h>
 #endif /* __ASSEMBLY__ */
 
+#include <linux/suspend.h>
+
 
 /* ======================================================================== */
 /* Structures mapping of some unit register set                             */
@@ -267,9 +269,9 @@ extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
 extern int __init lite5200_pm_init(void);
 
 /* lite5200 calls mpc5200 suspend functions, so here they are */
-extern int mpc52xx_pm_prepare(suspend_state_t);
+extern int mpc52xx_pm_prepare(void);
 extern int mpc52xx_pm_enter(suspend_state_t);
-extern int mpc52xx_pm_finish(suspend_state_t);
+extern void mpc52xx_pm_finish(void);
 extern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */
 #endif
 #endif /* CONFIG_PM */
index fcd7b428ed0bbc01e13ee9b443b43076fbeed907..98c6bd5756b756a3147ff72a300162e4ba876adb 100644 (file)
@@ -114,6 +114,9 @@ struct paca_struct {
        u64 user_time;                  /* accumulated usermode TB ticks */
        u64 system_time;                /* accumulated system TB ticks */
        u64 startpurr;                  /* PURR/TB value snapshot */
+       u64 startspurr;                 /* SPURR value snapshot */
+       u64 purrdelta;                  /* FIXME: document */
+       u64 spurrdelta;                 /* FIXME: document */
 };
 
 extern struct paca_struct paca[];
index f7eadf6ac8063ddb6604a9cd09a5aba57abc1c2f..81dbcd43a501355bd90bceb8c1dc24a7f8c14f66 100644 (file)
@@ -57,7 +57,7 @@ static __inline__ void set_dec(unsigned int val)
 /* Accessor functions for the timebase (RTC on 601) registers. */
 /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
 #ifdef CONFIG_6xx
-extern __inline__ int __attribute_pure__ __USE_RTC(void) {
+extern __inline__ int __pure __USE_RTC(void) {
        return (mfspr(SPRN_PVR)>>16) == 1;
 }
 #else
index f79c9b792af1d88d0d54ed7f5762bc232c96b51d..d756b34d25f309555d91631d1aead2a0a3e13578 100644 (file)
@@ -746,6 +746,7 @@ static inline int sched_find_first_bit(unsigned long *b)
 #include <asm-generic/bitops/fls64.h>
 
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 /*
  * ATTENTION: intel byte ordering convention for ext2 and minix !!
index 1c16792cee1dbaf239948ac8971dd2ad7290865e..9d7021723a25363c0828f4b3422ef9fc1b52d145 100644 (file)
@@ -137,6 +137,7 @@ static inline unsigned long __ffs(unsigned long word)
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/ffs.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
index f3bdcdb5d0463089205783e876db06f73e096409..444d5ea92ce9452c8f70abc46539330c8c9f2fd1 100644 (file)
@@ -136,6 +136,7 @@ static __inline__ unsigned long ffz(unsigned long word)
 #include <asm-generic/bitops/__ffs.h>
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/ffs.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
index 329e696e77516c8511ec0a04972aeefafabf16d3..00bd0a679d702f0a07737cd66f766442cb70f09d 100644 (file)
@@ -96,6 +96,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
 #include <asm-generic/bitops/fls.h>
 #include <asm-generic/bitops/fls64.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #include <asm-generic/bitops/ext2-atomic.h>
index bdf77b0dfd8e5875cd4a50a1f9c2c8708f1c3e52..058c2064f706feabed5a7e10d9ef8790a185b2d7 100644 (file)
 #define TCSETS         _IOW('T', 9, struct termios)
 #define TCSETSW                _IOW('T', 10, struct termios)
 #define TCSETSF                _IOW('T', 11, struct termios)
+#define TCGETS2                _IOR('T', 12, struct termios2)
+#define TCSETS2                _IOW('T', 13, struct termios2)
+#define TCSETSW2       _IOW('T', 14, struct termios2)
+#define TCSETSF2       _IOW('T', 15, struct termios2)
 
 /* Note that all the ioctls that are not available in Linux have a 
  * double underscore on the front to: a) avoid some programs to
index 64a230064ef254c9d6aee2b797e666f0417e774a..d638737ff13c3097c97b80ec9b6469d95e431857 100644 (file)
 
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
-extern struct bus_type of_platform_bus_type;
+
 #define of_bus_type    of_platform_bus_type    /* for compatibility */
 
-extern int of_register_driver(struct of_platform_driver *drv,
-                             struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
 extern struct of_device *of_platform_device_create(struct device_node *np,
                                                   const char *bus_id,
                                                   struct device *parent,
index 5eb00a105d7c0f70764223e162fc05a4e6d6054a..90cf2210118b809e19818d8334941c31252951ab 100644 (file)
@@ -31,6 +31,18 @@ struct termios {
 #endif
 };
 
+struct termios2 {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t _x_cc[2];                  /* padding to match ktermios */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 struct ktermios {
        tcflag_t c_iflag;               /* input mode flags */
        tcflag_t c_oflag;               /* output mode flags */
@@ -160,6 +172,7 @@ struct ktermios {
 #define CLOCAL   0x00000800
 #define CBAUDEX   0x00001000
 /* We'll never see these speeds with the Zilogs, but for completeness... */
+#define  BOTHER   0x00001000
 #define  B57600   0x00001001
 #define  B115200  0x00001002
 #define  B230400  0x00001003
@@ -189,6 +202,8 @@ struct ktermios {
 #define CMSPAR   0x40000000  /* mark or space (stick) parity */
 #define CRTSCTS          0x80000000  /* flow control */
 
+#define IBSHIFT          16            /* Shift from CBAUD to CIBAUD */
+
 /* c_lflag bits */
 #define ISIG   0x00000001
 #define ICANON 0x00000002
index d767f206ab33317988868a41a804d68054760019..4333232abb9f4e393619585086a408f243868b83 100644 (file)
@@ -107,6 +107,48 @@ struct winsize {
 })
 
 #define user_termios_to_kernel_termios(k, u) \
+({ \
+       int err; \
+       err  = get_user((k)->c_iflag, &(u)->c_iflag); \
+       err |= get_user((k)->c_oflag, &(u)->c_oflag); \
+       err |= get_user((k)->c_cflag, &(u)->c_cflag); \
+       err |= get_user((k)->c_lflag, &(u)->c_lflag); \
+       err |= get_user((k)->c_line,  &(u)->c_line); \
+       err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
+       if ((k)->c_lflag & ICANON) { \
+               err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
+               err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
+       } else { \
+               err |= get_user((k)->c_cc[VMIN],  &(u)->c_cc[_VMIN]); \
+               err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
+       } \
+       err |= get_user((k)->c_ispeed,  &(u)->c_ispeed); \
+       err |= get_user((k)->c_ospeed,  &(u)->c_ospeed); \
+       err; \
+})
+
+#define kernel_termios_to_user_termios(u, k) \
+({ \
+       int err; \
+       err  = put_user((k)->c_iflag, &(u)->c_iflag); \
+       err |= put_user((k)->c_oflag, &(u)->c_oflag); \
+       err |= put_user((k)->c_cflag, &(u)->c_cflag); \
+       err |= put_user((k)->c_lflag, &(u)->c_lflag); \
+       err |= put_user((k)->c_line, &(u)->c_line); \
+       err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
+       if (!((k)->c_lflag & ICANON)) { \
+               err |= put_user((k)->c_cc[VMIN],  &(u)->c_cc[_VMIN]); \
+               err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
+       } else { \
+               err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
+               err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
+       } \
+       err |= put_user((k)->c_ispeed, &(u)->c_ispeed); \
+       err |= put_user((k)->c_ospeed, &(u)->c_ospeed); \
+       err; \
+})
+
+#define user_termios_to_kernel_termios_1(k, u) \
 ({ \
        get_user((k)->c_iflag, &(u)->c_iflag); \
        get_user((k)->c_oflag, &(u)->c_oflag); \
@@ -114,7 +156,7 @@ struct winsize {
        get_user((k)->c_lflag, &(u)->c_lflag); \
        get_user((k)->c_line,  &(u)->c_line); \
        copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
-       if((k)->c_lflag & ICANON) { \
+       if ((k)->c_lflag & ICANON) { \
                get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
                get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
        } else { \
@@ -124,7 +166,7 @@ struct winsize {
        0; \
 })
 
-#define kernel_termios_to_user_termios(u, k) \
+#define kernel_termios_to_user_termios_1(u, k) \
 ({ \
        put_user((k)->c_iflag, &(u)->c_iflag); \
        put_user((k)->c_oflag, &(u)->c_oflag); \
@@ -132,7 +174,7 @@ struct winsize {
        put_user((k)->c_lflag, &(u)->c_lflag); \
        put_user((k)->c_line, &(u)->c_line); \
        copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
-       if(!((k)->c_lflag & ICANON)) { \
+       if (!((k)->c_lflag & ICANON)) { \
                put_user((k)->c_cc[VMIN],  &(u)->c_cc[_VMIN]); \
                put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
        } else { \
diff --git a/include/asm-sparc64/backoff.h b/include/asm-sparc64/backoff.h
new file mode 100644 (file)
index 0000000..0e32f8b
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _SPARC64_BACKOFF_H
+#define _SPARC64_BACKOFF_H
+
+#define BACKOFF_LIMIT  (4 * 1024)
+
+#ifdef CONFIG_SMP
+
+#define BACKOFF_SETUP(reg)     \
+       mov     1, reg
+
+#define BACKOFF_SPIN(reg, tmp, label)  \
+       mov     reg, tmp; \
+88:    brnz,pt tmp, 88b; \
+        sub    tmp, 1, tmp; \
+       cmp     reg, BACKOFF_LIMIT; \
+       bg,pn   %xcc, label; \
+        nop; \
+       ba,pt   %xcc, label; \
+        sllx   reg, 1, reg;
+
+#else
+
+#define BACKOFF_SETUP(reg)
+#define BACKOFF_SPIN(reg, tmp, label)
+
+#endif
+
+#endif /* _SPARC64_BACKOFF_H */
index 3d5e1af84723bade56ba80e46e98944d14d0e4d7..dd4bfe993b619160ba8e7e9629cacc6342a8930b 100644 (file)
@@ -81,6 +81,7 @@ static inline unsigned int hweight8(unsigned int w)
 #include <asm-generic/bitops/hweight.h>
 
 #endif
+#include <asm-generic/bitops/lock.h>
 #endif /* __KERNEL__ */
 
 #include <asm-generic/bitops/find.h>
index 2223b6d0e5ed882c983b5717c9adff133bf013a2..083c9a0f37deb9907a149036ca5ea13e979d3fb3 100644 (file)
 #define TCSETS         _IOW('T', 9, struct termios)
 #define TCSETSW                _IOW('T', 10, struct termios)
 #define TCSETSF                _IOW('T', 11, struct termios)
+#define TCGETS2                _IOR('T', 12, struct termios2)
+#define TCSETS2                _IOW('T', 13, struct termios2)
+#define TCSETSW2       _IOW('T', 14, struct termios2)
+#define TCSETSF2       _IOW('T', 15, struct termios2)
 
 /* Note that all the ioctls that are not available in Linux have a 
  * double underscore on the front to: a) avoid some programs to
index f7c1f17c7d52bb4ced8ee5a347105cb037a502cd..f15cfa723916a3bac7180f6005a96f318b1e5d7f 100644 (file)
 extern struct bus_type isa_bus_type;
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
-extern struct bus_type of_platform_bus_type;
+
 #define of_bus_type    of_platform_bus_type    /* for compatibility */
 
-extern int of_register_driver(struct of_platform_driver *drv,
-                             struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
 extern struct of_device *of_platform_device_create(struct device_node *np,
                                                   const char *bus_id,
                                                   struct device *parent,
index 705cd44b41730d0bd8f5604f854c6fc53e76b922..ebe31c152f16f2c46e592dbd2f1c8fe257d99437 100644 (file)
@@ -5,8 +5,6 @@
 
 typedef unsigned char   cc_t;
 typedef unsigned int    speed_t;
-
-/* XXX is this right for sparc64?  it was an unsigned long... XXX */
 typedef unsigned int    tcflag_t;
 
 #define NCC 8
@@ -33,6 +31,18 @@ struct termios {
 #endif
 };
 
+struct termios2 {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_line;                    /* line discipline */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t _x_cc[2];                  /* padding to match ktermios */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
 struct ktermios {
        tcflag_t c_iflag;               /* input mode flags */
        tcflag_t c_oflag;               /* output mode flags */
@@ -161,6 +171,7 @@ struct ktermios {
 #define HUPCL    0x00000400
 #define CLOCAL   0x00000800
 #define CBAUDEX   0x00001000
+#define  BOTHER   0x00001000
 #define  B57600   0x00001001
 #define  B115200  0x00001002
 #define  B230400  0x00001003
@@ -190,6 +201,8 @@ struct ktermios {
 #define CMSPAR    0x40000000  /* mark or space (stick) parity */
 #define CRTSCTS          0x80000000  /* flow control */
 
+#define IBSHIFT          16            /* Shift from CBAUD to CIBAUD */
+
 /* c_lflag bits */
 #define ISIG   0x00000001
 #define ICANON 0x00000002
index f05d390993d5d4c953727a240577e28e6649efa2..ef527211f8a89a3a6e1e90cd44b7ddb753ef6483 100644 (file)
@@ -123,10 +123,52 @@ struct winsize {
                err |= get_user((k)->c_cc[VMIN],  &(u)->c_cc[_VMIN]); \
                err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
        } \
+       err |= get_user((k)->c_ispeed,  &(u)->c_ispeed); \
+       err |= get_user((k)->c_ospeed,  &(u)->c_ospeed); \
        err; \
 })
 
 #define kernel_termios_to_user_termios(u, k) \
+({ \
+       int err; \
+       err  = put_user((k)->c_iflag, &(u)->c_iflag); \
+       err |= put_user((k)->c_oflag, &(u)->c_oflag); \
+       err |= put_user((k)->c_cflag, &(u)->c_cflag); \
+       err |= put_user((k)->c_lflag, &(u)->c_lflag); \
+       err |= put_user((k)->c_line, &(u)->c_line); \
+       err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
+       if(!((k)->c_lflag & ICANON)) { \
+               err |= put_user((k)->c_cc[VMIN],  &(u)->c_cc[_VMIN]); \
+               err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
+       } else { \
+               err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
+               err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
+       } \
+       err |= put_user((k)->c_ispeed, &(u)->c_ispeed); \
+       err |= put_user((k)->c_ospeed, &(u)->c_ospeed); \
+       err; \
+})
+
+#define user_termios_to_kernel_termios_1(k, u) \
+({ \
+       int err; \
+       err  = get_user((k)->c_iflag, &(u)->c_iflag); \
+       err |= get_user((k)->c_oflag, &(u)->c_oflag); \
+       err |= get_user((k)->c_cflag, &(u)->c_cflag); \
+       err |= get_user((k)->c_lflag, &(u)->c_lflag); \
+       err |= get_user((k)->c_line,  &(u)->c_line); \
+       err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
+       if((k)->c_lflag & ICANON) { \
+               err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
+               err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
+       } else { \
+               err |= get_user((k)->c_cc[VMIN],  &(u)->c_cc[_VMIN]); \
+               err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
+       } \
+       err; \
+})
+
+#define kernel_termios_to_user_termios_1(u, k) \
 ({ \
        int err; \
        err  = put_user((k)->c_iflag, &(u)->c_iflag); \
index 1fa99baf4e25bbaf2f82daaf1960537bb59bfde8..8eafdb1c08ba96b3939b30fdd2b38b250c3584ff 100644 (file)
@@ -145,6 +145,7 @@ static inline int __test_bit (int nr, const void *addr)
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #include <asm-generic/bitops/ext2-non-atomic.h>
 #define ext2_set_bit_atomic(l,n,a)      test_and_set_bit(n,a)
index a20fe9822f6002db96607331fd7ae50f0a95ee58..c96641f7502298fca9aa60c5f511c9e8df50dfb3 100644 (file)
@@ -402,6 +402,7 @@ static inline int fls(int x)
 }
 
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #endif /* __KERNEL__ */
 
index 1d7d9b4bcacb0846f44f72282008552f4582dba5..525edf2ce5c263454158fb8a724f9b75083f63f5 100644 (file)
@@ -408,6 +408,7 @@ static __inline__ int fls(int x)
 #define ARCH_HAS_FAST_MULTIPLIER 1
 
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 
 #endif /* __KERNEL__ */
 
index b897e8cb55fbb7a73a43d4f1ac7a16a20f3d56d2..9440a7a1b99ab55fdb38e70333cdcdf9bc83e1d0 100644 (file)
@@ -53,3 +53,5 @@ extern unsigned long saved_rdi;
 
 /* routines for saving/restoring kernel state */
 extern int acpi_save_state_mem(void);
+extern char core_restore_code;
+extern char restore_registers;
index 1c1e0d933eea8311db44907231d94a62b025c334..78db04cf6e4859bf24d57ea6ed854760a7aa1201 100644 (file)
@@ -108,6 +108,7 @@ static inline int fls (unsigned int x)
 #endif
 
 #include <asm-generic/bitops/hweight.h>
+#include <asm-generic/bitops/lock.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/minix.h>
 
index d10e608f232d04e053aa3c2bd8b68a810df6aad8..7ef8de6620010b4a3b22981d8e88e2009235b915 100644 (file)
@@ -232,18 +232,6 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
                __put_ioctx(kioctx);                                    \
 } while (0)
 
-#define in_aio() (unlikely(!is_sync_wait(current->io_wait)))
-
-/* may be used for debugging */
-#define warn_if_async()                                                        \
-do {                                                                   \
-       if (in_aio()) {                                                 \
-               printk(KERN_ERR "%s(%s:%d) called in async context!\n", \
-                       __FUNCTION__, __FILE__, __LINE__);              \
-               dump_stack();                                           \
-       }                                                               \
-} while (0)
-
 #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
 
 #include <linux/aio_abi.h>
index 6b20af0bbb79d2037cfb3c5aa69d6b3cac2f2e59..7113a32a86ea9fd8816a32625197c8fa3700d2f2 100644 (file)
@@ -18,7 +18,7 @@ static inline void bit_spin_lock(int bitnum, unsigned long *addr)
         */
        preempt_disable();
 #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
-       while (test_and_set_bit(bitnum, addr)) {
+       while (unlikely(test_and_set_bit_lock(bitnum, addr))) {
                while (test_bit(bitnum, addr)) {
                        preempt_enable();
                        cpu_relax();
@@ -36,7 +36,7 @@ static inline int bit_spin_trylock(int bitnum, unsigned long *addr)
 {
        preempt_disable();
 #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
-       if (test_and_set_bit(bitnum, addr)) {
+       if (unlikely(test_and_set_bit_lock(bitnum, addr))) {
                preempt_enable();
                return 0;
        }
@@ -50,10 +50,28 @@ static inline int bit_spin_trylock(int bitnum, unsigned long *addr)
  */
 static inline void bit_spin_unlock(int bitnum, unsigned long *addr)
 {
+#ifdef CONFIG_DEBUG_SPINLOCK
+       BUG_ON(!test_bit(bitnum, addr));
+#endif
 #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+       clear_bit_unlock(bitnum, addr);
+#endif
+       preempt_enable();
+       __release(bitlock);
+}
+
+/*
+ *  bit-based spin_unlock()
+ *  non-atomic version, which can be used eg. if the bit lock itself is
+ *  protecting the rest of the flags in the word.
+ */
+static inline void __bit_spin_unlock(int bitnum, unsigned long *addr)
+{
+#ifdef CONFIG_DEBUG_SPINLOCK
        BUG_ON(!test_bit(bitnum, addr));
-       smp_mb__before_clear_bit();
-       clear_bit(bitnum, addr);
+#endif
+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+       __clear_bit_unlock(bitnum, addr);
 #endif
        preempt_enable();
        __release(bitlock);
index 8961e7fb755c34bc4f1ea346fbb83854286bc932..7a8d7ade28a035b106cf025c4faa74c18ee8b229 100644 (file)
@@ -310,10 +310,6 @@ typedef __u32 kernel_cap_t;
 #define CAP_SETFCAP         31
 
 #ifdef __KERNEL__
-/*
- * Bounding set
- */
-extern kernel_cap_t cap_bset;
 
 /*
  * Internal kernel functions only
index 16ea3374dddf7a543501fca71718c5d72b885e07..107787aacb647c95c37f53bf94d2660486d687a3 100644 (file)
@@ -221,10 +221,15 @@ extern void clocksource_resume(void);
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
 extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
+extern void update_vsyscall_tz(void);
 #else
 static inline void update_vsyscall(struct timespec *ts, struct clocksource *c)
 {
 }
+
+static inline void update_vsyscall_tz(void)
+{
+}
 #endif
 
 #endif /* _LINUX_CLOCKSOURCE_H */
index acd583384bd9dffb50a097eae3370caf5704d78c..fe23792f05c1077149718fd783458e8d4d12c5db 100644 (file)
 #define __weak                         __attribute__((weak))
 #define __naked                                __attribute__((naked))
 #define __noreturn                     __attribute__((noreturn))
+
+/*
+ * From the GCC manual:
+ *
+ * Many functions have no effects except the return value and their
+ * return value depends only on the parameters and/or global
+ * variables.  Such a function can be subject to common subexpression
+ * elimination and loop optimization just as an arithmetic operator
+ * would be.
+ * [...]
+ */
 #define __pure                         __attribute__((pure))
 #define __aligned(x)                   __attribute__((aligned(x)))
 #define __printf(a,b)                  __attribute__((format(printf,a,b)))
 #define  noinline                      __attribute__((noinline))
-#define __attribute_pure__             __attribute__((pure))
 #define __attribute_const__            __attribute__((__const__))
 #define __maybe_unused                 __attribute__((unused))
index 86f9a3a6137debd41bdb03b8988580cbeb6d1ca7..c811c8b979ac29643669b7e3788b089df9fc5331 100644 (file)
@@ -132,20 +132,6 @@ extern void __chk_io_ptr(const volatile void __iomem *);
 # define __maybe_unused                /* unimplemented */
 #endif
 
-/*
- * From the GCC manual:
- *
- * Many functions have no effects except the return value and their
- * return value depends only on the parameters and/or global
- * variables.  Such a function can be subject to common subexpression
- * elimination and loop optimization just as an arithmetic operator
- * would be.
- * [...]
- */
-#ifndef __attribute_pure__
-# define __attribute_pure__    /* unimplemented */
-#endif
-
 #ifndef noinline
 #define noinline
 #endif
index 0a4542ddb73dab19ceb9477e22241dc3bc0fe33e..a5f88a6a259d84a92e93a905a7937b03b7501dbf 100644 (file)
@@ -122,14 +122,11 @@ extern void console_stop(struct console *);
 extern void console_start(struct console *);
 extern int is_console_locked(void);
 
-#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
+extern int console_suspend_enabled;
+
 /* Suspend and resume console messages over PM events */
 extern void suspend_console(void);
 extern void resume_console(void);
-#else
-static inline void suspend_console(void) {}
-static inline void resume_console(void) {}
-#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
 
 int mda_console_init(void);
 void prom_con_init(void);
index 0ad72c4cf312a8bb9dc18bb6f39ad54b36fac941..b79c5756936728ca8a576c3ea13142f71f333f4c 100644 (file)
@@ -119,8 +119,9 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
 #define lock_cpu_hotplug()     do { } while (0)
 #define unlock_cpu_hotplug()   do { } while (0)
 #define hotcpu_notifier(fn, pri)       do { (void)(fn); } while (0)
-#define register_hotcpu_notifier(nb)   do { (void)(nb); } while (0)
-#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0)
+/* These aren't inline functions due to a GCC bug. */
+#define register_hotcpu_notifier(nb)   ({ (void)(nb); 0; })
+#define unregister_hotcpu_notifier(nb) ({ (void)(nb); })
 
 /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
 static inline int cpu_is_offline(int cpu) { return 0; }
index 72aa00cc4b2db49e4d036955d6a72d16f6a1b224..8f3dcd30828fbb149ef7ee30c788ebf2e312e6e6 100644 (file)
@@ -512,11 +512,11 @@ struct cyclades_card {
     void __iomem *base_addr;
     void __iomem *ctl_addr;
     int irq;
-    int num_chips;     /* 0 if card absent, -1 if Z/PCI, else Y */
-    int first_line;    /* minor number of first channel on card */
-    int nports;                /* Number of ports in the card */
-    int bus_index;     /* address shift - 0 for ISA, 1 for PCI */
-    int        intr_enabled;   /* FW Interrupt flag - 0 disabled, 1 enabled */
+    unsigned int num_chips;    /* 0 if card absent, -1 if Z/PCI, else Y */
+    unsigned int first_line;   /* minor number of first channel on card */
+    unsigned int nports;       /* Number of ports in the card */
+    int bus_index;             /* address shift - 0 for ISA, 1 for PCI */
+    int intr_enabled;          /* FW Interrupt flag - 0 disabled, 1 enabled */
     spinlock_t card_lock;
     struct cyclades_port *ports;
 };
@@ -566,10 +566,9 @@ struct cyclades_port {
        int                     rtsdtr_inv;
        int                     chip_rev;
        int                     custom_divisor;
-       int                     x_char; /* to be pushed out ASAP */
+       u8                      x_char; /* to be pushed out ASAP */
        int                     close_delay;
        unsigned short          closing_wait;
-       unsigned long           event;
        int                     count;  /* # of fd on device */
        int                     breakon;
        int                     breakoff;
@@ -584,7 +583,6 @@ struct cyclades_port {
        struct cyclades_monitor mon;
        struct cyclades_idle_stats      idle_stats;
        struct cyclades_icount  icount;
-       struct work_struct      tqueue;
        wait_queue_head_t       open_wait;
        wait_queue_head_t       close_wait;
        struct completion       shutdown_wait;
@@ -592,19 +590,6 @@ struct cyclades_port {
        int throttle;
 };
 
-/*
- * Events are used to schedule things to happen at timer-interrupt
- * time, instead of at cy interrupt time.
- */
-#define Cy_EVENT_READ_PROCESS          0
-#define Cy_EVENT_WRITE_WAKEUP          1
-#define Cy_EVENT_HANGUP                        2
-#define Cy_EVENT_BREAK                 3
-#define Cy_EVENT_OPEN_WAKEUP           4
-#define Cy_EVENT_SHUTDOWN_WAKEUP       5
-#define        Cy_EVENT_DELTA_WAKEUP           6
-#define        Cy_EVENT_Z_RX_FULL              7
-
 #define        CLOSING_WAIT_DELAY      30*HZ
 #define CY_CLOSING_WAIT_NONE   65535
 #define CY_CLOSING_WAIT_INF    0
index 0ebfafbd338ca56fc89f781c2848a9c16b81cb6d..101a2d4636befbd1248b7642c38a87ff77243f07 100644 (file)
@@ -13,16 +13,26 @@ enum dma_data_direction {
        DMA_NONE = 3,
 };
 
-#define DMA_64BIT_MASK 0xffffffffffffffffULL
-#define DMA_48BIT_MASK 0x0000ffffffffffffULL
-#define DMA_40BIT_MASK 0x000000ffffffffffULL
-#define DMA_39BIT_MASK 0x0000007fffffffffULL
-#define DMA_32BIT_MASK 0x00000000ffffffffULL
-#define DMA_31BIT_MASK 0x000000007fffffffULL
-#define DMA_30BIT_MASK 0x000000003fffffffULL
-#define DMA_29BIT_MASK 0x000000001fffffffULL
-#define DMA_28BIT_MASK 0x000000000fffffffULL
-#define DMA_24BIT_MASK 0x0000000000ffffffULL
+#define DMA_BIT_MASK(n)        (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
+
+/*
+ * NOTE: do not use the below macros in new code and do not add new definitions
+ * here.
+ *
+ * Instead, just open-code DMA_BIT_MASK(n) within your driver
+ */
+#define DMA_64BIT_MASK DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK DMA_BIT_MASK(48)
+#define DMA_47BIT_MASK DMA_BIT_MASK(47)
+#define DMA_40BIT_MASK DMA_BIT_MASK(40)
+#define DMA_39BIT_MASK DMA_BIT_MASK(39)
+#define DMA_35BIT_MASK DMA_BIT_MASK(35)
+#define DMA_32BIT_MASK DMA_BIT_MASK(32)
+#define DMA_31BIT_MASK DMA_BIT_MASK(31)
+#define DMA_30BIT_MASK DMA_BIT_MASK(30)
+#define DMA_29BIT_MASK DMA_BIT_MASK(29)
+#define DMA_28BIT_MASK DMA_BIT_MASK(28)
+#define DMA_24BIT_MASK DMA_BIT_MASK(24)
 
 #define DMA_MASK_NONE  0x0ULL
 
index 589b0b355d84d1967eac403c390f23e428eb33c2..64134456ed8cf33782e3d4a83757f4c46515f644 100644 (file)
@@ -72,8 +72,8 @@
  * Macro-instructions used to manage several block sizes
  */
 #define EXT3_MIN_BLOCK_SIZE            1024
-#define        EXT3_MAX_BLOCK_SIZE             4096
-#define EXT3_MIN_BLOCK_LOG_SIZE                  10
+#define        EXT3_MAX_BLOCK_SIZE             65536
+#define EXT3_MIN_BLOCK_LOG_SIZE                10
 #ifdef __KERNEL__
 # define EXT3_BLOCK_SIZE(s)            ((s)->s_blocksize)
 #else
index cdee7aaa57aa60952281c54320f7a9bf0fa936fb..97dd409d5f4a1194fa6034242793d03290968f59 100644 (file)
 /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
 #define EXT4_MAX_RESERVE_BLOCKS                1027
 #define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0
-/*
- * Always enable hashed directories
- */
-#define CONFIG_EXT4_INDEX
 
 /*
  * Debug code
 #endif
 #define EXT4_BLOCK_ALIGN(size, blkbits)                ALIGN((size), (1 << (blkbits)))
 
-/*
- * Macro-instructions used to manage fragments
- */
-#define EXT4_MIN_FRAG_SIZE             1024
-#define        EXT4_MAX_FRAG_SIZE              4096
-#define EXT4_MIN_FRAG_LOG_SIZE           10
-#ifdef __KERNEL__
-# define EXT4_FRAG_SIZE(s)             (EXT4_SB(s)->s_frag_size)
-# define EXT4_FRAGS_PER_BLOCK(s)       (EXT4_SB(s)->s_frags_per_block)
-#else
-# define EXT4_FRAG_SIZE(s)             (EXT4_MIN_FRAG_SIZE << (s)->s_log_frag_size)
-# define EXT4_FRAGS_PER_BLOCK(s)       (EXT4_BLOCK_SIZE(s) / EXT4_FRAG_SIZE(s))
-#endif
-
 /*
  * Structure of a blocks group descriptor
  */
 struct ext4_group_desc
 {
-       __le32  bg_block_bitmap;                /* Blocks bitmap block */
-       __le32  bg_inode_bitmap;                /* Inodes bitmap block */
-       __le32  bg_inode_table;         /* Inodes table block */
+       __le32  bg_block_bitmap_lo;     /* Blocks bitmap block */
+       __le32  bg_inode_bitmap_lo;     /* Inodes bitmap block */
+       __le32  bg_inode_table_lo;      /* Inodes table block */
        __le16  bg_free_blocks_count;   /* Free blocks count */
        __le16  bg_free_inodes_count;   /* Free inodes count */
        __le16  bg_used_dirs_count;     /* Directories count */
-       __u16   bg_flags;
-       __u32   bg_reserved[3];
+       __le16  bg_flags;               /* EXT4_BG_flags (INODE_UNINIT, etc) */
+       __u32   bg_reserved[2];         /* Likely block/inode bitmap checksum */
+       __le16  bg_itable_unused;       /* Unused inodes count */
+       __le16  bg_checksum;            /* crc16(sb_uuid+group+desc) */
        __le32  bg_block_bitmap_hi;     /* Blocks bitmap block MSB */
        __le32  bg_inode_bitmap_hi;     /* Inodes bitmap block MSB */
        __le32  bg_inode_table_hi;      /* Inodes table block MSB */
 };
 
+#define EXT4_BG_INODE_UNINIT   0x0001 /* Inode table/bitmap not in use */
+#define EXT4_BG_BLOCK_UNINIT   0x0002 /* Block bitmap not in use */
+#define EXT4_BG_INODE_ZEROED   0x0004 /* On-disk itable initialized to zero */
+
 #ifdef __KERNEL__
 #include <linux/ext4_fs_i.h>
 #include <linux/ext4_fs_sb.h>
@@ -311,27 +299,24 @@ struct ext4_inode {
        __le32  i_generation;   /* File version (for NFS) */
        __le32  i_file_acl;     /* File ACL */
        __le32  i_dir_acl;      /* Directory ACL */
-       __le32  i_faddr;        /* Fragment address */
+       __le32  i_obso_faddr;   /* Obsoleted fragment address */
        union {
                struct {
-                       __u8    l_i_frag;       /* Fragment number */
-                       __u8    l_i_fsize;      /* Fragment size */
+                       __le16  l_i_reserved1;  /* Obsoleted fragment number/size which are removed in ext4 */
                        __le16  l_i_file_acl_high;
                        __le16  l_i_uid_high;   /* these 2 fields */
                        __le16  l_i_gid_high;   /* were reserved2[0] */
                        __u32   l_i_reserved2;
                } linux2;
                struct {
-                       __u8    h_i_frag;       /* Fragment number */
-                       __u8    h_i_fsize;      /* Fragment size */
+                       __le16  h_i_reserved1;  /* Obsoleted fragment number/size which are removed in ext4 */
                        __u16   h_i_mode_high;
                        __u16   h_i_uid_high;
                        __u16   h_i_gid_high;
                        __u32   h_i_author;
                } hurd2;
                struct {
-                       __u8    m_i_frag;       /* Fragment number */
-                       __u8    m_i_fsize;      /* Fragment size */
+                       __le16  h_i_reserved1;  /* Obsoleted fragment number/size which are removed in ext4 */
                        __le16  m_i_file_acl_high;
                        __u32   m_i_reserved2[2];
                } masix2;
@@ -419,8 +404,6 @@ do {                                                                               \
 
 #if defined(__KERNEL__) || defined(__linux__)
 #define i_reserved1    osd1.linux1.l_i_reserved1
-#define i_frag         osd2.linux2.l_i_frag
-#define i_fsize                osd2.linux2.l_i_fsize
 #define i_file_acl_high        osd2.linux2.l_i_file_acl_high
 #define i_uid_low      i_uid
 #define i_gid_low      i_gid
@@ -431,8 +414,6 @@ do {                                                                               \
 #elif defined(__GNU__)
 
 #define i_translator   osd1.hurd1.h_i_translator
-#define i_frag         osd2.hurd2.h_i_frag;
-#define i_fsize                osd2.hurd2.h_i_fsize;
 #define i_uid_high     osd2.hurd2.h_i_uid_high
 #define i_gid_high     osd2.hurd2.h_i_gid_high
 #define i_author       osd2.hurd2.h_i_author
@@ -440,8 +421,6 @@ do {                                                                               \
 #elif defined(__masix__)
 
 #define i_reserved1    osd1.masix1.m_i_reserved1
-#define i_frag         osd2.masix2.m_i_frag
-#define i_fsize                osd2.masix2.m_i_fsize
 #define i_file_acl_high        osd2.masix2.m_i_file_acl_high
 #define i_reserved2    osd2.masix2.m_i_reserved2
 
@@ -522,15 +501,15 @@ do {                                                                             \
  */
 struct ext4_super_block {
 /*00*/ __le32  s_inodes_count;         /* Inodes count */
-       __le32  s_blocks_count;         /* Blocks count */
-       __le32  s_r_blocks_count;       /* Reserved blocks count */
-       __le32  s_free_blocks_count;    /* Free blocks count */
+       __le32  s_blocks_count_lo;      /* Blocks count */
+       __le32  s_r_blocks_count_lo;    /* Reserved blocks count */
+       __le32  s_free_blocks_count_lo; /* Free blocks count */
 /*10*/ __le32  s_free_inodes_count;    /* Free inodes count */
        __le32  s_first_data_block;     /* First Data Block */
        __le32  s_log_block_size;       /* Block size */
-       __le32  s_log_frag_size;        /* Fragment size */
+       __le32  s_obso_log_frag_size;   /* Obsoleted fragment size */
 /*20*/ __le32  s_blocks_per_group;     /* # Blocks per group */
-       __le32  s_frags_per_group;      /* # Fragments per group */
+       __le32  s_obso_frags_per_group; /* Obsoleted fragments per group */
        __le32  s_inodes_per_group;     /* # Inodes per group */
        __le32  s_mtime;                /* Mount time */
 /*30*/ __le32  s_wtime;                /* Write time */
@@ -595,13 +574,13 @@ struct ext4_super_block {
 /*150*/        __le32  s_blocks_count_hi;      /* Blocks count */
        __le32  s_r_blocks_count_hi;    /* Reserved blocks count */
        __le32  s_free_blocks_count_hi; /* Free blocks count */
-       __u16   s_min_extra_isize;      /* All inodes have at least # bytes */
-       __u16   s_want_extra_isize;     /* New inodes should reserve # bytes */
-       __u32   s_flags;                /* Miscellaneous flags */
-       __u16   s_raid_stride;          /* RAID stride */
-       __u16   s_mmp_interval;         /* # seconds to wait in MMP checking */
-       __u64   s_mmp_block;            /* Block for multi-mount protection */
-       __u32   s_raid_stripe_width;    /* blocks on all data disks (N*stride)*/
+       __le16  s_min_extra_isize;      /* All inodes have at least # bytes */
+       __le16  s_want_extra_isize;     /* New inodes should reserve # bytes */
+       __le32  s_flags;                /* Miscellaneous flags */
+       __le16  s_raid_stride;          /* RAID stride */
+       __le16  s_mmp_interval;         /* # seconds to wait in MMP checking */
+       __le64  s_mmp_block;            /* Block for multi-mount protection */
+       __le32  s_raid_stripe_width;    /* blocks on all data disks (N*stride)*/
        __u32   s_reserved[163];        /* Padding to the end of the block */
 };
 
@@ -692,6 +671,7 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 #define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER    0x0001
 #define EXT4_FEATURE_RO_COMPAT_LARGE_FILE      0x0002
 #define EXT4_FEATURE_RO_COMPAT_BTREE_DIR       0x0004
+#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM                0x0010
 #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK       0x0020
 #define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE     0x0040
 
@@ -702,15 +682,18 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
 #define EXT4_FEATURE_INCOMPAT_META_BG          0x0010
 #define EXT4_FEATURE_INCOMPAT_EXTENTS          0x0040 /* extents support */
 #define EXT4_FEATURE_INCOMPAT_64BIT            0x0080
+#define EXT4_FEATURE_INCOMPAT_FLEX_BG          0x0200
 
 #define EXT4_FEATURE_COMPAT_SUPP       EXT2_FEATURE_COMPAT_EXT_ATTR
 #define EXT4_FEATURE_INCOMPAT_SUPP     (EXT4_FEATURE_INCOMPAT_FILETYPE| \
                                         EXT4_FEATURE_INCOMPAT_RECOVER| \
                                         EXT4_FEATURE_INCOMPAT_META_BG| \
                                         EXT4_FEATURE_INCOMPAT_EXTENTS| \
-                                        EXT4_FEATURE_INCOMPAT_64BIT)
+                                        EXT4_FEATURE_INCOMPAT_64BIT| \
+                                        EXT4_FEATURE_INCOMPAT_FLEX_BG)
 #define EXT4_FEATURE_RO_COMPAT_SUPP    (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
                                         EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
+                                        EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
                                         EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
                                         EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
                                         EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
@@ -789,17 +772,11 @@ struct ext4_dir_entry_2 {
  * (c) Daniel Phillips, 2001
  */
 
-#ifdef CONFIG_EXT4_INDEX
-  #define is_dx(dir) (EXT4_HAS_COMPAT_FEATURE(dir->i_sb, \
-                                             EXT4_FEATURE_COMPAT_DIR_INDEX) && \
+#define is_dx(dir) (EXT4_HAS_COMPAT_FEATURE(dir->i_sb, \
+                                     EXT4_FEATURE_COMPAT_DIR_INDEX) && \
                      (EXT4_I(dir)->i_flags & EXT4_INDEX_FL))
 #define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
 #define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2 || (dir)->i_nlink == 1)
-#else
-  #define is_dx(dir) 0
-#define EXT4_DIR_LINK_MAX(dir) ((dir)->i_nlink >= EXT4_LINK_MAX)
-#define EXT4_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2)
-#endif
 
 /* Legal values for the dx_root hash_version field: */
 
@@ -1004,39 +981,39 @@ extern void ext4_inode_table_set(struct super_block *sb,
 static inline ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es)
 {
        return ((ext4_fsblk_t)le32_to_cpu(es->s_blocks_count_hi) << 32) |
-               le32_to_cpu(es->s_blocks_count);
+               le32_to_cpu(es->s_blocks_count_lo);
 }
 
 static inline ext4_fsblk_t ext4_r_blocks_count(struct ext4_super_block *es)
 {
        return ((ext4_fsblk_t)le32_to_cpu(es->s_r_blocks_count_hi) << 32) |
-               le32_to_cpu(es->s_r_blocks_count);
+               le32_to_cpu(es->s_r_blocks_count_lo);
 }
 
 static inline ext4_fsblk_t ext4_free_blocks_count(struct ext4_super_block *es)
 {
        return ((ext4_fsblk_t)le32_to_cpu(es->s_free_blocks_count_hi) << 32) |
-               le32_to_cpu(es->s_free_blocks_count);
+               le32_to_cpu(es->s_free_blocks_count_lo);
 }
 
 static inline void ext4_blocks_count_set(struct ext4_super_block *es,
                                         ext4_fsblk_t blk)
 {
-       es->s_blocks_count = cpu_to_le32((u32)blk);
+       es->s_blocks_count_lo = cpu_to_le32((u32)blk);
        es->s_blocks_count_hi = cpu_to_le32(blk >> 32);
 }
 
 static inline void ext4_free_blocks_count_set(struct ext4_super_block *es,
                                              ext4_fsblk_t blk)
 {
-       es->s_free_blocks_count = cpu_to_le32((u32)blk);
+       es->s_free_blocks_count_lo = cpu_to_le32((u32)blk);
        es->s_free_blocks_count_hi = cpu_to_le32(blk >> 32);
 }
 
 static inline void ext4_r_blocks_count_set(struct ext4_super_block *es,
                                           ext4_fsblk_t blk)
 {
-       es->s_r_blocks_count = cpu_to_le32((u32)blk);
+       es->s_r_blocks_count_lo = cpu_to_le32((u32)blk);
        es->s_r_blocks_count_hi = cpu_to_le32(blk >> 32);
 }
 
index 81406f3655d4bd162c0ed0aade00c19de8666371..d2045a26195d6ebf576b922dd050b3c1a433d60d 100644 (file)
@@ -74,7 +74,7 @@ struct ext4_extent {
        __le32  ee_block;       /* first logical block extent covers */
        __le16  ee_len;         /* number of blocks covered by extent */
        __le16  ee_start_hi;    /* high 16 bits of physical block */
-       __le32  ee_start;       /* low 32 bits of physical block */
+       __le32  ee_start_lo;    /* low 32 bits of physical block */
 };
 
 /*
@@ -83,7 +83,7 @@ struct ext4_extent {
  */
 struct ext4_extent_idx {
        __le32  ei_block;       /* index covers logical blocks from 'block' */
-       __le32  ei_leaf;        /* pointer to the physical block of the next *
+       __le32  ei_leaf_lo;     /* pointer to the physical block of the next *
                                 * level. leaf or next index could be there */
        __le16  ei_leaf_hi;     /* high 16 bits of physical block */
        __u16   ei_unused;
index 1a511e9905aa2ae7d5c38a23da98644632eb6977..86ddfe2089f30ed1d2d14e7f5d976fde318b03f9 100644 (file)
@@ -78,11 +78,6 @@ struct ext4_ext_cache {
 struct ext4_inode_info {
        __le32  i_data[15];     /* unconverted */
        __u32   i_flags;
-#ifdef EXT4_FRAGMENTS
-       __u32   i_faddr;
-       __u8    i_frag_no;
-       __u8    i_frag_size;
-#endif
        ext4_fsblk_t    i_file_acl;
        __u32   i_dir_acl;
        __u32   i_dtime;
index 0a8e47d47c91ce11b2dbc6d4f99f3de004201111..b40e827cd4954f7ecead22be34f2259c8f81b915 100644 (file)
  * third extended-fs super-block data in memory
  */
 struct ext4_sb_info {
-       unsigned long s_frag_size;      /* Size of a fragment in bytes */
        unsigned long s_desc_size;      /* Size of a group descriptor in bytes */
-       unsigned long s_frags_per_block;/* Number of fragments per block */
        unsigned long s_inodes_per_block;/* Number of inodes per block */
-       unsigned long s_frags_per_group;/* Number of fragments in a group */
        unsigned long s_blocks_per_group;/* Number of blocks in a group */
        unsigned long s_inodes_per_group;/* Number of inodes in a group */
        unsigned long s_itb_per_group;  /* Number of inode table blocks per group */
index d716e6392cf6e7e5d6215da354b20a1c96e1d495..38c71d3c8dbf39efff5278fa9c58272d70c4554b 100644 (file)
@@ -12,8 +12,8 @@
  * Ext4-specific journaling extensions.
  */
 
-#ifndef _LINUX_EXT4_JBD_H
-#define _LINUX_EXT4_JBD_H
+#ifndef _LINUX_EXT4_JBD2_H
+#define _LINUX_EXT4_JBD2_H
 
 #include <linux/fs.h>
 #include <linux/jbd2.h>
@@ -228,4 +228,4 @@ static inline int ext4_should_writeback_data(struct inode *inode)
        return 0;
 }
 
-#endif /* _LINUX_EXT4_JBD_H */
+#endif /* _LINUX_EXT4_JBD2_H */
index 91b2e3b9251eb67ee57b19dd44ba0f84bb8fcb94..ddfa0372a3b723d978823bea9a3d4e267abf0506 100644 (file)
@@ -146,6 +146,7 @@ struct sock;
 
 extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
 extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
+extern int sk_detach_filter(struct sock *sk);
 extern int sk_chk_filter(struct sock_filter *filter, int flen);
 #endif /* __KERNEL__ */
 
index efded00ad08c5003bebd89964bb8b8619630a2c2..08934995c7ab5463e5f4064f4e2fff5ccfb4af94 100644 (file)
@@ -4,6 +4,7 @@
 #define FREEZER_H_INCLUDED
 
 #include <linux/sched.h>
+#include <linux/wait.h>
 
 #ifdef CONFIG_PM_SLEEP
 /*
@@ -126,6 +127,36 @@ static inline void set_freezable(void)
        current->flags &= ~PF_NOFREEZE;
 }
 
+/*
+ * Freezer-friendly wrappers around wait_event_interruptible() and
+ * wait_event_interruptible_timeout(), originally defined in <linux/wait.h>
+ */
+
+#define wait_event_freezable(wq, condition)                            \
+({                                                                     \
+       int __retval;                                                   \
+       do {                                                            \
+               __retval = wait_event_interruptible(wq,                 \
+                               (condition) || freezing(current));      \
+               if (__retval && !freezing(current))                     \
+                       break;                                          \
+               else if (!(condition))                                  \
+                       __retval = -ERESTARTSYS;                        \
+       } while (try_to_freeze());                                      \
+       __retval;                                                       \
+})
+
+
+#define wait_event_freezable_timeout(wq, condition, timeout)           \
+({                                                                     \
+       long __retval = timeout;                                        \
+       do {                                                            \
+               __retval = wait_event_interruptible_timeout(wq,         \
+                               (condition) || freezing(current),       \
+                               __retval);                              \
+       } while (try_to_freeze());                                      \
+       __retval;                                                       \
+})
 #else /* !CONFIG_PM_SLEEP */
 static inline int frozen(struct task_struct *p) { return 0; }
 static inline int freezing(struct task_struct *p) { return 0; }
@@ -143,6 +174,13 @@ static inline void freezer_do_not_count(void) {}
 static inline void freezer_count(void) {}
 static inline int freezer_should_skip(struct task_struct *p) { return 0; }
 static inline void set_freezable(void) {}
+
+#define wait_event_freezable(wq, condition)                            \
+               wait_event_interruptible(wq, condition)
+
+#define wait_event_freezable_timeout(wq, condition, timeout)           \
+               wait_event_interruptible_timeout(wq, condition, timeout)
+
 #endif /* !CONFIG_PM_SLEEP */
 
 #endif /* FREEZER_H_INCLUDED */
index e3fc5dbb22460ad7d265f5fb47d8839ea4fe32f5..6a4d170ad9a52d2f0a48c9765fdd73c836ae3f17 100644 (file)
@@ -330,6 +330,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
 #define ATTR_KILL_SGID 4096
 #define ATTR_FILE      8192
 #define ATTR_KILL_PRIV 16384
+#define ATTR_OPEN      32768   /* Truncating from open(O_TRUNC) */
 
 /*
  * This is the Inode Attributes structure, used for notify_change().  It
index 9fbe9d258e2259b196fc752213dd84ea03a2f5d4..d0c437028c80a18b1cace46c89bf59b92a39f59e 100644 (file)
@@ -6,7 +6,17 @@
     See the file COPYING.
 */
 
-/* This file defines the kernel interface of FUSE */
+/*
+ * This file defines the kernel interface of FUSE
+ *
+ * Protocol changelog:
+ *
+ * 7.9:
+ *  - new fuse_getattr_in input argument of GETATTR
+ *  - add lk_flags in fuse_lk_in
+ *  - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
+ *  - add blksize field to fuse_attr
+ */
 
 #include <asm/types.h>
 #include <linux/major.h>
@@ -15,7 +25,7 @@
 #define FUSE_KERNEL_VERSION 7
 
 /** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 8
+#define FUSE_KERNEL_MINOR_VERSION 9
 
 /** The node ID of the root inode */
 #define FUSE_ROOT_ID 1
@@ -44,6 +54,8 @@ struct fuse_attr {
        __u32   uid;
        __u32   gid;
        __u32   rdev;
+       __u32   blksize;
+       __u32   padding;
 };
 
 struct fuse_kstatfs {
@@ -76,6 +88,9 @@ struct fuse_file_lock {
 #define FATTR_ATIME    (1 << 4)
 #define FATTR_MTIME    (1 << 5)
 #define FATTR_FH       (1 << 6)
+#define FATTR_ATIME_NOW        (1 << 7)
+#define FATTR_MTIME_NOW        (1 << 8)
+#define FATTR_LOCKOWNER        (1 << 9)
 
 /**
  * Flags returned by the OPEN request
@@ -91,12 +106,38 @@ struct fuse_file_lock {
  */
 #define FUSE_ASYNC_READ                (1 << 0)
 #define FUSE_POSIX_LOCKS       (1 << 1)
+#define FUSE_FILE_OPS          (1 << 2)
+#define FUSE_ATOMIC_O_TRUNC    (1 << 3)
 
 /**
  * Release flags
  */
 #define FUSE_RELEASE_FLUSH     (1 << 0)
 
+/**
+ * Getattr flags
+ */
+#define FUSE_GETATTR_FH                (1 << 0)
+
+/**
+ * Lock flags
+ */
+#define FUSE_LK_FLOCK          (1 << 0)
+
+/**
+ * WRITE flags
+ *
+ * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
+ * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
+ */
+#define FUSE_WRITE_CACHE       (1 << 0)
+#define FUSE_WRITE_LOCKOWNER   (1 << 1)
+
+/**
+ * Read flags
+ */
+#define FUSE_READ_LOCKOWNER    (1 << 1)
+
 enum fuse_opcode {
        FUSE_LOOKUP        = 1,
        FUSE_FORGET        = 2,  /* no reply */
@@ -139,6 +180,8 @@ enum fuse_opcode {
 /* The read buffer is required to be at least 8k, but may be much larger */
 #define FUSE_MIN_READ_BUFFER 8192
 
+#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
+
 struct fuse_entry_out {
        __u64   nodeid;         /* Inode ID */
        __u64   generation;     /* Inode generation: nodeid:gen must
@@ -154,6 +197,14 @@ struct fuse_forget_in {
        __u64   nlookup;
 };
 
+struct fuse_getattr_in {
+       __u32   getattr_flags;
+       __u32   dummy;
+       __u64   fh;
+};
+
+#define FUSE_COMPAT_ATTR_OUT_SIZE 96
+
 struct fuse_attr_out {
        __u64   attr_valid;     /* Cache timeout for the attributes */
        __u32   attr_valid_nsec;
@@ -184,7 +235,7 @@ struct fuse_setattr_in {
        __u32   padding;
        __u64   fh;
        __u64   size;
-       __u64   unused1;
+       __u64   lock_owner;
        __u64   atime;
        __u64   mtime;
        __u64   unused2;
@@ -227,14 +278,18 @@ struct fuse_read_in {
        __u64   fh;
        __u64   offset;
        __u32   size;
-       __u32   padding;
+       __u32   read_flags;
+       __u64   lock_owner;
 };
 
+#define FUSE_COMPAT_WRITE_IN_SIZE 24
+
 struct fuse_write_in {
        __u64   fh;
        __u64   offset;
        __u32   size;
        __u32   write_flags;
+       __u64   lock_owner;
 };
 
 struct fuse_write_out {
@@ -273,6 +328,8 @@ struct fuse_lk_in {
        __u64   fh;
        __u64   owner;
        struct fuse_file_lock lk;
+       __u32   lk_flags;
+       __u32   padding;
 };
 
 struct fuse_lk_out {
index 540799bc85f864ad7569b50804ac7843ccdbe750..7a9398e1970432a500f5a660bf458c26f0158554 100644 (file)
@@ -300,7 +300,7 @@ hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
 
 /* Precise sleep: */
 extern long hrtimer_nanosleep(struct timespec *rqtp,
-                             struct timespec __user *rmtp,
+                             struct timespec *rmtp,
                              const enum hrtimer_mode mode,
                              const clockid_t clockid);
 extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
index 7a9db390c56a491e3221ed8154ac76ed89295c8f..c5bd28b69aec469087da75e93e28e7c789a4ca3f 100644 (file)
@@ -364,6 +364,16 @@ int ipmi_request_supply_msgs(ipmi_user_t          user,
                             struct ipmi_recv_msg *supplied_recv,
                             int                  priority);
 
+/*
+ * Poll the IPMI interface for the user.  This causes the IPMI code to
+ * do an immediate check for information from the driver and handle
+ * anything that is immediately pending.  This will not block in any
+ * way.  This is useful if you need to implement polling from the user
+ * for things like modifying the watchdog timeout when a panic occurs
+ * or disabling the watchdog timer on a reboot.
+ */
+void ipmi_poll_interface(ipmi_user_t user);
+
 /*
  * When commands come in to the SMS, the user can register to receive
  * them.  Only one user can be listening on a specific netfn/cmd/chan tuple
index c0633108d05dc3c4f5addcee52b5d44a66d86af4..efa292a52e7e56ad8c315c3824c87fa98dc50cfa 100644 (file)
@@ -148,26 +148,46 @@ struct ipmi_device_id {
 
 /* Take a pointer to a raw data buffer and a length and extract device
    id information from it.  The first byte of data must point to the
-   byte from the get device id response after the completion code.
-   The caller is responsible for making sure the length is at least
-   11 and the command completed without error. */
-static inline void ipmi_demangle_device_id(unsigned char *data,
-                                          unsigned int  data_len,
-                                          struct ipmi_device_id *id)
+   netfn << 2, the data should be of the format:
+      netfn << 2, cmd, completion code, data
+   as normally comes from a device interface. */
+static inline int ipmi_demangle_device_id(const unsigned char *data,
+                                         unsigned int data_len,
+                                         struct ipmi_device_id *id)
 {
+       if (data_len < 9)
+               return -EINVAL;
+       if (data[0] != IPMI_NETFN_APP_RESPONSE << 2 ||
+           data[1] != IPMI_GET_DEVICE_ID_CMD)
+               /* Strange, didn't get the response we expected. */
+               return -EINVAL;
+       if (data[2] != 0)
+               /* That's odd, it shouldn't be able to fail. */
+               return -EINVAL;
+
+       data += 3;
+       data_len -= 3;
        id->device_id = data[0];
        id->device_revision = data[1];
        id->firmware_revision_1 = data[2];
        id->firmware_revision_2 = data[3];
        id->ipmi_version = data[4];
        id->additional_device_support = data[5];
-       id->manufacturer_id = data[6] | (data[7] << 8) | (data[8] << 16);
-       id->product_id = data[9] | (data[10] << 8);
+       if (data_len >= 6) {
+               id->manufacturer_id = (data[6] | (data[7] << 8) |
+                                      (data[8] << 16));
+               id->product_id = data[9] | (data[10] << 8);
+       } else {
+               id->manufacturer_id = 0;
+               id->product_id = 0;
+       }
        if (data_len >= 15) {
                memcpy(id->aux_firmware_revision, data+11, 4);
                id->aux_firmware_revision_set = 1;
        } else
                id->aux_firmware_revision_set = 0;
+
+       return 0;
 }
 
 /* Add a low-level interface to the IPMI driver.  Note that if the
index 72f522372924b302501e3c99b5c7d35bb3d7d5f5..a3abf51e488fca138eef37028c06fae4a800680c 100644 (file)
@@ -72,14 +72,15 @@ extern int journal_enable_debug;
 #define jbd_debug(f, a...)     /**/
 #endif
 
-extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry);
-extern void * jbd_slab_alloc(size_t size, gfp_t flags);
-extern void jbd_slab_free(void *ptr, size_t size);
-
-#define jbd_kmalloc(size, flags) \
-       __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
-#define jbd_rep_kmalloc(size, flags) \
-       __jbd_kmalloc(__FUNCTION__, (size), (flags), 1)
+static inline void *jbd_alloc(size_t size, gfp_t flags)
+{
+       return (void *)__get_free_pages(flags, get_order(size));
+}
+
+static inline void jbd_free(void *ptr, size_t size)
+{
+       free_pages((unsigned long)ptr, get_order(size));
+};
 
 #define JFS_MIN_JOURNAL_BLOCKS 1024
 
index 260d6d76c5f3b898cfafad1cbc67ca7e8015bba1..06ef114570518e338ead34f6fce5c00b0420fc7b 100644 (file)
@@ -13,8 +13,8 @@
  * filesystem journaling support.
  */
 
-#ifndef _LINUX_JBD_H
-#define _LINUX_JBD_H
+#ifndef _LINUX_JBD2_H
+#define _LINUX_JBD2_H
 
 /* Allow this file to be included directly into e2fsprogs */
 #ifndef __KERNEL__
 #define journal_oom_retry 1
 
 /*
- * Define JBD_PARANIOD_IOFAIL to cause a kernel BUG() if ext3 finds
+ * Define JBD2_PARANIOD_IOFAIL to cause a kernel BUG() if ext4 finds
  * certain classes of error which can occur due to failed IOs.  Under
- * normal use we want ext3 to continue after such errors, because
+ * normal use we want ext4 to continue after such errors, because
  * hardware _can_ fail, but for debugging purposes when running tests on
  * known-good hardware we may want to trap these errors.
  */
-#undef JBD_PARANOID_IOFAIL
+#undef JBD2_PARANOID_IOFAIL
 
 /*
  * The default maximum commit age, in seconds.
  */
-#define JBD_DEFAULT_MAX_COMMIT_AGE 5
+#define JBD2_DEFAULT_MAX_COMMIT_AGE 5
 
 #ifdef CONFIG_JBD2_DEBUG
 /*
- * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
+ * Define JBD2_EXPENSIVE_CHECKING to enable more expensive internal
  * consistency checks.  By default we don't do this unless
  * CONFIG_JBD2_DEBUG is on.
  */
-#define JBD_EXPENSIVE_CHECKING
+#define JBD2_EXPENSIVE_CHECKING
 extern u8 jbd2_journal_enable_debug;
 
 #define jbd_debug(n, f, a...)                                          \
@@ -71,14 +71,15 @@ extern u8 jbd2_journal_enable_debug;
 #define jbd_debug(f, a...)     /**/
 #endif
 
-extern void * __jbd2_kmalloc (const char *where, size_t size, gfp_t flags, int retry);
-extern void * jbd2_slab_alloc(size_t size, gfp_t flags);
-extern void jbd2_slab_free(void *ptr, size_t size);
+static inline void *jbd2_alloc(size_t size, gfp_t flags)
+{
+       return (void *)__get_free_pages(flags, get_order(size));
+}
 
-#define jbd_kmalloc(size, flags) \
-       __jbd2_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
-#define jbd_rep_kmalloc(size, flags) \
-       __jbd2_kmalloc(__FUNCTION__, (size), (flags), 1)
+static inline void jbd2_free(void *ptr, size_t size)
+{
+       free_pages((unsigned long)ptr, get_order(size));
+};
 
 #define JBD2_MIN_JOURNAL_BLOCKS 1024
 
@@ -162,8 +163,8 @@ typedef struct journal_block_tag_s
        __be32          t_blocknr_high; /* most-significant high 32bits. */
 } journal_block_tag_t;
 
-#define JBD_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
-#define JBD_TAG_SIZE64 (sizeof(journal_block_tag_t))
+#define JBD2_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
+#define JBD2_TAG_SIZE64 (sizeof(journal_block_tag_t))
 
 /*
  * The revoke descriptor: used on disk to describe a series of blocks to
@@ -255,8 +256,8 @@ typedef struct journal_superblock_s
 #include <linux/fs.h>
 #include <linux/sched.h>
 
-#define JBD_ASSERTIONS
-#ifdef JBD_ASSERTIONS
+#define JBD2_ASSERTIONS
+#ifdef JBD2_ASSERTIONS
 #define J_ASSERT(assert)                                               \
 do {                                                                   \
        if (!(assert)) {                                                \
@@ -283,9 +284,9 @@ void buffer_assertion_failure(struct buffer_head *bh);
 
 #else
 #define J_ASSERT(assert)       do { } while (0)
-#endif         /* JBD_ASSERTIONS */
+#endif         /* JBD2_ASSERTIONS */
 
-#if defined(JBD_PARANOID_IOFAIL)
+#if defined(JBD2_PARANOID_IOFAIL)
 #define J_EXPECT(expr, why...)         J_ASSERT(expr)
 #define J_EXPECT_BH(bh, expr, why...)  J_ASSERT_BH(bh, expr)
 #define J_EXPECT_JH(jh, expr, why...)  J_ASSERT_JH(jh, expr)
@@ -959,12 +960,12 @@ void jbd2_journal_put_journal_head(struct journal_head *jh);
  */
 extern struct kmem_cache *jbd2_handle_cache;
 
-static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags)
+static inline handle_t *jbd2_alloc_handle(gfp_t gfp_flags)
 {
        return kmem_cache_alloc(jbd2_handle_cache, gfp_flags);
 }
 
-static inline void jbd_free_handle(handle_t *handle)
+static inline void jbd2_free_handle(handle_t *handle)
 {
        kmem_cache_free(jbd2_handle_cache, handle);
 }
@@ -1103,4 +1104,4 @@ extern int jbd_blocks_per_page(struct inode *inode);
 
 #endif /* __KERNEL__ */
 
-#endif /* _LINUX_JBD_H */
+#endif /* _LINUX_JBD2_H */
index 12bf44f083f53355ca785a663bd76422dafcdfc1..e8ffce898bf913c7c12943b0a40785354dde6834 100644 (file)
@@ -53,7 +53,9 @@ static inline int kstat_irqs(int irq)
 }
 
 extern void account_user_time(struct task_struct *, cputime_t);
+extern void account_user_time_scaled(struct task_struct *, cputime_t);
 extern void account_system_time(struct task_struct *, int, cputime_t);
+extern void account_system_time_scaled(struct task_struct *, cputime_t);
 extern void account_steal_time(struct task_struct *, cputime_t);
 
 #endif /* _LINUX_KERNEL_STAT_H */
index 377e6d4d9be38664320510c77fddc4c5d9cd95ba..bc3b6fc7b98d2bf757a4a5c2a13efe80f93a298e 100644 (file)
@@ -1037,18 +1037,6 @@ extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
 /*
  * qc helpers
  */
-static inline int
-ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
-{
-       if (sg == &qc->pad_sgent)
-               return 1;
-       if (qc->pad_len)
-               return 0;
-       if (qc->n_iter == qc->n_elem)
-               return 1;
-       return 0;
-}
-
 static inline struct scatterlist *
 ata_qc_first_sg(struct ata_queued_cmd *qc)
 {
index 39dd83b183a91d0f8fa9ce27a4f8ed84c8a238a8..452c88d971ade860fbd159b9d7319017cfd49826 100644 (file)
@@ -827,7 +827,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
 {
        const struct net_device *dev = skb->dev;
 
-       if (!dev->header_ops->parse)
+       if (!dev->header_ops || !dev->header_ops->parse)
                return 0;
        return dev->header_ops->parse(skb, haddr);
 }
index b157897e7792106842988ba0357600a1497d36c9..dd5a4fd4cfd3c9a2635b891bffed564cf659d66d 100644 (file)
@@ -7,9 +7,6 @@
 
 #define XT_SCTP_VALID_FLAGS            0x07
 
-#define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
-
-
 struct xt_sctp_flag_info {
        u_int8_t chunktype;
        u_int8_t flag;
@@ -59,21 +56,21 @@ struct xt_sctp_info {
 #define SCTP_CHUNKMAP_RESET(chunkmap)                          \
        do {                                                    \
                int i;                                          \
-               for (i = 0; i < ELEMCOUNT(chunkmap); i++)       \
+               for (i = 0; i < ARRAY_SIZE(chunkmap); i++)      \
                        chunkmap[i] = 0;                        \
        } while (0)
 
 #define SCTP_CHUNKMAP_SET_ALL(chunkmap)                        \
        do {                                                    \
                int i;                                          \
-               for (i = 0; i < ELEMCOUNT(chunkmap); i++)       \
+               for (i = 0; i < ARRAY_SIZE(chunkmap); i++)      \
                        chunkmap[i] = ~0;                       \
        } while (0)
 
 #define SCTP_CHUNKMAP_COPY(destmap, srcmap)                    \
        do {                                                    \
                int i;                                          \
-               for (i = 0; i < ELEMCOUNT(chunkmap); i++)       \
+               for (i = 0; i < ARRAY_SIZE(srcmap); i++)        \
                        destmap[i] = srcmap[i];                 \
        } while (0)
 
@@ -81,7 +78,7 @@ struct xt_sctp_info {
 ({                                                     \
        int i;                                          \
        int flag = 1;                                   \
-       for (i = 0; i < ELEMCOUNT(chunkmap); i++) {     \
+       for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {    \
                if (chunkmap[i]) {                      \
                        flag = 0;                       \
                        break;                          \
@@ -94,7 +91,7 @@ struct xt_sctp_info {
 ({                                                     \
        int i;                                          \
        int flag = 1;                                   \
-       for (i = 0; i < ELEMCOUNT(chunkmap); i++) {     \
+       for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {    \
                if (chunkmap[i] != ~0) {                \
                        flag = 0;                       \
                                break;                  \
index 448f70b30a0c81fd2148b0b04bbe150bec69e60c..a8efcfeea7323365b65ac3b6098e053af3f14de7 100644 (file)
@@ -48,6 +48,10 @@ struct of_platform_driver
 #define        to_of_platform_driver(drv) \
        container_of(drv,struct of_platform_driver, driver)
 
+extern int of_register_driver(struct of_platform_driver *drv,
+                             struct bus_type *bus);
+extern void of_unregister_driver(struct of_platform_driver *drv);
+
 #include <asm/of_platform.h>
 
 extern struct of_device *of_find_device_by_node(struct device_node *np);
index 9cdd6943e01b8145c7d105d7d89b17c63d40c604..ec3f76598327c69e70f7e2dc67dc701db4969558 100644 (file)
@@ -510,7 +510,6 @@ extern struct pardevice *parport_open (int devnum, const char *name,
                                       int flags, void *handle);
 extern void parport_close (struct pardevice *dev);
 extern ssize_t parport_device_id (int devnum, char *buffer, size_t len);
-extern int parport_device_num (int parport, int mux, int daisy);
 extern void parport_daisy_deselect_all (struct parport *port);
 extern int parport_daisy_select (struct parport *port, int daisy, int mode);
 
index 48b71badfb4c837969fedf91f90cba2cce369587..09a309b7b5d2d4565b48b1eb5f59acd5c13265fe 100644 (file)
@@ -104,104 +104,6 @@ extern void (*pm_idle)(void);
 extern void (*pm_power_off)(void);
 extern void (*pm_power_off_prepare)(void);
 
-typedef int __bitwise suspend_state_t;
-
-#define PM_SUSPEND_ON          ((__force suspend_state_t) 0)
-#define PM_SUSPEND_STANDBY     ((__force suspend_state_t) 1)
-#define PM_SUSPEND_MEM         ((__force suspend_state_t) 3)
-#define PM_SUSPEND_MAX         ((__force suspend_state_t) 4)
-
-/**
- * struct pm_ops - Callbacks for managing platform dependent system sleep
- *     states.
- *
- * @valid: Callback to determine if given system sleep state is supported by
- *     the platform.
- *     Valid (ie. supported) states are advertised in /sys/power/state.  Note
- *     that it still may be impossible to enter given system sleep state if the
- *     conditions aren't right.
- *     There is the %pm_valid_only_mem function available that can be assigned
- *     to this if the platform only supports mem sleep.
- *
- * @set_target: Tell the platform which system sleep state is going to be
- *     entered.
- *     @set_target() is executed right prior to suspending devices.  The
- *     information conveyed to the platform code by @set_target() should be
- *     disregarded by the platform as soon as @finish() is executed and if
- *     @prepare() fails.  If @set_target() fails (ie. returns nonzero),
- *     @prepare(), @enter() and @finish() will not be called by the PM core.
- *     This callback is optional.  However, if it is implemented, the argument
- *     passed to @prepare(), @enter() and @finish() is meaningless and should
- *     be ignored.
- *
- * @prepare: Prepare the platform for entering the system sleep state indicated
- *     by @set_target() or represented by the argument if @set_target() is not
- *     implemented.
- *     @prepare() is called right after devices have been suspended (ie. the
- *     appropriate .suspend() method has been executed for each device) and
- *     before the nonboot CPUs are disabled (it is executed with IRQs enabled).
- *     This callback is optional.  It returns 0 on success or a negative
- *     error code otherwise, in which case the system cannot enter the desired
- *     sleep state (@enter() and @finish() will not be called in that case).
- *
- * @enter: Enter the system sleep state indicated by @set_target() or
- *     represented by the argument if @set_target() is not implemented.
- *     This callback is mandatory.  It returns 0 on success or a negative
- *     error code otherwise, in which case the system cannot enter the desired
- *     sleep state.
- *
- * @finish: Called when the system has just left a sleep state, right after
- *     the nonboot CPUs have been enabled and before devices are resumed (it is
- *     executed with IRQs enabled).  If @set_target() is not implemented, the
- *     argument represents the sleep state being left.
- *     This callback is optional, but should be implemented by the platforms
- *     that implement @prepare().  If implemented, it is always called after
- *     @enter() (even if @enter() fails).
- */
-struct pm_ops {
-       int (*valid)(suspend_state_t state);
-       int (*set_target)(suspend_state_t state);
-       int (*prepare)(suspend_state_t state);
-       int (*enter)(suspend_state_t state);
-       int (*finish)(suspend_state_t state);
-};
-
-#ifdef CONFIG_SUSPEND
-extern struct pm_ops *pm_ops;
-
-/**
- * pm_set_ops - set platform dependent power management ops
- * @pm_ops: The new power management operations to set.
- */
-extern void pm_set_ops(struct pm_ops *pm_ops);
-extern int pm_valid_only_mem(suspend_state_t state);
-
-/**
- * arch_suspend_disable_irqs - disable IRQs for suspend
- *
- * Disables IRQs (in the default case). This is a weak symbol in the common
- * code and thus allows architectures to override it if more needs to be
- * done. Not called for suspend to disk.
- */
-extern void arch_suspend_disable_irqs(void);
-
-/**
- * arch_suspend_enable_irqs - enable IRQs after suspend
- *
- * Enables IRQs (in the default case). This is a weak symbol in the common
- * code and thus allows architectures to override it if more needs to be
- * done. Not called for suspend to disk.
- */
-extern void arch_suspend_enable_irqs(void);
-
-extern int pm_suspend(suspend_state_t state);
-#else /* !CONFIG_SUSPEND */
-#define suspend_valid_only_mem NULL
-
-static inline void pm_set_ops(struct pm_ops *pm_ops) {}
-static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
-#endif /* !CONFIG_SUSPEND */
-
 /*
  * Device power management
  */
index d93c300a3449ba81bf38f9aec6c95eb5942cb9ab..a9c31be7052c4bcbd4593963ebf32303b338e04f 100644 (file)
@@ -36,7 +36,8 @@
  */
 
 /********** fs/jbd/journal.c **********/
-#define JBD_POISON_FREE        0x5b
+#define JBD_POISON_FREE                0x5b
+#define JBD2_POISON_FREE       0x5c
 
 /********** drivers/base/dmapool.c **********/
 #define        POOL_POISON_FREED       0xa7    /* !inuse */
index c204ab0d4df16a2200962bd07a6a62637154832f..10a83d8d5775d370c6eac6ff6b8488e07e9b7579 100644 (file)
@@ -569,7 +569,7 @@ struct sched_info {
                           last_queued; /* when we were last queued to run */
 #ifdef CONFIG_SCHEDSTATS
        /* BKL stats */
-       unsigned long bkl_count;
+       unsigned int bkl_count;
 #endif
 };
 #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
@@ -705,34 +705,34 @@ struct sched_domain {
 
 #ifdef CONFIG_SCHEDSTATS
        /* load_balance() stats */
-       unsigned long lb_count[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_failed[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_balanced[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_gained[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_hot_gained[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_nobusyg[CPU_MAX_IDLE_TYPES];
-       unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_count[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_failed[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_balanced[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_imbalance[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_gained[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_hot_gained[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_nobusyg[CPU_MAX_IDLE_TYPES];
+       unsigned int lb_nobusyq[CPU_MAX_IDLE_TYPES];
 
        /* Active load balancing */
-       unsigned long alb_count;
-       unsigned long alb_failed;
-       unsigned long alb_pushed;
+       unsigned int alb_count;
+       unsigned int alb_failed;
+       unsigned int alb_pushed;
 
        /* SD_BALANCE_EXEC stats */
-       unsigned long sbe_count;
-       unsigned long sbe_balanced;
-       unsigned long sbe_pushed;
+       unsigned int sbe_count;
+       unsigned int sbe_balanced;
+       unsigned int sbe_pushed;
 
        /* SD_BALANCE_FORK stats */
-       unsigned long sbf_count;
-       unsigned long sbf_balanced;
-       unsigned long sbf_pushed;
+       unsigned int sbf_count;
+       unsigned int sbf_balanced;
+       unsigned int sbf_pushed;
 
        /* try_to_wake_up() stats */
-       unsigned long ttwu_wake_remote;
-       unsigned long ttwu_move_affine;
-       unsigned long ttwu_move_balance;
+       unsigned int ttwu_wake_remote;
+       unsigned int ttwu_move_affine;
+       unsigned int ttwu_move_balance;
 #endif
 };
 
@@ -991,7 +991,7 @@ struct task_struct {
        int __user *clear_child_tid;            /* CLONE_CHILD_CLEARTID */
 
        unsigned int rt_priority;
-       cputime_t utime, stime;
+       cputime_t utime, stime, utimescaled, stimescaled;
        cputime_t gtime;
        unsigned long nvcsw, nivcsw; /* context switch counts */
        struct timespec start_time;             /* monotonic time */
@@ -1110,13 +1110,6 @@ struct task_struct {
 
        unsigned long ptrace_message;
        siginfo_t *last_siginfo; /* For ptrace use.  */
-/*
- * current io wait handle: wait queue entry to use for io waits
- * If this thread is processing aio, this points at the waitqueue
- * inside the currently handled kiocb. It may be NULL (i.e. default
- * to a stack based synchronous wait) if its doing sync IO.
- */
-       wait_queue_t *io_wait;
 #ifdef CONFIG_TASK_XACCT
 /* i/o counters(bytes read/written, #syscalls */
        u64 rchar, wchar, syscr, syscw;
index 9b0b63c50f445717c8645962c7a06c77042115d6..ff3f857f69571c3c6e6372322cb55f58ad5fd619 100644 (file)
 #include <linux/xfrm.h>
 #include <net/flow.h>
 
+/*
+ * Bounding set
+ */
+extern kernel_cap_t cap_bset;
+
+extern unsigned securebits;
+
 struct ctl_table;
 
 /*
index 388cace9751f06b9ee9496e2824a79e4bb9d839f..4360e0816956e536d929d7fffd23fedaab14fd46 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _LINUX_SWSUSP_H
-#define _LINUX_SWSUSP_H
+#ifndef _LINUX_SUSPEND_H
+#define _LINUX_SUSPEND_H
 
 #if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32) || defined(CONFIG_PPC64)
 #include <asm/suspend.h>
@@ -9,6 +9,108 @@
 #include <linux/init.h>
 #include <linux/pm.h>
 #include <linux/mm.h>
+#include <asm/errno.h>
+
+#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
+extern int pm_prepare_console(void);
+extern void pm_restore_console(void);
+#else
+static inline int pm_prepare_console(void) { return 0; }
+static inline void pm_restore_console(void) {}
+#endif
+
+typedef int __bitwise suspend_state_t;
+
+#define PM_SUSPEND_ON          ((__force suspend_state_t) 0)
+#define PM_SUSPEND_STANDBY     ((__force suspend_state_t) 1)
+#define PM_SUSPEND_MEM         ((__force suspend_state_t) 3)
+#define PM_SUSPEND_MAX         ((__force suspend_state_t) 4)
+
+/**
+ * struct platform_suspend_ops - Callbacks for managing platform dependent
+ *     system sleep states.
+ *
+ * @valid: Callback to determine if given system sleep state is supported by
+ *     the platform.
+ *     Valid (ie. supported) states are advertised in /sys/power/state.  Note
+ *     that it still may be impossible to enter given system sleep state if the
+ *     conditions aren't right.
+ *     There is the %suspend_valid_only_mem function available that can be
+ *     assigned to this if the platform only supports mem sleep.
+ *
+ * @set_target: Tell the platform which system sleep state is going to be
+ *     entered.
+ *     @set_target() is executed right prior to suspending devices.  The
+ *     information conveyed to the platform code by @set_target() should be
+ *     disregarded by the platform as soon as @finish() is executed and if
+ *     @prepare() fails.  If @set_target() fails (ie. returns nonzero),
+ *     @prepare(), @enter() and @finish() will not be called by the PM core.
+ *     This callback is optional.  However, if it is implemented, the argument
+ *     passed to @enter() is meaningless and should be ignored.
+ *
+ * @prepare: Prepare the platform for entering the system sleep state indicated
+ *     by @set_target().
+ *     @prepare() is called right after devices have been suspended (ie. the
+ *     appropriate .suspend() method has been executed for each device) and
+ *     before the nonboot CPUs are disabled (it is executed with IRQs enabled).
+ *     This callback is optional.  It returns 0 on success or a negative
+ *     error code otherwise, in which case the system cannot enter the desired
+ *     sleep state (@enter() and @finish() will not be called in that case).
+ *
+ * @enter: Enter the system sleep state indicated by @set_target() or
+ *     represented by the argument if @set_target() is not implemented.
+ *     This callback is mandatory.  It returns 0 on success or a negative
+ *     error code otherwise, in which case the system cannot enter the desired
+ *     sleep state.
+ *
+ * @finish: Called when the system has just left a sleep state, right after
+ *     the nonboot CPUs have been enabled and before devices are resumed (it is
+ *     executed with IRQs enabled).
+ *     This callback is optional, but should be implemented by the platforms
+ *     that implement @prepare().  If implemented, it is always called after
+ *     @enter() (even if @enter() fails).
+ */
+struct platform_suspend_ops {
+       int (*valid)(suspend_state_t state);
+       int (*set_target)(suspend_state_t state);
+       int (*prepare)(void);
+       int (*enter)(suspend_state_t state);
+       void (*finish)(void);
+};
+
+#ifdef CONFIG_SUSPEND
+/**
+ * suspend_set_ops - set platform dependent suspend operations
+ * @ops: The new suspend operations to set.
+ */
+extern void suspend_set_ops(struct platform_suspend_ops *ops);
+extern int suspend_valid_only_mem(suspend_state_t state);
+
+/**
+ * arch_suspend_disable_irqs - disable IRQs for suspend
+ *
+ * Disables IRQs (in the default case). This is a weak symbol in the common
+ * code and thus allows architectures to override it if more needs to be
+ * done. Not called for suspend to disk.
+ */
+extern void arch_suspend_disable_irqs(void);
+
+/**
+ * arch_suspend_enable_irqs - enable IRQs after suspend
+ *
+ * Enables IRQs (in the default case). This is a weak symbol in the common
+ * code and thus allows architectures to override it if more needs to be
+ * done. Not called for suspend to disk.
+ */
+extern void arch_suspend_enable_irqs(void);
+
+extern int pm_suspend(suspend_state_t state);
+#else /* !CONFIG_SUSPEND */
+#define suspend_valid_only_mem NULL
+
+static inline void suspend_set_ops(struct platform_suspend_ops *ops) {}
+static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
+#endif /* !CONFIG_SUSPEND */
 
 /* struct pbe is used for creating lists of pages that should be restored
  * atomically during the resume from disk, because the page frames they have
@@ -24,32 +126,57 @@ struct pbe {
 extern void drain_local_pages(void);
 extern void mark_free_pages(struct zone *zone);
 
-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE)
-extern int pm_prepare_console(void);
-extern void pm_restore_console(void);
-#else
-static inline int pm_prepare_console(void) { return 0; }
-static inline void pm_restore_console(void) {}
-#endif
-
 /**
- * struct hibernation_ops - hibernation platform support
+ * struct platform_hibernation_ops - hibernation platform support
  *
  * The methods in this structure allow a platform to override the default
  * mechanism of shutting down the machine during a hibernation transition.
  *
  * All three methods must be assigned.
  *
- * @prepare: prepare system for hibernation
- * @enter: shut down system after state has been saved to disk
- * @finish: finish/clean up after state has been reloaded
- * @pre_restore: prepare system for the restoration from a hibernation image
- * @restore_cleanup: clean up after a failing image restoration
+ * @start: Tell the platform driver that we're starting hibernation.
+ *     Called right after shrinking memory and before freezing devices.
+ *
+ * @pre_snapshot: Prepare the platform for creating the hibernation image.
+ *     Called right after devices have been frozen and before the nonboot
+ *     CPUs are disabled (runs with IRQs on).
+ *
+ * @finish: Restore the previous state of the platform after the hibernation
+ *     image has been created *or* put the platform into the normal operation
+ *     mode after the hibernation (the same method is executed in both cases).
+ *     Called right after the nonboot CPUs have been enabled and before
+ *     thawing devices (runs with IRQs on).
+ *
+ * @prepare: Prepare the platform for entering the low power state.
+ *     Called right after the hibernation image has been saved and before
+ *     devices are prepared for entering the low power state.
+ *
+ * @enter: Put the system into the low power state after the hibernation image
+ *     has been saved to disk.
+ *     Called after the nonboot CPUs have been disabled and all of the low
+ *     level devices have been shut down (runs with IRQs off).
+ *
+ * @leave: Perform the first stage of the cleanup after the system sleep state
+ *     indicated by @set_target() has been left.
+ *     Called right after the control has been passed from the boot kernel to
+ *     the image kernel, before the nonboot CPUs are enabled and before devices
+ *     are resumed.  Executed with interrupts disabled.
+ *
+ * @pre_restore: Prepare system for the restoration from a hibernation image.
+ *     Called right after devices have been frozen and before the nonboot
+ *     CPUs are disabled (runs with IRQs on).
+ *
+ * @restore_cleanup: Clean up after a failing image restoration.
+ *     Called right after the nonboot CPUs have been enabled and before
+ *     thawing devices (runs with IRQs on).
  */
-struct hibernation_ops {
+struct platform_hibernation_ops {
+       int (*start)(void);
+       int (*pre_snapshot)(void);
+       void (*finish)(void);
        int (*prepare)(void);
        int (*enter)(void);
-       void (*finish)(void);
+       void (*leave)(void);
        int (*pre_restore)(void);
        void (*restore_cleanup)(void);
 };
@@ -70,14 +197,14 @@ extern void swsusp_set_page_free(struct page *);
 extern void swsusp_unset_page_free(struct page *);
 extern unsigned long get_safe_page(gfp_t gfp_mask);
 
-extern void hibernation_set_ops(struct hibernation_ops *ops);
+extern void hibernation_set_ops(struct platform_hibernation_ops *ops);
 extern int hibernate(void);
 #else /* CONFIG_HIBERNATION */
 static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
 static inline void swsusp_set_page_free(struct page *p) {}
 static inline void swsusp_unset_page_free(struct page *p) {}
 
-static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
+static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {}
 static inline int hibernate(void) { return -ENOSYS; }
 #endif /* CONFIG_HIBERNATION */
 
@@ -130,4 +257,4 @@ static inline void register_nosave_region_late(unsigned long b, unsigned long e)
 }
 #endif
 
-#endif /* _LINUX_SWSUSP_H */
+#endif /* _LINUX_SUSPEND_H */
index 483050c924c305038a96cbcc4985f3f25b3cfe42..e99171f01b4cf482c2cd8720dea2f0921c08b4e2 100644 (file)
@@ -238,6 +238,7 @@ enum
        NET_LLC=18,
        NET_NETFILTER=19,
        NET_DCCP=20,
+       NET_IRDA=412,
 };
 
 /* /proc/sys/kernel/random */
@@ -795,6 +796,25 @@ enum {
        NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5,
 };
 
+/* proc/sys/net/irda */
+enum {
+       NET_IRDA_DISCOVERY=1,
+       NET_IRDA_DEVNAME=2,
+       NET_IRDA_DEBUG=3,
+       NET_IRDA_FAST_POLL=4,
+       NET_IRDA_DISCOVERY_SLOTS=5,
+       NET_IRDA_DISCOVERY_TIMEOUT=6,
+       NET_IRDA_SLOT_TIMEOUT=7,
+       NET_IRDA_MAX_BAUD_RATE=8,
+       NET_IRDA_MIN_TX_TURN_TIME=9,
+       NET_IRDA_MAX_TX_DATA_SIZE=10,
+       NET_IRDA_MAX_TX_WINDOW=11,
+       NET_IRDA_MAX_NOREPLY_TIME=12,
+       NET_IRDA_WARN_NOREPLY_TIME=13,
+       NET_IRDA_LAP_KEEPALIVE_TIME=14,
+};
+
+
 /* CTL_FS names: */
 enum
 {
@@ -937,41 +957,42 @@ extern int sysctl_perm(struct ctl_table *table, int op);
 
 typedef struct ctl_table ctl_table;
 
-typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
+typedef int ctl_handler (struct ctl_table *table, int __user *name, int nlen,
                         void __user *oldval, size_t __user *oldlenp,
                         void __user *newval, size_t newlen);
 
-typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
+typedef int proc_handler (struct ctl_table *ctl, int write, struct file * filp,
                          void __user *buffer, size_t *lenp, loff_t *ppos);
 
-extern int proc_dostring(ctl_table *, int, struct file *,
+extern int proc_dostring(struct ctl_table *, int, struct file *,
                         void __user *, size_t *, loff_t *);
-extern int proc_dointvec(ctl_table *, int, struct file *,
+extern int proc_dointvec(struct ctl_table *, int, struct file *,
                         void __user *, size_t *, loff_t *);
-extern int proc_dointvec_bset(ctl_table *, int, struct file *,
+extern int proc_dointvec_bset(struct ctl_table *, int, struct file *,
                              void __user *, size_t *, loff_t *);
-extern int proc_dointvec_minmax(ctl_table *, int, struct file *,
+extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *,
                                void __user *, size_t *, loff_t *);
-extern int proc_dointvec_jiffies(ctl_table *, int, struct file *,
+extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *,
                                 void __user *, size_t *, loff_t *);
-extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *,
+extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, struct file *,
                                        void __user *, size_t *, loff_t *);
-extern int proc_dointvec_ms_jiffies(ctl_table *, int, struct file *,
+extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, struct file *,
                                    void __user *, size_t *, loff_t *);
-extern int proc_doulongvec_minmax(ctl_table *, int, struct file *,
+extern int proc_doulongvec_minmax(struct ctl_table *, int, struct file *,
                                  void __user *, size_t *, loff_t *);
-extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int,
+extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
                                      struct file *, void __user *, size_t *, loff_t *);
 
 extern int do_sysctl (int __user *name, int nlen,
                      void __user *oldval, size_t __user *oldlenp,
                      void __user *newval, size_t newlen);
 
-extern int do_sysctl_strategy (ctl_table *table, 
+extern int do_sysctl_strategy (struct ctl_table *table,
                               int __user *name, int nlen,
                               void __user *oldval, size_t __user *oldlenp,
                               void __user *newval, size_t newlen);
 
+extern ctl_handler sysctl_data;
 extern ctl_handler sysctl_string;
 extern ctl_handler sysctl_intvec;
 extern ctl_handler sysctl_jiffies;
@@ -980,7 +1001,7 @@ extern ctl_handler sysctl_ms_jiffies;
 
 /*
  * Register a set of sysctl names by calling register_sysctl_table
- * with an initialised array of ctl_table's.  An entry with zero
+ * with an initialised array of struct ctl_table's.  An entry with zero
  * ctl_name and NULL procname terminates the table.  table->de will be
  * set up by the registration and need not be initialised in advance.
  *
@@ -1026,8 +1047,8 @@ struct ctl_table
        void *data;
        int maxlen;
        mode_t mode;
-       ctl_table *child;
-       ctl_table *parent;              /* Automatically set */
+       struct ctl_table *child;
+       struct ctl_table *parent;       /* Automatically set */
        proc_handler *proc_handler;     /* Callback for text formatting */
        ctl_handler *strategy;          /* Callback function for all r/w */
        void *extra1;
@@ -1035,18 +1056,19 @@ struct ctl_table
 };
 
 /* struct ctl_table_header is used to maintain dynamic lists of
-   ctl_table trees. */
+   struct ctl_table trees. */
 struct ctl_table_header
 {
-       ctl_table *ctl_table;
+       struct ctl_table *ctl_table;
        struct list_head ctl_entry;
        int used;
        struct completion *unregistering;
 };
 
-struct ctl_table_header * register_sysctl_table(ctl_table * table);
+struct ctl_table_header *register_sysctl_table(struct ctl_table * table);
 
 void unregister_sysctl_table(struct ctl_table_header * table);
+int sysctl_check_table(struct ctl_table *table);
 
 #else /* __KERNEL__ */
 
index dce1ed2049727a9b7a3576abc0c075440bc121e6..5d69c0744fff60283c74fbd4ca7a8c28ee4715cf 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 
-#define TASKSTATS_VERSION      5
+#define TASKSTATS_VERSION      6
 #define TS_COMM_LEN            32      /* should be >= TASK_COMM_LEN
                                         * in linux/sched.h */
 
@@ -152,6 +152,11 @@ struct taskstats {
 
        __u64  nvcsw;                   /* voluntary_ctxt_switches */
        __u64  nivcsw;                  /* nonvoluntary_ctxt_switches */
+
+       /* time accounting for SMT machines */
+       __u64   ac_utimescaled;         /* utime scaled on frequency etc */
+       __u64   ac_stimescaled;         /* stime scaled on frequency etc */
+       __u64   cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
 };
 
 
index 911c2cd02941cda559bb176af22f11adfda6915e..954def408975a13a11b6e57cbeb3624346f0328c 100644 (file)
@@ -39,8 +39,13 @@ struct inet_frags {
        struct inet_frags_ctl   *ctl;
 
        unsigned int            (*hashfn)(struct inet_frag_queue *);
+       void                    (*constructor)(struct inet_frag_queue *q,
+                                               void *arg);
        void                    (*destructor)(struct inet_frag_queue *);
        void                    (*skb_free)(struct sk_buff *);
+       int                     (*match)(struct inet_frag_queue *q,
+                                               void *arg);
+       void                    (*frag_expire)(unsigned long data);
 };
 
 void inet_frags_init(struct inet_frags *);
@@ -50,6 +55,8 @@ void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
 void inet_frag_destroy(struct inet_frag_queue *q,
                                struct inet_frags *f, int *work);
 int inet_frag_evictor(struct inet_frags *f);
+struct inet_frag_queue *inet_frag_find(struct inet_frags *f, void *key,
+               unsigned int hash);
 
 static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
 {
index cc796cbc1b26e5c292d649b8a26b2364dc7e0eef..ae328b680ff2a5e5de0cd41955f7476efae95035 100644 (file)
@@ -377,6 +377,17 @@ static inline int ipv6_prefix_equal(const struct in6_addr *a1,
                                   prefixlen);
 }
 
+struct inet_frag_queue;
+
+struct ip6_create_arg {
+       __be32 id;
+       struct in6_addr *src;
+       struct in6_addr *dst;
+};
+
+void ip6_frag_init(struct inet_frag_queue *q, void *a);
+int ip6_frag_match(struct inet_frag_queue *q, void *a);
+
 static inline int ipv6_addr_any(const struct in6_addr *a)
 {
        return ((a->s6_addr32[0] | a->s6_addr32[1] | 
index 453c79d0915ba00ca8b33ff160ba64cb7c58a521..43fc3fa50d6237227e5bec82bc0b4e8e0d4ce8b7 100644 (file)
@@ -904,16 +904,6 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
        return err;
 }
 
-/**
- *     sk_filter_rcu_free: Free a socket filter
- *     @rcu: rcu_head that contains the sk_filter to free
- */
-static inline void sk_filter_rcu_free(struct rcu_head *rcu)
-{
-       struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
-       kfree(fp);
-}
-
 /**
  *     sk_filter_release: Release a socket filter
  *     @sk: socket
@@ -922,14 +912,18 @@ static inline void sk_filter_rcu_free(struct rcu_head *rcu)
  *     Remove a filter from a socket and release its resources.
  */
 
-static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp)
+static inline void sk_filter_release(struct sk_filter *fp)
+{
+       if (atomic_dec_and_test(&fp->refcnt))
+               kfree(fp);
+}
+
+static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
 {
        unsigned int size = sk_filter_len(fp);
 
        atomic_sub(size, &sk->sk_omem_alloc);
-
-       if (atomic_dec_and_test(&fp->refcnt))
-               call_rcu_bh(&fp->rcu, sk_filter_rcu_free);
+       sk_filter_release(fp);
 }
 
 static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
index 0e844845f3f4f5e12ee64daccaadea4c4879efa0..688f6f5d3285bf1cc6ae88850c7008ff1fd6d5a2 100644 (file)
@@ -186,7 +186,8 @@ struct xfrm_state
        /* Reference to data common to all the instances of this
         * transformer. */
        struct xfrm_type        *type;
-       struct xfrm_mode        *mode;
+       struct xfrm_mode        *inner_mode;
+       struct xfrm_mode        *outer_mode;
 
        /* Security context */
        struct xfrm_sec_ctx     *security;
@@ -228,8 +229,6 @@ struct xfrm_type;
 struct xfrm_dst;
 struct xfrm_policy_afinfo {
        unsigned short          family;
-       struct xfrm_type        *type_map[IPPROTO_MAX];
-       struct xfrm_mode        *mode_map[XFRM_MODE_MAX];
        struct dst_ops          *dst_ops;
        void                    (*garbage_collect)(void);
        int                     (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl);
@@ -255,7 +254,10 @@ extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid);
 extern int __xfrm_state_delete(struct xfrm_state *x);
 
 struct xfrm_state_afinfo {
-       unsigned short          family;
+       unsigned int            family;
+       struct module           *owner;
+       struct xfrm_type        *type_map[IPPROTO_MAX];
+       struct xfrm_mode        *mode_map[XFRM_MODE_MAX];
        int                     (*init_flags)(struct xfrm_state *x);
        void                    (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
                                                struct xfrm_tmpl *tmpl,
@@ -267,8 +269,6 @@ struct xfrm_state_afinfo {
 
 extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
 extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
-extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family);
-extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
 
 extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
 
@@ -295,8 +295,6 @@ struct xfrm_type
 
 extern int xfrm_register_type(struct xfrm_type *type, unsigned short family);
 extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family);
-extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family);
-extern void xfrm_put_type(struct xfrm_type *type);
 
 struct xfrm_mode {
        int (*input)(struct xfrm_state *x, struct sk_buff *skb);
@@ -314,14 +312,19 @@ struct xfrm_mode {
         */
        int (*output)(struct xfrm_state *x,struct sk_buff *skb);
 
+       struct xfrm_state_afinfo *afinfo;
        struct module *owner;
        unsigned int encap;
+       int flags;
+};
+
+/* Flags for xfrm_mode. */
+enum {
+       XFRM_MODE_FLAG_TUNNEL = 1,
 };
 
 extern int xfrm_register_mode(struct xfrm_mode *mode, int family);
 extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family);
-extern struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family);
-extern void xfrm_put_mode(struct xfrm_mode *mode);
 
 struct xfrm_tmpl
 {
@@ -1046,11 +1049,19 @@ extern void xfrm_replay_notify(struct xfrm_state *x, int event);
 extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
 extern int xfrm_init_state(struct xfrm_state *x);
 extern int xfrm_output(struct sk_buff *skb);
+extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
+                          int encap_type);
 extern int xfrm4_rcv(struct sk_buff *skb);
+
+static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi)
+{
+       return xfrm4_rcv_encap(skb, nexthdr, spi, 0);
+}
+
 extern int xfrm4_output(struct sk_buff *skb);
 extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family);
 extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
-extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi);
+extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
 extern int xfrm6_rcv(struct sk_buff *skb);
 extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
                            xfrm_address_t *saddr, u8 proto);
index ed652f40f075a68e2b41b68911a97a0f5224ed96..3ac5904d1b124c1584b0308b0c42712d9a86cc20 100644 (file)
@@ -57,7 +57,7 @@ identify_ramdisk_image(int fd, int start_block)
        unsigned char *buf;
 
        buf = kmalloc(size, GFP_KERNEL);
-       if (buf == 0)
+       if (!buf)
                return -1;
 
        minixsb = (struct minix_super_block *) buf;
@@ -407,12 +407,12 @@ static int __init crd_load(int in_fd, int out_fd)
        crd_infd = in_fd;
        crd_outfd = out_fd;
        inbuf = kmalloc(INBUFSIZ, GFP_KERNEL);
-       if (inbuf == 0) {
+       if (!inbuf) {
                printk(KERN_ERR "RAMDISK: Couldn't allocate gzip buffer\n");
                return -1;
        }
        window = kmalloc(WSIZE, GFP_KERNEL);
-       if (window == 0) {
+       if (!window) {
                printk(KERN_ERR "RAMDISK: Couldn't allocate gzip window\n");
                kfree(inbuf);
                return -1;
index 774843cff756fe169948b8a084649d5f36dcb7fa..20f1fed8fa48f65f206eeb3124b56d602da3ca80 100644 (file)
 #define STATE_PENDING  1
 #define STATE_READY    2
 
-/* used by sysctl */
-#define FS_MQUEUE      1
-#define CTL_QUEUESMAX  2
-#define CTL_MSGMAX     3
-#define CTL_MSGSIZEMAX         4
-
 /* default values */
 #define DFLT_QUEUESMAX 256     /* max number of message queues */
 #define DFLT_MSGMAX    10      /* max number of messages in each queue */
@@ -1196,7 +1190,6 @@ static int msg_maxsize_limit_max = INT_MAX;
 
 static ctl_table mq_sysctls[] = {
        {
-               .ctl_name       = CTL_QUEUESMAX,
                .procname       = "queues_max",
                .data           = &queues_max,
                .maxlen         = sizeof(int),
@@ -1204,7 +1197,6 @@ static ctl_table mq_sysctls[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = CTL_MSGMAX,
                .procname       = "msg_max",
                .data           = &msg_max,
                .maxlen         = sizeof(int),
@@ -1214,7 +1206,6 @@ static ctl_table mq_sysctls[] = {
                .extra2         = &msg_max_limit_max,
        },
        {
-               .ctl_name       = CTL_MSGSIZEMAX,
                .procname       = "msgsize_max",
                .data           = &msgsize_max,
                .maxlen         = sizeof(int),
@@ -1228,7 +1219,6 @@ static ctl_table mq_sysctls[] = {
 
 static ctl_table mq_sysctl_dir[] = {
        {
-               .ctl_name       = FS_MQUEUE,
                .procname       = "mqueue",
                .mode           = 0555,
                .child          = mq_sysctls,
index 2a999836ca18092e172280d346a63c4a6763d776..d63fbb18798a420eab9d7fd5ea2d50ab501fdd2a 100644 (file)
@@ -9,7 +9,7 @@ obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
            rcupdate.o extable.o params.o posix-timers.o \
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
            hrtimer.o rwsem.o latency.o nsproxy.o srcu.o die_notifier.o \
-           utsname.o
+           utsname.o sysctl_check.o
 
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
 obj-y += time/
index 24f0f8b2ba724567861b6b8983b554f8f0473b90..fce53d8df8a7ade114a002885a8cbfc1cdbedc49 100644 (file)
@@ -329,16 +329,16 @@ static comp_t encode_comp_t(unsigned long value)
        }
 
        /*
-         * If we need to round up, do it (and handle overflow correctly).
-         */
+        * If we need to round up, do it (and handle overflow correctly).
+        */
        if (rnd && (++value > MAXFRACT)) {
                value >>= EXPSIZE;
                exp++;
        }
 
        /*
-         * Clean it up and polish it off.
-         */
+        * Clean it up and polish it off.
+        */
        exp <<= MANTSIZE;               /* Shift the exponent into place */
        exp += value;                   /* and add on the mantissa. */
        return exp;
@@ -361,30 +361,30 @@ static comp_t encode_comp_t(unsigned long value)
 
 static comp2_t encode_comp2_t(u64 value)
 {
-        int exp, rnd;
-
-        exp = (value > (MAXFRACT2>>1));
-        rnd = 0;
-        while (value > MAXFRACT2) {
-                rnd = value & 1;
-                value >>= 1;
-                exp++;
-        }
-
-        /*
-         * If we need to round up, do it (and handle overflow correctly).
-         */
-        if (rnd && (++value > MAXFRACT2)) {
-                value >>= 1;
-                exp++;
-        }
-
-        if (exp > MAXEXP2) {
-                /* Overflow. Return largest representable number instead. */
-                return (1ul << (MANTSIZE2+EXPSIZE2-1)) - 1;
-        } else {
-                return (value & (MAXFRACT2>>1)) | (exp << (MANTSIZE2-1));
-        }
+       int exp, rnd;
+
+       exp = (value > (MAXFRACT2>>1));
+       rnd = 0;
+       while (value > MAXFRACT2) {
+               rnd = value & 1;
+               value >>= 1;
+               exp++;
+       }
+
+       /*
+        * If we need to round up, do it (and handle overflow correctly).
+        */
+       if (rnd && (++value > MAXFRACT2)) {
+               value >>= 1;
+               exp++;
+       }
+
+       if (exp > MAXEXP2) {
+               /* Overflow. Return largest representable number instead. */
+               return (1ul << (MANTSIZE2+EXPSIZE2-1)) - 1;
+       } else {
+               return (value & (MAXFRACT2>>1)) | (exp << (MANTSIZE2-1));
+       }
 }
 #endif
 
@@ -501,14 +501,14 @@ static void do_acct_process(struct file *file)
        ac.ac_swaps = encode_comp_t(0);
 
        /*
-         * Kernel segment override to datasegment and write it
-         * to the accounting file.
-         */
+        * Kernel segment override to datasegment and write it
+        * to the accounting file.
+        */
        fs = get_fs();
        set_fs(KERNEL_DS);
        /*
-        * Accounting records are not subject to resource limits.
-        */
+        * Accounting records are not subject to resource limits.
+        */
        flim = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
        current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
        file->f_op->write(file, (char *)&ac,
index 2924251a6547bebb25d952dc64ea5590848b1bce..6977ea57a7e2d16d802fb87a77096c6f23a723e6 100644 (file)
@@ -664,11 +664,11 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                                if (sid) {
                                        if (selinux_sid_to_string(
                                                        sid, &ctx, &len)) {
-                                               audit_log_format(ab, 
+                                               audit_log_format(ab,
                                                        " ssid=%u", sid);
                                                /* Maybe call audit_panic? */
                                        } else
-                                               audit_log_format(ab, 
+                                               audit_log_format(ab,
                                                        " subj=%s", ctx);
                                        kfree(ctx);
                                }
@@ -769,7 +769,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                sig_data->pid = audit_sig_pid;
                memcpy(sig_data->ctx, ctx, len);
                kfree(ctx);
-               audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_SIGNAL_INFO, 
+               audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_SIGNAL_INFO,
                                0, 0, sig_data, sizeof(*sig_data) + len);
                kfree(sig_data);
                break;
@@ -1005,7 +1005,7 @@ unsigned int audit_serial(void)
        return ret;
 }
 
-static inline void audit_get_stamp(struct audit_context *ctx, 
+static inline void audit_get_stamp(struct audit_context *ctx,
                                   struct timespec *t, unsigned int *serial)
 {
        if (ctx)
@@ -1056,7 +1056,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
        if (gfp_mask & __GFP_WAIT)
                reserve = 0;
        else
-               reserve = 5; /* Allow atomic callers to go up to five 
+               reserve = 5; /* Allow atomic callers to go up to five
                                entries over the normal backlog limit */
 
        while (audit_backlog_limit
@@ -1319,7 +1319,7 @@ void audit_log_d_path(struct audit_buffer *ab, const char *prefix,
        if (IS_ERR(p)) { /* Should never happen since we send PATH_MAX */
                /* FIXME: can we save some information here? */
                audit_log_format(ab, "<too long>");
-       } else 
+       } else
                audit_log_untrustedstring(ab, p);
        kfree(path);
 }
@@ -1365,7 +1365,7 @@ void audit_log_end(struct audit_buffer *ab)
  * audit_log_vformat, and audit_log_end.  It may be called
  * in any context.
  */
-void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, 
+void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
               const char *fmt, ...)
 {
        struct audit_buffer *ab;
index 359645cff5b2cd662ea209458203eef6b1e96976..df66a21fb3608a871656d67f489492afea15d488 100644 (file)
@@ -1498,7 +1498,7 @@ int audit_receive_filter(int type, int pid, int uid, int seq, void *data,
                 * auditctl to read from it... which isn't ever going to
                 * happen if we're actually running in the context of auditctl
                 * trying to _send_ the stuff */
-                
+
                dest = kmalloc(sizeof(struct audit_netlink_list), GFP_KERNEL);
                if (!dest)
                        return -ENOMEM;
@@ -1678,7 +1678,7 @@ int audit_filter_type(int type)
 {
        struct audit_entry *e;
        int result = 0;
-       
+
        rcu_read_lock();
        if (list_empty(&audit_filter_list[AUDIT_FILTER_TYPE]))
                goto unlock_and_return;
index 938e60a61882008d732bcdf83377fc29d3fa8368..e19b5a33aede78289769e3642b8377d665af51f6 100644 (file)
@@ -320,7 +320,7 @@ static int audit_filter_rules(struct task_struct *tsk,
                        result = audit_comparator(tsk->personality, f->op, f->val);
                        break;
                case AUDIT_ARCH:
-                       if (ctx)
+                       if (ctx)
                                result = audit_comparator(ctx->arch, f->op, f->val);
                        break;
 
@@ -898,7 +898,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
        if (context->personality != PER_LINUX)
                audit_log_format(ab, " per=%lx", context->personality);
        if (context->return_valid)
-               audit_log_format(ab, " success=%s exit=%ld", 
+               audit_log_format(ab, " success=%s exit=%ld",
                                 (context->return_valid==AUDITSC_SUCCESS)?"yes":"no",
                                 context->return_code);
 
@@ -1135,8 +1135,8 @@ void audit_free(struct task_struct *tsk)
                return;
 
        /* Check for system calls that do not go through the exit
-        * function (e.g., exit_group), then free context block. 
-        * We use GFP_ATOMIC here because we might be doing this 
+        * function (e.g., exit_group), then free context block.
+        * We use GFP_ATOMIC here because we might be doing this
         * in the context of the idle thread */
        /* that can happen only if we are called from do_exit() */
        if (context->in_syscall && context->auditable)
@@ -1316,7 +1316,7 @@ void __audit_getname(const char *name)
                context->pwdmnt = mntget(current->fs->pwdmnt);
                read_unlock(&current->fs->lock);
        }
-               
+
 }
 
 /* audit_putname - intercept a putname request
index 4e350a36ed6a177a5422cf097c8120269490d785..cbc5fd60c0f318dce6c1cdcd33b4cf5b5d37f6a1 100644 (file)
@@ -3,9 +3,9 @@
  *
  * Copyright (C) 1997  Andrew Main <zefram@fysh.org>
  *
- * Integrated into 2.1.97+,  Andrew G. Morgan <morgan@transmeta.com>
+ * Integrated into 2.1.97+,  Andrew G. Morgan <morgan@kernel.org>
  * 30 May 2002:        Cleanup, Robert M. Love <rml@tech9.net>
- */ 
+ */
 
 #include <linux/capability.h>
 #include <linux/mm.h>
@@ -14,9 +14,6 @@
 #include <linux/syscalls.h>
 #include <asm/uaccess.h>
 
-unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */
-kernel_cap_t cap_bset = CAP_INIT_EFF_SET;
-
 /*
  * This lock protects task->cap_* for all tasks including current.
  * Locking rule: acquire this prior to tasklist_lock.
@@ -40,49 +37,49 @@ static DEFINE_SPINLOCK(task_capability_lock);
  */
 asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
 {
-     int ret = 0;
-     pid_t pid;
-     __u32 version;
-     struct task_struct *target;
-     struct __user_cap_data_struct data;
-
-     if (get_user(version, &header->version))
-            return -EFAULT;
-
-     if (version != _LINUX_CAPABILITY_VERSION) {
-            if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
-                    return -EFAULT; 
-             return -EINVAL;
-     }
+       int ret = 0;
+       pid_t pid;
+       __u32 version;
+       struct task_struct *target;
+       struct __user_cap_data_struct data;
+
+       if (get_user(version, &header->version))
+               return -EFAULT;
+
+       if (version != _LINUX_CAPABILITY_VERSION) {
+               if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
+                       return -EFAULT;
+               return -EINVAL;
+       }
 
-     if (get_user(pid, &header->pid))
-            return -EFAULT;
+       if (get_user(pid, &header->pid))
+               return -EFAULT;
 
-     if (pid < 0) 
-             return -EINVAL;
+       if (pid < 0)
+               return -EINVAL;
 
-     spin_lock(&task_capability_lock);
-     read_lock(&tasklist_lock); 
+       spin_lock(&task_capability_lock);
+       read_lock(&tasklist_lock);
 
-     if (pid && pid != current->pid) {
-            target = find_task_by_pid(pid);
-            if (!target) {
-                 ret = -ESRCH;
-                 goto out;
-            }
-     } else
-            target = current;
+       if (pid && pid != current->pid) {
+               target = find_task_by_pid(pid);
+               if (!target) {
+                       ret = -ESRCH;
+                       goto out;
+               }
+       } else
+               target = current;
 
-     ret = security_capget(target, &data.effective, &data.inheritable, &data.permitted);
+       ret = security_capget(target, &data.effective, &data.inheritable, &data.permitted);
 
 out:
-     read_unlock(&tasklist_lock); 
-     spin_unlock(&task_capability_lock);
+       read_unlock(&tasklist_lock);
+       spin_unlock(&task_capability_lock);
 
-     if (!ret && copy_to_user(dataptr, &data, sizeof data))
-          return -EFAULT; 
+       if (!ret && copy_to_user(dataptr, &data, sizeof data))
+               return -EFAULT;
 
-     return ret;
+       return ret;
 }
 
 /*
@@ -115,7 +112,7 @@ static inline int cap_set_pg(int pgrp_nr, kernel_cap_t *effective,
        } while_each_pid_task(pgrp, PIDTYPE_PGID, g);
 
        if (!found)
-            ret = 0;
+               ret = 0;
        return ret;
 }
 
@@ -169,68 +166,68 @@ static inline int cap_set_all(kernel_cap_t *effective,
  */
 asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
 {
-     kernel_cap_t inheritable, permitted, effective;
-     __u32 version;
-     struct task_struct *target;
-     int ret;
-     pid_t pid;
-
-     if (get_user(version, &header->version))
-            return -EFAULT; 
-
-     if (version != _LINUX_CAPABILITY_VERSION) {
-            if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
-                    return -EFAULT; 
-             return -EINVAL;
-     }
-
-     if (get_user(pid, &header->pid))
-            return -EFAULT; 
-
-     if (pid && pid != current->pid && !capable(CAP_SETPCAP))
-             return -EPERM;
-
-     if (copy_from_user(&effective, &data->effective, sizeof(effective)) ||
-        copy_from_user(&inheritable, &data->inheritable, sizeof(inheritable)) ||
-        copy_from_user(&permitted, &data->permitted, sizeof(permitted)))
-            return -EFAULT; 
-
-     spin_lock(&task_capability_lock);
-     read_lock(&tasklist_lock);
-
-     if (pid > 0 && pid != current->pid) {
-          target = find_task_by_pid(pid);
-          if (!target) {
-               ret = -ESRCH;
-               goto out;
-          }
-     } else
-               target = current;
-
-     ret = 0;
-
-     /* having verified that the proposed changes are legal,
-           we now put them into effect. */
-     if (pid < 0) {
-             if (pid == -1)  /* all procs other than current and init */
-                     ret = cap_set_all(&effective, &inheritable, &permitted);
-
-             else            /* all procs in process group */
-                     ret = cap_set_pg(-pid, &effective, &inheritable,
-                                                       &permitted);
-     } else {
-            ret = security_capset_check(target, &effective, &inheritable,
-                                                       &permitted);
-            if (!ret)
-                    security_capset_set(target, &effective, &inheritable,
-                                                       &permitted);
-     }
+       kernel_cap_t inheritable, permitted, effective;
+       __u32 version;
+       struct task_struct *target;
+       int ret;
+       pid_t pid;
+
+       if (get_user(version, &header->version))
+               return -EFAULT;
+
+       if (version != _LINUX_CAPABILITY_VERSION) {
+               if (put_user(_LINUX_CAPABILITY_VERSION, &header->version))
+                       return -EFAULT;
+               return -EINVAL;
+       }
+
+       if (get_user(pid, &header->pid))
+               return -EFAULT;
+
+       if (pid && pid != current->pid && !capable(CAP_SETPCAP))
+               return -EPERM;
+
+       if (copy_from_user(&effective, &data->effective, sizeof(effective)) ||
+           copy_from_user(&inheritable, &data->inheritable, sizeof(inheritable)) ||
+           copy_from_user(&permitted, &data->permitted, sizeof(permitted)))
+               return -EFAULT;
+
+       spin_lock(&task_capability_lock);
+       read_lock(&tasklist_lock);
+
+       if (pid > 0 && pid != current->pid) {
+               target = find_task_by_pid(pid);
+               if (!target) {
+                       ret = -ESRCH;
+                       goto out;
+               }
+       } else
+               target = current;
+
+       ret = 0;
+
+       /* having verified that the proposed changes are legal,
+          we now put them into effect. */
+       if (pid < 0) {
+               if (pid == -1)  /* all procs other than current and init */
+                       ret = cap_set_all(&effective, &inheritable, &permitted);
+
+               else            /* all procs in process group */
+                       ret = cap_set_pg(-pid, &effective, &inheritable,
+                                        &permitted);
+       } else {
+               ret = security_capset_check(target, &effective, &inheritable,
+                                           &permitted);
+               if (!ret)
+                       security_capset_set(target, &effective, &inheritable,
+                                           &permitted);
+       }
 
 out:
-     read_unlock(&tasklist_lock);
-     spin_unlock(&task_capability_lock);
+       read_unlock(&tasklist_lock);
+       spin_unlock(&task_capability_lock);
 
-     return ret;
+       return ret;
 }
 
 int __capable(struct task_struct *t, int cap)
index 3bae3742c2aa567e18f7b1558f7fa72b1c9155a0..42a1ed4b61b172afe1693234a4c68e5cfb695610 100644 (file)
@@ -40,62 +40,27 @@ int put_compat_timespec(const struct timespec *ts, struct compat_timespec __user
                        __put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
 }
 
-static long compat_nanosleep_restart(struct restart_block *restart)
-{
-       unsigned long expire = restart->arg0, now = jiffies;
-       struct compat_timespec __user *rmtp;
-
-       /* Did it expire while we handled signals? */
-       if (!time_after(expire, now))
-               return 0;
-
-       expire = schedule_timeout_interruptible(expire - now);
-       if (expire == 0)
-               return 0;
-
-       rmtp = (struct compat_timespec __user *)restart->arg1;
-       if (rmtp) {
-               struct compat_timespec ct;
-               struct timespec t;
-
-               jiffies_to_timespec(expire, &t);
-               ct.tv_sec = t.tv_sec;
-               ct.tv_nsec = t.tv_nsec;
-               if (copy_to_user(rmtp, &ct, sizeof(ct)))
-                       return -EFAULT;
-       }
-       /* The 'restart' block is already filled in */
-       return -ERESTART_RESTARTBLOCK;
-}
-
 asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
-               struct compat_timespec __user *rmtp)
+                                    struct compat_timespec __user *rmtp)
 {
-       struct timespec t;
-       struct restart_block *restart;
-       unsigned long expire;
+       struct timespec tu, rmt;
+       long ret;
 
-       if (get_compat_timespec(&t, rqtp))
+       if (get_compat_timespec(&tu, rqtp))
                return -EFAULT;
 
-       if ((t.tv_nsec >= 1000000000L) || (t.tv_nsec < 0) || (t.tv_sec < 0))
+       if (!timespec_valid(&tu))
                return -EINVAL;
 
-       expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
-       expire = schedule_timeout_interruptible(expire);
-       if (expire == 0)
-               return 0;
+       ret = hrtimer_nanosleep(&tu, rmtp ? &rmt : NULL, HRTIMER_MODE_REL,
+                               CLOCK_MONOTONIC);
 
-       if (rmtp) {
-               jiffies_to_timespec(expire, &t);
-               if (put_compat_timespec(&t, rmtp))
+       if (ret && rmtp) {
+               if (put_compat_timespec(&rmt, rmtp))
                        return -EFAULT;
        }
-       restart = &current_thread_info()->restart_block;
-       restart->fn = compat_nanosleep_restart;
-       restart->arg0 = jiffies + expire;
-       restart->arg1 = (unsigned long) rmtp;
-       return -ERESTART_RESTARTBLOCK;
+
+       return ret;
 }
 
 static inline long get_compat_itimerval(struct itimerval *o,
@@ -247,8 +212,8 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource,
        int ret;
        mm_segment_t old_fs = get_fs ();
 
-       if (resource >= RLIM_NLIMITS) 
-               return -EINVAL; 
+       if (resource >= RLIM_NLIMITS)
+               return -EINVAL;
 
        if (!access_ok(VERIFY_READ, rlim, sizeof(*rlim)) ||
            __get_user(r.rlim_cur, &rlim->rlim_cur) ||
@@ -477,21 +442,21 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
 
 int get_compat_itimerspec(struct itimerspec *dst,
                          const struct compat_itimerspec __user *src)
-{ 
+{
        if (get_compat_timespec(&dst->it_interval, &src->it_interval) ||
            get_compat_timespec(&dst->it_value, &src->it_value))
                return -EFAULT;
        return 0;
-} 
+}
 
 int put_compat_itimerspec(struct compat_itimerspec __user *dst,
                          const struct itimerspec *src)
-{ 
+{
        if (put_compat_timespec(&src->it_interval, &dst->it_interval) ||
            put_compat_timespec(&src->it_value, &dst->it_value))
                return -EFAULT;
        return 0;
-} 
+}
 
 long compat_sys_timer_create(clockid_t which_clock,
                        struct compat_sigevent __user *timer_event_spec,
@@ -512,9 +477,9 @@ long compat_sys_timer_create(clockid_t which_clock,
 }
 
 long compat_sys_timer_settime(timer_t timer_id, int flags,
-                         struct compat_itimerspec __user *new, 
+                         struct compat_itimerspec __user *new,
                          struct compat_itimerspec __user *old)
-{ 
+{
        long err;
        mm_segment_t oldfs;
        struct itimerspec newts, oldts;
@@ -522,58 +487,58 @@ long compat_sys_timer_settime(timer_t timer_id, int flags,
        if (!new)
                return -EINVAL;
        if (get_compat_itimerspec(&newts, new))
-               return -EFAULT; 
+               return -EFAULT;
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_timer_settime(timer_id, flags,
                                (struct itimerspec __user *) &newts,
                                (struct itimerspec __user *) &oldts);
-       set_fs(oldfs); 
+       set_fs(oldfs);
        if (!err && old && put_compat_itimerspec(old, &oldts))
                return -EFAULT;
        return err;
-} 
+}
 
 long compat_sys_timer_gettime(timer_t timer_id,
                struct compat_itimerspec __user *setting)
-{ 
+{
        long err;
        mm_segment_t oldfs;
-       struct itimerspec ts; 
+       struct itimerspec ts;
 
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        err = sys_timer_gettime(timer_id,
-                               (struct itimerspec __user *) &ts); 
-       set_fs(oldfs); 
+                               (struct itimerspec __user *) &ts);
+       set_fs(oldfs);
        if (!err && put_compat_itimerspec(setting, &ts))
                return -EFAULT;
        return err;
-} 
+}
 
 long compat_sys_clock_settime(clockid_t which_clock,
                struct compat_timespec __user *tp)
 {
        long err;
        mm_segment_t oldfs;
-       struct timespec ts; 
+       struct timespec ts;
 
        if (get_compat_timespec(&ts, tp))
-               return -EFAULT; 
+               return -EFAULT;
        oldfs = get_fs();
-       set_fs(KERNEL_DS);      
+       set_fs(KERNEL_DS);
        err = sys_clock_settime(which_clock,
                                (struct timespec __user *) &ts);
        set_fs(oldfs);
        return err;
-} 
+}
 
 long compat_sys_clock_gettime(clockid_t which_clock,
                struct compat_timespec __user *tp)
 {
        long err;
        mm_segment_t oldfs;
-       struct timespec ts; 
+       struct timespec ts;
 
        oldfs = get_fs();
        set_fs(KERNEL_DS);
@@ -581,16 +546,16 @@ long compat_sys_clock_gettime(clockid_t which_clock,
                                (struct timespec __user *) &ts);
        set_fs(oldfs);
        if (!err && put_compat_timespec(&ts, tp))
-               return -EFAULT; 
+               return -EFAULT;
        return err;
-} 
+}
 
 long compat_sys_clock_getres(clockid_t which_clock,
                struct compat_timespec __user *tp)
 {
        long err;
        mm_segment_t oldfs;
-       struct timespec ts; 
+       struct timespec ts;
 
        oldfs = get_fs();
        set_fs(KERNEL_DS);
@@ -598,9 +563,9 @@ long compat_sys_clock_getres(clockid_t which_clock,
                               (struct timespec __user *) &ts);
        set_fs(oldfs);
        if (!err && tp && put_compat_timespec(&ts, tp))
-               return -EFAULT; 
+               return -EFAULT;
        return err;
-} 
+}
 
 static long compat_clock_nanosleep_restart(struct restart_block *restart)
 {
@@ -632,10 +597,10 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
 {
        long err;
        mm_segment_t oldfs;
-       struct timespec in, out; 
+       struct timespec in, out;
        struct restart_block *restart;
 
-       if (get_compat_timespec(&in, rqtp)) 
+       if (get_compat_timespec(&in, rqtp))
                return -EFAULT;
 
        oldfs = get_fs();
@@ -654,8 +619,8 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
                restart->fn = compat_clock_nanosleep_restart;
                restart->arg1 = (unsigned long) rmtp;
        }
-       return err;     
-} 
+       return err;
+}
 
 /*
  * We currently only need the following fields from the sigevent
index 38033db8d8ec3d8f23af3973560dc995782efbda..a21f71af9d81fba3c0012afd8538d25a1f7c0c62 100644 (file)
@@ -150,6 +150,7 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
        err = __raw_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE | mod,
                                        hcpu, -1, &nr_calls);
        if (err == NOTIFY_BAD) {
+               nr_calls--;
                __raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED | mod,
                                          hcpu, nr_calls, NULL);
                printk("%s: attempt to take down CPU %u failed\n",
@@ -233,6 +234,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
        ret = __raw_notifier_call_chain(&cpu_chain, CPU_UP_PREPARE | mod, hcpu,
                                                        -1, &nr_calls);
        if (ret == NOTIFY_BAD) {
+               nr_calls--;
                printk("%s: attempt to bring up CPU %u failed\n",
                                __FUNCTION__, cpu);
                ret = -EINVAL;
index 2eb2e50db0d6a7c1c93915116ee9d8e125ad2981..64950fa5d3211c5f2843e9637b38452a70eef9f7 100644 (file)
@@ -2431,12 +2431,12 @@ int __cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
        node = zone_to_nid(z);
        if (node_isset(node, current->mems_allowed))
                return 1;
-        /*
-         * Allow tasks that have access to memory reserves because they have
-         * been OOM killed to get memory anywhere.
-         */
-        if (unlikely(test_thread_flag(TIF_MEMDIE)))
-                return 1;
+       /*
+        * Allow tasks that have access to memory reserves because they have
+        * been OOM killed to get memory anywhere.
+        */
+       if (unlikely(test_thread_flag(TIF_MEMDIE)))
+               return 1;
        return 0;
 }
 
index 09e9574eeb26f0273054e1111224521e0a072c67..10e43fd8b721a7c28f44dbb60515efa9d0d4042d 100644 (file)
@@ -115,6 +115,12 @@ int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
        tmp += timespec_to_ns(&ts);
        d->cpu_run_real_total = (tmp < (s64)d->cpu_run_real_total) ? 0 : tmp;
 
+       tmp = (s64)d->cpu_scaled_run_real_total;
+       cputime_to_timespec(tsk->utimescaled + tsk->stimescaled, &ts);
+       tmp += timespec_to_ns(&ts);
+       d->cpu_scaled_run_real_total =
+               (tmp < (s64)d->cpu_scaled_run_real_total) ? 0 : tmp;
+
        /*
         * No locking available for sched_info (and too expensive to add one)
         * Mitigate by taking snapshot of values
index 937b13ca33baaac6a3ab01437b4016f9995a11f9..6a82bb716dace9bbcf0b469e3119fd10a95b9b1a 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/dma.h>
 #include <asm/system.h>
 
+
 
 /* A note on resource allocation:
  *
@@ -95,7 +95,7 @@ void free_dma(unsigned int dmanr)
        if (xchg(&dma_chan_busy[dmanr].lock, 0) == 0) {
                printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
                return;
-       }       
+       }
 
 } /* free_dma */
 
@@ -121,8 +121,8 @@ static int proc_dma_show(struct seq_file *m, void *v)
 
        for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) {
                if (dma_chan_busy[i].lock) {
-                   seq_printf(m, "%2d: %s\n", i,
-                              dma_chan_busy[i].device_id);
+                       seq_printf(m, "%2d: %s\n", i,
+                                  dma_chan_busy[i].device_id);
                }
        }
        return 0;
index 3c2eaea66b1e16347bcd564b0c492b8f026dcf21..a9e6bad9f706b05f96b2e7c4e16e6cb75acd6f4e 100644 (file)
@@ -57,7 +57,7 @@ lookup_exec_domain(u_long personality)
 {
        struct exec_domain *    ep;
        u_long                  pers = personality(personality);
-               
+
        read_lock(&exec_domains_lock);
        for (ep = exec_domains; ep; ep = ep->next) {
                if (pers >= ep->pers_low && pers <= ep->pers_high)
index 490495a39c7e65cb0eb239b2b6474ce5d58b718b..2ce28f165e31a1e671e014b10a852e53cd1c535b 100644 (file)
@@ -268,7 +268,7 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                        get_file(file);
                        if (tmp->vm_flags & VM_DENYWRITE)
                                atomic_dec(&inode->i_writecount);
-      
+
                        /* insert tmp into the share list, just after mpnt */
                        spin_lock(&file->f_mapping->i_mmap_lock);
                        tmp->vm_truncate_count = mpnt->vm_truncate_count;
@@ -331,7 +331,7 @@ static inline void mm_free_pgd(struct mm_struct * mm)
 #define mm_free_pgd(mm)
 #endif /* CONFIG_MMU */
 
- __cacheline_aligned_in_smp DEFINE_SPINLOCK(mmlist_lock);
+__cacheline_aligned_in_smp DEFINE_SPINLOCK(mmlist_lock);
 
 #define allocate_mm()  (kmem_cache_alloc(mm_cachep, GFP_KERNEL))
 #define free_mm(mm)    (kmem_cache_free(mm_cachep, (mm)))
@@ -738,8 +738,8 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
        /* compute the remainder to be cleared */
        size = (new_fdt->max_fds - open_files) * sizeof(struct file *);
 
-       /* This is long word aligned thus could use a optimized version */ 
-       memset(new_fds, 0, size); 
+       /* This is long word aligned thus could use a optimized version */
+       memset(new_fds, 0, size);
 
        if (new_fdt->max_fds > open_files) {
                int left = (new_fdt->max_fds-open_files)/8;
@@ -942,6 +942,7 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p)
        if (!(clone_flags & CLONE_PTRACE))
                p->ptrace = 0;
        p->flags = new_flags;
+       clear_freeze_flag(p);
 }
 
 asmlinkage long sys_set_tid_address(int __user *tidptr)
@@ -1058,6 +1059,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->utime = cputime_zero;
        p->stime = cputime_zero;
        p->gtime = cputime_zero;
+       p->utimescaled = cputime_zero;
+       p->stimescaled = cputime_zero;
 
 #ifdef CONFIG_TASK_XACCT
        p->rchar = 0;           /* I/O counter: bytes read */
@@ -1068,12 +1071,12 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        task_io_accounting_init(p);
        acct_clear_integrals(p);
 
-       p->it_virt_expires = cputime_zero;
+       p->it_virt_expires = cputime_zero;
        p->it_prof_expires = cputime_zero;
-       p->it_sched_expires = 0;
-       INIT_LIST_HEAD(&p->cpu_timers[0]);
-       INIT_LIST_HEAD(&p->cpu_timers[1]);
-       INIT_LIST_HEAD(&p->cpu_timers[2]);
+       p->it_sched_expires = 0;
+       INIT_LIST_HEAD(&p->cpu_timers[0]);
+       INIT_LIST_HEAD(&p->cpu_timers[1]);
+       INIT_LIST_HEAD(&p->cpu_timers[2]);
 
        p->lock_depth = -1;             /* -1 = no lock */
        do_posix_clock_monotonic_gettime(&p->start_time);
@@ -1083,7 +1086,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
        p->security = NULL;
 #endif
        p->io_context = NULL;
-       p->io_wait = NULL;
        p->audit_context = NULL;
        cpuset_fork(p);
 #ifdef CONFIG_NUMA
@@ -1239,7 +1241,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
         * A fatal signal pending means that current will exit, so the new
         * thread can't slip out of an OOM kill (or normal SIGKILL).
         */
-       recalc_sigpending();
+       recalc_sigpending();
        if (signal_pending(current)) {
                spin_unlock(&current->sighand->siglock);
                write_unlock_irq(&tasklist_lock);
index d725676d84f3580813161678394bc9220630af82..e45a65e41686c19e599140e0c4e04de5203f5bee 100644 (file)
@@ -293,7 +293,7 @@ EXPORT_SYMBOL_GPL(get_futex_key_refs);
  */
 void drop_futex_key_refs(union futex_key *key)
 {
-       if (key->both.ptr == 0)
+       if (!key->both.ptr)
                return;
        switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
                case FUT_OFF_INODE:
@@ -1046,7 +1046,7 @@ static int unqueue_me(struct futex_q *q)
  retry:
        lock_ptr = q->lock_ptr;
        barrier();
-       if (lock_ptr != 0) {
+       if (lock_ptr != NULL) {
                spin_lock(lock_ptr);
                /*
                 * q->lock_ptr can change between reading it and
index dc8a4451d79b15d64a37caf55c9dc4595c6ec5d2..b2b2c2b0a49bc845f0ba277f96b8db2d1d2f6803 100644 (file)
@@ -1286,8 +1286,7 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod
 long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
 {
        struct hrtimer_sleeper t;
-       struct timespec __user *rmtp;
-       struct timespec tu;
+       struct timespec *rmtp;
        ktime_t time;
 
        restart->fn = do_no_restart_syscall;
@@ -1298,14 +1297,12 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
        if (do_nanosleep(&t, HRTIMER_MODE_ABS))
                return 0;
 
-       rmtp = (struct timespec __user *) restart->arg1;
+       rmtp = (struct timespec *)restart->arg1;
        if (rmtp) {
                time = ktime_sub(t.timer.expires, t.timer.base->get_time());
                if (time.tv64 <= 0)
                        return 0;
-               tu = ktime_to_timespec(time);
-               if (copy_to_user(rmtp, &tu, sizeof(tu)))
-                       return -EFAULT;
+               *rmtp = ktime_to_timespec(time);
        }
 
        restart->fn = hrtimer_nanosleep_restart;
@@ -1314,12 +1311,11 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
        return -ERESTART_RESTARTBLOCK;
 }
 
-long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
+long hrtimer_nanosleep(struct timespec *rqtp, struct timespec *rmtp,
                       const enum hrtimer_mode mode, const clockid_t clockid)
 {
        struct restart_block *restart;
        struct hrtimer_sleeper t;
-       struct timespec tu;
        ktime_t rem;
 
        hrtimer_init(&t.timer, clockid, mode);
@@ -1335,9 +1331,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
                rem = ktime_sub(t.timer.expires, t.timer.base->get_time());
                if (rem.tv64 <= 0)
                        return 0;
-               tu = ktime_to_timespec(rem);
-               if (copy_to_user(rmtp, &tu, sizeof(tu)))
-                       return -EFAULT;
+               *rmtp = ktime_to_timespec(rem);
        }
 
        restart = &current_thread_info()->restart_block;
@@ -1353,7 +1347,8 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
 asmlinkage long
 sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
 {
-       struct timespec tu;
+       struct timespec tu, rmt;
+       int ret;
 
        if (copy_from_user(&tu, rqtp, sizeof(tu)))
                return -EFAULT;
@@ -1361,7 +1356,15 @@ sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
        if (!timespec_valid(&tu))
                return -EINVAL;
 
-       return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
+       ret = hrtimer_nanosleep(&tu, rmtp ? &rmt : NULL, HRTIMER_MODE_REL,
+                               CLOCK_MONOTONIC);
+
+       if (ret && rmtp) {
+               if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
+                       return -EFAULT;
+       }
+
+       return ret;
 }
 
 /*
index 3205e8e114fa361eff4a1698c9a3ec2bbf4e730f..2fab344dbf56c737b39feb3951e822e5911a775b 100644 (file)
@@ -130,7 +130,7 @@ asmlinkage long sys_getitimer(int which, struct itimerval __user *value)
 enum hrtimer_restart it_real_fn(struct hrtimer *timer)
 {
        struct signal_struct *sig =
-           container_of(timer, struct signal_struct, real_timer);
+               container_of(timer, struct signal_struct, real_timer);
 
        send_group_sig_info(SIGALRM, SEND_SIG_PRIV, sig->tsk);
 
@@ -291,6 +291,6 @@ asmlinkage long sys_setitimer(int which,
                return error;
 
        if (copy_to_user(ovalue, &get_buffer, sizeof(get_buffer)))
-               return -EFAULT; 
+               return -EFAULT;
        return 0;
 }
index 7885269b0da2589f08fcf655cc0ecfa9c28c9a37..e9f1b4ea504d920bd514deb8868536fd10de77bb 100644 (file)
@@ -785,7 +785,7 @@ static int kimage_load_normal_segment(struct kimage *image,
                size_t uchunk, mchunk;
 
                page = kimage_alloc_page(image, GFP_HIGHUSER, maddr);
-               if (page == 0) {
+               if (!page) {
                        result  = -ENOMEM;
                        goto out;
                }
@@ -844,7 +844,7 @@ static int kimage_load_crash_segment(struct kimage *image,
                size_t uchunk, mchunk;
 
                page = pfn_to_page(maddr >> PAGE_SHIFT);
-               if (page == 0) {
+               if (!page) {
                        result  = -ENOMEM;
                        goto out;
                }
index a389b423c279dcb6e5f2b94ffcf56e534b06875e..7734595bd3296923947432521095020096f69fdf 100644 (file)
@@ -105,7 +105,7 @@ void __module_put_and_exit(struct module *mod, long code)
        do_exit(code);
 }
 EXPORT_SYMBOL(__module_put_and_exit);
-       
+
 /* Find a module section: 0 means not found. */
 static unsigned int find_sec(Elf_Ehdr *hdr,
                             Elf_Shdr *sechdrs,
@@ -179,7 +179,7 @@ static unsigned long __find_symbol(const char *name,
        struct module *mod;
        const struct kernel_symbol *ks;
 
-       /* Core kernel first. */ 
+       /* Core kernel first. */
        *owner = NULL;
        ks = lookup_symbol(name, __start___ksymtab, __stop___ksymtab);
        if (ks) {
@@ -231,7 +231,7 @@ static unsigned long __find_symbol(const char *name,
                return ks->value;
        }
 
-       /* Now try modules. */ 
+       /* Now try modules. */
        list_for_each_entry(mod, &modules, list) {
                *owner = mod;
                ks = lookup_symbol(name, mod->syms, mod->syms + mod->num_syms);
@@ -285,7 +285,7 @@ static unsigned long __find_symbol(const char *name,
                }
        }
        DEBUGP("Failed to find symbol %s\n", name);
-       return 0;
+       return 0;
 }
 
 /* Search for module by name: must hold module_mutex. */
@@ -441,7 +441,7 @@ static int percpu_modinit(void)
        }
 
        return 0;
-}      
+}
 __initcall(percpu_modinit);
 #else /* ... !CONFIG_SMP */
 static inline void *percpu_modalloc(unsigned long size, unsigned long align,
@@ -483,8 +483,8 @@ static int modinfo_##field##_exists(struct module *mod)               \
 }                                                                     \
 static void free_modinfo_##field(struct module *mod)                  \
 {                                                                     \
-        kfree(mod->field);                                            \
-        mod->field = NULL;                                            \
+       kfree(mod->field);                                            \
+       mod->field = NULL;                                            \
 }                                                                     \
 static struct module_attribute modinfo_##field = {                    \
        .attr = { .name = __stringify(field), .mode = 0444 },         \
@@ -990,7 +990,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
        struct module_sect_attrs *sect_attrs;
        struct module_sect_attr *sattr;
        struct attribute **gattr;
-       
+
        /* Count loaded sections and allocate structures */
        for (i = 0; i < nsect; i++)
                if (sechdrs[i].sh_flags & SHF_ALLOC)
@@ -1348,14 +1348,14 @@ static int verify_export_symbols(struct module *mod)
        const unsigned long *crc;
 
        for (i = 0; i < mod->num_syms; i++)
-               if (__find_symbol(mod->syms[i].name, &owner, &crc, 1)) {
+               if (__find_symbol(mod->syms[i].name, &owner, &crc, 1)) {
                        name = mod->syms[i].name;
                        ret = -ENOEXEC;
                        goto dup;
                }
 
        for (i = 0; i < mod->num_gpl_syms; i++)
-               if (__find_symbol(mod->gpl_syms[i].name, &owner, &crc, 1)) {
+               if (__find_symbol(mod->gpl_syms[i].name, &owner, &crc, 1)) {
                        name = mod->gpl_syms[i].name;
                        ret = -ENOEXEC;
                        goto dup;
@@ -1929,7 +1929,7 @@ static struct module *load_module(void __user *umod,
                mod->unused_crcs = (void *)sechdrs[unusedgplcrcindex].sh_addr;
 
 #ifdef CONFIG_MODVERSIONS
-       if ((mod->num_syms && !crcindex) || 
+       if ((mod->num_syms && !crcindex) ||
            (mod->num_gpl_syms && !gplcrcindex) ||
            (mod->num_gpl_future_syms && !gplfuturecrcindex) ||
            (mod->num_unused_syms && !unusedcrcindex) ||
@@ -2016,7 +2016,7 @@ static struct module *load_module(void __user *umod,
        if (err < 0)
                goto arch_cleanup;
 
-       err = mod_sysfs_setup(mod, 
+       err = mod_sysfs_setup(mod,
                              (struct kernel_param *)
                              sechdrs[setupindex].sh_addr,
                              sechdrs[setupindex].sh_size
@@ -2028,8 +2028,8 @@ static struct module *load_module(void __user *umod,
 
        /* Size of section 0 is 0, so this works well if no unwind info. */
        mod->unwind_info = unwind_add_table(mod,
-                                           (void *)sechdrs[unwindex].sh_addr,
-                                           sechdrs[unwindex].sh_size);
+                                           (void *)sechdrs[unwindex].sh_addr,
+                                           sechdrs[unwindex].sh_size);
 
        /* Get rid of temporary copy */
        vfree(hdr);
@@ -2146,7 +2146,7 @@ static inline int within(unsigned long addr, void *start, unsigned long size)
  */
 static inline int is_arm_mapping_symbol(const char *str)
 {
-       return str[0] == '$' && strchr("atd", str[1]) 
+       return str[0] == '$' && strchr("atd", str[1])
               && (str[2] == '\0' || str[2] == '.');
 }
 
@@ -2161,11 +2161,11 @@ static const char *get_ksymbol(struct module *mod,
        /* At worse, next value is at end of module */
        if (within(addr, mod->module_init, mod->init_size))
                nextval = (unsigned long)mod->module_init+mod->init_text_size;
-       else 
+       else
                nextval = (unsigned long)mod->module_core+mod->core_text_size;
 
        /* Scan for closest preceeding symbol, and next symbol. (ELF
-           starts real symbols at 1). */
+          starts real symbols at 1). */
        for (i = 1; i < mod->num_symtab; i++) {
                if (mod->symtab[i].st_shndx == SHN_UNDEF)
                        continue;
@@ -2407,7 +2407,7 @@ const struct exception_table_entry *search_module_extables(unsigned long addr)
        list_for_each_entry(mod, &modules, list) {
                if (mod->num_exentries == 0)
                        continue;
-                               
+
                e = search_extable(mod->extable,
                                   mod->extable + mod->num_exentries - 1,
                                   addr);
@@ -2417,7 +2417,7 @@ const struct exception_table_entry *search_module_extables(unsigned long addr)
        preempt_enable();
 
        /* Now, if we found one, we are running inside it now, hence
-           we cannot unload the module, hence no refcnt needed. */
+          we cannot unload the module, hence no refcnt needed. */
        return e;
 }
 
index f64f4c1ac11fc78c6c13d28968383e77c724e35c..3886bd8230feac054f873d261d7d81d398c118f2 100644 (file)
@@ -56,14 +56,14 @@ EXPORT_SYMBOL(panic_blink);
  *
  *     This function never returns.
  */
+
 NORET_TYPE void panic(const char * fmt, ...)
 {
        long i;
        static char buf[1024];
        va_list args;
 #if defined(CONFIG_S390)
-        unsigned long caller = (unsigned long) __builtin_return_address(0);
+       unsigned long caller = (unsigned long) __builtin_return_address(0);
 #endif
 
        /*
@@ -128,7 +128,7 @@ NORET_TYPE void panic(const char * fmt, ...)
        }
 #endif
 #if defined(CONFIG_S390)
-        disabled_wait(caller);
+       disabled_wait(caller);
 #endif
        local_irq_enable();
        for (i = 0;;) {
@@ -154,7 +154,7 @@ EXPORT_SYMBOL(panic);
  *
  *     The string is overwritten by the next call to print_taint().
  */
+
 const char *print_tainted(void)
 {
        static char buf[20];
@@ -164,7 +164,7 @@ const char *print_tainted(void)
                        tainted & TAINT_FORCED_MODULE ? 'F' : ' ',
                        tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
                        tainted & TAINT_FORCED_RMMOD ? 'R' : ' ',
-                       tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
+                       tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
                        tainted & TAINT_BAD_PAGE ? 'B' : ' ',
                        tainted & TAINT_USER ? 'U' : ' ',
                        tainted & TAINT_DIE ? 'D' : ' ');
index 1d6aca288cdcb078ed5a3a6790d9f532f98d8f88..16f269e9ddc9b7d4ed129f98f0deac4965b87507 100644 (file)
@@ -592,11 +592,17 @@ static void __init param_sysfs_builtin(void)
 
        for (i=0; i < __stop___param - __start___param; i++) {
                char *dot;
+               size_t kplen;
 
                kp = &__start___param[i];
+               kplen = strlen(kp->name);
 
                /* We do not handle args without periods. */
-               dot = memchr(kp->name, '.', MAX_KBUILD_MODNAME);
+               if (kplen > MAX_KBUILD_MODNAME) {
+                       DEBUGP("kernel parameter name is too long: %s\n", kp->name);
+                       continue;
+               }
+               dot = memchr(kp->name, '.', kplen);
                if (!dot) {
                        DEBUGP("couldn't find period in %s\n", kp->name);
                        continue;
index d71ed09fe1dddd985e79f882ff30dd26bf1d28a2..d11f579d189a1b75f753addcdfba961f7561b74b 100644 (file)
@@ -981,9 +981,20 @@ sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp)
 static int common_nsleep(const clockid_t which_clock, int flags,
                         struct timespec *tsave, struct timespec __user *rmtp)
 {
-       return hrtimer_nanosleep(tsave, rmtp, flags & TIMER_ABSTIME ?
-                                HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
-                                which_clock);
+       struct timespec rmt;
+       int ret;
+
+       ret = hrtimer_nanosleep(tsave, rmtp ? &rmt : NULL,
+                               flags & TIMER_ABSTIME ?
+                               HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
+                               which_clock);
+
+       if (ret && rmtp) {
+               if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
+                       return -EFAULT;
+       }
+
+       return ret;
 }
 
 asmlinkage long
index 14b0e10dc95c6a8a1b305f212e2300574120f16f..8e186c678149e23581969a7acfca814a00295b95 100644 (file)
@@ -44,17 +44,6 @@ config PM_VERBOSE
        ---help---
        This option enables verbose messages from the Power Management code.
 
-config DISABLE_CONSOLE_SUSPEND
-       bool "Keep console(s) enabled during suspend/resume (DANGEROUS)"
-       depends on PM_DEBUG && PM_SLEEP
-       default n
-       ---help---
-       This option turns off the console suspend mechanism that prevents
-       debug messages from reaching the console during the suspend/resume
-       operations.  This may be helpful when debugging device drivers'
-       suspend/resume routines, but may itself lead to problems, for example
-       if netconsole is used.
-
 config PM_TRACE
        bool "Suspend/resume event tracing"
        depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL
index eb72255b5c86049d1c31f0c9d6ca09b5b653fdca..8b15f777010a9daefe2361adfbf5c1c0851dfb75 100644 (file)
@@ -45,17 +45,18 @@ enum {
 
 static int hibernation_mode = HIBERNATION_SHUTDOWN;
 
-static struct hibernation_ops *hibernation_ops;
+static struct platform_hibernation_ops *hibernation_ops;
 
 /**
  * hibernation_set_ops - set the global hibernate operations
  * @ops: the hibernation operations to use in subsequent hibernation transitions
  */
 
-void hibernation_set_ops(struct hibernation_ops *ops)
+void hibernation_set_ops(struct platform_hibernation_ops *ops)
 {
-       if (ops && !(ops->prepare && ops->enter && ops->finish
-           && ops->pre_restore && ops->restore_cleanup)) {
+       if (ops && !(ops->start && ops->pre_snapshot && ops->finish
+           && ops->prepare && ops->enter && ops->pre_restore
+           && ops->restore_cleanup)) {
                WARN_ON(1);
                return;
        }
@@ -69,16 +70,37 @@ void hibernation_set_ops(struct hibernation_ops *ops)
        mutex_unlock(&pm_mutex);
 }
 
+/**
+ *     platform_start - tell the platform driver that we're starting
+ *     hibernation
+ */
+
+static int platform_start(int platform_mode)
+{
+       return (platform_mode && hibernation_ops) ?
+               hibernation_ops->start() : 0;
+}
 
 /**
- *     platform_prepare - prepare the machine for hibernation using the
+ *     platform_pre_snapshot - prepare the machine for hibernation using the
  *     platform driver if so configured and return an error code if it fails
  */
 
-static int platform_prepare(int platform_mode)
+static int platform_pre_snapshot(int platform_mode)
 {
        return (platform_mode && hibernation_ops) ?
-               hibernation_ops->prepare() : 0;
+               hibernation_ops->pre_snapshot() : 0;
+}
+
+/**
+ *     platform_leave - prepare the machine for switching to the normal mode
+ *     of operation using the platform driver (called with interrupts disabled)
+ */
+
+static void platform_leave(int platform_mode)
+{
+       if (platform_mode && hibernation_ops)
+               hibernation_ops->leave();
 }
 
 /**
@@ -117,6 +139,51 @@ static void platform_restore_cleanup(int platform_mode)
                hibernation_ops->restore_cleanup();
 }
 
+/**
+ *     create_image - freeze devices that need to be frozen with interrupts
+ *     off, create the hibernation image and thaw those devices.  Control
+ *     reappears in this routine after a restore.
+ */
+
+int create_image(int platform_mode)
+{
+       int error;
+
+       error = arch_prepare_suspend();
+       if (error)
+               return error;
+
+       local_irq_disable();
+       /* At this point, device_suspend() has been called, but *not*
+        * device_power_down(). We *must* call device_power_down() now.
+        * Otherwise, drivers for some devices (e.g. interrupt controllers)
+        * become desynchronized with the actual state of the hardware
+        * at resume time, and evil weirdness ensues.
+        */
+       error = device_power_down(PMSG_FREEZE);
+       if (error) {
+               printk(KERN_ERR "Some devices failed to power down, "
+                       KERN_ERR "aborting suspend\n");
+               goto Enable_irqs;
+       }
+
+       save_processor_state();
+       error = swsusp_arch_suspend();
+       if (error)
+               printk(KERN_ERR "Error %d while creating the image\n", error);
+       /* Restore control flow magically appears here */
+       restore_processor_state();
+       if (!in_suspend)
+               platform_leave(platform_mode);
+       /* NOTE:  device_power_up() is just a resume() for devices
+        * that suspended with irqs off ... no overall powerup.
+        */
+       device_power_up();
+ Enable_irqs:
+       local_irq_enable();
+       return error;
+}
+
 /**
  *     hibernation_snapshot - quiesce devices and create the hibernation
  *     snapshot image.
@@ -135,12 +202,16 @@ int hibernation_snapshot(int platform_mode)
        if (error)
                return error;
 
+       error = platform_start(platform_mode);
+       if (error)
+               return error;
+
        suspend_console();
        error = device_suspend(PMSG_FREEZE);
        if (error)
                goto Resume_console;
 
-       error = platform_prepare(platform_mode);
+       error = platform_pre_snapshot(platform_mode);
        if (error)
                goto Resume_devices;
 
@@ -148,7 +219,7 @@ int hibernation_snapshot(int platform_mode)
        if (!error) {
                if (hibernation_mode != HIBERNATION_TEST) {
                        in_suspend = 1;
-                       error = swsusp_suspend();
+                       error = create_image(platform_mode);
                        /* Control returns here after successful restore */
                } else {
                        printk("swsusp debug: Waiting for 5 seconds.\n");
@@ -207,21 +278,50 @@ int hibernation_platform_enter(void)
 {
        int error;
 
-       if (hibernation_ops) {
-               kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
-               /*
-                * We have cancelled the power transition by running
-                * hibernation_ops->finish() before saving the image, so we
-                * should let the firmware know that we're going to enter the
-                * sleep state after all
-                */
-               error = hibernation_ops->prepare();
-               sysdev_shutdown();
-               if (!error)
-                       error = hibernation_ops->enter();
-       } else {
-               error = -ENOSYS;
+       if (!hibernation_ops)
+               return -ENOSYS;
+
+       /*
+        * We have cancelled the power transition by running
+        * hibernation_ops->finish() before saving the image, so we should let
+        * the firmware know that we're going to enter the sleep state after all
+        */
+       error = hibernation_ops->start();
+       if (error)
+               return error;
+
+       suspend_console();
+       error = device_suspend(PMSG_SUSPEND);
+       if (error)
+               goto Resume_console;
+
+       error = hibernation_ops->prepare();
+       if (error)
+               goto Resume_devices;
+
+       error = disable_nonboot_cpus();
+       if (error)
+               goto Finish;
+
+       local_irq_disable();
+       error = device_power_down(PMSG_SUSPEND);
+       if (!error) {
+               hibernation_ops->enter();
+               /* We should never get here */
+               while (1);
        }
+       local_irq_enable();
+
+       /*
+        * We don't need to reenable the nonboot CPUs or resume consoles, since
+        * the system is going to be halted anyway.
+        */
+ Finish:
+       hibernation_ops->finish();
+ Resume_devices:
+       device_resume();
+ Resume_console:
+       resume_console();
        return error;
 }
 
@@ -238,14 +338,14 @@ static void power_down(void)
        case HIBERNATION_TEST:
        case HIBERNATION_TESTPROC:
                break;
-       case HIBERNATION_SHUTDOWN:
-               kernel_power_off();
-               break;
        case HIBERNATION_REBOOT:
                kernel_restart(NULL);
                break;
        case HIBERNATION_PLATFORM:
                hibernation_platform_enter();
+       case HIBERNATION_SHUTDOWN:
+               kernel_power_off();
+               break;
        }
        kernel_halt();
        /*
@@ -298,6 +398,10 @@ int hibernate(void)
        if (error)
                goto Exit;
 
+       printk("Syncing filesystems ... ");
+       sys_sync();
+       printk("done.\n");
+
        error = prepare_processes();
        if (error)
                goto Finish;
index 350b485b3b60bdc7679cbd9963ef4ba4b64ed4f3..3cdf95b1dc92af97e13e8a6c68c4e0a6f8d42153 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/resume-trace.h>
 #include <linux/freezer.h>
 #include <linux/vmstat.h>
+#include <linux/syscalls.h>
 
 #include "power.h"
 
@@ -32,39 +33,32 @@ DEFINE_MUTEX(pm_mutex);
 /* This is just an arbitrary number */
 #define FREE_PAGE_NUMBER (100)
 
-struct pm_ops *pm_ops;
+static struct platform_suspend_ops *suspend_ops;
 
 /**
- *     pm_set_ops - Set the global power method table. 
+ *     suspend_set_ops - Set the global suspend method table.
  *     @ops:   Pointer to ops structure.
  */
 
-void pm_set_ops(struct pm_ops * ops)
+void suspend_set_ops(struct platform_suspend_ops *ops)
 {
        mutex_lock(&pm_mutex);
-       pm_ops = ops;
+       suspend_ops = ops;
        mutex_unlock(&pm_mutex);
 }
 
 /**
- * pm_valid_only_mem - generic memory-only valid callback
+ * suspend_valid_only_mem - generic memory-only valid callback
  *
- * pm_ops drivers that implement mem suspend only and only need
+ * Platform drivers that implement mem suspend only and only need
  * to check for that in their .valid callback can use this instead
  * of rolling their own .valid callback.
  */
-int pm_valid_only_mem(suspend_state_t state)
+int suspend_valid_only_mem(suspend_state_t state)
 {
        return state == PM_SUSPEND_MEM;
 }
 
-
-static inline void pm_finish(suspend_state_t state)
-{
-       if (pm_ops->finish)
-               pm_ops->finish(state);
-}
-
 /**
  *     suspend_prepare - Do prep work before entering low-power state.
  *
@@ -76,7 +70,7 @@ static int suspend_prepare(void)
        int error;
        unsigned int free_pages;
 
-       if (!pm_ops || !pm_ops->enter)
+       if (!suspend_ops || !suspend_ops->enter)
                return -EPERM;
 
        error = pm_notifier_call_chain(PM_SUSPEND_PREPARE);
@@ -128,7 +122,7 @@ void __attribute__ ((weak)) arch_suspend_enable_irqs(void)
  *
  *     This function should be called after devices have been suspended.
  */
-int suspend_enter(suspend_state_t state)
+static int suspend_enter(suspend_state_t state)
 {
        int error = 0;
 
@@ -139,7 +133,7 @@ int suspend_enter(suspend_state_t state)
                printk(KERN_ERR "Some devices failed to power down\n");
                goto Done;
        }
-       error = pm_ops->enter(state);
+       error = suspend_ops->enter(state);
        device_power_up();
  Done:
        arch_suspend_enable_irqs();
@@ -156,11 +150,11 @@ int suspend_devices_and_enter(suspend_state_t state)
 {
        int error;
 
-       if (!pm_ops)
+       if (!suspend_ops)
                return -ENOSYS;
 
-       if (pm_ops->set_target) {
-               error = pm_ops->set_target(state);
+       if (suspend_ops->set_target) {
+               error = suspend_ops->set_target(state);
                if (error)
                        return error;
        }
@@ -170,8 +164,8 @@ int suspend_devices_and_enter(suspend_state_t state)
                printk(KERN_ERR "Some devices failed to suspend\n");
                goto Resume_console;
        }
-       if (pm_ops->prepare) {
-               error = pm_ops->prepare(state);
+       if (suspend_ops->prepare) {
+               error = suspend_ops->prepare();
                if (error)
                        goto Resume_devices;
        }
@@ -180,7 +174,8 @@ int suspend_devices_and_enter(suspend_state_t state)
                suspend_enter(state);
 
        enable_nonboot_cpus();
-       pm_finish(state);
+       if (suspend_ops->finish)
+               suspend_ops->finish();
  Resume_devices:
        device_resume();
  Resume_console:
@@ -214,7 +209,7 @@ static inline int valid_state(suspend_state_t state)
        /* All states need lowlevel support and need to be valid
         * to the lowlevel implementation, no valid callback
         * implies that none are valid. */
-       if (!pm_ops || !pm_ops->valid || !pm_ops->valid(state))
+       if (!suspend_ops || !suspend_ops->valid || !suspend_ops->valid(state))
                return 0;
        return 1;
 }
@@ -236,9 +231,14 @@ static int enter_state(suspend_state_t state)
 
        if (!valid_state(state))
                return -ENODEV;
+
        if (!mutex_trylock(&pm_mutex))
                return -EBUSY;
 
+       printk("Syncing filesystems ... ");
+       sys_sync();
+       printk("done.\n");
+
        pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
        if ((error = suspend_prepare()))
                goto Unlock;
index 95fbf2dd3fe33901be99ef8ce60a3bf2ca9fb833..195dc4611764b08a65780976a6231aaf004889fe 100644 (file)
@@ -11,14 +11,32 @@ struct swsusp_info {
        unsigned long           size;
 } __attribute__((aligned(PAGE_SIZE)));
 
+#ifdef CONFIG_HIBERNATION
+#ifdef CONFIG_ARCH_HIBERNATION_HEADER
+/* Maximum size of architecture specific data in a hibernation header */
+#define MAX_ARCH_HEADER_SIZE   (sizeof(struct new_utsname) + 4)
 
+extern int arch_hibernation_header_save(void *addr, unsigned int max_size);
+extern int arch_hibernation_header_restore(void *addr);
+
+static inline int init_header_complete(struct swsusp_info *info)
+{
+       return arch_hibernation_header_save(info, MAX_ARCH_HEADER_SIZE);
+}
+
+static inline char *check_image_kernel(struct swsusp_info *info)
+{
+       return arch_hibernation_header_restore(info) ?
+                       "architecture specific data" : NULL;
+}
+#endif /* CONFIG_ARCH_HIBERNATION_HEADER */
 
-#ifdef CONFIG_HIBERNATION
 /*
  * Keep some memory free so that I/O operations can succeed without paging
  * [Might this be more than 4 MB?]
  */
 #define PAGES_FOR_IO   ((4096 * 1024) >> PAGE_SHIFT)
+
 /*
  * Keep 1 MB of memory free so that device drivers can allocate some pages in
  * their .suspend() routines without breaking the suspend to disk.
@@ -165,7 +183,6 @@ extern int swsusp_swap_in_use(void);
 extern int swsusp_check(void);
 extern int swsusp_shrink_memory(void);
 extern void swsusp_free(void);
-extern int swsusp_suspend(void);
 extern int swsusp_resume(void);
 extern int swsusp_read(unsigned int *flags_p);
 extern int swsusp_write(unsigned int flags);
index 3434940a3df175679e4391f94755f09431c864c1..6533923e711b5dd8be01efd5f1e9576250ebf42f 100644 (file)
@@ -75,21 +75,79 @@ void refrigerator(void)
        __set_current_state(save);
 }
 
-static void freeze_task(struct task_struct *p)
+static void fake_signal_wake_up(struct task_struct *p, int resume)
 {
        unsigned long flags;
 
-       if (!freezing(p)) {
+       spin_lock_irqsave(&p->sighand->siglock, flags);
+       signal_wake_up(p, resume);
+       spin_unlock_irqrestore(&p->sighand->siglock, flags);
+}
+
+static void send_fake_signal(struct task_struct *p)
+{
+       if (p->state == TASK_STOPPED)
+               force_sig_specific(SIGSTOP, p);
+       fake_signal_wake_up(p, p->state == TASK_STOPPED);
+}
+
+static int has_mm(struct task_struct *p)
+{
+       return (p->mm && !(p->flags & PF_BORROWED_MM));
+}
+
+/**
+ *     freeze_task - send a freeze request to given task
+ *     @p: task to send the request to
+ *     @with_mm_only: if set, the request will only be sent if the task has its
+ *             own mm
+ *     Return value: 0, if @with_mm_only is set and the task has no mm of its
+ *             own or the task is frozen, 1, otherwise
+ *
+ *     The freeze request is sent by seting the tasks's TIF_FREEZE flag and
+ *     either sending a fake signal to it or waking it up, depending on whether
+ *     or not it has its own mm (ie. it is a user land task).  If @with_mm_only
+ *     is set and the task has no mm of its own (ie. it is a kernel thread),
+ *     its TIF_FREEZE flag should not be set.
+ *
+ *     The task_lock() is necessary to prevent races with exit_mm() or
+ *     use_mm()/unuse_mm() from occuring.
+ */
+static int freeze_task(struct task_struct *p, int with_mm_only)
+{
+       int ret = 1;
+
+       task_lock(p);
+       if (freezing(p)) {
+               if (has_mm(p)) {
+                       if (!signal_pending(p))
+                               fake_signal_wake_up(p, 0);
+               } else {
+                       if (with_mm_only)
+                               ret = 0;
+                       else
+                               wake_up_state(p, TASK_INTERRUPTIBLE);
+               }
+       } else {
                rmb();
-               if (!frozen(p)) {
-                       set_freeze_flag(p);
-                       if (p->state == TASK_STOPPED)
-                               force_sig_specific(SIGSTOP, p);
-                       spin_lock_irqsave(&p->sighand->siglock, flags);
-                       signal_wake_up(p, p->state == TASK_STOPPED);
-                       spin_unlock_irqrestore(&p->sighand->siglock, flags);
+               if (frozen(p)) {
+                       ret = 0;
+               } else {
+                       if (has_mm(p)) {
+                               set_freeze_flag(p);
+                               send_fake_signal(p);
+                       } else {
+                               if (with_mm_only) {
+                                       ret = 0;
+                               } else {
+                                       set_freeze_flag(p);
+                                       wake_up_state(p, TASK_INTERRUPTIBLE);
+                               }
+                       }
                }
        }
+       task_unlock(p);
+       return ret;
 }
 
 static void cancel_freezing(struct task_struct *p)
@@ -110,6 +168,11 @@ static int try_to_freeze_tasks(int freeze_user_space)
        struct task_struct *g, *p;
        unsigned long end_time;
        unsigned int todo;
+       struct timeval start, end;
+       s64 elapsed_csecs64;
+       unsigned int elapsed_csecs;
+
+       do_gettimeofday(&start);
 
        end_time = jiffies + TIMEOUT;
        do {
@@ -119,31 +182,14 @@ static int try_to_freeze_tasks(int freeze_user_space)
                        if (frozen(p) || !freezeable(p))
                                continue;
 
-                       if (freeze_user_space) {
-                               if (p->state == TASK_TRACED &&
-                                   frozen(p->parent)) {
-                                       cancel_freezing(p);
-                                       continue;
-                               }
-                               /*
-                                * Kernel threads should not have TIF_FREEZE set
-                                * at this point, so we must ensure that either
-                                * p->mm is not NULL *and* PF_BORROWED_MM is
-                                * unset, or TIF_FRREZE is left unset.
-                                * The task_lock() is necessary to prevent races
-                                * with exit_mm() or use_mm()/unuse_mm() from
-                                * occuring.
-                                */
-                               task_lock(p);
-                               if (!p->mm || (p->flags & PF_BORROWED_MM)) {
-                                       task_unlock(p);
-                                       continue;
-                               }
-                               freeze_task(p);
-                               task_unlock(p);
-                       } else {
-                               freeze_task(p);
+                       if (p->state == TASK_TRACED && frozen(p->parent)) {
+                               cancel_freezing(p);
+                               continue;
                        }
+
+                       if (!freeze_task(p, freeze_user_space))
+                               continue;
+
                        if (!freezer_should_skip(p))
                                todo++;
                } while_each_thread(g, p);
@@ -153,6 +199,11 @@ static int try_to_freeze_tasks(int freeze_user_space)
                        break;
        } while (todo);
 
+       do_gettimeofday(&end);
+       elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
+       do_div(elapsed_csecs64, NSEC_PER_SEC / 100);
+       elapsed_csecs = elapsed_csecs64;
+
        if (todo) {
                /* This does not unfreeze processes that are already frozen
                 * (we have slightly ugly calling convention in that respect,
@@ -160,10 +211,9 @@ static int try_to_freeze_tasks(int freeze_user_space)
                 * but it cleans up leftover PF_FREEZE requests.
                 */
                printk("\n");
-               printk(KERN_ERR "Freezing of %s timed out after %d seconds "
+               printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds "
                                "(%d tasks refusing to freeze):\n",
-                               freeze_user_space ? "user space " : "tasks ",
-                               TIMEOUT / HZ, todo);
+                               elapsed_csecs / 100, elapsed_csecs % 100, todo);
                show_state();
                read_lock(&tasklist_lock);
                do_each_thread(g, p) {
@@ -174,6 +224,9 @@ static int try_to_freeze_tasks(int freeze_user_space)
                        task_unlock(p);
                } while_each_thread(g, p);
                read_unlock(&tasklist_lock);
+       } else {
+               printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
+                       elapsed_csecs % 100);
        }
 
        return todo ? -EBUSY : 0;
@@ -186,19 +239,21 @@ int freeze_processes(void)
 {
        int error;
 
-       printk("Stopping tasks ... ");
+       printk("Freezing user space processes ... ");
        error = try_to_freeze_tasks(FREEZER_USER_SPACE);
        if (error)
-               return error;
+               goto Exit;
+       printk("done.\n");
 
-       sys_sync();
+       printk("Freezing remaining freezable tasks ... ");
        error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
        if (error)
-               return error;
-
-       printk("done.\n");
+               goto Exit;
+       printk("done.");
+ Exit:
        BUG_ON(in_atomic());
-       return 0;
+       printk("\n");
+       return error;
 }
 
 static void thaw_tasks(int thaw_user_space)
index a686590d88c1b5def265e84aa9ab9091c4b07290..ccc95ac07bedbc8cbfed19b06a3eca9848b11723 100644 (file)
@@ -1239,17 +1239,39 @@ asmlinkage int swsusp_save(void)
        return 0;
 }
 
-static void init_header(struct swsusp_info *info)
+#ifndef CONFIG_ARCH_HIBERNATION_HEADER
+static int init_header_complete(struct swsusp_info *info)
 {
-       memset(info, 0, sizeof(struct swsusp_info));
+       memcpy(&info->uts, init_utsname(), sizeof(struct new_utsname));
        info->version_code = LINUX_VERSION_CODE;
+       return 0;
+}
+
+static char *check_image_kernel(struct swsusp_info *info)
+{
+       if (info->version_code != LINUX_VERSION_CODE)
+               return "kernel version";
+       if (strcmp(info->uts.sysname,init_utsname()->sysname))
+               return "system type";
+       if (strcmp(info->uts.release,init_utsname()->release))
+               return "kernel release";
+       if (strcmp(info->uts.version,init_utsname()->version))
+               return "version";
+       if (strcmp(info->uts.machine,init_utsname()->machine))
+               return "machine";
+       return NULL;
+}
+#endif /* CONFIG_ARCH_HIBERNATION_HEADER */
+
+static int init_header(struct swsusp_info *info)
+{
+       memset(info, 0, sizeof(struct swsusp_info));
        info->num_physpages = num_physpages;
-       memcpy(&info->uts, init_utsname(), sizeof(struct new_utsname));
-       info->cpus = num_online_cpus();
        info->image_pages = nr_copy_pages;
        info->pages = nr_copy_pages + nr_meta_pages + 1;
        info->size = info->pages;
        info->size <<= PAGE_SHIFT;
+       return init_header_complete(info);
 }
 
 /**
@@ -1303,7 +1325,11 @@ int snapshot_read_next(struct snapshot_handle *handle, size_t count)
                        return -ENOMEM;
        }
        if (!handle->offset) {
-               init_header((struct swsusp_info *)buffer);
+               int error;
+
+               error = init_header((struct swsusp_info *)buffer);
+               if (error)
+                       return error;
                handle->buffer = buffer;
                memory_bm_position_reset(&orig_bm);
                memory_bm_position_reset(&copy_bm);
@@ -1394,22 +1420,13 @@ duplicate_memory_bitmap(struct memory_bitmap *dst, struct memory_bitmap *src)
        }
 }
 
-static inline int check_header(struct swsusp_info *info)
+static int check_header(struct swsusp_info *info)
 {
-       char *reason = NULL;
+       char *reason;
 
-       if (info->version_code != LINUX_VERSION_CODE)
-               reason = "kernel version";
-       if (info->num_physpages != num_physpages)
+       reason = check_image_kernel(info);
+       if (!reason && info->num_physpages != num_physpages)
                reason = "memory size";
-       if (strcmp(info->uts.sysname,init_utsname()->sysname))
-               reason = "system type";
-       if (strcmp(info->uts.release,init_utsname()->release))
-               reason = "kernel release";
-       if (strcmp(info->uts.version,init_utsname()->version))
-               reason = "version";
-       if (strcmp(info->uts.machine,init_utsname()->machine))
-               reason = "machine";
        if (reason) {
                printk(KERN_ERR "swsusp: Resume mismatch: %s\n", reason);
                return -EPERM;
index 5da304c8f1f66473233d68d713a66e2a17c59d54..e1722d3155f17057284ab6374b3a00b9a31ed1d2 100644 (file)
@@ -270,39 +270,6 @@ int swsusp_shrink_memory(void)
        return 0;
 }
 
-int swsusp_suspend(void)
-{
-       int error;
-
-       if ((error = arch_prepare_suspend()))
-               return error;
-
-       local_irq_disable();
-       /* At this point, device_suspend() has been called, but *not*
-        * device_power_down(). We *must* device_power_down() now.
-        * Otherwise, drivers for some devices (e.g. interrupt controllers)
-        * become desynchronized with the actual state of the hardware
-        * at resume time, and evil weirdness ensues.
-        */
-       if ((error = device_power_down(PMSG_FREEZE))) {
-               printk(KERN_ERR "Some devices failed to power down, aborting suspend\n");
-               goto Enable_irqs;
-       }
-
-       save_processor_state();
-       if ((error = swsusp_arch_suspend()))
-               printk(KERN_ERR "Error %d suspending\n", error);
-       /* Restore control flow magically appears here */
-       restore_processor_state();
-       /* NOTE:  device_power_up() is just a resume() for devices
-        * that suspended with irqs off ... no overall powerup.
-        */
-       device_power_up();
- Enable_irqs:
-       local_irq_enable();
-       return error;
-}
-
 int swsusp_resume(void)
 {
        int error;
index bd0723a7df3f99cf811834f9cc1d107202d46947..5bd321bcbb75f06031d6ede749cad599c251373c 100644 (file)
@@ -153,6 +153,10 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
                mutex_lock(&pm_mutex);
                error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
                if (!error) {
+                       printk("Syncing filesystems ... ");
+                       sys_sync();
+                       printk("done.\n");
+
                        error = freeze_processes();
                        if (error)
                                thaw_processes();
index 52493474f0abafdfd7939ab57f3f2d6ad2006695..a30fe33de395a7964f68e237c73de7344190b18a 100644 (file)
@@ -862,7 +862,16 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha
        return -1;
 }
 
-#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
+int console_suspend_enabled = 1;
+EXPORT_SYMBOL(console_suspend_enabled);
+
+static int __init console_suspend_disable(char *str)
+{
+       console_suspend_enabled = 0;
+       return 1;
+}
+__setup("no_console_suspend", console_suspend_disable);
+
 /**
  * suspend_console - suspend the console subsystem
  *
@@ -870,6 +879,8 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha
  */
 void suspend_console(void)
 {
+       if (!console_suspend_enabled)
+               return;
        printk("Suspending console(s)\n");
        acquire_console_sem();
        console_suspended = 1;
@@ -877,10 +888,11 @@ void suspend_console(void)
 
 void resume_console(void)
 {
+       if (!console_suspend_enabled)
+               return;
        console_suspended = 0;
        release_console_sem();
 }
-#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
 
 /**
  * acquire_console_sem - lock the console system for exclusive use.
index ad855017bc59de72ebf592fda7576edf6e245bb4..61134eb7a0c8a9b2d2e0557b33ff4fbd7ff96f31 100644 (file)
@@ -370,7 +370,7 @@ void relay_reset(struct rchan *chan)
        if (!chan)
                return;
 
-       if (chan->is_global && chan->buf[0]) {
+       if (chan->is_global && chan->buf[0]) {
                __relay_reset(chan->buf[0], 0);
                return;
        }
@@ -850,13 +850,13 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos)
                buf->subbufs_consumed = consumed;
                buf->bytes_consumed = 0;
        }
-       
+
        produced = (produced % n_subbufs) * subbuf_size + buf->offset;
        consumed = (consumed % n_subbufs) * subbuf_size + buf->bytes_consumed;
 
        if (consumed > produced)
                produced += n_subbufs * subbuf_size;
-       
+
        if (consumed == produced)
                return 0;
 
index 92721d1534b85f1e2f3b192b041677b50b79b9e9..ed90be46fb31a3a3a98fb0ef92e4fff8a1dedcfc 100644 (file)
@@ -266,7 +266,8 @@ struct rt_rq {
  * acquire operations must be ordered by ascending &runqueue.
  */
 struct rq {
-       spinlock_t lock;        /* runqueue lock */
+       /* runqueue lock: */
+       spinlock_t lock;
 
        /*
         * nr_running and cpu_load should be in the same cacheline because
@@ -279,13 +280,15 @@ struct rq {
 #ifdef CONFIG_NO_HZ
        unsigned char in_nohz_recently;
 #endif
-       struct load_weight load;        /* capture load from *all* tasks on this cpu */
+       /* capture load from *all* tasks on this cpu: */
+       struct load_weight load;
        unsigned long nr_load_updates;
        u64 nr_switches;
 
        struct cfs_rq cfs;
 #ifdef CONFIG_FAIR_GROUP_SCHED
-       struct list_head leaf_cfs_rq_list; /* list of leaf cfs_rq on this cpu */
+       /* list of leaf cfs_rq on this cpu: */
+       struct list_head leaf_cfs_rq_list;
 #endif
        struct rt_rq  rt;
 
@@ -317,7 +320,8 @@ struct rq {
        /* For active balancing */
        int active_balance;
        int push_cpu;
-       int cpu;                /* cpu of this runqueue */
+       /* cpu of this runqueue: */
+       int cpu;
 
        struct task_struct *migration_thread;
        struct list_head migration_queue;
@@ -328,22 +332,22 @@ struct rq {
        struct sched_info rq_sched_info;
 
        /* sys_sched_yield() stats */
-       unsigned long yld_exp_empty;
-       unsigned long yld_act_empty;
-       unsigned long yld_both_empty;
-       unsigned long yld_count;
+       unsigned int yld_exp_empty;
+       unsigned int yld_act_empty;
+       unsigned int yld_both_empty;
+       unsigned int yld_count;
 
        /* schedule() stats */
-       unsigned long sched_switch;
-       unsigned long sched_count;
-       unsigned long sched_goidle;
+       unsigned int sched_switch;
+       unsigned int sched_count;
+       unsigned int sched_goidle;
 
        /* try_to_wake_up() stats */
-       unsigned long ttwu_count;
-       unsigned long ttwu_local;
+       unsigned int ttwu_count;
+       unsigned int ttwu_local;
 
        /* BKL stats */
-       unsigned long bkl_count;
+       unsigned int bkl_count;
 #endif
        struct lock_class_key rq_lock_key;
 };
@@ -449,12 +453,12 @@ enum {
 };
 
 const_debug unsigned int sysctl_sched_features =
-               SCHED_FEAT_NEW_FAIR_SLEEPERS    *1 |
-               SCHED_FEAT_START_DEBIT          *1 |
-               SCHED_FEAT_TREE_AVG             *0 |
-               SCHED_FEAT_APPROX_AVG           *0 |
-               SCHED_FEAT_WAKEUP_PREEMPT       *1 |
-               SCHED_FEAT_PREEMPT_RESTRICT     *1;
+               SCHED_FEAT_NEW_FAIR_SLEEPERS    * 1 |
+               SCHED_FEAT_START_DEBIT          * 1 |
+               SCHED_FEAT_TREE_AVG             * 0 |
+               SCHED_FEAT_APPROX_AVG           * 0 |
+               SCHED_FEAT_WAKEUP_PREEMPT       * 1 |
+               SCHED_FEAT_PREEMPT_RESTRICT     * 1;
 
 #define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x)
 
@@ -3333,6 +3337,16 @@ void account_guest_time(struct task_struct *p, cputime_t cputime)
        cpustat->guest = cputime64_add(cpustat->guest, tmp);
 }
 
+/*
+ * Account scaled user cpu time to a process.
+ * @p: the process that the cpu time gets accounted to
+ * @cputime: the cpu time spent in user space since the last update
+ */
+void account_user_time_scaled(struct task_struct *p, cputime_t cputime)
+{
+       p->utimescaled = cputime_add(p->utimescaled, cputime);
+}
+
 /*
  * Account system cpu time to a process.
  * @p: the process that the cpu time gets accounted to
@@ -3370,6 +3384,17 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
        acct_update_integrals(p);
 }
 
+/*
+ * Account scaled system cpu time to a process.
+ * @p: the process that the cpu time gets accounted to
+ * @hardirq_offset: the offset to subtract from hardirq_count()
+ * @cputime: the cpu time spent in kernel space since the last update
+ */
+void account_system_time_scaled(struct task_struct *p, cputime_t cputime)
+{
+       p->stimescaled = cputime_add(p->stimescaled, cputime);
+}
+
 /*
  * Account for involuntary wait time.
  * @p: the process from which the cpu time has been stolen
@@ -3859,7 +3884,10 @@ EXPORT_SYMBOL(wait_for_completion_timeout);
 
 int __sched wait_for_completion_interruptible(struct completion *x)
 {
-       return wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
+       long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
+       if (t == -ERESTARTSYS)
+               return t;
+       return 0;
 }
 EXPORT_SYMBOL(wait_for_completion_interruptible);
 
@@ -4794,18 +4822,18 @@ static void show_task(struct task_struct *p)
        unsigned state;
 
        state = p->state ? __ffs(p->state) + 1 : 0;
-       printk("%-13.13s %c", p->comm,
+       printk(KERN_INFO "%-13.13s %c", p->comm,
                state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
 #if BITS_PER_LONG == 32
        if (state == TASK_RUNNING)
-               printk(" running  ");
+               printk(KERN_CONT " running  ");
        else
-               printk(" %08lx ", thread_saved_pc(p));
+               printk(KERN_CONT " %08lx ", thread_saved_pc(p));
 #else
        if (state == TASK_RUNNING)
-               printk("  running task    ");
+               printk(KERN_CONT "  running task    ");
        else
-               printk(" %016lx ", thread_saved_pc(p));
+               printk(KERN_CONT " %016lx ", thread_saved_pc(p));
 #endif
 #ifdef CONFIG_DEBUG_STACK_USAGE
        {
@@ -4815,7 +4843,7 @@ static void show_task(struct task_struct *p)
                free = (unsigned long)n - (unsigned long)end_of_stack(p);
        }
 #endif
-       printk("%5lu %5d %6d\n", free, p->pid, p->parent->pid);
+       printk(KERN_CONT "%5lu %5d %6d\n", free, p->pid, p->parent->pid);
 
        if (state != TASK_RUNNING)
                show_stack(p, NULL);
@@ -5364,7 +5392,7 @@ sd_alloc_ctl_domain_table(struct sched_domain *sd)
        return table;
 }
 
-static ctl_table *sd_alloc_ctl_cpu_table(int cpu)
+static ctl_table * sd_alloc_ctl_cpu_table(int cpu)
 {
        struct ctl_table *entry, *table;
        struct sched_domain *sd;
@@ -5598,20 +5626,20 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
                        }
 
                        if (!group->__cpu_power) {
-                               printk("\n");
+                               printk(KERN_CONT "\n");
                                printk(KERN_ERR "ERROR: domain->cpu_power not "
                                                "set\n");
                                break;
                        }
 
                        if (!cpus_weight(group->cpumask)) {
-                               printk("\n");
+                               printk(KERN_CONT "\n");
                                printk(KERN_ERR "ERROR: empty group\n");
                                break;
                        }
 
                        if (cpus_intersects(groupmask, group->cpumask)) {
-                               printk("\n");
+                               printk(KERN_CONT "\n");
                                printk(KERN_ERR "ERROR: repeated CPUs\n");
                                break;
                        }
@@ -5619,11 +5647,11 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
                        cpus_or(groupmask, groupmask, group->cpumask);
 
                        cpumask_scnprintf(str, NR_CPUS, group->cpumask);
-                       printk(" %s", str);
+                       printk(KERN_CONT " %s", str);
 
                        group = group->next;
                } while (group != sd->groups);
-               printk("\n");
+               printk(KERN_CONT "\n");
 
                if (!cpus_equal(sd->span, groupmask))
                        printk(KERN_ERR "ERROR: groups don't span "
index a5e517ec07c3dfa5e7b688b40355a9e4a67f13bc..e6fb392e51644b24ec063681a99fed402c65a3e5 100644 (file)
@@ -137,7 +137,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
        SEQ_printf(m, "  .%-30s: %ld\n", "nr_running", cfs_rq->nr_running);
        SEQ_printf(m, "  .%-30s: %ld\n", "load", cfs_rq->load.weight);
 #ifdef CONFIG_SCHEDSTATS
-       SEQ_printf(m, "  .%-30s: %ld\n", "bkl_count",
+       SEQ_printf(m, "  .%-30s: %d\n", "bkl_count",
                        rq->bkl_count);
 #endif
        SEQ_printf(m, "  .%-30s: %ld\n", "nr_spread_over",
index 1c084842c3e75517b7cbbdcb2f665b0dfe8f56dd..ef1a7df80ea21257ab141a3ef57142bad9ab47ae 100644 (file)
@@ -21,7 +21,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
 
                /* runqueue-specific stats */
                seq_printf(seq,
-                   "cpu%d %lu %lu %lu %lu %lu %lu %lu %lu %lu %llu %llu %lu",
+                   "cpu%d %u %u %u %u %u %u %u %u %u %llu %llu %lu",
                    cpu, rq->yld_both_empty,
                    rq->yld_act_empty, rq->yld_exp_empty, rq->yld_count,
                    rq->sched_switch, rq->sched_count, rq->sched_goidle,
@@ -42,8 +42,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
                        seq_printf(seq, "domain%d %s", dcount++, mask_str);
                        for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES;
                                        itype++) {
-                               seq_printf(seq, " %lu %lu %lu %lu %lu %lu %lu "
-                                               "%lu",
+                               seq_printf(seq, " %u %u %u %u %u %u %u %u",
                                    sd->lb_count[itype],
                                    sd->lb_balanced[itype],
                                    sd->lb_failed[itype],
@@ -53,8 +52,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
                                    sd->lb_nobusyq[itype],
                                    sd->lb_nobusyg[itype]);
                        }
-                       seq_printf(seq, " %lu %lu %lu %lu %lu %lu %lu %lu %lu"
-                           " %lu %lu %lu\n",
+                       seq_printf(seq, " %u %u %u %u %u %u %u %u %u %u %u %u\n",
                            sd->alb_count, sd->alb_failed, sd->alb_pushed,
                            sd->sbe_count, sd->sbe_balanced, sd->sbe_pushed,
                            sd->sbf_count, sd->sbf_balanced, sd->sbf_pushed,
index 2124ffadcfdefff5a6cf0fbc2da37c3ac19d8a44..e4f059cd9867df74d44949cf7d16be947ee7c9e8 100644 (file)
@@ -99,7 +99,6 @@ static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
 static int recalc_sigpending_tsk(struct task_struct *t)
 {
        if (t->signal->group_stop_count > 0 ||
-           (freezing(t)) ||
            PENDING(&t->pending, &t->blocked) ||
            PENDING(&t->signal->shared_pending, &t->blocked)) {
                set_tsk_thread_flag(t, TIF_SIGPENDING);
index 8ae2e636eb1ba690f9fd9cf0f363d5f677db80ac..bc8879c822a54444657df6b9c51a7dcf227e055e 100644 (file)
@@ -105,7 +105,6 @@ EXPORT_SYMBOL(cad_pid);
  */
 
 void (*pm_power_off_prepare)(void);
-EXPORT_SYMBOL(pm_power_off_prepare);
 
 /*
  *     Notifier list for kernel code which wants to be called
index dde3d53e8adc0fd8aabbf871d0b5c6751dfb9907..067554bda8b79ba3954f2dc653dfa4f25f98f09c 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
-#include <linux/capability.h>
+#include <linux/security.h>
 #include <linux/ctype.h>
 #include <linux/utsname.h>
 #include <linux/smp_lock.h>
@@ -55,6 +55,8 @@
 #include <asm/stacktrace.h>
 #endif
 
+static int deprecated_sysctl_warning(struct __sysctl_args *args);
+
 #if defined(CONFIG_SYSCTL)
 
 /* External variables not in a header file. */
@@ -142,32 +144,29 @@ extern int max_lock_depth;
 
 #ifdef CONFIG_SYSCTL_SYSCALL
 static int parse_table(int __user *, int, void __user *, size_t __user *,
-               void __user *, size_t, ctl_table *);
+               void __user *, size_t, struct ctl_table *);
 #endif
 
 
 #ifdef CONFIG_PROC_SYSCTL
-static int proc_do_cad_pid(ctl_table *table, int write, struct file *filp,
+static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos);
-static int proc_dointvec_taint(ctl_table *table, int write, struct file *filp,
+static int proc_dointvec_taint(struct ctl_table *table, int write, struct file *filp,
                               void __user *buffer, size_t *lenp, loff_t *ppos);
 #endif
 
-static ctl_table root_table[];
+static struct ctl_table root_table[];
 static struct ctl_table_header root_table_header =
        { root_table, LIST_HEAD_INIT(root_table_header.ctl_entry) };
 
-static ctl_table kern_table[];
-static ctl_table vm_table[];
-static ctl_table fs_table[];
-static ctl_table debug_table[];
-static ctl_table dev_table[];
-extern ctl_table random_table[];
-#ifdef CONFIG_UNIX98_PTYS
-extern ctl_table pty_table[];
-#endif
+static struct ctl_table kern_table[];
+static struct ctl_table vm_table[];
+static struct ctl_table fs_table[];
+static struct ctl_table debug_table[];
+static struct ctl_table dev_table[];
+extern struct ctl_table random_table[];
 #ifdef CONFIG_INOTIFY_USER
-extern ctl_table inotify_table[];
+extern struct ctl_table inotify_table[];
 #endif
 
 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
@@ -179,7 +178,7 @@ extern int lock_stat;
 
 /* The default sysctl tables: */
 
-static ctl_table root_table[] = {
+static struct ctl_table root_table[] = {
        {
                .ctl_name       = CTL_KERN,
                .procname       = "kernel",
@@ -232,7 +231,7 @@ static unsigned long min_wakeup_granularity_ns;                     /* 0 usecs */
 static unsigned long max_wakeup_granularity_ns = 1000000000;   /* 1 second */
 #endif
 
-static ctl_table kern_table[] = {
+static struct ctl_table kern_table[] = {
 #ifdef CONFIG_SCHED_DEBUG
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -365,7 +364,6 @@ static ctl_table kern_table[] = {
        },
 #ifdef CONFIG_PROC_SYSCTL
        {
-               .ctl_name       = KERN_TAINTED,
                .procname       = "tainted",
                .data           = &tainted,
                .maxlen         = sizeof(int),
@@ -373,14 +371,15 @@ static ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec_taint,
        },
 #endif
+#ifdef CONFIG_SECURITY_CAPABILITIES
        {
-               .ctl_name       = KERN_CAP_BSET,
                .procname       = "cap-bound",
                .data           = &cap_bset,
                .maxlen         = sizeof(kernel_cap_t),
                .mode           = 0600,
                .proc_handler   = &proc_dointvec_bset,
        },
+#endif /* def CONFIG_SECURITY_CAPABILITIES */
 #ifdef CONFIG_BLK_DEV_INITRD
        {
                .ctl_name       = KERN_REALROOTDEV,
@@ -514,7 +513,6 @@ static ctl_table kern_table[] = {
 #endif
 #ifdef CONFIG_PROC_SYSCTL
        {
-               .ctl_name       = KERN_CADPID,
                .procname       = "cad_pid",
                .data           = NULL,
                .maxlen         = sizeof (int),
@@ -536,14 +534,6 @@ static ctl_table kern_table[] = {
                .mode           = 0555,
                .child          = random_table,
        },
-#ifdef CONFIG_UNIX98_PTYS
-       {
-               .ctl_name       = KERN_PTY,
-               .procname       = "pty",
-               .mode           = 0555,
-               .child          = pty_table,
-       },
-#endif
        {
                .ctl_name       = KERN_OVERFLOWUID,
                .procname       = "overflowuid",
@@ -650,7 +640,6 @@ static ctl_table kern_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = KERN_NMI_WATCHDOG,
                .procname       = "nmi_watchdog",
                .data           = &nmi_watchdog_enabled,
                .maxlen         = sizeof (int),
@@ -706,7 +695,6 @@ static ctl_table kern_table[] = {
 #endif
 #if    defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
        {
-               .ctl_name       = KERN_ACPI_VIDEO_FLAGS,
                .procname       = "acpi_video_flags",
                .data           = &acpi_realmode_flags,
                .maxlen         = sizeof (unsigned long),
@@ -783,7 +771,7 @@ static ctl_table kern_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table vm_table[] = {
+static struct ctl_table vm_table[] = {
        {
                .ctl_name       = VM_OVERCOMMIT_MEMORY,
                .procname       = "overcommit_memory",
@@ -847,7 +835,6 @@ static ctl_table vm_table[] = {
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = VM_DIRTY_WB_CS,
                .procname       = "dirty_writeback_centisecs",
                .data           = &dirty_writeback_interval,
                .maxlen         = sizeof(dirty_writeback_interval),
@@ -855,7 +842,6 @@ static ctl_table vm_table[] = {
                .proc_handler   = &dirty_writeback_centisecs_handler,
        },
        {
-               .ctl_name       = VM_DIRTY_EXPIRE_CS,
                .procname       = "dirty_expire_centisecs",
                .data           = &dirty_expire_interval,
                .maxlen         = sizeof(dirty_expire_interval),
@@ -883,7 +869,6 @@ static ctl_table vm_table[] = {
        },
 #ifdef CONFIG_HUGETLB_PAGE
         {
-               .ctl_name       = VM_HUGETLB_PAGES,
                .procname       = "nr_hugepages",
                .data           = &max_huge_pages,
                .maxlen         = sizeof(unsigned long),
@@ -1093,12 +1078,12 @@ static ctl_table vm_table[] = {
 };
 
 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
-static ctl_table binfmt_misc_table[] = {
+static struct ctl_table binfmt_misc_table[] = {
        { .ctl_name = 0 }
 };
 #endif
 
-static ctl_table fs_table[] = {
+static struct ctl_table fs_table[] = {
        {
                .ctl_name       = FS_NRINODE,
                .procname       = "inode-nr",
@@ -1116,7 +1101,6 @@ static ctl_table fs_table[] = {
                .proc_handler   = &proc_dointvec,
        },
        {
-               .ctl_name       = FS_NRFILE,
                .procname       = "file-nr",
                .data           = &files_stat,
                .maxlen         = 3*sizeof(int),
@@ -1192,7 +1176,6 @@ static ctl_table fs_table[] = {
                .extra2         = &two,
        },
        {
-               .ctl_name       = FS_AIO_NR,
                .procname       = "aio-nr",
                .data           = &aio_nr,
                .maxlen         = sizeof(aio_nr),
@@ -1200,7 +1183,6 @@ static ctl_table fs_table[] = {
                .proc_handler   = &proc_doulongvec_minmax,
        },
        {
-               .ctl_name       = FS_AIO_MAX_NR,
                .procname       = "aio-max-nr",
                .data           = &aio_max_nr,
                .maxlen         = sizeof(aio_max_nr),
@@ -1239,7 +1221,7 @@ static ctl_table fs_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table debug_table[] = {
+static struct ctl_table debug_table[] = {
 #if defined(CONFIG_X86) || defined(CONFIG_PPC)
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -1253,7 +1235,7 @@ static ctl_table debug_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table dev_table[] = {
+static struct ctl_table dev_table[] = {
        { .ctl_name = 0 }
 };
 
@@ -1369,10 +1351,15 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
        if (copy_from_user(&tmp, args, sizeof(tmp)))
                return -EFAULT;
 
+       error = deprecated_sysctl_warning(&tmp);
+       if (error)
+               goto out;
+
        lock_kernel();
        error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp,
                          tmp.newval, tmp.newlen);
        unlock_kernel();
+out:
        return error;
 }
 #endif /* CONFIG_SYSCTL_SYSCALL */
@@ -1393,7 +1380,7 @@ static int test_perm(int mode, int op)
        return -EACCES;
 }
 
-int sysctl_perm(ctl_table *table, int op)
+int sysctl_perm(struct ctl_table *table, int op)
 {
        int error;
        error = security_sysctl(table, op);
@@ -1406,7 +1393,7 @@ int sysctl_perm(ctl_table *table, int op)
 static int parse_table(int __user *name, int nlen,
                       void __user *oldval, size_t __user *oldlenp,
                       void __user *newval, size_t newlen,
-                      ctl_table *table)
+                      struct ctl_table *table)
 {
        int n;
 repeat:
@@ -1437,13 +1424,12 @@ repeat:
 }
 
 /* Perform the actual read/write of a sysctl table entry. */
-int do_sysctl_strategy (ctl_table *table, 
+int do_sysctl_strategy (struct ctl_table *table,
                        int __user *name, int nlen,
                        void __user *oldval, size_t __user *oldlenp,
                        void __user *newval, size_t newlen)
 {
        int op = 0, rc;
-       size_t len;
 
        if (oldval)
                op |= 004;
@@ -1464,25 +1450,10 @@ int do_sysctl_strategy (ctl_table *table,
        /* If there is no strategy routine, or if the strategy returns
         * zero, proceed with automatic r/w */
        if (table->data && table->maxlen) {
-               if (oldval && oldlenp) {
-                       if (get_user(len, oldlenp))
-                               return -EFAULT;
-                       if (len) {
-                               if (len > table->maxlen)
-                                       len = table->maxlen;
-                               if(copy_to_user(oldval, table->data, len))
-                                       return -EFAULT;
-                               if(put_user(len, oldlenp))
-                                       return -EFAULT;
-                       }
-               }
-               if (newval && newlen) {
-                       len = newlen;
-                       if (len > table->maxlen)
-                               len = table->maxlen;
-                       if(copy_from_user(table->data, newval, len))
-                               return -EFAULT;
-               }
+               rc = sysctl_data(table, name, nlen, oldval, oldlenp,
+                                newval, newlen);
+               if (rc < 0)
+                       return rc;
        }
        return 0;
 }
@@ -1499,7 +1470,9 @@ static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table)
 
 static __init int sysctl_init(void)
 {
+       int err;
        sysctl_set_parent(NULL, root_table);
+       err = sysctl_check_table(root_table);
        return 0;
 }
 
@@ -1512,7 +1485,7 @@ core_initcall(sysctl_init);
  * Register a sysctl table hierarchy. @table should be a filled in ctl_table
  * array. An entry with a ctl_name of 0 terminates the table. 
  *
- * The members of the &ctl_table structure are used as follows:
+ * The members of the &struct ctl_table structure are used as follows:
  *
  * ctl_name - This is the numeric sysctl value used by sysctl(2). The number
  *            must be unique within that level of sysctl
@@ -1573,7 +1546,7 @@ core_initcall(sysctl_init);
  * This routine returns %NULL on a failure to register, and a pointer
  * to the table header on success.
  */
-struct ctl_table_header *register_sysctl_table(ctl_table * table)
+struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
 {
        struct ctl_table_header *tmp;
        tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL);
@@ -1584,6 +1557,10 @@ struct ctl_table_header *register_sysctl_table(ctl_table * table)
        tmp->used = 0;
        tmp->unregistering = NULL;
        sysctl_set_parent(NULL, table);
+       if (sysctl_check_table(tmp->ctl_table)) {
+               kfree(tmp);
+               return NULL;
+       }
        spin_lock(&sysctl_lock);
        list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry);
        spin_unlock(&sysctl_lock);
@@ -1607,7 +1584,7 @@ void unregister_sysctl_table(struct ctl_table_header * header)
 }
 
 #else /* !CONFIG_SYSCTL */
-struct ctl_table_header *register_sysctl_table(ctl_table * table)
+struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
 {
        return NULL;
 }
@@ -1700,7 +1677,7 @@ static int _proc_do_string(void* data, int maxlen, int write,
  *
  * Returns 0 on success.
  */
-int proc_dostring(ctl_table *table, int write, struct file *filp,
+int proc_dostring(struct ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return _proc_do_string(table->data, table->maxlen, write, filp,
@@ -1727,7 +1704,7 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp,
        return 0;
 }
 
-static int __do_proc_dointvec(void *tbl_data, ctl_table *table,
+static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
                  int write, struct file *filp, void __user *buffer,
                  size_t *lenp, loff_t *ppos,
                  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
@@ -1837,7 +1814,7 @@ static int __do_proc_dointvec(void *tbl_data, ctl_table *table,
 #undef TMPBUFLEN
 }
 
-static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
+static int do_proc_dointvec(struct ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos,
                  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
                              int write, void *data),
@@ -1861,7 +1838,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
  *
  * Returns 0 on success.
  */
-int proc_dointvec(ctl_table *table, int write, struct file *filp,
+int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
                     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
     return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
@@ -1897,11 +1874,12 @@ static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp,
        return 0;
 }
 
+#ifdef CONFIG_SECURITY_CAPABILITIES
 /*
  *     init may raise the set.
  */
-int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
+
+int proc_dointvec_bset(struct ctl_table *table, int write, struct file *filp,
                        void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int op;
@@ -1914,11 +1892,12 @@ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
        return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
                                do_proc_dointvec_bset_conv,&op);
 }
+#endif /* def CONFIG_SECURITY_CAPABILITIES */
 
 /*
  *     Taint values can only be increased
  */
-static int proc_dointvec_taint(ctl_table *table, int write, struct file *filp,
+static int proc_dointvec_taint(struct ctl_table *table, int write, struct file *filp,
                               void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        int op;
@@ -1977,7 +1956,7 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp,
  *
  * Returns 0 on success.
  */
-int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        struct do_proc_dointvec_minmax_conv_param param = {
@@ -1988,7 +1967,7 @@ int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
                                do_proc_dointvec_minmax_conv, &param);
 }
 
-static int __do_proc_doulongvec_minmax(void *data, ctl_table *table, int write,
+static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
                                     struct file *filp,
                                     void __user *buffer,
                                     size_t *lenp, loff_t *ppos,
@@ -2093,7 +2072,7 @@ static int __do_proc_doulongvec_minmax(void *data, ctl_table *table, int write,
 #undef TMPBUFLEN
 }
 
-static int do_proc_doulongvec_minmax(ctl_table *table, int write,
+static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
                                     struct file *filp,
                                     void __user *buffer,
                                     size_t *lenp, loff_t *ppos,
@@ -2121,7 +2100,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
  *
  * Returns 0 on success.
  */
-int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
+int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp,
                           void __user *buffer, size_t *lenp, loff_t *ppos)
 {
     return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos, 1l, 1l);
@@ -2145,7 +2124,7 @@ int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
  *
  * Returns 0 on success.
  */
-int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
+int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
                                      struct file *filp,
                                      void __user *buffer,
                                      size_t *lenp, loff_t *ppos)
@@ -2238,7 +2217,7 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp,
  *
  * Returns 0 on success.
  */
-int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp,
                          void __user *buffer, size_t *lenp, loff_t *ppos)
 {
     return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
@@ -2261,7 +2240,7 @@ int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
  *
  * Returns 0 on success.
  */
-int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp,
                                 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
     return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
@@ -2285,14 +2264,14 @@ int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
  *
  * Returns 0 on success.
  */
-int proc_dointvec_ms_jiffies(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp,
                             void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return do_proc_dointvec(table, write, filp, buffer, lenp, ppos,
                                do_proc_dointvec_ms_jiffies_conv, NULL);
 }
 
-static int proc_do_cad_pid(ctl_table *table, int write, struct file *filp,
+static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp,
                           void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        struct pid *new_pid;
@@ -2316,55 +2295,55 @@ static int proc_do_cad_pid(ctl_table *table, int write, struct file *filp,
 
 #else /* CONFIG_PROC_FS */
 
-int proc_dostring(ctl_table *table, int write, struct file *filp,
+int proc_dostring(struct ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_dointvec(ctl_table *table, int write, struct file *filp,
+int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_bset(struct ctl_table *table, int write, struct file *filp,
                        void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_dointvec_ms_jiffies(ctl_table *table, int write, struct file *filp,
+int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp,
                             void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
+int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp,
                    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
        return -ENOSYS;
 }
 
-int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
+int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
                                      struct file *filp,
                                      void __user *buffer,
                                      size_t *lenp, loff_t *ppos)
@@ -2381,8 +2360,42 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
  * General sysctl support routines 
  */
 
+/* The generic sysctl data routine (used if no strategy routine supplied) */
+int sysctl_data(struct ctl_table *table, int __user *name, int nlen,
+               void __user *oldval, size_t __user *oldlenp,
+               void __user *newval, size_t newlen)
+{
+       size_t len;
+
+       /* Get out of I don't have a variable */
+       if (!table->data || !table->maxlen)
+               return -ENOTDIR;
+
+       if (oldval && oldlenp) {
+               if (get_user(len, oldlenp))
+                       return -EFAULT;
+               if (len) {
+                       if (len > table->maxlen)
+                               len = table->maxlen;
+                       if (copy_to_user(oldval, table->data, len))
+                               return -EFAULT;
+                       if (put_user(len, oldlenp))
+                               return -EFAULT;
+               }
+       }
+
+       if (newval && newlen) {
+               if (newlen > table->maxlen)
+                       newlen = table->maxlen;
+
+               if (copy_from_user(table->data, newval, newlen))
+                       return -EFAULT;
+       }
+       return 1;
+}
+
 /* The generic string strategy routine: */
-int sysctl_string(ctl_table *table, int __user *name, int nlen,
+int sysctl_string(struct ctl_table *table, int __user *name, int nlen,
                  void __user *oldval, size_t __user *oldlenp,
                  void __user *newval, size_t newlen)
 {
@@ -2428,7 +2441,7 @@ int sysctl_string(ctl_table *table, int __user *name, int nlen,
  * are between the minimum and maximum values given in the arrays
  * table->extra1 and table->extra2, respectively.
  */
-int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
+int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen,
                void __user *oldval, size_t __user *oldlenp,
                void __user *newval, size_t newlen)
 {
@@ -2464,7 +2477,7 @@ int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
 }
 
 /* Strategy function to convert jiffies to seconds */ 
-int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
+int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen,
                void __user *oldval, size_t __user *oldlenp,
                void __user *newval, size_t newlen)
 {
@@ -2498,7 +2511,7 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
 }
 
 /* Strategy function to convert jiffies to seconds */ 
-int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
+int sysctl_ms_jiffies(struct ctl_table *table, int __user *name, int nlen,
                void __user *oldval, size_t __user *oldlenp,
                void __user *newval, size_t newlen)
 {
@@ -2538,59 +2551,50 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
 
 asmlinkage long sys_sysctl(struct __sysctl_args __user *args)
 {
-       static int msg_count;
        struct __sysctl_args tmp;
-       int name[CTL_MAXNAME];
-       int i;
+       int error;
 
-       /* Read in the sysctl name for better debug message logging */
        if (copy_from_user(&tmp, args, sizeof(tmp)))
                return -EFAULT;
-       if (tmp.nlen <= 0 || tmp.nlen >= CTL_MAXNAME)
-               return -ENOTDIR;
-       for (i = 0; i < tmp.nlen; i++)
-               if (get_user(name[i], tmp.name + i))
-                       return -EFAULT;
 
-       /* Ignore accesses to kernel.version */
-       if ((tmp.nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
-               goto out;
+       error = deprecated_sysctl_warning(&tmp);
 
-       if (msg_count < 5) {
-               msg_count++;
-               printk(KERN_INFO
-                       "warning: process `%s' used the removed sysctl "
-                       "system call with ", current->comm);
-               for (i = 0; i < tmp.nlen; i++)
-                       printk("%d.", name[i]);
-               printk("\n");
-       }
-out:
+       /* If no error reading the parameters then just -ENOSYS ... */
+       if (!error)
+               error = -ENOSYS;
+
+       return error;
+}
+
+int sysctl_data(struct ctl_table *table, int __user *name, int nlen,
+                 void __user *oldval, size_t __user *oldlenp,
+                 void __user *newval, size_t newlen)
+{
        return -ENOSYS;
 }
 
-int sysctl_string(ctl_table *table, int __user *name, int nlen,
+int sysctl_string(struct ctl_table *table, int __user *name, int nlen,
                  void __user *oldval, size_t __user *oldlenp,
                  void __user *newval, size_t newlen)
 {
        return -ENOSYS;
 }
 
-int sysctl_intvec(ctl_table *table, int __user *name, int nlen,
+int sysctl_intvec(struct ctl_table *table, int __user *name, int nlen,
                void __user *oldval, size_t __user *oldlenp,
                void __user *newval, size_t newlen)
 {
        return -ENOSYS;
 }
 
-int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
+int sysctl_jiffies(struct ctl_table *table, int __user *name, int nlen,
                void __user *oldval, size_t __user *oldlenp,
                void __user *newval, size_t newlen)
 {
        return -ENOSYS;
 }
 
-int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
+int sysctl_ms_jiffies(struct ctl_table *table, int __user *name, int nlen,
                void __user *oldval, size_t __user *oldlenp,
                void __user *newval, size_t newlen)
 {
@@ -2599,6 +2603,33 @@ int sysctl_ms_jiffies(ctl_table *table, int __user *name, int nlen,
 
 #endif /* CONFIG_SYSCTL_SYSCALL */
 
+static int deprecated_sysctl_warning(struct __sysctl_args *args)
+{
+       static int msg_count;
+       int name[CTL_MAXNAME];
+       int i;
+
+       /* Read in the sysctl name for better debug message logging */
+       for (i = 0; i < args->nlen; i++)
+               if (get_user(name[i], args->name + i))
+                       return -EFAULT;
+
+       /* Ignore accesses to kernel.version */
+       if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
+               return 0;
+
+       if (msg_count < 5) {
+               msg_count++;
+               printk(KERN_INFO
+                       "warning: process `%s' used the deprecated sysctl "
+                       "system call with ", current->comm);
+               for (i = 0; i < args->nlen; i++)
+                       printk("%d.", name[i]);
+               printk("\n");
+       }
+       return 0;
+}
+
 /*
  * No sense putting this after each symbol definition, twice,
  * exception granted :-)
@@ -2616,4 +2647,5 @@ EXPORT_SYMBOL(sysctl_intvec);
 EXPORT_SYMBOL(sysctl_jiffies);
 EXPORT_SYMBOL(sysctl_ms_jiffies);
 EXPORT_SYMBOL(sysctl_string);
+EXPORT_SYMBOL(sysctl_data);
 EXPORT_SYMBOL(unregister_sysctl_table);
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c
new file mode 100644 (file)
index 0000000..3c9ef5a
--- /dev/null
@@ -0,0 +1,1588 @@
+#include <linux/stat.h>
+#include <linux/sysctl.h>
+#include "../arch/s390/appldata/appldata.h"
+#include "../fs/xfs/linux-2.6/xfs_sysctl.h"
+#include <linux/sunrpc/debug.h>
+#include <linux/string.h>
+#include <net/ip_vs.h>
+
+struct trans_ctl_table {
+       int                     ctl_name;
+       const char              *procname;
+       struct trans_ctl_table  *child;
+};
+
+static struct trans_ctl_table trans_random_table[] = {
+       { RANDOM_POOLSIZE,      "poolsize" },
+       { RANDOM_ENTROPY_COUNT, "entropy_avail" },
+       { RANDOM_READ_THRESH,   "read_wakeup_threshold" },
+       { RANDOM_WRITE_THRESH,  "write_wakeup_threshold" },
+       { RANDOM_BOOT_ID,       "boot_id" },
+       { RANDOM_UUID,          "uuid" },
+       {}
+};
+
+static struct trans_ctl_table trans_pty_table[] = {
+       { PTY_MAX,              "max" },
+       { PTY_NR,               "nr" },
+       {}
+};
+
+static struct trans_ctl_table trans_kern_table[] = {
+       { KERN_OSTYPE,                  "ostype" },
+       { KERN_OSRELEASE,               "osrelease" },
+       /* KERN_OSREV not used */
+       { KERN_VERSION,                 "version" },
+       /* KERN_SECUREMASK not used */
+       /* KERN_PROF not used */
+       { KERN_NODENAME,                "hostname" },
+       { KERN_DOMAINNAME,              "domainname" },
+
+#ifdef CONFIG_SECURITY_CAPABILITIES
+       { KERN_CAP_BSET,                "cap-bound" },
+#endif /* def CONFIG_SECURITY_CAPABILITIES */
+
+       { KERN_PANIC,                   "panic" },
+       { KERN_REALROOTDEV,             "real-root-dev" },
+
+       { KERN_SPARC_REBOOT,            "reboot-cmd" },
+       { KERN_CTLALTDEL,               "ctrl-alt-del" },
+       { KERN_PRINTK,                  "printk" },
+
+       /* KERN_NAMETRANS not used */
+       /* KERN_PPC_HTABRECLAIM not used */
+       /* KERN_PPC_ZEROPAGED not used */
+       { KERN_PPC_POWERSAVE_NAP,       "powersave-nap" },
+
+       { KERN_MODPROBE,                "modprobe" },
+       { KERN_SG_BIG_BUFF,             "sg-big-buff" },
+       { KERN_ACCT,                    "acct" },
+       { KERN_PPC_L2CR,                "l2cr" },
+
+       /* KERN_RTSIGNR not used */
+       /* KERN_RTSIGMAX not used */
+
+       { KERN_SHMMAX,                  "shmmax" },
+       { KERN_MSGMAX,                  "msgmax" },
+       { KERN_MSGMNB,                  "msgmnb" },
+       /* KERN_MSGPOOL not used*/
+       { KERN_SYSRQ,                   "sysrq" },
+       { KERN_MAX_THREADS,             "threads-max" },
+       { KERN_RANDOM,                  "random",       trans_random_table },
+       { KERN_SHMALL,                  "shmall" },
+       { KERN_MSGMNI,                  "msgmni" },
+       { KERN_SEM,                     "sem" },
+       { KERN_SPARC_STOP_A,            "stop-a" },
+       { KERN_SHMMNI,                  "shmmni" },
+
+       { KERN_OVERFLOWUID,             "overflowuid" },
+       { KERN_OVERFLOWGID,             "overflowgid" },
+
+       { KERN_HOTPLUG,                 "hotplug", },
+       { KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" },
+
+       { KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" },
+       { KERN_CORE_USES_PID,           "core_uses_pid" },
+       { KERN_TAINTED,                 "tainted" },
+       { KERN_CADPID,                  "cad_pid" },
+       { KERN_PIDMAX,                  "pid_max" },
+       { KERN_CORE_PATTERN,            "core_pattern" },
+       { KERN_PANIC_ON_OOPS,           "panic_on_oops" },
+       { KERN_HPPA_PWRSW,              "soft-power" },
+       { KERN_HPPA_UNALIGNED,          "unaligned-trap" },
+
+       { KERN_PRINTK_RATELIMIT,        "printk_ratelimit" },
+       { KERN_PRINTK_RATELIMIT_BURST,  "printk_ratelimit_burst" },
+
+       { KERN_PTY,                     "pty",          trans_pty_table },
+       { KERN_NGROUPS_MAX,             "ngroups_max" },
+       { KERN_SPARC_SCONS_PWROFF,      "scons_poweroff" },
+       { KERN_HZ_TIMER,                "hz_timer" },
+       { KERN_UNKNOWN_NMI_PANIC,       "unknown_nmi_panic" },
+       { KERN_BOOTLOADER_TYPE,         "bootloader_type" },
+       { KERN_RANDOMIZE,               "randomize_va_space" },
+
+       { KERN_SPIN_RETRY,              "spin_retry" },
+       { KERN_ACPI_VIDEO_FLAGS,        "acpi_video_flags" },
+       { KERN_IA64_UNALIGNED,          "ignore-unaligned-usertrap" },
+       { KERN_COMPAT_LOG,              "compat-log" },
+       { KERN_MAX_LOCK_DEPTH,          "max_lock_depth" },
+       { KERN_NMI_WATCHDOG,            "nmi_watchdog" },
+       { KERN_PANIC_ON_NMI,            "panic_on_unrecovered_nmi" },
+       {}
+};
+
+static struct trans_ctl_table trans_vm_table[] = {
+       { VM_OVERCOMMIT_MEMORY,         "overcommit_memory" },
+       { VM_PAGE_CLUSTER,              "page-cluster" },
+       { VM_DIRTY_BACKGROUND,          "dirty_background_ratio" },
+       { VM_DIRTY_RATIO,               "dirty_ratio" },
+       { VM_DIRTY_WB_CS,               "dirty_writeback_centisecs" },
+       { VM_DIRTY_EXPIRE_CS,           "dirty_expire_centisecs" },
+       { VM_NR_PDFLUSH_THREADS,        "nr_pdflush_threads" },
+       { VM_OVERCOMMIT_RATIO,          "overcommit_ratio" },
+       /* VM_PAGEBUF unused */
+       { VM_HUGETLB_PAGES,             "nr_hugepages" },
+       { VM_SWAPPINESS,                "swappiness" },
+       { VM_LOWMEM_RESERVE_RATIO,      "lowmem_reserve_ratio" },
+       { VM_MIN_FREE_KBYTES,           "min_free_kbytes" },
+       { VM_MAX_MAP_COUNT,             "max_map_count" },
+       { VM_LAPTOP_MODE,               "laptop_mode" },
+       { VM_BLOCK_DUMP,                "block_dump" },
+       { VM_HUGETLB_GROUP,             "hugetlb_shm_group" },
+       { VM_VFS_CACHE_PRESSURE,        "vfs_cache_pressure" },
+       { VM_LEGACY_VA_LAYOUT,          "legacy_va_layout" },
+       /* VM_SWAP_TOKEN_TIMEOUT unused */
+       { VM_DROP_PAGECACHE,            "drop_caches" },
+       { VM_PERCPU_PAGELIST_FRACTION,  "percpu_pagelist_fraction" },
+       { VM_ZONE_RECLAIM_MODE,         "zone_reclaim_mode" },
+       { VM_MIN_UNMAPPED,              "min_unmapped_ratio" },
+       { VM_PANIC_ON_OOM,              "panic_on_oom" },
+       { VM_VDSO_ENABLED,              "vdso_enabled" },
+       { VM_MIN_SLAB,                  "min_slab_ratio" },
+       { VM_CMM_PAGES,                 "cmm_pages" },
+       { VM_CMM_TIMED_PAGES,           "cmm_timed_pages" },
+       { VM_CMM_TIMEOUT,               "cmm_timeout" },
+
+       {}
+};
+
+static struct trans_ctl_table trans_net_core_table[] = {
+       { NET_CORE_WMEM_MAX,            "wmem_max" },
+       { NET_CORE_RMEM_MAX,            "rmem_max" },
+       { NET_CORE_WMEM_DEFAULT,        "wmem_default" },
+       { NET_CORE_RMEM_DEFAULT,        "rmem_default" },
+       /* NET_CORE_DESTROY_DELAY unused */
+       { NET_CORE_MAX_BACKLOG,         "netdev_max_backlog" },
+       /* NET_CORE_FASTROUTE unused */
+       { NET_CORE_MSG_COST,            "message_cost" },
+       { NET_CORE_MSG_BURST,           "message_burst" },
+       { NET_CORE_OPTMEM_MAX,          "optmem_max" },
+       /* NET_CORE_HOT_LIST_LENGTH unused */
+       /* NET_CORE_DIVERT_VERSION unused */
+       /* NET_CORE_NO_CONG_THRESH unused */
+       /* NET_CORE_NO_CONG unused */
+       /* NET_CORE_LO_CONG unused */
+       /* NET_CORE_MOD_CONG unused */
+       { NET_CORE_DEV_WEIGHT,          "dev_weight" },
+       { NET_CORE_SOMAXCONN,           "somaxconn" },
+       { NET_CORE_BUDGET,              "netdev_budget" },
+       { NET_CORE_AEVENT_ETIME,        "xfrm_aevent_etime" },
+       { NET_CORE_AEVENT_RSEQTH,       "xfrm_aevent_rseqth" },
+       { NET_CORE_WARNINGS,            "warnings" },
+       {},
+};
+
+static struct trans_ctl_table trans_net_unix_table[] = {
+       /* NET_UNIX_DESTROY_DELAY unused */
+       /* NET_UNIX_DELETE_DELAY unused */
+       { NET_UNIX_MAX_DGRAM_QLEN,      "max_dgram_qlen" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv4_route_table[] = {
+       { NET_IPV4_ROUTE_FLUSH,                 "flush" },
+       { NET_IPV4_ROUTE_MIN_DELAY,             "min_delay" },
+       { NET_IPV4_ROUTE_MAX_DELAY,             "max_delay" },
+       { NET_IPV4_ROUTE_GC_THRESH,             "gc_thresh" },
+       { NET_IPV4_ROUTE_MAX_SIZE,              "max_size" },
+       { NET_IPV4_ROUTE_GC_MIN_INTERVAL,       "gc_min_interval" },
+       { NET_IPV4_ROUTE_GC_TIMEOUT,            "gc_timeout" },
+       { NET_IPV4_ROUTE_GC_INTERVAL,           "gc_interval" },
+       { NET_IPV4_ROUTE_REDIRECT_LOAD,         "redirect_load" },
+       { NET_IPV4_ROUTE_REDIRECT_NUMBER,       "redirect_number" },
+       { NET_IPV4_ROUTE_REDIRECT_SILENCE,      "redirect_silence" },
+       { NET_IPV4_ROUTE_ERROR_COST,            "error_cost" },
+       { NET_IPV4_ROUTE_ERROR_BURST,           "error_burst" },
+       { NET_IPV4_ROUTE_GC_ELASTICITY,         "gc_elasticity" },
+       { NET_IPV4_ROUTE_MTU_EXPIRES,           "mtu_expires" },
+       { NET_IPV4_ROUTE_MIN_PMTU,              "min_pmtu" },
+       { NET_IPV4_ROUTE_MIN_ADVMSS,            "min_adv_mss" },
+       { NET_IPV4_ROUTE_SECRET_INTERVAL,       "secret_interval" },
+       { NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,    "gc_min_interval_ms" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
+       { NET_IPV4_CONF_FORWARDING,             "forwarding" },
+       { NET_IPV4_CONF_MC_FORWARDING,          "mc_forwarding" },
+
+       { NET_IPV4_CONF_PROXY_ARP,              "proxy_arp" },
+       { NET_IPV4_CONF_ACCEPT_REDIRECTS,       "accept_redirects" },
+       { NET_IPV4_CONF_SECURE_REDIRECTS,       "secure_redirects" },
+       { NET_IPV4_CONF_SEND_REDIRECTS,         "send_redirects" },
+       { NET_IPV4_CONF_SHARED_MEDIA,           "shared_media" },
+       { NET_IPV4_CONF_RP_FILTER,              "rp_filter" },
+       { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE,    "accept_source_route" },
+       { NET_IPV4_CONF_BOOTP_RELAY,            "bootp_relay" },
+       { NET_IPV4_CONF_LOG_MARTIANS,           "log_martians" },
+       { NET_IPV4_CONF_TAG,                    "tag" },
+       { NET_IPV4_CONF_ARPFILTER,              "arp_filter" },
+       { NET_IPV4_CONF_MEDIUM_ID,              "medium_id" },
+       { NET_IPV4_CONF_NOXFRM,                 "disable_xfrm" },
+       { NET_IPV4_CONF_NOPOLICY,               "disable_policy" },
+       { NET_IPV4_CONF_FORCE_IGMP_VERSION,     "force_igmp_version" },
+
+       { NET_IPV4_CONF_ARP_ANNOUNCE,           "arp_announce" },
+       { NET_IPV4_CONF_ARP_IGNORE,             "arp_ignore" },
+       { NET_IPV4_CONF_PROMOTE_SECONDARIES,    "promote_secondaries" },
+       { NET_IPV4_CONF_ARP_ACCEPT,             "arp_accept" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
+       { NET_PROTO_CONF_ALL,           "all",          trans_net_ipv4_conf_vars_table },
+       { NET_PROTO_CONF_DEFAULT,       "default",      trans_net_ipv4_conf_vars_table },
+       { 0, NULL, trans_net_ipv4_conf_vars_table },
+       {}
+};
+
+
+static struct trans_ctl_table trans_net_ipv4_vs_table[] = {
+       { NET_IPV4_VS_AMEMTHRESH,       "amemthresh" },
+       { NET_IPV4_VS_DEBUG_LEVEL,      "debug_level" },
+       { NET_IPV4_VS_AMDROPRATE,       "am_droprate" },
+       { NET_IPV4_VS_DROP_ENTRY,       "drop_entry" },
+       { NET_IPV4_VS_DROP_PACKET,      "drop_packet" },
+       { NET_IPV4_VS_SECURE_TCP,       "secure_tcp" },
+       { NET_IPV4_VS_TO_ES,            "timeout_established" },
+       { NET_IPV4_VS_TO_SS,            "timeout_synsent" },
+       { NET_IPV4_VS_TO_SR,            "timeout_synrecv" },
+       { NET_IPV4_VS_TO_FW,            "timeout_finwait" },
+       { NET_IPV4_VS_TO_TW,            "timeout_timewait" },
+       { NET_IPV4_VS_TO_CL,            "timeout_close" },
+       { NET_IPV4_VS_TO_CW,            "timeout_closewait" },
+       { NET_IPV4_VS_TO_LA,            "timeout_lastack" },
+       { NET_IPV4_VS_TO_LI,            "timeout_listen" },
+       { NET_IPV4_VS_TO_SA,            "timeout_synack" },
+       { NET_IPV4_VS_TO_UDP,           "timeout_udp" },
+       { NET_IPV4_VS_TO_ICMP,          "timeout_icmp" },
+       { NET_IPV4_VS_CACHE_BYPASS,     "cache_bypass" },
+       { NET_IPV4_VS_EXPIRE_NODEST_CONN,       "expire_nodest_conn" },
+       { NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE,        "expire_quiescent_template" },
+       { NET_IPV4_VS_SYNC_THRESHOLD,           "sync_threshold" },
+       { NET_IPV4_VS_NAT_ICMP_SEND,    "nat_icmp_send" },
+       { NET_IPV4_VS_LBLC_EXPIRE,              "lblc_expiration" },
+       { NET_IPV4_VS_LBLCR_EXPIRE,             "lblcr_expiration" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_neigh_vars_table[] = {
+       { NET_NEIGH_MCAST_SOLICIT,      "mcast_solicit" },
+       { NET_NEIGH_UCAST_SOLICIT,      "ucast_solicit" },
+       { NET_NEIGH_APP_SOLICIT,        "app_solicit" },
+       { NET_NEIGH_RETRANS_TIME,       "retrans_time" },
+       { NET_NEIGH_REACHABLE_TIME,     "base_reachable_time" },
+       { NET_NEIGH_DELAY_PROBE_TIME,   "delay_first_probe_time" },
+       { NET_NEIGH_GC_STALE_TIME,      "gc_stale_time" },
+       { NET_NEIGH_UNRES_QLEN,         "unres_qlen" },
+       { NET_NEIGH_PROXY_QLEN,         "proxy_qlen" },
+       { NET_NEIGH_ANYCAST_DELAY,      "anycast_delay" },
+       { NET_NEIGH_PROXY_DELAY,        "proxy_delay" },
+       { NET_NEIGH_LOCKTIME,           "locktime" },
+       { NET_NEIGH_GC_INTERVAL,        "gc_interval" },
+       { NET_NEIGH_GC_THRESH1,         "gc_thresh1" },
+       { NET_NEIGH_GC_THRESH2,         "gc_thresh2" },
+       { NET_NEIGH_GC_THRESH3,         "gc_thresh3" },
+       { NET_NEIGH_RETRANS_TIME_MS,    "retrans_time_ms" },
+       { NET_NEIGH_REACHABLE_TIME_MS,  "base_reachable_time_ms" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_neigh_table[] = {
+       { NET_PROTO_CONF_DEFAULT, "default", trans_net_neigh_vars_table },
+       { 0, NULL, trans_net_neigh_vars_table },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
+       { NET_IPV4_NF_CONNTRACK_MAX,                            "ip_conntrack_max" },
+
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,           "ip_conntrack_tcp_timeout_syn_sent" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,           "ip_conntrack_tcp_timeout_syn_recv" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,        "ip_conntrack_tcp_timeout_established" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,           "ip_conntrack_tcp_timeout_fin_wait" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,         "ip_conntrack_tcp_timeout_close_wait" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,           "ip_conntrack_tcp_timeout_last_ack" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,          "ip_conntrack_tcp_timeout_time_wait" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,              "ip_conntrack_tcp_timeout_close" },
+
+       { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT,                    "ip_conntrack_udp_timeout" },
+       { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM,             "ip_conntrack_udp_timeout_stream" },
+       { NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT,                   "ip_conntrack_icmp_timeout" },
+       { NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT,                "ip_conntrack_generic_timeout" },
+
+       { NET_IPV4_NF_CONNTRACK_BUCKETS,                        "ip_conntrack_buckets" },
+       { NET_IPV4_NF_CONNTRACK_LOG_INVALID,                    "ip_conntrack_log_invalid" },
+       { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS,        "ip_conntrack_tcp_timeout_max_retrans" },
+       { NET_IPV4_NF_CONNTRACK_TCP_LOOSE,                      "ip_conntrack_tcp_loose" },
+       { NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL,                 "ip_conntrack_tcp_be_liberal" },
+       { NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS,                "ip_conntrack_tcp_max_retrans" },
+
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,            "ip_conntrack_sctp_timeout_closed" },
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT,       "ip_conntrack_sctp_timeout_cookie_wait" },
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED,     "ip_conntrack_sctp_timeout_cookie_echoed" },
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED,       "ip_conntrack_sctp_timeout_established" },
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT,     "ip_conntrack_sctp_timeout_shutdown_sent" },
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD,     "ip_conntrack_sctp_timeout_shutdown_recd" },
+       { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "ip_conntrack_sctp_timeout_shutdown_ack_sent" },
+
+       { NET_IPV4_NF_CONNTRACK_COUNT,          "ip_conntrack_count" },
+       { NET_IPV4_NF_CONNTRACK_CHECKSUM,       "ip_conntrack_checksum" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv4_table[] = {
+       { NET_IPV4_FORWARD,                     "ip_forward" },
+       { NET_IPV4_DYNADDR,                     "ip_dynaddr" },
+
+       { NET_IPV4_CONF,                "conf",         trans_net_ipv4_conf_table },
+       { NET_IPV4_NEIGH,               "neigh",        trans_net_neigh_table },
+       { NET_IPV4_ROUTE,               "route",        trans_net_ipv4_route_table },
+       /* NET_IPV4_FIB_HASH unused */
+       { NET_IPV4_NETFILTER,           "netfilter",    trans_net_ipv4_netfilter_table },
+       { NET_IPV4_VS,                  "vs",           trans_net_ipv4_vs_table },
+
+       { NET_IPV4_TCP_TIMESTAMPS,              "tcp_timestamps" },
+       { NET_IPV4_TCP_WINDOW_SCALING,          "tcp_window_scaling" },
+       { NET_IPV4_TCP_SACK,                    "tcp_sack" },
+       { NET_IPV4_TCP_RETRANS_COLLAPSE,        "tcp_retrans_collapse" },
+       { NET_IPV4_DEFAULT_TTL,                 "ip_default_ttl" },
+       /* NET_IPV4_AUTOCONFIG unused */
+       { NET_IPV4_NO_PMTU_DISC,                "ip_no_pmtu_disc" },
+       { NET_IPV4_TCP_SYN_RETRIES,             "tcp_syn_retries" },
+       { NET_IPV4_IPFRAG_HIGH_THRESH,          "ipfrag_high_thresh" },
+       { NET_IPV4_IPFRAG_LOW_THRESH,           "ipfrag_low_thresh" },
+       { NET_IPV4_IPFRAG_TIME,                 "ipfrag_time" },
+       /* NET_IPV4_TCP_MAX_KA_PROBES unused */
+       { NET_IPV4_TCP_KEEPALIVE_TIME,          "tcp_keepalive_time" },
+       { NET_IPV4_TCP_KEEPALIVE_PROBES,        "tcp_keepalive_probes" },
+       { NET_IPV4_TCP_RETRIES1,                "tcp_retries1" },
+       { NET_IPV4_TCP_RETRIES2,                "tcp_retries2" },
+       { NET_IPV4_TCP_FIN_TIMEOUT,             "tcp_fin_timeout" },
+       /* NET_IPV4_IP_MASQ_DEBUG unused */
+       { NET_TCP_SYNCOOKIES,                   "tcp_syncookies" },
+       { NET_TCP_STDURG,                       "tcp_stdurg" },
+       { NET_TCP_RFC1337,                      "tcp_rfc1337" },
+       /* NET_TCP_SYN_TAILDROP unused */
+       { NET_TCP_MAX_SYN_BACKLOG,              "tcp_max_syn_backlog" },
+       { NET_IPV4_LOCAL_PORT_RANGE,            "ip_local_port_range" },
+       { NET_IPV4_ICMP_ECHO_IGNORE_ALL,        "icmp_echo_ignore_all" },
+       { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" },
+       /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */
+       /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */
+       /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */
+       /* NET_IPV4_ICMP_PARAMPROB_RATE unused */
+       /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */
+       { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,   "icmp_ignore_bogus_error_responses" },
+       { NET_IPV4_IGMP_MAX_MEMBERSHIPS,        "igmp_max_memberships" },
+       { NET_TCP_TW_RECYCLE,                   "tcp_tw_recycle" },
+       /* NET_IPV4_ALWAYS_DEFRAG unused */
+       { NET_IPV4_TCP_KEEPALIVE_INTVL,         "tcp_keepalive_intvl" },
+       { NET_IPV4_INET_PEER_THRESHOLD,         "inet_peer_threshold" },
+       { NET_IPV4_INET_PEER_MINTTL,            "inet_peer_minttl" },
+       { NET_IPV4_INET_PEER_MAXTTL,            "inet_peer_maxttl" },
+       { NET_IPV4_INET_PEER_GC_MINTIME,        "inet_peer_gc_mintime" },
+       { NET_IPV4_INET_PEER_GC_MAXTIME,        "inet_peer_gc_maxtime" },
+       { NET_TCP_ORPHAN_RETRIES,               "tcp_orphan_retries" },
+       { NET_TCP_ABORT_ON_OVERFLOW,            "tcp_abort_on_overflow" },
+       { NET_TCP_SYNACK_RETRIES,               "tcp_synack_retries" },
+       { NET_TCP_MAX_ORPHANS,                  "tcp_max_orphans" },
+       { NET_TCP_MAX_TW_BUCKETS,               "tcp_max_tw_buckets" },
+       { NET_TCP_FACK,                         "tcp_fack" },
+       { NET_TCP_REORDERING,                   "tcp_reordering" },
+       { NET_TCP_ECN,                          "tcp_ecn" },
+       { NET_TCP_DSACK,                        "tcp_dsack" },
+       { NET_TCP_MEM,                          "tcp_mem" },
+       { NET_TCP_WMEM,                         "tcp_wmem" },
+       { NET_TCP_RMEM,                         "tcp_rmem" },
+       { NET_TCP_APP_WIN,                      "tcp_app_win" },
+       { NET_TCP_ADV_WIN_SCALE,                "tcp_adv_win_scale" },
+       { NET_IPV4_NONLOCAL_BIND,               "ip_nonlocal_bind" },
+       { NET_IPV4_ICMP_RATELIMIT,              "icmp_ratelimit" },
+       { NET_IPV4_ICMP_RATEMASK,               "icmp_ratemask" },
+       { NET_TCP_TW_REUSE,                     "tcp_tw_reuse" },
+       { NET_TCP_FRTO,                         "tcp_frto" },
+       { NET_TCP_LOW_LATENCY,                  "tcp_low_latency" },
+       { NET_IPV4_IPFRAG_SECRET_INTERVAL,      "ipfrag_secret_interval" },
+       { NET_IPV4_IGMP_MAX_MSF,                "igmp_max_msf" },
+       { NET_TCP_NO_METRICS_SAVE,              "tcp_no_metrics_save" },
+       /* NET_TCP_DEFAULT_WIN_SCALE unused */
+       { NET_TCP_MODERATE_RCVBUF,              "tcp_moderate_rcvbuf" },
+       { NET_TCP_TSO_WIN_DIVISOR,              "tcp_tso_win_divisor" },
+       /* NET_TCP_BIC_BETA unused */
+       { NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,      "icmp_errors_use_inbound_ifaddr" },
+       { NET_TCP_CONG_CONTROL,                 "tcp_congestion_control" },
+       { NET_TCP_ABC,                          "tcp_abc" },
+       { NET_IPV4_IPFRAG_MAX_DIST,             "ipfrag_max_dist" },
+       { NET_TCP_MTU_PROBING,                  "tcp_mtu_probing" },
+       { NET_TCP_BASE_MSS,                     "tcp_base_mss" },
+       { NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,       "tcp_workaround_signed_windows" },
+       { NET_TCP_DMA_COPYBREAK,                "tcp_dma_copybreak" },
+       { NET_TCP_SLOW_START_AFTER_IDLE,        "tcp_slow_start_after_idle" },
+       { NET_CIPSOV4_CACHE_ENABLE,             "cipso_cache_enable" },
+       { NET_CIPSOV4_CACHE_BUCKET_SIZE,        "cipso_cache_bucket_size" },
+       { NET_CIPSOV4_RBM_OPTFMT,               "cipso_rbm_optfmt" },
+       { NET_CIPSOV4_RBM_STRICTVALID,          "cipso_rbm_strictvalid" },
+       { NET_TCP_AVAIL_CONG_CONTROL,           "tcp_available_congestion_control" },
+       { NET_TCP_ALLOWED_CONG_CONTROL,         "tcp_allowed_congestion_control" },
+       { NET_TCP_MAX_SSTHRESH,                 "tcp_max_ssthresh" },
+       { NET_TCP_FRTO_RESPONSE,                "tcp_frto_response" },
+       { 2088 /* NET_IPQ_QMAX */,              "ip_queue_maxlen" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipx_table[] = {
+       { NET_IPX_PPROP_BROADCASTING,   "ipx_pprop_broadcasting" },
+       /* NET_IPX_FORWARDING unused */
+       {}
+};
+
+static struct trans_ctl_table trans_net_atalk_table[] = {
+       { NET_ATALK_AARP_EXPIRY_TIME,           "aarp-expiry-time" },
+       { NET_ATALK_AARP_TICK_TIME,             "aarp-tick-time" },
+       { NET_ATALK_AARP_RETRANSMIT_LIMIT,      "aarp-retransmit-limit" },
+       { NET_ATALK_AARP_RESOLVE_TIME,          "aarp-resolve-time" },
+       {},
+};
+
+static struct trans_ctl_table trans_net_netrom_table[] = {
+       { NET_NETROM_DEFAULT_PATH_QUALITY,              "default_path_quality" },
+       { NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER,    "obsolescence_count_initialiser" },
+       { NET_NETROM_NETWORK_TTL_INITIALISER,           "network_ttl_initialiser" },
+       { NET_NETROM_TRANSPORT_TIMEOUT,                 "transport_timeout" },
+       { NET_NETROM_TRANSPORT_MAXIMUM_TRIES,           "transport_maximum_tries" },
+       { NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY,       "transport_acknowledge_delay" },
+       { NET_NETROM_TRANSPORT_BUSY_DELAY,              "transport_busy_delay" },
+       { NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE,   "transport_requested_window_size" },
+       { NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT,     "transport_no_activity_timeout" },
+       { NET_NETROM_ROUTING_CONTROL,                   "routing_control" },
+       { NET_NETROM_LINK_FAILS_COUNT,                  "link_fails_count" },
+       { NET_NETROM_RESET,                             "reset" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ax25_table[] = {
+       { NET_AX25_IP_DEFAULT_MODE,     "ip_default_mode" },
+       { NET_AX25_DEFAULT_MODE,        "ax25_default_mode" },
+       { NET_AX25_BACKOFF_TYPE,        "backoff_type" },
+       { NET_AX25_CONNECT_MODE,        "connect_mode" },
+       { NET_AX25_STANDARD_WINDOW,     "standard_window_size" },
+       { NET_AX25_EXTENDED_WINDOW,     "extended_window_size" },
+       { NET_AX25_T1_TIMEOUT,          "t1_timeout" },
+       { NET_AX25_T2_TIMEOUT,          "t2_timeout" },
+       { NET_AX25_T3_TIMEOUT,          "t3_timeout" },
+       { NET_AX25_IDLE_TIMEOUT,        "idle_timeout" },
+       { NET_AX25_N2,                  "maximum_retry_count" },
+       { NET_AX25_PACLEN,              "maximum_packet_length" },
+       { NET_AX25_PROTOCOL,            "protocol" },
+       { NET_AX25_DAMA_SLAVE_TIMEOUT,  "dama_slave_timeout" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_bridge_table[] = {
+       { NET_BRIDGE_NF_CALL_ARPTABLES,         "bridge-nf-call-arptables" },
+       { NET_BRIDGE_NF_CALL_IPTABLES,          "bridge-nf-call-iptables" },
+       { NET_BRIDGE_NF_CALL_IP6TABLES,         "bridge-nf-call-ip6tables" },
+       { NET_BRIDGE_NF_FILTER_VLAN_TAGGED,     "bridge-nf-filter-vlan-tagged" },
+       { NET_BRIDGE_NF_FILTER_PPPOE_TAGGED,    "bridge-nf-filter-pppoe-tagged" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_rose_table[] = {
+       { NET_ROSE_RESTART_REQUEST_TIMEOUT,     "restart_request_timeout" },
+       { NET_ROSE_CALL_REQUEST_TIMEOUT,        "call_request_timeout" },
+       { NET_ROSE_RESET_REQUEST_TIMEOUT,       "reset_request_timeout" },
+       { NET_ROSE_CLEAR_REQUEST_TIMEOUT,       "clear_request_timeout" },
+       { NET_ROSE_ACK_HOLD_BACK_TIMEOUT,       "acknowledge_hold_back_timeout" },
+       { NET_ROSE_ROUTING_CONTROL,             "routing_control" },
+       { NET_ROSE_LINK_FAIL_TIMEOUT,           "link_fail_timeout" },
+       { NET_ROSE_MAX_VCS,                     "maximum_virtual_circuits" },
+       { NET_ROSE_WINDOW_SIZE,                 "window_size" },
+       { NET_ROSE_NO_ACTIVITY_TIMEOUT,         "no_activity_timeout" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv6_conf_var_table[] = {
+       { NET_IPV6_FORWARDING,                  "forwarding" },
+       { NET_IPV6_HOP_LIMIT,                   "hop_limit" },
+       { NET_IPV6_MTU,                         "mtu" },
+       { NET_IPV6_ACCEPT_RA,                   "accept_ra" },
+       { NET_IPV6_ACCEPT_REDIRECTS,            "accept_redirects" },
+       { NET_IPV6_AUTOCONF,                    "autoconf" },
+       { NET_IPV6_DAD_TRANSMITS,               "dad_transmits" },
+       { NET_IPV6_RTR_SOLICITS,                "router_solicitations" },
+       { NET_IPV6_RTR_SOLICIT_INTERVAL,        "router_solicitation_interval" },
+       { NET_IPV6_RTR_SOLICIT_DELAY,           "router_solicitation_delay" },
+       { NET_IPV6_USE_TEMPADDR,                "use_tempaddr" },
+       { NET_IPV6_TEMP_VALID_LFT,              "temp_valid_lft" },
+       { NET_IPV6_TEMP_PREFERED_LFT,           "temp_prefered_lft" },
+       { NET_IPV6_REGEN_MAX_RETRY,             "regen_max_retry" },
+       { NET_IPV6_MAX_DESYNC_FACTOR,           "max_desync_factor" },
+       { NET_IPV6_MAX_ADDRESSES,               "max_addresses" },
+       { NET_IPV6_FORCE_MLD_VERSION,           "force_mld_version" },
+       { NET_IPV6_ACCEPT_RA_DEFRTR,            "accept_ra_defrtr" },
+       { NET_IPV6_ACCEPT_RA_PINFO,             "accept_ra_pinfo" },
+       { NET_IPV6_ACCEPT_RA_RTR_PREF,          "accept_ra_rtr_pref" },
+       { NET_IPV6_RTR_PROBE_INTERVAL,          "router_probe_interval" },
+       { NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN,  "accept_ra_rt_info_max_plen" },
+       { NET_IPV6_PROXY_NDP,                   "proxy_ndp" },
+       { NET_IPV6_ACCEPT_SOURCE_ROUTE,         "accept_source_route" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv6_conf_table[] = {
+       { NET_PROTO_CONF_ALL,           "all",  trans_net_ipv6_conf_var_table },
+       { NET_PROTO_CONF_DEFAULT,       "default", trans_net_ipv6_conf_var_table },
+       { 0, NULL, trans_net_ipv6_conf_var_table },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv6_route_table[] = {
+       { NET_IPV6_ROUTE_FLUSH,                 "flush" },
+       { NET_IPV6_ROUTE_GC_THRESH,             "gc_thresh" },
+       { NET_IPV6_ROUTE_MAX_SIZE,              "max_size" },
+       { NET_IPV6_ROUTE_GC_MIN_INTERVAL,       "gc_min_interval" },
+       { NET_IPV6_ROUTE_GC_TIMEOUT,            "gc_timeout" },
+       { NET_IPV6_ROUTE_GC_INTERVAL,           "gc_interval" },
+       { NET_IPV6_ROUTE_GC_ELASTICITY,         "gc_elasticity" },
+       { NET_IPV6_ROUTE_MTU_EXPIRES,           "mtu_expires" },
+       { NET_IPV6_ROUTE_MIN_ADVMSS,            "min_adv_mss" },
+       { NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,    "gc_min_interval_ms" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv6_icmp_table[] = {
+       { NET_IPV6_ICMP_RATELIMIT,      "ratelimit" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_ipv6_table[] = {
+       { NET_IPV6_CONF,                "conf",         trans_net_ipv6_conf_table },
+       { NET_IPV6_NEIGH,               "neigh",        trans_net_neigh_table },
+       { NET_IPV6_ROUTE,               "route",        trans_net_ipv6_route_table },
+       { NET_IPV6_ICMP,                "icmp",         trans_net_ipv6_icmp_table },
+       { NET_IPV6_BINDV6ONLY,          "bindv6only" },
+       { NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" },
+       { NET_IPV6_IP6FRAG_LOW_THRESH,  "ip6frag_low_thresh" },
+       { NET_IPV6_IP6FRAG_TIME,        "ip6frag_time" },
+       { NET_IPV6_IP6FRAG_SECRET_INTERVAL,     "ip6frag_secret_interval" },
+       { NET_IPV6_MLD_MAX_MSF,         "mld_max_msf" },
+       { 2088 /* IPQ_QMAX */,          "ip6_queue_maxlen" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_x25_table[] = {
+       { NET_X25_RESTART_REQUEST_TIMEOUT,      "restart_request_timeout" },
+       { NET_X25_CALL_REQUEST_TIMEOUT,         "call_request_timeout" },
+       { NET_X25_RESET_REQUEST_TIMEOUT,        "reset_request_timeout" },
+       { NET_X25_CLEAR_REQUEST_TIMEOUT,        "clear_request_timeout" },
+       { NET_X25_ACK_HOLD_BACK_TIMEOUT,        "acknowledgement_hold_back_timeout" },
+       { NET_X25_FORWARD,                      "x25_forward" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_tr_table[] = {
+       { NET_TR_RIF_TIMEOUT,   "rif_timeout" },
+       {}
+};
+
+
+static struct trans_ctl_table trans_net_decnet_conf_vars[] = {
+       { NET_DECNET_CONF_DEV_FORWARDING,       "forwarding" },
+       { NET_DECNET_CONF_DEV_PRIORITY,         "priority" },
+       { NET_DECNET_CONF_DEV_T2,               "t2" },
+       { NET_DECNET_CONF_DEV_T3,               "t3" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_decnet_conf[] = {
+       { 0, NULL, trans_net_decnet_conf_vars },
+       {}
+};
+
+static struct trans_ctl_table trans_net_decnet_table[] = {
+       { NET_DECNET_CONF,              "conf", trans_net_decnet_conf },
+       { NET_DECNET_NODE_ADDRESS,      "node_address" },
+       { NET_DECNET_NODE_NAME,         "node_name" },
+       { NET_DECNET_DEFAULT_DEVICE,    "default_device" },
+       { NET_DECNET_TIME_WAIT,         "time_wait" },
+       { NET_DECNET_DN_COUNT,          "dn_count" },
+       { NET_DECNET_DI_COUNT,          "di_count" },
+       { NET_DECNET_DR_COUNT,          "dr_count" },
+       { NET_DECNET_DST_GC_INTERVAL,   "dst_gc_interval" },
+       { NET_DECNET_NO_FC_MAX_CWND,    "no_fc_max_cwnd" },
+       { NET_DECNET_MEM,               "decnet_mem" },
+       { NET_DECNET_RMEM,              "decnet_rmem" },
+       { NET_DECNET_WMEM,              "decnet_wmem" },
+       { NET_DECNET_DEBUG_LEVEL,       "debug" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_sctp_table[] = {
+       { NET_SCTP_RTO_INITIAL,         "rto_initial" },
+       { NET_SCTP_RTO_MIN,             "rto_min" },
+       { NET_SCTP_RTO_MAX,             "rto_max" },
+       { NET_SCTP_RTO_ALPHA,           "rto_alpha_exp_divisor" },
+       { NET_SCTP_RTO_BETA,            "rto_beta_exp_divisor" },
+       { NET_SCTP_VALID_COOKIE_LIFE,   "valid_cookie_life" },
+       { NET_SCTP_ASSOCIATION_MAX_RETRANS,     "association_max_retrans" },
+       { NET_SCTP_PATH_MAX_RETRANS,    "path_max_retrans" },
+       { NET_SCTP_MAX_INIT_RETRANSMITS,        "max_init_retransmits" },
+       { NET_SCTP_HB_INTERVAL,         "hb_interval" },
+       { NET_SCTP_PRESERVE_ENABLE,     "cookie_preserve_enable" },
+       { NET_SCTP_MAX_BURST,           "max_burst" },
+       { NET_SCTP_ADDIP_ENABLE,        "addip_enable" },
+       { NET_SCTP_PRSCTP_ENABLE,       "prsctp_enable" },
+       { NET_SCTP_SNDBUF_POLICY,       "sndbuf_policy" },
+       { NET_SCTP_SACK_TIMEOUT,        "sack_timeout" },
+       { NET_SCTP_RCVBUF_POLICY,       "rcvbuf_policy" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_llc_llc2_timeout_table[] = {
+       { NET_LLC2_ACK_TIMEOUT,         "ack" },
+       { NET_LLC2_P_TIMEOUT,           "p" },
+       { NET_LLC2_REJ_TIMEOUT,         "rej" },
+       { NET_LLC2_BUSY_TIMEOUT,        "busy" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_llc_station_table[] = {
+       { NET_LLC_STATION_ACK_TIMEOUT,  "ack_timeout" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_llc_llc2_table[] = {
+       { NET_LLC2,             "timeout",      trans_net_llc_llc2_timeout_table },
+       {}
+};
+
+static struct trans_ctl_table trans_net_llc_table[] = {
+       { NET_LLC2,             "llc2",         trans_net_llc_llc2_table },
+       { NET_LLC_STATION,      "station",      trans_net_llc_station_table },
+       {}
+};
+
+static struct trans_ctl_table trans_net_netfilter_table[] = {
+       { NET_NF_CONNTRACK_MAX,                         "nf_conntrack_max" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,        "nf_conntrack_tcp_timeout_syn_sent" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,        "nf_conntrack_tcp_timeout_syn_recv" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,     "nf_conntrack_tcp_timeout_established" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,        "nf_conntrack_tcp_timeout_fin_wait" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,      "nf_conntrack_tcp_timeout_close_wait" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,        "nf_conntrack_tcp_timeout_last_ack" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,       "nf_conntrack_tcp_timeout_time_wait" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,           "nf_conntrack_tcp_timeout_close" },
+       { NET_NF_CONNTRACK_UDP_TIMEOUT,                 "nf_conntrack_udp_timeout" },
+       { NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM,          "nf_conntrack_udp_timeout_stream" },
+       { NET_NF_CONNTRACK_ICMP_TIMEOUT,        "nf_conntrack_icmp_timeout" },
+       { NET_NF_CONNTRACK_GENERIC_TIMEOUT,             "nf_conntrack_generic_timeout" },
+       { NET_NF_CONNTRACK_BUCKETS,                     "nf_conntrack_buckets" },
+       { NET_NF_CONNTRACK_LOG_INVALID,                 "nf_conntrack_log_invalid" },
+       { NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS,     "nf_conntrack_tcp_timeout_max_retrans" },
+       { NET_NF_CONNTRACK_TCP_LOOSE,                   "nf_conntrack_tcp_loose" },
+       { NET_NF_CONNTRACK_TCP_BE_LIBERAL,              "nf_conntrack_tcp_be_liberal" },
+       { NET_NF_CONNTRACK_TCP_MAX_RETRANS,             "nf_conntrack_tcp_max_retrans" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,         "nf_conntrack_sctp_timeout_closed" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT,    "nf_conntrack_sctp_timeout_cookie_wait" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED,  "nf_conntrack_sctp_timeout_cookie_echoed" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED,    "nf_conntrack_sctp_timeout_established" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT,  "nf_conntrack_sctp_timeout_shutdown_sent" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD,  "nf_conntrack_sctp_timeout_shutdown_recd" },
+       { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT,      "nf_conntrack_sctp_timeout_shutdown_ack_sent" },
+       { NET_NF_CONNTRACK_COUNT,                       "nf_conntrack_count" },
+       { NET_NF_CONNTRACK_ICMPV6_TIMEOUT,      "nf_conntrack_icmpv6_timeout" },
+       { NET_NF_CONNTRACK_FRAG6_TIMEOUT,               "nf_conntrack_frag6_timeout" },
+       { NET_NF_CONNTRACK_FRAG6_LOW_THRESH,            "nf_conntrack_frag6_low_thresh" },
+       { NET_NF_CONNTRACK_FRAG6_HIGH_THRESH,           "nf_conntrack_frag6_high_thresh" },
+       { NET_NF_CONNTRACK_CHECKSUM,                    "nf_conntrack_checksum" },
+
+       {}
+};
+
+static struct trans_ctl_table trans_net_dccp_table[] = {
+       { NET_DCCP_DEFAULT,     "default" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_irda_table[] = {
+       { NET_IRDA_DISCOVERY,           "discovery" },
+       { NET_IRDA_DEVNAME,             "devname" },
+       { NET_IRDA_DEBUG,               "debug" },
+       { NET_IRDA_FAST_POLL,           "fast_poll_increase" },
+       { NET_IRDA_DISCOVERY_SLOTS,     "discovery_slots" },
+       { NET_IRDA_DISCOVERY_TIMEOUT,   "discovery_timeout" },
+       { NET_IRDA_SLOT_TIMEOUT,        "slot_timeout" },
+       { NET_IRDA_MAX_BAUD_RATE,       "max_baud_rate" },
+       { NET_IRDA_MIN_TX_TURN_TIME,    "min_tx_turn_time" },
+       { NET_IRDA_MAX_TX_DATA_SIZE,    "max_tx_data_size" },
+       { NET_IRDA_MAX_TX_WINDOW,       "max_tx_window" },
+       { NET_IRDA_MAX_NOREPLY_TIME,    "max_noreply_time" },
+       { NET_IRDA_WARN_NOREPLY_TIME,   "warn_noreply_time" },
+       { NET_IRDA_LAP_KEEPALIVE_TIME,  "lap_keepalive_time" },
+       {}
+};
+
+static struct trans_ctl_table trans_net_table[] = {
+       { NET_CORE,             "core",         trans_net_core_table },
+       /* NET_ETHER not used */
+       /* NET_802 not used */
+       { NET_UNIX,             "unix",         trans_net_unix_table },
+       { NET_IPV4,             "ipv4",         trans_net_ipv4_table },
+       { NET_IPX,              "ipx",          trans_net_ipx_table },
+       { NET_ATALK,            "atalk",        trans_net_atalk_table },
+       { NET_NETROM,           "netrom",       trans_net_netrom_table },
+       { NET_AX25,             "ax25",         trans_net_ax25_table },
+       { NET_BRIDGE,           "bridge",       trans_net_bridge_table },
+       { NET_ROSE,             "rose",         trans_net_rose_table },
+       { NET_IPV6,             "ipv6",         trans_net_ipv6_table },
+       { NET_X25,              "x25",          trans_net_x25_table },
+       { NET_TR,               "tr",           trans_net_tr_table },
+       { NET_DECNET,           "decnet",       trans_net_decnet_table },
+       /*  NET_ECONET not used */
+       { NET_SCTP,             "sctp",         trans_net_sctp_table },
+       { NET_LLC,              "llc",          trans_net_llc_table },
+       { NET_NETFILTER,        "netfilter",    trans_net_netfilter_table },
+       { NET_DCCP,             "dccp",         trans_net_dccp_table },
+       { NET_IRDA,             "irda",         trans_net_irda_table },
+       { 2089,                 "nf_conntrack_max" },
+       {}
+};
+
+static struct trans_ctl_table trans_fs_quota_table[] = {
+       { FS_DQ_LOOKUPS,        "lookups" },
+       { FS_DQ_DROPS,          "drops" },
+       { FS_DQ_READS,          "reads" },
+       { FS_DQ_WRITES,         "writes" },
+       { FS_DQ_CACHE_HITS,     "cache_hits" },
+       { FS_DQ_ALLOCATED,      "allocated_dquots" },
+       { FS_DQ_FREE,           "free_dquots" },
+       { FS_DQ_SYNCS,          "syncs" },
+       { FS_DQ_WARNINGS,       "warnings" },
+       {}
+};
+
+static struct trans_ctl_table trans_fs_xfs_table[] = {
+       { XFS_RESTRICT_CHOWN,   "restrict_chown" },
+       { XFS_SGID_INHERIT,     "irix_sgid_inherit" },
+       { XFS_SYMLINK_MODE,     "irix_symlink_mode" },
+       { XFS_PANIC_MASK,       "panic_mask" },
+
+       { XFS_ERRLEVEL,         "error_level" },
+       { XFS_SYNCD_TIMER,      "xfssyncd_centisecs" },
+       { XFS_INHERIT_SYNC,     "inherit_sync" },
+       { XFS_INHERIT_NODUMP,   "inherit_nodump" },
+       { XFS_INHERIT_NOATIME,  "inherit_noatime" },
+       { XFS_BUF_TIMER,        "xfsbufd_centisecs" },
+       { XFS_BUF_AGE,          "age_buffer_centisecs" },
+       { XFS_INHERIT_NOSYM,    "inherit_nosymlinks" },
+       { XFS_ROTORSTEP,        "rotorstep" },
+       { XFS_INHERIT_NODFRG,   "inherit_nodefrag" },
+       { XFS_FILESTREAM_TIMER, "filestream_centisecs" },
+       { XFS_STATS_CLEAR,      "stats_clear" },
+       {}
+};
+
+static struct trans_ctl_table trans_fs_ocfs2_nm_table[] = {
+       { 1, "hb_ctl_path" },
+       {}
+};
+
+static struct trans_ctl_table trans_fs_ocfs2_table[] = {
+       { 1,    "nm",   trans_fs_ocfs2_nm_table },
+       {}
+};
+
+static struct trans_ctl_table trans_inotify_table[] = {
+       { INOTIFY_MAX_USER_INSTANCES,   "max_user_instances" },
+       { INOTIFY_MAX_USER_WATCHES,     "max_user_watches" },
+       { INOTIFY_MAX_QUEUED_EVENTS,    "max_queued_events" },
+       {}
+};
+
+static struct trans_ctl_table trans_fs_table[] = {
+       { FS_NRINODE,           "inode-nr" },
+       { FS_STATINODE,         "inode-state" },
+       /* FS_MAXINODE unused */
+       /* FS_NRDQUOT unused */
+       /* FS_MAXDQUOT unused */
+       { FS_NRFILE,            "file-nr" },
+       { FS_MAXFILE,           "file-max" },
+       { FS_DENTRY,            "dentry-state" },
+       /* FS_NRSUPER unused */
+       /* FS_MAXUPSER unused */
+       { FS_OVERFLOWUID,       "overflowuid" },
+       { FS_OVERFLOWGID,       "overflowgid" },
+       { FS_LEASES,            "leases-enable" },
+       { FS_DIR_NOTIFY,        "dir-notify-enable" },
+       { FS_LEASE_TIME,        "lease-break-time" },
+       { FS_DQSTATS,           "quota",                trans_fs_quota_table },
+       { FS_XFS,               "xfs",                  trans_fs_xfs_table },
+       { FS_AIO_NR,            "aio-nr" },
+       { FS_AIO_MAX_NR,        "aio-max-nr" },
+       { FS_INOTIFY,           "inotify",              trans_inotify_table },
+       { FS_OCFS2,             "ocfs2",                trans_fs_ocfs2_table },
+       { KERN_SETUID_DUMPABLE, "suid_dumpable" },
+       {}
+};
+
+static struct trans_ctl_table trans_debug_table[] = {
+       {}
+};
+
+static struct trans_ctl_table trans_cdrom_table[] = {
+       { DEV_CDROM_INFO,               "info" },
+       { DEV_CDROM_AUTOCLOSE,          "autoclose" },
+       { DEV_CDROM_AUTOEJECT,          "autoeject" },
+       { DEV_CDROM_DEBUG,              "debug" },
+       { DEV_CDROM_LOCK,               "lock" },
+       { DEV_CDROM_CHECK_MEDIA,        "check_media" },
+       {}
+};
+
+static struct trans_ctl_table trans_ipmi_table[] = {
+       { DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" },
+       {}
+};
+
+static struct trans_ctl_table trans_mac_hid_files[] = {
+       /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */
+       /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */
+       { DEV_MAC_HID_MOUSE_BUTTON_EMULATION,   "mouse_button_emulation" },
+       { DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,    "mouse_button2_keycode" },
+       { DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,    "mouse_button3_keycode" },
+       /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */
+       {}
+};
+
+static struct trans_ctl_table trans_raid_table[] = {
+       { DEV_RAID_SPEED_LIMIT_MIN,     "speed_limit_min" },
+       { DEV_RAID_SPEED_LIMIT_MAX,     "speed_limit_max" },
+       {}
+};
+
+static struct trans_ctl_table trans_scsi_table[] = {
+       { DEV_SCSI_LOGGING_LEVEL, "logging_level" },
+       {}
+};
+
+static struct trans_ctl_table trans_parport_default_table[] = {
+       { DEV_PARPORT_DEFAULT_TIMESLICE,        "timeslice" },
+       { DEV_PARPORT_DEFAULT_SPINTIME,         "spintime" },
+       {}
+};
+
+static struct trans_ctl_table trans_parport_device_table[] = {
+       { DEV_PARPORT_DEVICE_TIMESLICE,         "timeslice" },
+       {}
+};
+
+static struct trans_ctl_table trans_parport_devices_table[] = {
+       { DEV_PARPORT_DEVICES_ACTIVE,           "active" },
+       { 0, NULL, trans_parport_device_table },
+       {}
+};
+
+static struct trans_ctl_table trans_parport_parport_table[] = {
+       { DEV_PARPORT_SPINTIME,         "spintime" },
+       { DEV_PARPORT_BASE_ADDR,        "base-addr" },
+       { DEV_PARPORT_IRQ,              "irq" },
+       { DEV_PARPORT_DMA,              "dma" },
+       { DEV_PARPORT_MODES,            "modes" },
+       { DEV_PARPORT_DEVICES,          "devices",      trans_parport_devices_table },
+       { DEV_PARPORT_AUTOPROBE,        "autoprobe" },
+       { DEV_PARPORT_AUTOPROBE + 1,    "autoprobe0" },
+       { DEV_PARPORT_AUTOPROBE + 2,    "autoprobe1" },
+       { DEV_PARPORT_AUTOPROBE + 3,    "autoprobe2" },
+       { DEV_PARPORT_AUTOPROBE + 4,    "autoprobe3" },
+       {}
+};
+static struct trans_ctl_table trans_parport_table[] = {
+       { DEV_PARPORT_DEFAULT,  "default",      trans_parport_default_table },
+       { 0, NULL, trans_parport_parport_table },
+       {}
+};
+
+static struct trans_ctl_table trans_dev_table[] = {
+       { DEV_CDROM,    "cdrom",        trans_cdrom_table },
+       /* DEV_HWMON unused */
+       { DEV_PARPORT,  "parport",      trans_parport_table },
+       { DEV_RAID,     "raid",         trans_raid_table },
+       { DEV_MAC_HID,  "mac_hid",      trans_mac_hid_files },
+       { DEV_SCSI,     "scsi",         trans_scsi_table },
+       { DEV_IPMI,     "ipmi",         trans_ipmi_table },
+       {}
+};
+
+static struct trans_ctl_table trans_bus_isa_table[] = {
+       { BUS_ISA_MEM_BASE,     "membase" },
+       { BUS_ISA_PORT_BASE,    "portbase" },
+       { BUS_ISA_PORT_SHIFT,   "portshift" },
+       {}
+};
+
+static struct trans_ctl_table trans_bus_table[] = {
+       { CTL_BUS_ISA,  "isa",  trans_bus_isa_table },
+       {}
+};
+
+static struct trans_ctl_table trans_arlan_conf_table0[] = {
+       { 1,    "spreadingCode" },
+       { 2,    "channelNumber" },
+       { 3,    "scramblingDisable" },
+       { 4,    "txAttenuation" },
+       { 5,    "systemId" },
+       { 6,    "maxDatagramSize" },
+       { 7,    "maxFrameSize" },
+       { 8,    "maxRetries" },
+       { 9,    "receiveMode" },
+       { 10,   "priority" },
+       { 11,   "rootOrRepeater" },
+       { 12,   "SID" },
+       { 13,   "registrationMode" },
+       { 14,   "registrationFill" },
+       { 15,   "localTalkAddress" },
+       { 16,   "codeFormat" },
+       { 17,   "numChannels" },
+       { 18,   "channel1" },
+       { 19,   "channel2" },
+       { 20,   "channel3" },
+       { 21,   "channel4" },
+       { 22,   "txClear" },
+       { 23,   "txRetries" },
+       { 24,   "txRouting" },
+       { 25,   "txScrambled" },
+       { 26,   "rxParameter" },
+       { 27,   "txTimeoutMs" },
+       { 28,   "waitCardTimeout" },
+       { 29,   "channelSet" },
+       { 30,   "name" },
+       { 31,   "waitTime" },
+       { 32,   "lParameter" },
+       { 33,   "_15" },
+       { 34,   "headerSize" },
+       { 36,   "tx_delay_ms" },
+       { 37,   "retries" },
+       { 38,   "ReTransmitPacketMaxSize" },
+       { 39,   "waitReTransmitPacketMaxSize" },
+       { 40,   "fastReTransCount" },
+       { 41,   "driverRetransmissions" },
+       { 42,   "txAckTimeoutMs" },
+       { 43,   "registrationInterrupts" },
+       { 44,   "hardwareType" },
+       { 45,   "radioType" },
+       { 46,   "writeEEPROM" },
+       { 47,   "writeRadioType" },
+       { 48,   "entry_exit_debug" },
+       { 49,   "debug" },
+       { 50,   "in_speed" },
+       { 51,   "out_speed" },
+       { 52,   "in_speed10" },
+       { 53,   "out_speed10" },
+       { 54,   "in_speed_max" },
+       { 55,   "out_speed_max" },
+       { 56,   "measure_rate" },
+       { 57,   "pre_Command_Wait" },
+       { 58,   "rx_tweak1" },
+       { 59,   "rx_tweak2" },
+       { 60,   "tx_queue_len" },
+
+       { 150,  "arlan0-txRing" },
+       { 151,  "arlan0-rxRing" },
+       { 152,  "arlan0-18" },
+       { 153,  "arlan0-ring" },
+       { 154,  "arlan0-shm-cpy" },
+       { 155,  "config0" },
+       { 156,  "reset0" },
+       {}
+};
+
+static struct trans_ctl_table trans_arlan_conf_table1[] = {
+       { 1,    "spreadingCode" },
+       { 2,    "channelNumber" },
+       { 3,    "scramblingDisable" },
+       { 4,    "txAttenuation" },
+       { 5,    "systemId" },
+       { 6,    "maxDatagramSize" },
+       { 7,    "maxFrameSize" },
+       { 8,    "maxRetries" },
+       { 9,    "receiveMode" },
+       { 10,   "priority" },
+       { 11,   "rootOrRepeater" },
+       { 12,   "SID" },
+       { 13,   "registrationMode" },
+       { 14,   "registrationFill" },
+       { 15,   "localTalkAddress" },
+       { 16,   "codeFormat" },
+       { 17,   "numChannels" },
+       { 18,   "channel1" },
+       { 19,   "channel2" },
+       { 20,   "channel3" },
+       { 21,   "channel4" },
+       { 22,   "txClear" },
+       { 23,   "txRetries" },
+       { 24,   "txRouting" },
+       { 25,   "txScrambled" },
+       { 26,   "rxParameter" },
+       { 27,   "txTimeoutMs" },
+       { 28,   "waitCardTimeout" },
+       { 29,   "channelSet" },
+       { 30,   "name" },
+       { 31,   "waitTime" },
+       { 32,   "lParameter" },
+       { 33,   "_15" },
+       { 34,   "headerSize" },
+       { 36,   "tx_delay_ms" },
+       { 37,   "retries" },
+       { 38,   "ReTransmitPacketMaxSize" },
+       { 39,   "waitReTransmitPacketMaxSize" },
+       { 40,   "fastReTransCount" },
+       { 41,   "driverRetransmissions" },
+       { 42,   "txAckTimeoutMs" },
+       { 43,   "registrationInterrupts" },
+       { 44,   "hardwareType" },
+       { 45,   "radioType" },
+       { 46,   "writeEEPROM" },
+       { 47,   "writeRadioType" },
+       { 48,   "entry_exit_debug" },
+       { 49,   "debug" },
+       { 50,   "in_speed" },
+       { 51,   "out_speed" },
+       { 52,   "in_speed10" },
+       { 53,   "out_speed10" },
+       { 54,   "in_speed_max" },
+       { 55,   "out_speed_max" },
+       { 56,   "measure_rate" },
+       { 57,   "pre_Command_Wait" },
+       { 58,   "rx_tweak1" },
+       { 59,   "rx_tweak2" },
+       { 60,   "tx_queue_len" },
+
+       { 150,  "arlan1-txRing" },
+       { 151,  "arlan1-rxRing" },
+       { 152,  "arlan1-18" },
+       { 153,  "arlan1-ring" },
+       { 154,  "arlan1-shm-cpy" },
+       { 155,  "config1" },
+       { 156,  "reset1" },
+       {}
+};
+
+static struct trans_ctl_table trans_arlan_conf_table2[] = {
+       { 1,    "spreadingCode" },
+       { 2,    "channelNumber" },
+       { 3,    "scramblingDisable" },
+       { 4,    "txAttenuation" },
+       { 5,    "systemId" },
+       { 6,    "maxDatagramSize" },
+       { 7,    "maxFrameSize" },
+       { 8,    "maxRetries" },
+       { 9,    "receiveMode" },
+       { 10,   "priority" },
+       { 11,   "rootOrRepeater" },
+       { 12,   "SID" },
+       { 13,   "registrationMode" },
+       { 14,   "registrationFill" },
+       { 15,   "localTalkAddress" },
+       { 16,   "codeFormat" },
+       { 17,   "numChannels" },
+       { 18,   "channel1" },
+       { 19,   "channel2" },
+       { 20,   "channel3" },
+       { 21,   "channel4" },
+       { 22,   "txClear" },
+       { 23,   "txRetries" },
+       { 24,   "txRouting" },
+       { 25,   "txScrambled" },
+       { 26,   "rxParameter" },
+       { 27,   "txTimeoutMs" },
+       { 28,   "waitCardTimeout" },
+       { 29,   "channelSet" },
+       { 30,   "name" },
+       { 31,   "waitTime" },
+       { 32,   "lParameter" },
+       { 33,   "_15" },
+       { 34,   "headerSize" },
+       { 36,   "tx_delay_ms" },
+       { 37,   "retries" },
+       { 38,   "ReTransmitPacketMaxSize" },
+       { 39,   "waitReTransmitPacketMaxSize" },
+       { 40,   "fastReTransCount" },
+       { 41,   "driverRetransmissions" },
+       { 42,   "txAckTimeoutMs" },
+       { 43,   "registrationInterrupts" },
+       { 44,   "hardwareType" },
+       { 45,   "radioType" },
+       { 46,   "writeEEPROM" },
+       { 47,   "writeRadioType" },
+       { 48,   "entry_exit_debug" },
+       { 49,   "debug" },
+       { 50,   "in_speed" },
+       { 51,   "out_speed" },
+       { 52,   "in_speed10" },
+       { 53,   "out_speed10" },
+       { 54,   "in_speed_max" },
+       { 55,   "out_speed_max" },
+       { 56,   "measure_rate" },
+       { 57,   "pre_Command_Wait" },
+       { 58,   "rx_tweak1" },
+       { 59,   "rx_tweak2" },
+       { 60,   "tx_queue_len" },
+
+       { 150,  "arlan2-txRing" },
+       { 151,  "arlan2-rxRing" },
+       { 152,  "arlan2-18" },
+       { 153,  "arlan2-ring" },
+       { 154,  "arlan2-shm-cpy" },
+       { 155,  "config2" },
+       { 156,  "reset2" },
+       {}
+};
+
+static struct trans_ctl_table trans_arlan_conf_table3[] = {
+       { 1,    "spreadingCode" },
+       { 2,    "channelNumber" },
+       { 3,    "scramblingDisable" },
+       { 4,    "txAttenuation" },
+       { 5,    "systemId" },
+       { 6,    "maxDatagramSize" },
+       { 7,    "maxFrameSize" },
+       { 8,    "maxRetries" },
+       { 9,    "receiveMode" },
+       { 10,   "priority" },
+       { 11,   "rootOrRepeater" },
+       { 12,   "SID" },
+       { 13,   "registrationMode" },
+       { 14,   "registrationFill" },
+       { 15,   "localTalkAddress" },
+       { 16,   "codeFormat" },
+       { 17,   "numChannels" },
+       { 18,   "channel1" },
+       { 19,   "channel2" },
+       { 20,   "channel3" },
+       { 21,   "channel4" },
+       { 22,   "txClear" },
+       { 23,   "txRetries" },
+       { 24,   "txRouting" },
+       { 25,   "txScrambled" },
+       { 26,   "rxParameter" },
+       { 27,   "txTimeoutMs" },
+       { 28,   "waitCardTimeout" },
+       { 29,   "channelSet" },
+       { 30,   "name" },
+       { 31,   "waitTime" },
+       { 32,   "lParameter" },
+       { 33,   "_15" },
+       { 34,   "headerSize" },
+       { 36,   "tx_delay_ms" },
+       { 37,   "retries" },
+       { 38,   "ReTransmitPacketMaxSize" },
+       { 39,   "waitReTransmitPacketMaxSize" },
+       { 40,   "fastReTransCount" },
+       { 41,   "driverRetransmissions" },
+       { 42,   "txAckTimeoutMs" },
+       { 43,   "registrationInterrupts" },
+       { 44,   "hardwareType" },
+       { 45,   "radioType" },
+       { 46,   "writeEEPROM" },
+       { 47,   "writeRadioType" },
+       { 48,   "entry_exit_debug" },
+       { 49,   "debug" },
+       { 50,   "in_speed" },
+       { 51,   "out_speed" },
+       { 52,   "in_speed10" },
+       { 53,   "out_speed10" },
+       { 54,   "in_speed_max" },
+       { 55,   "out_speed_max" },
+       { 56,   "measure_rate" },
+       { 57,   "pre_Command_Wait" },
+       { 58,   "rx_tweak1" },
+       { 59,   "rx_tweak2" },
+       { 60,   "tx_queue_len" },
+
+       { 150,  "arlan3-txRing" },
+       { 151,  "arlan3-rxRing" },
+       { 152,  "arlan3-18" },
+       { 153,  "arlan3-ring" },
+       { 154,  "arlan3-shm-cpy" },
+       { 155,  "config3" },
+       { 156,  "reset3" },
+       {}
+};
+
+static struct trans_ctl_table trans_arlan_table[] = {
+       { 1,            "arlan0",       trans_arlan_conf_table0 },
+       { 2,            "arlan1",       trans_arlan_conf_table1 },
+       { 3,            "arlan2",       trans_arlan_conf_table2 },
+       { 4,            "arlan3",       trans_arlan_conf_table3 },
+       {}
+};
+
+static struct trans_ctl_table trans_appldata_table[] = {
+       { CTL_APPLDATA_TIMER,           "timer" },
+       { CTL_APPLDATA_INTERVAL,        "interval" },
+       { CTL_APPLDATA_OS,              "os" },
+       { CTL_APPLDATA_NET_SUM,         "net_sum" },
+       { CTL_APPLDATA_MEM,             "mem" },
+       {}
+
+};
+
+static struct trans_ctl_table trans_s390dbf_table[] = {
+       { 5678 /* CTL_S390DBF_STOPPABLE */,     "debug_stoppable" },
+       { 5679 /* CTL_S390DBF_ACTIVE */,        "debug_active" },
+       {}
+};
+
+static struct trans_ctl_table trans_sunrpc_table[] = {
+       { CTL_RPCDEBUG,         "rpc_debug" },
+       { CTL_NFSDEBUG,         "nfs_debug" },
+       { CTL_NFSDDEBUG,        "nfsd_debug" },
+       { CTL_NLMDEBUG,         "nlm_debug" },
+       { CTL_SLOTTABLE_UDP,    "udp_slot_table_entries" },
+       { CTL_SLOTTABLE_TCP,    "tcp_slot_table_entries" },
+       { CTL_MIN_RESVPORT,     "min_resvport" },
+       { CTL_MAX_RESVPORT,     "max_resvport" },
+       {}
+};
+
+static struct trans_ctl_table trans_pm_table[] = {
+       { 1 /* CTL_PM_SUSPEND */,       "suspend" },
+       { 2 /* CTL_PM_CMODE */,         "cmode" },
+       { 3 /* CTL_PM_P0 */,            "p0" },
+       { 4 /* CTL_PM_CM */,            "cm" },
+       {}
+};
+
+static struct trans_ctl_table trans_frv_table[] = {
+       { 1,    "cache-mode" },
+       { 2,    "pin-cxnr" },
+       {}
+};
+
+static struct trans_ctl_table trans_root_table[] = {
+       { CTL_KERN,     "kernel",       trans_kern_table },
+       { CTL_VM,       "vm",           trans_vm_table },
+       { CTL_NET,      "net",          trans_net_table },
+       /* CTL_PROC not used */
+       { CTL_FS,       "fs",           trans_fs_table },
+       { CTL_DEBUG,    "debug",        trans_debug_table },
+       { CTL_DEV,      "dev",          trans_dev_table },
+       { CTL_BUS,      "bus",          trans_bus_table },
+       { CTL_ABI,      "abi" },
+       /* CTL_CPU not used */
+       { CTL_ARLAN,    "arlan",        trans_arlan_table },
+       { CTL_APPLDATA, "appldata",     trans_appldata_table },
+       { CTL_S390DBF,  "s390dbf",      trans_s390dbf_table },
+       { CTL_SUNRPC,   "sunrpc",       trans_sunrpc_table },
+       { CTL_PM,       "pm",           trans_pm_table },
+       { CTL_FRV,      "frv",          trans_frv_table },
+       {}
+};
+
+
+
+
+static int sysctl_depth(struct ctl_table *table)
+{
+       struct ctl_table *tmp;
+       int depth;
+
+       depth = 0;
+       for (tmp = table; tmp->parent; tmp = tmp->parent)
+               depth++;
+
+       return depth;
+}
+
+static struct ctl_table *sysctl_parent(struct ctl_table *table, int n)
+{
+       int i;
+
+       for (i = 0; table && i < n; i++)
+               table = table->parent;
+
+       return table;
+}
+
+static struct trans_ctl_table *sysctl_binary_lookup(struct ctl_table *table)
+{
+       struct ctl_table *test;
+       struct trans_ctl_table *ref;
+       int depth, cur_depth;
+
+       depth = sysctl_depth(table);
+
+       cur_depth = depth;
+       ref = trans_root_table;
+repeat:
+       test = sysctl_parent(table, cur_depth);
+       for (; ref->ctl_name || ref->procname || ref->child; ref++) {
+               int match = 0;
+
+               if (cur_depth && !ref->child)
+                       continue;
+
+               if (test->procname && ref->procname &&
+                       (strcmp(test->procname, ref->procname) == 0))
+                       match++;
+
+               if (test->ctl_name && ref->ctl_name &&
+                       (test->ctl_name == ref->ctl_name))
+                       match++;
+
+               if (!ref->ctl_name && !ref->procname)
+                       match++;
+
+               if (match) {
+                       if (cur_depth != 0) {
+                               cur_depth--;
+                               ref = ref->child;
+                               goto repeat;
+                       }
+                       goto out;
+               }
+       }
+       ref = NULL;
+out:
+       return ref;
+}
+
+static void sysctl_print_path(struct ctl_table *table)
+{
+       struct ctl_table *tmp;
+       int depth, i;
+       depth = sysctl_depth(table);
+       if (table->procname) {
+               for (i = depth; i >= 0; i--) {
+                       tmp = sysctl_parent(table, i);
+                       printk("/%s", tmp->procname?tmp->procname:"");
+               }
+       }
+       printk(" ");
+       if (table->ctl_name) {
+               for (i = depth; i >= 0; i--) {
+                       tmp = sysctl_parent(table, i);
+                       printk(".%d", tmp->ctl_name);
+               }
+       }
+}
+
+static void sysctl_repair_table(struct ctl_table *table)
+{
+       /* Don't complain about the classic default
+        * sysctl strategy routine.  Maybe later we
+        * can get the tables fixed and complain about
+        * this.
+        */
+       if (table->ctl_name && table->procname &&
+               (table->proc_handler == proc_dointvec) &&
+               (!table->strategy)) {
+               table->strategy = sysctl_data;
+       }
+}
+
+static struct ctl_table *sysctl_check_lookup(struct ctl_table *table)
+{
+       struct ctl_table_header *head;
+       struct ctl_table *ref, *test;
+       int depth, cur_depth;
+
+       depth = sysctl_depth(table);
+
+       for (head = sysctl_head_next(NULL); head;
+            head = sysctl_head_next(head)) {
+               cur_depth = depth;
+               ref = head->ctl_table;
+repeat:
+               test = sysctl_parent(table, cur_depth);
+               for (; ref->ctl_name || ref->procname; ref++) {
+                       int match = 0;
+                       if (cur_depth && !ref->child)
+                               continue;
+
+                       if (test->procname && ref->procname &&
+                           (strcmp(test->procname, ref->procname) == 0))
+                                       match++;
+
+                       if (test->ctl_name && ref->ctl_name &&
+                           (test->ctl_name == ref->ctl_name))
+                               match++;
+
+                       if (match) {
+                               if (cur_depth != 0) {
+                                       cur_depth--;
+                                       ref = ref->child;
+                                       goto repeat;
+                               }
+                               goto out;
+                       }
+               }
+       }
+       ref = NULL;
+out:
+       sysctl_head_finish(head);
+       return ref;
+}
+
+static void set_fail(const char **fail, struct ctl_table *table, const char *str)
+{
+       if (*fail) {
+               printk(KERN_ERR "sysctl table check failed: ");
+               sysctl_print_path(table);
+               printk(" %s\n", *fail);
+       }
+       *fail = str;
+}
+
+static int sysctl_check_dir(struct ctl_table *table)
+{
+       struct ctl_table *ref;
+       int error;
+
+       error = 0;
+       ref = sysctl_check_lookup(table);
+       if (ref) {
+               int match = 0;
+               if ((!table->procname && !ref->procname) ||
+                   (table->procname && ref->procname &&
+                    (strcmp(table->procname, ref->procname) == 0)))
+                       match++;
+
+               if ((!table->ctl_name && !ref->ctl_name) ||
+                   (table->ctl_name && ref->ctl_name &&
+                    (table->ctl_name == ref->ctl_name)))
+                       match++;
+
+               if (match != 2) {
+                       printk(KERN_ERR "%s: failed: ", __func__);
+                       sysctl_print_path(table);
+                       printk(" ref: ");
+                       sysctl_print_path(ref);
+                       printk("\n");
+                       error = -EINVAL;
+               }
+       }
+       return error;
+}
+
+static void sysctl_check_leaf(struct ctl_table *table, const char **fail)
+{
+       struct ctl_table *ref;
+
+       ref = sysctl_check_lookup(table);
+       if (ref && (ref != table))
+               set_fail(fail, table, "Sysctl already exists");
+}
+
+static void sysctl_check_bin_path(struct ctl_table *table, const char **fail)
+{
+       struct trans_ctl_table *ref;
+
+       ref = sysctl_binary_lookup(table);
+       if (table->ctl_name && !ref)
+               set_fail(fail, table, "Unknown sysctl binary path");
+       if (ref) {
+               if (ref->procname &&
+                   (!table->procname ||
+                    (strcmp(table->procname, ref->procname) != 0)))
+                       set_fail(fail, table, "procname does not match binary path procname");
+
+               if (ref->ctl_name && table->ctl_name &&
+                   (table->ctl_name != ref->ctl_name))
+                       set_fail(fail, table, "ctl_name does not match binary path ctl_name");
+       }
+}
+
+int sysctl_check_table(struct ctl_table *table)
+{
+       int error = 0;
+       for (; table->ctl_name || table->procname; table++) {
+               const char *fail = NULL;
+
+               sysctl_repair_table(table);
+               if (table->parent) {
+                       if (table->procname && !table->parent->procname)
+                               set_fail(&fail, table, "Parent without procname");
+                       if (table->ctl_name && !table->parent->ctl_name)
+                               set_fail(&fail, table, "Parent without ctl_name");
+               }
+               if (!table->procname)
+                       set_fail(&fail, table, "No procname");
+               if (table->child) {
+                       if (table->data)
+                               set_fail(&fail, table, "Directory with data?");
+                       if (table->maxlen)
+                               set_fail(&fail, table, "Directory with maxlen?");
+                       if ((table->mode & (S_IRUGO|S_IXUGO)) != table->mode)
+                               set_fail(&fail, table, "Writable sysctl directory");
+                       if (table->proc_handler)
+                               set_fail(&fail, table, "Directory with proc_handler");
+                       if (table->strategy)
+                               set_fail(&fail, table, "Directory with strategy");
+                       if (table->extra1)
+                               set_fail(&fail, table, "Directory with extra1");
+                       if (table->extra2)
+                               set_fail(&fail, table, "Directory with extra2");
+                       if (sysctl_check_dir(table))
+                               set_fail(&fail, table, "Inconsistent directory names");
+               } else {
+                       if ((table->strategy == sysctl_data) ||
+                           (table->strategy == sysctl_string) ||
+                           (table->strategy == sysctl_intvec) ||
+                           (table->strategy == sysctl_jiffies) ||
+                           (table->strategy == sysctl_ms_jiffies) ||
+                           (table->proc_handler == proc_dostring) ||
+                           (table->proc_handler == proc_dointvec) ||
+#ifdef CONFIG_SECURITY_CAPABILITIES
+                           (table->proc_handler == proc_dointvec_bset) ||
+#endif /* def CONFIG_SECURITY_CAPABILITIES */
+                           (table->proc_handler == proc_dointvec_minmax) ||
+                           (table->proc_handler == proc_dointvec_jiffies) ||
+                           (table->proc_handler == proc_dointvec_userhz_jiffies) ||
+                           (table->proc_handler == proc_dointvec_ms_jiffies) ||
+                           (table->proc_handler == proc_doulongvec_minmax) ||
+                           (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
+                               if (!table->data)
+                                       set_fail(&fail, table, "No data");
+                               if (!table->maxlen)
+                                       set_fail(&fail, table, "No maxlen");
+                       }
+                       if ((table->proc_handler == proc_doulongvec_minmax) ||
+                           (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
+                               if (table->maxlen > sizeof (unsigned long)) {
+                                       if (!table->extra1)
+                                               set_fail(&fail, table, "No min");
+                                       if (!table->extra2)
+                                               set_fail(&fail, table, "No max");
+                               }
+                       }
+#ifdef CONFIG_SYSCTL_SYSCALL
+                       if (table->ctl_name && !table->strategy)
+                               set_fail(&fail, table, "Missing strategy");
+#endif
+#if 0
+                       if (!table->ctl_name && table->strategy)
+                               set_fail(&fail, table, "Strategy without ctl_name");
+#endif
+#ifdef CONFIG_PROC_FS
+                       if (table->procname && !table->proc_handler)
+                               set_fail(&fail, table, "No proc_handler");
+#endif
+#if 0
+                       if (!table->procname && table->proc_handler)
+                               set_fail(&fail, table, "proc_handler without procname");
+#endif
+                       sysctl_check_leaf(table, &fail);
+               }
+               sysctl_check_bin_path(table, &fail);
+               if (fail) {
+                       set_fail(&fail, table, NULL);
+                       error = -EINVAL;
+               }
+               if (table->child)
+                       error |= sysctl_check_table(table->child);
+       }
+       return error;
+}
index 2d5b6a682138d12af18eb2b93caeca9c4443c56f..09d3c45c4da78d9af2bec9e10f89e37bfeec01d5 100644 (file)
@@ -9,9 +9,9 @@
  */
 /*
  * Modification history kernel/time.c
- * 
+ *
  * 1993-09-02    Philip Gladstone
- *      Created file with time related functions from sched.c and adjtimex() 
+ *      Created file with time related functions from sched.c and adjtimex()
  * 1993-10-08    Torsten Duwe
  *      adjtime interface update and CMOS clock write code
  * 1995-08-13    Torsten Duwe
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/timex.h>
 #include <linux/capability.h>
+#include <linux/clocksource.h>
 #include <linux/errno.h>
 #include <linux/syscalls.h>
 #include <linux/security.h>
@@ -38,7 +39,7 @@
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 
-/* 
+/*
  * The timezone where the local system is located.  Used as a default by some
  * programs who obtain this value by using gettimeofday.
  */
@@ -71,7 +72,7 @@ asmlinkage long sys_time(time_t __user * tloc)
  * why not move it into the appropriate arch directory (for those
  * architectures that need it).
  */
+
 asmlinkage long sys_stime(time_t __user *tptr)
 {
        struct timespec tv;
@@ -110,10 +111,10 @@ asmlinkage long sys_gettimeofday(struct timeval __user *tv, struct timezone __us
 /*
  * Adjust the time obtained from the CMOS to be UTC time instead of
  * local time.
- * 
+ *
  * This is ugly, but preferable to the alternatives.  Otherwise we
  * would either need to write a program to do it in /etc/rc (and risk
- * confusion if the program gets run more than once; it would also be 
+ * confusion if the program gets run more than once; it would also be
  * hard to make the program warp the clock precisely n hours)  or
  * compile in the timezone information into the kernel.  Bad, bad....
  *
@@ -158,6 +159,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
        if (tz) {
                /* SMP safe, global irq locking makes it work. */
                sys_tz = *tz;
+               update_vsyscall_tz();
                if (firsttime) {
                        firsttime = 0;
                        if (!tv)
index 6ce1952eea7dbf84d4d9a4c3a5d03f8fd5bffbf3..8521d10fbb27543602bcd71ae503ce44d21d73f3 100644 (file)
@@ -817,7 +817,7 @@ unsigned long next_timer_interrupt(void)
 #endif
 
 /*
- * Called from the timer interrupt handler to charge one tick to the current 
+ * Called from the timer interrupt handler to charge one tick to the current
  * process.  user_tick is 1 if the tick is user time, 0 for system.
  */
 void update_process_times(int user_tick)
@@ -826,10 +826,13 @@ void update_process_times(int user_tick)
        int cpu = smp_processor_id();
 
        /* Note: this timer irq context must be accounted for as well. */
-       if (user_tick)
+       if (user_tick) {
                account_user_time(p, jiffies_to_cputime(1));
-       else
+               account_user_time_scaled(p, jiffies_to_cputime(1));
+       } else {
                account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1));
+               account_system_time_scaled(p, jiffies_to_cputime(1));
+       }
        run_local_timers();
        if (rcu_pending(cpu))
                rcu_check_callbacks(cpu, user_tick);
index c122131a122f54121f239ece78f830efbaf90d69..4ab1b584961b922afacc61f80750d1f0396ac0ec 100644 (file)
@@ -62,6 +62,10 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
        rcu_read_unlock();
        stats->ac_utime  = cputime_to_msecs(tsk->utime) * USEC_PER_MSEC;
        stats->ac_stime  = cputime_to_msecs(tsk->stime) * USEC_PER_MSEC;
+       stats->ac_utimescaled =
+               cputime_to_msecs(tsk->utimescaled) * USEC_PER_MSEC;
+       stats->ac_stimescaled =
+               cputime_to_msecs(tsk->stimescaled) * USEC_PER_MSEC;
        stats->ac_minflt = tsk->min_flt;
        stats->ac_majflt = tsk->maj_flt;
 
index bfc33314c72088845f46e35465c31827e7170422..d2c2f257bedd348a0f81316fc02ef90226ecc0ac 100644 (file)
@@ -49,7 +49,7 @@ MODULE_LICENSE("GPL");
  * @p: pointer to buffer over which CRC is run
  * @len: length of buffer @p
  */
-u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len);
+u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len);
 
 #if CRC_LE_BITS == 1
 /*
@@ -57,7 +57,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len);
  * simplified by inlining the table in ?: form.
  */
 
-u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
+u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
 {
        int i;
        while (len--) {
@@ -69,7 +69,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
 }
 #else                          /* Table-based approach */
 
-u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
+u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len)
 {
 # if CRC_LE_BITS == 8
        const u32      *b =(u32 *)p;
@@ -145,7 +145,7 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len)
  * @p: pointer to buffer over which CRC is run
  * @len: length of buffer @p
  */
-u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len);
+u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len);
 
 #if CRC_BE_BITS == 1
 /*
@@ -153,7 +153,7 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len);
  * simplified by inlining the table in ?: form.
  */
 
-u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
+u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
 {
        int i;
        while (len--) {
@@ -167,7 +167,7 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
 }
 
 #else                          /* Table-based approach */
-u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len)
+u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len)
 {
 # if CRC_BE_BITS == 8
        const u32      *b =(u32 *)p;
index 60f46803af3f1c82ea6650bf12a40e9f3ac5aefc..802f11f0bf5baebf99460c1e4d238921764fab93 100644 (file)
@@ -66,7 +66,7 @@ EXPORT_SYMBOL(crc32c_le);
  * loop below with crc32 and vary the POLY if we don't find value in terms
  * of space and maintainability in keeping the two modules separate.
  */
-u32 __attribute_pure__
+u32 __pure
 crc32c_le(u32 crc, unsigned char const *p, size_t len)
 {
        int i;
@@ -160,7 +160,7 @@ static const u32 crc32c_table[256] = {
  * crc using table.
  */
 
-u32 __attribute_pure__
+u32 __pure
 crc32c_le(u32 seed, unsigned char const *data, size_t length)
 {
        u32 crc = __cpu_to_le32(seed);
@@ -177,7 +177,7 @@ crc32c_le(u32 seed, unsigned char const *data, size_t length)
 EXPORT_SYMBOL(crc32c_be);
 
 #if CRC_BE_BITS == 1
-u32 __attribute_pure__
+u32 __pure
 crc32c_be(u32 crc, unsigned char const *p, size_t len)
 {
        int i;
index 79f24a969cb4dfef1de95045bb5e9ced44e6243c..920366399eed6a3adb409d58622c74db46abcd7a 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/uio.h>
 #include <linux/hash.h>
 #include <linux/writeback.h>
+#include <linux/backing-dev.h>
 #include <linux/pagevec.h>
 #include <linux/blkdev.h>
 #include <linux/security.h>
index ae2959bb59cbb785c70ffa99677c6194b1d4910d..034617f8cdb2391c99b6aa615854a1b63403e71b 100644 (file)
@@ -1020,7 +1020,7 @@ static long region_chg(struct list_head *head, long f, long t)
         * size such that we can guarentee to record the reservation. */
        if (&rg->link == head || t < rg->from) {
                nrg = kmalloc(sizeof(*nrg), GFP_KERNEL);
-               if (nrg == 0)
+               if (!nrg)
                        return -ENOMEM;
                nrg->from = f;
                nrg->to   = f;
index 8ea5c2412c6e155aef62dbaa1fb4c882b77c1acc..08e3c7f2bd15a1b2e502aeb3e9f509148cb5dfa8 100644 (file)
@@ -291,7 +291,7 @@ unsigned long do_mremap(unsigned long addr,
                if ((addr <= new_addr) && (addr+old_len) > new_addr)
                        goto out;
 
-               ret = security_file_mmap(0, 0, 0, 0, new_addr, 1);
+               ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
                if (ret)
                        goto out;
 
@@ -399,7 +399,7 @@ unsigned long do_mremap(unsigned long addr,
                                goto out;
                        }
 
-                       ret = security_file_mmap(0, 0, 0, 0, new_addr, 1);
+                       ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1);
                        if (ret)
                                goto out;
                }
index 3ce9bc024d676c9db1f58a298d5aacc5f1d9c6fa..54eb555c4ef8596a605e616e17652b9b7b190d81 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1156,105 +1156,187 @@ static inline int cache_free_alien(struct kmem_cache *cachep, void *objp)
 }
 #endif
 
-static int __cpuinit cpuup_callback(struct notifier_block *nfb,
-                                   unsigned long action, void *hcpu)
+static void __cpuinit cpuup_canceled(long cpu)
+{
+       struct kmem_cache *cachep;
+       struct kmem_list3 *l3 = NULL;
+       int node = cpu_to_node(cpu);
+
+       list_for_each_entry(cachep, &cache_chain, next) {
+               struct array_cache *nc;
+               struct array_cache *shared;
+               struct array_cache **alien;
+               cpumask_t mask;
+
+               mask = node_to_cpumask(node);
+               /* cpu is dead; no one can alloc from it. */
+               nc = cachep->array[cpu];
+               cachep->array[cpu] = NULL;
+               l3 = cachep->nodelists[node];
+
+               if (!l3)
+                       goto free_array_cache;
+
+               spin_lock_irq(&l3->list_lock);
+
+               /* Free limit for this kmem_list3 */
+               l3->free_limit -= cachep->batchcount;
+               if (nc)
+                       free_block(cachep, nc->entry, nc->avail, node);
+
+               if (!cpus_empty(mask)) {
+                       spin_unlock_irq(&l3->list_lock);
+                       goto free_array_cache;
+               }
+
+               shared = l3->shared;
+               if (shared) {
+                       free_block(cachep, shared->entry,
+                                  shared->avail, node);
+                       l3->shared = NULL;
+               }
+
+               alien = l3->alien;
+               l3->alien = NULL;
+
+               spin_unlock_irq(&l3->list_lock);
+
+               kfree(shared);
+               if (alien) {
+                       drain_alien_cache(cachep, alien);
+                       free_alien_cache(alien);
+               }
+free_array_cache:
+               kfree(nc);
+       }
+       /*
+        * In the previous loop, all the objects were freed to
+        * the respective cache's slabs,  now we can go ahead and
+        * shrink each nodelist to its limit.
+        */
+       list_for_each_entry(cachep, &cache_chain, next) {
+               l3 = cachep->nodelists[node];
+               if (!l3)
+                       continue;
+               drain_freelist(cachep, l3, l3->free_objects);
+       }
+}
+
+static int __cpuinit cpuup_prepare(long cpu)
 {
-       long cpu = (long)hcpu;
        struct kmem_cache *cachep;
        struct kmem_list3 *l3 = NULL;
        int node = cpu_to_node(cpu);
        const int memsize = sizeof(struct kmem_list3);
 
-       switch (action) {
-       case CPU_LOCK_ACQUIRE:
-               mutex_lock(&cache_chain_mutex);
-               break;
-       case CPU_UP_PREPARE:
-       case CPU_UP_PREPARE_FROZEN:
+       /*
+        * We need to do this right in the beginning since
+        * alloc_arraycache's are going to use this list.
+        * kmalloc_node allows us to add the slab to the right
+        * kmem_list3 and not this cpu's kmem_list3
+        */
+
+       list_for_each_entry(cachep, &cache_chain, next) {
                /*
-                * We need to do this right in the beginning since
-                * alloc_arraycache's are going to use this list.
-                * kmalloc_node allows us to add the slab to the right
-                * kmem_list3 and not this cpu's kmem_list3
+                * Set up the size64 kmemlist for cpu before we can
+                * begin anything. Make sure some other cpu on this
+                * node has not already allocated this
                 */
+               if (!cachep->nodelists[node]) {
+                       l3 = kmalloc_node(memsize, GFP_KERNEL, node);
+                       if (!l3)
+                               goto bad;
+                       kmem_list3_init(l3);
+                       l3->next_reap = jiffies + REAPTIMEOUT_LIST3 +
+                           ((unsigned long)cachep) % REAPTIMEOUT_LIST3;
 
-               list_for_each_entry(cachep, &cache_chain, next) {
                        /*
-                        * Set up the size64 kmemlist for cpu before we can
-                        * begin anything. Make sure some other cpu on this
-                        * node has not already allocated this
+                        * The l3s don't come and go as CPUs come and
+                        * go.  cache_chain_mutex is sufficient
+                        * protection here.
                         */
-                       if (!cachep->nodelists[node]) {
-                               l3 = kmalloc_node(memsize, GFP_KERNEL, node);
-                               if (!l3)
-                                       goto bad;
-                               kmem_list3_init(l3);
-                               l3->next_reap = jiffies + REAPTIMEOUT_LIST3 +
-                                   ((unsigned long)cachep) % REAPTIMEOUT_LIST3;
-
-                               /*
-                                * The l3s don't come and go as CPUs come and
-                                * go.  cache_chain_mutex is sufficient
-                                * protection here.
-                                */
-                               cachep->nodelists[node] = l3;
-                       }
-
-                       spin_lock_irq(&cachep->nodelists[node]->list_lock);
-                       cachep->nodelists[node]->free_limit =
-                               (1 + nr_cpus_node(node)) *
-                               cachep->batchcount + cachep->num;
-                       spin_unlock_irq(&cachep->nodelists[node]->list_lock);
+                       cachep->nodelists[node] = l3;
                }
 
-               /*
-                * Now we can go ahead with allocating the shared arrays and
-                * array caches
-                */
-               list_for_each_entry(cachep, &cache_chain, next) {
-                       struct array_cache *nc;
-                       struct array_cache *shared = NULL;
-                       struct array_cache **alien = NULL;
-
-                       nc = alloc_arraycache(node, cachep->limit,
-                                               cachep->batchcount);
-                       if (!nc)
+               spin_lock_irq(&cachep->nodelists[node]->list_lock);
+               cachep->nodelists[node]->free_limit =
+                       (1 + nr_cpus_node(node)) *
+                       cachep->batchcount + cachep->num;
+               spin_unlock_irq(&cachep->nodelists[node]->list_lock);
+       }
+
+       /*
+        * Now we can go ahead with allocating the shared arrays and
+        * array caches
+        */
+       list_for_each_entry(cachep, &cache_chain, next) {
+               struct array_cache *nc;
+               struct array_cache *shared = NULL;
+               struct array_cache **alien = NULL;
+
+               nc = alloc_arraycache(node, cachep->limit,
+                                       cachep->batchcount);
+               if (!nc)
+                       goto bad;
+               if (cachep->shared) {
+                       shared = alloc_arraycache(node,
+                               cachep->shared * cachep->batchcount,
+                               0xbaadf00d);
+                       if (!shared) {
+                               kfree(nc);
                                goto bad;
-                       if (cachep->shared) {
-                               shared = alloc_arraycache(node,
-                                       cachep->shared * cachep->batchcount,
-                                       0xbaadf00d);
-                               if (!shared)
-                                       goto bad;
                        }
-                       if (use_alien_caches) {
-                                alien = alloc_alien_cache(node, cachep->limit);
-                                if (!alien)
-                                        goto bad;
-                        }
-                       cachep->array[cpu] = nc;
-                       l3 = cachep->nodelists[node];
-                       BUG_ON(!l3);
-
-                       spin_lock_irq(&l3->list_lock);
-                       if (!l3->shared) {
-                               /*
-                                * We are serialised from CPU_DEAD or
-                                * CPU_UP_CANCELLED by the cpucontrol lock
-                                */
-                               l3->shared = shared;
-                               shared = NULL;
+               }
+               if (use_alien_caches) {
+                       alien = alloc_alien_cache(node, cachep->limit);
+                       if (!alien) {
+                               kfree(shared);
+                               kfree(nc);
+                               goto bad;
                        }
+               }
+               cachep->array[cpu] = nc;
+               l3 = cachep->nodelists[node];
+               BUG_ON(!l3);
+
+               spin_lock_irq(&l3->list_lock);
+               if (!l3->shared) {
+                       /*
+                        * We are serialised from CPU_DEAD or
+                        * CPU_UP_CANCELLED by the cpucontrol lock
+                        */
+                       l3->shared = shared;
+                       shared = NULL;
+               }
 #ifdef CONFIG_NUMA
-                       if (!l3->alien) {
-                               l3->alien = alien;
-                               alien = NULL;
-                       }
-#endif
-                       spin_unlock_irq(&l3->list_lock);
-                       kfree(shared);
-                       free_alien_cache(alien);
+               if (!l3->alien) {
+                       l3->alien = alien;
+                       alien = NULL;
                }
+#endif
+               spin_unlock_irq(&l3->list_lock);
+               kfree(shared);
+               free_alien_cache(alien);
+       }
+       return 0;
+bad:
+       cpuup_canceled(cpu);
+       return -ENOMEM;
+}
+
+static int __cpuinit cpuup_callback(struct notifier_block *nfb,
+                                   unsigned long action, void *hcpu)
+{
+       long cpu = (long)hcpu;
+       int err = 0;
+
+       switch (action) {
+       case CPU_LOCK_ACQUIRE:
+               mutex_lock(&cache_chain_mutex);
+               break;
+       case CPU_UP_PREPARE:
+       case CPU_UP_PREPARE_FROZEN:
+               err = cpuup_prepare(cpu);
                break;
        case CPU_ONLINE:
        case CPU_ONLINE_FROZEN:
@@ -1291,72 +1373,13 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb,
 #endif
        case CPU_UP_CANCELED:
        case CPU_UP_CANCELED_FROZEN:
-               list_for_each_entry(cachep, &cache_chain, next) {
-                       struct array_cache *nc;
-                       struct array_cache *shared;
-                       struct array_cache **alien;
-                       cpumask_t mask;
-
-                       mask = node_to_cpumask(node);
-                       /* cpu is dead; no one can alloc from it. */
-                       nc = cachep->array[cpu];
-                       cachep->array[cpu] = NULL;
-                       l3 = cachep->nodelists[node];
-
-                       if (!l3)
-                               goto free_array_cache;
-
-                       spin_lock_irq(&l3->list_lock);
-
-                       /* Free limit for this kmem_list3 */
-                       l3->free_limit -= cachep->batchcount;
-                       if (nc)
-                               free_block(cachep, nc->entry, nc->avail, node);
-
-                       if (!cpus_empty(mask)) {
-                               spin_unlock_irq(&l3->list_lock);
-                               goto free_array_cache;
-                       }
-
-                       shared = l3->shared;
-                       if (shared) {
-                               free_block(cachep, shared->entry,
-                                          shared->avail, node);
-                               l3->shared = NULL;
-                       }
-
-                       alien = l3->alien;
-                       l3->alien = NULL;
-
-                       spin_unlock_irq(&l3->list_lock);
-
-                       kfree(shared);
-                       if (alien) {
-                               drain_alien_cache(cachep, alien);
-                               free_alien_cache(alien);
-                       }
-free_array_cache:
-                       kfree(nc);
-               }
-               /*
-                * In the previous loop, all the objects were freed to
-                * the respective cache's slabs,  now we can go ahead and
-                * shrink each nodelist to its limit.
-                */
-               list_for_each_entry(cachep, &cache_chain, next) {
-                       l3 = cachep->nodelists[node];
-                       if (!l3)
-                               continue;
-                       drain_freelist(cachep, l3, l3->free_objects);
-               }
+               cpuup_canceled(cpu);
                break;
        case CPU_LOCK_RELEASE:
                mutex_unlock(&cache_chain_mutex);
                break;
        }
-       return NOTIFY_OK;
-bad:
-       return NOTIFY_BAD;
+       return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
 static struct notifier_block __cpuinitdata cpucache_notifier = {
index e1471385d0014a79e4e7834b1c6e1f46c80cba1e..cb474cc996453006c0cc79430530ac1611b6facc 100644 (file)
@@ -1282,7 +1282,7 @@ out:
         */
        if (priority < 0)
                priority = 0;
-       for (i = 0; zones[i] != 0; i++) {
+       for (i = 0; zones[i] != NULL; i++) {
                struct zone *zone = zones[i];
 
                if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
index c742d37bfb972c631d45fda6bd1580d5216c5d3b..ba6428f204f9020209bc1dd693a5aa0e4727f4ac 100644 (file)
@@ -24,16 +24,6 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary
 
 #include "common.h"
 
-/*
- * Define this to use a version of the code which interacts with the higher
- * layers in a more intellegent way, by always reserving enough space for
- * our header at the begining of the packet.  However, there may still be
- * some problems with programs like tcpdump.  In 2.5 we'll sort out what
- * we need to do to get this perfect.  For now we just will copy the packet
- * if we need space for the header
- */
-/* #define FASTER_VERSION */
-
 #ifdef SKB_DEBUG
 static void skb_debug(const struct sk_buff *skb)
 {
@@ -69,9 +59,7 @@ struct br2684_vcc {
 #ifdef CONFIG_ATM_BR2684_IPFILTER
        struct br2684_filter filter;
 #endif /* CONFIG_ATM_BR2684_IPFILTER */
-#ifndef FASTER_VERSION
        unsigned copies_needed, copies_failed;
-#endif /* FASTER_VERSION */
 };
 
 struct br2684_dev {
@@ -147,13 +135,6 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
        struct br2684_vcc *brvcc)
 {
        struct atm_vcc *atmvcc;
-#ifdef FASTER_VERSION
-       if (brvcc->encaps == e_llc)
-               memcpy(skb_push(skb, 8), llc_oui_pid_pad, 8);
-       /* last 2 bytes of llc_oui_pid_pad are managed by header routines;
-          yes, you got it: 8 + 2 = sizeof(llc_oui_pid_pad)
-        */
-#else
        int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
        if (skb_headroom(skb) < minheadroom) {
                struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
@@ -170,7 +151,6 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
                skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
        else
                memset(skb->data, 0, 2);
-#endif /* FASTER_VERSION */
        skb_debug(skb);
 
        ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
@@ -237,87 +217,6 @@ static struct net_device_stats *br2684_get_stats(struct net_device *dev)
        return &BRPRIV(dev)->stats;
 }
 
-#ifdef FASTER_VERSION
-/*
- * These mirror eth_header and eth_header_cache.  They are not usually
- * exported for use in modules, so we grab them from net_device
- * after ether_setup() is done with it.  Bit of a hack.
- */
-static int (*my_eth_header)(struct sk_buff *, struct net_device *,
-       unsigned short, void *, void *, unsigned);
-static int (*my_eth_header_cache)(struct neighbour *, struct hh_cache *);
-
-static int
-br2684_header(struct sk_buff *skb, struct net_device *dev,
-             unsigned short type, void *daddr, void *saddr, unsigned len)
-{
-       u16 *pad_before_eth;
-       int t = my_eth_header(skb, dev, type, daddr, saddr, len);
-       if (t > 0) {
-               pad_before_eth = (u16 *) skb_push(skb, 2);
-               *pad_before_eth = 0;
-               return dev->hard_header_len;    /* or return 16; ? */
-       } else
-               return t;
-}
-
-static int
-br2684_header_cache(struct neighbour *neigh, struct hh_cache *hh)
-{
-/* hh_data is 16 bytes long. if encaps is ether-llc we need 24, so
-xmit will add the additional header part in that case */
-       u16 *pad_before_eth = (u16 *)(hh->hh_data);
-       int t = my_eth_header_cache(neigh, hh);
-       DPRINTK("br2684_header_cache, neigh=%p, hh_cache=%p\n", neigh, hh);
-       if (t < 0)
-               return t;
-       else {
-               *pad_before_eth = 0;
-               hh->hh_len = PADLEN + ETH_HLEN;
-       }
-       return 0;
-}
-
-/*
- * This is similar to eth_type_trans, which cannot be used because of
- * our dev->hard_header_len
- */
-static inline __be16 br_type_trans(struct sk_buff *skb, struct net_device *dev)
-{
-       struct ethhdr *eth;
-       unsigned char *rawp;
-       eth = eth_hdr(skb);
-
-       if (is_multicast_ether_addr(eth->h_dest)) {
-               if (!compare_ether_addr(eth->h_dest, dev->broadcast))
-                       skb->pkt_type = PACKET_BROADCAST;
-               else
-                       skb->pkt_type = PACKET_MULTICAST;
-       }
-
-       else if (compare_ether_addr(eth->h_dest, dev->dev_addr))
-               skb->pkt_type = PACKET_OTHERHOST;
-
-       if (ntohs(eth->h_proto) >= 1536)
-               return eth->h_proto;
-
-       rawp = skb->data;
-
-       /*
-        * This is a magic hack to spot IPX packets. Older Novell breaks
-        * the protocol design and runs IPX over 802.3 without an 802.2 LLC
-        * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
-        * won't work for fault tolerant netware but does for the rest.
-        */
-       if (*(unsigned short *) rawp == 0xFFFF)
-               return htons(ETH_P_802_3);
-
-       /*
-        * Real 802.2 LLC
-        */
-       return htons(ETH_P_802_2);
-}
-#endif /* FASTER_VERSION */
 
 /*
  * We remember when the MAC gets set, so we don't override it later with
@@ -448,17 +347,8 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
                return;
        }
 
-#ifdef FASTER_VERSION
-       /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
-          than should be. What else should I set? */
-       skb_pull(skb, plen);
-       skb_set_mac_header(skb, -ETH_HLEN);
-       skb->pkt_type = PACKET_HOST;
-       skb->protocol = br_type_trans(skb, net_dev);
-#else
        skb_pull(skb, plen - ETH_HLEN);
        skb->protocol = eth_type_trans(skb, net_dev);
-#endif /* FASTER_VERSION */
 #ifdef CONFIG_ATM_BR2684_IPFILTER
        if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) {
                brdev->stats.rx_dropped++;
@@ -584,13 +474,6 @@ static void br2684_setup(struct net_device *netdev)
        ether_setup(netdev);
        brdev->net_dev = netdev;
 
-#ifdef FASTER_VERSION
-       my_eth_header = netdev->hard_header;
-       netdev->hard_header = br2684_header;
-       my_eth_header_cache = netdev->hard_header_cache;
-       netdev->hard_header_cache = br2684_header_cache;
-       netdev->hard_header_len = sizeof(llc_oui_pid_pad) + ETH_HLEN;   /* 10 + 14 */
-#endif
        my_eth_mac_addr = netdev->set_mac_address;
        netdev->set_mac_address = br2684_mac_addr;
        netdev->hard_start_xmit = br2684_start_xmit;
@@ -719,16 +602,12 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
 
        list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
                seq_printf(seq, "  vcc %d.%d.%d: encaps=%s"
-#ifndef FASTER_VERSION
                                    ", failed copies %u/%u"
-#endif /* FASTER_VERSION */
                                    "\n", brvcc->atmvcc->dev->number,
                                    brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
                                    (brvcc->encaps == e_llc) ? "LLC" : "VC"
-#ifndef FASTER_VERSION
                                    , brvcc->copies_failed
                                    , brvcc->copies_needed
-#endif /* FASTER_VERSION */
                                    );
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 #define b1(var, byte)  ((u8 *) &brvcc->filter.var)[byte]
index bd903aaf7aa74fb871f4f4cdda14c6cd55755ee5..1f0068eae5018948ec187aa31af5a7ce5ed44fde 100644 (file)
@@ -386,6 +386,25 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
        return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
 }
 
+/**
+ *     sk_filter_rcu_release: Release a socket filter by rcu_head
+ *     @rcu: rcu_head that contains the sk_filter to free
+ */
+static void sk_filter_rcu_release(struct rcu_head *rcu)
+{
+       struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
+
+       sk_filter_release(fp);
+}
+
+static void sk_filter_delayed_uncharge(struct sock *sk, struct sk_filter *fp)
+{
+       unsigned int size = sk_filter_len(fp);
+
+       atomic_sub(size, &sk->sk_omem_alloc);
+       call_rcu_bh(&fp->rcu, sk_filter_rcu_release);
+}
+
 /**
  *     sk_attach_filter - attach a socket filter
  *     @fprog: the filter program
@@ -398,7 +417,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
  */
 int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
 {
-       struct sk_filter *fp;
+       struct sk_filter *fp, *old_fp;
        unsigned int fsize = sizeof(struct sock_filter) * fprog->len;
        int err;
 
@@ -418,19 +437,34 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
        fp->len = fprog->len;
 
        err = sk_chk_filter(fp->insns, fp->len);
-       if (!err) {
-               struct sk_filter *old_fp;
-
-               rcu_read_lock_bh();
-               old_fp = rcu_dereference(sk->sk_filter);
-               rcu_assign_pointer(sk->sk_filter, fp);
-               rcu_read_unlock_bh();
-               fp = old_fp;
+       if (err) {
+               sk_filter_uncharge(sk, fp);
+               return err;
        }
 
-       if (fp)
-               sk_filter_release(sk, fp);
-       return err;
+       rcu_read_lock_bh();
+       old_fp = rcu_dereference(sk->sk_filter);
+       rcu_assign_pointer(sk->sk_filter, fp);
+       rcu_read_unlock_bh();
+
+       sk_filter_delayed_uncharge(sk, old_fp);
+       return 0;
+}
+
+int sk_detach_filter(struct sock *sk)
+{
+       int ret = -ENOENT;
+       struct sk_filter *filter;
+
+       rcu_read_lock_bh();
+       filter = rcu_dereference(sk->sk_filter);
+       if (filter) {
+               rcu_assign_pointer(sk->sk_filter, NULL);
+               sk_filter_delayed_uncharge(sk, filter);
+               ret = 0;
+       }
+       rcu_read_unlock_bh();
+       return ret;
 }
 
 EXPORT_SYMBOL(sk_chk_filter);
index cd3af59b38a10fbdb6163c2f705930f2002698df..67ba9914e52e78aadb1f0be6cde6fc0219c8c544 100644 (file)
@@ -2496,7 +2496,6 @@ static struct neigh_sysctl_table {
                        .proc_handler   = &proc_dointvec,
                },
                {
-                       .ctl_name       = NET_NEIGH_RETRANS_TIME,
                        .procname       = "retrans_time",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
@@ -2541,26 +2540,39 @@ static struct neigh_sysctl_table {
                        .proc_handler   = &proc_dointvec,
                },
                {
-                       .ctl_name       = NET_NEIGH_ANYCAST_DELAY,
                        .procname       = "anycast_delay",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
                        .proc_handler   = &proc_dointvec_userhz_jiffies,
                },
                {
-                       .ctl_name       = NET_NEIGH_PROXY_DELAY,
                        .procname       = "proxy_delay",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
                        .proc_handler   = &proc_dointvec_userhz_jiffies,
                },
                {
-                       .ctl_name       = NET_NEIGH_LOCKTIME,
                        .procname       = "locktime",
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
                        .proc_handler   = &proc_dointvec_userhz_jiffies,
                },
+               {
+                       .ctl_name       = NET_NEIGH_RETRANS_TIME_MS,
+                       .procname       = "retrans_time_ms",
+                       .maxlen         = sizeof(int),
+                       .mode           = 0644,
+                       .proc_handler   = &proc_dointvec_ms_jiffies,
+                       .strategy       = &sysctl_ms_jiffies,
+               },
+               {
+                       .ctl_name       = NET_NEIGH_REACHABLE_TIME_MS,
+                       .procname       = "base_reachable_time_ms",
+                       .maxlen         = sizeof(int),
+                       .mode           = 0644,
+                       .proc_handler   = &proc_dointvec_ms_jiffies,
+                       .strategy       = &sysctl_ms_jiffies,
+               },
                {
                        .ctl_name       = NET_NEIGH_GC_INTERVAL,
                        .procname       = "gc_interval",
@@ -2590,22 +2602,7 @@ static struct neigh_sysctl_table {
                        .mode           = 0644,
                        .proc_handler   = &proc_dointvec,
                },
-               {
-                       .ctl_name       = NET_NEIGH_RETRANS_TIME_MS,
-                       .procname       = "retrans_time_ms",
-                       .maxlen         = sizeof(int),
-                       .mode           = 0644,
-                       .proc_handler   = &proc_dointvec_ms_jiffies,
-                       .strategy       = &sysctl_ms_jiffies,
-               },
-               {
-                       .ctl_name       = NET_NEIGH_REACHABLE_TIME_MS,
-                       .procname       = "base_reachable_time_ms",
-                       .maxlen         = sizeof(int),
-                       .mode           = 0644,
-                       .proc_handler   = &proc_dointvec_ms_jiffies,
-                       .strategy       = &sysctl_ms_jiffies,
-               },
+               {}
        },
        .neigh_dev = {
                {
@@ -2658,42 +2655,48 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
        t->neigh_vars[9].data  = &p->anycast_delay;
        t->neigh_vars[10].data = &p->proxy_delay;
        t->neigh_vars[11].data = &p->locktime;
+       t->neigh_vars[12].data  = &p->retrans_time;
+       t->neigh_vars[13].data  = &p->base_reachable_time;
 
        if (dev) {
                dev_name_source = dev->name;
                t->neigh_dev[0].ctl_name = dev->ifindex;
-               t->neigh_vars[12].procname = NULL;
-               t->neigh_vars[13].procname = NULL;
-               t->neigh_vars[14].procname = NULL;
-               t->neigh_vars[15].procname = NULL;
+               /* Terminate the table early */
+               memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14]));
        } else {
                dev_name_source = t->neigh_dev[0].procname;
-               t->neigh_vars[12].data = (int *)(p + 1);
-               t->neigh_vars[13].data = (int *)(p + 1) + 1;
-               t->neigh_vars[14].data = (int *)(p + 1) + 2;
-               t->neigh_vars[15].data = (int *)(p + 1) + 3;
+               t->neigh_vars[14].data = (int *)(p + 1);
+               t->neigh_vars[15].data = (int *)(p + 1) + 1;
+               t->neigh_vars[16].data = (int *)(p + 1) + 2;
+               t->neigh_vars[17].data = (int *)(p + 1) + 3;
        }
 
-       t->neigh_vars[16].data  = &p->retrans_time;
-       t->neigh_vars[17].data  = &p->base_reachable_time;
 
        if (handler || strategy) {
                /* RetransTime */
                t->neigh_vars[3].proc_handler = handler;
                t->neigh_vars[3].strategy = strategy;
                t->neigh_vars[3].extra1 = dev;
+               if (!strategy)
+                       t->neigh_vars[3].ctl_name = CTL_UNNUMBERED;
                /* ReachableTime */
                t->neigh_vars[4].proc_handler = handler;
                t->neigh_vars[4].strategy = strategy;
                t->neigh_vars[4].extra1 = dev;
+               if (!strategy)
+                       t->neigh_vars[4].ctl_name = CTL_UNNUMBERED;
                /* RetransTime (in milliseconds)*/
-               t->neigh_vars[16].proc_handler = handler;
-               t->neigh_vars[16].strategy = strategy;
-               t->neigh_vars[16].extra1 = dev;
+               t->neigh_vars[12].proc_handler = handler;
+               t->neigh_vars[12].strategy = strategy;
+               t->neigh_vars[12].extra1 = dev;
+               if (!strategy)
+                       t->neigh_vars[12].ctl_name = CTL_UNNUMBERED;
                /* ReachableTime (in milliseconds) */
-               t->neigh_vars[17].proc_handler = handler;
-               t->neigh_vars[17].strategy = strategy;
-               t->neigh_vars[17].extra1 = dev;
+               t->neigh_vars[13].proc_handler = handler;
+               t->neigh_vars[13].strategy = strategy;
+               t->neigh_vars[13].extra1 = dev;
+               if (!strategy)
+                       t->neigh_vars[13].ctl_name = CTL_UNNUMBERED;
        }
 
        dev_name = kstrdup(dev_name_source, GFP_KERNEL);
index 2100c734b102c9bde14ef3e86a362621996f37b9..8cae60c5338304f17cc6f59197c6bb447229b3eb 100644 (file)
@@ -2454,7 +2454,7 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev)
        spin_lock(&x->lock);
        iph = ip_hdr(skb);
 
-       err = x->mode->output(x, skb);
+       err = x->outer_mode->output(x, skb);
        if (err)
                goto error;
        err = x->type->output(x, skb);
index d45ecdccc6a153ec1ffccb1430e6085a3dd42f7d..d292b4113d6e240829c48cbd84e24ab5da660764 100644 (file)
@@ -428,7 +428,6 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
                    char __user *optval, int optlen)
 {
        struct sock *sk=sock->sk;
-       struct sk_filter *filter;
        int val;
        int valbool;
        struct linger ling;
@@ -652,16 +651,7 @@ set_rcvbuf:
                break;
 
        case SO_DETACH_FILTER:
-               rcu_read_lock_bh();
-               filter = rcu_dereference(sk->sk_filter);
-               if (filter) {
-                       rcu_assign_pointer(sk->sk_filter, NULL);
-                       sk_filter_release(sk, filter);
-                       rcu_read_unlock_bh();
-                       break;
-               }
-               rcu_read_unlock_bh();
-               ret = -ENONET;
+               ret = sk_detach_filter(sk);
                break;
 
        case SO_PASSSEC:
@@ -925,7 +915,7 @@ void sk_free(struct sock *sk)
 
        filter = rcu_dereference(sk->sk_filter);
        if (filter) {
-               sk_filter_release(sk, filter);
+               sk_filter_uncharge(sk, filter);
                rcu_assign_pointer(sk->sk_filter, NULL);
        }
 
index 19d7e1dbd87e99a98f463e944a6f20f052fd9856..3560a2a875a05561f2d0b353cb62b6b58095e8b4 100644 (file)
@@ -19,6 +19,9 @@
 #include "ccid.h"
 #include "dccp.h"
 
+/* rate-limit for syncs in reply to sequence-invalid packets; RFC 4340, 7.5.4 */
+int sysctl_dccp_sync_ratelimit __read_mostly = HZ / 8;
+
 static void dccp_fin(struct sock *sk, struct sk_buff *skb)
 {
        sk->sk_shutdown |= RCV_SHUTDOWN;
index 9364b2fb4dbd4ce0e45581e7595c7e2d2a32e6dd..c62c05039f693e40bbd2b4cad307fa68d619629f 100644 (file)
@@ -18,9 +18,6 @@
 #error This file should not be compiled without CONFIG_SYSCTL defined
 #endif
 
-/* rate-limit for syncs in reply to sequence-invalid packets; RFC 4340, 7.5.4 */
-int sysctl_dccp_sync_ratelimit __read_mostly = HZ / 8;
-
 static struct ctl_table dccp_default_table[] = {
        {
                .procname       = "seq_window",
index 6cc54eeca3edf54b11f76f6d23ca7b43d2adeec5..72e6ab66834fb74ffafe799131796c56640fcbf1 100644 (file)
@@ -586,7 +586,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 * hdr)
        if (stype & IEEE80211_STYPE_QOS_DATA) {
                const struct ieee80211_hdr_3addrqos *qoshdr =
                        (struct ieee80211_hdr_3addrqos *)skb->data;
-               hdr[12] = qoshdr->qos_ctl & cpu_to_le16(IEEE80211_QCTL_TID);
+               hdr[12] = le16_to_cpu(qoshdr->qos_ctl) & IEEE80211_QCTL_TID;
        } else
                hdr[12] = 0;            /* priority */
 
index 484cf512858fea297b81a2b1f8bf16e0ffa27913..e15e04fc66615dc354241214fdadaa366512264f 100644 (file)
@@ -136,7 +136,9 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f,
                *work -= f->qsize;
        atomic_sub(f->qsize, &f->mem);
 
-       f->destructor(q);
+       if (f->destructor)
+               f->destructor(q);
+       kfree(q);
 
 }
 EXPORT_SYMBOL(inet_frag_destroy);
@@ -172,3 +174,88 @@ int inet_frag_evictor(struct inet_frags *f)
        return evicted;
 }
 EXPORT_SYMBOL(inet_frag_evictor);
+
+static struct inet_frag_queue *inet_frag_intern(struct inet_frag_queue *qp_in,
+               struct inet_frags *f, unsigned int hash, void *arg)
+{
+       struct inet_frag_queue *qp;
+#ifdef CONFIG_SMP
+       struct hlist_node *n;
+#endif
+
+       write_lock(&f->lock);
+#ifdef CONFIG_SMP
+       /* With SMP race we have to recheck hash table, because
+        * such entry could be created on other cpu, while we
+        * promoted read lock to write lock.
+        */
+       hlist_for_each_entry(qp, n, &f->hash[hash], list) {
+               if (f->match(qp, arg)) {
+                       atomic_inc(&qp->refcnt);
+                       write_unlock(&f->lock);
+                       qp_in->last_in |= COMPLETE;
+                       inet_frag_put(qp_in, f);
+                       return qp;
+               }
+       }
+#endif
+       qp = qp_in;
+       if (!mod_timer(&qp->timer, jiffies + f->ctl->timeout))
+               atomic_inc(&qp->refcnt);
+
+       atomic_inc(&qp->refcnt);
+       hlist_add_head(&qp->list, &f->hash[hash]);
+       list_add_tail(&qp->lru_list, &f->lru_list);
+       f->nqueues++;
+       write_unlock(&f->lock);
+       return qp;
+}
+
+static struct inet_frag_queue *inet_frag_alloc(struct inet_frags *f, void *arg)
+{
+       struct inet_frag_queue *q;
+
+       q = kzalloc(f->qsize, GFP_ATOMIC);
+       if (q == NULL)
+               return NULL;
+
+       f->constructor(q, arg);
+       atomic_add(f->qsize, &f->mem);
+       setup_timer(&q->timer, f->frag_expire, (unsigned long)q);
+       spin_lock_init(&q->lock);
+       atomic_set(&q->refcnt, 1);
+
+       return q;
+}
+
+static struct inet_frag_queue *inet_frag_create(struct inet_frags *f,
+               void *arg, unsigned int hash)
+{
+       struct inet_frag_queue *q;
+
+       q = inet_frag_alloc(f, arg);
+       if (q == NULL)
+               return NULL;
+
+       return inet_frag_intern(q, f, hash, arg);
+}
+
+struct inet_frag_queue *inet_frag_find(struct inet_frags *f, void *key,
+               unsigned int hash)
+{
+       struct inet_frag_queue *q;
+       struct hlist_node *n;
+
+       read_lock(&f->lock);
+       hlist_for_each_entry(q, n, &f->hash[hash], list) {
+               if (f->match(q, key)) {
+                       atomic_inc(&q->refcnt);
+                       read_unlock(&f->lock);
+                       return q;
+               }
+       }
+       read_unlock(&f->lock);
+
+       return inet_frag_create(f, key, hash);
+}
+EXPORT_SYMBOL(inet_frag_find);
index 443b3f89192f5841f78e7783874f9c8b9b479020..2143bf30597a84b528e0cced57bc657dbe577417 100644 (file)
@@ -108,6 +108,11 @@ int ip_frag_mem(void)
 static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
                         struct net_device *dev);
 
+struct ip4_create_arg {
+       struct iphdr *iph;
+       u32 user;
+};
+
 static unsigned int ipqhashfn(__be16 id, __be32 saddr, __be32 daddr, u8 prot)
 {
        return jhash_3words((__force u32)id << 16 | prot,
@@ -123,6 +128,19 @@ static unsigned int ip4_hashfn(struct inet_frag_queue *q)
        return ipqhashfn(ipq->id, ipq->saddr, ipq->daddr, ipq->protocol);
 }
 
+static int ip4_frag_match(struct inet_frag_queue *q, void *a)
+{
+       struct ipq *qp;
+       struct ip4_create_arg *arg = a;
+
+       qp = container_of(q, struct ipq, q);
+       return (qp->id == arg->iph->id &&
+                       qp->saddr == arg->iph->saddr &&
+                       qp->daddr == arg->iph->daddr &&
+                       qp->protocol == arg->iph->protocol &&
+                       qp->user == arg->user);
+}
+
 /* Memory Tracking Functions. */
 static __inline__ void frag_kfree_skb(struct sk_buff *skb, int *work)
 {
@@ -132,6 +150,20 @@ static __inline__ void frag_kfree_skb(struct sk_buff *skb, int *work)
        kfree_skb(skb);
 }
 
+static void ip4_frag_init(struct inet_frag_queue *q, void *a)
+{
+       struct ipq *qp = container_of(q, struct ipq, q);
+       struct ip4_create_arg *arg = a;
+
+       qp->protocol = arg->iph->protocol;
+       qp->id = arg->iph->id;
+       qp->saddr = arg->iph->saddr;
+       qp->daddr = arg->iph->daddr;
+       qp->user = arg->user;
+       qp->peer = sysctl_ipfrag_max_dist ?
+               inet_getpeer(arg->iph->saddr, 1) : NULL;
+}
+
 static __inline__ void ip4_frag_free(struct inet_frag_queue *q)
 {
        struct ipq *qp;
@@ -139,17 +171,6 @@ static __inline__ void ip4_frag_free(struct inet_frag_queue *q)
        qp = container_of(q, struct ipq, q);
        if (qp->peer)
                inet_putpeer(qp->peer);
-       kfree(qp);
-}
-
-static __inline__ struct ipq *frag_alloc_queue(void)
-{
-       struct ipq *qp = kzalloc(sizeof(struct ipq), GFP_ATOMIC);
-
-       if (!qp)
-               return NULL;
-       atomic_add(sizeof(struct ipq), &ip4_frags.mem);
-       return qp;
 }
 
 
@@ -185,7 +206,9 @@ static void ip_evictor(void)
  */
 static void ip_expire(unsigned long arg)
 {
-       struct ipq *qp = (struct ipq *) arg;
+       struct ipq *qp;
+
+       qp = container_of((struct inet_frag_queue *) arg, struct ipq, q);
 
        spin_lock(&qp->q.lock);
 
@@ -210,112 +233,30 @@ out:
        ipq_put(qp);
 }
 
-/* Creation primitives. */
-
-static struct ipq *ip_frag_intern(struct ipq *qp_in)
+/* Find the correct entry in the "incomplete datagrams" queue for
+ * this IP datagram, and create new one, if nothing is found.
+ */
+static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
 {
-       struct ipq *qp;
-#ifdef CONFIG_SMP
-       struct hlist_node *n;
-#endif
+       struct inet_frag_queue *q;
+       struct ip4_create_arg arg;
        unsigned int hash;
 
-       write_lock(&ip4_frags.lock);
-       hash = ipqhashfn(qp_in->id, qp_in->saddr, qp_in->daddr,
-                        qp_in->protocol);
-#ifdef CONFIG_SMP
-       /* With SMP race we have to recheck hash table, because
-        * such entry could be created on other cpu, while we
-        * promoted read lock to write lock.
-        */
-       hlist_for_each_entry(qp, n, &ip4_frags.hash[hash], q.list) {
-               if (qp->id == qp_in->id         &&
-                   qp->saddr == qp_in->saddr   &&
-                   qp->daddr == qp_in->daddr   &&
-                   qp->protocol == qp_in->protocol &&
-                   qp->user == qp_in->user) {
-                       atomic_inc(&qp->q.refcnt);
-                       write_unlock(&ip4_frags.lock);
-                       qp_in->q.last_in |= COMPLETE;
-                       ipq_put(qp_in);
-                       return qp;
-               }
-       }
-#endif
-       qp = qp_in;
-
-       if (!mod_timer(&qp->q.timer, jiffies + ip4_frags_ctl.timeout))
-               atomic_inc(&qp->q.refcnt);
+       arg.iph = iph;
+       arg.user = user;
+       hash = ipqhashfn(iph->id, iph->saddr, iph->daddr, iph->protocol);
 
-       atomic_inc(&qp->q.refcnt);
-       hlist_add_head(&qp->q.list, &ip4_frags.hash[hash]);
-       INIT_LIST_HEAD(&qp->q.lru_list);
-       list_add_tail(&qp->q.lru_list, &ip4_frags.lru_list);
-       ip4_frags.nqueues++;
-       write_unlock(&ip4_frags.lock);
-       return qp;
-}
-
-/* Add an entry to the 'ipq' queue for a newly received IP datagram. */
-static struct ipq *ip_frag_create(struct iphdr *iph, u32 user)
-{
-       struct ipq *qp;
-
-       if ((qp = frag_alloc_queue()) == NULL)
+       q = inet_frag_find(&ip4_frags, &arg, hash);
+       if (q == NULL)
                goto out_nomem;
 
-       qp->protocol = iph->protocol;
-       qp->id = iph->id;
-       qp->saddr = iph->saddr;
-       qp->daddr = iph->daddr;
-       qp->user = user;
-       qp->peer = sysctl_ipfrag_max_dist ? inet_getpeer(iph->saddr, 1) : NULL;
-
-       /* Initialize a timer for this entry. */
-       init_timer(&qp->q.timer);
-       qp->q.timer.data = (unsigned long) qp;  /* pointer to queue     */
-       qp->q.timer.function = ip_expire;               /* expire function      */
-       spin_lock_init(&qp->q.lock);
-       atomic_set(&qp->q.refcnt, 1);
-
-       return ip_frag_intern(qp);
+       return container_of(q, struct ipq, q);
 
 out_nomem:
        LIMIT_NETDEBUG(KERN_ERR "ip_frag_create: no memory left !\n");
        return NULL;
 }
 
-/* Find the correct entry in the "incomplete datagrams" queue for
- * this IP datagram, and create new one, if nothing is found.
- */
-static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
-{
-       __be16 id = iph->id;
-       __be32 saddr = iph->saddr;
-       __be32 daddr = iph->daddr;
-       __u8 protocol = iph->protocol;
-       unsigned int hash;
-       struct ipq *qp;
-       struct hlist_node *n;
-
-       read_lock(&ip4_frags.lock);
-       hash = ipqhashfn(id, saddr, daddr, protocol);
-       hlist_for_each_entry(qp, n, &ip4_frags.hash[hash], q.list) {
-               if (qp->id == id                &&
-                   qp->saddr == saddr  &&
-                   qp->daddr == daddr  &&
-                   qp->protocol == protocol &&
-                   qp->user == user) {
-                       atomic_inc(&qp->q.refcnt);
-                       read_unlock(&ip4_frags.lock);
-                       return qp;
-               }
-       }
-       read_unlock(&ip4_frags.lock);
-
-       return ip_frag_create(iph, user);
-}
-
 /* Is the fragment too far ahead to be part of ipq? */
 static inline int ip_frag_too_far(struct ipq *qp)
 {
@@ -545,7 +486,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
        if (prev) {
                head = prev->next;
                fp = skb_clone(head, GFP_ATOMIC);
-
                if (!fp)
                        goto out_nomem;
 
@@ -571,7 +511,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
                goto out_oversize;
 
        /* Head of list must not be cloned. */
-       err = -ENOMEM;
        if (skb_cloned(head) && pskb_expand_head(head, 0, 0, GFP_ATOMIC))
                goto out_nomem;
 
@@ -627,6 +566,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
 out_nomem:
        LIMIT_NETDEBUG(KERN_ERR "IP: queue_glue: no memory for gluing "
                              "queue %p\n", qp);
+       err = -ENOMEM;
        goto out_fail;
 out_oversize:
        if (net_ratelimit())
@@ -671,9 +611,12 @@ void __init ipfrag_init(void)
 {
        ip4_frags.ctl = &ip4_frags_ctl;
        ip4_frags.hashfn = ip4_hashfn;
+       ip4_frags.constructor = ip4_frag_init;
        ip4_frags.destructor = ip4_frag_free;
        ip4_frags.skb_free = NULL;
        ip4_frags.qsize = sizeof(struct ipq);
+       ip4_frags.match = ip4_frag_match;
+       ip4_frags.frag_expire = ip_expire;
        inet_frags_init(&ip4_frags);
 }
 
index 11fedc73049c109d17fa741ba8ad6222bfd4b61b..adcbaf6d4299c8be3c94ccd815f23bc736a6cbf3 100644 (file)
@@ -281,7 +281,6 @@ static int icmp_nlattr_to_tuple(struct nlattr *tb[],
 static struct ctl_table_header *icmp_sysctl_header;
 static struct ctl_table icmp_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_ICMP_TIMEOUT,
                .procname       = "nf_conntrack_icmp_timeout",
                .data           = &nf_ct_icmp_timeout,
                .maxlen         = sizeof(unsigned int),
@@ -295,7 +294,6 @@ static struct ctl_table icmp_sysctl_table[] = {
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
 static struct ctl_table icmp_compat_sysctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT,
                .procname       = "ip_conntrack_icmp_timeout",
                .data           = &nf_ct_icmp_timeout,
                .maxlen         = sizeof(unsigned int),
index c98ef16effd24171bf24dc580c6c633bab716ac7..c78acc1a7f11395b154460774dbbd6ee52444e0f 100644 (file)
@@ -740,7 +740,6 @@ ctl_table ipv4_table[] = {
                .strategy       = &sysctl_jiffies
        },
        {
-               .ctl_name       = NET_IPV4_IPFRAG_MAX_DIST,
                .procname       = "ipfrag_max_dist",
                .data           = &sysctl_ipfrag_max_dist,
                .maxlen         = sizeof(int),
@@ -865,7 +864,6 @@ ctl_table ipv4_table[] = {
        },
 #endif /* CONFIG_NETLABEL */
        {
-               .ctl_name       = NET_TCP_AVAIL_CONG_CONTROL,
                .procname       = "tcp_available_congestion_control",
                .maxlen         = TCP_CA_BUF_MAX,
                .mode           = 0444,
index 0f00966b1784b0f1f448053554a4719cbbe1c496..9288220b73a8d80abf9a7fff748269930d8f8a8a 100644 (file)
@@ -1121,7 +1121,7 @@ static int tcp_mark_lost_retrans(struct sock *sk, u32 received_upto)
        struct sk_buff *skb;
        int flag = 0;
        int cnt = 0;
-       u32 new_low_seq = 0;
+       u32 new_low_seq = tp->snd_nxt;
 
        tcp_for_write_queue(skb, sk) {
                u32 ack_seq = TCP_SKB_CB(skb)->ack_seq;
@@ -1153,7 +1153,7 @@ static int tcp_mark_lost_retrans(struct sock *sk, u32 received_upto)
                                NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT);
                        }
                } else {
-                       if (!new_low_seq || before(ack_seq, new_low_seq))
+                       if (before(ack_seq, new_low_seq))
                                new_low_seq = ack_seq;
                        cnt += tcp_skb_pcount(skb);
                }
@@ -1242,7 +1242,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
        int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3;
        int reord = tp->packets_out;
        int prior_fackets;
-       u32 highest_sack_end_seq = 0;
+       u32 highest_sack_end_seq = tp->lost_retrans_low;
        int flag = 0;
        int found_dup_sack = 0;
        int cached_fack_count;
index e9bbfde19ac32420a6dfd77b090e8b22fd97edc6..5e95c8a07efbad59809f5370c62b317b58e1fe9c 100644 (file)
 #include <net/ip.h>
 #include <net/xfrm.h>
 
-static int xfrm4_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
-{
-       switch (nexthdr) {
-       case IPPROTO_IPIP:
-       case IPPROTO_IPV6:
-               *spi = ip_hdr(skb)->saddr;
-               *seq = 0;
-               return 0;
-       }
-
-       return xfrm_parse_spi(skb, nexthdr, spi, seq);
-}
-
 #ifdef CONFIG_NETFILTER
 static inline int xfrm4_rcv_encap_finish(struct sk_buff *skb)
 {
@@ -46,28 +33,29 @@ drop:
 }
 #endif
 
-static int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
+int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
+                   int encap_type)
 {
-       __be32 spi, seq;
+       int err;
+       __be32 seq;
        struct xfrm_state *xfrm_vec[XFRM_MAX_DEPTH];
        struct xfrm_state *x;
        int xfrm_nr = 0;
        int decaps = 0;
-       int err = xfrm4_parse_spi(skb, ip_hdr(skb)->protocol, &spi, &seq);
        unsigned int nhoff = offsetof(struct iphdr, protocol);
 
-       if (err != 0)
+       seq = 0;
+       if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
                goto drop;
 
        do {
                const struct iphdr *iph = ip_hdr(skb);
-               int nexthdr;
 
                if (xfrm_nr == XFRM_MAX_DEPTH)
                        goto drop;
 
                x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi,
-                               iph->protocol != IPPROTO_IPV6 ? iph->protocol : IPPROTO_IPIP, AF_INET);
+                                     nexthdr, AF_INET);
                if (x == NULL)
                        goto drop;
 
@@ -103,15 +91,15 @@ static int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
 
                xfrm_vec[xfrm_nr++] = x;
 
-               if (x->mode->input(x, skb))
+               if (x->outer_mode->input(x, skb))
                        goto drop;
 
-               if (x->props.mode == XFRM_MODE_TUNNEL) {
+               if (x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) {
                        decaps = 1;
                        break;
                }
 
-               err = xfrm_parse_spi(skb, ip_hdr(skb)->protocol, &spi, &seq);
+               err = xfrm_parse_spi(skb, nexthdr, &spi, &seq);
                if (err < 0)
                        goto drop;
        } while (!err);
@@ -165,6 +153,7 @@ drop:
        kfree_skb(skb);
        return 0;
 }
+EXPORT_SYMBOL(xfrm4_rcv_encap);
 
 /* If it's a keepalive packet, then just eat it.
  * If it's an encapsulated packet, then pass it to the
@@ -252,11 +241,8 @@ int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
        __skb_pull(skb, len);
        skb_reset_transport_header(skb);
 
-       /* modify the protocol (it's ESP!) */
-       iph->protocol = IPPROTO_ESP;
-
        /* process ESP */
-       ret = xfrm4_rcv_encap(skb, encap_type);
+       ret = xfrm4_rcv_encap(skb, IPPROTO_ESP, 0, encap_type);
        return ret;
 
 drop:
@@ -266,7 +252,7 @@ drop:
 
 int xfrm4_rcv(struct sk_buff *skb)
 {
-       return xfrm4_rcv_encap(skb, 0);
+       return xfrm4_rcv_spi(skb, ip_hdr(skb)->protocol, 0);
 }
 
 EXPORT_SYMBOL(xfrm4_rcv);
index 73d2338bec55f306985f82897b644b1f6f70df1a..e42e122414be1e461c01898aff091f405b48dfa2 100644 (file)
@@ -114,6 +114,7 @@ static struct xfrm_mode xfrm4_beet_mode = {
        .output = xfrm4_beet_output,
        .owner = THIS_MODULE,
        .encap = XFRM_MODE_BEET,
+       .flags = XFRM_MODE_FLAG_TUNNEL,
 };
 
 static int __init xfrm4_beet_init(void)
index 1ae9d32276f0a8daa13cf8abbf743b34c691f0f8..e4deecba6dd216d546706f57e3e557123af52c71 100644 (file)
@@ -139,6 +139,7 @@ static struct xfrm_mode xfrm4_tunnel_mode = {
        .output = xfrm4_tunnel_output,
        .owner = THIS_MODULE,
        .encap = XFRM_MODE_TUNNEL,
+       .flags = XFRM_MODE_FLAG_TUNNEL,
 };
 
 static int __init xfrm4_tunnel_init(void)
index a4edd666318b0f85bb9efb166df3512f78bce8d5..c4a7156962bd58797d93b7c21051bcc797c98de9 100644 (file)
@@ -47,7 +47,7 @@ static inline int xfrm4_output_one(struct sk_buff *skb)
        struct iphdr *iph;
        int err;
 
-       if (x->props.mode == XFRM_MODE_TUNNEL) {
+       if (x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) {
                err = xfrm4_tunnel_check_size(skb);
                if (err)
                        goto error_nolock;
index 329825ca68fe71730387583c9d96129ee3770db2..cc86fb110dd882050848053e94406d6870803a01 100644 (file)
@@ -117,7 +117,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
                header_len += xfrm[i]->props.header_len;
                trailer_len += xfrm[i]->props.trailer_len;
 
-               if (xfrm[i]->props.mode == XFRM_MODE_TUNNEL) {
+               if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
                        unsigned short encap_family = xfrm[i]->props.family;
                        switch (encap_family) {
                        case AF_INET:
@@ -151,7 +151,6 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
        i = 0;
        for (; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) {
                struct xfrm_dst *x = (struct xfrm_dst*)dst_prev;
-               struct xfrm_state_afinfo *afinfo;
                x->u.rt.fl = *fl;
 
                dst_prev->xfrm = xfrm[i++];
@@ -169,27 +168,17 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
                /* Copy neighbout for reachability confirmation */
                dst_prev->neighbour     = neigh_clone(rt->u.dst.neighbour);
                dst_prev->input         = rt->u.dst.input;
-               /* XXX: When IPv6 module can be unloaded, we should manage reference
-                * to xfrm6_output in afinfo->output. Miyazawa
-                * */
-               afinfo = xfrm_state_get_afinfo(dst_prev->xfrm->props.family);
-               if (!afinfo) {
-                       dst = *dst_p;
-                       err = -EAFNOSUPPORT;
-                       goto error;
-               }
-               dst_prev->output = afinfo->output;
-               xfrm_state_put_afinfo(afinfo);
-               if (dst_prev->xfrm->props.family == AF_INET && rt->peer)
-                       atomic_inc(&rt->peer->refcnt);
-               x->u.rt.peer = rt->peer;
+               dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output;
+               if (rt0->peer)
+                       atomic_inc(&rt0->peer->refcnt);
+               x->u.rt.peer = rt0->peer;
                /* Sheit... I remember I did this right. Apparently,
                 * it was magically lost, so this code needs audit */
                x->u.rt.rt_flags = rt0->rt_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL);
-               x->u.rt.rt_type = rt->rt_type;
+               x->u.rt.rt_type = rt0->rt_type;
                x->u.rt.rt_src = rt0->rt_src;
                x->u.rt.rt_dst = rt0->rt_dst;
-               x->u.rt.rt_gateway = rt->rt_gateway;
+               x->u.rt.rt_gateway = rt0->rt_gateway;
                x->u.rt.rt_spec_dst = rt0->rt_spec_dst;
                x->u.rt.idev = rt0->idev;
                in_dev_hold(rt0->idev);
@@ -291,7 +280,7 @@ static void xfrm4_dst_destroy(struct dst_entry *dst)
 
        if (likely(xdst->u.rt.idev))
                in_dev_put(xdst->u.rt.idev);
-       if (dst->xfrm && dst->xfrm->props.family == AF_INET && likely(xdst->u.rt.peer))
+       if (likely(xdst->u.rt.peer))
                inet_putpeer(xdst->u.rt.peer);
        xfrm_dst_destroy(xdst);
 }
index 93e2c061cddaf3b71a7c6e3c0bae0a22f1b45d76..13d54a1c3337bd311c7245f331367296f07b0558 100644 (file)
@@ -49,6 +49,7 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
 
 static struct xfrm_state_afinfo xfrm4_state_afinfo = {
        .family                 = AF_INET,
+       .owner                  = THIS_MODULE,
        .init_flags             = xfrm4_init_flags,
        .init_tempsel           = __xfrm4_init_tempsel,
        .output                 = xfrm4_output,
index 1312417608e2a34ba7c6e05746d605b2930d05bf..326845195620dd07851907fdf03d65cadb0be220 100644 (file)
@@ -18,7 +18,7 @@ static int ipip_output(struct xfrm_state *x, struct sk_buff *skb)
 
 static int ipip_xfrm_rcv(struct xfrm_state *x, struct sk_buff *skb)
 {
-       return IPPROTO_IP;
+       return ip_hdr(skb)->protocol;
 }
 
 static int ipip_init_state(struct xfrm_state *x)
@@ -48,20 +48,25 @@ static struct xfrm_type ipip_type = {
        .output         = ipip_output
 };
 
+static int xfrm_tunnel_rcv(struct sk_buff *skb)
+{
+       return xfrm4_rcv_spi(skb, IPPROTO_IP, ip_hdr(skb)->saddr);
+}
+
 static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
 {
        return -ENOENT;
 }
 
 static struct xfrm_tunnel xfrm_tunnel_handler = {
-       .handler        =       xfrm4_rcv,
+       .handler        =       xfrm_tunnel_rcv,
        .err_handler    =       xfrm_tunnel_err,
        .priority       =       2,
 };
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 static struct xfrm_tunnel xfrm64_tunnel_handler = {
-       .handler        =       xfrm4_rcv,
+       .handler        =       xfrm_tunnel_rcv,
        .err_handler    =       xfrm_tunnel_err,
        .priority       =       2,
 };
index 52d10d213217c0bb8c7be5bbda65d9e31ad45e3d..348bd8d061125f61932c74d683e6a3f8d69c28e6 100644 (file)
@@ -255,11 +255,6 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp,
 
 static int snmp6_alloc_dev(struct inet6_dev *idev)
 {
-       int err = -ENOMEM;
-
-       if (!idev || !idev->dev)
-               return -EINVAL;
-
        if (snmp_mib_init((void **)idev->stats.ipv6,
                          sizeof(struct ipstats_mib),
                          __alignof__(struct ipstats_mib)) < 0)
@@ -280,15 +275,14 @@ err_icmpmsg:
 err_icmp:
        snmp_mib_free((void **)idev->stats.ipv6);
 err_ip:
-       return err;
+       return -ENOMEM;
 }
 
-static int snmp6_free_dev(struct inet6_dev *idev)
+static void snmp6_free_dev(struct inet6_dev *idev)
 {
        snmp_mib_free((void **)idev->stats.icmpv6msg);
        snmp_mib_free((void **)idev->stats.icmpv6);
        snmp_mib_free((void **)idev->stats.ipv6);
-       return 0;
 }
 
 /* Nobody refers to this device, we may destroy it. */
index bc929381fa46c59926266efde1a6702d2460f1e4..1b1caf3aa1c189d7ce57bf38d4276afa5d4c35c9 100644 (file)
@@ -747,6 +747,7 @@ static void cleanup_ipv6_mibs(void)
 {
        snmp_mib_free((void **)ipv6_statistics);
        snmp_mib_free((void **)icmpv6_statistics);
+       snmp_mib_free((void **)icmpv6msg_statistics);
        snmp_mib_free((void **)udp_stats_in6);
        snmp_mib_free((void **)udplite_stats_in6);
 }
index f9f689162692e9b6334b9a2d0e04ccbd069d60fb..67cd06613a253b3fc6197726dc259764b2be0f34 100644 (file)
@@ -344,6 +344,8 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
            pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
                goto out;
 
+       skb->ip_summed = CHECKSUM_NONE;
+
        hdr_len = skb->data - skb_network_header(skb);
        ah = (struct ip_auth_hdr *)skb->data;
        ahp = x->data;
@@ -475,8 +477,15 @@ static int ah6_init_state(struct xfrm_state *x)
 
        x->props.header_len = XFRM_ALIGN8(sizeof(struct ip_auth_hdr) +
                                          ahp->icv_trunc_len);
-       if (x->props.mode == XFRM_MODE_TUNNEL)
+       switch (x->props.mode) {
+       case XFRM_MODE_BEET:
+       case XFRM_MODE_TRANSPORT:
+               break;
+       case XFRM_MODE_TUNNEL:
                x->props.header_len += sizeof(struct ipv6hdr);
+       default:
+               goto error;
+       }
        x->data = ahp;
 
        return 0;
index 9eb92859835171ec22709c04148ce9860ea2acbe..b0715432e454e4360a0e3e55fbded272a048b235 100644 (file)
@@ -354,8 +354,15 @@ static int esp6_init_state(struct xfrm_state *x)
                                    (x->ealg->alg_key_len + 7) / 8))
                goto error;
        x->props.header_len = sizeof(struct ip_esp_hdr) + esp->conf.ivlen;
-       if (x->props.mode == XFRM_MODE_TUNNEL)
+       switch (x->props.mode) {
+       case XFRM_MODE_BEET:
+       case XFRM_MODE_TRANSPORT:
+               break;
+       case XFRM_MODE_TUNNEL:
                x->props.header_len += sizeof(struct ipv6hdr);
+       default:
+               goto error;
+       }
        x->data = esp;
        return 0;
 
index 217d60f9fc80e89afc4e07a831ec9470c45b07e9..b12cc22e7745d4f629a1abe1871cfce161e551aa 100644 (file)
@@ -154,8 +154,10 @@ static void ip6_fl_gc(unsigned long dummy)
        write_unlock(&ip6_fl_lock);
 }
 
-static int fl_intern(struct ip6_flowlabel *fl, __be32 label)
+static struct ip6_flowlabel *fl_intern(struct ip6_flowlabel *fl, __be32 label)
 {
+       struct ip6_flowlabel *lfl;
+
        fl->label = label & IPV6_FLOWLABEL_MASK;
 
        write_lock_bh(&ip6_fl_lock);
@@ -163,12 +165,26 @@ static int fl_intern(struct ip6_flowlabel *fl, __be32 label)
                for (;;) {
                        fl->label = htonl(net_random())&IPV6_FLOWLABEL_MASK;
                        if (fl->label) {
-                               struct ip6_flowlabel *lfl;
                                lfl = __fl_lookup(fl->label);
                                if (lfl == NULL)
                                        break;
                        }
                }
+       } else {
+               /*
+                * we dropper the ip6_fl_lock, so this entry could reappear
+                * and we need to recheck with it.
+                *
+                * OTOH no need to search the active socket first, like it is
+                * done in ipv6_flowlabel_opt - sock is locked, so new entry
+                * with the same label can only appear on another sock
+                */
+               lfl = __fl_lookup(fl->label);
+               if (lfl != NULL) {
+                       atomic_inc(&lfl->users);
+                       write_unlock_bh(&ip6_fl_lock);
+                       return lfl;
+               }
        }
 
        fl->lastuse = jiffies;
@@ -176,7 +192,7 @@ static int fl_intern(struct ip6_flowlabel *fl, __be32 label)
        fl_ht[FL_HASH(fl->label)] = fl;
        atomic_inc(&fl_size);
        write_unlock_bh(&ip6_fl_lock);
-       return 0;
+       return NULL;
 }
 
 
@@ -190,14 +206,17 @@ struct ip6_flowlabel * fl6_sock_lookup(struct sock *sk, __be32 label)
 
        label &= IPV6_FLOWLABEL_MASK;
 
+       read_lock_bh(&ip6_sk_fl_lock);
        for (sfl=np->ipv6_fl_list; sfl; sfl = sfl->next) {
                struct ip6_flowlabel *fl = sfl->fl;
                if (fl->label == label) {
                        fl->lastuse = jiffies;
                        atomic_inc(&fl->users);
+                       read_unlock_bh(&ip6_sk_fl_lock);
                        return fl;
                }
        }
+       read_unlock_bh(&ip6_sk_fl_lock);
        return NULL;
 }
 
@@ -409,6 +428,16 @@ static int ipv6_opt_cmp(struct ipv6_txoptions *o1, struct ipv6_txoptions *o2)
        return 0;
 }
 
+static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl,
+               struct ip6_flowlabel *fl)
+{
+       write_lock_bh(&ip6_sk_fl_lock);
+       sfl->fl = fl;
+       sfl->next = np->ipv6_fl_list;
+       np->ipv6_fl_list = sfl;
+       write_unlock_bh(&ip6_sk_fl_lock);
+}
+
 int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
 {
        int err;
@@ -416,7 +445,8 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
        struct in6_flowlabel_req freq;
        struct ipv6_fl_socklist *sfl1=NULL;
        struct ipv6_fl_socklist *sfl, **sflp;
-       struct ip6_flowlabel *fl;
+       struct ip6_flowlabel *fl, *fl1 = NULL;
+
 
        if (optlen < sizeof(freq))
                return -EINVAL;
@@ -472,8 +502,6 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
                sfl1 = kmalloc(sizeof(*sfl1), GFP_KERNEL);
 
                if (freq.flr_label) {
-                       struct ip6_flowlabel *fl1 = NULL;
-
                        err = -EEXIST;
                        read_lock_bh(&ip6_sk_fl_lock);
                        for (sfl = np->ipv6_fl_list; sfl; sfl = sfl->next) {
@@ -492,6 +520,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
                        if (fl1 == NULL)
                                fl1 = fl_lookup(freq.flr_label);
                        if (fl1) {
+recheck:
                                err = -EEXIST;
                                if (freq.flr_flags&IPV6_FL_F_EXCL)
                                        goto release;
@@ -513,11 +542,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
                                        fl1->linger = fl->linger;
                                if ((long)(fl->expires - fl1->expires) > 0)
                                        fl1->expires = fl->expires;
-                               write_lock_bh(&ip6_sk_fl_lock);
-                               sfl1->fl = fl1;
-                               sfl1->next = np->ipv6_fl_list;
-                               np->ipv6_fl_list = sfl1;
-                               write_unlock_bh(&ip6_sk_fl_lock);
+                               fl_link(np, sfl1, fl1);
                                fl_free(fl);
                                return 0;
 
@@ -534,9 +559,9 @@ release:
                if (sfl1 == NULL || (err = mem_check(sk)) != 0)
                        goto done;
 
-               err = fl_intern(fl, freq.flr_label);
-               if (err)
-                       goto done;
+               fl1 = fl_intern(fl, freq.flr_label);
+               if (fl1 != NULL)
+                       goto recheck;
 
                if (!freq.flr_label) {
                        if (copy_to_user(&((struct in6_flowlabel_req __user *) optval)->flr_label,
@@ -545,9 +570,7 @@ release:
                        }
                }
 
-               sfl1->fl = fl;
-               sfl1->next = np->ipv6_fl_list;
-               np->ipv6_fl_list = sfl1;
+               fl_link(np, sfl1, fl);
                return 0;
 
        default:
index 28fc8edfdc3aa63f24f85df71869809d27df7e71..80ef2a1d39fd56704fef43e47a8c80456ce0a587 100644 (file)
@@ -411,8 +411,15 @@ static int ipcomp6_init_state(struct xfrm_state *x)
                goto out;
 
        x->props.header_len = 0;
-       if (x->props.mode == XFRM_MODE_TUNNEL)
+       switch (x->props.mode) {
+       case XFRM_MODE_BEET:
+       case XFRM_MODE_TRANSPORT:
+               break;
+       case XFRM_MODE_TUNNEL:
                x->props.header_len += sizeof(struct ipv6hdr);
+       default:
+               goto error;
+       }
 
        mutex_lock(&ipcomp6_resource_mutex);
        if (!ipcomp6_alloc_scratches())
index 6cc33dc83d1cb354767de626024fd6cd982573c3..20cfc90d5597dc266d398beb8de1eaeb0a77107f 100644 (file)
@@ -1658,30 +1658,26 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
        struct inet6_dev *idev;
        int ret;
 
-       if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME ||
-           ctl->ctl_name == NET_NEIGH_REACHABLE_TIME)
+       if ((strcmp(ctl->procname, "retrans_time") == 0) ||
+           (strcmp(ctl->procname, "base_reachable_time") == 0))
                ndisc_warn_deprecated_sysctl(ctl, "syscall", dev ? dev->name : "default");
 
-       switch (ctl->ctl_name) {
-       case NET_NEIGH_RETRANS_TIME:
+       if (strcmp(ctl->procname, "retrans_time") == 0)
                ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
-               break;
-       case NET_NEIGH_REACHABLE_TIME:
+
+       else if (strcmp(ctl->procname, "base_reachable_time") == 0)
                ret = proc_dointvec_jiffies(ctl, write,
                                            filp, buffer, lenp, ppos);
-               break;
-       case NET_NEIGH_RETRANS_TIME_MS:
-       case NET_NEIGH_REACHABLE_TIME_MS:
+
+       else if ((strcmp(ctl->procname, "retrans_time_ms") == 0) ||
+                (strcmp(ctl->procname, "base_reacable_time_ms") == 0))
                ret = proc_dointvec_ms_jiffies(ctl, write,
                                               filp, buffer, lenp, ppos);
-               break;
-       default:
+       else
                ret = -1;
-       }
 
        if (write && ret == 0 && dev && (idev = in6_dev_get(dev)) != NULL) {
-               if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME ||
-                   ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS)
+               if (ctl->data == &idev->nd_parms->base_reachable_time)
                        idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time);
                idev->tstamp = jiffies;
                inet6_ifinfo_notify(RTM_NEWLINK, idev);
index 0e40948f4fc6516237b90f940f58bb0e1298c5f8..ad74bab050477305a93153e586492dc663b7c3ee 100644 (file)
@@ -306,7 +306,6 @@ static struct nf_hook_ops ipv6_conntrack_ops[] = {
 #ifdef CONFIG_SYSCTL
 static ctl_table nf_ct_ipv6_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_FRAG6_TIMEOUT,
                .procname       = "nf_conntrack_frag6_timeout",
                .data           = &nf_frags_ctl.timeout,
                .maxlen         = sizeof(unsigned int),
index fbdc66920de4837a21461be7864fc36fbd5e7cb2..fd9123f3dc04dfc25472130744875548dd4de04b 100644 (file)
@@ -260,7 +260,6 @@ static int icmpv6_nlattr_to_tuple(struct nlattr *tb[],
 static struct ctl_table_header *icmpv6_sysctl_header;
 static struct ctl_table icmpv6_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_ICMPV6_TIMEOUT,
                .procname       = "nf_conntrack_icmpv6_timeout",
                .data           = &nf_ct_icmpv6_timeout,
                .maxlen         = sizeof(unsigned int),
index 726fafd41961b1489caaa9f618616ea50f8d70f6..e170c67c47a5b613c7681d05d0b0f73c784e9c46 100644 (file)
@@ -130,22 +130,6 @@ static inline void frag_kfree_skb(struct sk_buff *skb, unsigned int *work)
        kfree_skb(skb);
 }
 
-static void nf_frag_free(struct inet_frag_queue *q)
-{
-       kfree(container_of(q, struct nf_ct_frag6_queue, q));
-}
-
-static inline struct nf_ct_frag6_queue *frag_alloc_queue(void)
-{
-       struct nf_ct_frag6_queue *fq;
-
-       fq = kzalloc(sizeof(struct nf_ct_frag6_queue), GFP_ATOMIC);
-       if (fq == NULL)
-               return NULL;
-       atomic_add(sizeof(struct nf_ct_frag6_queue), &nf_frags.mem);
-       return fq;
-}
-
 /* Destruction primitives. */
 
 static __inline__ void fq_put(struct nf_ct_frag6_queue *fq)
@@ -168,7 +152,10 @@ static void nf_ct_frag6_evictor(void)
 
 static void nf_ct_frag6_expire(unsigned long data)
 {
-       struct nf_ct_frag6_queue *fq = (struct nf_ct_frag6_queue *) data;
+       struct nf_ct_frag6_queue *fq;
+
+       fq = container_of((struct inet_frag_queue *)data,
+                       struct nf_ct_frag6_queue, q);
 
        spin_lock(&fq->q.lock);
 
@@ -184,89 +171,29 @@ out:
 
 /* Creation primitives. */
 
-static struct nf_ct_frag6_queue *nf_ct_frag6_intern(unsigned int hash,
-                                         struct nf_ct_frag6_queue *fq_in)
+static __inline__ struct nf_ct_frag6_queue *
+fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
 {
-       struct nf_ct_frag6_queue *fq;
-#ifdef CONFIG_SMP
-       struct hlist_node *n;
-#endif
-
-       write_lock(&nf_frags.lock);
-#ifdef CONFIG_SMP
-       hlist_for_each_entry(fq, n, &nf_frags.hash[hash], q.list) {
-               if (fq->id == fq_in->id &&
-                   ipv6_addr_equal(&fq_in->saddr, &fq->saddr) &&
-                   ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) {
-                       atomic_inc(&fq->q.refcnt);
-                       write_unlock(&nf_frags.lock);
-                       fq_in->q.last_in |= COMPLETE;
-                       fq_put(fq_in);
-                       return fq;
-               }
-       }
-#endif
-       fq = fq_in;
-
-       if (!mod_timer(&fq->q.timer, jiffies + nf_frags_ctl.timeout))
-               atomic_inc(&fq->q.refcnt);
-
-       atomic_inc(&fq->q.refcnt);
-       hlist_add_head(&fq->q.list, &nf_frags.hash[hash]);
-       INIT_LIST_HEAD(&fq->q.lru_list);
-       list_add_tail(&fq->q.lru_list, &nf_frags.lru_list);
-       nf_frags.nqueues++;
-       write_unlock(&nf_frags.lock);
-       return fq;
-}
+       struct inet_frag_queue *q;
+       struct ip6_create_arg arg;
+       unsigned int hash;
 
+       arg.id = id;
+       arg.src = src;
+       arg.dst = dst;
+       hash = ip6qhashfn(id, src, dst);
 
-static struct nf_ct_frag6_queue *
-nf_ct_frag6_create(unsigned int hash, __be32 id, struct in6_addr *src,                            struct in6_addr *dst)
-{
-       struct nf_ct_frag6_queue *fq;
-
-       if ((fq = frag_alloc_queue()) == NULL) {
-               pr_debug("Can't alloc new queue\n");
+       q = inet_frag_find(&nf_frags, &arg, hash);
+       if (q == NULL)
                goto oom;
-       }
-
-       fq->id = id;
-       ipv6_addr_copy(&fq->saddr, src);
-       ipv6_addr_copy(&fq->daddr, dst);
-
-       setup_timer(&fq->q.timer, nf_ct_frag6_expire, (unsigned long)fq);
-       spin_lock_init(&fq->q.lock);
-       atomic_set(&fq->q.refcnt, 1);
 
-       return nf_ct_frag6_intern(hash, fq);
+       return container_of(q, struct nf_ct_frag6_queue, q);
 
 oom:
+       pr_debug("Can't alloc new queue\n");
        return NULL;
 }
 
-static __inline__ struct nf_ct_frag6_queue *
-fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst)
-{
-       struct nf_ct_frag6_queue *fq;
-       struct hlist_node *n;
-       unsigned int hash = ip6qhashfn(id, src, dst);
-
-       read_lock(&nf_frags.lock);
-       hlist_for_each_entry(fq, n, &nf_frags.hash[hash], q.list) {
-               if (fq->id == id &&
-                   ipv6_addr_equal(src, &fq->saddr) &&
-                   ipv6_addr_equal(dst, &fq->daddr)) {
-                       atomic_inc(&fq->q.refcnt);
-                       read_unlock(&nf_frags.lock);
-                       return fq;
-               }
-       }
-       read_unlock(&nf_frags.lock);
-
-       return nf_ct_frag6_create(hash, id, src, dst);
-}
-
 
 static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
                             struct frag_hdr *fhdr, int nhoff)
@@ -749,9 +676,12 @@ int nf_ct_frag6_init(void)
 {
        nf_frags.ctl = &nf_frags_ctl;
        nf_frags.hashfn = nf_hashfn;
-       nf_frags.destructor = nf_frag_free;
+       nf_frags.constructor = ip6_frag_init;
+       nf_frags.destructor = NULL;
        nf_frags.skb_free = nf_skb_free;
        nf_frags.qsize = sizeof(struct nf_ct_frag6_queue);
+       nf_frags.match = ip6_frag_match;
+       nf_frags.frag_expire = nf_ct_frag6_expire;
        inet_frags_init(&nf_frags);
 
        return 0;
index 6ad19cfc2025bca20618a81d7bb45495f7291ab1..76c88a93b9b5a7714678a0ccb28aa140aa4e4998 100644 (file)
@@ -143,6 +143,18 @@ static unsigned int ip6_hashfn(struct inet_frag_queue *q)
        return ip6qhashfn(fq->id, &fq->saddr, &fq->daddr);
 }
 
+int ip6_frag_match(struct inet_frag_queue *q, void *a)
+{
+       struct frag_queue *fq;
+       struct ip6_create_arg *arg = a;
+
+       fq = container_of(q, struct frag_queue, q);
+       return (fq->id == arg->id &&
+                       ipv6_addr_equal(&fq->saddr, arg->src) &&
+                       ipv6_addr_equal(&fq->daddr, arg->dst));
+}
+EXPORT_SYMBOL(ip6_frag_match);
+
 /* Memory Tracking Functions. */
 static inline void frag_kfree_skb(struct sk_buff *skb, int *work)
 {
@@ -152,20 +164,16 @@ static inline void frag_kfree_skb(struct sk_buff *skb, int *work)
        kfree_skb(skb);
 }
 
-static void ip6_frag_free(struct inet_frag_queue *fq)
+void ip6_frag_init(struct inet_frag_queue *q, void *a)
 {
-       kfree(container_of(fq, struct frag_queue, q));
-}
-
-static inline struct frag_queue *frag_alloc_queue(void)
-{
-       struct frag_queue *fq = kzalloc(sizeof(struct frag_queue), GFP_ATOMIC);
+       struct frag_queue *fq = container_of(q, struct frag_queue, q);
+       struct ip6_create_arg *arg = a;
 
-       if(!fq)
-               return NULL;
-       atomic_add(sizeof(struct frag_queue), &ip6_frags.mem);
-       return fq;
+       fq->id = arg->id;
+       ipv6_addr_copy(&fq->saddr, arg->src);
+       ipv6_addr_copy(&fq->daddr, arg->dst);
 }
+EXPORT_SYMBOL(ip6_frag_init);
 
 /* Destruction primitives. */
 
@@ -193,9 +201,11 @@ static void ip6_evictor(struct inet6_dev *idev)
 
 static void ip6_frag_expire(unsigned long data)
 {
-       struct frag_queue *fq = (struct frag_queue *) data;
+       struct frag_queue *fq;
        struct net_device *dev = NULL;
 
+       fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);
+
        spin_lock(&fq->q.lock);
 
        if (fq->q.last_in & COMPLETE)
@@ -230,98 +240,30 @@ out:
        fq_put(fq);
 }
 
-/* Creation primitives. */
-
-
-static struct frag_queue *ip6_frag_intern(struct frag_queue *fq_in)
+static __inline__ struct frag_queue *
+fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst,
+       struct inet6_dev *idev)
 {
-       struct frag_queue *fq;
+       struct inet_frag_queue *q;
+       struct ip6_create_arg arg;
        unsigned int hash;
-#ifdef CONFIG_SMP
-       struct hlist_node *n;
-#endif
 
-       write_lock(&ip6_frags.lock);
-       hash = ip6qhashfn(fq_in->id, &fq_in->saddr, &fq_in->daddr);
-#ifdef CONFIG_SMP
-       hlist_for_each_entry(fq, n, &ip6_frags.hash[hash], q.list) {
-               if (fq->id == fq_in->id &&
-                   ipv6_addr_equal(&fq_in->saddr, &fq->saddr) &&
-                   ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) {
-                       atomic_inc(&fq->q.refcnt);
-                       write_unlock(&ip6_frags.lock);
-                       fq_in->q.last_in |= COMPLETE;
-                       fq_put(fq_in);
-                       return fq;
-               }
-       }
-#endif
-       fq = fq_in;
-
-       if (!mod_timer(&fq->q.timer, jiffies + ip6_frags_ctl.timeout))
-               atomic_inc(&fq->q.refcnt);
-
-       atomic_inc(&fq->q.refcnt);
-       hlist_add_head(&fq->q.list, &ip6_frags.hash[hash]);
-       INIT_LIST_HEAD(&fq->q.lru_list);
-       list_add_tail(&fq->q.lru_list, &ip6_frags.lru_list);
-       ip6_frags.nqueues++;
-       write_unlock(&ip6_frags.lock);
-       return fq;
-}
-
-
-static struct frag_queue *
-ip6_frag_create(__be32 id, struct in6_addr *src, struct in6_addr *dst,
-               struct inet6_dev *idev)
-{
-       struct frag_queue *fq;
+       arg.id = id;
+       arg.src = src;
+       arg.dst = dst;
+       hash = ip6qhashfn(id, src, dst);
 
-       if ((fq = frag_alloc_queue()) == NULL)
+       q = inet_frag_find(&ip6_frags, &arg, hash);
+       if (q == NULL)
                goto oom;
 
-       fq->id = id;
-       ipv6_addr_copy(&fq->saddr, src);
-       ipv6_addr_copy(&fq->daddr, dst);
-
-       init_timer(&fq->q.timer);
-       fq->q.timer.function = ip6_frag_expire;
-       fq->q.timer.data = (long) fq;
-       spin_lock_init(&fq->q.lock);
-       atomic_set(&fq->q.refcnt, 1);
-
-       return ip6_frag_intern(fq);
+       return container_of(q, struct frag_queue, q);
 
 oom:
        IP6_INC_STATS_BH(idev, IPSTATS_MIB_REASMFAILS);
        return NULL;
 }
 
-static __inline__ struct frag_queue *
-fq_find(__be32 id, struct in6_addr *src, struct in6_addr *dst,
-       struct inet6_dev *idev)
-{
-       struct frag_queue *fq;
-       struct hlist_node *n;
-       unsigned int hash;
-
-       read_lock(&ip6_frags.lock);
-       hash = ip6qhashfn(id, src, dst);
-       hlist_for_each_entry(fq, n, &ip6_frags.hash[hash], q.list) {
-               if (fq->id == id &&
-                   ipv6_addr_equal(src, &fq->saddr) &&
-                   ipv6_addr_equal(dst, &fq->daddr)) {
-                       atomic_inc(&fq->q.refcnt);
-                       read_unlock(&ip6_frags.lock);
-                       return fq;
-               }
-       }
-       read_unlock(&ip6_frags.lock);
-
-       return ip6_frag_create(id, src, dst, idev);
-}
-
-
 static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
                           struct frag_hdr *fhdr, int nhoff)
 {
@@ -697,8 +639,11 @@ void __init ipv6_frag_init(void)
 
        ip6_frags.ctl = &ip6_frags_ctl;
        ip6_frags.hashfn = ip6_hashfn;
-       ip6_frags.destructor = ip6_frag_free;
+       ip6_frags.constructor = ip6_frag_init;
+       ip6_frags.destructor = NULL;
        ip6_frags.skb_free = NULL;
        ip6_frags.qsize = sizeof(struct frag_queue);
+       ip6_frags.match = ip6_frag_match;
+       ip6_frags.frag_expire = ip6_frag_expire;
        inet_frags_init(&ip6_frags);
 }
index cce9941c11c60afb75a7f4242b90aaf3a51e0670..95f8e4a62f68f6048f01e964ae1b619d9e90a947 100644 (file)
@@ -2397,7 +2397,6 @@ int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
 
 ctl_table ipv6_route_table[] = {
        {
-               .ctl_name       =       NET_IPV6_ROUTE_FLUSH,
                .procname       =       "flush",
                .data           =       &flush_delay,
                .maxlen         =       sizeof(int),
index 02f69e544f6f51c85f04266e3a2f1dfbcf19ddfc..515783707e86b0338d003dab53fe9b2310652aa3 100644 (file)
@@ -16,7 +16,7 @@
 #include <net/ipv6.h>
 #include <net/xfrm.h>
 
-int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
+int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi)
 {
        int err;
        __be32 seq;
@@ -24,11 +24,9 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
        struct xfrm_state *x;
        int xfrm_nr = 0;
        int decaps = 0;
-       int nexthdr;
        unsigned int nhoff;
 
        nhoff = IP6CB(skb)->nhoff;
-       nexthdr = skb_network_header(skb)[nhoff];
 
        seq = 0;
        if (!spi && (err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
@@ -41,7 +39,7 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
                        goto drop;
 
                x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi,
-                               nexthdr != IPPROTO_IPIP ? nexthdr : IPPROTO_IPV6, AF_INET6);
+                                     nexthdr, AF_INET6);
                if (x == NULL)
                        goto drop;
                spin_lock(&x->lock);
@@ -70,10 +68,10 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
 
                xfrm_vec[xfrm_nr++] = x;
 
-               if (x->mode->input(x, skb))
+               if (x->outer_mode->input(x, skb))
                        goto drop;
 
-               if (x->props.mode == XFRM_MODE_TUNNEL) { /* XXX */
+               if (x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) {
                        decaps = 1;
                        break;
                }
@@ -99,7 +97,6 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
        memcpy(skb->sp->xvec + skb->sp->len, xfrm_vec,
               xfrm_nr * sizeof(xfrm_vec[0]));
        skb->sp->len += xfrm_nr;
-       skb->ip_summed = CHECKSUM_NONE;
 
        nf_reset(skb);
 
@@ -135,7 +132,8 @@ EXPORT_SYMBOL(xfrm6_rcv_spi);
 
 int xfrm6_rcv(struct sk_buff *skb)
 {
-       return xfrm6_rcv_spi(skb, 0);
+       return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff],
+                            0);
 }
 
 EXPORT_SYMBOL(xfrm6_rcv);
index 13bb1e85676467e8e3a03d19b38518736d44e2ce..2bfb4f05c14cdffec7f7c455e5ecf43f34acd4c9 100644 (file)
@@ -79,6 +79,7 @@ static struct xfrm_mode xfrm6_beet_mode = {
        .output = xfrm6_beet_output,
        .owner = THIS_MODULE,
        .encap = XFRM_MODE_BEET,
+       .flags = XFRM_MODE_FLAG_TUNNEL,
 };
 
 static int __init xfrm6_beet_init(void)
index 957ae36b66958ab55fbe656e01d20bcba76f78a1..a7bc8c62317af220e6ba9ae95842286b4b7925c5 100644 (file)
@@ -58,16 +58,7 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
        return 0;
 }
 
-/*
- * Do nothing about routing optimization header unlike IPsec.
- */
-static int xfrm6_ro_input(struct xfrm_state *x, struct sk_buff *skb)
-{
-       return 0;
-}
-
 static struct xfrm_mode xfrm6_ro_mode = {
-       .input = xfrm6_ro_input,
        .output = xfrm6_ro_output,
        .owner = THIS_MODULE,
        .encap = XFRM_MODE_ROUTEOPTIMIZATION,
index ea22838791126f1df90aa82f43487ae121a6afc6..fd84e2217274a894ca69b1b7a23bfee81fab297f 100644 (file)
@@ -118,6 +118,7 @@ static struct xfrm_mode xfrm6_tunnel_mode = {
        .output = xfrm6_tunnel_output,
        .owner = THIS_MODULE,
        .encap = XFRM_MODE_TUNNEL,
+       .flags = XFRM_MODE_FLAG_TUNNEL,
 };
 
 static int __init xfrm6_tunnel_init(void)
index a5a32c17249ded0bc1211a3a2ff101c9898ed61e..656976760ad47175afa8bc6ac7d2152d5e7f95b4 100644 (file)
@@ -50,7 +50,7 @@ static inline int xfrm6_output_one(struct sk_buff *skb)
        struct ipv6hdr *iph;
        int err;
 
-       if (x->props.mode == XFRM_MODE_TUNNEL) {
+       if (x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) {
                err = xfrm6_tunnel_check_size(skb);
                if (err)
                        goto error_nolock;
index 15aa4c58c3159ef9ec2a844bcca0305c0b034ec8..82e27b80d07d3d060112eb873d7b0a9774853cba 100644 (file)
@@ -178,8 +178,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
                __xfrm6_bundle_len_inc(&header_len, &nfheader_len, xfrm[i]);
                trailer_len += xfrm[i]->props.trailer_len;
 
-               if (xfrm[i]->props.mode == XFRM_MODE_TUNNEL ||
-                   xfrm[i]->props.mode == XFRM_MODE_ROUTEOPTIMIZATION) {
+               if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
                        unsigned short encap_family = xfrm[i]->props.family;
                        switch(encap_family) {
                        case AF_INET:
@@ -215,7 +214,6 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
        i = 0;
        for (; dst_prev != &rt->u.dst; dst_prev = dst_prev->child) {
                struct xfrm_dst *x = (struct xfrm_dst*)dst_prev;
-               struct xfrm_state_afinfo *afinfo;
 
                dst_prev->xfrm = xfrm[i++];
                dst_prev->dev = rt->u.dst.dev;
@@ -232,18 +230,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
                /* Copy neighbour for reachability confirmation */
                dst_prev->neighbour     = neigh_clone(rt->u.dst.neighbour);
                dst_prev->input         = rt->u.dst.input;
-               /* XXX: When IPv4 is implemented as module and can be unloaded,
-                * we should manage reference to xfrm4_output in afinfo->output.
-                * Miyazawa
-                */
-               afinfo = xfrm_state_get_afinfo(dst_prev->xfrm->props.family);
-               if (!afinfo) {
-                       dst = *dst_p;
-                       goto error;
-               }
-
-               dst_prev->output = afinfo->output;
-               xfrm_state_put_afinfo(afinfo);
+               dst_prev->output = dst_prev->xfrm->outer_mode->afinfo->output;
                /* Sheit... I remember I did this right. Apparently,
                 * it was magically lost, so this code needs audit */
                x->u.rt6.rt6i_flags    = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL);
index cdadb4847469f21e52237c75d5f12abaac9a5ffb..b392bee396f16341c2842aa20c3759c19afb0238 100644 (file)
@@ -93,7 +93,8 @@ __xfrm6_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n)
        /* Rule 4: select IPsec tunnel */
        for (i = 0; i < n; i++) {
                if (src[i] &&
-                   src[i]->props.mode == XFRM_MODE_TUNNEL) {
+                   (src[i]->props.mode == XFRM_MODE_TUNNEL ||
+                    src[i]->props.mode == XFRM_MODE_BEET)) {
                        dst[j++] = src[i];
                        src[i] = NULL;
                }
@@ -146,7 +147,8 @@ __xfrm6_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n)
        /* Rule 3: select IPsec tunnel */
        for (i = 0; i < n; i++) {
                if (src[i] &&
-                   src[i]->mode == XFRM_MODE_TUNNEL) {
+                   (src[i]->mode == XFRM_MODE_TUNNEL ||
+                    src[i]->mode == XFRM_MODE_BEET)) {
                        dst[j++] = src[i];
                        src[i] = NULL;
                }
@@ -168,6 +170,7 @@ __xfrm6_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n)
 
 static struct xfrm_state_afinfo xfrm6_state_afinfo = {
        .family                 = AF_INET6,
+       .owner                  = THIS_MODULE,
        .init_tempsel           = __xfrm6_init_tempsel,
        .tmpl_sort              = __xfrm6_tmpl_sort,
        .state_sort             = __xfrm6_state_sort,
index 3f8a3abde67ea47c2c5a9cef9a4137d751477a4a..fae90ff310875eac20da4de63c56469ce53237eb 100644 (file)
@@ -248,7 +248,7 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
 
 static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
 {
-       return 0;
+       return skb_network_header(skb)[IP6CB(skb)->nhoff];
 }
 
 static int xfrm6_tunnel_rcv(struct sk_buff *skb)
@@ -257,7 +257,7 @@ static int xfrm6_tunnel_rcv(struct sk_buff *skb)
        __be32 spi;
 
        spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&iph->saddr);
-       return xfrm6_rcv_spi(skb, spi) > 0 ? : 0;
+       return xfrm6_rcv_spi(skb, IPPROTO_IPV6, spi) > 0 ? : 0;
 }
 
 static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
index 824309dabfe9450102791912c77c8f0ba1b74b4b..b5a13882c92714b42fba19c96a8ab898bab5f143 100644 (file)
@@ -381,18 +381,9 @@ static void ircomm_tty_discovery_indication(discinfo_t *discovery,
        info.daddr = discovery->daddr;
        info.saddr = discovery->saddr;
 
-       /* FIXME. We have a locking problem on the hashbin here.
-        * We probably need to use hashbin_find_next(), but we first
-        * need to ensure that "line" is unique. - Jean II */
-       self = (struct ircomm_tty_cb *) hashbin_get_first(ircomm_tty);
-       while (self != NULL) {
-               IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
-
-               ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION,
-                                   NULL, &info);
-
-               self = (struct ircomm_tty_cb *) hashbin_get_next(ircomm_tty);
-       }
+       self = (struct ircomm_tty_cb *) priv;
+       ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION,
+                           NULL, &info);
 }
 
 /*
index 957e04feb0f71dbb1492121d93998dde4fb62d83..525343a1c521a052349a8163c0c737b5b58aca66 100644 (file)
 #include <net/irda/irda.h>             /* irda_debug */
 #include <net/irda/irias_object.h>
 
-#define NET_IRDA 412 /* Random number */
-enum { DISCOVERY=1, DEVNAME, DEBUG, FAST_POLL, DISCOVERY_SLOTS,
-       DISCOVERY_TIMEOUT, SLOT_TIMEOUT, MAX_BAUD_RATE, MIN_TX_TURN_TIME,
-       MAX_TX_DATA_SIZE, MAX_TX_WINDOW, MAX_NOREPLY_TIME, WARN_NOREPLY_TIME,
-       LAP_KEEPALIVE_TIME };
-
 extern int  sysctl_discovery;
 extern int  sysctl_discovery_slots;
 extern int  sysctl_discovery_timeout;
@@ -94,7 +88,7 @@ static int do_devname(ctl_table *table, int write, struct file *filp,
 /* One file */
 static ctl_table irda_table[] = {
        {
-               .ctl_name       = DISCOVERY,
+               .ctl_name       = NET_IRDA_DISCOVERY,
                .procname       = "discovery",
                .data           = &sysctl_discovery,
                .maxlen         = sizeof(int),
@@ -102,7 +96,7 @@ static ctl_table irda_table[] = {
                .proc_handler   = &proc_dointvec
        },
        {
-               .ctl_name       = DEVNAME,
+               .ctl_name       = NET_IRDA_DEVNAME,
                .procname       = "devname",
                .data           = sysctl_devname,
                .maxlen         = 65,
@@ -112,7 +106,7 @@ static ctl_table irda_table[] = {
        },
 #ifdef CONFIG_IRDA_DEBUG
        {
-               .ctl_name       = DEBUG,
+               .ctl_name       = NET_IRDA_DEBUG,
                .procname       = "debug",
                .data           = &irda_debug,
                .maxlen         = sizeof(int),
@@ -122,7 +116,7 @@ static ctl_table irda_table[] = {
 #endif
 #ifdef CONFIG_IRDA_FAST_RR
        {
-               .ctl_name       = FAST_POLL,
+               .ctl_name       = NET_IRDA_FAST_POLL,
                .procname       = "fast_poll_increase",
                .data           = &sysctl_fast_poll_increase,
                .maxlen         = sizeof(int),
@@ -131,7 +125,7 @@ static ctl_table irda_table[] = {
        },
 #endif
        {
-               .ctl_name       = DISCOVERY_SLOTS,
+               .ctl_name       = NET_IRDA_DISCOVERY_SLOTS,
                .procname       = "discovery_slots",
                .data           = &sysctl_discovery_slots,
                .maxlen         = sizeof(int),
@@ -142,7 +136,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_discovery_slots
        },
        {
-               .ctl_name       = DISCOVERY_TIMEOUT,
+               .ctl_name       = NET_IRDA_DISCOVERY_TIMEOUT,
                .procname       = "discovery_timeout",
                .data           = &sysctl_discovery_timeout,
                .maxlen         = sizeof(int),
@@ -150,7 +144,7 @@ static ctl_table irda_table[] = {
                .proc_handler   = &proc_dointvec
        },
        {
-               .ctl_name       = SLOT_TIMEOUT,
+               .ctl_name       = NET_IRDA_SLOT_TIMEOUT,
                .procname       = "slot_timeout",
                .data           = &sysctl_slot_timeout,
                .maxlen         = sizeof(int),
@@ -161,7 +155,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_slot_timeout
        },
        {
-               .ctl_name       = MAX_BAUD_RATE,
+               .ctl_name       = NET_IRDA_MAX_BAUD_RATE,
                .procname       = "max_baud_rate",
                .data           = &sysctl_max_baud_rate,
                .maxlen         = sizeof(int),
@@ -172,7 +166,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_max_baud_rate
        },
        {
-               .ctl_name       = MIN_TX_TURN_TIME,
+               .ctl_name       = NET_IRDA_MIN_TX_TURN_TIME,
                .procname       = "min_tx_turn_time",
                .data           = &sysctl_min_tx_turn_time,
                .maxlen         = sizeof(int),
@@ -183,7 +177,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_min_tx_turn_time
        },
        {
-               .ctl_name       = MAX_TX_DATA_SIZE,
+               .ctl_name       = NET_IRDA_MAX_TX_DATA_SIZE,
                .procname       = "max_tx_data_size",
                .data           = &sysctl_max_tx_data_size,
                .maxlen         = sizeof(int),
@@ -194,7 +188,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_max_tx_data_size
        },
        {
-               .ctl_name       = MAX_TX_WINDOW,
+               .ctl_name       = NET_IRDA_MAX_TX_WINDOW,
                .procname       = "max_tx_window",
                .data           = &sysctl_max_tx_window,
                .maxlen         = sizeof(int),
@@ -205,7 +199,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_max_tx_window
        },
        {
-               .ctl_name       = MAX_NOREPLY_TIME,
+               .ctl_name       = NET_IRDA_MAX_NOREPLY_TIME,
                .procname       = "max_noreply_time",
                .data           = &sysctl_max_noreply_time,
                .maxlen         = sizeof(int),
@@ -216,7 +210,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_max_noreply_time
        },
        {
-               .ctl_name       = WARN_NOREPLY_TIME,
+               .ctl_name       = NET_IRDA_WARN_NOREPLY_TIME,
                .procname       = "warn_noreply_time",
                .data           = &sysctl_warn_noreply_time,
                .maxlen         = sizeof(int),
@@ -227,7 +221,7 @@ static ctl_table irda_table[] = {
                .extra2         = &max_warn_noreply_time
        },
        {
-               .ctl_name       = LAP_KEEPALIVE_TIME,
+               .ctl_name       = NET_IRDA_LAP_KEEPALIVE_TIME,
                .procname       = "lap_keepalive_time",
                .data           = &sysctl_lap_keepalive_time,
                .maxlen         = sizeof(int),
index f0224c2311d29a9df5826bfe46def0a93cf3866f..6caa3ec2cff7798ef13e1f604fc8bdfff50a0c4c 100644 (file)
@@ -306,9 +306,12 @@ int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq)
                            ((chan->chan == channel) || (chan->freq == freq))) {
                                local->oper_channel = chan;
                                local->oper_hw_mode = mode;
-                               set++;
+                               set = 1;
+                               break;
                        }
                }
+               if (set)
+                       break;
        }
 
        if (set) {
@@ -508,10 +511,11 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
 
 static int ieee80211_ioctl_siwscan(struct net_device *dev,
                                   struct iw_request_info *info,
-                                  struct iw_point *data, char *extra)
+                                  union iwreq_data *wrqu, char *extra)
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+       struct iw_scan_req *req = NULL;
        u8 *ssid = NULL;
        size_t ssid_len = 0;
 
@@ -536,6 +540,14 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
                return -EOPNOTSUPP;
        }
 
+       /* if SSID was specified explicitly then use that */
+       if (wrqu->data.length == sizeof(struct iw_scan_req) &&
+           wrqu->data.flags & IW_SCAN_THIS_ESSID) {
+               req = (struct iw_scan_req *)extra;
+               ssid = req->essid;
+               ssid_len = req->essid_len;
+       }
+
        return ieee80211_sta_req_scan(dev, ssid, ssid_len);
 }
 
index 1641e8fe44b715e9b8d3832273d90d7df499b4a4..db81aef6177a948471d7d1f19ae9143ec88ad1c5 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 /* TODO:
- * BSS table: use <BSSID,SSID> as the key to support multi-SSID APs
  * order BSS list by RSSI(?) ("quality of AP")
  * scan result table filtering (by capability (privacy, IBSS/BSS, WPA/RSN IE,
  *    SSID)
@@ -61,7 +60,8 @@
 static void ieee80211_send_probe_req(struct net_device *dev, u8 *dst,
                                     u8 *ssid, size_t ssid_len);
 static struct ieee80211_sta_bss *
-ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid);
+ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int channel,
+                    u8 *ssid, u8 ssid_len);
 static void ieee80211_rx_bss_put(struct net_device *dev,
                                 struct ieee80211_sta_bss *bss);
 static int ieee80211_sta_find_ibss(struct net_device *dev,
@@ -427,7 +427,9 @@ static void ieee80211_set_associated(struct net_device *dev,
                if (sdata->type != IEEE80211_IF_TYPE_STA)
                        return;
 
-               bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+               bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
+                                          local->hw.conf.channel,
+                                          ifsta->ssid, ifsta->ssid_len);
                if (bss) {
                        if (bss->has_erp_value)
                                ieee80211_handle_erp_ie(dev, bss->erp_value);
@@ -574,7 +576,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
                capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME |
                        WLAN_CAPABILITY_SHORT_PREAMBLE;
        }
-       bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+       bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
+                                  ifsta->ssid, ifsta->ssid_len);
        if (bss) {
                if (bss->capability & WLAN_CAPABILITY_PRIVACY)
                        capab |= WLAN_CAPABILITY_PRIVACY;
@@ -722,6 +725,7 @@ static void ieee80211_send_disassoc(struct net_device *dev,
 static int ieee80211_privacy_mismatch(struct net_device *dev,
                                      struct ieee80211_if_sta *ifsta)
 {
+       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sta_bss *bss;
        int res = 0;
 
@@ -729,7 +733,8 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
            ifsta->key_management_enabled)
                return 0;
 
-       bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+       bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
+                                  ifsta->ssid, ifsta->ssid_len);
        if (!bss)
                return 0;
 
@@ -1203,15 +1208,11 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
        capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info);
        status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code);
        aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
-       if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
-               printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
-                      "set\n", dev->name, aid);
-       aid &= ~(BIT(15) | BIT(14));
 
        printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x "
               "status=%d aid=%d)\n",
               dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa),
-              capab_info, status_code, aid);
+              capab_info, status_code, aid & ~(BIT(15) | BIT(14)));
 
        if (status_code != WLAN_STATUS_SUCCESS) {
                printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
@@ -1223,6 +1224,11 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
                return;
        }
 
+       if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
+               printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
+                      "set\n", dev->name, aid);
+       aid &= ~(BIT(15) | BIT(14));
+
        pos = mgmt->u.assoc_resp.variable;
        if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
            == ParseFailed) {
@@ -1241,7 +1247,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
         * update our stored copy */
        if (elems.erp_info && elems.erp_info_len >= 1) {
                struct ieee80211_sta_bss *bss
-                       = ieee80211_rx_bss_get(dev, ifsta->bssid);
+                       = ieee80211_rx_bss_get(dev, ifsta->bssid,
+                                              local->hw.conf.channel,
+                                              ifsta->ssid, ifsta->ssid_len);
                if (bss) {
                        bss->erp_value = elems.erp_info[0];
                        bss->has_erp_value = 1;
@@ -1271,7 +1279,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
                               " AP\n", dev->name);
                        return;
                }
-               bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+               bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
+                                          local->hw.conf.channel,
+                                          ifsta->ssid, ifsta->ssid_len);
                if (bss) {
                        sta->last_rssi = bss->rssi;
                        sta->last_signal = bss->signal;
@@ -1347,7 +1357,8 @@ static void __ieee80211_rx_bss_hash_del(struct net_device *dev,
 
 
 static struct ieee80211_sta_bss *
-ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
+ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid, int channel,
+                    u8 *ssid, u8 ssid_len)
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sta_bss *bss;
@@ -1358,6 +1369,11 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
        atomic_inc(&bss->users);
        atomic_inc(&bss->users);
        memcpy(bss->bssid, bssid, ETH_ALEN);
+       bss->channel = channel;
+       if (ssid && ssid_len <= IEEE80211_MAX_SSID_LEN) {
+               memcpy(bss->ssid, ssid, ssid_len);
+               bss->ssid_len = ssid_len;
+       }
 
        spin_lock_bh(&local->sta_bss_lock);
        /* TODO: order by RSSI? */
@@ -1369,7 +1385,8 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
 
 
 static struct ieee80211_sta_bss *
-ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
+ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int channel,
+                    u8 *ssid, u8 ssid_len)
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sta_bss *bss;
@@ -1377,7 +1394,10 @@ ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
        spin_lock_bh(&local->sta_bss_lock);
        bss = local->sta_bss_hash[STA_HASH(bssid)];
        while (bss) {
-               if (memcmp(bss->bssid, bssid, ETH_ALEN) == 0) {
+               if (!memcmp(bss->bssid, bssid, ETH_ALEN) &&
+                   bss->channel == channel &&
+                   bss->ssid_len == ssid_len &&
+                   (ssid_len == 0 || !memcmp(bss->ssid, ssid, ssid_len))) {
                        atomic_inc(&bss->users);
                        break;
                }
@@ -1545,9 +1565,11 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
        else
                channel = rx_status->channel;
 
-       bss = ieee80211_rx_bss_get(dev, mgmt->bssid);
+       bss = ieee80211_rx_bss_get(dev, mgmt->bssid, channel,
+                                  elems.ssid, elems.ssid_len);
        if (!bss) {
-               bss = ieee80211_rx_bss_add(dev, mgmt->bssid);
+               bss = ieee80211_rx_bss_add(dev, mgmt->bssid, channel,
+                                          elems.ssid, elems.ssid_len);
                if (!bss)
                        return;
        } else {
@@ -1573,10 +1595,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
 
        bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int);
        bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info);
-       if (elems.ssid && elems.ssid_len <= IEEE80211_MAX_SSID_LEN) {
-               memcpy(bss->ssid, elems.ssid, elems.ssid_len);
-               bss->ssid_len = elems.ssid_len;
-       }
 
        bss->supp_rates_len = 0;
        if (elems.supp_rates) {
@@ -1647,7 +1665,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
 
 
        bss->hw_mode = rx_status->phymode;
-       bss->channel = channel;
        bss->freq = rx_status->freq;
        if (channel != rx_status->channel &&
            (bss->hw_mode == MODE_IEEE80211G ||
@@ -2375,7 +2392,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sta_bss *bss;
-       struct ieee80211_sub_if_data *sdata;
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_hw_mode *mode;
        u8 bssid[ETH_ALEN], *pos;
        int i;
@@ -2398,18 +2415,17 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
        printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %s\n",
               dev->name, print_mac(mac, bssid));
 
-       bss = ieee80211_rx_bss_add(dev, bssid);
+       bss = ieee80211_rx_bss_add(dev, bssid, local->hw.conf.channel,
+                                  sdata->u.sta.ssid, sdata->u.sta.ssid_len);
        if (!bss)
                return -ENOMEM;
 
-       sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        mode = local->oper_hw_mode;
 
        if (local->hw.conf.beacon_int == 0)
                local->hw.conf.beacon_int = 100;
        bss->beacon_int = local->hw.conf.beacon_int;
        bss->hw_mode = local->hw.conf.phymode;
-       bss->channel = local->hw.conf.channel;
        bss->freq = local->hw.conf.freq;
        bss->last_update = jiffies;
        bss->capability = WLAN_CAPABILITY_IBSS;
@@ -2469,7 +2485,8 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
               "%s\n", print_mac(mac, bssid), print_mac(mac2, ifsta->bssid));
 #endif /* CONFIG_MAC80211_IBSS_DEBUG */
        if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 &&
-           (bss = ieee80211_rx_bss_get(dev, bssid))) {
+           (bss = ieee80211_rx_bss_get(dev, bssid, local->hw.conf.channel,
+                                       ifsta->ssid, ifsta->ssid_len))) {
                printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"
                       " based on configured SSID\n",
                       dev->name, print_mac(mac, bssid));
index d8b501878d9fbf71f1c59fea03f748364fe52120..13f8191796420584c109b3f971093965ed91c08b 100644 (file)
@@ -70,7 +70,6 @@ static int new(struct nf_conn *conntrack, const struct sk_buff *skb,
 static struct ctl_table_header *generic_sysctl_header;
 static struct ctl_table generic_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_GENERIC_TIMEOUT,
                .procname       = "nf_conntrack_generic_timeout",
                .data           = &nf_ct_generic_timeout,
                .maxlen         = sizeof(unsigned int),
@@ -84,7 +83,6 @@ static struct ctl_table generic_sysctl_table[] = {
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
 static struct ctl_table generic_compat_sysctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT,
                .procname       = "ip_conntrack_generic_timeout",
                .data           = &nf_ct_generic_timeout,
                .maxlen         = sizeof(unsigned int),
index 04192acc7c402f6ab7c8eca48e2fefabb12ea278..cb046751059278d602848b4126d530a37bc165bf 100644 (file)
@@ -476,7 +476,6 @@ static unsigned int sctp_sysctl_table_users;
 static struct ctl_table_header *sctp_sysctl_header;
 static struct ctl_table sctp_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,
                .procname       = "nf_conntrack_sctp_timeout_closed",
                .data           = &nf_ct_sctp_timeout_closed,
                .maxlen         = sizeof(unsigned int),
@@ -484,7 +483,6 @@ static struct ctl_table sctp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT,
                .procname       = "nf_conntrack_sctp_timeout_cookie_wait",
                .data           = &nf_ct_sctp_timeout_cookie_wait,
                .maxlen         = sizeof(unsigned int),
@@ -492,7 +490,6 @@ static struct ctl_table sctp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED,
                .procname       = "nf_conntrack_sctp_timeout_cookie_echoed",
                .data           = &nf_ct_sctp_timeout_cookie_echoed,
                .maxlen         = sizeof(unsigned int),
@@ -500,7 +497,6 @@ static struct ctl_table sctp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED,
                .procname       = "nf_conntrack_sctp_timeout_established",
                .data           = &nf_ct_sctp_timeout_established,
                .maxlen         = sizeof(unsigned int),
@@ -508,7 +504,6 @@ static struct ctl_table sctp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT,
                .procname       = "nf_conntrack_sctp_timeout_shutdown_sent",
                .data           = &nf_ct_sctp_timeout_shutdown_sent,
                .maxlen         = sizeof(unsigned int),
@@ -516,7 +511,6 @@ static struct ctl_table sctp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD,
                .procname       = "nf_conntrack_sctp_timeout_shutdown_recd",
                .data           = &nf_ct_sctp_timeout_shutdown_recd,
                .maxlen         = sizeof(unsigned int),
@@ -524,7 +518,6 @@ static struct ctl_table sctp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT,
                .procname       = "nf_conntrack_sctp_timeout_shutdown_ack_sent",
                .data           = &nf_ct_sctp_timeout_shutdown_ack_sent,
                .maxlen         = sizeof(unsigned int),
@@ -539,7 +532,6 @@ static struct ctl_table sctp_sysctl_table[] = {
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
 static struct ctl_table sctp_compat_sysctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED,
                .procname       = "ip_conntrack_sctp_timeout_closed",
                .data           = &nf_ct_sctp_timeout_closed,
                .maxlen         = sizeof(unsigned int),
@@ -547,7 +539,6 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT,
                .procname       = "ip_conntrack_sctp_timeout_cookie_wait",
                .data           = &nf_ct_sctp_timeout_cookie_wait,
                .maxlen         = sizeof(unsigned int),
@@ -555,7 +546,6 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED,
                .procname       = "ip_conntrack_sctp_timeout_cookie_echoed",
                .data           = &nf_ct_sctp_timeout_cookie_echoed,
                .maxlen         = sizeof(unsigned int),
@@ -563,7 +553,6 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED,
                .procname       = "ip_conntrack_sctp_timeout_established",
                .data           = &nf_ct_sctp_timeout_established,
                .maxlen         = sizeof(unsigned int),
@@ -571,7 +560,6 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT,
                .procname       = "ip_conntrack_sctp_timeout_shutdown_sent",
                .data           = &nf_ct_sctp_timeout_shutdown_sent,
                .maxlen         = sizeof(unsigned int),
@@ -579,7 +567,6 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD,
                .procname       = "ip_conntrack_sctp_timeout_shutdown_recd",
                .data           = &nf_ct_sctp_timeout_shutdown_recd,
                .maxlen         = sizeof(unsigned int),
@@ -587,7 +574,6 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT,
                .procname       = "ip_conntrack_sctp_timeout_shutdown_ack_sent",
                .data           = &nf_ct_sctp_timeout_shutdown_ack_sent,
                .maxlen         = sizeof(unsigned int),
index c7075345971b000d6396fd07b4c710fcefc22227..7a3f64c1aca6f346581c0ef0bc54427f2fb75d14 100644 (file)
@@ -834,10 +834,12 @@ static int tcp_packet(struct nf_conn *conntrack,
        case TCP_CONNTRACK_SYN_SENT:
                if (old_state < TCP_CONNTRACK_TIME_WAIT)
                        break;
-               if (conntrack->proto.tcp.seen[!dir].flags &
-                       IP_CT_TCP_FLAG_CLOSE_INIT) {
-                       /* Attempt to reopen a closed connection.
-                       * Delete this connection and look up again. */
+               if ((conntrack->proto.tcp.seen[!dir].flags &
+                       IP_CT_TCP_FLAG_CLOSE_INIT)
+                   || (conntrack->proto.tcp.last_dir == dir
+                       && conntrack->proto.tcp.last_index == TCP_RST_SET)) {
+                       /* Attempt to reopen a closed/aborted connection.
+                        * Delete this connection and look up again. */
                        write_unlock_bh(&tcp_lock);
                        if (del_timer(&conntrack->timeout))
                                conntrack->timeout.function((unsigned long)
@@ -925,6 +927,7 @@ static int tcp_packet(struct nf_conn *conntrack,
      in_window:
        /* From now on we have got in-window packets */
        conntrack->proto.tcp.last_index = index;
+       conntrack->proto.tcp.last_dir = dir;
 
        pr_debug("tcp_conntracks: ");
        NF_CT_DUMP_TUPLE(tuple);
@@ -1162,7 +1165,6 @@ static unsigned int tcp_sysctl_table_users;
 static struct ctl_table_header *tcp_sysctl_header;
 static struct ctl_table tcp_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,
                .procname       = "nf_conntrack_tcp_timeout_syn_sent",
                .data           = &nf_ct_tcp_timeout_syn_sent,
                .maxlen         = sizeof(unsigned int),
@@ -1170,7 +1172,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,
                .procname       = "nf_conntrack_tcp_timeout_syn_recv",
                .data           = &nf_ct_tcp_timeout_syn_recv,
                .maxlen         = sizeof(unsigned int),
@@ -1178,7 +1179,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,
                .procname       = "nf_conntrack_tcp_timeout_established",
                .data           = &nf_ct_tcp_timeout_established,
                .maxlen         = sizeof(unsigned int),
@@ -1186,7 +1186,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,
                .procname       = "nf_conntrack_tcp_timeout_fin_wait",
                .data           = &nf_ct_tcp_timeout_fin_wait,
                .maxlen         = sizeof(unsigned int),
@@ -1194,7 +1193,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,
                .procname       = "nf_conntrack_tcp_timeout_close_wait",
                .data           = &nf_ct_tcp_timeout_close_wait,
                .maxlen         = sizeof(unsigned int),
@@ -1202,7 +1200,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,
                .procname       = "nf_conntrack_tcp_timeout_last_ack",
                .data           = &nf_ct_tcp_timeout_last_ack,
                .maxlen         = sizeof(unsigned int),
@@ -1210,7 +1207,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,
                .procname       = "nf_conntrack_tcp_timeout_time_wait",
                .data           = &nf_ct_tcp_timeout_time_wait,
                .maxlen         = sizeof(unsigned int),
@@ -1218,7 +1214,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,
                .procname       = "nf_conntrack_tcp_timeout_close",
                .data           = &nf_ct_tcp_timeout_close,
                .maxlen         = sizeof(unsigned int),
@@ -1226,7 +1221,6 @@ static struct ctl_table tcp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS,
                .procname       = "nf_conntrack_tcp_timeout_max_retrans",
                .data           = &nf_ct_tcp_timeout_max_retrans,
                .maxlen         = sizeof(unsigned int),
@@ -1265,7 +1259,6 @@ static struct ctl_table tcp_sysctl_table[] = {
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
 static struct ctl_table tcp_compat_sysctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,
                .procname       = "ip_conntrack_tcp_timeout_syn_sent",
                .data           = &nf_ct_tcp_timeout_syn_sent,
                .maxlen         = sizeof(unsigned int),
@@ -1273,7 +1266,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV,
                .procname       = "ip_conntrack_tcp_timeout_syn_recv",
                .data           = &nf_ct_tcp_timeout_syn_recv,
                .maxlen         = sizeof(unsigned int),
@@ -1281,7 +1273,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED,
                .procname       = "ip_conntrack_tcp_timeout_established",
                .data           = &nf_ct_tcp_timeout_established,
                .maxlen         = sizeof(unsigned int),
@@ -1289,7 +1280,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT,
                .procname       = "ip_conntrack_tcp_timeout_fin_wait",
                .data           = &nf_ct_tcp_timeout_fin_wait,
                .maxlen         = sizeof(unsigned int),
@@ -1297,7 +1287,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT,
                .procname       = "ip_conntrack_tcp_timeout_close_wait",
                .data           = &nf_ct_tcp_timeout_close_wait,
                .maxlen         = sizeof(unsigned int),
@@ -1305,7 +1294,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK,
                .procname       = "ip_conntrack_tcp_timeout_last_ack",
                .data           = &nf_ct_tcp_timeout_last_ack,
                .maxlen         = sizeof(unsigned int),
@@ -1313,7 +1301,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT,
                .procname       = "ip_conntrack_tcp_timeout_time_wait",
                .data           = &nf_ct_tcp_timeout_time_wait,
                .maxlen         = sizeof(unsigned int),
@@ -1321,7 +1308,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE,
                .procname       = "ip_conntrack_tcp_timeout_close",
                .data           = &nf_ct_tcp_timeout_close,
                .maxlen         = sizeof(unsigned int),
@@ -1329,7 +1315,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS,
                .procname       = "ip_conntrack_tcp_timeout_max_retrans",
                .data           = &nf_ct_tcp_timeout_max_retrans,
                .maxlen         = sizeof(unsigned int),
index ba80e1a1ea17fd740fae91cacde263106cec28d2..b3e7ecb080e624575bf630b13d52c8abd6000d0c 100644 (file)
@@ -146,7 +146,6 @@ static unsigned int udp_sysctl_table_users;
 static struct ctl_table_header *udp_sysctl_header;
 static struct ctl_table udp_sysctl_table[] = {
        {
-               .ctl_name       = NET_NF_CONNTRACK_UDP_TIMEOUT,
                .procname       = "nf_conntrack_udp_timeout",
                .data           = &nf_ct_udp_timeout,
                .maxlen         = sizeof(unsigned int),
@@ -154,7 +153,6 @@ static struct ctl_table udp_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM,
                .procname       = "nf_conntrack_udp_timeout_stream",
                .data           = &nf_ct_udp_timeout_stream,
                .maxlen         = sizeof(unsigned int),
@@ -168,7 +166,6 @@ static struct ctl_table udp_sysctl_table[] = {
 #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
 static struct ctl_table udp_compat_sysctl_table[] = {
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT,
                .procname       = "ip_conntrack_udp_timeout",
                .data           = &nf_ct_udp_timeout,
                .maxlen         = sizeof(unsigned int),
@@ -176,7 +173,6 @@ static struct ctl_table udp_compat_sysctl_table[] = {
                .proc_handler   = &proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM,
                .procname       = "ip_conntrack_udp_timeout_stream",
                .data           = &nf_ct_udp_timeout_stream,
                .maxlen         = sizeof(unsigned int),
index f907770fd4e9097302ef8343f25401eec5eb6ee9..3358273a47b78f6567396de97619dab08a403ec6 100644 (file)
@@ -42,21 +42,21 @@ match_flags(const struct xt_sctp_flag_info *flag_info,
 static inline bool
 match_packet(const struct sk_buff *skb,
             unsigned int offset,
-            const u_int32_t *chunkmap,
-            int chunk_match_type,
-            const struct xt_sctp_flag_info *flag_info,
-            const int flag_count,
+            const struct xt_sctp_info *info,
             bool *hotdrop)
 {
        u_int32_t chunkmapcopy[256 / sizeof (u_int32_t)];
        sctp_chunkhdr_t _sch, *sch;
+       int chunk_match_type = info->chunk_match_type;
+       const struct xt_sctp_flag_info *flag_info = info->flag_info;
+       int flag_count = info->flag_count;
 
 #ifdef DEBUG_SCTP
        int i = 0;
 #endif
 
        if (chunk_match_type == SCTP_CHUNK_MATCH_ALL)
-               SCTP_CHUNKMAP_COPY(chunkmapcopy, chunkmap);
+               SCTP_CHUNKMAP_COPY(chunkmapcopy, info->chunkmap);
 
        do {
                sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch);
@@ -73,7 +73,7 @@ match_packet(const struct sk_buff *skb,
 
                duprintf("skb->len: %d\toffset: %d\n", skb->len, offset);
 
-               if (SCTP_CHUNKMAP_IS_SET(chunkmap, sch->type)) {
+               if (SCTP_CHUNKMAP_IS_SET(info->chunkmap, sch->type)) {
                        switch (chunk_match_type) {
                        case SCTP_CHUNK_MATCH_ANY:
                                if (match_flags(flag_info, flag_count,
@@ -104,7 +104,7 @@ match_packet(const struct sk_buff *skb,
 
        switch (chunk_match_type) {
        case SCTP_CHUNK_MATCH_ALL:
-               return SCTP_CHUNKMAP_IS_CLEAR(chunkmap);
+               return SCTP_CHUNKMAP_IS_CLEAR(info->chunkmap);
        case SCTP_CHUNK_MATCH_ANY:
                return false;
        case SCTP_CHUNK_MATCH_ONLY:
@@ -148,9 +148,7 @@ match(const struct sk_buff *skb,
                        && ntohs(sh->dest) <= info->dpts[1],
                        XT_SCTP_DEST_PORTS, info->flags, info->invflags)
                && SCCHECK(match_packet(skb, protoff + sizeof (sctp_sctphdr_t),
-                                       info->chunkmap, info->chunk_match_type,
-                                       info->flag_info, info->flag_count,
-                                       hotdrop),
+                                       info, hotdrop),
                           XT_SCTP_CHUNK_TYPES, info->flags, info->invflags);
 }
 
index 95ae11956f35ebb931fc4bf20039df2c8ba1caf8..e01d57692c9a76f530b89cbc0b9e9443ae3c8ced 100644 (file)
@@ -249,10 +249,11 @@ static void dev_watchdog_down(struct net_device *dev)
  */
 void netif_carrier_on(struct net_device *dev)
 {
-       if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state))
+       if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
                linkwatch_fire_event(dev);
-       if (netif_running(dev))
-               __netdev_watchdog_up(dev);
+               if (netif_running(dev))
+                       __netdev_watchdog_up(dev);
+       }
 }
 
 /**
index 738db32a287d0be1500e0f67d1ce3676f439783b..864b541bbf5171eb1a4b3338583af6dc2fe41c19 100644 (file)
@@ -114,7 +114,6 @@ done:
 
 static ctl_table debug_table[] = {
        {
-               .ctl_name       = CTL_RPCDEBUG,
                .procname       = "rpc_debug",
                .data           = &rpc_debug,
                .maxlen         = sizeof(int),
@@ -122,7 +121,6 @@ static ctl_table debug_table[] = {
                .proc_handler   = &proc_dodebug
        },
        {
-               .ctl_name       = CTL_NFSDEBUG,
                .procname       = "nfs_debug",
                .data           = &nfs_debug,
                .maxlen         = sizeof(int),
@@ -130,7 +128,6 @@ static ctl_table debug_table[] = {
                .proc_handler   = &proc_dodebug
        },
        {
-               .ctl_name       = CTL_NFSDDEBUG,
                .procname       = "nfsd_debug",
                .data           = &nfsd_debug,
                .maxlen         = sizeof(int),
@@ -138,7 +135,6 @@ static ctl_table debug_table[] = {
                .proc_handler   = &proc_dodebug
        },
        {
-               .ctl_name       = CTL_NLMDEBUG,
                .procname       = "nlm_debug",
                .data           = &nlm_debug,
                .maxlen         = sizeof(int),
index 113f44429982d26ad4ffce161187cceaf0115073..cb97fda1b6dfa196aedea7e091599cb944b61950 100644 (file)
@@ -49,13 +49,16 @@ EXPORT_SYMBOL(secpath_dup);
 int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
 {
        int offset, offset_seq;
+       int hlen;
 
        switch (nexthdr) {
        case IPPROTO_AH:
+               hlen = sizeof(struct ip_auth_hdr);
                offset = offsetof(struct ip_auth_hdr, spi);
                offset_seq = offsetof(struct ip_auth_hdr, seq_no);
                break;
        case IPPROTO_ESP:
+               hlen = sizeof(struct ip_esp_hdr);
                offset = offsetof(struct ip_esp_hdr, spi);
                offset_seq = offsetof(struct ip_esp_hdr, seq_no);
                break;
@@ -69,7 +72,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
                return 1;
        }
 
-       if (!pskb_may_pull(skb, 16))
+       if (!pskb_may_pull(skb, hlen))
                return -EINVAL;
 
        *spi = *(__be32*)(skb_transport_header(skb) + offset);
index 0eb3377602e9c3c9b413072f1db6f0b5a915b8e5..f4bfd6c4565119f9f3be6cb80547922b930b4f73 100644 (file)
@@ -63,7 +63,7 @@ int xfrm_output(struct sk_buff *skb)
                                xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
                }
 
-               err = x->mode->output(x, skb);
+               err = x->outer_mode->output(x, skb);
                if (err)
                        goto error;
 
@@ -82,7 +82,7 @@ int xfrm_output(struct sk_buff *skb)
                }
                dst = skb->dst;
                x = dst->xfrm;
-       } while (x && (x->props.mode != XFRM_MODE_TUNNEL));
+       } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL));
 
        err = 0;
 
index af27c193697c5ceede169a36588ed36cbd4e4abb..b702bd8a3893b7f2471df1c23df25a7105da70da 100644 (file)
@@ -49,8 +49,6 @@ static DEFINE_SPINLOCK(xfrm_policy_gc_lock);
 
 static struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family);
 static void xfrm_policy_put_afinfo(struct xfrm_policy_afinfo *afinfo);
-static struct xfrm_policy_afinfo *xfrm_policy_lock_afinfo(unsigned int family);
-static void xfrm_policy_unlock_afinfo(struct xfrm_policy_afinfo *afinfo);
 
 static inline int
 __xfrm4_selector_match(struct xfrm_selector *sel, struct flowi *fl)
@@ -86,72 +84,6 @@ int xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl,
        return 0;
 }
 
-int xfrm_register_type(struct xfrm_type *type, unsigned short family)
-{
-       struct xfrm_policy_afinfo *afinfo = xfrm_policy_lock_afinfo(family);
-       struct xfrm_type **typemap;
-       int err = 0;
-
-       if (unlikely(afinfo == NULL))
-               return -EAFNOSUPPORT;
-       typemap = afinfo->type_map;
-
-       if (likely(typemap[type->proto] == NULL))
-               typemap[type->proto] = type;
-       else
-               err = -EEXIST;
-       xfrm_policy_unlock_afinfo(afinfo);
-       return err;
-}
-EXPORT_SYMBOL(xfrm_register_type);
-
-int xfrm_unregister_type(struct xfrm_type *type, unsigned short family)
-{
-       struct xfrm_policy_afinfo *afinfo = xfrm_policy_lock_afinfo(family);
-       struct xfrm_type **typemap;
-       int err = 0;
-
-       if (unlikely(afinfo == NULL))
-               return -EAFNOSUPPORT;
-       typemap = afinfo->type_map;
-
-       if (unlikely(typemap[type->proto] != type))
-               err = -ENOENT;
-       else
-               typemap[type->proto] = NULL;
-       xfrm_policy_unlock_afinfo(afinfo);
-       return err;
-}
-EXPORT_SYMBOL(xfrm_unregister_type);
-
-struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
-{
-       struct xfrm_policy_afinfo *afinfo;
-       struct xfrm_type **typemap;
-       struct xfrm_type *type;
-       int modload_attempted = 0;
-
-retry:
-       afinfo = xfrm_policy_get_afinfo(family);
-       if (unlikely(afinfo == NULL))
-               return NULL;
-       typemap = afinfo->type_map;
-
-       type = typemap[proto];
-       if (unlikely(type && !try_module_get(type->owner)))
-               type = NULL;
-       if (!type && !modload_attempted) {
-               xfrm_policy_put_afinfo(afinfo);
-               request_module("xfrm-type-%d-%d",
-                              (int) family, (int) proto);
-               modload_attempted = 1;
-               goto retry;
-       }
-
-       xfrm_policy_put_afinfo(afinfo);
-       return type;
-}
-
 int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl,
                    unsigned short family)
 {
@@ -170,94 +102,6 @@ int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl,
 }
 EXPORT_SYMBOL(xfrm_dst_lookup);
 
-void xfrm_put_type(struct xfrm_type *type)
-{
-       module_put(type->owner);
-}
-
-int xfrm_register_mode(struct xfrm_mode *mode, int family)
-{
-       struct xfrm_policy_afinfo *afinfo;
-       struct xfrm_mode **modemap;
-       int err;
-
-       if (unlikely(mode->encap >= XFRM_MODE_MAX))
-               return -EINVAL;
-
-       afinfo = xfrm_policy_lock_afinfo(family);
-       if (unlikely(afinfo == NULL))
-               return -EAFNOSUPPORT;
-
-       err = -EEXIST;
-       modemap = afinfo->mode_map;
-       if (likely(modemap[mode->encap] == NULL)) {
-               modemap[mode->encap] = mode;
-               err = 0;
-       }
-
-       xfrm_policy_unlock_afinfo(afinfo);
-       return err;
-}
-EXPORT_SYMBOL(xfrm_register_mode);
-
-int xfrm_unregister_mode(struct xfrm_mode *mode, int family)
-{
-       struct xfrm_policy_afinfo *afinfo;
-       struct xfrm_mode **modemap;
-       int err;
-
-       if (unlikely(mode->encap >= XFRM_MODE_MAX))
-               return -EINVAL;
-
-       afinfo = xfrm_policy_lock_afinfo(family);
-       if (unlikely(afinfo == NULL))
-               return -EAFNOSUPPORT;
-
-       err = -ENOENT;
-       modemap = afinfo->mode_map;
-       if (likely(modemap[mode->encap] == mode)) {
-               modemap[mode->encap] = NULL;
-               err = 0;
-       }
-
-       xfrm_policy_unlock_afinfo(afinfo);
-       return err;
-}
-EXPORT_SYMBOL(xfrm_unregister_mode);
-
-struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family)
-{
-       struct xfrm_policy_afinfo *afinfo;
-       struct xfrm_mode *mode;
-       int modload_attempted = 0;
-
-       if (unlikely(encap >= XFRM_MODE_MAX))
-               return NULL;
-
-retry:
-       afinfo = xfrm_policy_get_afinfo(family);
-       if (unlikely(afinfo == NULL))
-               return NULL;
-
-       mode = afinfo->mode_map[encap];
-       if (unlikely(mode && !try_module_get(mode->owner)))
-               mode = NULL;
-       if (!mode && !modload_attempted) {
-               xfrm_policy_put_afinfo(afinfo);
-               request_module("xfrm-mode-%d-%d", family, encap);
-               modload_attempted = 1;
-               goto retry;
-       }
-
-       xfrm_policy_put_afinfo(afinfo);
-       return mode;
-}
-
-void xfrm_put_mode(struct xfrm_mode *mode)
-{
-       module_put(mode->owner);
-}
-
 static inline unsigned long make_jiffies(long secs)
 {
        if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
@@ -2096,7 +1940,8 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first,
                if (xdst->genid != dst->xfrm->genid)
                        return 0;
 
-               if (strict && fl && dst->xfrm->props.mode != XFRM_MODE_TUNNEL &&
+               if (strict && fl &&
+                   !(dst->xfrm->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) &&
                    !xfrm_state_addr_flow_check(dst->xfrm, fl, family))
                        return 0;
 
@@ -2213,23 +2058,6 @@ static void xfrm_policy_put_afinfo(struct xfrm_policy_afinfo *afinfo)
        read_unlock(&xfrm_policy_afinfo_lock);
 }
 
-static struct xfrm_policy_afinfo *xfrm_policy_lock_afinfo(unsigned int family)
-{
-       struct xfrm_policy_afinfo *afinfo;
-       if (unlikely(family >= NPROTO))
-               return NULL;
-       write_lock_bh(&xfrm_policy_afinfo_lock);
-       afinfo = xfrm_policy_afinfo[family];
-       if (unlikely(!afinfo))
-               write_unlock_bh(&xfrm_policy_afinfo_lock);
-       return afinfo;
-}
-
-static void xfrm_policy_unlock_afinfo(struct xfrm_policy_afinfo *afinfo)
-{
-       write_unlock_bh(&xfrm_policy_afinfo_lock);
-}
-
 static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
        struct net_device *dev = ptr;
@@ -2464,7 +2292,8 @@ static int xfrm_policy_migrate(struct xfrm_policy *pol,
                        if (!migrate_tmpl_match(mp, &pol->xfrm_vec[i]))
                                continue;
                        n++;
-                       if (pol->xfrm_vec[i].mode != XFRM_MODE_TUNNEL)
+                       if (pol->xfrm_vec[i].mode != XFRM_MODE_TUNNEL &&
+                           pol->xfrm_vec[i].mode != XFRM_MODE_BEET)
                                continue;
                        /* update endpoints */
                        memcpy(&pol->xfrm_vec[i].id.daddr, &mp->new_daddr,
index 344f0a6abec53aacd0da9dfe9600854f130c5f7b..224b44e31a07b934091f79e42b85888ab143925f 100644 (file)
@@ -57,6 +57,9 @@ static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024;
 static unsigned int xfrm_state_num;
 static unsigned int xfrm_state_genid;
 
+static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family);
+static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
+
 static inline unsigned int xfrm_dst_hash(xfrm_address_t *daddr,
                                         xfrm_address_t *saddr,
                                         u32 reqid,
@@ -187,6 +190,184 @@ int __xfrm_state_delete(struct xfrm_state *x);
 int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
 void km_state_expired(struct xfrm_state *x, int hard, u32 pid);
 
+static struct xfrm_state_afinfo *xfrm_state_lock_afinfo(unsigned int family)
+{
+       struct xfrm_state_afinfo *afinfo;
+       if (unlikely(family >= NPROTO))
+               return NULL;
+       write_lock_bh(&xfrm_state_afinfo_lock);
+       afinfo = xfrm_state_afinfo[family];
+       if (unlikely(!afinfo))
+               write_unlock_bh(&xfrm_state_afinfo_lock);
+       return afinfo;
+}
+
+static void xfrm_state_unlock_afinfo(struct xfrm_state_afinfo *afinfo)
+{
+       write_unlock_bh(&xfrm_state_afinfo_lock);
+}
+
+int xfrm_register_type(struct xfrm_type *type, unsigned short family)
+{
+       struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family);
+       struct xfrm_type **typemap;
+       int err = 0;
+
+       if (unlikely(afinfo == NULL))
+               return -EAFNOSUPPORT;
+       typemap = afinfo->type_map;
+
+       if (likely(typemap[type->proto] == NULL))
+               typemap[type->proto] = type;
+       else
+               err = -EEXIST;
+       xfrm_state_unlock_afinfo(afinfo);
+       return err;
+}
+EXPORT_SYMBOL(xfrm_register_type);
+
+int xfrm_unregister_type(struct xfrm_type *type, unsigned short family)
+{
+       struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family);
+       struct xfrm_type **typemap;
+       int err = 0;
+
+       if (unlikely(afinfo == NULL))
+               return -EAFNOSUPPORT;
+       typemap = afinfo->type_map;
+
+       if (unlikely(typemap[type->proto] != type))
+               err = -ENOENT;
+       else
+               typemap[type->proto] = NULL;
+       xfrm_state_unlock_afinfo(afinfo);
+       return err;
+}
+EXPORT_SYMBOL(xfrm_unregister_type);
+
+static struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
+{
+       struct xfrm_state_afinfo *afinfo;
+       struct xfrm_type **typemap;
+       struct xfrm_type *type;
+       int modload_attempted = 0;
+
+retry:
+       afinfo = xfrm_state_get_afinfo(family);
+       if (unlikely(afinfo == NULL))
+               return NULL;
+       typemap = afinfo->type_map;
+
+       type = typemap[proto];
+       if (unlikely(type && !try_module_get(type->owner)))
+               type = NULL;
+       if (!type && !modload_attempted) {
+               xfrm_state_put_afinfo(afinfo);
+               request_module("xfrm-type-%d-%d", family, proto);
+               modload_attempted = 1;
+               goto retry;
+       }
+
+       xfrm_state_put_afinfo(afinfo);
+       return type;
+}
+
+static void xfrm_put_type(struct xfrm_type *type)
+{
+       module_put(type->owner);
+}
+
+int xfrm_register_mode(struct xfrm_mode *mode, int family)
+{
+       struct xfrm_state_afinfo *afinfo;
+       struct xfrm_mode **modemap;
+       int err;
+
+       if (unlikely(mode->encap >= XFRM_MODE_MAX))
+               return -EINVAL;
+
+       afinfo = xfrm_state_lock_afinfo(family);
+       if (unlikely(afinfo == NULL))
+               return -EAFNOSUPPORT;
+
+       err = -EEXIST;
+       modemap = afinfo->mode_map;
+       if (modemap[mode->encap])
+               goto out;
+
+       err = -ENOENT;
+       if (!try_module_get(afinfo->owner))
+               goto out;
+
+       mode->afinfo = afinfo;
+       modemap[mode->encap] = mode;
+       err = 0;
+
+out:
+       xfrm_state_unlock_afinfo(afinfo);
+       return err;
+}
+EXPORT_SYMBOL(xfrm_register_mode);
+
+int xfrm_unregister_mode(struct xfrm_mode *mode, int family)
+{
+       struct xfrm_state_afinfo *afinfo;
+       struct xfrm_mode **modemap;
+       int err;
+
+       if (unlikely(mode->encap >= XFRM_MODE_MAX))
+               return -EINVAL;
+
+       afinfo = xfrm_state_lock_afinfo(family);
+       if (unlikely(afinfo == NULL))
+               return -EAFNOSUPPORT;
+
+       err = -ENOENT;
+       modemap = afinfo->mode_map;
+       if (likely(modemap[mode->encap] == mode)) {
+               modemap[mode->encap] = NULL;
+               module_put(mode->afinfo->owner);
+               err = 0;
+       }
+
+       xfrm_state_unlock_afinfo(afinfo);
+       return err;
+}
+EXPORT_SYMBOL(xfrm_unregister_mode);
+
+static struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family)
+{
+       struct xfrm_state_afinfo *afinfo;
+       struct xfrm_mode *mode;
+       int modload_attempted = 0;
+
+       if (unlikely(encap >= XFRM_MODE_MAX))
+               return NULL;
+
+retry:
+       afinfo = xfrm_state_get_afinfo(family);
+       if (unlikely(afinfo == NULL))
+               return NULL;
+
+       mode = afinfo->mode_map[encap];
+       if (unlikely(mode && !try_module_get(mode->owner)))
+               mode = NULL;
+       if (!mode && !modload_attempted) {
+               xfrm_state_put_afinfo(afinfo);
+               request_module("xfrm-mode-%d-%d", family, encap);
+               modload_attempted = 1;
+               goto retry;
+       }
+
+       xfrm_state_put_afinfo(afinfo);
+       return mode;
+}
+
+static void xfrm_put_mode(struct xfrm_mode *mode)
+{
+       module_put(mode->owner);
+}
+
 static void xfrm_state_gc_destroy(struct xfrm_state *x)
 {
        del_timer_sync(&x->timer);
@@ -196,8 +377,10 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
        kfree(x->calg);
        kfree(x->encap);
        kfree(x->coaddr);
-       if (x->mode)
-               xfrm_put_mode(x->mode);
+       if (x->inner_mode)
+               xfrm_put_mode(x->inner_mode);
+       if (x->outer_mode)
+               xfrm_put_mode(x->outer_mode);
        if (x->type) {
                x->type->destructor(x);
                xfrm_put_type(x->type);
@@ -1699,7 +1882,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo)
 }
 EXPORT_SYMBOL(xfrm_state_unregister_afinfo);
 
-struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family)
+static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family)
 {
        struct xfrm_state_afinfo *afinfo;
        if (unlikely(family >= NPROTO))
@@ -1711,14 +1894,11 @@ struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family)
        return afinfo;
 }
 
-void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo)
+static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo)
 {
        read_unlock(&xfrm_state_afinfo_lock);
 }
 
-EXPORT_SYMBOL(xfrm_state_get_afinfo);
-EXPORT_SYMBOL(xfrm_state_put_afinfo);
-
 /* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */
 void xfrm_state_delete_tunnel(struct xfrm_state *x)
 {
@@ -1769,6 +1949,14 @@ int xfrm_init_state(struct xfrm_state *x)
                goto error;
 
        err = -EPROTONOSUPPORT;
+       x->inner_mode = xfrm_get_mode(x->props.mode, x->sel.family);
+       if (x->inner_mode == NULL)
+               goto error;
+
+       if (!(x->inner_mode->flags & XFRM_MODE_FLAG_TUNNEL) &&
+           family != x->sel.family)
+               goto error;
+
        x->type = xfrm_get_type(x->id.proto, family);
        if (x->type == NULL)
                goto error;
@@ -1777,8 +1965,8 @@ int xfrm_init_state(struct xfrm_state *x)
        if (err)
                goto error;
 
-       x->mode = xfrm_get_mode(x->props.mode, family);
-       if (x->mode == NULL)
+       x->outer_mode = xfrm_get_mode(x->props.mode, family);
+       if (x->outer_mode == NULL)
                goto error;
 
        x->km.state = XFRM_STATE_VALID;
index 59ad83caa210dd5d31af0bb76aa234e3dad0fca6..cbb42580a81d964a69efe153749d05b4d2ac2f27 100755 (executable)
@@ -9,7 +9,7 @@ use strict;
 my $P = $0;
 $P =~ s@.*/@@g;
 
-my $V = '0.10';
+my $V = '0.11';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -18,12 +18,21 @@ my $tree = 1;
 my $chk_signoff = 1;
 my $chk_patch = 1;
 my $tst_type = 0;
+my $emacs = 0;
+my $file = 0;
+my $check = 0;
+my $root;
 GetOptions(
-       'q|quiet      => \$quiet,
+       'q|quiet+'      => \$quiet,
        'tree!'         => \$tree,
        'signoff!'      => \$chk_signoff,
        'patch!'        => \$chk_patch,
        'test-type!'    => \$tst_type,
+       'emacs!'        => \$emacs,
+       'file!'         => \$file,
+       'subjective!'   => \$check,
+       'strict!'       => \$check,
+       'root=s'        => \$root,
 ) or exit;
 
 my $exit = 0;
@@ -33,19 +42,110 @@ if ($#ARGV < 0) {
        print "version: $V\n";
        print "options: -q           => quiet\n";
        print "         --no-tree    => run without a kernel tree\n";
+       print "         --emacs      => emacs compile window format\n";
+       print "         --file       => check a source file\n";
+       print "         --strict     => enable more subjective tests\n";
+       print "         --root       => path to the kernel tree root\n";
        exit(1);
 }
 
-if ($tree && !top_of_kernel_tree()) {
-       print "Must be run from the top-level dir. of a kernel tree\n";
-       exit(2);
+if ($tree) {
+       if (defined $root) {
+               if (!top_of_kernel_tree($root)) {
+                       die "$P: $root: --root does not point at a valid tree\n";
+               }
+       } else {
+               if (top_of_kernel_tree('.')) {
+                       $root = '.';
+               } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ &&
+                                               top_of_kernel_tree($1)) {
+                       $root = $1;
+               }
+       }
+
+       if (!defined $root) {
+               print "Must be run from the top-level dir. of a kernel tree\n";
+               exit(2);
+       }
 }
 
+my $emitted_corrupt = 0;
+
+our $Ident       = qr{[A-Za-z_][A-Za-z\d_]*};
+our $Storage   = qr{extern|static|asmlinkage};
+our $Sparse    = qr{
+                       __user|
+                       __kernel|
+                       __force|
+                       __iomem|
+                       __must_check|
+                       __init_refok|
+                       __kprobes|
+                       fastcall
+               }x;
+our $Attribute = qr{
+                       const|
+                       __read_mostly|
+                       __kprobes|
+                       __(?:mem|cpu|dev|)(?:initdata|init)
+                 }x;
+our $Inline    = qr{inline|__always_inline|noinline};
+our $NonptrType        = qr{
+                       \b
+                       (?:const\s+)?
+                       (?:unsigned\s+)?
+                       (?:
+                               void|
+                               char|
+                               short|
+                               int|
+                               long|
+                               unsigned|
+                               float|
+                               double|
+                               bool|
+                               long\s+int|
+                               long\s+long|
+                               long\s+long\s+int|
+                               (?:__)?(?:u|s|be|le)(?:8|16|32|64)|
+                               struct\s+$Ident|
+                               union\s+$Ident|
+                               enum\s+$Ident|
+                               ${Ident}_t|
+                               ${Ident}_handler|
+                               ${Ident}_handler_fn
+                       )
+                       (?:\s+$Sparse)*
+                       \b
+                 }x;
+
+our $Type      = qr{
+                       \b$NonptrType\b
+                       (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
+                       (?:\s+$Sparse|\s+$Attribute)*
+                 }x;
+our $Declare   = qr{(?:$Storage\s+)?$Type};
+our $Member    = qr{->$Ident|\.$Ident|\[[^]]*\]};
+our $Lval      = qr{$Ident(?:$Member)*};
+
+our $Constant  = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*};
+our $Assignment        = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)};
+our $Operators = qr{
+                       <=|>=|==|!=|
+                       =>|->|<<|>>|<|>|!|~|
+                       &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/
+                 }x;
+
+our $Bare = '';
+
+$chk_signoff = 0 if ($file);
+
 my @dep_includes = ();
 my @dep_functions = ();
-my $removal = 'Documentation/feature-removal-schedule.txt';
-if ($tree && -f $removal) {
-       open(REMOVE, "<$removal") || die "$P: $removal: open failed - $!\n";
+my $removal = "Documentation/feature-removal-schedule.txt";
+if ($tree && -f "$root/$removal") {
+       open(REMOVE, "<$root/$removal") ||
+                               die "$P: $removal: open failed - $!\n";
        while (<REMOVE>) {
                if (/^Check:\s+(.*\S)/) {
                        for my $entry (split(/[, ]+/, $1)) {
@@ -61,28 +161,42 @@ if ($tree && -f $removal) {
 }
 
 my @rawlines = ();
-while (<>) {
-       chomp;
-       push(@rawlines, $_);
-       if (eof(ARGV)) {
-               if (!process($ARGV, @rawlines)) {
-                       $exit = 1;
-               }
-               @rawlines = ();
+for my $filename (@ARGV) {
+       if ($file) {
+               open(FILE, "diff -u /dev/null $filename|") ||
+                       die "$P: $filename: diff failed - $!\n";
+       } else {
+               open(FILE, "<$filename") ||
+                       die "$P: $filename: open failed - $!\n";
        }
+       while (<FILE>) {
+               chomp;
+               push(@rawlines, $_);
+       }
+       close(FILE);
+       if (!process($filename, @rawlines)) {
+               $exit = 1;
+       }
+       @rawlines = ();
 }
 
 exit($exit);
 
 sub top_of_kernel_tree {
-       if ((-f "COPYING") && (-f "CREDITS") && (-f "Kbuild") &&
-           (-f "MAINTAINERS") && (-f "Makefile") && (-f "README") &&
-           (-d "Documentation") && (-d "arch") && (-d "include") &&
-           (-d "drivers") && (-d "fs") && (-d "init") && (-d "ipc") &&
-           (-d "kernel") && (-d "lib") && (-d "scripts")) {
-               return 1;
+       my ($root) = @_;
+
+       my @tree_check = (
+               "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile",
+               "README", "Documentation", "arch", "include", "drivers",
+               "fs", "init", "ipc", "kernel", "lib", "scripts",
+       );
+
+       foreach my $check (@tree_check) {
+               if (! -e $root . '/' . $check) {
+                       return 0;
+               }
        }
-       return 0;
+       return 1;
 }
 
 sub expand_tabs {
@@ -105,6 +219,20 @@ sub expand_tabs {
 
        return $res;
 }
+sub copy_spacing {
+       my ($str) = @_;
+
+       my $res = '';
+       for my $c (split(//, $str)) {
+               if ($c eq "\t") {
+                       $res .= $c;
+               } else {
+                       $res .= ' ';
+               }
+       }
+
+       return $res;
+}
 
 sub line_stats {
        my ($line) = @_;
@@ -260,47 +388,138 @@ sub ctx_has_comment {
        return ($cmt ne '');
 }
 
-sub ctx_expr_before {
-       my ($line) = @_;
-
-       ##print "CHECK<$line>\n";
-
-       my $pos = length($line) - 1;
-       my $count = 0;
-       my $c;
+sub cat_vet {
+       my ($vet) = @_;
+       my ($res, $coded);
 
-       for (; $pos >= 0; $pos--) {
-               $c = substr($line, $pos, 1);
-               ##print "CHECK: c<$c> count<$count>\n";
-               if ($c eq ')') {
-                       $count++;
-               } elsif ($c eq '(') {
-                       last if (--$count == 0);
+       $res = '';
+       while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) {
+               $res .= $1;
+               if ($2 ne '') {
+                       $coded = sprintf("^%c", unpack('C', $2) + 64);
+                       $res .= $coded;
                }
        }
+       $res =~ s/$/\$/;
 
-       ##print "CHECK: result<" . substr($line, 0, $pos) . ">\n";
-
-       return substr($line, 0, $pos);
+       return $res;
 }
 
-sub cat_vet {
-       my ($vet) = @_;
-       my ($res, $coded);
+sub annotate_values {
+       my ($stream, $type) = @_;
 
-       $res = '';
-       while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]])/g) {
-               $coded = sprintf("^%c", unpack('C', $2) + 64);
-               $res .= $1 . $coded;
+       my $res;
+       my $cur = $stream;
+
+       my $debug = 0;
+
+       print "$stream\n" if ($debug);
+
+       ##my $type = 'N';
+       my $pos = 0;
+       my $preprocessor = 0;
+       my $paren = 0;
+       my @paren_type;
+
+       # Include any user defined types we may have found as we went.
+       my $type_match = "(?:$Type$Bare)";
+
+       while (length($cur)) {
+               print " <$type> " if ($debug);
+               if ($cur =~ /^(\s+)/o) {
+                       print "WS($1)\n" if ($debug);
+                       if ($1 =~ /\n/ && $preprocessor) {
+                               $preprocessor = 0;
+                               $type = 'N';
+                       }
+
+               } elsif ($cur =~ /^($type_match)/) {
+                       print "DECLARE($1)\n" if ($debug);
+                       $type = 'T';
+
+               } elsif ($cur =~ /^(#\s*define\s*$Ident)(\(?)/o) {
+                       print "DEFINE($1)\n" if ($debug);
+                       $preprocessor = 1;
+                       $paren_type[$paren] = 'N';
+
+               } elsif ($cur =~ /^(#\s*(?:ifdef|ifndef|if|else|endif))/o) {
+                       print "PRE($1)\n" if ($debug);
+                       $preprocessor = 1;
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(\\\n)/o) {
+                       print "PRECONT($1)\n" if ($debug);
+
+               } elsif ($cur =~ /^(sizeof)\s*(\()?/o) {
+                       print "SIZEOF($1)\n" if ($debug);
+                       if (defined $2) {
+                               $paren_type[$paren] = 'V';
+                       }
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(if|while|typeof)\b/o) {
+                       print "COND($1)\n" if ($debug);
+                       $paren_type[$paren] = 'N';
+                       $type = 'N';
+
+               } elsif ($cur =~/^(return|case|else)/o) {
+                       print "KEYWORD($1)\n" if ($debug);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(\()/o) {
+                       print "PAREN('$1')\n" if ($debug);
+                       $paren++;
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(\))/o) {
+                       $paren-- if ($paren > 0);
+                       if (defined $paren_type[$paren]) {
+                               $type = $paren_type[$paren];
+                               undef $paren_type[$paren];
+                               print "PAREN('$1') -> $type\n" if ($debug);
+                       } else {
+                               print "PAREN('$1')\n" if ($debug);
+                       }
+
+               } elsif ($cur =~ /^($Ident)\(/o) {
+                       print "FUNC($1)\n" if ($debug);
+                       $paren_type[$paren] = 'V';
+
+               } elsif ($cur =~ /^($Ident|$Constant)/o) {
+                       print "IDENT($1)\n" if ($debug);
+                       $type = 'V';
+
+               } elsif ($cur =~ /^($Assignment)/o) {
+                       print "ASSIGN($1)\n" if ($debug);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(;|{|}|\?|:|\[)/o) {
+                       print "END($1)\n" if ($debug);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^($Operators)/o) {
+                       print "OP($1)\n" if ($debug);
+                       if ($1 ne '++' && $1 ne '--') {
+                               $type = 'N';
+                       }
+
+               } elsif ($cur =~ /(^.)/o) {
+                       print "C($1)\n" if ($debug);
+               }
+               if (defined $1) {
+                       $cur = substr($cur, length($1));
+                       $res .= $type x length($1);
+               }
        }
-       $res =~ s/$/\$/;
 
        return $res;
 }
 
+my $prefix = '';
+
 my @report = ();
 sub report {
-       push(@report, $_[0]);
+       push(@report, $prefix . $_[0]);
 }
 sub report_dump {
        @report;
@@ -308,14 +527,19 @@ sub report_dump {
 sub ERROR {
        report("ERROR: $_[0]\n");
        our $clean = 0;
+       our $cnt_error++;
 }
 sub WARN {
        report("WARNING: $_[0]\n");
        our $clean = 0;
+       our $cnt_warn++;
 }
 sub CHK {
-       report("CHECK: $_[0]\n");
-       our $clean = 0;
+       if ($check) {
+               report("CHECK: $_[0]\n");
+               our $clean = 0;
+               our $cnt_chk++;
+       }
 }
 
 sub process {
@@ -335,6 +559,11 @@ sub process {
        my $signoff = 0;
        my $is_patch = 0;
 
+       our $cnt_lines = 0;
+       our $cnt_error = 0;
+       our $cnt_warn = 0;
+       our $cnt_chk = 0;
+
        # Trace the real file/line as we go.
        my $realfile = '';
        my $realline = 0;
@@ -343,62 +572,10 @@ sub process {
        my $in_comment = 0;
        my $first_line = 0;
 
-       my $Ident       = qr{[A-Za-z\d_]+};
-       my $Storage     = qr{extern|static|asmlinkage};
-       my $Sparse      = qr{
-                               __user|
-                               __kernel|
-                               __force|
-                               __iomem|
-                               __must_check|
-                               __init_refok|
-                               fastcall
-                       }x;
-       my $Inline      = qr{inline|__always_inline|noinline};
-       my $NonptrType  = qr{
-                               \b
-                               (?:const\s+)?
-                               (?:unsigned\s+)?
-                               (?:
-                                       void|
-                                       char|
-                                       short|
-                                       int|
-                                       long|
-                                       unsigned|
-                                       float|
-                                       double|
-                                       bool|
-                                       long\s+int|
-                                       long\s+long|
-                                       long\s+long\s+int|
-                                       u8|u16|u32|u64|
-                                       s8|s16|s32|s64|
-                                       struct\s+$Ident|
-                                       union\s+$Ident|
-                                       enum\s+$Ident|
-                                       ${Ident}_t
-                               )
-                               (?:\s+$Sparse)*
-                               \b
-                         }x;
-       my $Type        = qr{
-                               \b$NonptrType\b
-                               (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
-                               (?:\s+$Sparse)*
-                         }x;
-       my $Declare     = qr{(?:$Storage\s+)?$Type};
-       my $Attribute   = qr{
-                               const|
-                               __read_mostly|
-                               __(?:mem|cpu|dev|)(?:initdata|init)
-                         }x;
-       my $Member      = qr{->$Ident|\.$Ident|\[[^]]*\]};
-       my $Lval        = qr{$Ident(?:$Member)*};
+       my $prev_values = 'N';
 
        # Possible bare types.
        my @bare = ();
-       my $Bare = $NonptrType;
 
        # Pre-scan the patch looking for any __setup documentation.
        my @setup_docs = ();
@@ -417,11 +594,14 @@ sub process {
                }
        }
 
+       $prefix = '';
+
        foreach my $line (@lines) {
                $linenr++;
 
                my $rawline = $line;
 
+
 #extract the filename as it passes
                if ($line=~/^\+\+\+\s+(\S+)/) {
                        $realfile=$1;
@@ -430,7 +610,7 @@ sub process {
                        next;
                }
 #extract the line range in the file after the patch is applied
-               if ($line=~/^\@\@ -\d+,\d+ \+(\d+)(,(\d+))? \@\@/) {
+               if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
                        $is_patch = 1;
                        $first_line = $linenr + 1;
                        $in_comment = 0;
@@ -440,6 +620,7 @@ sub process {
                        } else {
                                $realcnt=1+1;
                        }
+                       $prev_values = 'N';
                        next;
                }
 
@@ -473,18 +654,24 @@ sub process {
                        # Track the previous line.
                        ($prevline, $stashline) = ($stashline, $line);
                        ($previndent, $stashindent) = ($stashindent, $indent);
+
                } elsif ($realcnt == 1) {
                        $realcnt--;
                }
 
 #make up the handle for any error we report on this line
-               $here = "#$linenr: ";
+               $here = "#$linenr: " if (!$file);
+               $here = "#$realline: " if ($file);
                $here .= "FILE: $realfile:$realline:" if ($realcnt != 0);
 
                my $hereline = "$here\n$line\n";
                my $herecurr = "$here\n$line\n";
                my $hereprev = "$here\n$prevline\n$line\n";
 
+               $prefix = "$filename:$realline: " if ($emacs && $file);
+               $prefix = "$filename:$linenr: " if ($emacs && !$file);
+               $cnt_lines++ if ($realcnt != 0);
+
 #check the patch for a signoff:
                if ($line =~ /^\s*signed-off-by:/i) {
                        # This is a signoff, if ugly, so do not double report.
@@ -502,7 +689,7 @@ sub process {
 # Check for wrappage within a valid hunk of the file
                if ($realcnt != 0 && $line !~ m{^(?:\+|-| |$)}) {
                        ERROR("patch seems to be corrupt (line wrapped?)\n" .
-                               $herecurr);
+                               $herecurr) if (!$emitted_corrupt++);
                }
 
 # UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
@@ -568,8 +755,12 @@ sub process {
                    $line !~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?$Type\b/ &&
                    $line !~ /$Ident:\s*$/ &&
                    $line !~ /^.\s*$Ident\s*\(/ &&
+                    # definitions in global scope can only start with types
                    ($line =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?($Ident)\b/ ||
-                    $line =~ /^.\s*(?:$Storage\s+)?($Ident)\b\s*\**\s*$Ident\s*(?:;|=)/)) {
+                    # declarations always start with types
+                    $line =~ /^.\s*(?:$Storage\s+)?($Ident)\b\s*\**\s*$Ident\s*(?:;|=)/) ||
+                    # any (foo ... *) is a pointer cast, and foo is a type
+                    $line =~ /\(($Ident)(?:\s+$Sparse)*\s*\*+\s*\)/) {
                        my $possible = $1;
                        if ($possible !~ /^(?:$Storage|$Type|DEFINE_\S+)$/ &&
                            $possible ne 'goto' && $possible ne 'return' &&
@@ -579,7 +770,7 @@ sub process {
                                #print "POSSIBLE<$possible>\n";
                                push(@bare, $possible);
                                my $bare = join("|", @bare);
-                               $Bare   = qr{
+                               $Bare   = '|' . qr{
                                                \b(?:$bare)\b
                                                (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
                                                (?:\s+$Sparse)*
@@ -641,6 +832,14 @@ sub process {
                        }
                }
 
+               # Track the 'values' across context and added lines.
+               my $opline = $line; $opline =~ s/^./ /;
+               my $curr_values = annotate_values($opline . "\n", $prev_values);
+               $curr_values = $prev_values . $curr_values;
+               #warn "--> $opline\n";
+               #warn "--> $curr_values ($prev_values)\n";
+               $prev_values = substr($curr_values, -1);
+
 #ignore lines not being added
                if ($line=~/^[^\+]/) {next;}
 
@@ -678,6 +877,7 @@ sub process {
                }
                # Remove C99 comments.
                $line =~ s@//.*@@;
+               $opline =~ s@//.*@@;
 
 #EXPORT_SYMBOL should immediately follow its function closing }.
                if (($line =~ /EXPORT_SYMBOL.*\((.*)\)/) ||
@@ -766,18 +966,13 @@ sub process {
                }
 
 # check for spaces between functions and their parentheses.
-               if ($line =~ /($Ident)\s+\(/ &&
-                   $1 !~ /^(?:if|for|while|switch|return|volatile|__volatile__|__attribute__|format|__extension__|Copyright)$/ &&
-                   $line !~ /$Type\s+\(/ && $line !~ /^.\#\s*define\b/) {
-                       WARN("no space between function name and open parenthesis '('\n" . $herecurr);
+               while ($line =~ /($Ident)\s+\(/g) {
+                       if ($1 !~ /^(?:if|for|while|switch|return|volatile|__volatile__|__attribute__|format|__extension__|Copyright|case)$/ &&
+                           $line !~ /$Type\s+\(/ && $line !~ /^.\#\s*define\b/) {
+                               WARN("no space between function name and open parenthesis '('\n" . $herecurr);
+                       }
                }
 # Check operator spacing.
-               # Note we expand the line with the leading + as the real
-               # line will be displayed with the leading + and the tabs
-               # will therefore also expand that way.
-               my $opline = $line;
-               $opline = expand_tabs($opline);
-               $opline =~ s/^./ /;
                if (!($line=~/\#\s*include/)) {
                        my $ops = qr{
                                <<=|>>=|<=|>=|==|!=|
@@ -787,6 +982,9 @@ sub process {
                        }x;
                        my @elements = split(/($ops|;)/, $opline);
                        my $off = 0;
+
+                       my $blank = copy_spacing($opline);
+
                        for (my $n = 0; $n < $#elements; $n += 2) {
                                $off += length($elements[$n]);
 
@@ -822,62 +1020,24 @@ sub process {
 
                                my $at = "(ctx:$ctx)";
 
-                               my $ptr = (" " x $off) . "^";
+                               my $ptr = substr($blank, 0, $off) . "^";
                                my $hereptr = "$hereline$ptr\n";
 
                                # Classify operators into binary, unary, or
                                # definitions (* only) where they have more
                                # than one mode.
-                               my $unary_ctx = $prevline . $ca;
-                               $unary_ctx =~ s/^./ /;
-                               my $is_unary = 0;
-                               my $Unary = qr{
-                                       (?:
-                                               ^|;|,|$ops|\(|\?|:|
-                                               \(\s*$Type\s*\)|
-                                               $Type|
-                                               return|case|else|
-                                               \{|\}|
-                                               \[|
-                                               ^.\#\s*define\s+$Ident\s*(?:\([^\)]*\))?|
-                                               ^.\#\s*else|
-                                               ^.\#\s*endif|
-                                               ^.\#\s*(?:if|ifndef|ifdef)\b.*
-                                       )\s*(?:|\\)\s*$
-                               }x;
-                               my $UnaryFalse = qr{
-                                       sizeof\s*\(\s*$Type\s*\)\s*$
-                               }x;
-                               my $UnaryDefine = qr{
-                                        (?:$Type|$Bare)\s*|
-                                        (?:$Type|$Bare).*,\s*\**
-                               }x;
-                               if ($op eq '-' || $op eq '&' || $op eq '*') {
-                                       # An operator is binary if the left hand
-                                       # side is a value.  Pick out the known
-                                       # non-values.
-                                       if ($unary_ctx =~ /$Unary$/s &&
-                                           $unary_ctx !~ /$UnaryFalse$/s) {
-                                               $is_unary = 1;
-
-                                       # Special handling for ')' check if this
-                                       # brace represents a conditional, if so
-                                       # we are unary.
-                                       } elsif ($unary_ctx =~ /\)\s*$/) {
-                                               my $before = ctx_expr_before($unary_ctx);
-                                               if ($before =~ /(?:for|if|while)\s*$/) {
-                                                       $is_unary = 1;
-                                               }
-                                       }
-
-                                       # Check for type definition for of '*'.
-                                       if ($op eq '*' && $unary_ctx =~ /$UnaryDefine$/) {
-                                               $is_unary = 2;
-                                       }
+                               my $op_type = substr($curr_values, $off + 1, 1);
+                               my $op_left = substr($curr_values, $off, 1);
+                               my $is_unary;
+                               if ($op_type eq 'T') {
+                                       $is_unary = 2;
+                               } elsif ($op_left eq 'V') {
+                                       $is_unary = 0;
+                               } else {
+                                       $is_unary = 1;
                                }
-
                                #if ($op eq '-' || $op eq '&' || $op eq '*') {
-                               #       print "UNARY: <$is_unary $a:$op:$c> <$ca:$op:$cc> <$unary_ctx>\n";
+                               #       print "UNARY: <$op_left$op_type $is_unary $a:$op:$c> <$ca:$op:$cc> <$unary_ctx>\n";
                                #}
 
                                # ; should have either the end of line or a space or \ after it
@@ -952,7 +1112,7 @@ sub process {
 
 # check for multiple assignments
                if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
-                       WARN("multiple assignments should be avoided\n" . $herecurr);
+                       CHK("multiple assignments should be avoided\n" . $herecurr);
                }
 
 ## # check for multiple declarations, allowing for a function declaration
@@ -1012,7 +1172,7 @@ sub process {
                }
 
 # Check for illegal assignment in if conditional.
-               if ($line=~/\bif\s*\(.*[^<>!=]=[^=].*\)/) {
+               if ($line=~/\bif\s*\(.*[^<>!=]=[^=]/) {
                        #next if ($line=~/\".*\Q$op\E.*\"/ or $line=~/\'\Q$op\E\'/);
                        ERROR("do not use assignment in if condition\n" . $herecurr);
                }
@@ -1038,8 +1198,8 @@ sub process {
 
 #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
                if ($tree && $rawline =~ m{^.\#\s*include\s*\<asm\/(.*)\.h\>}) {
-                       my $checkfile = "include/linux/$1.h";
-                       if (-f $checkfile) {
+                       my $checkfile = "$root/include/linux/$1.h";
+                       if (-f $checkfile && $1 ne 'irq.h') {
                                CHK("Use #include <linux/$1.h> instead of <asm/$1.h>\n" .
                                        $herecurr);
                        }
@@ -1151,7 +1311,8 @@ sub process {
                }
 
 # no volatiles please
-               if ($line =~ /\bvolatile\b/ && $line !~ /\basm\s+volatile\b/) {
+               my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
+               if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
                        WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
                }
 
@@ -1240,6 +1401,11 @@ sub process {
 
        if ($clean == 0 && ($chk_patch || $is_patch)) {
                print report_dump();
+               if ($quiet < 2) {
+                       print "total: $cnt_error errors, $cnt_warn warnings, " .
+                               (($check)? "$cnt_chk checks, " : "") .
+                               "$cnt_lines lines checked\n";
+               }
        }
        if ($clean == 1 && $quiet == 0) {
                print "Your patch has no obvious style problems and is ready for submission.\n"
index 778cb0cfc5d892fa9ae3f001d35d2560779dd15c..48ca5b092768fdde28e1df98b6420e47af0e82b1 100644 (file)
 #include <linux/hugetlb.h>
 #include <linux/mount.h>
 
+#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
+/*
+ * Because of the reduced scope of CAP_SETPCAP when filesystem
+ * capabilities are in effect, it is safe to allow this capability to
+ * be available in the default configuration.
+ */
+# define CAP_INIT_BSET  CAP_FULL_SET
+#else /* ie. ndef CONFIG_SECURITY_FILE_CAPABILITIES */
+# define CAP_INIT_BSET  CAP_INIT_EFF_SET
+#endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */
+
+kernel_cap_t cap_bset = CAP_INIT_BSET;    /* systemwide capability bound */
+EXPORT_SYMBOL(cap_bset);
+
+/* Global security state */
+
+unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */
+EXPORT_SYMBOL(securebits);
+
 int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
 {
        NETLINK_CB(skb).eff_cap = current->cap_effective;
@@ -73,14 +92,44 @@ int cap_capget (struct task_struct *target, kernel_cap_t *effective,
        return 0;
 }
 
+#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
+
+static inline int cap_block_setpcap(struct task_struct *target)
+{
+       /*
+        * No support for remote process capability manipulation with
+        * filesystem capability support.
+        */
+       return (target != current);
+}
+
+static inline int cap_inh_is_capped(void)
+{
+       /*
+        * return 1 if changes to the inheritable set are limited
+        * to the old permitted set.
+        */
+       return !cap_capable(current, CAP_SETPCAP);
+}
+
+#else /* ie., ndef CONFIG_SECURITY_FILE_CAPABILITIES */
+
+static inline int cap_block_setpcap(struct task_struct *t) { return 0; }
+static inline int cap_inh_is_capped(void) { return 1; }
+
+#endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */
+
 int cap_capset_check (struct task_struct *target, kernel_cap_t *effective,
                      kernel_cap_t *inheritable, kernel_cap_t *permitted)
 {
-       /* Derived from kernel/capability.c:sys_capset. */
-       /* verify restrictions on target's new Inheritable set */
-       if (!cap_issubset (*inheritable,
-                          cap_combine (target->cap_inheritable,
-                                       current->cap_permitted))) {
+       if (cap_block_setpcap(target)) {
+               return -EPERM;
+       }
+       if (cap_inh_is_capped()
+           && !cap_issubset(*inheritable,
+                            cap_combine(target->cap_inheritable,
+                                        current->cap_permitted))) {
+               /* incapable of using this inheritable set */
                return -EPERM;
        }
 
index bc43d4c7383e89e5675e3ab1b031aa33fe7d7fc2..6d895ade73de485d9ceab48a28094068550e79b0 100644 (file)
@@ -37,15 +37,13 @@ static int dummy_capget (struct task_struct *target, kernel_cap_t * effective,
                         kernel_cap_t * inheritable, kernel_cap_t * permitted)
 {
        *effective = *inheritable = *permitted = 0;
-       if (!issecure(SECURE_NOROOT)) {
-               if (target->euid == 0) {
-                       *permitted |= (~0 & ~CAP_FS_MASK);
-                       *effective |= (~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_FS_MASK);
-               }
-               if (target->fsuid == 0) {
-                       *permitted |= CAP_FS_MASK;
-                       *effective |= CAP_FS_MASK;
-               }
+       if (target->euid == 0) {
+               *permitted |= (~0 & ~CAP_FS_MASK);
+               *effective |= (~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_FS_MASK);
+       }
+       if (target->fsuid == 0) {
+               *permitted |= CAP_FS_MASK;
+               *effective |= CAP_FS_MASK;
        }
        return 0;
 }
index cb008d9f0a823235265464197b8e2cd311b084e2..36a191e7004e957fb38de4e9c5507f8941a33062 100644 (file)
@@ -448,7 +448,7 @@ int selinux_xfrm_postroute_last(u32 isec_sid, struct sk_buff *skb,
        if (dst) {
                struct dst_entry *dst_test;
 
-               for (dst_test = dst; dst_test != 0;
+               for (dst_test = dst; dst_test != NULL;
                     dst_test = dst_test->child) {
                        struct xfrm_state *x = dst_test->xfrm;
 
index b9eca9f3dd252cd44d29d4aa1215c713347a8d81..3b73ba7d03e85ea96012225d43ff5491d1312e0b 100644 (file)
@@ -209,7 +209,7 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
                void *ptr;
 
                if (!aacirun->substream || !aacirun->start) {
-                       dev_warn(&aaci->dev->dev, "RX interrupt???");
+                       dev_warn(&aaci->dev->dev, "RX interrupt???\n");
                        writel(0, aacirun->base + AACI_IE);
                        return;
                }
@@ -263,7 +263,7 @@ static void aaci_fifo_irq(struct aaci *aaci, int channel, u32 mask)
                void *ptr;
 
                if (!aacirun->substream || !aacirun->start) {
-                       dev_warn(&aaci->dev->dev, "TX interrupt???");
+                       dev_warn(&aaci->dev->dev, "TX interrupt???\n");
                        writel(0, aacirun->base + AACI_IE);
                        return;
                }
index 1200670017bddf5a5a8ba74f3f95c995f6ec73ab..f883c4b676abaed9ca308376b032d8fbdbd37903 100644 (file)
@@ -36,7 +36,6 @@ obj-$(CONFIG_SOUND_MSNDCLAS)  += msnd.o msnd_classic.o
 obj-$(CONFIG_SOUND_MSNDPIN)    += msnd.o msnd_pinnacle.o
 obj-$(CONFIG_SOUND_VWSND)      += vwsnd.o
 obj-$(CONFIG_SOUND_ICH)                += i810_audio.o ac97_codec.o
-obj-$(CONFIG_SOUND_ES1371)     += es1371.o ac97_codec.o
 obj-$(CONFIG_SOUND_AU1550_AC97)        += au1550_ac97.o ac97_codec.o
 obj-$(CONFIG_SOUND_TRIDENT)    += trident.o ac97_codec.o
 obj-$(CONFIG_SOUND_BCM_CS4297A)        += swarm_cs4297a.o
index 4611636b1a81c455cc83b0baac28d21a020c1d84..3c1531652d117086977c8f201afac846fc7d4d48 100644 (file)
@@ -2,12 +2,6 @@
 # Makefile for the DMA sound driver
 #
 
-dmasound_pmac-y                        += dmasound_awacs.o \
-                                  trans_16.o dac3550a.o tas_common.o \
-                                  tas3001c.o tas3001c_tables.o \
-                                  tas3004.o tas3004_tables.o
-
 obj-$(CONFIG_DMASOUND_ATARI)   += dmasound_core.o dmasound_atari.o
-obj-$(CONFIG_DMASOUND_PMAC)    += dmasound_core.o dmasound_pmac.o
 obj-$(CONFIG_DMASOUND_PAULA)   += dmasound_core.o dmasound_paula.o
 obj-$(CONFIG_DMASOUND_Q40)     += dmasound_core.o dmasound_q40.o
diff --git a/sound/oss/dmasound/awacs_defs.h b/sound/oss/dmasound/awacs_defs.h
deleted file mode 100644 (file)
index 2194f46..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*********************************************************/
-/* This file was written by someone, somewhere, sometime */
-/* And is released into the Public Domain                */
-/*********************************************************/
-
-#ifndef _AWACS_DEFS_H_
-#define _AWACS_DEFS_H_
-
-/*******************************/
-/* AWACs Audio Register Layout */
-/*******************************/
-
-struct awacs_regs {
-    unsigned   control;        /* Audio control register */
-    unsigned   pad0[3];
-    unsigned   codec_ctrl;     /* Codec control register */
-    unsigned   pad1[3];
-    unsigned   codec_stat;     /* Codec status register */
-    unsigned   pad2[3];
-    unsigned   clip_count;     /* Clipping count register */
-    unsigned   pad3[3];
-    unsigned   byteswap;       /* Data is little-endian if 1 */
-};
-
-/*******************/
-/* Audio Bit Masks */
-/*******************/
-
-/* Audio Control Reg Bit Masks */
-/* ----- ------- --- --- ----- */
-#define MASK_ISFSEL    (0xf)           /* Input SubFrame Select */
-#define MASK_OSFSEL    (0xf << 4)      /* Output SubFrame Select */
-#define MASK_RATE      (0x7 << 8)      /* Sound Rate */
-#define MASK_CNTLERR   (0x1 << 11)     /* Error */
-#define MASK_PORTCHG   (0x1 << 12)     /* Port Change */
-#define MASK_IEE       (0x1 << 13)     /* Enable Interrupt on Error */
-#define MASK_IEPC      (0x1 << 14)     /* Enable Interrupt on Port Change */
-#define MASK_SSFSEL    (0x3 << 15)     /* Status SubFrame Select */
-
-/* Audio Codec Control Reg Bit Masks */
-/* ----- ----- ------- --- --- ----- */
-#define MASK_NEWECMD   (0x1 << 24)     /* Lock: don't write to reg when 1 */
-#define MASK_EMODESEL  (0x3 << 22)     /* Send info out on which frame? */
-#define MASK_EXMODEADDR        (0x3ff << 12)   /* Extended Mode Address -- 10 bits */
-#define MASK_EXMODEDATA        (0xfff)         /* Extended Mode Data -- 12 bits */
-
-/* Audio Codec Control Address Values / Masks */
-/* ----- ----- ------- ------- ------ - ----- */
-#define MASK_ADDR0     (0x0 << 12)     /* Expanded Data Mode Address 0 */
-#define MASK_ADDR_MUX  MASK_ADDR0      /* Mux Control */
-#define MASK_ADDR_GAIN MASK_ADDR0
-
-#define MASK_ADDR1     (0x1 << 12)     /* Expanded Data Mode Address 1 */
-#define MASK_ADDR_MUTE MASK_ADDR1
-#define MASK_ADDR_RATE MASK_ADDR1
-
-#define MASK_ADDR2     (0x2 << 12)     /* Expanded Data Mode Address 2 */
-#define MASK_ADDR_VOLA MASK_ADDR2      /* Volume Control A -- Headphones */
-#define MASK_ADDR_VOLHD MASK_ADDR2
-
-#define MASK_ADDR4     (0x4 << 12)     /* Expanded Data Mode Address 4 */
-#define MASK_ADDR_VOLC MASK_ADDR4      /* Volume Control C -- Speaker */
-#define MASK_ADDR_VOLSPK MASK_ADDR4
-
-/* additional registers of screamer */
-#define MASK_ADDR5     (0x5 << 12)     /* Expanded Data Mode Address 5 */
-#define MASK_ADDR6     (0x6 << 12)     /* Expanded Data Mode Address 6 */
-#define MASK_ADDR7     (0x7 << 12)     /* Expanded Data Mode Address 7 */
-
-/* Address 0 Bit Masks & Macros */
-/* ------- - --- ----- - ------ */
-#define MASK_GAINRIGHT (0xf)           /* Gain Right Mask */
-#define MASK_GAINLEFT  (0xf << 4)      /* Gain Left Mask */
-#define MASK_GAINLINE  (0x1 << 8)      /* Disable Mic preamp */
-#define MASK_GAINMIC   (0x0 << 8)      /* Enable Mic preamp */
-
-#define MASK_MUX_CD    (0x1 << 9)      /* Select CD in MUX */
-#define MASK_MUX_MIC   (0x1 << 10)     /* Select Mic in MUX */
-#define MASK_MUX_AUDIN (0x1 << 11)     /* Select Audio In in MUX */
-#define MASK_MUX_LINE  MASK_MUX_AUDIN
-
-#define GAINRIGHT(x)   ((x) & MASK_GAINRIGHT)
-#define GAINLEFT(x)    (((x) << 4) & MASK_GAINLEFT)
-
-#define DEF_CD_GAIN 0x00bb
-#define DEF_MIC_GAIN 0x00cc
-
-/* Address 1 Bit Masks */
-/* ------- - --- ----- */
-#define MASK_ADDR1RES1 (0x3)           /* Reserved */
-#define MASK_RECALIBRATE (0x1 << 2)    /* Recalibrate */
-#define MASK_SAMPLERATE        (0x7 << 3)      /* Sample Rate: */
-#define MASK_LOOPTHRU  (0x1 << 6)      /* Loopthrough Enable */
-#define MASK_CMUTE     (0x1 << 7)      /* Output C (Speaker) Mute when 1 */
-#define MASK_SPKMUTE   MASK_CMUTE
-#define MASK_ADDR1RES2 (0x1 << 8)      /* Reserved */
-#define MASK_AMUTE     (0x1 << 9)      /* Output A (Headphone) Mute when 1 */
-#define MASK_HDMUTE    MASK_AMUTE
-#define MASK_PAROUT0   (0x1 << 10)     /* Parallel Output 0 */
-#define MASK_PAROUT1   (0x2 << 10)     /* Parallel Output 1 */
-
-#define MASK_MIC_BOOST  (0x4)           /* screamer mic boost */
-
-#define SAMPLERATE_48000       (0x0 << 3)      /* 48 or 44.1 kHz */
-#define SAMPLERATE_32000       (0x1 << 3)      /* 32 or 29.4 kHz */
-#define SAMPLERATE_24000       (0x2 << 3)      /* 24 or 22.05 kHz */
-#define SAMPLERATE_19200       (0x3 << 3)      /* 19.2 or 17.64 kHz */
-#define SAMPLERATE_16000       (0x4 << 3)      /* 16 or 14.7 kHz */
-#define SAMPLERATE_12000       (0x5 << 3)      /* 12 or 11.025 kHz */
-#define SAMPLERATE_9600                (0x6 << 3)      /* 9.6 or 8.82 kHz */
-#define SAMPLERATE_8000                (0x7 << 3)      /* 8 or 7.35 kHz */
-
-/* Address 2 & 4 Bit Masks & Macros */
-/* ------- - - - --- ----- - ------ */
-#define MASK_OUTVOLRIGHT (0xf)         /* Output Right Volume */
-#define MASK_ADDR2RES1 (0x2 << 4)      /* Reserved */
-#define MASK_ADDR4RES1 MASK_ADDR2RES1
-#define MASK_OUTVOLLEFT        (0xf << 6)      /* Output Left Volume */
-#define MASK_ADDR2RES2 (0x2 << 10)     /* Reserved */
-#define MASK_ADDR4RES2 MASK_ADDR2RES2
-
-#define VOLRIGHT(x)    (((~(x)) & MASK_OUTVOLRIGHT))
-#define VOLLEFT(x)     (((~(x)) << 6) & MASK_OUTVOLLEFT)
-
-/* Audio Codec Status Reg Bit Masks */
-/* ----- ----- ------ --- --- ----- */
-#define MASK_EXTEND    (0x1 << 23)     /* Extend */
-#define MASK_VALID     (0x1 << 22)     /* Valid Data? */
-#define MASK_OFLEFT    (0x1 << 21)     /* Overflow Left */
-#define MASK_OFRIGHT   (0x1 << 20)     /* Overflow Right */
-#define MASK_ERRCODE   (0xf << 16)     /* Error Code */
-#define MASK_REVISION  (0xf << 12)     /* Revision Number */
-#define MASK_MFGID     (0xf << 8)      /* Mfg. ID */
-#define MASK_CODSTATRES        (0xf << 4)      /* bits 4 - 7 reserved */
-#define MASK_INPPORT   (0xf)           /* Input Port */
-#define MASK_HDPCONN   8               /* headphone plugged in */
-
-/* Clipping Count Reg Bit Masks */
-/* -------- ----- --- --- ----- */
-#define MASK_CLIPLEFT  (0xff << 7)     /* Clipping Count, Left Channel */
-#define MASK_CLIPRIGHT (0xff)          /* Clipping Count, Right Channel */
-
-/* DBDMA ChannelStatus Bit Masks */
-/* ----- ------------- --- ----- */
-#define MASK_CSERR     (0x1 << 7)      /* Error */
-#define MASK_EOI       (0x1 << 6)      /* End of Input -- only for Input Channel */
-#define MASK_CSUNUSED  (0x1f << 1)     /* bits 1-5 not used */
-#define MASK_WAIT      (0x1)           /* Wait */
-
-/* Various Rates */
-/* ------- ----- */
-#define RATE_48000     (0x0 << 8)      /* 48 kHz */
-#define RATE_44100     (0x0 << 8)      /* 44.1 kHz */
-#define RATE_32000     (0x1 << 8)      /* 32 kHz */
-#define RATE_29400     (0x1 << 8)      /* 29.4 kHz */
-#define RATE_24000     (0x2 << 8)      /* 24 kHz */
-#define RATE_22050     (0x2 << 8)      /* 22.05 kHz */
-#define RATE_19200     (0x3 << 8)      /* 19.2 kHz */
-#define RATE_17640     (0x3 << 8)      /* 17.64 kHz */
-#define RATE_16000     (0x4 << 8)      /* 16 kHz */
-#define RATE_14700     (0x4 << 8)      /* 14.7 kHz */
-#define RATE_12000     (0x5 << 8)      /* 12 kHz */
-#define RATE_11025     (0x5 << 8)      /* 11.025 kHz */
-#define RATE_9600      (0x6 << 8)      /* 9.6 kHz */
-#define RATE_8820      (0x6 << 8)      /* 8.82 kHz */
-#define RATE_8000      (0x7 << 8)      /* 8 kHz */
-#define RATE_7350      (0x7 << 8)      /* 7.35 kHz */
-
-#define RATE_LOW       1       /* HIGH = 48kHz, etc;  LOW = 44.1kHz, etc. */
-
-/*******************/
-/* Burgundy values */
-/*******************/
-
-#define MASK_ADDR_BURGUNDY_INPSEL21 (0x11 << 12)
-#define MASK_ADDR_BURGUNDY_INPSEL3 (0x12 << 12)
-
-#define MASK_ADDR_BURGUNDY_GAINCH1 (0x13 << 12)
-#define MASK_ADDR_BURGUNDY_GAINCH2 (0x14 << 12)
-#define MASK_ADDR_BURGUNDY_GAINCH3 (0x15 << 12)
-#define MASK_ADDR_BURGUNDY_GAINCH4 (0x16 << 12)
-
-#define MASK_ADDR_BURGUNDY_VOLCH1 (0x20 << 12)
-#define MASK_ADDR_BURGUNDY_VOLCH2 (0x21 << 12)
-#define MASK_ADDR_BURGUNDY_VOLCH3 (0x22 << 12)
-#define MASK_ADDR_BURGUNDY_VOLCH4 (0x23 << 12)
-
-#define MASK_ADDR_BURGUNDY_OUTPUTSELECTS (0x2B << 12)
-#define MASK_ADDR_BURGUNDY_OUTPUTENABLES (0x2F << 12)
-
-#define MASK_ADDR_BURGUNDY_MASTER_VOLUME (0x30 << 12)
-
-#define MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES (0x60 << 12)
-
-#define MASK_ADDR_BURGUNDY_ATTENSPEAKER (0x62 << 12)
-#define MASK_ADDR_BURGUNDY_ATTENLINEOUT (0x63 << 12)
-#define MASK_ADDR_BURGUNDY_ATTENHP (0x64 << 12)
-
-#define MASK_ADDR_BURGUNDY_VOLCD (MASK_ADDR_BURGUNDY_VOLCH1)
-#define MASK_ADDR_BURGUNDY_VOLLINE (MASK_ADDR_BURGUNDY_VOLCH2)
-#define MASK_ADDR_BURGUNDY_VOLMIC (MASK_ADDR_BURGUNDY_VOLCH3)
-#define MASK_ADDR_BURGUNDY_VOLMODEM (MASK_ADDR_BURGUNDY_VOLCH4)
-
-#define MASK_ADDR_BURGUNDY_GAINCD (MASK_ADDR_BURGUNDY_GAINCH1)
-#define MASK_ADDR_BURGUNDY_GAINLINE (MASK_ADDR_BURGUNDY_GAINCH2)
-#define MASK_ADDR_BURGUNDY_GAINMIC (MASK_ADDR_BURGUNDY_GAINCH3)
-#define MASK_ADDR_BURGUNDY_GAINMODEM (MASK_ADDR_BURGUNDY_VOLCH4)
-
-
-/* These are all default values for the burgundy */
-#define DEF_BURGUNDY_INPSEL21 (0xAA)
-#define DEF_BURGUNDY_INPSEL3 (0x0A)
-
-#define DEF_BURGUNDY_GAINCD (0x33)
-#define DEF_BURGUNDY_GAINLINE (0x44)
-#define DEF_BURGUNDY_GAINMIC (0x44)
-#define DEF_BURGUNDY_GAINMODEM (0x06)
-
-/* Remember: lowest volume here is 0x9b */
-#define DEF_BURGUNDY_VOLCD (0xCCCCCCCC)
-#define DEF_BURGUNDY_VOLLINE (0x00000000)
-#define DEF_BURGUNDY_VOLMIC (0x00000000)
-#define DEF_BURGUNDY_VOLMODEM (0xCCCCCCCC)
-
-#define DEF_BURGUNDY_OUTPUTSELECTS (0x010f010f)
-#define DEF_BURGUNDY_OUTPUTENABLES (0x0A)
-
-#define DEF_BURGUNDY_MASTER_VOLUME (0xFFFFFFFF)
-
-#define DEF_BURGUNDY_MORE_OUTPUTENABLES (0x7E)
-
-#define DEF_BURGUNDY_ATTENSPEAKER (0x44)
-#define DEF_BURGUNDY_ATTENLINEOUT (0xCC)
-#define DEF_BURGUNDY_ATTENHP (0xCC)
-
-/*********************/
-/* i2s layout values */
-/*********************/
-
-#define I2S_REG_INT_CTL                        0x00
-#define I2S_REG_SERIAL_FORMAT          0x10
-#define I2S_REG_CODEC_MSG_OUT          0x20
-#define I2S_REG_CODEC_MSG_IN           0x30
-#define I2S_REG_FRAME_COUNT            0x40
-#define I2S_REG_FRAME_MATCH            0x50
-#define I2S_REG_DATAWORD_SIZES         0x60
-#define I2S_REG_PEAKLEVEL_SEL          0x70
-#define I2S_REG_PEAKLEVEL_IN0          0x80
-#define I2S_REG_PEAKLEVEL_IN1          0x90
-
-#endif /* _AWACS_DEFS_H_ */
diff --git a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c
deleted file mode 100644 (file)
index 0f0d03a..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Driver for the i2c/i2s based DAC3550a sound chip used
- * on some Apple iBooks. Also known as "DACA".
- *
- *  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.
- */
-
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-#include <linux/proc_fs.h>
-#include <linux/ioport.h>
-#include <linux/sysctl.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <linux/init.h>
-#include <asm/uaccess.h>
-#include <asm/errno.h>
-#include <asm/io.h>
-
-#include "dmasound.h"
-
-/* FYI: This code was derived from the tas3001c.c Texas/Tumbler mixer
- * control code, as well as info derived from the AppleDACAAudio driver
- * from Darwin CVS (main thing I derived being register numbers and 
- * values, as well as when to make the calls). */
-
-#define I2C_DRIVERID_DACA (0xFDCB)
-
-#define DACA_VERSION   "0.1"
-#define DACA_DATE "20010930"
-
-static int cur_left_vol;
-static int cur_right_vol;
-static struct i2c_client *daca_client;
-
-static int daca_attach_adapter(struct i2c_adapter *adapter);
-static int daca_detect_client(struct i2c_adapter *adapter, int address);
-static int daca_detach_client(struct i2c_client *client);
-
-struct i2c_driver daca_driver = {  
-       .driver = {
-               .name           = "DAC3550A driver  V " DACA_VERSION,
-       },
-       .id                     = I2C_DRIVERID_DACA,
-       .attach_adapter         = daca_attach_adapter,
-       .detach_client          = daca_detach_client,
-};
-
-#define VOL_MAX ((1<<20) - 1)
-
-void daca_get_volume(uint * left_vol, uint  *right_vol)
-{
-       *left_vol = cur_left_vol >> 5;
-       *right_vol = cur_right_vol >> 5;
-}
-
-int daca_set_volume(uint left_vol, uint right_vol)
-{
-       unsigned short voldata;
-  
-       if (!daca_client)
-               return -1;
-
-       /* Derived from experience, not from any specific values */
-       left_vol <<= 5;
-       right_vol <<= 5;
-
-       if (left_vol > VOL_MAX)
-               left_vol = VOL_MAX;
-       if (right_vol > VOL_MAX)
-               right_vol = VOL_MAX;
-
-       voldata = ((left_vol >> 14)  & 0x3f) << 8;
-       voldata |= (right_vol >> 14)  & 0x3f;
-  
-       if (i2c_smbus_write_word_data(daca_client, 2, voldata) < 0) {
-               printk("daca: failed to set volume \n");
-               return -1; 
-       }
-
-       cur_left_vol = left_vol;
-       cur_right_vol = right_vol;
-  
-       return 0;
-}
-
-int daca_leave_sleep(void)
-{
-       if (!daca_client)
-               return -1;
-  
-       /* Do a short sleep, just to make sure I2C bus is awake and paying
-        * attention to us
-        */
-       msleep(20);
-       /* Write the sample rate reg the value it needs */
-       i2c_smbus_write_byte_data(daca_client, 1, 8);
-       daca_set_volume(cur_left_vol >> 5, cur_right_vol >> 5);
-       /* Another short delay, just to make sure the other I2C bus writes
-        * have taken...
-        */
-       msleep(20);
-       /* Write the global config reg - invert right power amp,
-        * DAC on, use 5-volt mode */
-       i2c_smbus_write_byte_data(daca_client, 3, 0x45);
-
-       return 0;
-}
-
-int daca_enter_sleep(void)
-{
-       if (!daca_client)
-               return -1;
-
-       i2c_smbus_write_byte_data(daca_client, 1, 8);
-       daca_set_volume(cur_left_vol >> 5, cur_right_vol >> 5);
-
-       /* Write the global config reg - invert right power amp,
-        * DAC on, enter low-power mode, use 5-volt mode
-        */
-       i2c_smbus_write_byte_data(daca_client, 3, 0x65);
-
-       return 0;
-}
-
-static int daca_attach_adapter(struct i2c_adapter *adapter)
-{
-       if (!strncmp(adapter->name, "mac-io", 6))
-               daca_detect_client(adapter, 0x4d);
-       return 0;
-}
-
-static int daca_init_client(struct i2c_client * new_client)
-{
-       /* 
-        * Probe is not working with the current i2c-keywest
-        * driver. We try to use addr 0x4d on each adapters
-        * instead, by setting the format register.
-        * 
-        * FIXME: I'm sure that can be obtained from the
-        * device-tree. --BenH.
-        */
-  
-       /* Write the global config reg - invert right power amp,
-        * DAC on, use 5-volt mode
-        */
-       if (i2c_smbus_write_byte_data(new_client, 3, 0x45))
-               return -1;
-
-       i2c_smbus_write_byte_data(new_client, 1, 8);
-       daca_client = new_client;
-       daca_set_volume(15000, 15000);
-
-       return 0;
-}
-
-static int daca_detect_client(struct i2c_adapter *adapter, int address)
-{
-       const char *client_name = "DAC 3550A Digital Equalizer";
-       struct i2c_client *new_client;
-       int rc = -ENODEV;
-
-       new_client = kzalloc(sizeof(*new_client), GFP_KERNEL);
-       if (!new_client)
-               return -ENOMEM;
-
-       new_client->addr = address;
-       new_client->adapter = adapter;
-       new_client->driver = &daca_driver;
-       new_client->flags = 0;
-       strcpy(new_client->name, client_name);
-
-       if (daca_init_client(new_client))
-               goto bail;
-
-       /* Tell the i2c layer a new client has arrived */
-       if (i2c_attach_client(new_client))
-               goto bail;
-
-       return 0;
- bail:
-       kfree(new_client);
-       return rc;
-}
-
-
-static int daca_detach_client(struct i2c_client *client)
-{
-       if (client == daca_client)
-               daca_client = NULL;
-
-       i2c_detach_client(client);
-       kfree(client);
-       return 0;
-}
-
-void daca_cleanup(void)
-{
-       i2c_del_driver(&daca_driver);
-}
-
-int daca_init(void)
-{
-       printk("dac3550a driver version %s (%s)\n",DACA_VERSION,DACA_DATE);
-       return i2c_add_driver(&daca_driver);
-}
index 25dd5a318eb452d53ac68d3d4a0ecf82aeadaf1a..d978b009656405d17f9069c64f604cd632a4729f 100644 (file)
@@ -59,7 +59,6 @@ static inline int ioctl_return(int __user *addr, int value)
      */
 
 #undef HAS_8BIT_TABLES
-#undef HAS_RECORD
 
 #if defined(CONFIG_DMASOUND_ATARI) || defined(CONFIG_DMASOUND_ATARI_MODULE) ||\
     defined(CONFIG_DMASOUND_PAULA) || defined(CONFIG_DMASOUND_PAULA_MODULE) ||\
@@ -83,10 +82,6 @@ static inline int ioctl_return(int __user *addr, int value)
 #define DEFAULT_N_BUFFERS 4
 #define DEFAULT_BUFF_SIZE (1<<15)
 
-#if defined(CONFIG_DMASOUND_PMAC) || defined(CONFIG_DMASOUND_PMAC_MODULE)
-#define HAS_RECORD
-#endif
-
     /*
      *  Initialization
      */
@@ -168,9 +163,6 @@ struct sound_settings {
     SETTINGS soft;     /* software settings */
     SETTINGS dsp;      /* /dev/dsp default settings */
     TRANS *trans_write;        /* supported translations */
-#ifdef HAS_RECORD
-    TRANS *trans_read; /* supported translations */
-#endif
     int volume_left;   /* volume (range is machine dependent) */
     int volume_right;
     int bass;          /* tone (range is machine dependent) */
@@ -253,11 +245,6 @@ struct sound_queue {
 extern struct sound_queue dmasound_write_sq;
 #define write_sq       dmasound_write_sq
 
-#ifdef HAS_RECORD
-extern struct sound_queue dmasound_read_sq;
-#define read_sq                dmasound_read_sq
-#endif
-
 extern int dmasound_catchRadius;
 #define catchRadius    dmasound_catchRadius
 
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
deleted file mode 100644 (file)
index 8f63880..0000000
+++ /dev/null
@@ -1,3215 +0,0 @@
-/*
- *  linux/sound/oss/dmasound/dmasound_awacs.c
- *
- *  PowerMac `AWACS' and `Burgundy' DMA Sound Driver
- *  with some limited support for DACA & Tumbler
- *
- *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and
- *  history prior to 2001/01/26.
- *
- *     26/01/2001 ed 0.1 Iain Sandoe
- *             - added version info.
- *             - moved dbdma command buffer allocation to PMacXXXSqSetup()
- *             - fixed up beep dbdma cmd buffers
- *
- *     08/02/2001 [0.2]
- *             - make SNDCTL_DSP_GETFMTS return the correct info for the h/w
- *             - move soft format translations to a separate file
- *             - [0.3] make SNDCTL_DSP_GETCAPS return correct info.
- *             - [0.4] more informative machine name strings.
- *             - [0.5]
- *             - record changes.
- *             - made the default_hard/soft entries.
- *     04/04/2001 [0.6]
- *             - minor correction to bit assignments in awacs_defs.h
- *             - incorporate mixer changes from 2.2.x back-port.
- *             - take out passthru as a rec input (it isn't).
- *              - make Input Gain slider work the 'right way up'.
- *              - try to make the mixer sliders more logical - so now the
- *                input selectors are just two-state (>50% == ON) and the
- *                Input Gain slider handles the rest of the gain issues.
- *              - try to pick slider representations that most closely match
- *                the actual use - e.g. IGain for input gain... 
- *              - first stab at over/under-run detection.
- *             - minor cosmetic changes to IRQ identification.
- *             - fix bug where rates > max would be reported as supported.
- *              - first stab at over/under-run detection.
- *              - make use of i2c for mixer settings conditional on perch
- *                rather than cuda (some machines without perch have cuda).
- *              - fix bug where TX stops when dbdma status comes up "DEAD"
- *               so far only reported on PowerComputing clones ... but.
- *             - put in AWACS/Screamer register write timeouts.
- *             - part way to partitioning the init() stuff
- *             - first pass at 'tumbler' stuff (not support - just an attempt
- *               to allow the driver to load on new G4s).
- *      01/02/2002 [0.7] - BenH
- *             - all sort of minor bits went in since the latest update, I
- *               bumped the version number for that reason
- *
- *      07/26/2002 [0.8] - BenH
- *             - More minor bits since last changelog (I should be more careful
- *               with those)
- *             - Support for snapper & better tumbler integration by Toby Sargeant
- *             - Headphone detect for scremer by Julien Blache
- *             - More tumbler fixed by Andreas Schwab
- *     11/29/2003 [0.8.1] - Renzo Davoli (King Enzo)
- *             - Support for Snapper line in
- *             - snapper input resampling (for rates < 44100)
- *             - software line gain control
- */
-
-/* GENERAL FIXME/TODO: check that the assumptions about what is written to
-   mac-io is valid for DACA & Tumbler.
-
-   This driver is in bad need of a rewrite. The dbdma code has to be split,
-   some proper device-tree parsing code has to be written, etc...
-*/
-
-#include <linux/types.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/soundcard.h>
-#include <linux/adb.h>
-#include <linux/nvram.h>
-#include <linux/tty.h>
-#include <linux/vt_kern.h>
-#include <linux/spinlock.h>
-#include <linux/kmod.h>
-#include <linux/interrupt.h>
-#include <linux/input.h>
-#include <linux/mutex.h>
-#ifdef CONFIG_ADB_CUDA
-#include <linux/cuda.h>
-#endif
-#ifdef CONFIG_ADB_PMU
-#include <linux/pmu.h>
-#endif
-
-#include <asm/uaccess.h>
-#include <asm/prom.h>
-#include <asm/machdep.h>
-#include <asm/io.h>
-#include <asm/dbdma.h>
-#include <asm/pmac_feature.h>
-#include <asm/irq.h>
-#include <asm/nvram.h>
-
-#include "awacs_defs.h"
-#include "dmasound.h"
-#include "tas3001c.h"
-#include "tas3004.h"
-#include "tas_common.h"
-
-#define DMASOUND_AWACS_REVISION        0
-#define DMASOUND_AWACS_EDITION 7
-
-#define AWACS_SNAPPER   110    /* fake revision # for snapper */
-#define AWACS_BURGUNDY 100     /* fake revision # for burgundy */
-#define AWACS_TUMBLER    90    /* fake revision # for tumbler */
-#define AWACS_DACA      80     /* fake revision # for daca (ibook) */
-#define AWACS_AWACS       2     /* holding revision for AWACS */
-#define AWACS_SCREAMER    3     /* holding revision for Screamer */
-/*
- * Interrupt numbers and addresses, & info obtained from the device tree.
- */
-static int awacs_irq, awacs_tx_irq, awacs_rx_irq;
-static volatile struct awacs_regs __iomem *awacs;
-static volatile u32 __iomem *i2s;
-static volatile struct dbdma_regs __iomem *awacs_txdma, *awacs_rxdma;
-static int awacs_rate_index;
-static int awacs_subframe;
-static struct device_node* awacs_node;
-static struct device_node* i2s_node;
-static struct resource awacs_rsrc[3];
-
-static char awacs_name[64];
-static int awacs_revision;
-static int awacs_sleeping;
-static DEFINE_MUTEX(dmasound_mutex);
-
-static int sound_device_id;            /* exists after iMac revA */
-static int hw_can_byteswap = 1 ;       /* most pmac sound h/w can */
-
-/* model info */
-/* To be replaced with better interaction with pmac_feature.c */
-static int is_pbook_3X00;
-static int is_pbook_g3;
-
-/* expansion info */
-static int has_perch;
-static int has_ziva;
-
-/* for earlier powerbooks which need fiddling with mac-io to enable
- * cd etc.
-*/
-static unsigned char __iomem *latch_base;
-static unsigned char __iomem *macio_base;
-
-/*
- * Space for the DBDMA command blocks.
- */
-static void *awacs_tx_cmd_space;
-static volatile struct dbdma_cmd *awacs_tx_cmds;
-static int number_of_tx_cmd_buffers;
-
-static void *awacs_rx_cmd_space;
-static volatile struct dbdma_cmd *awacs_rx_cmds;
-static int number_of_rx_cmd_buffers;
-
-/*
- * Cached values of AWACS registers (we can't read them).
- * Except on the burgundy (and screamer). XXX
- */
-
-int awacs_reg[8];
-int awacs_reg1_save;
-
-/* tracking values for the mixer contents
-*/
-
-static int spk_vol;
-static int line_vol;
-static int passthru_vol;
-
-static int ip_gain;           /* mic preamp settings */
-static int rec_lev = 0x4545 ; /* default CD gain 69 % */
-static int mic_lev;
-static int cd_lev = 0x6363 ; /* 99 % */
-static int line_lev;
-
-static int hdp_connected;
-
-/*
- * Stuff for outputting a beep.  The values range from -327 to +327
- * so we can multiply by an amplitude in the range 0..100 to get a
- * signed short value to put in the output buffer.
- */
-static short beep_wform[256] = {
-       0,      40,     79,     117,    153,    187,    218,    245,
-       269,    288,    304,    316,    323,    327,    327,    324,
-       318,    310,    299,    288,    275,    262,    249,    236,
-       224,    213,    204,    196,    190,    186,    183,    182,
-       182,    183,    186,    189,    192,    196,    200,    203,
-       206,    208,    209,    209,    209,    207,    204,    201,
-       197,    193,    188,    183,    179,    174,    170,    166,
-       163,    161,    160,    159,    159,    160,    161,    162,
-       164,    166,    168,    169,    171,    171,    171,    170,
-       169,    167,    163,    159,    155,    150,    144,    139,
-       133,    128,    122,    117,    113,    110,    107,    105,
-       103,    103,    103,    103,    104,    104,    105,    105,
-       105,    103,    101,    97,     92,     86,     78,     68,
-       58,     45,     32,     18,     3,      -11,    -26,    -41,
-       -55,    -68,    -79,    -88,    -95,    -100,   -102,   -102,
-       -99,    -93,    -85,    -75,    -62,    -48,    -33,    -16,
-       0,      16,     33,     48,     62,     75,     85,     93,
-       99,     102,    102,    100,    95,     88,     79,     68,
-       55,     41,     26,     11,     -3,     -18,    -32,    -45,
-       -58,    -68,    -78,    -86,    -92,    -97,    -101,   -103,
-       -105,   -105,   -105,   -104,   -104,   -103,   -103,   -103,
-       -103,   -105,   -107,   -110,   -113,   -117,   -122,   -128,
-       -133,   -139,   -144,   -150,   -155,   -159,   -163,   -167,
-       -169,   -170,   -171,   -171,   -171,   -169,   -168,   -166,
-       -164,   -162,   -161,   -160,   -159,   -159,   -160,   -161,
-       -163,   -166,   -170,   -174,   -179,   -183,   -188,   -193,
-       -197,   -201,   -204,   -207,   -209,   -209,   -209,   -208,
-       -206,   -203,   -200,   -196,   -192,   -189,   -186,   -183,
-       -182,   -182,   -183,   -186,   -190,   -196,   -204,   -213,
-       -224,   -236,   -249,   -262,   -275,   -288,   -299,   -310,
-       -318,   -324,   -327,   -327,   -323,   -316,   -304,   -288,
-       -269,   -245,   -218,   -187,   -153,   -117,   -79,    -40,
-};
-
-/* beep support */
-#define BEEP_SRATE     22050   /* 22050 Hz sample rate */
-#define BEEP_BUFLEN    512
-#define BEEP_VOLUME    15      /* 0 - 100 */
-
-static int beep_vol = BEEP_VOLUME;
-static int beep_playing;
-static int awacs_beep_state;
-static short *beep_buf;
-static void *beep_dbdma_cmd_space;
-static volatile struct dbdma_cmd *beep_dbdma_cmd;
-
-/* Burgundy functions */
-static void awacs_burgundy_wcw(unsigned addr,unsigned newval);
-static unsigned awacs_burgundy_rcw(unsigned addr);
-static void awacs_burgundy_write_volume(unsigned address, int volume);
-static int awacs_burgundy_read_volume(unsigned address);
-static void awacs_burgundy_write_mvolume(unsigned address, int volume);
-static int awacs_burgundy_read_mvolume(unsigned address);
-
-/* we will allocate a single 'emergency' dbdma cmd block to use if the
-   tx status comes up "DEAD".  This happens on some PowerComputing Pmac
-   clones, either owing to a bug in dbdma or some interaction between
-   IDE and sound.  However, this measure would deal with DEAD status if
-   if appeared elsewhere.
-
-   for the sake of memory efficiency we'll allocate this cmd as part of
-   the beep cmd stuff.
-*/
-
-static volatile struct dbdma_cmd *emergency_dbdma_cmd;
-
-#ifdef CONFIG_PM
-/*
- * Stuff for restoring after a sleep.
- */
-static void awacs_sleep_notify(struct pmu_sleep_notifier *self, int when);
-struct pmu_sleep_notifier awacs_sleep_notifier = {
-       awacs_sleep_notify, SLEEP_LEVEL_SOUND,
-};
-#endif /* CONFIG_PM */
-
-/* for (soft) sample rate translations */
-int expand_bal;                /* Balance factor for expanding (not volume!) */
-int expand_read_bal;   /* Balance factor for expanding reads (not volume!) */
-
-/*** Low level stuff *********************************************************/
-
-static void *PMacAlloc(unsigned int size, gfp_t flags);
-static void PMacFree(void *ptr, unsigned int size);
-static int PMacIrqInit(void);
-#ifdef MODULE
-static void PMacIrqCleanup(void);
-#endif
-static void PMacSilence(void);
-static void PMacInit(void);
-static int PMacSetFormat(int format);
-static int PMacSetVolume(int volume);
-static void PMacPlay(void);
-static void PMacRecord(void);
-static irqreturn_t pmac_awacs_tx_intr(int irq, void *devid);
-static irqreturn_t pmac_awacs_rx_intr(int irq, void *devid);
-static irqreturn_t pmac_awacs_intr(int irq, void *devid);
-static void awacs_write(int val);
-static int awacs_get_volume(int reg, int lshift);
-static int awacs_volume_setter(int volume, int n, int mute, int lshift);
-
-
-/*** Mid level stuff **********************************************************/
-
-static int PMacMixerIoctl(u_int cmd, u_long arg);
-static int PMacWriteSqSetup(void);
-static int PMacReadSqSetup(void);
-static void PMacAbortRead(void);
-
-extern TRANS transAwacsNormal ;
-extern TRANS transAwacsExpand ;
-extern TRANS transAwacsNormalRead ;
-extern TRANS transAwacsExpandRead ;
-
-extern int daca_init(void);
-extern void daca_cleanup(void);
-extern int daca_set_volume(uint left_vol, uint right_vol);
-extern void daca_get_volume(uint * left_vol, uint  *right_vol);
-extern int daca_enter_sleep(void);
-extern int daca_leave_sleep(void);
-
-#define TRY_LOCK()     \
-       if ((rc = mutex_lock_interruptible(&dmasound_mutex)) != 0)      \
-               return rc;
-#define LOCK()         mutex_lock(&dmasound_mutex);
-
-#define UNLOCK()       mutex_unlock(&dmasound_mutex);
-
-/* We use different versions that the ones provided in dmasound.h
- * 
- * FIXME: Use different names ;)
- */
-#undef IOCTL_IN
-#undef IOCTL_OUT
-
-#define IOCTL_IN(arg, ret)     \
-       rc = get_user(ret, (int __user *)(arg)); \
-       if (rc) break;
-#define IOCTL_OUT(arg, ret)    \
-       ioctl_return2((int __user *)(arg), ret)
-
-static inline int ioctl_return2(int __user *addr, int value)
-{
-       return value < 0 ? value : put_user(value, addr);
-}
-
-
-/*** AE - TUMBLER / SNAPPER START ************************************************/
-
-
-int gpio_audio_reset, gpio_audio_reset_pol;
-int gpio_amp_mute, gpio_amp_mute_pol;
-int gpio_headphone_mute, gpio_headphone_mute_pol;
-int gpio_headphone_detect, gpio_headphone_detect_pol;
-int gpio_headphone_irq;
-
-int
-setup_audio_gpio(const char *name, const char* compatible, int *gpio_addr, int* gpio_pol)
-{
-       struct device_node *gpiop;
-       struct device_node *np;
-       const u32* pp;
-       int ret = -ENODEV;
-
-       gpiop = of_find_node_by_name(NULL, "gpio");
-       if (!gpiop)
-               goto done;
-
-       np = of_get_next_child(gpiop, NULL);
-       while(np != 0) {
-               if (name) {
-                       const char *property =
-                               of_get_property(np,"audio-gpio",NULL);
-                       if (property != 0 && strcmp(property,name) == 0)
-                               break;
-               } else if (compatible && of_device_is_compatible(np, compatible))
-                       break;
-               np = of_get_next_child(gpiop, np);
-       }
-       if (!np)
-               goto done;
-       pp = of_get_property(np, "AAPL,address", NULL);
-       if (!pp)
-               goto done;
-       *gpio_addr = (*pp) & 0x0000ffff;
-       pp = of_get_property(np, "audio-gpio-active-state", NULL);
-       if (pp)
-               *gpio_pol = *pp;
-       else
-               *gpio_pol = 1;
-       ret = irq_of_parse_and_map(np, 0);
-done:
-       of_node_put(np);
-       of_node_put(gpiop);
-       return ret;
-}
-
-static inline void
-write_audio_gpio(int gpio_addr, int data)
-{
-       if (!gpio_addr)
-               return;
-       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio_addr, data ? 0x05 : 0x04);
-}
-
-static inline int
-read_audio_gpio(int gpio_addr)
-{
-       if (!gpio_addr)
-               return 0;
-       return ((pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_addr, 0) & 0x02) !=0);
-}
-
-/*
- * Headphone interrupt via GPIO (Tumbler, Snapper, DACA)
- */
-static irqreturn_t
-headphone_intr(int irq, void *devid)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&dmasound.lock, flags);
-       if (read_audio_gpio(gpio_headphone_detect) == gpio_headphone_detect_pol) {
-               printk(KERN_INFO "Audio jack plugged, muting speakers.\n");
-               write_audio_gpio(gpio_headphone_mute, !gpio_headphone_mute_pol);
-               write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
-               tas_output_device_change(sound_device_id,TAS_OUTPUT_HEADPHONES,0);
-       } else {
-               printk(KERN_INFO "Audio jack unplugged, enabling speakers.\n");
-               write_audio_gpio(gpio_amp_mute, !gpio_amp_mute_pol);
-               write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
-               tas_output_device_change(sound_device_id,TAS_OUTPUT_INTERNAL_SPKR,0);
-       }
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-       return IRQ_HANDLED;
-}
-
-
-/* Initialize tumbler */
-
-static int
-tas_dmasound_init(void)
-{
-       setup_audio_gpio(
-               "audio-hw-reset",
-               NULL,
-               &gpio_audio_reset,
-               &gpio_audio_reset_pol);
-       setup_audio_gpio(
-               "amp-mute",
-               NULL,
-               &gpio_amp_mute,
-               &gpio_amp_mute_pol);
-       setup_audio_gpio("headphone-mute",
-               NULL,
-               &gpio_headphone_mute,
-               &gpio_headphone_mute_pol);
-       gpio_headphone_irq = setup_audio_gpio(
-               "headphone-detect",
-               NULL,
-               &gpio_headphone_detect,
-               &gpio_headphone_detect_pol);
-       /* Fix some broken OF entries in desktop machines */
-       if (!gpio_headphone_irq)
-               gpio_headphone_irq = setup_audio_gpio(
-                       NULL,
-                       "keywest-gpio15",
-                       &gpio_headphone_detect,
-                       &gpio_headphone_detect_pol);
-
-       write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-       msleep(100);
-       write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
-       msleep(100);
-       if (gpio_headphone_irq) {
-               if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",NULL) < 0) {
-                       printk(KERN_ERR "tumbler: Can't request headphone interrupt\n");
-                       gpio_headphone_irq = 0;
-               } else {
-                       u8 val;
-                       /* Activate headphone status interrupts */
-                       val = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_headphone_detect, 0);
-                       pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio_headphone_detect, val | 0x80);
-                       /* Trigger it */
-                       headphone_intr(0, NULL);
-               }
-       }
-       if (!gpio_headphone_irq) {
-               /* Some machine enter this case ? */
-               printk(KERN_WARNING "tumbler: Headphone detect IRQ not found, enabling all outputs !\n");
-               write_audio_gpio(gpio_amp_mute, !gpio_amp_mute_pol);
-               write_audio_gpio(gpio_headphone_mute, !gpio_headphone_mute_pol);
-       }
-       return 0;
-}
-
-
-static int
-tas_dmasound_cleanup(void)
-{
-       if (gpio_headphone_irq)
-               free_irq(gpio_headphone_irq, NULL);
-       return 0;
-}
-
-/* We don't support 48k yet */
-static int tas_freqs[1] = { 44100 } ;
-static int tas_freqs_ok[1] = { 1 } ;
-
-/* don't know what to do really - just have to leave it where
- * OF left things
-*/
-
-static int
-tas_set_frame_rate(void)
-{
-       if (i2s) {
-               out_le32(i2s + (I2S_REG_SERIAL_FORMAT >> 2), 0x41190000);
-               out_le32(i2s + (I2S_REG_DATAWORD_SIZES >> 2), 0x02000200);
-       }
-       dmasound.hard.speed = 44100 ;
-       awacs_rate_index = 0 ;
-       return 44100 ;
-}
-
-static int
-tas_mixer_ioctl(u_int cmd, u_long arg)
-{
-       int __user *argp = (int __user *)arg;
-       int data;
-       int rc;
-
-        rc=tas_device_ioctl(cmd, arg);
-        if (rc != -EINVAL) {
-               return rc;
-        }
-
-        if ((cmd & ~0xff) == MIXER_WRITE(0) &&
-            tas_supported_mixers() & (1<<(cmd & 0xff))) {
-               rc = get_user(data, argp);
-                if (rc<0) return rc;
-               tas_set_mixer_level(cmd & 0xff, data);
-               tas_get_mixer_level(cmd & 0xff, &data);
-               return ioctl_return2(argp, data);
-        }
-        if ((cmd & ~0xff) == MIXER_READ(0) &&
-            tas_supported_mixers() & (1<<(cmd & 0xff))) {
-               tas_get_mixer_level(cmd & 0xff, &data);
-               return ioctl_return2(argp, data);
-        }
-
-       switch(cmd) {
-       case SOUND_MIXER_READ_DEVMASK:
-               data = tas_supported_mixers() | SOUND_MASK_SPEAKER;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_STEREODEVS:
-               data = tas_stereo_mixers();
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_CAPS:
-               rc = IOCTL_OUT(arg, 0);
-               break;
-       case SOUND_MIXER_READ_RECMASK:
-               // XXX FIXME: find a way to check what is really available */
-               data = SOUND_MASK_LINE | SOUND_MASK_MIC;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECSRC:
-               if (awacs_reg[0] & MASK_MUX_AUDIN)
-                       data |= SOUND_MASK_LINE;
-               if (awacs_reg[0] & MASK_MUX_MIC)
-                       data |= SOUND_MASK_MIC;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_RECSRC:
-               IOCTL_IN(arg, data);
-               data =0;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_SPEAKER: /* really bell volume */
-               IOCTL_IN(arg, data);
-               beep_vol = data & 0xff;
-               /* fall through */
-       case SOUND_MIXER_READ_SPEAKER:
-               rc = IOCTL_OUT(arg, (beep_vol<<8) | beep_vol);
-               break;
-       case SOUND_MIXER_OUTMASK:
-       case SOUND_MIXER_OUTSRC:
-       default:
-               rc = -EINVAL;
-       }
-
-       return rc;
-}
-
-static void __init
-tas_init_frame_rates(const unsigned int *prop, unsigned int l)
-{
-       int i ;
-       if (prop) {
-               for (i=0; i<1; i++)
-                       tas_freqs_ok[i] = 0;
-               for (l /= sizeof(int); l > 0; --l) {
-                       unsigned int r = *prop++;
-                       /* Apple 'Fixed' format */
-                       if (r >= 0x10000)
-                               r >>= 16;
-                       for (i = 0; i < 1; ++i) {
-                               if (r == tas_freqs[i]) {
-                                       tas_freqs_ok[i] = 1;
-                                       break;
-                               }
-                       }
-               }
-       }
-       /* else we assume that all the rates are available */
-}
-
-
-/*** AE - TUMBLER / SNAPPER END ************************************************/
-
-
-
-/*** Low level stuff *********************************************************/
-
-/*
- * PCI PowerMac, with AWACS, Screamer, Burgundy, DACA or Tumbler and DBDMA.
- */
-static void *PMacAlloc(unsigned int size, gfp_t flags)
-{
-       return kmalloc(size, flags);
-}
-
-static void PMacFree(void *ptr, unsigned int size)
-{
-       kfree(ptr);
-}
-
-static int __init PMacIrqInit(void)
-{
-       if (awacs)
-               if (request_irq(awacs_irq, pmac_awacs_intr, 0, "Built-in Sound misc", NULL))
-                       return 0;
-       if (request_irq(awacs_tx_irq, pmac_awacs_tx_intr, 0, "Built-in Sound out", NULL)
-           || request_irq(awacs_rx_irq, pmac_awacs_rx_intr, 0, "Built-in Sound in", NULL))
-               return 0;
-       return 1;
-}
-
-#ifdef MODULE
-static void PMacIrqCleanup(void)
-{
-       /* turn off input & output dma */
-       DBDMA_DO_STOP(awacs_txdma);
-       DBDMA_DO_STOP(awacs_rxdma);
-
-       if (awacs)
-               /* disable interrupts from awacs interface */
-               out_le32(&awacs->control, in_le32(&awacs->control) & 0xfff);
-       
-       /* Switch off the sound clock */
-       pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, awacs_node, 0, 0);
-       /* Make sure proper bits are set on pismo & tipb */
-       if ((machine_is_compatible("PowerBook3,1") ||
-           machine_is_compatible("PowerBook3,2")) && awacs) {
-               awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
-               awacs_write(MASK_ADDR1 | awacs_reg[1]);
-               msleep(200);
-       }
-       if (awacs)
-               free_irq(awacs_irq, NULL);
-       free_irq(awacs_tx_irq, NULL);
-       free_irq(awacs_rx_irq, NULL);
-       
-       if (awacs)
-               iounmap(awacs);
-       if (i2s)
-               iounmap(i2s);
-       iounmap(awacs_txdma);
-       iounmap(awacs_rxdma);
-
-       release_mem_region(awacs_rsrc[0].start,
-                          awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
-       release_mem_region(awacs_rsrc[1].start,
-                          awacs_rsrc[1].end - awacs_rsrc[1].start + 1);
-       release_mem_region(awacs_rsrc[2].start,
-                          awacs_rsrc[2].end - awacs_rsrc[2].start + 1);
-
-       kfree(awacs_tx_cmd_space);
-       kfree(awacs_rx_cmd_space);
-       kfree(beep_dbdma_cmd_space);
-       kfree(beep_buf);
-#ifdef CONFIG_PM
-       pmu_unregister_sleep_notifier(&awacs_sleep_notifier);
-#endif
-}
-#endif /* MODULE */
-
-static void PMacSilence(void)
-{
-       /* turn off output dma */
-       DBDMA_DO_STOP(awacs_txdma);
-}
-
-/* don't know what to do really - just have to leave it where
- * OF left things
-*/
-
-static int daca_set_frame_rate(void)
-{
-       if (i2s) {
-               out_le32(i2s + (I2S_REG_SERIAL_FORMAT >> 2), 0x41190000);
-               out_le32(i2s + (I2S_REG_DATAWORD_SIZES >> 2), 0x02000200);
-       }
-       dmasound.hard.speed = 44100 ;
-       awacs_rate_index = 0 ;
-       return 44100 ;
-}
-
-static int awacs_freqs[8] = {
-       44100, 29400, 22050, 17640, 14700, 11025, 8820, 7350
-};
-static int awacs_freqs_ok[8] = { 1, 1, 1, 1, 1, 1, 1, 1 };
-
-static int
-awacs_set_frame_rate(int desired, int catch_r)
-{
-       int tolerance, i = 8 ;
-       /*
-        * If we have a sample rate which is within catchRadius percent
-        * of the requested value, we don't have to expand the samples.
-        * Otherwise choose the next higher rate.
-        * N.B.: burgundy awacs only works at 44100 Hz.
-        */
-       do {
-               tolerance = catch_r * awacs_freqs[--i] / 100;
-               if (awacs_freqs_ok[i]
-                   && dmasound.soft.speed <= awacs_freqs[i] + tolerance)
-                       break;
-       } while (i > 0);
-       dmasound.hard.speed = awacs_freqs[i];
-       awacs_rate_index = i;
-
-       out_le32(&awacs->control, MASK_IEPC | (i << 8) | 0x11 );
-       awacs_reg[1] = (awacs_reg[1] & ~MASK_SAMPLERATE) | (i << 3);
-       awacs_write(awacs_reg[1] | MASK_ADDR1);
-       return dmasound.hard.speed;
-}
-
-static int
-burgundy_set_frame_rate(void)
-{
-       awacs_rate_index = 0 ;
-       awacs_reg[1] = (awacs_reg[1] & ~MASK_SAMPLERATE) ;
-       /* XXX disable error interrupt on burgundy for now */
-       out_le32(&awacs->control, MASK_IEPC | 0 | 0x11 | MASK_IEE);
-       return 44100 ;
-}
-
-static int
-set_frame_rate(int desired, int catch_r)
-{
-       switch (awacs_revision) {
-               case AWACS_BURGUNDY:
-                       dmasound.hard.speed = burgundy_set_frame_rate();
-                       break ;
-               case AWACS_TUMBLER:
-               case AWACS_SNAPPER:
-                       dmasound.hard.speed = tas_set_frame_rate();
-                       break ;
-               case AWACS_DACA:
-                       dmasound.hard.speed =
-                         daca_set_frame_rate();
-                       break ;
-               default:
-                       dmasound.hard.speed = awacs_set_frame_rate(desired,
-                                               catch_r);
-                       break ;
-       }
-       return dmasound.hard.speed ;
-}
-
-static void
-awacs_recalibrate(void)
-{
-       /* Sorry for the horrible delays... I hope to get that improved
-        * by making the whole PM process asynchronous in a future version
-        */
-       msleep(750);
-       awacs_reg[1] |= MASK_CMUTE | MASK_AMUTE;
-       awacs_write(awacs_reg[1] | MASK_RECALIBRATE | MASK_ADDR1);
-       msleep(1000);
-       awacs_write(awacs_reg[1] | MASK_ADDR1);
-}
-
-static void PMacInit(void)
-{
-       int tolerance;
-
-       switch (dmasound.soft.format) {
-           case AFMT_S16_LE:
-           case AFMT_U16_LE:
-               if (hw_can_byteswap)
-                       dmasound.hard.format = AFMT_S16_LE;
-               else
-                       dmasound.hard.format = AFMT_S16_BE;
-               break;
-       default:
-               dmasound.hard.format = AFMT_S16_BE;
-               break;
-       }
-       dmasound.hard.stereo = 1;
-       dmasound.hard.size = 16;
-
-       /* set dmasound.hard.speed - on the basis of what we want (soft)
-        * and the tolerance we'll allow.
-       */
-       set_frame_rate(dmasound.soft.speed, catchRadius) ;
-
-       tolerance = (catchRadius * dmasound.hard.speed) / 100;
-       if (dmasound.soft.speed >= dmasound.hard.speed - tolerance) {
-               dmasound.trans_write = &transAwacsNormal;
-               dmasound.trans_read = &transAwacsNormalRead;
-       } else {
-               dmasound.trans_write = &transAwacsExpand;
-               dmasound.trans_read = &transAwacsExpandRead;
-       }
-
-       if (awacs) {
-               if (hw_can_byteswap && (dmasound.hard.format == AFMT_S16_LE))
-                       out_le32(&awacs->byteswap, BS_VAL);
-               else
-                       out_le32(&awacs->byteswap, 0);
-       }
-       
-       expand_bal = -dmasound.soft.speed;
-       expand_read_bal = -dmasound.soft.speed;
-}
-
-static int PMacSetFormat(int format)
-{
-       int size;
-       int req_format = format;
-               
-       switch (format) {
-       case AFMT_QUERY:
-               return dmasound.soft.format;
-       case AFMT_MU_LAW:
-       case AFMT_A_LAW:
-       case AFMT_U8:
-       case AFMT_S8:
-               size = 8;
-               break;
-       case AFMT_S16_LE:
-               if(!hw_can_byteswap)
-                       format = AFMT_S16_BE;
-       case AFMT_S16_BE:
-               size = 16;
-               break;
-       case AFMT_U16_LE:
-               if(!hw_can_byteswap)
-                       format = AFMT_U16_BE;
-       case AFMT_U16_BE:
-               size = 16;
-               break;
-       default: /* :-) */
-               printk(KERN_ERR "dmasound: unknown format 0x%x, using AFMT_U8\n",
-                      format);
-               size = 8;
-               format = AFMT_U8;
-       }
-       
-       if (req_format == format) {
-               dmasound.soft.format = format;
-               dmasound.soft.size = size;
-               if (dmasound.minDev == SND_DEV_DSP) {
-                       dmasound.dsp.format = format;
-                       dmasound.dsp.size = size;
-               }
-       }
-
-       return format;
-}
-
-#define AWACS_VOLUME_TO_MASK(x)        (15 - ((((x) - 1) * 15) / 99))
-#define AWACS_MASK_TO_VOLUME(y)        (100 - ((y) * 99 / 15))
-
-static int awacs_get_volume(int reg, int lshift)
-{
-       int volume;
-
-       volume = AWACS_MASK_TO_VOLUME((reg >> lshift) & 0xf);
-       volume |= AWACS_MASK_TO_VOLUME(reg & 0xf) << 8;
-       return volume;
-}
-
-static int awacs_volume_setter(int volume, int n, int mute, int lshift)
-{
-       int r1, rn;
-
-       if (mute && volume == 0) {
-               r1 = awacs_reg[1] | mute;
-       } else {
-               r1 = awacs_reg[1] & ~mute;
-               rn = awacs_reg[n] & ~(0xf | (0xf << lshift));
-               rn |= ((AWACS_VOLUME_TO_MASK(volume & 0xff) & 0xf) << lshift);
-               rn |= AWACS_VOLUME_TO_MASK((volume >> 8) & 0xff) & 0xf;
-               awacs_reg[n] = rn;
-               awacs_write((n << 12) | rn);
-               volume = awacs_get_volume(rn, lshift);
-       }
-       if (r1 != awacs_reg[1]) {
-               awacs_reg[1] = r1;
-               awacs_write(r1 | MASK_ADDR1);
-       }
-       return volume;
-}
-
-static int PMacSetVolume(int volume)
-{
-       printk(KERN_WARNING "Bogus call to PMacSetVolume !\n");
-       return 0;
-}
-
-static void awacs_setup_for_beep(int speed)
-{
-       out_le32(&awacs->control,
-                (in_le32(&awacs->control) & ~0x1f00)
-                | ((speed > 0 ? speed : awacs_rate_index) << 8));
-
-       if (hw_can_byteswap && (dmasound.hard.format == AFMT_S16_LE) && speed == -1)
-               out_le32(&awacs->byteswap, BS_VAL);
-       else
-               out_le32(&awacs->byteswap, 0);
-}
-
-/* CHECK: how much of this *really* needs IRQs masked? */
-static void __PMacPlay(void)
-{
-       volatile struct dbdma_cmd *cp;
-       int next_frg, count;
-
-       count = 300 ; /* > two cycles at the lowest sample rate */
-
-       /* what we want to send next */
-       next_frg = (write_sq.front + write_sq.active) % write_sq.max_count;
-
-       if (awacs_beep_state) {
-               /* sound takes precedence over beeps */
-               /* stop the dma channel */
-               out_le32(&awacs_txdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
-               while ( (in_le32(&awacs_txdma->status) & RUN) && count--)
-                       udelay(1);
-               if (awacs)
-                       awacs_setup_for_beep(-1);
-               out_le32(&awacs_txdma->cmdptr,
-                        virt_to_bus(&(awacs_tx_cmds[next_frg])));
-
-               beep_playing = 0;
-               awacs_beep_state = 0;
-       }
-       /* this won't allow more than two frags to be in the output queue at
-          once. (or one, if the max frags is 2 - because count can't exceed
-          2 in that case)
-       */
-       while (write_sq.active < 2 && write_sq.active < write_sq.count) {
-               count = (write_sq.count == write_sq.active + 1) ?
-                               write_sq.rear_size:write_sq.block_size ;
-               if (count < write_sq.block_size) {
-                       if (!write_sq.syncing) /* last block not yet filled,*/
-                               break;  /* and we're not syncing or POST-ed */
-                       else {
-                               /* pretend the block is full to force a new
-                                  block to be started on the next write */
-                               write_sq.rear_size = write_sq.block_size ;
-                               write_sq.syncing &= ~2 ; /* clear POST */
-                       }
-               }
-               cp = &awacs_tx_cmds[next_frg];
-               st_le16(&cp->req_count, count);
-               st_le16(&cp->xfer_status, 0);
-               st_le16(&cp->command, OUTPUT_MORE + INTR_ALWAYS);
-               /* put a STOP at the end of the queue - but only if we have
-                  space for it.  This means that, if we under-run and we only
-                  have two fragments, we might re-play sound from an existing
-                  queued frag.  I guess the solution to that is not to set two
-                  frags if you are likely to under-run...
-               */
-               if (write_sq.count < write_sq.max_count) {
-                       if (++next_frg >= write_sq.max_count)
-                               next_frg = 0 ; /* wrap */
-                       /* if we get here then we've underrun so we will stop*/
-                       st_le16(&awacs_tx_cmds[next_frg].command, DBDMA_STOP);
-               }
-               /* set the dbdma controller going, if it is not already */
-               if (write_sq.active == 0)
-                       out_le32(&awacs_txdma->cmdptr, virt_to_bus(cp));
-               (void)in_le32(&awacs_txdma->status);
-               out_le32(&awacs_txdma->control, ((RUN|WAKE) << 16) + (RUN|WAKE));
-               ++write_sq.active;
-       }
-}
-
-static void PMacPlay(void)
-{
-       LOCK();
-       if (!awacs_sleeping) {
-               unsigned long flags;
-
-               spin_lock_irqsave(&dmasound.lock, flags);
-               __PMacPlay();
-               spin_unlock_irqrestore(&dmasound.lock, flags);
-       }
-       UNLOCK();
-}
-
-static void PMacRecord(void)
-{
-       unsigned long flags;
-
-       if (read_sq.active)
-               return;
-
-       spin_lock_irqsave(&dmasound.lock, flags);
-
-       /* This is all we have to do......Just start it up.
-       */
-       out_le32(&awacs_rxdma->control, ((RUN|WAKE) << 16) + (RUN|WAKE));
-       read_sq.active = 1;
-
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-}
-
-/* if the TX status comes up "DEAD" - reported on some Power Computing machines
-   we need to re-start the dbdma - but from a different physical start address
-   and with a different transfer length.  It would get very messy to do this
-   with the normal dbdma_cmd blocks - we would have to re-write the buffer start
-   addresses each time.  So, we will keep a single dbdma_cmd block which can be
-   fiddled with.
-   When DEAD status is first reported the content of the faulted dbdma block is
-   copied into the emergency buffer and we note that the buffer is in use.
-   we then bump the start physical address by the amount that was successfully
-   output before it died.
-   On any subsequent DEAD result we just do the bump-ups (we know that we are
-   already using the emergency dbdma_cmd).
-   CHECK: this just tries to "do it".  It is possible that we should abandon
-   xfers when the number of residual bytes gets below a certain value - I can
-   see that this might cause a loop-forever if too small a transfer causes
-   DEAD status.  However this is a TODO for now - we'll see what gets reported.
-   When we get a successful transfer result with the emergency buffer we just
-   pretend that it completed using the original dmdma_cmd and carry on.  The
-   'next_cmd' field will already point back to the original loop of blocks.
-*/
-
-static irqreturn_t
-pmac_awacs_tx_intr(int irq, void *devid)
-{
-       int i = write_sq.front;
-       int stat;
-       int i_nowrap = write_sq.front;
-       volatile struct dbdma_cmd *cp;
-       /* != 0 when we are dealing with a DEAD xfer */
-       static int emergency_in_use;
-
-       spin_lock(&dmasound.lock);
-       while (write_sq.active > 0) { /* we expect to have done something*/
-               if (emergency_in_use) /* we are dealing with DEAD xfer */
-                       cp = emergency_dbdma_cmd ;
-               else
-                       cp = &awacs_tx_cmds[i];
-               stat = ld_le16(&cp->xfer_status);
-               if (stat & DEAD) {
-                       unsigned short req, res ;
-                       unsigned int phy ;
-#ifdef DEBUG_DMASOUND
-printk("dmasound_pmac: tx-irq: xfer died - patching it up...\n") ;
-#endif
-                       /* to clear DEAD status we must first clear RUN
-                          set it to quiescent to be on the safe side */
-                       (void)in_le32(&awacs_txdma->status);
-                       out_le32(&awacs_txdma->control,
-                               (RUN|PAUSE|FLUSH|WAKE) << 16);
-                       write_sq.died++ ;
-                       if (!emergency_in_use) { /* new problem */
-                               memcpy((void *)emergency_dbdma_cmd, (void *)cp,
-                                       sizeof(struct dbdma_cmd));
-                               emergency_in_use = 1;
-                               cp = emergency_dbdma_cmd;
-                       }
-                       /* now bump the values to reflect the amount
-                          we haven't yet shifted */
-                       req = ld_le16(&cp->req_count);
-                       res = ld_le16(&cp->res_count);
-                       phy = ld_le32(&cp->phy_addr);
-                       phy += (req - res);
-                       st_le16(&cp->req_count, res);
-                       st_le16(&cp->res_count, 0);
-                       st_le16(&cp->xfer_status, 0);
-                       st_le32(&cp->phy_addr, phy);
-                       st_le32(&cp->cmd_dep, virt_to_bus(&awacs_tx_cmds[(i+1)%write_sq.max_count]));
-                       st_le16(&cp->command, OUTPUT_MORE | BR_ALWAYS | INTR_ALWAYS);
-                       
-                       /* point at our patched up command block */
-                       out_le32(&awacs_txdma->cmdptr, virt_to_bus(cp));
-                       /* we must re-start the controller */
-                       (void)in_le32(&awacs_txdma->status);
-                       /* should complete clearing the DEAD status */
-                       out_le32(&awacs_txdma->control,
-                               ((RUN|WAKE) << 16) + (RUN|WAKE));
-                       break; /* this block is still going */
-               }
-               if ((stat & ACTIVE) == 0)
-                       break;  /* this frame is still going */
-               if (emergency_in_use)
-                       emergency_in_use = 0 ; /* done that */
-               --write_sq.count;
-               --write_sq.active;
-               i_nowrap++;
-               if (++i >= write_sq.max_count)
-                       i = 0;
-       }
-
-       /* if we stopped and we were not sync-ing - then we under-ran */
-       if( write_sq.syncing == 0 ){
-               stat = in_le32(&awacs_txdma->status) ;
-               /* we hit the dbdma_stop */
-               if( (stat & ACTIVE) == 0 ) write_sq.xruns++ ;
-       }
-
-       /* if we used some data up then wake the writer to supply some more*/
-       if (i_nowrap != write_sq.front)
-               WAKE_UP(write_sq.action_queue);
-       write_sq.front = i;
-
-       /* but make sure we funnel what we've already got */\
-        if (!awacs_sleeping)
-               __PMacPlay();
-
-       /* make the wake-on-empty conditional on syncing */
-       if (!write_sq.active && (write_sq.syncing & 1))
-               WAKE_UP(write_sq.sync_queue); /* any time we're empty */
-       spin_unlock(&dmasound.lock);
-       return IRQ_HANDLED;
-}
-
-
-static irqreturn_t
-pmac_awacs_rx_intr(int irq, void *devid)
-{
-       int stat ;
-       /* For some reason on my PowerBook G3, I get one interrupt
-        * when the interrupt vector is installed (like something is
-        * pending).  This happens before the dbdma is initialized by
-        * us, so I just check the command pointer and if it is zero,
-        * just blow it off.
-        */
-       if (in_le32(&awacs_rxdma->cmdptr) == 0)
-               return IRQ_HANDLED;
-
-       /* We also want to blow 'em off when shutting down.
-       */
-       if (read_sq.active == 0)
-               return IRQ_HANDLED;
-
-       spin_lock(&dmasound.lock);
-       /* Check multiple buffers in case we were held off from
-        * interrupt processing for a long time.  Geeze, I really hope
-        * this doesn't happen.
-        */
-       while ((stat=awacs_rx_cmds[read_sq.rear].xfer_status)) {
-
-               /* if we got a "DEAD" status then just log it for now.
-                  and try to restart dma.
-                  TODO: figure out how best to fix it up
-               */
-               if (stat & DEAD){
-#ifdef DEBUG_DMASOUND
-printk("dmasound_pmac: rx-irq: DIED - attempting resurection\n");
-#endif
-                       /* to clear DEAD status we must first clear RUN
-                          set it to quiescent to be on the safe side */
-                       (void)in_le32(&awacs_txdma->status);
-                       out_le32(&awacs_txdma->control,
-                               (RUN|PAUSE|FLUSH|WAKE) << 16);
-                       awacs_rx_cmds[read_sq.rear].xfer_status = 0;
-                       awacs_rx_cmds[read_sq.rear].res_count = 0;
-                       read_sq.died++ ;
-                       (void)in_le32(&awacs_txdma->status);
-                       /* re-start the same block */
-                       out_le32(&awacs_rxdma->cmdptr,
-                               virt_to_bus(&awacs_rx_cmds[read_sq.rear]));
-                       /* we must re-start the controller */
-                       (void)in_le32(&awacs_rxdma->status);
-                       /* should complete clearing the DEAD status */
-                       out_le32(&awacs_rxdma->control,
-                               ((RUN|WAKE) << 16) + (RUN|WAKE));
-                       spin_unlock(&dmasound.lock);
-                       return IRQ_HANDLED; /* try this block again */
-               }
-               /* Clear status and move on to next buffer.
-               */
-               awacs_rx_cmds[read_sq.rear].xfer_status = 0;
-               read_sq.rear++;
-
-               /* Wrap the buffer ring.
-               */
-               if (read_sq.rear >= read_sq.max_active)
-                       read_sq.rear = 0;
-
-               /* If we have caught up to the front buffer, bump it.
-                * This will cause weird (but not fatal) results if the
-                * read loop is currently using this buffer.  The user is
-                * behind in this case anyway, so weird things are going
-                * to happen.
-                */
-               if (read_sq.rear == read_sq.front) {
-                       read_sq.front++;
-                       read_sq.xruns++ ; /* we overan */
-                       if (read_sq.front >= read_sq.max_active)
-                               read_sq.front = 0;
-               }
-       }
-
-       WAKE_UP(read_sq.action_queue);
-       spin_unlock(&dmasound.lock);
-       return IRQ_HANDLED;
-}
-
-
-static irqreturn_t
-pmac_awacs_intr(int irq, void *devid)
-{
-       int ctrl;
-       int status;
-       int r1;
-
-       spin_lock(&dmasound.lock);
-       ctrl = in_le32(&awacs->control);
-       status = in_le32(&awacs->codec_stat);
-
-       if (ctrl & MASK_PORTCHG) {
-               /* tested on Screamer, should work on others too */
-               if (awacs_revision == AWACS_SCREAMER) {
-                       if (((status & MASK_HDPCONN) >> 3) && (hdp_connected == 0)) {
-                               hdp_connected = 1;
-                               
-                               r1 = awacs_reg[1] | MASK_SPKMUTE;
-                               awacs_reg[1] = r1;
-                               awacs_write(r1 | MASK_ADDR_MUTE);
-                       } else if (((status & MASK_HDPCONN) >> 3 == 0) && (hdp_connected == 1)) {
-                               hdp_connected = 0;
-                               
-                               r1 = awacs_reg[1] & ~MASK_SPKMUTE;
-                               awacs_reg[1] = r1;
-                               awacs_write(r1 | MASK_ADDR_MUTE);
-                       }
-               }
-       }
-       if (ctrl & MASK_CNTLERR) {
-               int err = (in_le32(&awacs->codec_stat) & MASK_ERRCODE) >> 16;
-               /* CHECK: we just swallow burgundy errors at the moment..*/
-               if (err != 0 && awacs_revision != AWACS_BURGUNDY)
-                       printk(KERN_ERR "dmasound_pmac: error %x\n", err);
-       }
-       /* Writing 1s to the CNTLERR and PORTCHG bits clears them... */
-       out_le32(&awacs->control, ctrl);
-       spin_unlock(&dmasound.lock);
-       return IRQ_HANDLED;
-}
-
-static void
-awacs_write(int val)
-{
-       int count = 300 ;
-       if (awacs_revision >= AWACS_DACA || !awacs)
-               return ;
-
-       while ((in_le32(&awacs->codec_ctrl) & MASK_NEWECMD) && count--)
-               udelay(1) ;     /* timeout is > 2 samples at lowest rate */
-       out_le32(&awacs->codec_ctrl, val | (awacs_subframe << 22));
-       (void)in_le32(&awacs->byteswap);
-}
-
-/* this is called when the beep timer expires... it will be called even
-   if the beep has been overidden by other sound output.
-*/
-static void awacs_nosound(unsigned long xx)
-{
-       unsigned long flags;
-       int count = 600 ; /* > four samples at lowest rate */
-
-       spin_lock_irqsave(&dmasound.lock, flags);
-       if (beep_playing) {
-               st_le16(&beep_dbdma_cmd->command, DBDMA_STOP);
-               out_le32(&awacs_txdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
-               while ((in_le32(&awacs_txdma->status) & RUN) && count--)
-                       udelay(1);
-               if (awacs)
-                       awacs_setup_for_beep(-1);
-               beep_playing = 0;
-       }
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-}
-
-/*
- * We generate the beep with a single dbdma command that loops a buffer
- * forever - without generating interrupts.
- *
- * So, to stop it you have to stop dma output as per awacs_nosound.
- */
-static int awacs_beep_event(struct input_dev *dev, unsigned int type,
-               unsigned int code, int hz)
-{
-       unsigned long flags;
-       int beep_speed = 0;
-       int srate;
-       int period, ncycles, nsamples;
-       int i, j, f;
-       short *p;
-       static int beep_hz_cache;
-       static int beep_nsamples_cache;
-       static int beep_volume_cache;
-
-       if (type != EV_SND)
-               return -1;
-       switch (code) {
-       case SND_BELL:
-               if (hz)
-                       hz = 1000;
-               break;
-       case SND_TONE:
-               break;
-       default:
-               return -1;
-       }
-
-       if (beep_buf == NULL)
-               return -1;
-
-       /* quick-hack fix for DACA, Burgundy & Tumbler */
-
-       if (awacs_revision >= AWACS_DACA){
-               srate = 44100 ;
-       } else {
-               for (i = 0; i < 8 && awacs_freqs[i] >= BEEP_SRATE; ++i)
-                       if (awacs_freqs_ok[i])
-                               beep_speed = i;
-               srate = awacs_freqs[beep_speed];
-       }
-
-       if (hz <= srate / BEEP_BUFLEN || hz > srate / 2) {
-               /* cancel beep currently playing */
-               awacs_nosound(0);
-               return 0;
-       }
-
-       spin_lock_irqsave(&dmasound.lock, flags);
-       if (beep_playing || write_sq.active || beep_buf == NULL) {
-               spin_unlock_irqrestore(&dmasound.lock, flags);
-               return -1;              /* too hard, sorry :-( */
-       }
-       beep_playing = 1;
-       st_le16(&beep_dbdma_cmd->command, OUTPUT_MORE + BR_ALWAYS);
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-
-       if (hz == beep_hz_cache && beep_vol == beep_volume_cache) {
-               nsamples = beep_nsamples_cache;
-       } else {
-               period = srate * 256 / hz;      /* fixed point */
-               ncycles = BEEP_BUFLEN * 256 / period;
-               nsamples = (period * ncycles) >> 8;
-               f = ncycles * 65536 / nsamples;
-               j = 0;
-               p = beep_buf;
-               for (i = 0; i < nsamples; ++i, p += 2) {
-                       p[0] = p[1] = beep_wform[j >> 8] * beep_vol;
-                       j = (j + f) & 0xffff;
-               }
-               beep_hz_cache = hz;
-               beep_volume_cache = beep_vol;
-               beep_nsamples_cache = nsamples;
-       }
-
-       st_le16(&beep_dbdma_cmd->req_count, nsamples*4);
-       st_le16(&beep_dbdma_cmd->xfer_status, 0);
-       st_le32(&beep_dbdma_cmd->cmd_dep, virt_to_bus(beep_dbdma_cmd));
-       st_le32(&beep_dbdma_cmd->phy_addr, virt_to_bus(beep_buf));
-       awacs_beep_state = 1;
-
-       spin_lock_irqsave(&dmasound.lock, flags);
-       if (beep_playing) {     /* i.e. haven't been terminated already */
-               int count = 300 ;
-               out_le32(&awacs_txdma->control, (RUN|WAKE|FLUSH|PAUSE) << 16);
-               while ((in_le32(&awacs_txdma->status) & RUN) && count--)
-                       udelay(1); /* timeout > 2 samples at lowest rate*/
-               if (awacs)
-                       awacs_setup_for_beep(beep_speed);
-               out_le32(&awacs_txdma->cmdptr, virt_to_bus(beep_dbdma_cmd));
-               (void)in_le32(&awacs_txdma->status);
-               out_le32(&awacs_txdma->control, RUN | (RUN << 16));
-       }
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-
-       return 0;
-}
-
-/* used in init and for wake-up */
-
-static void
-load_awacs(void)
-{
-       awacs_write(awacs_reg[0] + MASK_ADDR0);
-       awacs_write(awacs_reg[1] + MASK_ADDR1);
-       awacs_write(awacs_reg[2] + MASK_ADDR2);
-       awacs_write(awacs_reg[4] + MASK_ADDR4);
-
-       if (awacs_revision == AWACS_SCREAMER) {
-               awacs_write(awacs_reg[5] + MASK_ADDR5);
-               msleep(100);
-               awacs_write(awacs_reg[6] + MASK_ADDR6);
-               msleep(2);
-               awacs_write(awacs_reg[1] + MASK_ADDR1);
-               awacs_write(awacs_reg[7] + MASK_ADDR7);
-       }
-       if (awacs) {
-               if (hw_can_byteswap && (dmasound.hard.format == AFMT_S16_LE))
-                       out_le32(&awacs->byteswap, BS_VAL);
-               else
-                       out_le32(&awacs->byteswap, 0);
-       }
-}
-
-#ifdef CONFIG_PM
-/*
- * Save state when going to sleep, restore it afterwards.
- */
-/* FIXME: sort out disabling/re-enabling of read stuff as well */
-static void awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
-{
-       unsigned long flags;
-
-       switch (when) {
-       case PBOOK_SLEEP_NOW:           
-               LOCK();
-               awacs_sleeping = 1;
-               /* Tell the rest of the driver we are now going to sleep */
-               mb();
-               if (awacs_revision == AWACS_SCREAMER ||
-                   awacs_revision == AWACS_AWACS) {
-                       awacs_reg1_save = awacs_reg[1];
-                       awacs_reg[1] |= MASK_AMUTE | MASK_CMUTE;
-                       awacs_write(MASK_ADDR1 | awacs_reg[1]);
-               }
-
-               PMacSilence();
-               /* stop rx - if going - a bit of a daft user... but */
-               out_le32(&awacs_rxdma->control, (RUN|WAKE|FLUSH << 16));
-               /* deny interrupts */
-               if (awacs)
-                       disable_irq(awacs_irq);
-               disable_irq(awacs_tx_irq);
-               disable_irq(awacs_rx_irq);
-               /* Chip specific sleep code */
-               switch (awacs_revision) {
-                       case AWACS_TUMBLER:
-                       case AWACS_SNAPPER:
-                               write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
-                               write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
-                               tas_enter_sleep();
-                               write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-                               break ;
-                       case AWACS_DACA:
-                               daca_enter_sleep();
-                               break ;
-                       case AWACS_BURGUNDY:
-                               break ;
-                       case AWACS_SCREAMER:
-                       case AWACS_AWACS:
-                       default:
-                               out_le32(&awacs->control, 0x11) ;
-                               break ;
-               }
-               /* Disable sound clock */
-               pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, awacs_node, 0, 0);
-               /* According to Darwin, we do that after turning off the sound
-                * chip clock. All this will have to be cleaned up once we properly
-                * parse the OF sound-objects
-                */
-               if ((machine_is_compatible("PowerBook3,1") ||
-                   machine_is_compatible("PowerBook3,2")) && awacs) {
-                       awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
-                       awacs_write(MASK_ADDR1 | awacs_reg[1]);
-                       msleep(200);
-               }
-               break;
-       case PBOOK_WAKE:
-               /* Enable sound clock */
-               pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, awacs_node, 0, 1);
-               if ((machine_is_compatible("PowerBook3,1") ||
-                   machine_is_compatible("PowerBook3,2")) && awacs) {
-                       msleep(100);
-                       awacs_reg[1] &= ~(MASK_PAROUT0 | MASK_PAROUT1);
-                       awacs_write(MASK_ADDR1 | awacs_reg[1]);
-                       msleep(300);
-               } else
-                       msleep(1000);
-               /* restore settings */
-               switch (awacs_revision) {
-                       case AWACS_TUMBLER:
-                       case AWACS_SNAPPER:
-                               write_audio_gpio(gpio_headphone_mute, gpio_headphone_mute_pol);
-                               write_audio_gpio(gpio_amp_mute, gpio_amp_mute_pol);
-                               write_audio_gpio(gpio_audio_reset, gpio_audio_reset_pol);
-                               msleep(100);
-                               write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
-                               msleep(150);
-                               tas_leave_sleep(); /* Stub for now */
-                               headphone_intr(0, NULL);
-                               break;
-                       case AWACS_DACA:
-                               msleep(10); /* Check this !!! */
-                               daca_leave_sleep();
-                               break ;         /* dont know how yet */
-                       case AWACS_BURGUNDY:
-                               break ;
-                       case AWACS_SCREAMER:
-                       case AWACS_AWACS:
-                       default:
-                               load_awacs() ;
-                               break ;
-               }
-               /* Recalibrate chip */
-               if (awacs_revision == AWACS_SCREAMER && awacs)
-                       awacs_recalibrate();
-               /* Make sure dma is stopped */
-               PMacSilence();
-               if (awacs)
-                       enable_irq(awacs_irq);
-               enable_irq(awacs_tx_irq);
-               enable_irq(awacs_rx_irq);
-               if (awacs) {
-                       /* OK, allow ints back again */
-                       out_le32(&awacs->control, MASK_IEPC
-                               | (awacs_rate_index << 8) | 0x11
-                                | (awacs_revision < AWACS_DACA ? MASK_IEE: 0));
-               }
-               if (macio_base && is_pbook_g3) {
-                       /* FIXME: should restore the setup we had...*/
-                       out_8(macio_base + 0x37, 3);
-               } else if (is_pbook_3X00) {
-                       in_8(latch_base + 0x190);
-               }
-               /* Remove mute */
-               if (awacs_revision == AWACS_SCREAMER ||
-                   awacs_revision == AWACS_AWACS) {
-                       awacs_reg[1] = awacs_reg1_save;
-                       awacs_write(MASK_ADDR1 | awacs_reg[1]);
-               }
-               awacs_sleeping = 0;
-               /* Resume pending sounds. */
-               /* we don't try to restart input... */
-               spin_lock_irqsave(&dmasound.lock, flags);
-               __PMacPlay();
-               spin_unlock_irqrestore(&dmasound.lock, flags);
-               UNLOCK();
-       }
-}
-#endif /* CONFIG_PM */
-
-
-/* All the burgundy functions: */
-
-/* Waits for busy flag to clear */
-static inline void
-awacs_burgundy_busy_wait(void)
-{
-       int count = 50; /* > 2 samples at 44k1 */
-       while ((in_le32(&awacs->codec_ctrl) & MASK_NEWECMD) && count--)
-               udelay(1) ;
-}
-
-static inline void
-awacs_burgundy_extend_wait(void)
-{
-       int count = 50 ; /* > 2 samples at 44k1 */
-       while ((!(in_le32(&awacs->codec_stat) & MASK_EXTEND)) && count--)
-               udelay(1) ;
-       count = 50;
-       while ((in_le32(&awacs->codec_stat) & MASK_EXTEND) && count--)
-               udelay(1);
-}
-
-static void
-awacs_burgundy_wcw(unsigned addr, unsigned val)
-{
-       out_le32(&awacs->codec_ctrl, addr + 0x200c00 + (val & 0xff));
-       awacs_burgundy_busy_wait();
-       out_le32(&awacs->codec_ctrl, addr + 0x200d00 +((val>>8) & 0xff));
-       awacs_burgundy_busy_wait();
-       out_le32(&awacs->codec_ctrl, addr + 0x200e00 +((val>>16) & 0xff));
-       awacs_burgundy_busy_wait();
-       out_le32(&awacs->codec_ctrl, addr + 0x200f00 +((val>>24) & 0xff));
-       awacs_burgundy_busy_wait();
-}
-
-static unsigned
-awacs_burgundy_rcw(unsigned addr)
-{
-       unsigned val = 0;
-       unsigned long flags;
-
-       /* should have timeouts here */
-       spin_lock_irqsave(&dmasound.lock, flags);
-
-       out_le32(&awacs->codec_ctrl, addr + 0x100000);
-       awacs_burgundy_busy_wait();
-       awacs_burgundy_extend_wait();
-       val += (in_le32(&awacs->codec_stat) >> 4) & 0xff;
-
-       out_le32(&awacs->codec_ctrl, addr + 0x100100);
-       awacs_burgundy_busy_wait();
-       awacs_burgundy_extend_wait();
-       val += ((in_le32(&awacs->codec_stat)>>4) & 0xff) <<8;
-
-       out_le32(&awacs->codec_ctrl, addr + 0x100200);
-       awacs_burgundy_busy_wait();
-       awacs_burgundy_extend_wait();
-       val += ((in_le32(&awacs->codec_stat)>>4) & 0xff) <<16;
-
-       out_le32(&awacs->codec_ctrl, addr + 0x100300);
-       awacs_burgundy_busy_wait();
-       awacs_burgundy_extend_wait();
-       val += ((in_le32(&awacs->codec_stat)>>4) & 0xff) <<24;
-
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-
-       return val;
-}
-
-
-static void
-awacs_burgundy_wcb(unsigned addr, unsigned val)
-{
-       out_le32(&awacs->codec_ctrl, addr + 0x300000 + (val & 0xff));
-       awacs_burgundy_busy_wait();
-}
-
-static unsigned
-awacs_burgundy_rcb(unsigned addr)
-{
-       unsigned val = 0;
-       unsigned long flags;
-
-       /* should have timeouts here */
-       spin_lock_irqsave(&dmasound.lock, flags);
-
-       out_le32(&awacs->codec_ctrl, addr + 0x100000);
-       awacs_burgundy_busy_wait();
-       awacs_burgundy_extend_wait();
-       val += (in_le32(&awacs->codec_stat) >> 4) & 0xff;
-
-       spin_unlock_irqrestore(&dmasound.lock, flags);
-
-       return val;
-}
-
-static int
-awacs_burgundy_check(void)
-{
-       /* Checks to see the chip is alive and kicking */
-       int error = in_le32(&awacs->codec_ctrl) & MASK_ERRCODE;
-
-       return error == 0xf0000;
-}
-
-static int
-awacs_burgundy_init(void)
-{
-       if (awacs_burgundy_check()) {
-               printk(KERN_WARNING "dmasound_pmac: burgundy not working :-(\n");
-               return 1;
-       }
-
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_OUTPUTENABLES,
-                          DEF_BURGUNDY_OUTPUTENABLES);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,
-                          DEF_BURGUNDY_MORE_OUTPUTENABLES);
-       awacs_burgundy_wcw(MASK_ADDR_BURGUNDY_OUTPUTSELECTS,
-                          DEF_BURGUNDY_OUTPUTSELECTS);
-
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_INPSEL21,
-                          DEF_BURGUNDY_INPSEL21);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_INPSEL3,
-                          DEF_BURGUNDY_INPSEL3);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_GAINCD,
-                          DEF_BURGUNDY_GAINCD);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_GAINLINE,
-                          DEF_BURGUNDY_GAINLINE);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_GAINMIC,
-                          DEF_BURGUNDY_GAINMIC);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_GAINMODEM,
-                          DEF_BURGUNDY_GAINMODEM);
-
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_ATTENSPEAKER,
-                          DEF_BURGUNDY_ATTENSPEAKER);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_ATTENLINEOUT,
-                          DEF_BURGUNDY_ATTENLINEOUT);
-       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_ATTENHP,
-                          DEF_BURGUNDY_ATTENHP);
-
-       awacs_burgundy_wcw(MASK_ADDR_BURGUNDY_MASTER_VOLUME,
-                          DEF_BURGUNDY_MASTER_VOLUME);
-       awacs_burgundy_wcw(MASK_ADDR_BURGUNDY_VOLCD,
-                          DEF_BURGUNDY_VOLCD);
-       awacs_burgundy_wcw(MASK_ADDR_BURGUNDY_VOLLINE,
-                          DEF_BURGUNDY_VOLLINE);
-       awacs_burgundy_wcw(MASK_ADDR_BURGUNDY_VOLMIC,
-                          DEF_BURGUNDY_VOLMIC);
-       return 0;
-}
-
-static void
-awacs_burgundy_write_volume(unsigned address, int volume)
-{
-       int hardvolume,lvolume,rvolume;
-
-       lvolume = (volume & 0xff) ? (volume & 0xff) + 155 : 0;
-       rvolume = ((volume >>8)&0xff) ? ((volume >> 8)&0xff ) + 155 : 0;
-
-       hardvolume = lvolume + (rvolume << 16);
-
-       awacs_burgundy_wcw(address, hardvolume);
-}
-
-static int
-awacs_burgundy_read_volume(unsigned address)
-{
-       int softvolume,wvolume;
-
-       wvolume = awacs_burgundy_rcw(address);
-
-       softvolume = (wvolume & 0xff) - 155;
-       softvolume += (((wvolume >> 16) & 0xff) - 155)<<8;
-
-       return softvolume > 0 ? softvolume : 0;
-}
-
-static int
-awacs_burgundy_read_mvolume(unsigned address)
-{
-       int lvolume,rvolume,wvolume;
-
-       wvolume = awacs_burgundy_rcw(address);
-
-       wvolume &= 0xffff;
-
-       rvolume = (wvolume & 0xff) - 155;
-       lvolume = ((wvolume & 0xff00)>>8) - 155;
-
-       return lvolume + (rvolume << 8);
-}
-
-static void
-awacs_burgundy_write_mvolume(unsigned address, int volume)
-{
-       int lvolume,rvolume,hardvolume;
-
-       lvolume = (volume &0xff) ? (volume & 0xff) + 155 :0;
-       rvolume = ((volume >>8) & 0xff) ? (volume >> 8) + 155 :0;
-
-       hardvolume = lvolume + (rvolume << 8);
-       hardvolume += (hardvolume << 16);
-
-       awacs_burgundy_wcw(address, hardvolume);
-}
-
-/* End burgundy functions */
-
-/* Set up output volumes on machines with the 'perch/whisper' extension card.
- * this has an SGS i2c chip (7433) which is accessed using the cuda.
- *
- * TODO: split this out and make use of the other parts of the SGS chip to
- * do Bass, Treble etc.
- */
-
-static void
-awacs_enable_amp(int spkr_vol)
-{
-#ifdef CONFIG_ADB_CUDA
-       struct adb_request req;
-
-       if (sys_ctrler != SYS_CTRLER_CUDA)
-               return;
-
-       /* turn on headphones */
-       cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
-                    0x8a, 4, 0);
-       while (!req.complete) cuda_poll();
-       cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
-                    0x8a, 6, 0);
-       while (!req.complete) cuda_poll();
-
-       /* turn on speaker */
-       cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
-                    0x8a, 3, (100 - (spkr_vol & 0xff)) * 32 / 100);
-       while (!req.complete) cuda_poll();
-       cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_GET_SET_IIC,
-                    0x8a, 5, (100 - ((spkr_vol >> 8) & 0xff)) * 32 / 100);
-       while (!req.complete) cuda_poll();
-
-       cuda_request(&req, NULL, 5, CUDA_PACKET,
-                    CUDA_GET_SET_IIC, 0x8a, 1, 0x29);
-       while (!req.complete) cuda_poll();
-#endif /* CONFIG_ADB_CUDA */
-}
-
-
-/*** Mid level stuff *********************************************************/
-
-
-/*
- * /dev/mixer abstraction
- */
-
-static void do_line_lev(int data)
-{
-               line_lev = data ;
-               awacs_reg[0] &= ~MASK_MUX_AUDIN;
-               if ((data & 0xff) >= 50)
-                       awacs_reg[0] |= MASK_MUX_AUDIN;
-               awacs_write(MASK_ADDR0 | awacs_reg[0]);
-}
-
-static void do_ip_gain(int data)
-{
-       ip_gain = data ;
-       data &= 0xff;
-       awacs_reg[0] &= ~MASK_GAINLINE;
-       if (awacs_revision == AWACS_SCREAMER) {
-               awacs_reg[6] &= ~MASK_MIC_BOOST ;
-               if (data >= 33) {
-                       awacs_reg[0] |= MASK_GAINLINE;
-                       if( data >= 66)
-                               awacs_reg[6] |= MASK_MIC_BOOST ;
-               }
-               awacs_write(MASK_ADDR6 | awacs_reg[6]) ;
-       } else {
-               if (data >= 50)
-                       awacs_reg[0] |= MASK_GAINLINE;
-       }
-       awacs_write(MASK_ADDR0 | awacs_reg[0]);
-}
-
-static void do_mic_lev(int data)
-{
-       mic_lev = data ;
-       data &= 0xff;
-       awacs_reg[0] &= ~MASK_MUX_MIC;
-       if (data >= 50)
-               awacs_reg[0] |= MASK_MUX_MIC;
-       awacs_write(MASK_ADDR0 | awacs_reg[0]);
-}
-
-static void do_cd_lev(int data)
-{
-       cd_lev = data ;
-       awacs_reg[0] &= ~MASK_MUX_CD;
-       if ((data & 0xff) >= 50)
-               awacs_reg[0] |= MASK_MUX_CD;
-       awacs_write(MASK_ADDR0 | awacs_reg[0]);
-}
-
-static void do_rec_lev(int data)
-{
-       int left, right ;
-       rec_lev = data ;
-       /* need to fudge this to use the volume setter routine */
-       left = 100 - (data & 0xff) ; if( left < 0 ) left = 0 ;
-       right = 100 - ((data >> 8) & 0xff) ; if( right < 0 ) right = 0 ;
-       left |= (right << 8 );
-       left = awacs_volume_setter(left, 0, 0, 4);
-}
-
-static void do_passthru_vol(int data)
-{
-       passthru_vol = data ;
-       awacs_reg[1] &= ~MASK_LOOPTHRU;
-       if (awacs_revision == AWACS_SCREAMER) {
-               if( data ) { /* switch it on for non-zero */
-                       awacs_reg[1] |= MASK_LOOPTHRU;
-                       awacs_write(MASK_ADDR1 | awacs_reg[1]);
-               }
-               data = awacs_volume_setter(data, 5, 0, 6) ;
-       } else {
-               if ((data & 0xff) >= 50)
-                       awacs_reg[1] |= MASK_LOOPTHRU;
-               awacs_write(MASK_ADDR1 | awacs_reg[1]);
-               data = (awacs_reg[1] & MASK_LOOPTHRU)? 100: 0;
-       }
-}
-
-static int awacs_mixer_ioctl(u_int cmd, u_long arg)
-{
-       int data;
-       int rc;
-
-       switch (cmd) {
-       case SOUND_MIXER_READ_CAPS:
-               /* say we will allow multiple inputs?  prob. wrong
-                       so I'm switching it to single */
-               return IOCTL_OUT(arg, 1);
-       case SOUND_MIXER_READ_DEVMASK:
-               data  = SOUND_MASK_VOLUME | SOUND_MASK_SPEAKER
-                       | SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD
-                       | SOUND_MASK_IGAIN | SOUND_MASK_RECLEV
-                       | SOUND_MASK_ALTPCM
-                       | SOUND_MASK_MONITOR;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECMASK:
-               data = SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECSRC:
-               data = 0;
-               if (awacs_reg[0] & MASK_MUX_AUDIN)
-                       data |= SOUND_MASK_LINE;
-               if (awacs_reg[0] & MASK_MUX_MIC)
-                       data |= SOUND_MASK_MIC;
-               if (awacs_reg[0] & MASK_MUX_CD)
-                       data |= SOUND_MASK_CD;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_RECSRC:
-               IOCTL_IN(arg, data);
-               data &= (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD);
-               awacs_reg[0] &= ~(MASK_MUX_CD | MASK_MUX_MIC
-                                 | MASK_MUX_AUDIN);
-               if (data & SOUND_MASK_LINE)
-                       awacs_reg[0] |= MASK_MUX_AUDIN;
-               if (data & SOUND_MASK_MIC)
-                       awacs_reg[0] |= MASK_MUX_MIC;
-               if (data & SOUND_MASK_CD)
-                       awacs_reg[0] |= MASK_MUX_CD;
-               awacs_write(awacs_reg[0] | MASK_ADDR0);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_STEREODEVS:
-               data = SOUND_MASK_VOLUME | SOUND_MASK_SPEAKER| SOUND_MASK_RECLEV  ;
-               if (awacs_revision == AWACS_SCREAMER)
-                       data |= SOUND_MASK_MONITOR ;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_VOLUME:
-               IOCTL_IN(arg, data);
-               line_vol = data ;
-               awacs_volume_setter(data, 2, 0, 6);
-               /* fall through */
-       case SOUND_MIXER_READ_VOLUME:
-               rc = IOCTL_OUT(arg, line_vol);
-               break;
-       case SOUND_MIXER_WRITE_SPEAKER:
-               IOCTL_IN(arg, data);
-               spk_vol = data ;
-               if (has_perch)
-                       awacs_enable_amp(data);
-               else
-                       (void)awacs_volume_setter(data, 4, MASK_CMUTE, 6);
-               /* fall though */
-       case SOUND_MIXER_READ_SPEAKER:
-               rc = IOCTL_OUT(arg, spk_vol);
-               break;
-       case SOUND_MIXER_WRITE_ALTPCM:  /* really bell volume */
-               IOCTL_IN(arg, data);
-               beep_vol = data & 0xff;
-               /* fall through */
-       case SOUND_MIXER_READ_ALTPCM:
-               rc = IOCTL_OUT(arg, beep_vol);
-               break;
-       case SOUND_MIXER_WRITE_LINE:
-               IOCTL_IN(arg, data);
-               do_line_lev(data) ;
-               /* fall through */
-       case SOUND_MIXER_READ_LINE:
-               rc = IOCTL_OUT(arg, line_lev);
-               break;
-       case SOUND_MIXER_WRITE_IGAIN:
-               IOCTL_IN(arg, data);
-               do_ip_gain(data) ;
-               /* fall through */
-       case SOUND_MIXER_READ_IGAIN:
-               rc = IOCTL_OUT(arg, ip_gain);
-               break;
-       case SOUND_MIXER_WRITE_MIC:
-               IOCTL_IN(arg, data);
-               do_mic_lev(data);
-               /* fall through */
-       case SOUND_MIXER_READ_MIC:
-               rc = IOCTL_OUT(arg, mic_lev);
-               break;
-       case SOUND_MIXER_WRITE_CD:
-               IOCTL_IN(arg, data);
-               do_cd_lev(data);
-               /* fall through */
-       case SOUND_MIXER_READ_CD:
-               rc = IOCTL_OUT(arg, cd_lev);
-               break;
-       case SOUND_MIXER_WRITE_RECLEV:
-               IOCTL_IN(arg, data);
-               do_rec_lev(data) ;
-               /* fall through */
-       case SOUND_MIXER_READ_RECLEV:
-               rc = IOCTL_OUT(arg, rec_lev);
-               break;
-       case MIXER_WRITE(SOUND_MIXER_MONITOR):
-               IOCTL_IN(arg, data);
-               do_passthru_vol(data) ;
-               /* fall through */
-       case MIXER_READ(SOUND_MIXER_MONITOR):
-               rc = IOCTL_OUT(arg, passthru_vol);
-               break;
-       default:
-               rc = -EINVAL;
-       }
-       
-       return rc;
-}
-
-static void awacs_mixer_init(void)
-{
-       awacs_volume_setter(line_vol, 2, 0, 6);
-       if (has_perch)
-               awacs_enable_amp(spk_vol);
-       else
-               (void)awacs_volume_setter(spk_vol, 4, MASK_CMUTE, 6);
-       do_line_lev(line_lev) ;
-       do_ip_gain(ip_gain) ;
-       do_mic_lev(mic_lev) ;
-       do_cd_lev(cd_lev) ;
-       do_rec_lev(rec_lev) ;
-       do_passthru_vol(passthru_vol) ;
-}
-
-static int burgundy_mixer_ioctl(u_int cmd, u_long arg)
-{
-       int data;
-       int rc;
-
-       /* We are, we are, we are... Burgundy or better */
-       switch(cmd) {
-       case SOUND_MIXER_READ_DEVMASK:
-               data = SOUND_MASK_VOLUME | SOUND_MASK_CD |
-                       SOUND_MASK_LINE | SOUND_MASK_MIC |
-                       SOUND_MASK_SPEAKER | SOUND_MASK_ALTPCM;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECMASK:
-               data = SOUND_MASK_LINE | SOUND_MASK_MIC
-                       | SOUND_MASK_CD;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECSRC:
-               data = 0;
-               if (awacs_reg[0] & MASK_MUX_AUDIN)
-                       data |= SOUND_MASK_LINE;
-               if (awacs_reg[0] & MASK_MUX_MIC)
-                       data |= SOUND_MASK_MIC;
-               if (awacs_reg[0] & MASK_MUX_CD)
-                       data |= SOUND_MASK_CD;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_RECSRC:
-               IOCTL_IN(arg, data);
-               data &= (SOUND_MASK_LINE
-                        | SOUND_MASK_MIC | SOUND_MASK_CD);
-               awacs_reg[0] &= ~(MASK_MUX_CD | MASK_MUX_MIC
-                                 | MASK_MUX_AUDIN);
-               if (data & SOUND_MASK_LINE)
-                       awacs_reg[0] |= MASK_MUX_AUDIN;
-               if (data & SOUND_MASK_MIC)
-                       awacs_reg[0] |= MASK_MUX_MIC;
-               if (data & SOUND_MASK_CD)
-                       awacs_reg[0] |= MASK_MUX_CD;
-               awacs_write(awacs_reg[0] | MASK_ADDR0);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_STEREODEVS:
-               data = SOUND_MASK_VOLUME | SOUND_MASK_SPEAKER
-                       | SOUND_MASK_RECLEV | SOUND_MASK_CD
-                       | SOUND_MASK_LINE;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_CAPS:
-               rc = IOCTL_OUT(arg, 0);
-               break;
-       case SOUND_MIXER_WRITE_VOLUME:
-               IOCTL_IN(arg, data);
-               awacs_burgundy_write_mvolume(MASK_ADDR_BURGUNDY_MASTER_VOLUME, data);
-                               /* Fall through */
-       case SOUND_MIXER_READ_VOLUME:
-               rc = IOCTL_OUT(arg, awacs_burgundy_read_mvolume(MASK_ADDR_BURGUNDY_MASTER_VOLUME));
-               break;
-       case SOUND_MIXER_WRITE_SPEAKER:
-               IOCTL_IN(arg, data);
-               if (!(data & 0xff)) {
-                       /* Mute the left speaker */
-                       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,
-                                          awacs_burgundy_rcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES) & ~0x2);
-               } else {
-                       /* Unmute the left speaker */
-                       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,
-                                          awacs_burgundy_rcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES) | 0x2);
-               }
-               if (!(data & 0xff00)) {
-                       /* Mute the right speaker */
-                       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,
-                                          awacs_burgundy_rcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES) & ~0x4);
-               } else {
-                       /* Unmute the right speaker */
-                       awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,
-                                          awacs_burgundy_rcb(MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES) | 0x4);
-               }
-
-               data = (((data&0xff)*16)/100 > 0xf ? 0xf :
-                       (((data&0xff)*16)/100)) +
-                       ((((data>>8)*16)/100 > 0xf ? 0xf :
-                         ((((data>>8)*16)/100)))<<4);
-
-               awacs_burgundy_wcb(MASK_ADDR_BURGUNDY_ATTENSPEAKER, ~data);
-                               /* Fall through */
-       case SOUND_MIXER_READ_SPEAKER:
-               data = awacs_burgundy_rcb(MASK_ADDR_BURGUNDY_ATTENSPEAKER);
-               data = (((data & 0xf)*100)/16) + ((((data>>4)*100)/16)<<8);
-               rc = IOCTL_OUT(arg, (~data) & 0x0000ffff);
-               break;
-       case SOUND_MIXER_WRITE_ALTPCM:  /* really bell volume */
-               IOCTL_IN(arg, data);
-               beep_vol = data & 0xff;
-                               /* fall through */
-       case SOUND_MIXER_READ_ALTPCM:
-               rc = IOCTL_OUT(arg, beep_vol);
-               break;
-       case SOUND_MIXER_WRITE_LINE:
-               IOCTL_IN(arg, data);
-               awacs_burgundy_write_volume(MASK_ADDR_BURGUNDY_VOLLINE, data);
-
-                               /* fall through */
-       case SOUND_MIXER_READ_LINE:
-               data = awacs_burgundy_read_volume(MASK_ADDR_BURGUNDY_VOLLINE);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_MIC:
-               IOCTL_IN(arg, data);
-                               /* Mic is mono device */
-               data = (data << 8) + (data << 24);
-               awacs_burgundy_write_volume(MASK_ADDR_BURGUNDY_VOLMIC, data);
-                               /* fall through */
-       case SOUND_MIXER_READ_MIC:
-               data = awacs_burgundy_read_volume(MASK_ADDR_BURGUNDY_VOLMIC);
-               data <<= 24;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_CD:
-               IOCTL_IN(arg, data);
-               awacs_burgundy_write_volume(MASK_ADDR_BURGUNDY_VOLCD, data);
-                               /* fall through */
-       case SOUND_MIXER_READ_CD:
-               data = awacs_burgundy_read_volume(MASK_ADDR_BURGUNDY_VOLCD);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_RECLEV:
-               IOCTL_IN(arg, data);
-               data = awacs_volume_setter(data, 0, 0, 4);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECLEV:
-               data = awacs_get_volume(awacs_reg[0], 4);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_OUTMASK:
-       case SOUND_MIXER_OUTSRC:
-       default:
-               rc = -EINVAL;
-       }
-       
-       return rc;
-}
-
-static int daca_mixer_ioctl(u_int cmd, u_long arg)
-{
-       int data;
-       int rc;
-
-       /* And the DACA's no genius either! */
-
-       switch(cmd) {
-       case SOUND_MIXER_READ_DEVMASK:
-               data = SOUND_MASK_VOLUME;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECMASK:
-               data = 0;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_RECSRC:
-               data = 0;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_WRITE_RECSRC:
-               IOCTL_IN(arg, data);
-               data =0;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_STEREODEVS:
-               data = SOUND_MASK_VOLUME;
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_READ_CAPS:
-               rc = IOCTL_OUT(arg, 0);
-               break;
-       case SOUND_MIXER_WRITE_VOLUME:
-               IOCTL_IN(arg, data);
-               daca_set_volume(data, data);
-               /* Fall through */
-       case SOUND_MIXER_READ_VOLUME:
-               daca_get_volume(& data, &data);
-               rc = IOCTL_OUT(arg, data);
-               break;
-       case SOUND_MIXER_OUTMASK:
-       case SOUND_MIXER_OUTSRC:
-       default:
-               rc = -EINVAL;
-       }
-       return rc;
-}
-
-static int PMacMixerIoctl(u_int cmd, u_long arg)
-{
-       int rc;
-       
-       /* Different IOCTLS for burgundy and, eventually, DACA & Tumbler */
-
-       TRY_LOCK();
-       
-       switch (awacs_revision){
-               case AWACS_BURGUNDY:
-                       rc = burgundy_mixer_ioctl(cmd, arg);
-                       break ;
-               case AWACS_DACA:
-                       rc = daca_mixer_ioctl(cmd, arg);
-                       break;
-               case AWACS_TUMBLER:
-               case AWACS_SNAPPER:
-                       rc = tas_mixer_ioctl(cmd, arg);
-                       break ;
-               default: /* ;-)) */
-                       rc = awacs_mixer_ioctl(cmd, arg);
-       }
-
-       UNLOCK();
-       
-       return rc;
-}
-
-static void PMacMixerInit(void)
-{
-       switch (awacs_revision) {
-               case AWACS_TUMBLER:
-                 printk("AE-Init tumbler mixer\n");
-                 break ;
-               case AWACS_SNAPPER:
-                 printk("AE-Init snapper mixer\n");
-                 break ;
-               case AWACS_DACA:
-               case AWACS_BURGUNDY:
-                       break ; /* don't know yet */
-               case AWACS_AWACS:
-               case AWACS_SCREAMER:
-               default:
-                       awacs_mixer_init() ;
-                       break ;
-       }
-}
-
-/* Write/Read sq setup functions:
-   Check to see if we have enough (or any) dbdma cmd buffers for the
-   user's fragment settings.  If not, allocate some. If this fails we will
-   point at the beep buffer - as an emergency provision - to stop dma tromping
-   on some random bit of memory (if someone lets it go anyway).
-   The command buffers are then set up to point to the fragment buffers
-   (allocated elsewhere).  We need n+1 commands the last of which holds
-   a NOP + loop to start.
-*/
-
-static int PMacWriteSqSetup(void)
-{
-       int i, count = 600 ;
-       volatile struct dbdma_cmd *cp;
-
-       LOCK();
-       
-       /* stop the controller from doing any output - if it isn't already.
-          it _should_ be before this is called anyway */
-
-       out_le32(&awacs_txdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
-       while ((in_le32(&awacs_txdma->status) & RUN) && count--)
-               udelay(1);
-#ifdef DEBUG_DMASOUND
-if (count <= 0)
-       printk("dmasound_pmac: write sq setup: timeout waiting for dma to stop\n");
-#endif
-
-       if ((write_sq.max_count + 1) > number_of_tx_cmd_buffers) {
-               kfree(awacs_tx_cmd_space);
-               number_of_tx_cmd_buffers = 0;
-
-               /* we need nbufs + 1 (for the loop) and we should request + 1
-                  again because the DBDMA_ALIGN might pull the start up by up
-                  to sizeof(struct dbdma_cmd) - 4.
-               */
-
-               awacs_tx_cmd_space = kmalloc
-                       ((write_sq.max_count + 1 + 1) * sizeof(struct dbdma_cmd),
-                        GFP_KERNEL);
-               if (awacs_tx_cmd_space == NULL) {
-                       /* don't leave it dangling - nasty but better than a
-                          random address */
-                       out_le32(&awacs_txdma->cmdptr, virt_to_bus(beep_dbdma_cmd));
-                       printk(KERN_ERR
-                          "dmasound_pmac: can't allocate dbdma cmd buffers"
-                          ", driver disabled\n");
-                       UNLOCK();
-                       return -ENOMEM;
-               }
-               awacs_tx_cmds = (volatile struct dbdma_cmd *)
-                       DBDMA_ALIGN(awacs_tx_cmd_space);
-               number_of_tx_cmd_buffers = write_sq.max_count + 1;
-       }
-
-       cp = awacs_tx_cmds;
-       memset((void *)cp, 0, (write_sq.max_count+1) * sizeof(struct dbdma_cmd));
-       for (i = 0; i < write_sq.max_count; ++i, ++cp) {
-               st_le32(&cp->phy_addr, virt_to_bus(write_sq.buffers[i]));
-       }
-       st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS);
-       st_le32(&cp->cmd_dep, virt_to_bus(awacs_tx_cmds));
-       /* point the controller at the command stack - ready to go */
-       out_le32(&awacs_txdma->cmdptr, virt_to_bus(awacs_tx_cmds));
-       UNLOCK();
-       return 0;
-}
-
-static int PMacReadSqSetup(void)
-{
-       int i, count = 600;
-       volatile struct dbdma_cmd *cp;
-
-       LOCK();
-       
-       /* stop the controller from doing any input - if it isn't already.
-          it _should_ be before this is called anyway */
-       
-       out_le32(&awacs_rxdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
-       while ((in_le32(&awacs_rxdma->status) & RUN) && count--)
-               udelay(1);
-#ifdef DEBUG_DMASOUND
-if (count <= 0)
-       printk("dmasound_pmac: read sq setup: timeout waiting for dma to stop\n");
-#endif
-
-       if ((read_sq.max_count+1) > number_of_rx_cmd_buffers ) {
-               kfree(awacs_rx_cmd_space);
-               number_of_rx_cmd_buffers = 0;
-
-               /* we need nbufs + 1 (for the loop) and we should request + 1 again
-                  because the DBDMA_ALIGN might pull the start up by up to
-                  sizeof(struct dbdma_cmd) - 4 (assuming kmalloc aligns 32 bits).
-               */
-
-               awacs_rx_cmd_space = kmalloc
-                       ((read_sq.max_count + 1 + 1) * sizeof(struct dbdma_cmd),
-                        GFP_KERNEL);
-               if (awacs_rx_cmd_space == NULL) {
-                       /* don't leave it dangling - nasty but better than a
-                          random address */
-                       out_le32(&awacs_rxdma->cmdptr, virt_to_bus(beep_dbdma_cmd));
-                       printk(KERN_ERR
-                          "dmasound_pmac: can't allocate dbdma cmd buffers"
-                          ", driver disabled\n");
-                       UNLOCK();
-                       return -ENOMEM;
-               }
-               awacs_rx_cmds = (volatile struct dbdma_cmd *)
-                       DBDMA_ALIGN(awacs_rx_cmd_space);
-               number_of_rx_cmd_buffers = read_sq.max_count + 1 ;
-       }
-       cp = awacs_rx_cmds;
-       memset((void *)cp, 0, (read_sq.max_count+1) * sizeof(struct dbdma_cmd));
-
-       /* Set dma buffers up in a loop */
-       for (i = 0; i < read_sq.max_count; i++,cp++) {
-               st_le32(&cp->phy_addr, virt_to_bus(read_sq.buffers[i]));
-               st_le16(&cp->command, INPUT_MORE + INTR_ALWAYS);
-               st_le16(&cp->req_count, read_sq.block_size);
-               st_le16(&cp->xfer_status, 0);
-       }
-
-       /* The next two lines make the thing loop around.
-       */
-       st_le16(&cp->command, DBDMA_NOP + BR_ALWAYS);
-       st_le32(&cp->cmd_dep, virt_to_bus(awacs_rx_cmds));
-       /* point the controller at the command stack - ready to go */
-       out_le32(&awacs_rxdma->cmdptr, virt_to_bus(awacs_rx_cmds));
-
-       UNLOCK();
-       return 0;
-}
-
-/* TODO: this needs work to guarantee that when it returns DMA has stopped
-   but in a more elegant way than is done here....
-*/
-
-static void PMacAbortRead(void)
-{
-       int i;
-       volatile struct dbdma_cmd *cp;
-
-       LOCK();
-       /* give it a chance to update the output and provide the IRQ
-          that is expected.
-       */
-
-       out_le32(&awacs_rxdma->control, ((FLUSH) << 16) + FLUSH );
-
-       cp = awacs_rx_cmds;
-       for (i = 0; i < read_sq.max_count; i++,cp++)
-               st_le16(&cp->command, DBDMA_STOP);
-       /*
-        * We should probably wait for the thing to stop before we
-        * release the memory.
-        */
-
-       msleep(100) ; /* give it a (small) chance to act */
-
-       /* apply the sledgehammer approach - just stop it now */
-
-       out_le32(&awacs_rxdma->control, (RUN|PAUSE|FLUSH|WAKE) << 16);
-       UNLOCK();
-}
-
-extern char *get_afmt_string(int);
-static int PMacStateInfo(char *b, size_t sp)
-{
-       int i, len = 0;
-       len = sprintf(b,"HW rates: ");
-       switch (awacs_revision){
-               case AWACS_DACA:
-               case AWACS_BURGUNDY:
-                       len += sprintf(b,"44100 ") ;
-                       break ;
-               case AWACS_TUMBLER:
-               case AWACS_SNAPPER:
-                       for (i=0; i<1; i++){
-                               if (tas_freqs_ok[i])
-                                       len += sprintf(b+len,"%d ", tas_freqs[i]) ;
-                       }
-                       break ;
-               case AWACS_AWACS:
-               case AWACS_SCREAMER:
-               default:
-                       for (i=0; i<8; i++){
-                               if (awacs_freqs_ok[i])
-                                       len += sprintf(b+len,"%d ", awacs_freqs[i]) ;
-                       }
-                       break ;
-       }
-       len += sprintf(b+len,"s/sec\n") ;
-       if (len < sp) {
-               len += sprintf(b+len,"HW AFMTS: ");
-               i = AFMT_U16_BE ;
-               while (i) {
-                       if (i & dmasound.mach.hardware_afmts)
-                               len += sprintf(b+len,"%s ",
-                                       get_afmt_string(i & dmasound.mach.hardware_afmts));
-                       i >>= 1 ;
-               }
-               len += sprintf(b+len,"\n") ;
-       }
-       return len ;
-}
-
-/*** Machine definitions *****************************************************/
-
-static SETTINGS def_hard = {
-       .format = AFMT_S16_BE,
-       .stereo = 1,
-       .size   = 16,
-       .speed  = 44100
-} ;
-
-static SETTINGS def_soft = {
-       .format = AFMT_S16_BE,
-       .stereo = 1,
-       .size   = 16,
-       .speed  = 44100
-} ;
-
-static MACHINE machPMac = {
-       .name           = awacs_name,
-       .name2          = "PowerMac Built-in Sound",
-       .owner          = THIS_MODULE,
-       .dma_alloc      = PMacAlloc,
-       .dma_free       = PMacFree,
-       .irqinit        = PMacIrqInit,
-#ifdef MODULE
-       .irqcleanup     = PMacIrqCleanup,
-#endif /* MODULE */
-       .init           = PMacInit,
-       .silence        = PMacSilence,
-       .setFormat      = PMacSetFormat,
-       .setVolume      = PMacSetVolume,
-       .play           = PMacPlay,
-       .record         = NULL,         /* default to no record */
-       .mixer_init     = PMacMixerInit,
-       .mixer_ioctl    = PMacMixerIoctl,
-       .write_sq_setup = PMacWriteSqSetup,
-       .read_sq_setup  = PMacReadSqSetup,
-       .state_info     = PMacStateInfo,
-       .abort_read     = PMacAbortRead,
-       .min_dsp_speed  = 7350,
-       .max_dsp_speed  = 44100,
-       .version        = ((DMASOUND_AWACS_REVISION<<8) + DMASOUND_AWACS_EDITION)
-};
-
-
-/*** Config & Setup **********************************************************/
-
-/* Check for pmac models that we care about in terms of special actions.
-*/
-
-void __init
-set_model(void)
-{
-       /* portables/lap-tops */
-
-       if (machine_is_compatible("AAPL,3400/2400") ||
-           machine_is_compatible("AAPL,3500")) {
-               is_pbook_3X00 = 1 ;
-       }
-       if (machine_is_compatible("PowerBook1,1")  || /* lombard */
-           machine_is_compatible("AAPL,PowerBook1998")){ /* wallstreet */
-               is_pbook_g3 = 1 ;
-               return ;
-       }
-}
-
-/* Get the OF node that tells us about the registers, interrupts etc. to use
-   for sound IO.
-
-   On most machines the sound IO OF node is the 'davbus' node.  On newer pmacs
-   with DACA (& Tumbler) the node to use is i2s-a.  On much older machines i.e.
-   before 9500 there is no davbus node and we have to use the 'awacs' property.
-
-  In the latter case we signal this by setting the codec value - so that the
-  code that looks for chip properties knows how to go about it.
-*/
-
-static struct device_node* __init
-get_snd_io_node(void)
-{
-       struct device_node *np;
-
-       /* set up awacs_node for early OF which doesn't have a full set of
-        * properties on davbus
-        */
-       awacs_node = of_find_node_by_name(NULL, "awacs");
-       if (awacs_node)
-               awacs_revision = AWACS_AWACS;
-
-       /* powermac models after 9500 (other than those which use DACA or
-        * Tumbler) have a node called "davbus".
-        */
-       np = of_find_node_by_name(NULL, "davbus");
-       /*
-        * if we didn't find a davbus device, try 'i2s-a' since
-        * this seems to be what iBooks (& Tumbler) have.
-        */
-       if (np == NULL) {
-               i2s_node = of_find_node_by_name(NULL, "i2s-a");
-               np = of_node_get(i2s_node);
-       }
-
-       /* if we didn't find this - perhaps we are on an early model
-        * which _only_ has an 'awacs' node
-       */
-       if (np == NULL && awacs_node)
-               np = of_node_get(awacs_node);
-
-       /* if we failed all these return null - this will cause the
-        * driver to give up...
-       */
-       return np ;
-}
-
-/* Get the OF node that contains the info about the sound chip, inputs s-rates
-   etc.
-   This node does not exist (or contains much reduced info) on earlier machines
-   we have to deduce the info other ways for these.
-*/
-
-static struct device_node* __init
-get_snd_info_node(struct device_node *io)
-{
-       struct device_node *info;
-
-       for_each_node_by_name(info, "sound")
-               if (info->parent == io)
-                       break;
-       return info;
-}
-
-/* Find out what type of codec we have.
-*/
-
-static int __init
-get_codec_type(struct device_node *info)
-{
-       /* already set if pre-davbus model and info will be NULL */
-       int codec = awacs_revision ;
-
-       if (info) {
-               /* must do awacs first to allow screamer to overide it */
-               if (of_device_is_compatible(info, "awacs"))
-                       codec = AWACS_AWACS ;
-               if (of_device_is_compatible(info, "screamer"))
-                       codec = AWACS_SCREAMER;
-               if (of_device_is_compatible(info, "burgundy"))
-                       codec = AWACS_BURGUNDY ;
-               if (of_device_is_compatible(info, "daca"))
-                       codec = AWACS_DACA;
-               if (of_device_is_compatible(info, "tumbler"))
-                       codec = AWACS_TUMBLER;
-               if (of_device_is_compatible(info, "snapper"))
-                       codec = AWACS_SNAPPER;
-       }
-       return codec ;
-}
-
-/* find out what type, if any, of expansion card we have
-*/
-static void __init
-get_expansion_type(void)
-{
-       struct device_node *dn;
-
-       dn = of_find_node_by_name(NULL, "perch");
-       if (dn != NULL)
-               has_perch = 1;
-       of_node_put(dn);
-
-       dn = of_find_node_by_name(NULL, "pb-ziva-pc");
-       if (dn != NULL)
-               has_ziva = 1;
-       of_node_put(dn);
-       /* need to work out how we deal with iMac SRS module */
-}
-
-/* set up frame rates.
- * I suspect that these routines don't quite go about it the right way:
- * - where there is more than one rate - I think that the first property
- * value is the number of rates.
- * TODO: check some more device trees and modify accordingly
- *       Set dmasound.mach.max_dsp_rate on the basis of these routines.
-*/
-
-static void __init
-awacs_init_frame_rates(const unsigned int *prop, unsigned int l)
-{
-       int i ;
-       if (prop) {
-               for (i=0; i<8; i++)
-                       awacs_freqs_ok[i] = 0 ;
-               for (l /= sizeof(int); l > 0; --l) {
-                       unsigned int r = *prop++;
-                       /* Apple 'Fixed' format */
-                       if (r >= 0x10000)
-                               r >>= 16;
-                       for (i = 0; i < 8; ++i) {
-                               if (r == awacs_freqs[i]) {
-                                       awacs_freqs_ok[i] = 1;
-                                       break;
-                               }
-                       }
-               }
-       }
-       /* else we assume that all the rates are available */
-}
-
-static void __init
-burgundy_init_frame_rates(const unsigned int *prop, unsigned int l)
-{
-       int temp[9] ;
-       int i = 0 ;
-       if (prop) {
-               for (l /= sizeof(int); l > 0; --l) {
-                       unsigned int r = *prop++;
-                       /* Apple 'Fixed' format */
-                       if (r >= 0x10000)
-                               r >>= 16;
-                       temp[i] = r ;
-                       i++ ; if(i>=9) i=8;
-               }
-       }
-#ifdef DEBUG_DMASOUND
-if (i > 1){
-       int j;
-       printk("dmasound_pmac: burgundy with multiple frame rates\n");
-       for(j=0; j<i; j++)
-               printk("%d ", temp[j]) ;
-       printk("\n") ;
-}
-#endif
-}
-
-static void __init
-daca_init_frame_rates(const unsigned int *prop, unsigned int l)
-{
-       int temp[9] ;
-       int i = 0 ;
-       if (prop) {
-               for (l /= sizeof(int); l > 0; --l) {
-                       unsigned int r = *prop++;
-                       /* Apple 'Fixed' format */
-                       if (r >= 0x10000)
-                               r >>= 16;
-                       temp[i] = r ;
-                       i++ ; if(i>=9) i=8;
-
-               }
-       }
-#ifdef DEBUG_DMASOUND
-if (i > 1){
-       int j;
-       printk("dmasound_pmac: DACA with multiple frame rates\n");
-       for(j=0; j<i; j++)
-               printk("%d ", temp[j]) ;
-       printk("\n") ;
-}
-#endif
-}
-
-static void __init
-init_frame_rates(const unsigned int *prop, unsigned int l)
-{
-       switch (awacs_revision) {
-               case AWACS_TUMBLER:
-               case AWACS_SNAPPER:
-                       tas_init_frame_rates(prop, l);
-                       break ;
-               case AWACS_DACA:
-                       daca_init_frame_rates(prop, l);
-                       break ;
-               case AWACS_BURGUNDY:
-                       burgundy_init_frame_rates(prop, l);
-                       break ;
-               default:
-                       awacs_init_frame_rates(prop, l);
-                       break ;
-       }
-}
-
-/* find things/machines that can't do mac-io byteswap
-*/
-
-static void __init
-set_hw_byteswap(struct device_node *io)
-{
-       struct device_node *mio ;
-       unsigned int kl = 0 ;
-
-       /* if seems that Keylargo can't byte-swap  */
-
-       for (mio = io->parent; mio ; mio = mio->parent) {
-               if (strcmp(mio->name, "mac-io") == 0) {
-                       if (of_device_is_compatible(mio, "Keylargo"))
-                               kl = 1;
-                       break;
-               }
-       }
-       hw_can_byteswap = !kl;
-}
-
-/* Allocate the resources necessary for beep generation.  This cannot be (quite)
-   done statically (yet) because we cannot do virt_to_bus() on static vars when
-   the code is loaded as a module.
-
-   for the sake of saving the possibility that two allocations will incur the
-   overhead of two pull-ups in DBDMA_ALIGN() we allocate the 'emergency' dmdma
-   command here as well... even tho' it is not part of the beep process.
-*/
-
-int32_t
-__init setup_beep(void)
-{
-       /* Initialize beep stuff */
-       /* want one cmd buffer for beeps, and a second one for emergencies
-          - i.e. dbdma error conditions.
-          ask for three to allow for pull up in DBDMA_ALIGN().
-       */
-       beep_dbdma_cmd_space =
-               kmalloc((2 + 1) * sizeof(struct dbdma_cmd), GFP_KERNEL);
-       if(beep_dbdma_cmd_space == NULL) {
-               printk(KERN_ERR "dmasound_pmac: no beep dbdma cmd space\n") ;
-               return -ENOMEM ;
-       }
-       beep_dbdma_cmd = (volatile struct dbdma_cmd *)
-                       DBDMA_ALIGN(beep_dbdma_cmd_space);
-       /* set up emergency dbdma cmd */
-       emergency_dbdma_cmd = beep_dbdma_cmd+1 ;
-       beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
-       if (beep_buf == NULL) {
-               printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n");
-               kfree(beep_dbdma_cmd_space) ;
-               return -ENOMEM ;
-       }
-       return 0 ;
-}
-
-static struct input_dev *awacs_beep_dev;
-
-int __init dmasound_awacs_init(void)
-{
-       struct device_node *io = NULL, *info = NULL;
-       int vol, res;
-
-       if (!machine_is(powermac))
-               return -ENODEV;
-
-       awacs_subframe = 0;
-       awacs_revision = 0;
-       hw_can_byteswap = 1 ; /* most can */
-
-       /* look for models we need to handle specially */
-       set_model() ;
-
-       /* find the OF node that tells us about the dbdma stuff
-       */
-       io = get_snd_io_node();
-       if (io == NULL) {
-#ifdef DEBUG_DMASOUND
-printk("dmasound_pmac: couldn't find sound io OF node\n");
-#endif
-               goto no_device;
-       }
-
-       /* find the OF node that tells us about the sound sub-system
-        * this doesn't exist on pre-davbus machines (earlier than 9500)
-       */
-       if (awacs_revision != AWACS_AWACS) { /* set for pre-davbus */
-               info = get_snd_info_node(io) ;
-               if (info == NULL){
-#ifdef DEBUG_DMASOUND
-printk("dmasound_pmac: couldn't find 'sound' OF node\n");
-#endif
-                       goto no_device;
-               }
-       }
-
-       awacs_revision = get_codec_type(info) ;
-       if (awacs_revision == 0) {
-#ifdef DEBUG_DMASOUND
-printk("dmasound_pmac: couldn't find a Codec we can handle\n");
-#endif
-               goto no_device; /* we don't know this type of h/w */
-       }
-
-       /* set up perch, ziva, SRS or whatever else we have as sound
-        *  expansion.
-       */
-       get_expansion_type();
-
-       /* we've now got enough information to make up the audio topology.
-        * we will map the sound part of mac-io now so that we can probe for
-        * other info if necessary (early AWACS we want to read chip ids)
-        */
-
-       if (of_get_address(io, 2, NULL, NULL) == NULL) {
-               /* OK - maybe we need to use the 'awacs' node (on earlier
-                * machines).
-                */
-               if (awacs_node) {
-                       of_node_put(io);
-                       io = of_node_get(awacs_node);
-                       if (of_get_address(io, 2, NULL, NULL) == NULL) {
-                               printk("dmasound_pmac: can't use %s\n",
-                                      io->full_name);
-                               goto no_device;
-                       }
-               } else
-                       printk("dmasound_pmac: can't use %s\n", io->full_name);
-       }
-
-       if (of_address_to_resource(io, 0, &awacs_rsrc[0]) ||
-           request_mem_region(awacs_rsrc[0].start,
-                              awacs_rsrc[0].end - awacs_rsrc[0].start + 1,
-                              " (IO)") == NULL) {
-               printk(KERN_ERR "dmasound: can't request IO resource !\n");
-               goto no_device;
-       }
-       if (of_address_to_resource(io, 1, &awacs_rsrc[1]) ||
-           request_mem_region(awacs_rsrc[1].start,
-                              awacs_rsrc[1].end - awacs_rsrc[1].start + 1,
-                              " (tx dma)") == NULL) {
-               release_mem_region(awacs_rsrc[0].start,
-                                  awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
-               printk(KERN_ERR "dmasound: can't request Tx DMA resource !\n");
-               goto no_device;
-       }
-       if (of_address_to_resource(io, 2, &awacs_rsrc[2]) ||
-           request_mem_region(awacs_rsrc[2].start,
-                              awacs_rsrc[2].end - awacs_rsrc[2].start + 1,
-                              " (rx dma)") == NULL) {
-               release_mem_region(awacs_rsrc[0].start,
-                                  awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
-               release_mem_region(awacs_rsrc[1].start,
-                                  awacs_rsrc[1].end - awacs_rsrc[1].start + 1);
-               printk(KERN_ERR "dmasound: can't request Rx DMA resource !\n");
-               goto no_device;
-       }
-
-       awacs_beep_dev = input_allocate_device();
-       if (!awacs_beep_dev) {
-               release_mem_region(awacs_rsrc[0].start,
-                                  awacs_rsrc[0].end - awacs_rsrc[0].start + 1);
-               release_mem_region(awacs_rsrc[1].start,
-                                  awacs_rsrc[1].end - awacs_rsrc[1].start + 1);
-               release_mem_region(awacs_rsrc[2].start,
-                                  awacs_rsrc[2].end - awacs_rsrc[2].start + 1);
-               printk(KERN_ERR "dmasound: can't allocate input device !\n");
-               goto no_device;
-       }
-
-       awacs_beep_dev->name = "dmasound beeper";
-       awacs_beep_dev->phys = "macio/input0";
-       awacs_beep_dev->id.bustype = BUS_HOST;
-       awacs_beep_dev->event = awacs_beep_event;
-       awacs_beep_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
-       awacs_beep_dev->evbit[0] = BIT(EV_SND);
-
-       /* all OF versions I've seen use this value */
-       if (i2s_node)
-               i2s = ioremap(awacs_rsrc[0].start, 0x1000);
-       else
-               awacs = ioremap(awacs_rsrc[0].start, 0x1000);
-       awacs_txdma = ioremap(awacs_rsrc[1].start, 0x100);
-       awacs_rxdma = ioremap(awacs_rsrc[2].start, 0x100);
-
-       /* first of all make sure that the chip is powered up....*/
-       pmac_call_feature(PMAC_FTR_SOUND_CHIP_ENABLE, io, 0, 1);
-       if (awacs_revision == AWACS_SCREAMER && awacs)
-               awacs_recalibrate();
-
-       awacs_irq = irq_of_parse_and_map(io, 0);
-       awacs_tx_irq = irq_of_parse_and_map(io, 1);
-       awacs_rx_irq = irq_of_parse_and_map(io, 2);
-
-       /* Hack for legacy crap that will be killed someday */
-       of_node_put(awacs_node);
-       awacs_node = of_node_get(io);
-
-       /* if we have an awacs or screamer - probe the chip to make
-        * sure we have the right revision.
-       */
-
-       if (awacs_revision <= AWACS_SCREAMER){
-               uint32_t temp, rev, mfg ;
-               /* find out the awacs revision from the chip */
-               temp = in_le32(&awacs->codec_stat);
-               rev = (temp >> 12) & 0xf;
-               mfg = (temp >>  8) & 0xf;
-#ifdef DEBUG_DMASOUND
-printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
-#endif
-               if (rev >= AWACS_SCREAMER)
-                       awacs_revision = AWACS_SCREAMER ;
-               else
-                       awacs_revision = rev ;
-       }
-
-       dmasound.mach = machPMac;
-
-       /* find out other bits & pieces from OF, these may be present
-          only on some models ... so be careful.
-       */
-
-       /* in the absence of a frame rates property we will use the defaults
-       */
-
-       if (info) {
-               const unsigned int *prop;
-               unsigned int l;
-
-               sound_device_id = 0;
-               /* device ID appears post g3 b&w */
-               prop = of_get_property(info, "device-id", NULL);
-               if (prop != 0)
-                       sound_device_id = *prop;
-
-               /* look for a property saying what sample rates
-                  are available */
-
-               prop = of_get_property(info, "sample-rates", &l);
-               if (prop == 0)
-                       prop = of_get_property(info, "output-frame-rates", &l);
-
-               /* if it's there use it to set up frame rates */
-               init_frame_rates(prop, l) ;
-               of_node_put(info);
-               info = NULL;
-       }
-
-       if (awacs)
-               out_le32(&awacs->control, 0x11); /* set everything quiesent */
-
-       set_hw_byteswap(io) ; /* figure out if the h/w can do it */
-
-#ifdef CONFIG_NVRAM
-       /* get default volume from nvram */
-       vol = ((pmac_xpram_read( 8 ) & 7 ) << 1 );
-#else
-       vol = 0;
-#endif
-
-       /* set up tracking values */
-       spk_vol = vol * 100 ;
-       spk_vol /= 7 ; /* get set value to a percentage */
-       spk_vol |= (spk_vol << 8) ; /* equal left & right */
-       line_vol = passthru_vol = spk_vol ;
-
-       /* fill regs that are shared between AWACS & Burgundy */
-
-       awacs_reg[2] = vol + (vol << 6);
-       awacs_reg[4] = vol + (vol << 6);
-       awacs_reg[5] = vol + (vol << 6); /* screamer has loopthru vol control */
-       awacs_reg[6] = 0; /* maybe should be vol << 3 for PCMCIA speaker */
-       awacs_reg[7] = 0;
-
-       awacs_reg[0] = MASK_MUX_CD;
-       awacs_reg[1] = MASK_LOOPTHRU;
-
-       /* FIXME: Only machines with external SRS module need MASK_PAROUT */
-       if (has_perch || sound_device_id == 0x5
-           || /*sound_device_id == 0x8 ||*/ sound_device_id == 0xb)
-               awacs_reg[1] |= MASK_PAROUT0 | MASK_PAROUT1;
-
-       switch (awacs_revision) {
-               case AWACS_TUMBLER:
-                        tas_register_driver(&tas3001c_hooks);
-                       tas_init(I2C_DRIVERID_TAS3001C, I2C_DRIVERNAME_TAS3001C);
-                       tas_dmasound_init();
-                       tas_post_init();
-                       break ;
-               case AWACS_SNAPPER:
-                        tas_register_driver(&tas3004_hooks);
-                       tas_init(I2C_DRIVERID_TAS3004,I2C_DRIVERNAME_TAS3004);
-                       tas_dmasound_init();
-                       tas_post_init();
-                       break;
-               case AWACS_DACA:
-                       daca_init();
-                       break;  
-               case AWACS_BURGUNDY:
-                       awacs_burgundy_init();
-                       break ;
-               case AWACS_SCREAMER:
-               case AWACS_AWACS:
-               default:
-                       load_awacs();
-                       break ;
-       }
-
-       /* enable/set-up external modules - when we know how */
-
-       if (has_perch)
-               awacs_enable_amp(100 * 0x101);
-
-       /* Reset dbdma channels */
-       out_le32(&awacs_txdma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16);
-       while (in_le32(&awacs_txdma->status) & RUN)
-               udelay(1);
-       out_le32(&awacs_rxdma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16);
-       while (in_le32(&awacs_rxdma->status) & RUN)
-               udelay(1);
-
-       /* Initialize beep stuff */
-       if ((res=setup_beep()))
-               return res ;
-
-#ifdef CONFIG_PM
-       pmu_register_sleep_notifier(&awacs_sleep_notifier);
-#endif /* CONFIG_PM */
-
-       /* Powerbooks have odd ways of enabling inputs such as
-          an expansion-bay CD or sound from an internal modem
-          or a PC-card modem. */
-       if (is_pbook_3X00) {
-               /*
-                * Enable CD and PC-card sound inputs.
-                * This is done by reading from address
-                * f301a000, + 0x10 to enable the expansion-bay
-                * CD sound input, + 0x80 to enable the PC-card
-                * sound input.  The 0x100 enables the SCSI bus
-                * terminator power.
-                */
-               latch_base = ioremap (0xf301a000, 0x1000);
-               in_8(latch_base + 0x190);
-
-       } else if (is_pbook_g3) {
-               struct device_node* mio;
-               macio_base = NULL;
-               for (mio = io->parent; mio; mio = mio->parent) {
-                       if (strcmp(mio->name, "mac-io") == 0) {
-                               struct resource r;
-                               if (of_address_to_resource(mio, 0, &r) == 0)
-                                       macio_base = ioremap(r.start, 0x40);
-                               break;
-                       }
-               }
-               /*
-                * Enable CD sound input.
-                * The relevant bits for writing to this byte are 0x8f.
-                * I haven't found out what the 0x80 bit does.
-                * For the 0xf bits, writing 3 or 7 enables the CD
-                * input, any other value disables it.  Values
-                * 1, 3, 5, 7 enable the microphone.  Values 0, 2,
-                * 4, 6, 8 - f enable the input from the modem.
-                *  -- paulus.
-                */
-               if (macio_base)
-                       out_8(macio_base + 0x37, 3);
-       }
-
-       if (hw_can_byteswap)
-               dmasound.mach.hardware_afmts = (AFMT_S16_BE | AFMT_S16_LE) ;
-       else
-               dmasound.mach.hardware_afmts = AFMT_S16_BE ;
-
-       /* shut out chips that do output only.
-        * may need to extend this to machines which have no inputs - even tho'
-        * they use screamer - IIRC one of the powerbooks is like this.
-        */
-
-       if (awacs_revision != AWACS_DACA) {
-               dmasound.mach.capabilities = DSP_CAP_DUPLEX ;
-               dmasound.mach.record = PMacRecord ;
-       }
-
-       dmasound.mach.default_hard = def_hard ;
-       dmasound.mach.default_soft = def_soft ;
-
-       switch (awacs_revision) {
-               case AWACS_BURGUNDY:
-                       sprintf(awacs_name, "PowerMac Burgundy ") ;
-                       break ;
-               case AWACS_DACA:
-                       sprintf(awacs_name, "PowerMac DACA ") ;
-                       break ;
-               case AWACS_TUMBLER:
-                       sprintf(awacs_name, "PowerMac Tumbler ") ;
-                       break ;
-               case AWACS_SNAPPER:
-                       sprintf(awacs_name, "PowerMac Snapper ") ;
-                       break ;
-               case AWACS_SCREAMER:
-                       sprintf(awacs_name, "PowerMac Screamer ") ;
-                       break ;
-               case AWACS_AWACS:
-               default:
-                       sprintf(awacs_name, "PowerMac AWACS rev %d ", awacs_revision) ;
-                       break ;
-       }
-
-       /*
-        * XXX: we should handle errors here, but that would mean
-        * rewriting the whole init code.  later..
-        */
-       input_register_device(awacs_beep_dev);
-
-       of_node_put(io);
-
-       return dmasound_init();
-
-no_device:
-       of_node_put(info);
-       of_node_put(awacs_node);
-       of_node_put(i2s_node);
-       of_node_put(io);
-       return -ENODEV ;
-}
-
-static void __exit dmasound_awacs_cleanup(void)
-{
-       input_unregister_device(awacs_beep_dev);
-
-       switch (awacs_revision) {
-               case AWACS_TUMBLER:
-               case AWACS_SNAPPER:
-                       tas_dmasound_cleanup();
-                       tas_cleanup();
-                       break ;
-               case AWACS_DACA:
-                       daca_cleanup();
-                       break;
-       }
-       dmasound_deinit();
-
-       of_node_put(awacs_node);
-       of_node_put(i2s_node);
-}
-
-MODULE_DESCRIPTION("PowerMac built-in audio driver.");
-MODULE_LICENSE("GPL");
-
-module_init(dmasound_awacs_init);
-module_exit(dmasound_awacs_cleanup);
index f4056a9c371b03ee6df58c20a4d8e9e1a8c72a46..a003c0ea9303f800f27e6de612773d0a2f5012e2 100644 (file)
@@ -202,13 +202,6 @@ module_param(numWriteBufs, int, 0);
 static unsigned int writeBufSize = DEFAULT_BUFF_SIZE ; /* in bytes */
 module_param(writeBufSize, int, 0);
 
-#ifdef HAS_RECORD
-static unsigned int numReadBufs = DEFAULT_N_BUFFERS;
-module_param(numReadBufs, int, 0);
-static unsigned int readBufSize = DEFAULT_BUFF_SIZE;   /* in bytes */
-module_param(readBufSize, int, 0);
-#endif
-
 MODULE_LICENSE("GPL");
 
 #ifdef MODULE
@@ -403,10 +396,6 @@ static void mixer_init(void)
 
 struct sound_queue dmasound_write_sq;
 static void sq_reset_output(void) ;
-#ifdef HAS_RECORD
-struct sound_queue dmasound_read_sq;
-static void sq_reset_input(void) ;
-#endif
 
 static int sq_allocate_buffers(struct sound_queue *sq, int num, int size)
 {
@@ -530,12 +519,6 @@ printk("dmasound_core: invalid frag count (user set %d)\n", sq->user_frags) ;
            sq->rear = -1;
            setup_func = dmasound.mach.write_sq_setup;
        }
-#ifdef HAS_RECORD
-       else {
-           sq->rear = 0;
-           setup_func = dmasound.mach.read_sq_setup;
-       }
-#endif
        if (setup_func)
            return setup_func();
        return 0 ;
@@ -672,13 +655,6 @@ static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait)
        }
        if (file->f_mode & FMODE_WRITE )
                poll_wait(file, &write_sq.action_queue, wait);
-#ifdef HAS_RECORD
-       if (file->f_mode & FMODE_READ)
-               poll_wait(file, &read_sq.action_queue, wait);
-       if (file->f_mode & FMODE_READ)
-               if (read_sq.block_size - read_sq.rear_size > 0)
-                       mask |= POLLIN | POLLRDNORM;
-#endif
        if (file->f_mode & FMODE_WRITE)
                if (write_sq.count < write_sq.max_active || write_sq.block_size - write_sq.rear_size > 0)
                        mask |= POLLOUT | POLLWRNORM;
@@ -686,101 +662,6 @@ static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait)
 
 }
 
-#ifdef HAS_RECORD
-    /*
-     *  Here is how the values are used for reading.
-     *  The value 'active' simply indicates the DMA is running.  This is done
-     *  so the driver semantics are DMA starts when the first read is posted.
-     *  The value 'front' indicates the buffer we should next send to the user.
-     *  The value 'rear' indicates the buffer the DMA is currently filling.
-     *  When 'front' == 'rear' the buffer "ring" is empty (we always have an
-     *  empty available).  The 'rear_size' is used to track partial offsets
-     *  into the buffer we are currently returning to the user.
-
-     *  This level (> [1.5]) doesn't care what strategy the LL driver uses with
-     *  DMA on over-run.  It can leave it running (and keep active == 1) or it
-     *  can kill it and set active == 0 in which case this routine will spot
-     *  it and restart the DMA.
-     */
-
-static ssize_t sq_read(struct file *file, char __user *dst, size_t uLeft,
-                      loff_t *ppos)
-{
-
-       ssize_t uRead, bLeft, bUsed, uUsed;
-
-       if (uLeft == 0)
-               return 0;
-
-       /* cater for the compatibility mode - record compiled in but no LL */
-       if (dmasound.mach.record == NULL)
-               return -EINVAL ;
-
-       /* see comment in sq_write()
-       */
-
-       if( shared_resources_initialised == 0) {
-               dmasound.mach.init() ;
-               shared_resources_initialised = 1 ;
-       }
-
-       /* set up the sq if it is not already done. see comments in sq_write().
-       */
-
-       if (read_sq.locked == 0) {
-               if ((uRead = sq_setup(&read_sq)) < 0)
-                       return uRead ;
-       }
-
-       uRead = 0;
-
-       /* Move what the user requests, depending upon other options.
-       */
-       while (uLeft > 0) {
-
-               /* we happened to get behind and the LL driver killed DMA
-                  then we should set it going again.  This also sets it
-                  going the first time through.
-               */
-               if ( !read_sq.active )
-                       dmasound.mach.record();
-
-               /* When front == rear, the DMA is not done yet.
-               */
-               while (read_sq.front == read_sq.rear) {
-                       if (read_sq.open_mode & O_NONBLOCK) {
-                              return uRead > 0 ? uRead : -EAGAIN;
-                       }
-                       SLEEP(read_sq.action_queue);
-                       if (signal_pending(current))
-                               return uRead > 0 ? uRead : -EINTR;
-               }
-
-               /* The amount we move is either what is left in the
-                * current buffer or what the user wants.
-                */
-               bLeft = read_sq.block_size - read_sq.rear_size;
-               bUsed = read_sq.rear_size;
-               uUsed = sound_copy_translate(dmasound.trans_read, dst, uLeft,
-                                            read_sq.buffers[read_sq.front],
-                                            &bUsed, bLeft);
-               if (uUsed <= 0)
-                       return uUsed;
-               dst += uUsed;
-               uRead += uUsed;
-               uLeft -= uUsed;
-               read_sq.rear_size += bUsed;
-               if (read_sq.rear_size >= read_sq.block_size) {
-                       read_sq.rear_size = 0;
-                       read_sq.front++;
-                       if (read_sq.front >= read_sq.max_active)
-                               read_sq.front = 0;
-               }
-       }
-       return uRead;
-}
-#endif /* HAS_RECORD */
-
 static inline void sq_init_waitqueue(struct sound_queue *sq)
 {
        init_waitqueue_head(&sq->action_queue);
@@ -854,23 +735,6 @@ static int sq_open2(struct sound_queue *sq, struct file *file, mode_t mode,
 #define write_sq_open(file)    \
        sq_open2(&write_sq, file, FMODE_WRITE, numWriteBufs, writeBufSize )
 
-#ifdef HAS_RECORD
-#define read_sq_init_waitqueue()       sq_init_waitqueue(&read_sq)
-#if 0 /* blocking open() */
-#define read_sq_wake_up(file)          sq_wake_up(&read_sq, file, FMODE_READ)
-#endif
-#define read_sq_release_buffers()      sq_release_buffers(&read_sq)
-#define read_sq_open(file)     \
-       sq_open2(&read_sq, file, FMODE_READ, numReadBufs, readBufSize )
-#else
-#define read_sq_init_waitqueue()       do {} while (0)
-#if 0 /* blocking open() */
-#define read_sq_wake_up(file)          do {} while (0)
-#endif
-#define read_sq_release_buffers()      do {} while (0)
-#define sq_reset_input()               do {} while (0)
-#endif
-
 static int sq_open(struct inode *inode, struct file *file)
 {
        int rc;
@@ -881,25 +745,11 @@ static int sq_open(struct inode *inode, struct file *file)
        rc = write_sq_open(file); /* checks the f_mode */
        if (rc)
                goto out;
-#ifdef HAS_RECORD
-       if (dmasound.mach.record) {
-               rc = read_sq_open(file); /* checks the f_mode */
-               if (rc)
-                       goto out;
-       } else { /* no record function installed; in compat mode */
-               if (file->f_mode & FMODE_READ) {
-                       /* TODO: if O_RDWR, release any resources grabbed by write part */
-                       rc = -ENXIO;
-                       goto out;
-               }
-       }
-#else /* !HAS_RECORD */
        if (file->f_mode & FMODE_READ) {
                /* TODO: if O_RDWR, release any resources grabbed by write part */
                rc = -ENXIO ; /* I think this is what is required by open(2) */
                goto out;
        }
-#endif /* HAS_RECORD */
 
        if (dmasound.mach.sq_open)
            dmasound.mach.sq_open(file->f_mode);
@@ -956,43 +806,9 @@ static void sq_reset_output(void)
        write_sq.user_frag_size = 0 ;
 }
 
-#ifdef HAS_RECORD
-
-static void sq_reset_input(void)
-{
-       if (dmasound.mach.record && read_sq.active) {
-               if (dmasound.mach.abort_read) { /* this routine must really be present */
-                       read_sq.syncing = 1 ;
-                       /* this can use the read_sq.sync_queue to sleep if
-                          necessary - it should not return until DMA
-                          is really stopped - because we might deallocate
-                          the buffers as the next action...
-                       */
-                       dmasound.mach.abort_read() ;
-               } else {
-                       printk(KERN_ERR
-                       "dmasound_core: %s has no abort_read()!! all bets are off\n",
-                               dmasound.mach.name) ;
-               }
-       }
-       read_sq.syncing =
-       read_sq.active =
-       read_sq.front =
-       read_sq.count =
-       read_sq.rear = 0 ;
-
-       /* OK - we can unlock the parameters and fragment settings */
-       read_sq.locked = 0 ;
-       read_sq.user_frags = 0 ;
-       read_sq.user_frag_size = 0 ;
-}
-
-#endif
-
 static void sq_reset(void)
 {
        sq_reset_output() ;
-       sq_reset_input() ;
        /* we could consider resetting the shared_resources_owner here... but I
           think it is probably still rather non-obvious to application writer
        */
@@ -1038,17 +854,6 @@ static int sq_release(struct inode *inode, struct file *file)
 
        lock_kernel();
 
-#ifdef HAS_RECORD
-       /* probably best to do the read side first - so that time taken to do it
-          overlaps with playing any remaining output samples.
-       */
-       if (file->f_mode & FMODE_READ) {
-               sq_reset_input() ; /* make sure dma is stopped and all is quiet */
-               read_sq_release_buffers();
-               read_sq.busy = 0;
-       }
-#endif
-
        if (file->f_mode & FMODE_WRITE) {
                if (write_sq.busy)
                        rc = sq_fsync(file, file->f_path.dentry);
@@ -1105,11 +910,6 @@ static int shared_resources_are_mine(mode_t md)
 
 static int queues_are_quiescent(void)
 {
-#ifdef HAS_RECORD
-       if (dmasound.mach.record)
-               if (read_sq.locked)
-                       return 0 ;
-#endif
        if (write_sq.locked)
                return 0 ;
        return 1 ;
@@ -1185,13 +985,6 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
                   the read_sq ones.
                */
                size = 0 ;
-#ifdef HAS_RECORD
-               if (dmasound.mach.record && (file->f_mode & FMODE_READ)) {
-                       if ( !read_sq.locked )
-                               sq_setup(&read_sq) ; /* set params */
-                       size = read_sq.user_frag_size ;
-               }
-#endif
                if (file->f_mode & FMODE_WRITE) {
                        if ( !write_sq.locked )
                                sq_setup(&write_sq) ;
@@ -1214,8 +1007,6 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
                   everything - read, however, is killed imediately.
                */
                result = 0 ;
-               if ((file->f_mode & FMODE_READ) && dmasound.mach.record)
-                       sq_reset_input() ;
                if (file->f_mode & FMODE_WRITE) {
                        result = sq_fsync(file, file->f_path.dentry);
                        sq_reset_output() ;
@@ -1294,13 +1085,6 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
                result = 0 ;
                nbufs = (data >> 16) & 0x7fff ; /* 0x7fff is 'use maximum' */
                size = data & 0xffff;
-#ifdef HAS_RECORD
-               if ((file->f_mode & FMODE_READ) && dmasound.mach.record) {
-                       result = set_queue_frags(&read_sq, nbufs, size) ;
-                       if (result)
-                               return result ;
-               }
-#endif
                if (file->f_mode & FMODE_WRITE) {
                        result = set_queue_frags(&write_sq, nbufs, size) ;
                        if (result)
@@ -1348,20 +1132,6 @@ static const struct file_operations sq_fops =
        .release        = sq_release,
 };
 
-#ifdef HAS_RECORD
-static const struct file_operations sq_fops_record =
-{
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = sq_write,
-       .poll           = sq_poll,
-       .ioctl          = sq_ioctl,
-       .open           = sq_open,
-       .release        = sq_release,
-       .read           = sq_read,
-};
-#endif
-
 static int sq_init(void)
 {
        const struct file_operations *fops = &sq_fops;
@@ -1369,10 +1139,6 @@ static int sq_init(void)
        int sq_unit;
 #endif
 
-#ifdef HAS_RECORD
-       if (dmasound.mach.record)
-               fops = &sq_fops_record;
-#endif
        sq_unit = register_sound_dsp(fops, -1);
        if (sq_unit < 0) {
                printk(KERN_ERR "dmasound_core: couldn't register fops\n") ;
@@ -1380,7 +1146,6 @@ static int sq_init(void)
        }
 
        write_sq_init_waitqueue();
-       read_sq_init_waitqueue();
 
        /* These parameters will be restored for every clean open()
         * in the case of multiple open()s (e.g. dsp0 & dsp1) they
@@ -1406,11 +1171,7 @@ static int sq_init(void)
    driver.
 */
 
-#ifdef HAS_RECORD
-#define STAT_BUFF_LEN 1024
-#else
 #define STAT_BUFF_LEN 768
-#endif
 
 /* this is how much space we will allow the low-level driver to use
    in the stat buffer.  Currently, 2 * (80 character line + <NL>).
@@ -1518,11 +1279,6 @@ static int state_open(struct inode *inode, struct file *file)
        len += sprintf(buffer+len,"Allocated:%8s%6s\n","Buffers","Size") ;
        len += sprintf(buffer+len,"%9s:%8d%6d\n",
                "write", write_sq.numBufs, write_sq.bufSize) ;
-#ifdef HAS_RECORD
-       if (dmasound.mach.record)
-               len += sprintf(buffer+len,"%9s:%8d%6d\n",
-                       "read", read_sq.numBufs, read_sq.bufSize) ;
-#endif
        len += sprintf(buffer+len,
                "Current  : MaxFrg FragSiz MaxAct Frnt Rear "
                "Cnt RrSize A B S L  xruns\n") ;
@@ -1531,14 +1287,6 @@ static int state_open(struct inode *inode, struct file *file)
                write_sq.max_active, write_sq.front, write_sq.rear,
                write_sq.count, write_sq.rear_size, write_sq.active,
                write_sq.busy, write_sq.syncing, write_sq.locked, write_sq.xruns) ;
-#ifdef HAS_RECORD
-       if (dmasound.mach.record)
-               len += sprintf(buffer+len,"%9s:%7d%8d%7d%5d%5d%4d%7d%2d%2d%2d%2d%7d\n",
-                       "read", read_sq.max_count, read_sq.block_size,
-                       read_sq.max_active, read_sq.front, read_sq.rear,
-                       read_sq.count, read_sq.rear_size, read_sq.active,
-                       read_sq.busy, read_sq.syncing, read_sq.locked, read_sq.xruns) ;
-#endif
 #ifdef DEBUG_DMASOUND
 printk("dmasound: stat buffer used %d bytes\n", len) ;
 #endif
@@ -1638,13 +1386,6 @@ int dmasound_init(void)
                (dmasound.mach.version >> 8), (dmasound.mach.version & 0xff)) ;
        printk(KERN_INFO "Write will use %4d fragments of %7d bytes as default\n",
                numWriteBufs, writeBufSize) ;
-#ifdef HAS_RECORD
-       if (dmasound.mach.record)
-               printk(KERN_INFO
-                       "Read  will use %4d fragments of %7d bytes as default\n",
-                       numReadBufs, readBufSize) ;
-#endif
-
        return 0;
 }
 
@@ -1659,7 +1400,6 @@ void dmasound_deinit(void)
        }
 
        write_sq_release_buffers();
-       read_sq_release_buffers();
 
        if (mixer_unit >= 0)
                unregister_sound_mixer(mixer_unit);
@@ -1684,36 +1424,12 @@ static int dmasound_setup(char *str)
         */
 
        switch (ints[0]) {
-#ifdef HAS_RECORD
-        case 5:
-                if ((ints[5] < 0) || (ints[5] > MAX_CATCH_RADIUS))
-                        printk("dmasound_setup: invalid catch radius, using default = %d\n", catchRadius);
-                else
-                        catchRadius = ints[5];
-                /* fall through */
-        case 4:
-                if (ints[4] < MIN_BUFFERS)
-                        printk("dmasound_setup: invalid number of read buffers, using default = %d\n",
-                                 numReadBufs);
-                else
-                        numReadBufs = ints[4];
-                /* fall through */
-        case 3:
-               if ((size = ints[3]) < 256)  /* check for small buffer specs */
-                       size <<= 10 ;
-                if (size < MIN_BUFSIZE || size > MAX_BUFSIZE)
-                        printk("dmasound_setup: invalid read buffer size, using default = %d\n", readBufSize);
-                else
-                        readBufSize = size;
-                /* fall through */
-#else
        case 3:
                if ((ints[3] < 0) || (ints[3] > MAX_CATCH_RADIUS))
                        printk("dmasound_setup: invalid catch radius, using default = %d\n", catchRadius);
                else
                        catchRadius = ints[3];
                /* fall through */
-#endif
        case 2:
                if (ints[1] < MIN_BUFFERS)
                        printk("dmasound_setup: invalid number of buffers, using default = %d\n", numWriteBufs);
@@ -1830,9 +1546,6 @@ EXPORT_SYMBOL(dmasound_init);
 EXPORT_SYMBOL(dmasound_deinit);
 #endif
 EXPORT_SYMBOL(dmasound_write_sq);
-#ifdef HAS_RECORD
-EXPORT_SYMBOL(dmasound_read_sq);
-#endif
 EXPORT_SYMBOL(dmasound_catchRadius);
 #ifdef HAS_8BIT_TABLES
 EXPORT_SYMBOL(dmasound_ulaw2dma8);
diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
deleted file mode 100644 (file)
index 4b7dbdd..0000000
+++ /dev/null
@@ -1,849 +0,0 @@
-/*
- * Driver for the i2c/i2s based TA3004 sound chip used
- * on some Apple hardware. Also known as "snapper".
- *
- * Tobias Sargeant <tobias.sargeant@bigpond.com>
- * Based upon, tas3001c.c by Christopher C. Chimelis <chris@debian.org>:
- *
- *   TODO:
- *   -----
- *   * Enable control over input line 2 (is this connected?)
- *   * Implement sleep support (at least mute everything and
- *   * set gains to minimum during sleep)
- *   * Look into some of Darwin's tweaks regarding the mute
- *   * lines (delays & different behaviour on some HW)
- *
- */
-
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/ioport.h>
-#include <linux/sysctl.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <linux/init.h>
-#include <linux/soundcard.h>
-#include <linux/workqueue.h>
-#include <asm/uaccess.h>
-#include <asm/errno.h>
-#include <asm/io.h>
-#include <asm/prom.h>
-
-#include "dmasound.h"
-#include "tas_common.h"
-#include "tas3001c.h"
-
-#include "tas_ioctl.h"
-
-#define TAS3001C_BIQUAD_FILTER_COUNT  6
-#define TAS3001C_BIQUAD_CHANNEL_COUNT 2
-
-#define VOL_DEFAULT    (100 * 4 / 5)
-#define INPUT_DEFAULT  (100 * 4 / 5)
-#define BASS_DEFAULT   (100 / 2)
-#define TREBLE_DEFAULT (100 / 2)
-
-struct tas3001c_data_t {
-       struct tas_data_t super;
-       int device_id;
-       int output_id;
-       int speaker_id;
-       struct tas_drce_t drce_state;
-       struct work_struct change;
-};
-
-
-static const union tas_biquad_t
-tas3001c_eq_unity={
-       .buf = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 }
-};
-
-
-static inline unsigned char db_to_regval(short db) {
-       int r=0;
-
-       r=(db+0x59a0) / 0x60;
-
-       if (r < 0x91) return 0x91;
-       if (r > 0xef) return 0xef;
-       return r;
-}
-
-static inline short quantize_db(short db) {
-       return db_to_regval(db) * 0x60 - 0x59a0;
-}
-
-
-static inline int
-register_width(enum tas3001c_reg_t r)
-{
-       switch(r) {
-       case TAS3001C_REG_MCR:
-       case TAS3001C_REG_TREBLE:
-       case TAS3001C_REG_BASS:
-               return 1;
-
-       case TAS3001C_REG_DRC:
-               return 2;
-
-       case TAS3001C_REG_MIXER1:
-       case TAS3001C_REG_MIXER2:
-               return 3;
-
-       case TAS3001C_REG_VOLUME:
-               return 6;
-
-       case TAS3001C_REG_LEFT_BIQUAD0:
-       case TAS3001C_REG_LEFT_BIQUAD1:
-       case TAS3001C_REG_LEFT_BIQUAD2:
-       case TAS3001C_REG_LEFT_BIQUAD3:
-       case TAS3001C_REG_LEFT_BIQUAD4:
-       case TAS3001C_REG_LEFT_BIQUAD5:
-       case TAS3001C_REG_LEFT_BIQUAD6:
-
-       case TAS3001C_REG_RIGHT_BIQUAD0:
-       case TAS3001C_REG_RIGHT_BIQUAD1:
-       case TAS3001C_REG_RIGHT_BIQUAD2:
-       case TAS3001C_REG_RIGHT_BIQUAD3:
-       case TAS3001C_REG_RIGHT_BIQUAD4:
-       case TAS3001C_REG_RIGHT_BIQUAD5:
-       case TAS3001C_REG_RIGHT_BIQUAD6:
-               return 15;
-
-       default:
-               return 0;
-       }
-}
-
-static int
-tas3001c_write_register(       struct tas3001c_data_t *self,
-                               enum tas3001c_reg_t reg_num,
-                               char *data,
-                               uint write_mode)
-{
-       if (reg_num==TAS3001C_REG_MCR ||
-           reg_num==TAS3001C_REG_BASS ||
-           reg_num==TAS3001C_REG_TREBLE) {
-               return tas_write_byte_register(&self->super,
-                                              (uint)reg_num,
-                                              *data,
-                                              write_mode);
-       } else {
-               return tas_write_register(&self->super,
-                                         (uint)reg_num,
-                                         register_width(reg_num),
-                                         data,
-                                         write_mode);
-       }
-}
-
-static int
-tas3001c_sync_register(        struct tas3001c_data_t *self,
-                       enum tas3001c_reg_t reg_num)
-{
-       if (reg_num==TAS3001C_REG_MCR ||
-           reg_num==TAS3001C_REG_BASS ||
-           reg_num==TAS3001C_REG_TREBLE) {
-               return tas_sync_byte_register(&self->super,
-                                             (uint)reg_num,
-                                             register_width(reg_num));
-       } else {
-               return tas_sync_register(&self->super,
-                                        (uint)reg_num,
-                                        register_width(reg_num));
-       }
-}
-
-static int
-tas3001c_read_register(        struct tas3001c_data_t *self,
-                       enum tas3001c_reg_t reg_num,
-                       char *data,
-                       uint write_mode)
-{
-       return tas_read_register(&self->super,
-                                (uint)reg_num,
-                                register_width(reg_num),
-                                data);
-}
-
-static inline int
-tas3001c_fast_load(struct tas3001c_data_t *self, int fast)
-{
-       if (fast)
-               self->super.shadow[TAS3001C_REG_MCR][0] |= 0x80;
-       else
-               self->super.shadow[TAS3001C_REG_MCR][0] &= 0x7f;
-       return tas3001c_sync_register(self,TAS3001C_REG_MCR);
-}
-
-static uint
-tas3001c_supported_mixers(struct tas3001c_data_t *self)
-{
-       return SOUND_MASK_VOLUME |
-               SOUND_MASK_PCM |
-               SOUND_MASK_ALTPCM |
-               SOUND_MASK_TREBLE |
-               SOUND_MASK_BASS;
-}
-
-static int
-tas3001c_mixer_is_stereo(struct tas3001c_data_t *self,int mixer)
-{
-       switch(mixer) {
-       case SOUND_MIXER_VOLUME:
-               return 1;
-       default:
-               return 0;
-       }
-}
-
-static uint
-tas3001c_stereo_mixers(struct tas3001c_data_t *self)
-{
-       uint r=tas3001c_supported_mixers(self);
-       uint i;
-       
-       for (i=1; i<SOUND_MIXER_NRDEVICES; i++)
-               if (r&(1<<i) && !tas3001c_mixer_is_stereo(self,i))
-                       r &= ~(1<<i);
-       return r;
-}
-
-static int
-tas3001c_get_mixer_level(struct tas3001c_data_t *self,int mixer,uint *level)
-{
-       if (!self)
-               return -1;
-               
-       *level=self->super.mixer[mixer];
-       
-       return 0;
-}
-
-static int
-tas3001c_set_mixer_level(struct tas3001c_data_t *self,int mixer,uint level)
-{
-       int rc;
-       tas_shadow_t *shadow;
-
-       uint temp;
-       uint offset=0;
-
-       if (!self)
-               return -1;
-               
-       shadow=self->super.shadow;
-
-       if (!tas3001c_mixer_is_stereo(self,mixer))
-               level = tas_mono_to_stereo(level);
-
-       switch(mixer) {
-       case SOUND_MIXER_VOLUME:
-               temp = tas3001c_gain.master[level&0xff];
-               shadow[TAS3001C_REG_VOLUME][0] = (temp >> 16) & 0xff;
-               shadow[TAS3001C_REG_VOLUME][1] = (temp >> 8)  & 0xff;
-               shadow[TAS3001C_REG_VOLUME][2] = (temp >> 0)  & 0xff;
-               temp = tas3001c_gain.master[(level>>8)&0xff];
-               shadow[TAS3001C_REG_VOLUME][3] = (temp >> 16) & 0xff;
-               shadow[TAS3001C_REG_VOLUME][4] = (temp >> 8)  & 0xff;
-               shadow[TAS3001C_REG_VOLUME][5] = (temp >> 0)  & 0xff;
-               rc = tas3001c_sync_register(self,TAS3001C_REG_VOLUME);
-               break;
-       case SOUND_MIXER_ALTPCM:
-               /* tas3001c_fast_load(self, 1); */
-               level = tas_mono_to_stereo(level);
-               temp = tas3001c_gain.mixer[level&0xff];
-               shadow[TAS3001C_REG_MIXER2][offset+0] = (temp >> 16) & 0xff;
-               shadow[TAS3001C_REG_MIXER2][offset+1] = (temp >> 8)  & 0xff;
-               shadow[TAS3001C_REG_MIXER2][offset+2] = (temp >> 0)  & 0xff;
-               rc = tas3001c_sync_register(self,TAS3001C_REG_MIXER2);
-               /* tas3001c_fast_load(self, 0); */
-               break;
-       case SOUND_MIXER_PCM:
-               /* tas3001c_fast_load(self, 1); */
-               level = tas_mono_to_stereo(level);
-               temp = tas3001c_gain.mixer[level&0xff];
-               shadow[TAS3001C_REG_MIXER1][offset+0] = (temp >> 16) & 0xff;
-               shadow[TAS3001C_REG_MIXER1][offset+1] = (temp >> 8)  & 0xff;
-               shadow[TAS3001C_REG_MIXER1][offset+2] = (temp >> 0)  & 0xff;
-               rc = tas3001c_sync_register(self,TAS3001C_REG_MIXER1);
-               /* tas3001c_fast_load(self, 0); */
-               break;
-       case SOUND_MIXER_TREBLE:
-               temp = tas3001c_gain.treble[level&0xff];
-               shadow[TAS3001C_REG_TREBLE][0]=temp&0xff;
-               rc = tas3001c_sync_register(self,TAS3001C_REG_TREBLE);
-               break;
-       case SOUND_MIXER_BASS:
-               temp = tas3001c_gain.bass[level&0xff];
-               shadow[TAS3001C_REG_BASS][0]=temp&0xff;
-               rc = tas3001c_sync_register(self,TAS3001C_REG_BASS);
-               break;
-       default:
-               rc = -1;
-               break;
-       }
-       if (rc < 0)
-               return rc;
-       self->super.mixer[mixer]=level;
-       return 0;
-}
-
-static int
-tas3001c_leave_sleep(struct tas3001c_data_t *self)
-{
-       unsigned char mcr = (1<<6)+(2<<4)+(2<<2);
-
-       if (!self)
-               return -1;
-
-       /* Make sure something answers on the i2c bus */
-       if (tas3001c_write_register(self, TAS3001C_REG_MCR, &mcr,
-           WRITE_NORMAL|FORCE_WRITE) < 0)
-               return -1;
-
-       tas3001c_fast_load(self, 1);
-
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD0);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD1);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD2);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD3);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD4);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD5);
-
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD0);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD1);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD2);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD3);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD4);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD5);
-
-       tas3001c_fast_load(self, 0);
-
-       (void)tas3001c_sync_register(self,TAS3001C_REG_BASS);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_TREBLE);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER1);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER2);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_VOLUME);
-
-       return 0;
-}
-
-static int
-tas3001c_enter_sleep(struct tas3001c_data_t *self)
-{
-       /* Stub for now, but I have the details on low-power mode */
-       if (!self)
-               return -1; 
-       return 0;
-}
-
-static int
-tas3001c_sync_biquad(  struct tas3001c_data_t *self,
-                       u_int channel,
-                       u_int filter)
-{
-       enum tas3001c_reg_t reg;
-
-       if (channel >= TAS3001C_BIQUAD_CHANNEL_COUNT ||
-           filter  >= TAS3001C_BIQUAD_FILTER_COUNT) return -EINVAL;
-
-       reg=( channel ? TAS3001C_REG_RIGHT_BIQUAD0 : TAS3001C_REG_LEFT_BIQUAD0 ) + filter;
-
-       return tas3001c_sync_register(self,reg);
-}
-
-static int
-tas3001c_write_biquad_shadow(  struct tas3001c_data_t *self,
-                               u_int channel,
-                               u_int filter,
-                               const union tas_biquad_t *biquad)
-{
-       tas_shadow_t *shadow=self->super.shadow;
-       enum tas3001c_reg_t reg;
-
-       if (channel >= TAS3001C_BIQUAD_CHANNEL_COUNT ||
-           filter  >= TAS3001C_BIQUAD_FILTER_COUNT) return -EINVAL;
-
-       reg=( channel ? TAS3001C_REG_RIGHT_BIQUAD0 : TAS3001C_REG_LEFT_BIQUAD0 ) + filter;
-
-       SET_4_20(shadow[reg], 0,biquad->coeff.b0);
-       SET_4_20(shadow[reg], 3,biquad->coeff.b1);
-       SET_4_20(shadow[reg], 6,biquad->coeff.b2);
-       SET_4_20(shadow[reg], 9,biquad->coeff.a1);
-       SET_4_20(shadow[reg],12,biquad->coeff.a2);
-
-       return 0;
-}
-
-static int
-tas3001c_write_biquad( struct tas3001c_data_t *self,
-                       u_int channel,
-                       u_int filter,
-                       const union tas_biquad_t *biquad)
-{
-       int rc;
-
-       rc=tas3001c_write_biquad_shadow(self, channel, filter, biquad);
-       if (rc < 0) return rc;
-
-       return tas3001c_sync_biquad(self, channel, filter);
-}
-
-static int
-tas3001c_write_biquad_list(    struct tas3001c_data_t *self,
-                               u_int filter_count,
-                               u_int flags,
-                               struct tas_biquad_ctrl_t *biquads)
-{
-       int i;
-       int rc;
-
-       if (flags & TAS_BIQUAD_FAST_LOAD) tas3001c_fast_load(self,1);
-
-       for (i=0; i<filter_count; i++) {
-               rc=tas3001c_write_biquad(self,
-                                        biquads[i].channel,
-                                        biquads[i].filter,
-                                        &biquads[i].data);
-               if (rc < 0) break;
-       }
-
-       if (flags & TAS_BIQUAD_FAST_LOAD) {
-               tas3001c_fast_load(self,0);
-
-               (void)tas3001c_sync_register(self,TAS3001C_REG_BASS);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_TREBLE);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER1);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER2);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_VOLUME);
-       }
-
-       return rc;
-}
-
-static int
-tas3001c_read_biquad(  struct tas3001c_data_t *self,
-                       u_int channel,
-                       u_int filter,
-                       union tas_biquad_t *biquad)
-{
-       tas_shadow_t *shadow=self->super.shadow;
-       enum tas3001c_reg_t reg;
-
-       if (channel >= TAS3001C_BIQUAD_CHANNEL_COUNT ||
-           filter  >= TAS3001C_BIQUAD_FILTER_COUNT) return -EINVAL;
-
-       reg=( channel ? TAS3001C_REG_RIGHT_BIQUAD0 : TAS3001C_REG_LEFT_BIQUAD0 ) + filter;
-
-       biquad->coeff.b0=GET_4_20(shadow[reg], 0);
-       biquad->coeff.b1=GET_4_20(shadow[reg], 3);
-       biquad->coeff.b2=GET_4_20(shadow[reg], 6);
-       biquad->coeff.a1=GET_4_20(shadow[reg], 9);
-       biquad->coeff.a2=GET_4_20(shadow[reg],12);
-       
-       return 0;       
-}
-
-static int
-tas3001c_eq_rw(        struct tas3001c_data_t *self,
-               u_int cmd,
-               u_long arg)
-{
-       int rc;
-       struct tas_biquad_ctrl_t biquad;
-       void __user *argp = (void __user *)arg;
-
-       if (copy_from_user(&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
-               return -EFAULT;
-       }
-
-       if (cmd & SIOC_IN) {
-               rc=tas3001c_write_biquad(self, biquad.channel, biquad.filter, &biquad.data);
-               if (rc != 0) return rc;
-       }
-
-       if (cmd & SIOC_OUT) {
-               rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
-               if (rc != 0) return rc;
-
-               if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
-                       return -EFAULT;
-               }
-
-       }
-       return 0;
-}
-
-static int
-tas3001c_eq_list_rw(   struct tas3001c_data_t *self,
-                       u_int cmd,
-                       u_long arg)
-{
-       int rc;
-       int filter_count;
-       int flags;
-       int i,j;
-       char sync_required[2][6];
-       struct tas_biquad_ctrl_t biquad;
-       struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
-
-       memset(sync_required,0,sizeof(sync_required));
-
-       if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
-               return -EFAULT;
-
-       if (copy_from_user(&flags, &argp->flags, sizeof(int)))
-               return -EFAULT;
-
-       if (cmd & SIOC_IN) {
-       }
-
-       for (i=0; i < filter_count; i++) {
-               if (copy_from_user(&biquad, &argp->biquads[i],
-                                  sizeof(struct tas_biquad_ctrl_t))) {
-                       return -EFAULT;
-               }
-
-               if (cmd & SIOC_IN) {
-                       sync_required[biquad.channel][biquad.filter]=1;
-                       rc=tas3001c_write_biquad_shadow(self, biquad.channel, biquad.filter, &biquad.data);
-                       if (rc != 0) return rc;
-               }
-
-               if (cmd & SIOC_OUT) {
-                       rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
-                       if (rc != 0) return rc;
-
-                       if (copy_to_user(&argp->biquads[i], &biquad,
-                                        sizeof(struct tas_biquad_ctrl_t))) {
-                               return -EFAULT;
-                       }
-               }
-       }
-
-       if (cmd & SIOC_IN) {
-               if (flags & TAS_BIQUAD_FAST_LOAD) tas3001c_fast_load(self,1);
-               for (i=0; i<2; i++) {
-                       for (j=0; j<6; j++) {
-                               if (sync_required[i][j]) {
-                                       rc=tas3001c_sync_biquad(self, i, j);
-                                       if (rc < 0) return rc;
-                               }
-                       }
-               }
-               if (flags & TAS_BIQUAD_FAST_LOAD) {
-                       tas3001c_fast_load(self,0);
-                       /* now we need to set up the mixers again,
-                          because leaving fast mode resets them. */
-                       (void)tas3001c_sync_register(self,TAS3001C_REG_BASS);
-                       (void)tas3001c_sync_register(self,TAS3001C_REG_TREBLE);
-                       (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER1);
-                       (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER2);
-                       (void)tas3001c_sync_register(self,TAS3001C_REG_VOLUME);
-               }
-       }
-
-       return 0;
-}
-
-static int
-tas3001c_update_drce(  struct tas3001c_data_t *self,
-                       int flags,
-                       struct tas_drce_t *drce)
-{
-       tas_shadow_t *shadow;
-       shadow=self->super.shadow;
-
-       shadow[TAS3001C_REG_DRC][1] = 0xc1;
-
-       if (flags & TAS_DRCE_THRESHOLD) {
-               self->drce_state.threshold=quantize_db(drce->threshold);
-               shadow[TAS3001C_REG_DRC][2] = db_to_regval(self->drce_state.threshold);
-       }
-
-       if (flags & TAS_DRCE_ENABLE) {
-               self->drce_state.enable = drce->enable;
-       }
-
-       if (!self->drce_state.enable) {
-               shadow[TAS3001C_REG_DRC][0] = 0xf0;
-       }
-
-#ifdef DEBUG_DRCE
-       printk("DRCE IOCTL: set [ ENABLE:%x THRESH:%x\n",
-              self->drce_state.enable,
-              self->drce_state.threshold);
-
-       printk("DRCE IOCTL: reg [ %02x %02x ]\n",
-              (unsigned char)shadow[TAS3001C_REG_DRC][0],
-              (unsigned char)shadow[TAS3001C_REG_DRC][1]);
-#endif
-
-       return tas3001c_sync_register(self, TAS3001C_REG_DRC);
-}
-
-static int
-tas3001c_drce_rw(      struct tas3001c_data_t *self,
-                       u_int cmd,
-                       u_long arg)
-{
-       int rc;
-       struct tas_drce_ctrl_t drce_ctrl;
-       void __user *argp = (void __user *)arg;
-
-       if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
-               return -EFAULT;
-
-#ifdef DEBUG_DRCE
-       printk("DRCE IOCTL: input [ FLAGS:%x ENABLE:%x THRESH:%x\n",
-              drce_ctrl.flags,
-              drce_ctrl.data.enable,
-              drce_ctrl.data.threshold);
-#endif
-
-       if (cmd & SIOC_IN) {
-               rc = tas3001c_update_drce(self, drce_ctrl.flags, &drce_ctrl.data);
-               if (rc < 0)
-                       return rc;
-       }
-
-       if (cmd & SIOC_OUT) {
-               if (drce_ctrl.flags & TAS_DRCE_ENABLE)
-                       drce_ctrl.data.enable = self->drce_state.enable;
-
-               if (drce_ctrl.flags & TAS_DRCE_THRESHOLD)
-                       drce_ctrl.data.threshold = self->drce_state.threshold;
-
-               if (copy_to_user(argp, &drce_ctrl,
-                                sizeof(struct tas_drce_ctrl_t))) {
-                       return -EFAULT;
-               }
-       }
-
-       return 0;
-}
-
-static void
-tas3001c_update_device_parameters(struct tas3001c_data_t *self)
-{
-       int i,j;
-
-       if (!self) return;
-
-       if (self->output_id == TAS_OUTPUT_HEADPHONES) {
-               tas3001c_fast_load(self, 1);
-
-               for (i=0; i<TAS3001C_BIQUAD_CHANNEL_COUNT; i++) {
-                       for (j=0; j<TAS3001C_BIQUAD_FILTER_COUNT; j++) {
-                               tas3001c_write_biquad(self, i, j, &tas3001c_eq_unity);
-                       }
-               }
-
-               tas3001c_fast_load(self, 0);
-
-               (void)tas3001c_sync_register(self,TAS3001C_REG_BASS);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_TREBLE);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER1);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_MIXER2);
-               (void)tas3001c_sync_register(self,TAS3001C_REG_VOLUME);
-
-               return;
-       }
-
-       for (i=0; tas3001c_eq_prefs[i]; i++) {
-               struct tas_eq_pref_t *eq = tas3001c_eq_prefs[i];
-
-               if (eq->device_id == self->device_id &&
-                   (eq->output_id == 0 || eq->output_id == self->output_id) &&
-                   (eq->speaker_id == 0 || eq->speaker_id == self->speaker_id)) {
-
-                       tas3001c_update_drce(self, TAS_DRCE_ALL, eq->drce);
-                       tas3001c_write_biquad_list(self, eq->filter_count, TAS_BIQUAD_FAST_LOAD, eq->biquads);
-
-                       break;
-               }
-       }
-}
-
-static void
-tas3001c_device_change_handler(struct work_struct *work)
-{
-       struct tas3001c_data_t *self;
-       self = container_of(work, struct tas3001c_data_t, change);
-       tas3001c_update_device_parameters(self);
-}
-
-static int
-tas3001c_output_device_change( struct tas3001c_data_t *self,
-                               int device_id,
-                               int output_id,
-                               int speaker_id)
-{
-       self->device_id=device_id;
-       self->output_id=output_id;
-       self->speaker_id=speaker_id;
-
-       schedule_work(&self->change);
-       return 0;
-}
-
-static int
-tas3001c_device_ioctl( struct tas3001c_data_t *self,
-                       u_int cmd,
-                       u_long arg)
-{
-       uint __user *argp = (void __user *)arg;
-       switch (cmd) {
-       case TAS_READ_EQ:
-       case TAS_WRITE_EQ:
-               return tas3001c_eq_rw(self, cmd, arg);
-
-       case TAS_READ_EQ_LIST:
-       case TAS_WRITE_EQ_LIST:
-               return tas3001c_eq_list_rw(self, cmd, arg);
-
-       case TAS_READ_EQ_FILTER_COUNT:
-               put_user(TAS3001C_BIQUAD_FILTER_COUNT, argp);
-               return 0;
-
-       case TAS_READ_EQ_CHANNEL_COUNT:
-               put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, argp);
-               return 0;
-
-       case TAS_READ_DRCE:
-       case TAS_WRITE_DRCE:
-               return tas3001c_drce_rw(self, cmd, arg);
-
-       case TAS_READ_DRCE_CAPS:
-               put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, argp);
-               return 0;
-
-       case TAS_READ_DRCE_MIN:
-       case TAS_READ_DRCE_MAX: {
-               struct tas_drce_ctrl_t drce_ctrl;
-
-               if (copy_from_user(&drce_ctrl, argp,
-                                  sizeof(struct tas_drce_ctrl_t))) {
-                       return -EFAULT;
-               }
-
-               if (drce_ctrl.flags & TAS_DRCE_THRESHOLD) {
-                       if (cmd == TAS_READ_DRCE_MIN) {
-                               drce_ctrl.data.threshold=-36<<8;
-                       } else {
-                               drce_ctrl.data.threshold=-6<<8;
-                       }
-               }
-
-               if (copy_to_user(argp, &drce_ctrl,
-                                sizeof(struct tas_drce_ctrl_t))) {
-                       return -EFAULT;
-               }
-       }
-       }
-
-       return -EINVAL;
-}
-
-static int
-tas3001c_init_mixer(struct tas3001c_data_t *self)
-{
-       unsigned char mcr = (1<<6)+(2<<4)+(2<<2);
-
-       /* Make sure something answers on the i2c bus */
-       if (tas3001c_write_register(self, TAS3001C_REG_MCR, &mcr,
-           WRITE_NORMAL|FORCE_WRITE) < 0)
-               return -1;
-
-       tas3001c_fast_load(self, 1);
-
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD0);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD1);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD2);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD3);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD4);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD5);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_RIGHT_BIQUAD6);
-
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD0);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD1);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD2);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD3);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD4);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD5);
-       (void)tas3001c_sync_register(self,TAS3001C_REG_LEFT_BIQUAD6);
-
-       tas3001c_fast_load(self, 0);
-
-       tas3001c_set_mixer_level(self, SOUND_MIXER_VOLUME, VOL_DEFAULT<<8 | VOL_DEFAULT);
-       tas3001c_set_mixer_level(self, SOUND_MIXER_PCM, INPUT_DEFAULT<<8 | INPUT_DEFAULT);
-       tas3001c_set_mixer_level(self, SOUND_MIXER_ALTPCM, 0);
-
-       tas3001c_set_mixer_level(self, SOUND_MIXER_BASS, BASS_DEFAULT);
-       tas3001c_set_mixer_level(self, SOUND_MIXER_TREBLE, TREBLE_DEFAULT);
-
-       return 0;
-}
-
-static int
-tas3001c_uninit_mixer(struct tas3001c_data_t *self)
-{
-       tas3001c_set_mixer_level(self, SOUND_MIXER_VOLUME, 0);
-       tas3001c_set_mixer_level(self, SOUND_MIXER_PCM,    0);
-       tas3001c_set_mixer_level(self, SOUND_MIXER_ALTPCM, 0);
-
-       tas3001c_set_mixer_level(self, SOUND_MIXER_BASS,   0);
-       tas3001c_set_mixer_level(self, SOUND_MIXER_TREBLE, 0);
-
-       return 0;
-}
-
-static int
-tas3001c_init(struct i2c_client *client)
-{
-       struct tas3001c_data_t *self;
-       size_t sz = sizeof(*self) + (TAS3001C_REG_MAX*sizeof(tas_shadow_t));
-       int i, j;
-
-       self = kzalloc(sz, GFP_KERNEL);
-       if (!self)
-               return -ENOMEM;
-
-       self->super.client = client;
-       self->super.shadow = (tas_shadow_t *)(self+1);
-       self->output_id = TAS_OUTPUT_HEADPHONES;
-
-       dev_set_drvdata(&client->dev, self);
-
-       for (i = 0; i < TAS3001C_BIQUAD_CHANNEL_COUNT; i++)
-               for (j = 0; j < TAS3001C_BIQUAD_FILTER_COUNT; j++)
-                       tas3001c_write_biquad_shadow(self, i, j,
-                               &tas3001c_eq_unity);
-
-       INIT_WORK(&self->change, tas3001c_device_change_handler);
-       return 0;
-}
-
-static void
-tas3001c_uninit(struct tas3001c_data_t *self)
-{
-       tas3001c_uninit_mixer(self);
-       kfree(self);
-}
-
-struct tas_driver_hooks_t tas3001c_hooks = {
-       .init                   = (tas_hook_init_t)tas3001c_init,
-       .post_init              = (tas_hook_post_init_t)tas3001c_init_mixer,
-       .uninit                 = (tas_hook_uninit_t)tas3001c_uninit,
-       .get_mixer_level        = (tas_hook_get_mixer_level_t)tas3001c_get_mixer_level,
-       .set_mixer_level        = (tas_hook_set_mixer_level_t)tas3001c_set_mixer_level,
-       .enter_sleep            = (tas_hook_enter_sleep_t)tas3001c_enter_sleep,
-       .leave_sleep            = (tas_hook_leave_sleep_t)tas3001c_leave_sleep,
-       .supported_mixers       = (tas_hook_supported_mixers_t)tas3001c_supported_mixers,
-       .mixer_is_stereo        = (tas_hook_mixer_is_stereo_t)tas3001c_mixer_is_stereo,
-       .stereo_mixers          = (tas_hook_stereo_mixers_t)tas3001c_stereo_mixers,
-       .output_device_change   = (tas_hook_output_device_change_t)tas3001c_output_device_change,
-       .device_ioctl           = (tas_hook_device_ioctl_t)tas3001c_device_ioctl
-};
diff --git a/sound/oss/dmasound/tas3001c.h b/sound/oss/dmasound/tas3001c.h
deleted file mode 100644 (file)
index 3660da3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Header file for the i2c/i2s based TA3001c sound chip used
- * on some Apple hardware. Also known as "tumbler".
- *
- *  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.
- *
- * Written by Christopher C. Chimelis <chris@debian.org>
- */
-
-#ifndef _TAS3001C_H_
-#define _TAS3001C_H_
-
-#include <linux/types.h>
-
-#include "tas_common.h"
-#include "tas_eq_prefs.h"
-
-/*
- * Macros that correspond to the registers that we write to
- * when setting the various values.
- */
-
-#define TAS3001C_VERSION       "0.3"
-#define TAS3001C_DATE          "20011214"
-
-#define I2C_DRIVERNAME_TAS3001C "TAS3001c driver V " TAS3001C_VERSION
-#define I2C_DRIVERID_TAS3001C   (I2C_DRIVERID_TAS_BASE+0)
-
-extern  struct tas_driver_hooks_t tas3001c_hooks;
-extern struct tas_gain_t tas3001c_gain;
-extern struct tas_eq_pref_t *tas3001c_eq_prefs[];
-
-enum tas3001c_reg_t {
-  TAS3001C_REG_MCR                    = 0x01,
-  TAS3001C_REG_DRC                    = 0x02,
-
-  TAS3001C_REG_VOLUME                 = 0x04,
-  TAS3001C_REG_TREBLE                 = 0x05,
-  TAS3001C_REG_BASS                   = 0x06,
-  TAS3001C_REG_MIXER1                 = 0x07,
-  TAS3001C_REG_MIXER2                 = 0x08,
-
-  TAS3001C_REG_LEFT_BIQUAD0           = 0x0a,
-  TAS3001C_REG_LEFT_BIQUAD1           = 0x0b,
-  TAS3001C_REG_LEFT_BIQUAD2           = 0x0c,
-  TAS3001C_REG_LEFT_BIQUAD3           = 0x0d,
-  TAS3001C_REG_LEFT_BIQUAD4           = 0x0e,
-  TAS3001C_REG_LEFT_BIQUAD5           = 0x0f,
-  TAS3001C_REG_LEFT_BIQUAD6           = 0x10,
-  
-  TAS3001C_REG_RIGHT_BIQUAD0          = 0x13,
-  TAS3001C_REG_RIGHT_BIQUAD1          = 0x14,
-  TAS3001C_REG_RIGHT_BIQUAD2          = 0x15,
-  TAS3001C_REG_RIGHT_BIQUAD3          = 0x16,
-  TAS3001C_REG_RIGHT_BIQUAD4          = 0x17,
-  TAS3001C_REG_RIGHT_BIQUAD5          = 0x18,
-  TAS3001C_REG_RIGHT_BIQUAD6          = 0x19,
-
-  TAS3001C_REG_MAX                    = 0x20
-};
-
-#endif /* _TAS3001C_H_ */
diff --git a/sound/oss/dmasound/tas3001c_tables.c b/sound/oss/dmasound/tas3001c_tables.c
deleted file mode 100644 (file)
index 1768fa9..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-#include "tas_common.h"
-#include "tas_eq_prefs.h"
-
-static struct tas_drce_t eqp_0e_2_1_drce = {
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -15.33  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_0e_2_1_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
-};
-
-static struct tas_eq_pref_t eqp_0e_2_1 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x0e,
-  .output_id     = TAS_OUTPUT_EXTERNAL_SPKR,
-  .speaker_id    = 0x01,
-
-  .drce          = &eqp_0e_2_1_drce,
-
-  .filter_count  = 12,
-  .biquads       = eqp_0e_2_1_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_10_1_0_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -12.46  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_10_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0F4A12, 0xE16BDA, 0x0F4A12, 0xE173F0, 0x0E9C3A } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x02DD54, 0x05BAA8, 0x02DD54, 0xF8001D, 0x037532 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0E2FC7, 0xE4D5DC, 0x0D7477, 0xE4D5DC, 0x0BA43F } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0E7899, 0xE67CCA, 0x0D0E93, 0xE67CCA, 0x0B872D } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0F4A12, 0xE16BDA, 0x0F4A12, 0xE173F0, 0x0E9C3A } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x02DD54, 0x05BAA8, 0x02DD54, 0xF8001D, 0x037532 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0E2FC7, 0xE4D5DC, 0x0D7477, 0xE4D5DC, 0x0BA43F } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0E7899, 0xE67CCA, 0x0D0E93, 0xE67CCA, 0x0B872D } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-};
-
-static struct tas_eq_pref_t eqp_10_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x10,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_10_1_0_drce,
-
-  .filter_count  = 12,
-  .biquads       = eqp_10_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_15_2_1_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -15.33  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_15_2_1_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
-};
-
-static struct tas_eq_pref_t eqp_15_2_1 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x15,
-  .output_id     = TAS_OUTPUT_EXTERNAL_SPKR,
-  .speaker_id    = 0x01,
-
-  .drce          = &eqp_15_2_1_drce,
-
-  .filter_count  = 12,
-  .biquads       = eqp_15_2_1_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_15_1_0_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = 0.0     * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_15_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FAD08, 0xE0A5EF, 0x0FAD08, 0xE0A79D, 0x0F5BBE } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x04B38D, 0x09671B, 0x04B38D, 0x000F71, 0x02BEC5 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FDD32, 0xE0A56F, 0x0F8A69, 0xE0A56F, 0x0F679C } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0FD284, 0xE135FB, 0x0F2161, 0xE135FB, 0x0EF3E5 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0E81B1, 0xE6283F, 0x0CE49D, 0xE6283F, 0x0B664F } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0F2D62, 0xE98797, 0x0D1E19, 0xE98797, 0x0C4B7B } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FAD08, 0xE0A5EF, 0x0FAD08, 0xE0A79D, 0x0F5BBE } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x04B38D, 0x09671B, 0x04B38D, 0x000F71, 0x02BEC5 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FDD32, 0xE0A56F, 0x0F8A69, 0xE0A56F, 0x0F679C } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0FD284, 0xE135FB, 0x0F2161, 0xE135FB, 0x0EF3E5 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0E81B1, 0xE6283F, 0x0CE49D, 0xE6283F, 0x0B664F } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0F2D62, 0xE98797, 0x0D1E19, 0xE98797, 0x0C4B7B } } },
-};
-
-static struct tas_eq_pref_t eqp_15_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x15,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_15_1_0_drce,
-
-  .filter_count  = 12,
-  .biquads       = eqp_15_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_0f_2_1_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -15.33  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_0f_2_1_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FE143, 0xE05204, 0x0FCCC5, 0xE05266, 0x0FAE6B } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x102383, 0xE03A03, 0x0FA325, 0xE03A03, 0x0FC6A8 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FF2AB, 0xE06285, 0x0FB20A, 0xE06285, 0x0FA4B5 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F544D, 0xE35971, 0x0D8F3A, 0xE35971, 0x0CE388 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x13E1D3, 0xF3ECB5, 0x042227, 0xF3ECB5, 0x0803FA } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0AC119, 0x034181, 0x078AB1, 0x034181, 0x024BCA } } },
-};
-
-static struct tas_eq_pref_t eqp_0f_2_1 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x0f,
-  .output_id     = TAS_OUTPUT_EXTERNAL_SPKR,
-  .speaker_id    = 0x01,
-
-  .drce          = &eqp_0f_2_1_drce,
-
-  .filter_count  = 12,
-  .biquads       = eqp_0f_2_1_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_0f_1_0_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -15.33  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_0f_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0FCAD3, 0xE06A58, 0x0FCAD3, 0xE06B09, 0x0F9657 } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x041731, 0x082E63, 0x041731, 0xFD8D08, 0x02CFBD } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0FFDC7, 0xE0524C, 0x0FBFAA, 0xE0524C, 0x0FBD72 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0F3D35, 0xE228CA, 0x0EC7B2, 0xE228CA, 0x0E04E8 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0FCEBF, 0xE181C2, 0x0F2656, 0xE181C2, 0x0EF516 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0EC417, 0x073E22, 0x0B0633, 0x073E22, 0x09CA4A } } },
-};
-
-static struct tas_eq_pref_t eqp_0f_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x0f,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_0f_1_0_drce,
-
-  .filter_count  = 12,
-  .biquads       = eqp_0f_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static uint tas3001c_master_tab[]={
-              0x0,       0x75,       0x9c,       0xbb,
-             0xdb,       0xfb,      0x11e,      0x143,
-            0x16b,      0x196,      0x1c3,      0x1f5,
-            0x229,      0x263,      0x29f,      0x2e1,
-            0x328,      0x373,      0x3c5,      0x41b,
-            0x478,      0x4dc,      0x547,      0x5b8,
-            0x633,      0x6b5,      0x740,      0x7d5,
-            0x873,      0x91c,      0x9d2,      0xa92,
-            0xb5e,      0xc39,      0xd22,      0xe19,
-            0xf20,     0x1037,     0x1161,     0x129e,
-           0x13ed,     0x1551,     0x16ca,     0x185d,
-           0x1a08,     0x1bcc,     0x1dac,     0x1fa7,
-           0x21c1,     0x23fa,     0x2655,     0x28d6,
-           0x2b7c,     0x2e4a,     0x3141,     0x3464,
-           0x37b4,     0x3b35,     0x3ee9,     0x42d3,
-           0x46f6,     0x4b53,     0x4ff0,     0x54ce,
-           0x59f2,     0x5f5f,     0x6519,     0x6b24,
-           0x7183,     0x783c,     0x7f53,     0x86cc,
-           0x8ead,     0x96fa,     0x9fba,     0xa8f2,
-           0xb2a7,     0xbce1,     0xc7a5,     0xd2fa,
-           0xdee8,     0xeb75,     0xf8aa,    0x1068e,
-          0x1152a,    0x12487,    0x134ad,    0x145a5,
-          0x1577b,    0x16a37,    0x17df5,    0x192bd,
-          0x1a890,    0x1bf7b,    0x1d78d,    0x1f0d1,
-          0x20b55,    0x22727,    0x24456,    0x262f2,
-          0x2830b
-};
-
-static uint tas3001c_mixer_tab[]={
-              0x0,      0x748,      0x9be,      0xbaf,
-            0xda4,      0xfb1,     0x11de,     0x1431,
-           0x16ad,     0x1959,     0x1c37,     0x1f4b,
-           0x2298,     0x2628,     0x29fb,     0x2e12,
-           0x327d,     0x3734,     0x3c47,     0x41b4,
-           0x4787,     0x4dbe,     0x546d,     0x5b86,
-           0x632e,     0x6b52,     0x7400,     0x7d54,
-           0x873b,     0x91c6,     0x9d1a,     0xa920,
-           0xb5e5,     0xc38c,     0xd21b,     0xe18f,
-           0xf1f5,    0x1036a,    0x1160f,    0x129d6,
-          0x13ed0,    0x1550c,    0x16ca0,    0x185c9,
-          0x1a07b,    0x1bcc3,    0x1dab9,    0x1fa75,
-          0x21c0f,    0x23fa3,    0x26552,    0x28d64,
-          0x2b7c9,    0x2e4a2,    0x31411,    0x3463b,
-          0x37b44,    0x3b353,    0x3ee94,    0x42d30,
-          0x46f55,    0x4b533,    0x4fefc,    0x54ce5,
-          0x59f25,    0x5f5f6,    0x65193,    0x6b23c,
-          0x71835,    0x783c3,    0x7f52c,    0x86cc0,
-          0x8eacc,    0x96fa5,    0x9fba0,    0xa8f1a,
-          0xb2a71,    0xbce0a,    0xc7a4a,    0xd2fa0,
-          0xdee7b,    0xeb752,    0xf8a9f,   0x1068e4,
-         0x1152a3,   0x12486a,   0x134ac8,   0x145a55,
-         0x1577ac,   0x16a370,   0x17df51,   0x192bc2,
-         0x1a88f8,   0x1bf7b7,   0x1d78c9,   0x1f0d04,
-         0x20b542,   0x227268,   0x244564,   0x262f26,
-         0x2830af
-};
-
-static uint tas3001c_treble_tab[]={
-             0x96,       0x95,       0x95,       0x94,
-             0x93,       0x92,       0x92,       0x91,
-             0x90,       0x90,       0x8f,       0x8e,
-             0x8d,       0x8d,       0x8c,       0x8b,
-             0x8a,       0x8a,       0x89,       0x88,
-             0x88,       0x87,       0x86,       0x85,
-             0x85,       0x84,       0x83,       0x83,
-             0x82,       0x81,       0x80,       0x80,
-             0x7f,       0x7e,       0x7e,       0x7d,
-             0x7c,       0x7b,       0x7b,       0x7a,
-             0x79,       0x78,       0x78,       0x77,
-             0x76,       0x76,       0x75,       0x74,
-             0x73,       0x73,       0x72,       0x71,
-             0x71,       0x70,       0x6e,       0x6d,
-             0x6d,       0x6c,       0x6b,       0x6a,
-             0x69,       0x68,       0x67,       0x66,
-             0x65,       0x63,       0x62,       0x62,
-             0x60,       0x5f,       0x5d,       0x5c,
-             0x5a,       0x58,       0x56,       0x55,
-             0x53,       0x51,       0x4f,       0x4c,
-             0x4a,       0x48,       0x45,       0x43,
-             0x40,       0x3d,       0x3a,       0x37,
-             0x35,       0x32,       0x2e,       0x2a,
-             0x27,       0x22,       0x1e,       0x1a,
-             0x15,       0x11,        0xc,        0x7,
-              0x1
-};
-
-static uint tas3001c_bass_tab[]={
-             0x86,       0x83,       0x81,       0x7f,
-             0x7d,       0x7b,       0x79,       0x78,
-             0x76,       0x75,       0x74,       0x72,
-             0x71,       0x6f,       0x6e,       0x6d,
-             0x6c,       0x6b,       0x69,       0x67,
-             0x65,       0x64,       0x61,       0x60,
-             0x5e,       0x5d,       0x5c,       0x5b,
-             0x5a,       0x59,       0x58,       0x57,
-             0x56,       0x55,       0x55,       0x54,
-             0x53,       0x52,       0x50,       0x4f,
-             0x4d,       0x4c,       0x4b,       0x49,
-             0x47,       0x45,       0x44,       0x42,
-             0x41,       0x3f,       0x3e,       0x3d,
-             0x3c,       0x3b,       0x39,       0x38,
-             0x37,       0x36,       0x35,       0x34,
-             0x33,       0x31,       0x30,       0x2f,
-             0x2e,       0x2c,       0x2b,       0x2b,
-             0x29,       0x28,       0x27,       0x26,
-             0x25,       0x24,       0x22,       0x21,
-             0x20,       0x1e,       0x1c,       0x19,
-             0x18,       0x18,       0x17,       0x16,
-             0x15,       0x14,       0x13,       0x12,
-             0x11,       0x10,        0xf,        0xe,
-              0xd,        0xb,        0xa,        0x9,
-              0x8,        0x6,        0x4,        0x2,
-              0x1
-};
-
-struct tas_gain_t tas3001c_gain = {
-  .master  = tas3001c_master_tab,
-  .treble  = tas3001c_treble_tab,
-  .bass    = tas3001c_bass_tab,
-  .mixer   = tas3001c_mixer_tab
-};
-
-struct tas_eq_pref_t *tas3001c_eq_prefs[]={
-  &eqp_0e_2_1,
-  &eqp_10_1_0,
-  &eqp_15_2_1,
-  &eqp_15_1_0,
-  &eqp_0f_2_1,
-  &eqp_0f_1_0,
-  NULL
-};
diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
deleted file mode 100644 (file)
index 678bf0f..0000000
+++ /dev/null
@@ -1,1138 +0,0 @@
-/*
- * Driver for the i2c/i2s based TA3004 sound chip used
- * on some Apple hardware. Also known as "snapper".
- *
- * Tobias Sargeant <tobias.sargeant@bigpond.com>
- * Based upon tas3001c.c by Christopher C. Chimelis <chris@debian.org>:
- *
- * Input support by Renzo Davoli <renzo@cs.unibo.it>
- *
- */
-
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/ioport.h>
-#include <linux/sysctl.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <linux/init.h>
-#include <linux/soundcard.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
-
-#include <asm/uaccess.h>
-#include <asm/errno.h>
-#include <asm/io.h>
-#include <asm/prom.h>
-
-#include "dmasound.h"
-#include "tas_common.h"
-#include "tas3004.h"
-
-#include "tas_ioctl.h"
-
-/* #define DEBUG_DRCE */
-
-#define TAS3004_BIQUAD_FILTER_COUNT  7
-#define TAS3004_BIQUAD_CHANNEL_COUNT 2
-
-#define VOL_DEFAULT    (100 * 4 / 5)
-#define INPUT_DEFAULT  (100 * 4 / 5)
-#define BASS_DEFAULT   (100 / 2)
-#define TREBLE_DEFAULT (100 / 2)
-
-struct tas3004_data_t {
-       struct tas_data_t super;
-       int device_id;
-       int output_id;
-       int speaker_id;
-       struct tas_drce_t drce_state;
-       struct work_struct change;
-};
-
-#define MAKE_TIME(sec,usec) (((sec)<<12) + (50000+(usec/10)*(1<<12))/100000)
-
-#define MAKE_RATIO(i,f) (((i)<<8) + ((500+(f)*(1<<8))/1000))
-
-
-static const union tas_biquad_t tas3004_eq_unity = {
-       .buf             = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 },
-};
-
-
-static const struct tas_drce_t tas3004_drce_min = {
-       .enable         = 1,
-       .above          = { .val = MAKE_RATIO(16,0), .expand = 0 },
-       .below          = { .val = MAKE_RATIO(2,0), .expand = 0 },
-       .threshold      = -0x59a0,
-       .energy         = MAKE_TIME(0,  1700),
-       .attack         = MAKE_TIME(0,  1700),
-       .decay          = MAKE_TIME(0,  1700),
-};
-
-
-static const struct tas_drce_t tas3004_drce_max = {
-       .enable         = 1,
-       .above          = { .val = MAKE_RATIO(1,500), .expand = 1 },
-       .below          = { .val = MAKE_RATIO(2,0), .expand = 1 },
-       .threshold      = -0x0,
-       .energy         = MAKE_TIME(2,400000),
-       .attack         = MAKE_TIME(2,400000),
-       .decay          = MAKE_TIME(2,400000),
-};
-
-
-static const unsigned short time_constants[]={
-       MAKE_TIME(0,  1700),
-       MAKE_TIME(0,  3500),
-       MAKE_TIME(0,  6700),
-       MAKE_TIME(0, 13000),
-       MAKE_TIME(0, 26000),
-       MAKE_TIME(0, 53000),
-       MAKE_TIME(0,106000),
-       MAKE_TIME(0,212000),
-       MAKE_TIME(0,425000),
-       MAKE_TIME(0,850000),
-       MAKE_TIME(1,700000),
-       MAKE_TIME(2,400000),
-};
-
-static const unsigned short above_threshold_compression_ratio[]={
-       MAKE_RATIO( 1, 70),
-       MAKE_RATIO( 1,140),
-       MAKE_RATIO( 1,230),
-       MAKE_RATIO( 1,330),
-       MAKE_RATIO( 1,450),
-       MAKE_RATIO( 1,600),
-       MAKE_RATIO( 1,780),
-       MAKE_RATIO( 2,  0),
-       MAKE_RATIO( 2,290),
-       MAKE_RATIO( 2,670),
-       MAKE_RATIO( 3,200),
-       MAKE_RATIO( 4,  0),
-       MAKE_RATIO( 5,330),
-       MAKE_RATIO( 8,  0),
-       MAKE_RATIO(16,  0),
-};
-
-static const unsigned short above_threshold_expansion_ratio[]={
-       MAKE_RATIO(1, 60),
-       MAKE_RATIO(1,130),
-       MAKE_RATIO(1,190),
-       MAKE_RATIO(1,250),
-       MAKE_RATIO(1,310),
-       MAKE_RATIO(1,380),
-       MAKE_RATIO(1,440),
-       MAKE_RATIO(1,500)
-};
-
-static const unsigned short below_threshold_compression_ratio[]={
-       MAKE_RATIO(1, 70),
-       MAKE_RATIO(1,140),
-       MAKE_RATIO(1,230),
-       MAKE_RATIO(1,330),
-       MAKE_RATIO(1,450),
-       MAKE_RATIO(1,600),
-       MAKE_RATIO(1,780),
-       MAKE_RATIO(2,  0)
-};
-
-static const unsigned short below_threshold_expansion_ratio[]={
-       MAKE_RATIO(1, 60),
-       MAKE_RATIO(1,130),
-       MAKE_RATIO(1,190),
-       MAKE_RATIO(1,250),
-       MAKE_RATIO(1,310),
-       MAKE_RATIO(1,380),
-       MAKE_RATIO(1,440),
-       MAKE_RATIO(1,500),
-       MAKE_RATIO(1,560),
-       MAKE_RATIO(1,630),
-       MAKE_RATIO(1,690),
-       MAKE_RATIO(1,750),
-       MAKE_RATIO(1,810),
-       MAKE_RATIO(1,880),
-       MAKE_RATIO(1,940),
-       MAKE_RATIO(2,  0)
-};
-
-static inline int
-search(        unsigned short val,
-       const unsigned short *arr,
-       const int arrsize) {
-       /*
-        * This could be a binary search, but for small tables,
-        * a linear search is likely to be faster
-        */
-
-       int i;
-
-       for (i=0; i < arrsize; i++)
-               if (arr[i] >= val)
-                       goto _1;
-       return arrsize-1;
- _1:
-       if (i == 0)
-               return 0;
-       return (arr[i]-val < val-arr[i-1]) ? i : i-1;
-}
-
-#define SEARCH(a, b) search(a, b, ARRAY_SIZE(b))
-
-static inline int
-time_index(unsigned short time)
-{
-       return SEARCH(time, time_constants);
-}
-
-
-static inline int
-above_threshold_compression_index(unsigned short ratio)
-{
-       return SEARCH(ratio, above_threshold_compression_ratio);
-}
-
-
-static inline int
-above_threshold_expansion_index(unsigned short ratio)
-{
-       return SEARCH(ratio, above_threshold_expansion_ratio);
-}
-
-
-static inline int
-below_threshold_compression_index(unsigned short ratio)
-{
-       return SEARCH(ratio, below_threshold_compression_ratio);
-}
-
-
-static inline int
-below_threshold_expansion_index(unsigned short ratio)
-{
-       return SEARCH(ratio, below_threshold_expansion_ratio);
-}
-
-static inline unsigned char db_to_regval(short db) {
-       int r=0;
-
-       r=(db+0x59a0) / 0x60;
-
-       if (r < 0x91) return 0x91;
-       if (r > 0xef) return 0xef;
-       return r;
-}
-
-static inline short quantize_db(short db)
-{
-       return db_to_regval(db) * 0x60 - 0x59a0;
-}
-
-static inline int
-register_width(enum tas3004_reg_t r)
-{
-       switch(r) {
-       case TAS3004_REG_MCR:
-       case TAS3004_REG_TREBLE:
-       case TAS3004_REG_BASS:
-       case TAS3004_REG_ANALOG_CTRL:
-       case TAS3004_REG_TEST1:
-       case TAS3004_REG_TEST2:
-       case TAS3004_REG_MCR2:
-               return 1;
-
-       case TAS3004_REG_LEFT_LOUD_BIQUAD_GAIN:
-       case TAS3004_REG_RIGHT_LOUD_BIQUAD_GAIN:
-               return 3;
-
-       case TAS3004_REG_DRC:
-       case TAS3004_REG_VOLUME:
-               return 6;
-
-       case TAS3004_REG_LEFT_MIXER:
-       case TAS3004_REG_RIGHT_MIXER:
-               return 9;
-
-       case TAS3004_REG_TEST:
-               return 10;
-
-       case TAS3004_REG_LEFT_BIQUAD0:
-       case TAS3004_REG_LEFT_BIQUAD1:
-       case TAS3004_REG_LEFT_BIQUAD2:
-       case TAS3004_REG_LEFT_BIQUAD3:
-       case TAS3004_REG_LEFT_BIQUAD4:
-       case TAS3004_REG_LEFT_BIQUAD5:
-       case TAS3004_REG_LEFT_BIQUAD6:
-
-       case TAS3004_REG_RIGHT_BIQUAD0:
-       case TAS3004_REG_RIGHT_BIQUAD1:
-       case TAS3004_REG_RIGHT_BIQUAD2:
-       case TAS3004_REG_RIGHT_BIQUAD3:
-       case TAS3004_REG_RIGHT_BIQUAD4:
-       case TAS3004_REG_RIGHT_BIQUAD5:
-       case TAS3004_REG_RIGHT_BIQUAD6:
-
-       case TAS3004_REG_LEFT_LOUD_BIQUAD:
-       case TAS3004_REG_RIGHT_LOUD_BIQUAD:
-               return 15;
-
-       default:
-               return 0;
-       }
-}
-
-static int
-tas3004_write_register(        struct tas3004_data_t *self,
-                       enum tas3004_reg_t reg_num,
-                       char *data,
-                       uint write_mode)
-{
-       if (reg_num==TAS3004_REG_MCR ||
-           reg_num==TAS3004_REG_BASS ||
-           reg_num==TAS3004_REG_TREBLE ||
-           reg_num==TAS3004_REG_ANALOG_CTRL) {
-               return tas_write_byte_register(&self->super,
-                                              (uint)reg_num,
-                                              *data,
-                                              write_mode);
-       } else {
-               return tas_write_register(&self->super,
-                                         (uint)reg_num,
-                                         register_width(reg_num),
-                                         data,
-                                         write_mode);
-       }
-}
-
-static int
-tas3004_sync_register( struct tas3004_data_t *self,
-                       enum tas3004_reg_t reg_num)
-{
-       if (reg_num==TAS3004_REG_MCR ||
-           reg_num==TAS3004_REG_BASS ||
-           reg_num==TAS3004_REG_TREBLE ||
-           reg_num==TAS3004_REG_ANALOG_CTRL) {
-               return tas_sync_byte_register(&self->super,
-                                             (uint)reg_num,
-                                             register_width(reg_num));
-       } else {
-               return tas_sync_register(&self->super,
-                                        (uint)reg_num,
-                                        register_width(reg_num));
-       }
-}
-
-static int
-tas3004_read_register( struct tas3004_data_t *self,
-                       enum tas3004_reg_t reg_num,
-                       char *data,
-                       uint write_mode)
-{
-       return tas_read_register(&self->super,
-                                (uint)reg_num,
-                                register_width(reg_num),
-                                data);
-}
-
-static inline int
-tas3004_fast_load(struct tas3004_data_t *self, int fast)
-{
-       if (fast)
-               self->super.shadow[TAS3004_REG_MCR][0] |= 0x80;
-       else
-               self->super.shadow[TAS3004_REG_MCR][0] &= 0x7f;
-       return tas3004_sync_register(self,TAS3004_REG_MCR);
-}
-
-static uint
-tas3004_supported_mixers(struct tas3004_data_t *self)
-{
-       return SOUND_MASK_VOLUME |
-               SOUND_MASK_PCM |
-               SOUND_MASK_ALTPCM |
-               SOUND_MASK_IMIX |
-               SOUND_MASK_TREBLE |
-               SOUND_MASK_BASS |
-               SOUND_MASK_MIC |
-               SOUND_MASK_LINE;
-}
-
-static int
-tas3004_mixer_is_stereo(struct tas3004_data_t *self, int mixer)
-{
-       switch(mixer) {
-       case SOUND_MIXER_VOLUME:
-       case SOUND_MIXER_PCM:
-       case SOUND_MIXER_ALTPCM:
-       case SOUND_MIXER_IMIX:
-               return 1;
-       default:
-               return 0;
-       }
-}
-
-static uint
-tas3004_stereo_mixers(struct tas3004_data_t *self)
-{
-       uint r = tas3004_supported_mixers(self);
-       uint i;
-       
-       for (i=1; i<SOUND_MIXER_NRDEVICES; i++)
-               if (r&(1<<i) && !tas3004_mixer_is_stereo(self,i))
-                       r &= ~(1<<i);
-       return r;
-}
-
-static int
-tas3004_get_mixer_level(struct tas3004_data_t *self, int mixer, uint *level)
-{
-       if (!self)
-               return -1;
-
-       *level = self->super.mixer[mixer];
-
-       return 0;
-}
-
-static int
-tas3004_set_mixer_level(struct tas3004_data_t *self, int mixer, uint level)
-{
-       int rc;
-       tas_shadow_t *shadow;
-       uint temp;
-       uint offset=0;
-
-       if (!self)
-               return -1;
-
-       shadow = self->super.shadow;
-
-       if (!tas3004_mixer_is_stereo(self,mixer))
-               level = tas_mono_to_stereo(level);
-       switch(mixer) {
-       case SOUND_MIXER_VOLUME:
-               temp = tas3004_gain.master[level&0xff];
-               SET_4_20(shadow[TAS3004_REG_VOLUME], 0, temp);
-               temp = tas3004_gain.master[(level>>8)&0xff];
-               SET_4_20(shadow[TAS3004_REG_VOLUME], 3, temp);
-               rc = tas3004_sync_register(self,TAS3004_REG_VOLUME);
-               break;
-       case SOUND_MIXER_IMIX:
-               offset += 3;
-       case SOUND_MIXER_ALTPCM:
-               offset += 3;
-       case SOUND_MIXER_PCM:
-               /*
-                * Don't load these in fast mode. The documentation
-                * says it can be done in either mode, but testing it
-                * shows that fast mode produces ugly clicking.
-               */
-               /* tas3004_fast_load(self,1); */
-               temp = tas3004_gain.mixer[level&0xff];
-               SET_4_20(shadow[TAS3004_REG_LEFT_MIXER], offset, temp);
-               temp = tas3004_gain.mixer[(level>>8)&0xff];
-               SET_4_20(shadow[TAS3004_REG_RIGHT_MIXER], offset, temp);
-               rc = tas3004_sync_register(self,TAS3004_REG_LEFT_MIXER);
-               if (rc == 0)
-                       rc=tas3004_sync_register(self,TAS3004_REG_RIGHT_MIXER);
-               /* tas3004_fast_load(self,0); */
-               break;
-       case SOUND_MIXER_TREBLE:
-               temp = tas3004_gain.treble[level&0xff];
-               shadow[TAS3004_REG_TREBLE][0]=temp&0xff;
-               rc = tas3004_sync_register(self,TAS3004_REG_TREBLE);
-               break;
-       case SOUND_MIXER_BASS:
-               temp = tas3004_gain.bass[level&0xff];
-               shadow[TAS3004_REG_BASS][0]=temp&0xff;
-               rc = tas3004_sync_register(self,TAS3004_REG_BASS);
-               break;
-       case SOUND_MIXER_MIC:
-               if ((level&0xff)>0) {
-                       software_input_volume = SW_INPUT_VOLUME_SCALE * (level&0xff);
-                       if (self->super.mixer[mixer] == 0) {
-                               self->super.mixer[SOUND_MIXER_LINE] = 0;
-                               shadow[TAS3004_REG_ANALOG_CTRL][0]=0xc2;
-                               rc = tas3004_sync_register(self,TAS3004_REG_ANALOG_CTRL);
-                       } else rc=0;
-               } else {
-                       self->super.mixer[SOUND_MIXER_LINE] = SW_INPUT_VOLUME_DEFAULT;
-                       software_input_volume = SW_INPUT_VOLUME_SCALE *
-                               (self->super.mixer[SOUND_MIXER_LINE]&0xff);
-                       shadow[TAS3004_REG_ANALOG_CTRL][0]=0x00;
-                       rc = tas3004_sync_register(self,TAS3004_REG_ANALOG_CTRL);
-               }
-               break;
-       case SOUND_MIXER_LINE:
-               if (self->super.mixer[SOUND_MIXER_MIC] == 0) {
-                       software_input_volume = SW_INPUT_VOLUME_SCALE * (level&0xff);
-                       rc=0;
-               }
-               break;
-       default:
-               rc = -1;
-               break;
-       }
-       if (rc < 0)
-               return rc;
-       self->super.mixer[mixer] = level;
-       
-       return 0;
-}
-
-static int
-tas3004_leave_sleep(struct tas3004_data_t *self)
-{
-       unsigned char mcr = (1<<6)+(2<<4)+(2<<2);
-
-       if (!self)
-               return -1;
-
-       /* Make sure something answers on the i2c bus */
-       if (tas3004_write_register(self, TAS3004_REG_MCR, &mcr,
-           WRITE_NORMAL | FORCE_WRITE) < 0)
-               return -1;
-
-       tas3004_fast_load(self, 1);
-
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD0);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD1);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD2);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD3);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD4);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD5);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD6);
-
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD0);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD1);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD2);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD3);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD4);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD5);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD6);
-
-       tas3004_fast_load(self, 0);
-
-       (void)tas3004_sync_register(self,TAS3004_REG_VOLUME);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_MIXER);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_MIXER);
-       (void)tas3004_sync_register(self,TAS3004_REG_TREBLE);
-       (void)tas3004_sync_register(self,TAS3004_REG_BASS);
-       (void)tas3004_sync_register(self,TAS3004_REG_ANALOG_CTRL);
-
-       return 0;
-}
-
-static int
-tas3004_enter_sleep(struct tas3004_data_t *self)
-{
-       if (!self)
-               return -1; 
-       return 0;
-}
-
-static int
-tas3004_sync_biquad(   struct tas3004_data_t *self,
-                       u_int channel,
-                       u_int filter)
-{
-       enum tas3004_reg_t reg;
-
-       if (channel >= TAS3004_BIQUAD_CHANNEL_COUNT ||
-           filter  >= TAS3004_BIQUAD_FILTER_COUNT) return -EINVAL;
-
-       reg=( channel ? TAS3004_REG_RIGHT_BIQUAD0 : TAS3004_REG_LEFT_BIQUAD0 ) + filter;
-
-       return tas3004_sync_register(self,reg);
-}
-
-static int
-tas3004_write_biquad_shadow(   struct tas3004_data_t *self,
-                               u_int channel,
-                               u_int filter,
-                               const union tas_biquad_t *biquad)
-{
-       tas_shadow_t *shadow=self->super.shadow;
-       enum tas3004_reg_t reg;
-
-       if (channel >= TAS3004_BIQUAD_CHANNEL_COUNT ||
-           filter  >= TAS3004_BIQUAD_FILTER_COUNT) return -EINVAL;
-
-       reg=( channel ? TAS3004_REG_RIGHT_BIQUAD0 : TAS3004_REG_LEFT_BIQUAD0 ) + filter;
-
-       SET_4_20(shadow[reg], 0,biquad->coeff.b0);
-       SET_4_20(shadow[reg], 3,biquad->coeff.b1);
-       SET_4_20(shadow[reg], 6,biquad->coeff.b2);
-       SET_4_20(shadow[reg], 9,biquad->coeff.a1);
-       SET_4_20(shadow[reg],12,biquad->coeff.a2);
-
-       return 0;
-}
-
-static int
-tas3004_write_biquad(  struct tas3004_data_t *self,
-                       u_int channel,
-                       u_int filter,
-                       const union tas_biquad_t *biquad)
-{
-       int rc;
-
-       rc=tas3004_write_biquad_shadow(self, channel, filter, biquad);
-       if (rc < 0) return rc;
-
-       return tas3004_sync_biquad(self, channel, filter);
-}
-
-static int
-tas3004_write_biquad_list(     struct tas3004_data_t *self,
-                               u_int filter_count,
-                               u_int flags,
-                               struct tas_biquad_ctrl_t *biquads)
-{
-       int i;
-       int rc;
-
-       if (flags & TAS_BIQUAD_FAST_LOAD) tas3004_fast_load(self,1);
-
-       for (i=0; i<filter_count; i++) {
-               rc=tas3004_write_biquad(self,
-                                       biquads[i].channel,
-                                       biquads[i].filter,
-                                       &biquads[i].data);
-               if (rc < 0) break;
-       }
-
-       if (flags & TAS_BIQUAD_FAST_LOAD) tas3004_fast_load(self,0);
-
-       return rc;
-}
-
-static int
-tas3004_read_biquad(   struct tas3004_data_t *self,
-                       u_int channel,
-                       u_int filter,
-                       union tas_biquad_t *biquad)
-{
-       tas_shadow_t *shadow=self->super.shadow;
-       enum tas3004_reg_t reg;
-
-       if (channel >= TAS3004_BIQUAD_CHANNEL_COUNT ||
-           filter  >= TAS3004_BIQUAD_FILTER_COUNT) return -EINVAL;
-
-       reg=( channel ? TAS3004_REG_RIGHT_BIQUAD0 : TAS3004_REG_LEFT_BIQUAD0 ) + filter;
-
-       biquad->coeff.b0=GET_4_20(shadow[reg], 0);
-       biquad->coeff.b1=GET_4_20(shadow[reg], 3);
-       biquad->coeff.b2=GET_4_20(shadow[reg], 6);
-       biquad->coeff.a1=GET_4_20(shadow[reg], 9);
-       biquad->coeff.a2=GET_4_20(shadow[reg],12);
-       
-       return 0;       
-}
-
-static int
-tas3004_eq_rw( struct tas3004_data_t *self,
-               u_int cmd,
-               u_long arg)
-{
-       void __user *argp = (void __user *)arg;
-       int rc;
-       struct tas_biquad_ctrl_t biquad;
-
-       if (copy_from_user((void *)&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
-               return -EFAULT;
-       }
-
-       if (cmd & SIOC_IN) {
-               rc=tas3004_write_biquad(self, biquad.channel, biquad.filter, &biquad.data);
-               if (rc != 0) return rc;
-       }
-
-       if (cmd & SIOC_OUT) {
-               rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
-               if (rc != 0) return rc;
-
-               if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
-                       return -EFAULT;
-               }
-
-       }
-       return 0;
-}
-
-static int
-tas3004_eq_list_rw(    struct tas3004_data_t *self,
-                       u_int cmd,
-                       u_long arg)
-{
-       int rc = 0;
-       int filter_count;
-       int flags;
-       int i,j;
-       char sync_required[TAS3004_BIQUAD_CHANNEL_COUNT][TAS3004_BIQUAD_FILTER_COUNT];
-       struct tas_biquad_ctrl_t biquad;
-       struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
-
-       memset(sync_required,0,sizeof(sync_required));
-
-       if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
-               return -EFAULT;
-
-       if (copy_from_user(&flags, &argp->flags, sizeof(int)))
-               return -EFAULT;
-
-       if (cmd & SIOC_IN) {
-       }
-
-       for (i=0; i < filter_count; i++) {
-               if (copy_from_user(&biquad, &argp->biquads[i],
-                                  sizeof(struct tas_biquad_ctrl_t))) {
-                       return -EFAULT;
-               }
-
-               if (cmd & SIOC_IN) {
-                       sync_required[biquad.channel][biquad.filter]=1;
-                       rc=tas3004_write_biquad_shadow(self, biquad.channel, biquad.filter, &biquad.data);
-                       if (rc != 0) return rc;
-               }
-
-               if (cmd & SIOC_OUT) {
-                       rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
-                       if (rc != 0) return rc;
-
-                       if (copy_to_user(&argp->biquads[i], &biquad,
-                                        sizeof(struct tas_biquad_ctrl_t))) {
-                               return -EFAULT;
-                       }
-               }
-       }
-
-       if (cmd & SIOC_IN) {
-               /*
-                * This is OK for the tas3004. For the
-                * tas3001c, going into fast load mode causes
-                * the treble and bass to be reset to 0dB, and
-                * volume controls to be muted.
-                */
-               if (flags & TAS_BIQUAD_FAST_LOAD) tas3004_fast_load(self,1);
-               for (i=0; i<TAS3004_BIQUAD_CHANNEL_COUNT; i++) {
-                       for (j=0; j<TAS3004_BIQUAD_FILTER_COUNT; j++) {
-                               if (sync_required[i][j]) {
-                                       rc=tas3004_sync_biquad(self, i, j);
-                                       if (rc < 0) goto out;
-                               }
-                       }
-               }
-       out:
-               if (flags & TAS_BIQUAD_FAST_LOAD)
-                       tas3004_fast_load(self,0);
-       }
-
-       return rc;
-}
-
-static int
-tas3004_update_drce(   struct tas3004_data_t *self,
-                       int flags,
-                       struct tas_drce_t *drce)
-{
-       tas_shadow_t *shadow;
-       int i;
-       shadow=self->super.shadow;
-
-       if (flags & TAS_DRCE_ABOVE_RATIO) {
-               self->drce_state.above.expand = drce->above.expand;
-               if (drce->above.val == (1<<8)) {
-                       self->drce_state.above.val = 1<<8;
-                       shadow[TAS3004_REG_DRC][0] = 0x02;
-                                       
-               } else if (drce->above.expand) {
-                       i=above_threshold_expansion_index(drce->above.val);
-                       self->drce_state.above.val=above_threshold_expansion_ratio[i];
-                       shadow[TAS3004_REG_DRC][0] = 0x0a + (i<<3);
-               } else {
-                       i=above_threshold_compression_index(drce->above.val);
-                       self->drce_state.above.val=above_threshold_compression_ratio[i];
-                       shadow[TAS3004_REG_DRC][0] = 0x08 + (i<<3);
-               }
-       }
-
-       if (flags & TAS_DRCE_BELOW_RATIO) {
-               self->drce_state.below.expand = drce->below.expand;
-               if (drce->below.val == (1<<8)) {
-                       self->drce_state.below.val = 1<<8;
-                       shadow[TAS3004_REG_DRC][1] = 0x02;
-                                       
-               } else if (drce->below.expand) {
-                       i=below_threshold_expansion_index(drce->below.val);
-                       self->drce_state.below.val=below_threshold_expansion_ratio[i];
-                       shadow[TAS3004_REG_DRC][1] = 0x08 + (i<<3);
-               } else {
-                       i=below_threshold_compression_index(drce->below.val);
-                       self->drce_state.below.val=below_threshold_compression_ratio[i];
-                       shadow[TAS3004_REG_DRC][1] = 0x0a + (i<<3);
-               }
-       }
-
-       if (flags & TAS_DRCE_THRESHOLD) {
-               self->drce_state.threshold=quantize_db(drce->threshold);
-               shadow[TAS3004_REG_DRC][2] = db_to_regval(self->drce_state.threshold);
-       }
-
-       if (flags & TAS_DRCE_ENERGY) {
-               i=time_index(drce->energy);
-               self->drce_state.energy=time_constants[i];
-               shadow[TAS3004_REG_DRC][3] = 0x40 + (i<<4);
-       }
-
-       if (flags & TAS_DRCE_ATTACK) {
-               i=time_index(drce->attack);
-               self->drce_state.attack=time_constants[i];
-               shadow[TAS3004_REG_DRC][4] = 0x40 + (i<<4);
-       }
-
-       if (flags & TAS_DRCE_DECAY) {
-               i=time_index(drce->decay);
-               self->drce_state.decay=time_constants[i];
-               shadow[TAS3004_REG_DRC][5] = 0x40 + (i<<4);
-       }
-
-       if (flags & TAS_DRCE_ENABLE) {
-               self->drce_state.enable = drce->enable;
-       }
-
-       if (!self->drce_state.enable) {
-               shadow[TAS3004_REG_DRC][0] |= 0x01;
-       }
-
-#ifdef DEBUG_DRCE
-       printk("DRCE: set [ ENABLE:%x ABOVE:%x/%x BELOW:%x/%x THRESH:%x ENERGY:%x ATTACK:%x DECAY:%x\n",
-              self->drce_state.enable,
-              self->drce_state.above.expand,self->drce_state.above.val,
-              self->drce_state.below.expand,self->drce_state.below.val,
-              self->drce_state.threshold,
-              self->drce_state.energy,
-              self->drce_state.attack,
-              self->drce_state.decay);
-
-       printk("DRCE: reg [ %02x %02x %02x %02x %02x %02x ]\n",
-              (unsigned char)shadow[TAS3004_REG_DRC][0],
-              (unsigned char)shadow[TAS3004_REG_DRC][1],
-              (unsigned char)shadow[TAS3004_REG_DRC][2],
-              (unsigned char)shadow[TAS3004_REG_DRC][3],
-              (unsigned char)shadow[TAS3004_REG_DRC][4],
-              (unsigned char)shadow[TAS3004_REG_DRC][5]);
-#endif
-
-       return tas3004_sync_register(self, TAS3004_REG_DRC);
-}
-
-static int
-tas3004_drce_rw(       struct tas3004_data_t *self,
-                       u_int cmd,
-                       u_long arg)
-{
-       int rc;
-       struct tas_drce_ctrl_t drce_ctrl;
-       void __user *argp = (void __user *)arg;
-
-       if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
-               return -EFAULT;
-
-#ifdef DEBUG_DRCE
-       printk("DRCE: input [ FLAGS:%x ENABLE:%x ABOVE:%x/%x BELOW:%x/%x THRESH:%x ENERGY:%x ATTACK:%x DECAY:%x\n",
-              drce_ctrl.flags,
-              drce_ctrl.data.enable,
-              drce_ctrl.data.above.expand,drce_ctrl.data.above.val,
-              drce_ctrl.data.below.expand,drce_ctrl.data.below.val,
-              drce_ctrl.data.threshold,
-              drce_ctrl.data.energy,
-              drce_ctrl.data.attack,
-              drce_ctrl.data.decay);
-#endif
-
-       if (cmd & SIOC_IN) {
-               rc = tas3004_update_drce(self, drce_ctrl.flags, &drce_ctrl.data);
-               if (rc < 0) return rc;
-       }
-
-       if (cmd & SIOC_OUT) {
-               if (drce_ctrl.flags & TAS_DRCE_ENABLE)
-                       drce_ctrl.data.enable = self->drce_state.enable;
-               if (drce_ctrl.flags & TAS_DRCE_ABOVE_RATIO)
-                       drce_ctrl.data.above = self->drce_state.above;
-               if (drce_ctrl.flags & TAS_DRCE_BELOW_RATIO)
-                       drce_ctrl.data.below = self->drce_state.below;
-               if (drce_ctrl.flags & TAS_DRCE_THRESHOLD)
-                       drce_ctrl.data.threshold = self->drce_state.threshold;
-               if (drce_ctrl.flags & TAS_DRCE_ENERGY)
-                       drce_ctrl.data.energy = self->drce_state.energy;
-               if (drce_ctrl.flags & TAS_DRCE_ATTACK)
-                       drce_ctrl.data.attack = self->drce_state.attack;
-               if (drce_ctrl.flags & TAS_DRCE_DECAY)
-                       drce_ctrl.data.decay = self->drce_state.decay;
-
-               if (copy_to_user(argp, &drce_ctrl,
-                                sizeof(struct tas_drce_ctrl_t))) {
-                       return -EFAULT;
-               }
-       }
-
-       return 0;
-}
-
-static void
-tas3004_update_device_parameters(struct tas3004_data_t *self)
-{
-       char data;
-       int i;
-
-       if (!self) return;
-
-       if (self->output_id == TAS_OUTPUT_HEADPHONES) {
-               /* turn on allPass when headphones are plugged in */
-               data = 0x02;
-       } else {
-               data = 0x00;
-       }
-
-       tas3004_write_register(self, TAS3004_REG_MCR2, &data, WRITE_NORMAL | FORCE_WRITE);
-
-       for (i=0; tas3004_eq_prefs[i]; i++) {
-               struct tas_eq_pref_t *eq = tas3004_eq_prefs[i];
-
-               if (eq->device_id == self->device_id &&
-                   (eq->output_id == 0 || eq->output_id == self->output_id) &&
-                   (eq->speaker_id == 0 || eq->speaker_id == self->speaker_id)) {
-
-                       tas3004_update_drce(self, TAS_DRCE_ALL, eq->drce);
-                       tas3004_write_biquad_list(self, eq->filter_count, TAS_BIQUAD_FAST_LOAD, eq->biquads);
-
-                       break;
-               }
-       }
-}
-
-static void
-tas3004_device_change_handler(struct work_struct *work)
-{
-       struct tas3004_data_t *self;
-       self = container_of(work, struct tas3004_data_t, change);
-       tas3004_update_device_parameters(self);
-}
-
-static int
-tas3004_output_device_change(  struct tas3004_data_t *self,
-                               int device_id,
-                               int output_id,
-                               int speaker_id)
-{
-       self->device_id=device_id;
-       self->output_id=output_id;
-       self->speaker_id=speaker_id;
-
-       schedule_work(&self->change);
-
-       return 0;
-}
-
-static int
-tas3004_device_ioctl(  struct tas3004_data_t *self,
-                       u_int cmd,
-                       u_long arg)
-{
-       uint __user *argp = (void __user *)arg;
-       switch (cmd) {
-       case TAS_READ_EQ:
-       case TAS_WRITE_EQ:
-               return tas3004_eq_rw(self, cmd, arg);
-
-       case TAS_READ_EQ_LIST:
-       case TAS_WRITE_EQ_LIST:
-               return tas3004_eq_list_rw(self, cmd, arg);
-
-       case TAS_READ_EQ_FILTER_COUNT:
-               put_user(TAS3004_BIQUAD_FILTER_COUNT, argp);
-               return 0;
-
-       case TAS_READ_EQ_CHANNEL_COUNT:
-               put_user(TAS3004_BIQUAD_CHANNEL_COUNT, argp);
-               return 0;
-
-       case TAS_READ_DRCE:
-       case TAS_WRITE_DRCE:
-               return tas3004_drce_rw(self, cmd, arg);
-
-       case TAS_READ_DRCE_CAPS:
-               put_user(TAS_DRCE_ENABLE         |
-                        TAS_DRCE_ABOVE_RATIO    |
-                        TAS_DRCE_BELOW_RATIO    |
-                        TAS_DRCE_THRESHOLD      |
-                        TAS_DRCE_ENERGY         |
-                        TAS_DRCE_ATTACK         |
-                        TAS_DRCE_DECAY,
-                        argp);
-               return 0;
-
-       case TAS_READ_DRCE_MIN:
-       case TAS_READ_DRCE_MAX: {
-               struct tas_drce_ctrl_t drce_ctrl;
-               const struct tas_drce_t *drce_copy;
-
-               if (copy_from_user(&drce_ctrl, argp,
-                                  sizeof(struct tas_drce_ctrl_t))) {
-                       return -EFAULT;
-               }
-
-               if (cmd == TAS_READ_DRCE_MIN) {
-                       drce_copy=&tas3004_drce_min;
-               } else {
-                       drce_copy=&tas3004_drce_max;
-               }
-
-               if (drce_ctrl.flags & TAS_DRCE_ABOVE_RATIO) {
-                       drce_ctrl.data.above=drce_copy->above;
-               }
-               if (drce_ctrl.flags & TAS_DRCE_BELOW_RATIO) {
-                       drce_ctrl.data.below=drce_copy->below;
-               }
-               if (drce_ctrl.flags & TAS_DRCE_THRESHOLD) {
-                       drce_ctrl.data.threshold=drce_copy->threshold;
-               }
-               if (drce_ctrl.flags & TAS_DRCE_ENERGY) {
-                       drce_ctrl.data.energy=drce_copy->energy;
-               }
-               if (drce_ctrl.flags & TAS_DRCE_ATTACK) {
-                       drce_ctrl.data.attack=drce_copy->attack;
-               }
-               if (drce_ctrl.flags & TAS_DRCE_DECAY) {
-                       drce_ctrl.data.decay=drce_copy->decay;
-               }
-
-               if (copy_to_user(argp, &drce_ctrl,
-                                sizeof(struct tas_drce_ctrl_t))) {
-                       return -EFAULT;
-               }
-       }
-       }
-
-       return -EINVAL;
-}
-
-static int
-tas3004_init_mixer(struct tas3004_data_t *self)
-{
-       unsigned char mcr = (1<<6)+(2<<4)+(2<<2);
-
-       /* Make sure something answers on the i2c bus */
-       if (tas3004_write_register(self, TAS3004_REG_MCR, &mcr,
-           WRITE_NORMAL | FORCE_WRITE) < 0)
-               return -1;
-
-       tas3004_fast_load(self, 1);
-
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD0);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD1);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD2);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD3);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD4);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD5);
-       (void)tas3004_sync_register(self,TAS3004_REG_RIGHT_BIQUAD6);
-
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD0);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD1);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD2);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD3);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD4);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD5);
-       (void)tas3004_sync_register(self,TAS3004_REG_LEFT_BIQUAD6);
-
-       tas3004_sync_register(self, TAS3004_REG_DRC);
-
-       tas3004_sync_register(self, TAS3004_REG_MCR2);
-
-       tas3004_fast_load(self, 0);
-
-       tas3004_set_mixer_level(self, SOUND_MIXER_VOLUME, VOL_DEFAULT<<8 | VOL_DEFAULT);
-       tas3004_set_mixer_level(self, SOUND_MIXER_PCM, INPUT_DEFAULT<<8 | INPUT_DEFAULT);
-       tas3004_set_mixer_level(self, SOUND_MIXER_ALTPCM, 0);
-       tas3004_set_mixer_level(self, SOUND_MIXER_IMIX, 0);
-
-       tas3004_set_mixer_level(self, SOUND_MIXER_BASS, BASS_DEFAULT);
-       tas3004_set_mixer_level(self, SOUND_MIXER_TREBLE, TREBLE_DEFAULT);
-
-       tas3004_set_mixer_level(self, SOUND_MIXER_LINE,SW_INPUT_VOLUME_DEFAULT);
-
-       return 0;
-}
-
-static int
-tas3004_uninit_mixer(struct tas3004_data_t *self)
-{
-       tas3004_set_mixer_level(self, SOUND_MIXER_VOLUME, 0);
-       tas3004_set_mixer_level(self, SOUND_MIXER_PCM, 0);
-       tas3004_set_mixer_level(self, SOUND_MIXER_ALTPCM, 0);
-       tas3004_set_mixer_level(self, SOUND_MIXER_IMIX, 0);
-
-       tas3004_set_mixer_level(self, SOUND_MIXER_BASS, 0);
-       tas3004_set_mixer_level(self, SOUND_MIXER_TREBLE, 0);
-
-       tas3004_set_mixer_level(self, SOUND_MIXER_LINE, 0);
-
-       return 0;
-}
-
-static int
-tas3004_init(struct i2c_client *client)
-{
-       struct tas3004_data_t *self;
-       size_t sz = sizeof(*self) + (TAS3004_REG_MAX*sizeof(tas_shadow_t));
-       char drce_init[] = { 0x69, 0x22, 0x9f, 0xb0, 0x60, 0xa0 };
-       char mcr2 = 0;
-       int i, j;
-
-       self = kzalloc(sz, GFP_KERNEL);
-       if (!self)
-               return -ENOMEM;
-
-       self->super.client = client;
-       self->super.shadow = (tas_shadow_t *)(self+1);
-       self->output_id = TAS_OUTPUT_HEADPHONES;
-
-       dev_set_drvdata(&client->dev, self);
-
-       for (i = 0; i < TAS3004_BIQUAD_CHANNEL_COUNT; i++)
-               for (j = 0; j<TAS3004_BIQUAD_FILTER_COUNT; j++)
-                       tas3004_write_biquad_shadow(self, i, j,
-                                       &tas3004_eq_unity);
-
-       tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW);
-       tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW);
-
-       INIT_WORK(&self->change, tas3004_device_change_handler);
-       return 0;
-}
-
-static void 
-tas3004_uninit(struct tas3004_data_t *self)
-{
-       tas3004_uninit_mixer(self);
-       kfree(self);
-}
-
-
-struct tas_driver_hooks_t tas3004_hooks = {
-       .init                   = (tas_hook_init_t)tas3004_init,
-       .post_init              = (tas_hook_post_init_t)tas3004_init_mixer,
-       .uninit                 = (tas_hook_uninit_t)tas3004_uninit,
-       .get_mixer_level        = (tas_hook_get_mixer_level_t)tas3004_get_mixer_level,
-       .set_mixer_level        = (tas_hook_set_mixer_level_t)tas3004_set_mixer_level,
-       .enter_sleep            = (tas_hook_enter_sleep_t)tas3004_enter_sleep,
-       .leave_sleep            = (tas_hook_leave_sleep_t)tas3004_leave_sleep,
-       .supported_mixers       = (tas_hook_supported_mixers_t)tas3004_supported_mixers,
-       .mixer_is_stereo        = (tas_hook_mixer_is_stereo_t)tas3004_mixer_is_stereo,
-       .stereo_mixers          = (tas_hook_stereo_mixers_t)tas3004_stereo_mixers,
-       .output_device_change   = (tas_hook_output_device_change_t)tas3004_output_device_change,
-       .device_ioctl           = (tas_hook_device_ioctl_t)tas3004_device_ioctl
-};
diff --git a/sound/oss/dmasound/tas3004.h b/sound/oss/dmasound/tas3004.h
deleted file mode 100644 (file)
index c6d584b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Header file for the i2c/i2s based TA3004 sound chip used
- * on some Apple hardware. Also known as "tumbler".
- *
- *  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.
- *
- * Written by Christopher C. Chimelis <chris@debian.org>
- */
-
-#ifndef _TAS3004_H_
-#define _TAS3004_H_
-
-#include <linux/types.h>
-
-#include "tas_common.h"
-#include "tas_eq_prefs.h"
-
-/*
- * Macros that correspond to the registers that we write to
- * when setting the various values.
- */
-
-#define TAS3004_VERSION                "0.3"
-#define TAS3004_DATE           "20011214"
-
-#define I2C_DRIVERNAME_TAS3004 "TAS3004 driver V " TAS3004_VERSION
-#define I2C_DRIVERID_TAS3004    (I2C_DRIVERID_TAS_BASE+1)
-
-extern  struct tas_driver_hooks_t tas3004_hooks;
-extern struct tas_gain_t tas3004_gain;
-extern struct tas_eq_pref_t *tas3004_eq_prefs[];
-
-enum tas3004_reg_t {
-  TAS3004_REG_MCR                    = 0x01,
-  TAS3004_REG_DRC                    = 0x02,
-
-  TAS3004_REG_VOLUME                 = 0x04,
-  TAS3004_REG_TREBLE                 = 0x05,
-  TAS3004_REG_BASS                   = 0x06,
-  TAS3004_REG_LEFT_MIXER             = 0x07,
-  TAS3004_REG_RIGHT_MIXER            = 0x08,
-
-  TAS3004_REG_LEFT_BIQUAD0           = 0x0a,
-  TAS3004_REG_LEFT_BIQUAD1           = 0x0b,
-  TAS3004_REG_LEFT_BIQUAD2           = 0x0c,
-  TAS3004_REG_LEFT_BIQUAD3           = 0x0d,
-  TAS3004_REG_LEFT_BIQUAD4           = 0x0e,
-  TAS3004_REG_LEFT_BIQUAD5           = 0x0f,
-  TAS3004_REG_LEFT_BIQUAD6           = 0x10,
-  
-  TAS3004_REG_RIGHT_BIQUAD0          = 0x13,
-  TAS3004_REG_RIGHT_BIQUAD1          = 0x14,
-  TAS3004_REG_RIGHT_BIQUAD2          = 0x15,
-  TAS3004_REG_RIGHT_BIQUAD3          = 0x16,
-  TAS3004_REG_RIGHT_BIQUAD4          = 0x17,
-  TAS3004_REG_RIGHT_BIQUAD5          = 0x18,
-  TAS3004_REG_RIGHT_BIQUAD6          = 0x19,
-
-  TAS3004_REG_LEFT_LOUD_BIQUAD       = 0x21,
-  TAS3004_REG_RIGHT_LOUD_BIQUAD      = 0x22,
-
-  TAS3004_REG_LEFT_LOUD_BIQUAD_GAIN  = 0x23,
-  TAS3004_REG_RIGHT_LOUD_BIQUAD_GAIN = 0x24,
-
-  TAS3004_REG_TEST                   = 0x29,
-
-  TAS3004_REG_ANALOG_CTRL            = 0x40,
-  TAS3004_REG_TEST1                  = 0x41,
-  TAS3004_REG_TEST2                  = 0x42,
-  TAS3004_REG_MCR2                   = 0x43,
-
-  TAS3004_REG_MAX                    = 0x44
-};
-
-#endif /* _TAS3004_H_ */
diff --git a/sound/oss/dmasound/tas3004_tables.c b/sound/oss/dmasound/tas3004_tables.c
deleted file mode 100644 (file)
index b910e0a..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-#include "tas3004.h"
-#include "tas_eq_prefs.h"
-
-static struct tas_drce_t eqp_17_1_0_drce={
-    .enable     = 1,
-    .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-    .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-    .threshold  = -19.12  * (1<<8),
-    .energy     = 2.4     * (1<<12),
-    .attack     = 0.013   * (1<<12),
-    .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_17_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0fd0d4, 0xe05e56, 0x0fd0d4, 0xe05ee1, 0x0fa234 } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x0910d7, 0x088e1a, 0x030651, 0x01dcb1, 0x02c892 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0ff895, 0xe0970b, 0x0f7f00, 0xe0970b, 0x0f7795 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0fd1c4, 0xe1ac22, 0x0ec8cf, 0xe1ac22, 0x0e9a94 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0f7c1c, 0xe3cc03, 0x0df786, 0xe3cc03, 0x0d73a2 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x11fb92, 0xf5a1a0, 0x073cd2, 0xf5a1a0, 0x093865 } } },
-  { .channel = 0, .filter = 6, .data = { .coeff = { 0x0e17a9, 0x068b6c, 0x08a0e5, 0x068b6c, 0x06b88e } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0fd0d4, 0xe05e56, 0x0fd0d4, 0xe05ee1, 0x0fa234 } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x0910d7, 0x088e1a, 0x030651, 0x01dcb1, 0x02c892 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0ff895, 0xe0970b, 0x0f7f00, 0xe0970b, 0x0f7795 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0fd1c4, 0xe1ac22, 0x0ec8cf, 0xe1ac22, 0x0e9a94 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0f7c1c, 0xe3cc03, 0x0df786, 0xe3cc03, 0x0d73a2 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x11fb92, 0xf5a1a0, 0x073cd2, 0xf5a1a0, 0x093865 } } },
-  { .channel = 1, .filter = 6, .data = { .coeff = { 0x0e17a9, 0x068b6c, 0x08a0e5, 0x068b6c, 0x06b88e } } }
-};
-
-static struct tas_eq_pref_t eqp_17_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x17,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_17_1_0_drce,
-
-  .filter_count  = 14,
-  .biquads       = eqp_17_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_18_1_0_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -13.14  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_18_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0f5514, 0xe155d7, 0x0f5514, 0xe15cfa, 0x0eb14b } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x06ec33, 0x02abe3, 0x015eef, 0xf764d9, 0x03922d } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0ef5f2, 0xe67d1f, 0x0bcf37, 0xe67d1f, 0x0ac529 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0db050, 0xe5be4d, 0x0d0c78, 0xe5be4d, 0x0abcc8 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0f1298, 0xe64ec6, 0x0cc03e, 0xe64ec6, 0x0bd2d7 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0c641a, 0x06537a, 0x08d155, 0x06537a, 0x053570 } } },
-  { .channel = 0, .filter = 6, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0f5514, 0xe155d7, 0x0f5514, 0xe15cfa, 0x0eb14b } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x06ec33, 0x02abe3, 0x015eef, 0xf764d9, 0x03922d } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0ef5f2, 0xe67d1f, 0x0bcf37, 0xe67d1f, 0x0ac529 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0db050, 0xe5be4d, 0x0d0c78, 0xe5be4d, 0x0abcc8 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0f1298, 0xe64ec6, 0x0cc03e, 0xe64ec6, 0x0bd2d7 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0c641a, 0x06537a, 0x08d155, 0x06537a, 0x053570 } } },
-  { .channel = 1, .filter = 6, .data = { .coeff = { 0x100000, 0x000000, 0x000000, 0x000000, 0x000000 } } }
-};
-
-static struct tas_eq_pref_t eqp_18_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x18,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_18_1_0_drce,
-
-  .filter_count  = 14,
-  .biquads       = eqp_18_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_1a_1_0_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -10.75  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_1a_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0fb8fd, 0xe08e04, 0x0fb8fd, 0xe08f40, 0x0f7336 } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x06371d, 0x0c6e3a, 0x06371d, 0x05bfd3, 0x031ca2 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0fa1c0, 0xe18692, 0x0f030e, 0xe18692, 0x0ea4ce } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0fe495, 0xe17eff, 0x0f0452, 0xe17eff, 0x0ee8e7 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x100857, 0xe7e71c, 0x0e9599, 0xe7e71c, 0x0e9df1 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0fb26e, 0x06a82c, 0x0db2b4, 0x06a82c, 0x0d6522 } } },
-  { .channel = 0, .filter = 6, .data = { .coeff = { 0x11419d, 0xf06cbf, 0x0a4f6e, 0xf06cbf, 0x0b910c } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0fb8fd, 0xe08e04, 0x0fb8fd, 0xe08f40, 0x0f7336 } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x06371d, 0x0c6e3a, 0x06371d, 0x05bfd3, 0x031ca2 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0fa1c0, 0xe18692, 0x0f030e, 0xe18692, 0x0ea4ce } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0fe495, 0xe17eff, 0x0f0452, 0xe17eff, 0x0ee8e7 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x100857, 0xe7e71c, 0x0e9599, 0xe7e71c, 0x0e9df1 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0fb26e, 0x06a82c, 0x0db2b4, 0x06a82c, 0x0d6522 } } },
-  { .channel = 1, .filter = 6, .data = { .coeff = { 0x11419d, 0xf06cbf, 0x0a4f6e, 0xf06cbf, 0x0b910c } } }
-};
-
-static struct tas_eq_pref_t eqp_1a_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x1a,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_1a_1_0_drce,
-
-  .filter_count  = 14,
-  .biquads       = eqp_1a_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static struct tas_drce_t eqp_1c_1_0_drce={
-  .enable     = 1,
-  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  = -14.34  * (1<<8),
-  .energy     = 2.4     * (1<<12),
-  .attack     = 0.013   * (1<<12),
-  .decay      = 0.212   * (1<<12),
-};
-
-static struct tas_biquad_ctrl_t eqp_1c_1_0_biquads[]={
-  { .channel = 0, .filter = 0, .data = { .coeff = { 0x0f4f95, 0xe160d4, 0x0f4f95, 0xe1686e, 0x0ea6c5 } } },
-  { .channel = 0, .filter = 1, .data = { .coeff = { 0x066b92, 0x0290d4, 0x0148a0, 0xf6853f, 0x03bfc7 } } },
-  { .channel = 0, .filter = 2, .data = { .coeff = { 0x0f57dc, 0xe51c91, 0x0dd1cb, 0xe51c91, 0x0d29a8 } } },
-  { .channel = 0, .filter = 3, .data = { .coeff = { 0x0df1cb, 0xe4fa84, 0x0d7cdc, 0xe4fa84, 0x0b6ea7 } } },
-  { .channel = 0, .filter = 4, .data = { .coeff = { 0x0eba36, 0xe6aa48, 0x0b9f52, 0xe6aa48, 0x0a5989 } } },
-  { .channel = 0, .filter = 5, .data = { .coeff = { 0x0caf02, 0x05ef9d, 0x084beb, 0x05ef9d, 0x04faee } } },
-  { .channel = 0, .filter = 6, .data = { .coeff = { 0x0fc686, 0xe22947, 0x0e4b5d, 0xe22947, 0x0e11e4 } } },
-
-  { .channel = 1, .filter = 0, .data = { .coeff = { 0x0f4f95, 0xe160d4, 0x0f4f95, 0xe1686e, 0x0ea6c5 } } },
-  { .channel = 1, .filter = 1, .data = { .coeff = { 0x066b92, 0x0290d4, 0x0148a0, 0xf6853f, 0x03bfc7 } } },
-  { .channel = 1, .filter = 2, .data = { .coeff = { 0x0f57dc, 0xe51c91, 0x0dd1cb, 0xe51c91, 0x0d29a8 } } },
-  { .channel = 1, .filter = 3, .data = { .coeff = { 0x0df1cb, 0xe4fa84, 0x0d7cdc, 0xe4fa84, 0x0b6ea7 } } },
-  { .channel = 1, .filter = 4, .data = { .coeff = { 0x0eba36, 0xe6aa48, 0x0b9f52, 0xe6aa48, 0x0a5989 } } },
-  { .channel = 1, .filter = 5, .data = { .coeff = { 0x0caf02, 0x05ef9d, 0x084beb, 0x05ef9d, 0x04faee } } },
-  { .channel = 1, .filter = 6, .data = { .coeff = { 0x0fc686, 0xe22947, 0x0e4b5d, 0xe22947, 0x0e11e4 } } }
-};
-
-static struct tas_eq_pref_t eqp_1c_1_0 = {
-  .sample_rate   = 44100,
-  .device_id     = 0x1c,
-  .output_id     = TAS_OUTPUT_INTERNAL_SPKR,
-  .speaker_id    = 0x00,
-
-  .drce          = &eqp_1c_1_0_drce,
-
-  .filter_count  = 14,
-  .biquads       = eqp_1c_1_0_biquads
-};
-
-/* ======================================================================== */
-
-static uint tas3004_master_tab[]={
-              0x0,       0x75,       0x9c,       0xbb,
-             0xdb,       0xfb,      0x11e,      0x143,
-            0x16b,      0x196,      0x1c3,      0x1f5,
-            0x229,      0x263,      0x29f,      0x2e1,
-            0x328,      0x373,      0x3c5,      0x41b,
-            0x478,      0x4dc,      0x547,      0x5b8,
-            0x633,      0x6b5,      0x740,      0x7d5,
-            0x873,      0x91c,      0x9d2,      0xa92,
-            0xb5e,      0xc39,      0xd22,      0xe19,
-            0xf20,     0x1037,     0x1161,     0x129e,
-           0x13ed,     0x1551,     0x16ca,     0x185d,
-           0x1a08,     0x1bcc,     0x1dac,     0x1fa7,
-           0x21c1,     0x23fa,     0x2655,     0x28d6,
-           0x2b7c,     0x2e4a,     0x3141,     0x3464,
-           0x37b4,     0x3b35,     0x3ee9,     0x42d3,
-           0x46f6,     0x4b53,     0x4ff0,     0x54ce,
-           0x59f2,     0x5f5f,     0x6519,     0x6b24,
-           0x7183,     0x783c,     0x7f53,     0x86cc,
-           0x8ead,     0x96fa,     0x9fba,     0xa8f2,
-           0xb2a7,     0xbce1,     0xc7a5,     0xd2fa,
-           0xdee8,     0xeb75,     0xf8aa,    0x1068e,
-          0x1152a,    0x12487,    0x134ad,    0x145a5,
-          0x1577b,    0x16a37,    0x17df5,    0x192bd,
-          0x1a890,    0x1bf7b,    0x1d78d,    0x1f0d1,
-          0x20b55,    0x22727,    0x24456,    0x262f2,
-          0x2830b
-};
-
-static uint tas3004_mixer_tab[]={
-              0x0,      0x748,      0x9be,      0xbaf,
-            0xda4,      0xfb1,     0x11de,     0x1431,
-           0x16ad,     0x1959,     0x1c37,     0x1f4b,
-           0x2298,     0x2628,     0x29fb,     0x2e12,
-           0x327d,     0x3734,     0x3c47,     0x41b4,
-           0x4787,     0x4dbe,     0x546d,     0x5b86,
-           0x632e,     0x6b52,     0x7400,     0x7d54,
-           0x873b,     0x91c6,     0x9d1a,     0xa920,
-           0xb5e5,     0xc38c,     0xd21b,     0xe18f,
-           0xf1f5,    0x1036a,    0x1160f,    0x129d6,
-          0x13ed0,    0x1550c,    0x16ca0,    0x185c9,
-          0x1a07b,    0x1bcc3,    0x1dab9,    0x1fa75,
-          0x21c0f,    0x23fa3,    0x26552,    0x28d64,
-          0x2b7c9,    0x2e4a2,    0x31411,    0x3463b,
-          0x37b44,    0x3b353,    0x3ee94,    0x42d30,
-          0x46f55,    0x4b533,    0x4fefc,    0x54ce5,
-          0x59f25,    0x5f5f6,    0x65193,    0x6b23c,
-          0x71835,    0x783c3,    0x7f52c,    0x86cc0,
-          0x8eacc,    0x96fa5,    0x9fba0,    0xa8f1a,
-          0xb2a71,    0xbce0a,    0xc7a4a,    0xd2fa0,
-          0xdee7b,    0xeb752,    0xf8a9f,   0x1068e4,
-         0x1152a3,   0x12486a,   0x134ac8,   0x145a55,
-         0x1577ac,   0x16a370,   0x17df51,   0x192bc2,
-         0x1a88f8,   0x1bf7b7,   0x1d78c9,   0x1f0d04,
-         0x20b542,   0x227268,   0x244564,   0x262f26,
-         0x2830af
-};
-
-static uint tas3004_treble_tab[]={
-             0x96,       0x95,       0x95,       0x94,
-             0x93,       0x92,       0x92,       0x91,
-             0x90,       0x90,       0x8f,       0x8e,
-             0x8d,       0x8d,       0x8c,       0x8b,
-             0x8a,       0x8a,       0x89,       0x88,
-             0x88,       0x87,       0x86,       0x85,
-             0x85,       0x84,       0x83,       0x83,
-             0x82,       0x81,       0x80,       0x80,
-             0x7f,       0x7e,       0x7e,       0x7d,
-             0x7c,       0x7b,       0x7b,       0x7a,
-             0x79,       0x78,       0x78,       0x77,
-             0x76,       0x76,       0x75,       0x74,
-             0x73,       0x73,       0x72,       0x71,
-             0x71,       0x68,       0x45,       0x5b,
-             0x6d,       0x6c,       0x6b,       0x6a,
-             0x69,       0x68,       0x67,       0x66,
-             0x65,       0x63,       0x62,       0x62,
-             0x60,       0x5e,       0x5c,       0x5b,
-             0x59,       0x57,       0x55,       0x53,
-             0x52,       0x4f,       0x4d,       0x4a,
-             0x48,       0x46,       0x43,       0x40,
-             0x3d,       0x3a,       0x36,       0x33,
-             0x2f,       0x2c,       0x27,       0x23,
-             0x1f,       0x1a,       0x15,        0xf,
-              0x8,        0x5,        0x2,        0x1,
-              0x1
-};
-
-static uint tas3004_bass_tab[]={
-             0x96,       0x95,       0x95,       0x94,
-             0x93,       0x92,       0x92,       0x91,
-             0x90,       0x90,       0x8f,       0x8e,
-             0x8d,       0x8d,       0x8c,       0x8b,
-             0x8a,       0x8a,       0x89,       0x88,
-             0x88,       0x87,       0x86,       0x85,
-             0x85,       0x84,       0x83,       0x83,
-             0x82,       0x81,       0x80,       0x80,
-             0x7f,       0x7e,       0x7e,       0x7d,
-             0x7c,       0x7b,       0x7b,       0x7a,
-             0x79,       0x78,       0x78,       0x77,
-             0x76,       0x76,       0x75,       0x74,
-             0x73,       0x73,       0x72,       0x71,
-             0x70,       0x6f,       0x6e,       0x6d,
-             0x6c,       0x6b,       0x6a,       0x6a,
-             0x69,       0x67,       0x66,       0x66,
-             0x65,       0x63,       0x62,       0x62,
-             0x61,       0x60,       0x5e,       0x5d,
-             0x5b,       0x59,       0x57,       0x55,
-             0x53,       0x51,       0x4f,       0x4c,
-             0x4a,       0x48,       0x46,       0x44,
-             0x41,       0x3e,       0x3b,       0x38,
-             0x36,       0x33,       0x2f,       0x2b,
-             0x28,       0x24,       0x20,       0x1c,
-             0x17,       0x12,        0xd,        0x7,
-              0x1
-};
-
-struct tas_gain_t tas3004_gain={
-  .master  = tas3004_master_tab,
-  .treble  = tas3004_treble_tab,
-  .bass    = tas3004_bass_tab,
-  .mixer   = tas3004_mixer_tab
-};
-
-struct tas_eq_pref_t *tas3004_eq_prefs[]={
-  &eqp_17_1_0,
-  &eqp_18_1_0,
-  &eqp_1a_1_0,
-  &eqp_1c_1_0,
-  NULL
-};
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
deleted file mode 100644 (file)
index b295ef6..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/ioport.h>
-#include <linux/sysctl.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <linux/init.h>
-#include <linux/soundcard.h>
-#include <asm/uaccess.h>
-#include <asm/errno.h>
-#include <asm/io.h>
-#include <asm/prom.h>
-
-#include "tas_common.h"
-
-#define CALL0(proc)                                                            \
-       do {                                                                    \
-               struct tas_data_t *self;                                        \
-               if (!tas_client || driver_hooks == NULL)                        \
-                       return -1;                                              \
-               self = dev_get_drvdata(&tas_client->dev);                       \
-               if (driver_hooks->proc)                                         \
-                       return driver_hooks->proc(self);                        \
-               else                                                            \
-                       return -EINVAL;                                         \
-       } while (0)
-
-#define CALL(proc,arg...)                                                      \
-       do {                                                                    \
-               struct tas_data_t *self;                                        \
-               if (!tas_client || driver_hooks == NULL)                        \
-                       return -1;                                              \
-               self = dev_get_drvdata(&tas_client->dev);                       \
-               if (driver_hooks->proc)                                         \
-                       return driver_hooks->proc(self, ## arg);                \
-               else                                                            \
-                       return -EINVAL;                                         \
-       } while (0)
-
-
-static u8 tas_i2c_address = 0x34;
-static struct i2c_client *tas_client;
-
-static int tas_attach_adapter(struct i2c_adapter *);
-static int tas_detach_client(struct i2c_client *);
-
-struct i2c_driver tas_driver = {
-       .driver = {
-               .name   = "tas",
-       },
-       .attach_adapter = tas_attach_adapter,
-       .detach_client  = tas_detach_client,
-};
-
-struct tas_driver_hooks_t *driver_hooks;
-
-int
-tas_register_driver(struct tas_driver_hooks_t *hooks)
-{
-       driver_hooks = hooks;
-       return 0;
-}
-
-int
-tas_get_mixer_level(int mixer, uint *level)
-{
-       CALL(get_mixer_level,mixer,level);
-}
-
-int
-tas_set_mixer_level(int mixer,uint level)
-{
-       CALL(set_mixer_level,mixer,level);
-}
-
-int
-tas_enter_sleep(void)
-{
-       CALL0(enter_sleep);
-}
-
-int
-tas_leave_sleep(void)
-{
-       CALL0(leave_sleep);
-}
-
-int
-tas_supported_mixers(void)
-{
-       CALL0(supported_mixers);
-}
-
-int
-tas_mixer_is_stereo(int mixer)
-{
-       CALL(mixer_is_stereo,mixer);
-}
-
-int
-tas_stereo_mixers(void)
-{
-       CALL0(stereo_mixers);
-}
-
-int
-tas_output_device_change(int device_id,int layout_id,int speaker_id)
-{
-       CALL(output_device_change,device_id,layout_id,speaker_id);
-}
-
-int
-tas_device_ioctl(u_int cmd, u_long arg)
-{
-       CALL(device_ioctl,cmd,arg);
-}
-
-int
-tas_post_init(void)
-{
-       CALL0(post_init);
-}
-
-static int
-tas_detect_client(struct i2c_adapter *adapter, int address)
-{
-       static const char *client_name = "tas Digital Equalizer";
-       struct i2c_client *new_client;
-       int rc = -ENODEV;
-
-       if (!driver_hooks) {
-               printk(KERN_ERR "tas_detect_client called with no hooks !\n");
-               return -ENODEV;
-       }
-       
-       new_client = kzalloc(sizeof(*new_client), GFP_KERNEL);
-       if (!new_client)
-               return -ENOMEM;
-
-       new_client->addr = address;
-       new_client->adapter = adapter;
-       new_client->driver = &tas_driver;
-       strlcpy(new_client->name, client_name, DEVICE_NAME_SIZE);
-
-        if (driver_hooks->init(new_client))
-               goto bail;
-
-       /* Tell the i2c layer a new client has arrived */
-       if (i2c_attach_client(new_client)) {
-               driver_hooks->uninit(dev_get_drvdata(&new_client->dev));
-               goto bail;
-       }
-
-       tas_client = new_client;
-       return 0;
- bail:
-       tas_client = NULL;
-       kfree(new_client);
-       return rc;
-}
-
-static int
-tas_attach_adapter(struct i2c_adapter *adapter)
-{
-       if (!strncmp(adapter->name, "mac-io", 6))
-               return tas_detect_client(adapter, tas_i2c_address);
-       return 0;
-}
-
-static int
-tas_detach_client(struct i2c_client *client)
-{
-       if (client == tas_client) {
-               driver_hooks->uninit(dev_get_drvdata(&client->dev));
-
-               i2c_detach_client(client);
-               kfree(client);
-       }
-       return 0;
-}
-
-void
-tas_cleanup(void)
-{
-       i2c_del_driver(&tas_driver);
-}
-
-int __init
-tas_init(int driver_id, const char *driver_name)
-{
-       const u32* paddr;
-       struct device_node *tas_node;
-
-       printk(KERN_INFO "tas driver [%s])\n", driver_name);
-
-#ifndef CONFIG_I2C_POWERMAC
-       request_module("i2c-powermac");
-#endif
-       tas_node = of_find_node_by_name("deq");
-       if (tas_node == NULL)
-               return -ENODEV;
-       paddr = of_get_property(tas_node, "i2c-address", NULL);
-       if (paddr) {
-               tas_i2c_address = (*paddr) >> 1;
-               printk(KERN_INFO "using i2c address: 0x%x from device-tree\n",
-                               tas_i2c_address);
-       } else    
-               printk(KERN_INFO "using i2c address: 0x%x (default)\n",
-                               tas_i2c_address);
-       of_node_put(tas_node);
-
-       return i2c_add_driver(&tas_driver);
-}
diff --git a/sound/oss/dmasound/tas_common.h b/sound/oss/dmasound/tas_common.h
deleted file mode 100644 (file)
index 0741c28..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-#ifndef _TAS_COMMON_H_
-#define _TAS_COMMON_H_
-
-#include <linux/i2c.h>
-#include <linux/soundcard.h>
-#include <asm/string.h>
-
-#define I2C_DRIVERID_TAS_BASE   (0xFEBA)
-
-#define SET_4_20(shadow, offset, val)                        \
-       do {                                                 \
-               (shadow)[(offset)+0] = ((val) >> 16) & 0xff; \
-               (shadow)[(offset)+1] = ((val) >> 8)  & 0xff; \
-               (shadow)[(offset)+2] = ((val) >> 0)  & 0xff; \
-       } while (0)
-
-#define GET_4_20(shadow, offset)                             \
-       (((u_int)((shadow)[(offset)+0]) << 16) |             \
-        ((u_int)((shadow)[(offset)+1]) <<  8) |             \
-        ((u_int)((shadow)[(offset)+2]) <<  0))
-
-
-#define TAS_BIQUAD_FAST_LOAD 0x01
-
-#define TAS_DRCE_ENABLE           0x01
-#define TAS_DRCE_ABOVE_RATIO      0x02
-#define TAS_DRCE_BELOW_RATIO      0x04
-#define TAS_DRCE_THRESHOLD        0x08
-#define TAS_DRCE_ENERGY           0x10
-#define TAS_DRCE_ATTACK           0x20
-#define TAS_DRCE_DECAY            0x40
-
-#define TAS_DRCE_ALL              0x7f
-
-
-#define TAS_OUTPUT_HEADPHONES     0x00
-#define TAS_OUTPUT_INTERNAL_SPKR  0x01
-#define TAS_OUTPUT_EXTERNAL_SPKR  0x02
-
-
-union tas_biquad_t {
-       struct {
-               int b0,b1,b2,a1,a2;
-       } coeff;
-       int buf[5];
-};
-
-struct tas_biquad_ctrl_t {
-       u_int channel:4;
-       u_int filter:4;
-
-       union tas_biquad_t data;
-};
-
-struct tas_biquad_ctrl_list_t {
-       int flags;
-       int filter_count;
-       struct tas_biquad_ctrl_t biquads[0];
-};
-
-struct tas_ratio_t {
-       unsigned short val;    /* 8.8                        */
-       unsigned short expand; /* 0 = compress, !0 = expand. */
-};
-
-struct tas_drce_t {
-       unsigned short enable;
-       struct tas_ratio_t above;
-       struct tas_ratio_t below;
-       short threshold;       /* dB,       8.8 signed    */
-       unsigned short energy; /* seconds,  4.12 unsigned */
-       unsigned short attack; /* seconds,  4.12 unsigned */
-       unsigned short decay;  /* seconds,  4.12 unsigned */
-};
-
-struct tas_drce_ctrl_t {
-       uint flags;
-
-       struct tas_drce_t data;
-};
-
-struct tas_gain_t
-{
-  unsigned int *master;
-  unsigned int *treble;
-  unsigned int *bass;
-  unsigned int *mixer;
-};
-
-typedef char tas_shadow_t[0x45];
-
-struct tas_data_t
-{
-       struct i2c_client *client;
-       tas_shadow_t *shadow;
-       uint mixer[SOUND_MIXER_NRDEVICES];
-};
-
-typedef int (*tas_hook_init_t)(struct i2c_client *);
-typedef int (*tas_hook_post_init_t)(struct tas_data_t *);
-typedef void (*tas_hook_uninit_t)(struct tas_data_t *);
-
-typedef int (*tas_hook_get_mixer_level_t)(struct tas_data_t *,int,uint *);
-typedef int (*tas_hook_set_mixer_level_t)(struct tas_data_t *,int,uint);
-
-typedef int (*tas_hook_enter_sleep_t)(struct tas_data_t *);
-typedef int (*tas_hook_leave_sleep_t)(struct tas_data_t *);
-
-typedef int (*tas_hook_supported_mixers_t)(struct tas_data_t *);
-typedef int (*tas_hook_mixer_is_stereo_t)(struct tas_data_t *,int);
-typedef int (*tas_hook_stereo_mixers_t)(struct tas_data_t *);
-
-typedef int (*tas_hook_output_device_change_t)(struct tas_data_t *,int,int,int);
-typedef int (*tas_hook_device_ioctl_t)(struct tas_data_t *,u_int,u_long);
-
-struct tas_driver_hooks_t {
-       /*
-        * All hardware initialisation must be performed in
-        * post_init(), as tas_dmasound_init() does a hardware reset.
-        *
-        * init() is called before tas_dmasound_init() so that
-        * ouput_device_change() is always called after i2c driver
-        * initialisation. The implication is that
-        * output_device_change() must cope with the fact that it
-        * may be called before post_init().
-        */
-
-       tas_hook_init_t                   init;
-       tas_hook_post_init_t              post_init;
-       tas_hook_uninit_t                 uninit;
-
-       tas_hook_get_mixer_level_t        get_mixer_level;
-       tas_hook_set_mixer_level_t        set_mixer_level;
-
-       tas_hook_enter_sleep_t            enter_sleep;
-       tas_hook_leave_sleep_t            leave_sleep;
-
-       tas_hook_supported_mixers_t       supported_mixers;
-       tas_hook_mixer_is_stereo_t        mixer_is_stereo;
-       tas_hook_stereo_mixers_t          stereo_mixers;
-
-       tas_hook_output_device_change_t   output_device_change;
-       tas_hook_device_ioctl_t           device_ioctl;
-};
-
-enum tas_write_mode_t {
-       WRITE_HW     = 0x01,
-       WRITE_SHADOW = 0x02,
-       WRITE_NORMAL = 0x03,
-       FORCE_WRITE  = 0x04
-};
-
-static inline uint
-tas_mono_to_stereo(uint mono)
-{
-       mono &=0xff;
-       return mono | (mono<<8);
-}
-
-/*
- * Todo: make these functions a bit more efficient !
- */
-static inline int
-tas_write_register(    struct tas_data_t *self,
-                       uint reg_num,
-                       uint reg_width,
-                       char *data,
-                       uint write_mode)
-{
-       int rc;
-
-       if (reg_width==0 || data==NULL || self==NULL)
-               return -EINVAL;
-       if (!(write_mode & FORCE_WRITE) &&
-           !memcmp(data,self->shadow[reg_num],reg_width))
-               return 0;
-
-       if (write_mode & WRITE_SHADOW)
-               memcpy(self->shadow[reg_num],data,reg_width);
-       if (write_mode & WRITE_HW) {
-               rc=i2c_smbus_write_i2c_block_data(self->client,
-                                                 reg_num,
-                                                 reg_width,
-                                                 data);
-               if (rc < 0) {
-                       printk("tas: I2C block write failed \n");  
-                       return rc; 
-               }
-       }
-       return 0;
-}
-
-static inline int
-tas_sync_register(     struct tas_data_t *self,
-                       uint reg_num,
-                       uint reg_width)
-{
-       int rc;
-
-       if (reg_width==0 || self==NULL)
-               return -EINVAL;
-       rc=i2c_smbus_write_i2c_block_data(self->client,
-                                         reg_num,
-                                         reg_width,
-                                         self->shadow[reg_num]);
-       if (rc < 0) {
-               printk("tas: I2C block write failed \n");
-               return rc;
-       }
-       return 0;
-}
-
-static inline int
-tas_write_byte_register(       struct tas_data_t *self,
-                               uint reg_num,
-                               char data,
-                               uint write_mode)
-{
-       if (self==NULL)
-               return -1;
-       if (!(write_mode & FORCE_WRITE) && data != self->shadow[reg_num][0])
-               return 0;
-       if (write_mode & WRITE_SHADOW)
-               self->shadow[reg_num][0]=data;
-       if (write_mode & WRITE_HW) {
-               if (i2c_smbus_write_byte_data(self->client, reg_num, data) < 0) {
-                       printk("tas: I2C byte write failed \n");  
-                       return -1; 
-               }
-       }
-       return 0;
-}
-
-static inline int
-tas_sync_byte_register(        struct tas_data_t *self,
-                       uint reg_num,
-                       uint reg_width)
-{
-       if (reg_width==0 || self==NULL)
-               return -1;
-       if (i2c_smbus_write_byte_data(
-           self->client, reg_num, self->shadow[reg_num][0]) < 0) {
-               printk("tas: I2C byte write failed \n");
-               return -1;
-       }
-       return 0;
-}
-
-static inline int
-tas_read_register(     struct tas_data_t *self,
-                       uint reg_num,
-                       uint reg_width,
-                       char *data)
-{
-       if (reg_width==0 || data==NULL || self==NULL)
-               return -1;
-       memcpy(data,self->shadow[reg_num],reg_width);
-       return 0;
-}
-
-extern int tas_register_driver(struct tas_driver_hooks_t *hooks);
-
-extern int tas_get_mixer_level(int mixer,uint *level);
-extern int tas_set_mixer_level(int mixer,uint level);
-extern int tas_enter_sleep(void);
-extern int tas_leave_sleep(void);
-extern int tas_supported_mixers(void);
-extern int tas_mixer_is_stereo(int mixer);
-extern int tas_stereo_mixers(void);
-extern int tas_output_device_change(int,int,int);
-extern int tas_device_ioctl(u_int, u_long);
-
-extern void tas_cleanup(void);
-extern int tas_init(int driver_id,const char *driver_name);
-extern int tas_post_init(void);
-
-#endif /* _TAS_COMMON_H_ */
-/*
- * Local Variables:
- * tab-width: 8
- * indent-tabs-mode: t
- * c-basic-offset: 8
- * End:
- */
diff --git a/sound/oss/dmasound/tas_eq_prefs.h b/sound/oss/dmasound/tas_eq_prefs.h
deleted file mode 100644 (file)
index 3a994ed..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _TAS_EQ_PREFS_H_
-#define _TAS_EQ_PREFS_H_
-
-struct tas_eq_pref_t {
-       u_int sample_rate;
-       u_int device_id;
-       u_int output_id;
-       u_int speaker_id;
-
-       struct tas_drce_t *drce;
-
-       u_int filter_count;
-       struct tas_biquad_ctrl_t *biquads;
-};
-
-#endif /* _TAS_EQ_PREFS_H_ */
-
-/*
- * Local Variables:
- * tab-width: 8
- * indent-tabs-mode: t
- * c-basic-offset: 8
- * End:
- */
diff --git a/sound/oss/dmasound/tas_ioctl.h b/sound/oss/dmasound/tas_ioctl.h
deleted file mode 100644 (file)
index 9d12b37..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _TAS_IOCTL_H_
-#define _TAS_IOCTL_H_
-
-#include <linux/soundcard.h>
-
-
-#define TAS_READ_EQ              _SIOR('t',0,struct tas_biquad_ctrl_t)
-#define TAS_WRITE_EQ             _SIOW('t',0,struct tas_biquad_ctrl_t)
-
-#define TAS_READ_EQ_LIST         _SIOR('t',1,struct tas_biquad_ctrl_t)
-#define TAS_WRITE_EQ_LIST        _SIOW('t',1,struct tas_biquad_ctrl_t)
-
-#define TAS_READ_EQ_FILTER_COUNT  _SIOR('t',2,int)
-#define TAS_READ_EQ_CHANNEL_COUNT _SIOR('t',3,int)
-
-#define TAS_READ_DRCE            _SIOR('t',4,struct tas_drce_ctrl_t)
-#define TAS_WRITE_DRCE           _SIOW('t',4,struct tas_drce_ctrl_t)
-
-#define TAS_READ_DRCE_CAPS       _SIOR('t',5,int)
-#define TAS_READ_DRCE_MIN        _SIOR('t',6,int)
-#define TAS_READ_DRCE_MAX        _SIOR('t',7,int)
-
-#endif
diff --git a/sound/oss/dmasound/trans_16.c b/sound/oss/dmasound/trans_16.c
deleted file mode 100644 (file)
index ca973ac..0000000
+++ /dev/null
@@ -1,898 +0,0 @@
-/*
- *  linux/sound/oss/dmasound/trans_16.c
- *
- *  16 bit translation routines.  Only used by Power mac at present.
- *
- *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and
- *  history prior to 08/02/2001.
- *
- *  08/02/2001 Iain Sandoe
- *             split from dmasound_awacs.c
- *  11/29/2003 Renzo Davoli (King Enzo)
- *     - input resampling (for soft rate < hard rate)
- *     - software line in gain control
- */
-
-#include <linux/soundcard.h>
-#include <asm/uaccess.h>
-#include "dmasound.h"
-
-extern int expand_bal; /* Balance factor for expanding (not volume!) */
-static short dmasound_alaw2dma16[] ;
-static short dmasound_ulaw2dma16[] ;
-
-static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft);
-static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft);
-static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-
-static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
-                           u_char frame[], ssize_t *frameUsed,
-                           ssize_t frameLeft);
-static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
-                           u_char frame[], ssize_t *frameUsed,
-                           ssize_t frameLeft);
-static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
-                           u_char frame[], ssize_t *frameUsed,
-                           ssize_t frameLeft);
-
-static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft);
-
-/*** Translations ************************************************************/
-
-static int expand_data;        /* Data for expanding */
-
-static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       short *table = dmasound.soft.format == AFMT_MU_LAW
-               ? dmasound_ulaw2dma16 : dmasound_alaw2dma16;
-       ssize_t count, used;
-       short *p = (short *) &frame[*frameUsed];
-       int val, stereo = dmasound.soft.stereo;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               u_char data;
-               if (get_user(data, userPtr++))
-                       return -EFAULT;
-               val = table[data];
-               *p++ = val;
-               if (stereo) {
-                       if (get_user(data, userPtr++))
-                               return -EFAULT;
-                       val = table[data];
-               }
-               *p++ = val;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 2: used;
-}
-
-
-static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft)
-{
-       ssize_t count, used;
-       short *p = (short *) &frame[*frameUsed];
-       int val, stereo = dmasound.soft.stereo;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               u_char data;
-               if (get_user(data, userPtr++))
-                       return -EFAULT;
-               val = data << 8;
-               *p++ = val;
-               if (stereo) {
-                       if (get_user(data, userPtr++))
-                               return -EFAULT;
-                       val = data << 8;
-               }
-               *p++ = val;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 2: used;
-}
-
-
-static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft)
-{
-       ssize_t count, used;
-       short *p = (short *) &frame[*frameUsed];
-       int val, stereo = dmasound.soft.stereo;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               u_char data;
-               if (get_user(data, userPtr++))
-                       return -EFAULT;
-               val = (data ^ 0x80) << 8;
-               *p++ = val;
-               if (stereo) {
-                       if (get_user(data, userPtr++))
-                               return -EFAULT;
-                       val = (data ^ 0x80) << 8;
-               }
-               *p++ = val;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 2: used;
-}
-
-
-static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       ssize_t count, used;
-       int stereo = dmasound.soft.stereo;
-       short *fp = (short *) &frame[*frameUsed];
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       if (!stereo) {
-               short __user *up = (short __user *) userPtr;
-               while (count > 0) {
-                       short data;
-                       if (get_user(data, up++))
-                               return -EFAULT;
-                       *fp++ = data;
-                       *fp++ = data;
-                       count--;
-               }
-       } else {
-               if (copy_from_user(fp, userPtr, count * 4))
-                       return -EFAULT;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 4: used * 2;
-}
-
-static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       ssize_t count, used;
-       int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
-       int stereo = dmasound.soft.stereo;
-       short *fp = (short *) &frame[*frameUsed];
-       short __user *up = (short __user *) userPtr;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               short data;
-               if (get_user(data, up++))
-                       return -EFAULT;
-               data ^= mask;
-               *fp++ = data;
-               if (stereo) {
-                       if (get_user(data, up++))
-                               return -EFAULT;
-                       data ^= mask;
-               }
-               *fp++ = data;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 4: used * 2;
-}
-
-
-static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
-                           u_char frame[], ssize_t *frameUsed,
-                           ssize_t frameLeft)
-{
-       unsigned short *table = (unsigned short *)
-               (dmasound.soft.format == AFMT_MU_LAW
-                ? dmasound_ulaw2dma16 : dmasound_alaw2dma16);
-       unsigned int data = expand_data;
-       unsigned int *p = (unsigned int *) &frame[*frameUsed];
-       int bal = expand_bal;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int utotal, ftotal;
-       int stereo = dmasound.soft.stereo;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               u_char c;
-               if (bal < 0) {
-                       if (userCount == 0)
-                               break;
-                       if (get_user(c, userPtr++))
-                               return -EFAULT;
-                       data = table[c];
-                       if (stereo) {
-                               if (get_user(c, userPtr++))
-                                       return -EFAULT;
-                               data = (data << 16) + table[c];
-                       } else
-                               data = (data << 16) + data;
-                       userCount--;
-                       bal += hSpeed;
-               }
-               *p++ = data;
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_bal = bal;
-       expand_data = data;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 2: utotal;
-}
-
-static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       unsigned int *p = (unsigned int *) &frame[*frameUsed];
-       unsigned int data = expand_data;
-       int bal = expand_bal;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int stereo = dmasound.soft.stereo;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               u_char c;
-               if (bal < 0) {
-                       if (userCount == 0)
-                               break;
-                       if (get_user(c, userPtr++))
-                               return -EFAULT;
-                       data = c << 8;
-                       if (stereo) {
-                               if (get_user(c, userPtr++))
-                                       return -EFAULT;
-                               data = (data << 16) + (c << 8);
-                       } else
-                               data = (data << 16) + data;
-                       userCount--;
-                       bal += hSpeed;
-               }
-               *p++ = data;
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_bal = bal;
-       expand_data = data;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 2: utotal;
-}
-
-
-static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       unsigned int *p = (unsigned int *) &frame[*frameUsed];
-       unsigned int data = expand_data;
-       int bal = expand_bal;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int stereo = dmasound.soft.stereo;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               u_char c;
-               if (bal < 0) {
-                       if (userCount == 0)
-                               break;
-                       if (get_user(c, userPtr++))
-                               return -EFAULT;
-                       data = (c ^ 0x80) << 8;
-                       if (stereo) {
-                               if (get_user(c, userPtr++))
-                                       return -EFAULT;
-                               data = (data << 16) + ((c ^ 0x80) << 8);
-                       } else
-                               data = (data << 16) + data;
-                       userCount--;
-                       bal += hSpeed;
-               }
-               *p++ = data;
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_bal = bal;
-       expand_data = data;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 2: utotal;
-}
-
-
-static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
-                           u_char frame[], ssize_t *frameUsed,
-                           ssize_t frameLeft)
-{
-       unsigned int *p = (unsigned int *) &frame[*frameUsed];
-       unsigned int data = expand_data;
-       unsigned short __user *up = (unsigned short __user *) userPtr;
-       int bal = expand_bal;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int stereo = dmasound.soft.stereo;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               unsigned short c;
-               if (bal < 0) {
-                       if (userCount == 0)
-                               break;
-                       if (get_user(data, up++))
-                               return -EFAULT;
-                       if (stereo) {
-                               if (get_user(c, up++))
-                                       return -EFAULT;
-                               data = (data << 16) + c;
-                       } else
-                               data = (data << 16) + data;
-                       userCount--;
-                       bal += hSpeed;
-               }
-               *p++ = data;
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_bal = bal;
-       expand_data = data;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 4: utotal * 2;
-}
-
-
-static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
-                           u_char frame[], ssize_t *frameUsed,
-                           ssize_t frameLeft)
-{
-       int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
-       unsigned int *p = (unsigned int *) &frame[*frameUsed];
-       unsigned int data = expand_data;
-       unsigned short __user *up = (unsigned short __user *) userPtr;
-       int bal = expand_bal;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int stereo = dmasound.soft.stereo;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               unsigned short c;
-               if (bal < 0) {
-                       if (userCount == 0)
-                               break;
-                       if (get_user(data, up++))
-                               return -EFAULT;
-                       data ^= mask;
-                       if (stereo) {
-                               if (get_user(c, up++))
-                                       return -EFAULT;
-                               data = (data << 16) + (c ^ mask);
-                       } else
-                               data = (data << 16) + data;
-                       userCount--;
-                       bal += hSpeed;
-               }
-               *p++ = data;
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_bal = bal;
-       expand_data = data;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 4: utotal * 2;
-}
-
-/* data in routines... */
-
-static ssize_t pmac_ct_s8_read(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft)
-{
-       ssize_t count, used;
-       short *p = (short *) &frame[*frameUsed];
-       int val, stereo = dmasound.soft.stereo;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               u_char data;
-
-               val = *p++;
-               val = (val * software_input_volume) >> 7;
-               data = val >> 8;
-               if (put_user(data, (u_char __user *)userPtr++))
-                       return -EFAULT;
-               if (stereo) {
-                       val = *p;
-                       val = (val * software_input_volume) >> 7;
-                       data = val >> 8;
-                       if (put_user(data, (u_char __user *)userPtr++))
-                               return -EFAULT;
-               }
-               p++;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 2: used;
-}
-
-
-static ssize_t pmac_ct_u8_read(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft)
-{
-       ssize_t count, used;
-       short *p = (short *) &frame[*frameUsed];
-       int val, stereo = dmasound.soft.stereo;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               u_char data;
-
-               val = *p++;
-               val = (val * software_input_volume) >> 7;
-               data = (val >> 8) ^ 0x80;
-               if (put_user(data, (u_char __user *)userPtr++))
-                       return -EFAULT;
-               if (stereo) {
-                       val = *p;
-                       val = (val * software_input_volume) >> 7;
-                       data = (val >> 8) ^ 0x80;
-                       if (put_user(data, (u_char __user *)userPtr++))
-                               return -EFAULT;
-               }
-               p++;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 2: used;
-}
-
-static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       ssize_t count, used;
-       int stereo = dmasound.soft.stereo;
-       short *fp = (short *) &frame[*frameUsed];
-       short __user *up = (short __user *) userPtr;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               short data;
-
-               data = *fp++;
-               data = (data * software_input_volume) >> 7;
-               if (put_user(data, up++))
-                       return -EFAULT;
-               if (stereo) {
-                       data = *fp;
-                       data = (data * software_input_volume) >> 7;
-                       if (put_user(data, up++))
-                               return -EFAULT;
-               }
-               fp++;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 4: used * 2;
-}
-
-static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       ssize_t count, used;
-       int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
-       int stereo = dmasound.soft.stereo;
-       short *fp = (short *) &frame[*frameUsed];
-       short __user *up = (short __user *) userPtr;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       used = count = min_t(unsigned long, userCount, frameLeft);
-       while (count > 0) {
-               int data;
-
-               data = *fp++;
-               data = (data * software_input_volume) >> 7;
-               data ^= mask;
-               if (put_user(data, up++))
-                       return -EFAULT;
-               if (stereo) {
-                       data = *fp;
-                       data = (data * software_input_volume) >> 7;
-                       data ^= mask;
-                       if (put_user(data, up++))
-                               return -EFAULT;
-               }
-               fp++;
-               count--;
-       }
-       *frameUsed += used * 4;
-       return stereo? used * 4: used * 2;
-}
-
-/* data in routines (reducing speed)... */
-
-static ssize_t pmac_ctx_s8_read(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft)
-{
-       short *p = (short *) &frame[*frameUsed];
-       int bal = expand_read_bal;
-       int vall,valr, stereo = dmasound.soft.stereo;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               u_char data;
-
-               if (bal<0 && userCount == 0)
-                       break;
-               vall = *p++;
-               vall = (vall * software_input_volume) >> 7;
-               if (stereo) {
-                       valr = *p;
-                       valr = (valr * software_input_volume) >> 7;
-               }
-               p++;
-               if (bal < 0) {
-                       data = vall >> 8;
-                       if (put_user(data, (u_char __user *)userPtr++))
-                               return -EFAULT;
-                       if (stereo) {
-                               data = valr >> 8;
-                               if (put_user(data, (u_char __user *)userPtr++))
-                                       return -EFAULT;
-                       }
-                       userCount--;
-                       bal += hSpeed;
-               }
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_read_bal=bal;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 2: utotal;
-}
-
-
-static ssize_t pmac_ctx_u8_read(const u_char __user *userPtr, size_t userCount,
-                         u_char frame[], ssize_t *frameUsed,
-                         ssize_t frameLeft)
-{
-       short *p = (short *) &frame[*frameUsed];
-       int bal = expand_read_bal;
-       int vall,valr, stereo = dmasound.soft.stereo;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       if (stereo)
-               userCount >>= 1;
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               u_char data;
-
-               if (bal<0 && userCount == 0)
-                       break;
-
-               vall = *p++;
-               vall = (vall * software_input_volume) >> 7;
-               if (stereo) {
-                       valr = *p;
-                       valr = (valr * software_input_volume) >> 7;
-               }
-               p++;
-               if (bal < 0) {
-                       data = (vall >> 8) ^ 0x80;
-                       if (put_user(data, (u_char __user *)userPtr++))
-                               return -EFAULT;
-                       if (stereo) {
-                               data = (valr >> 8) ^ 0x80;
-                               if (put_user(data, (u_char __user *)userPtr++))
-                                       return -EFAULT;
-                       }
-                       userCount--;
-                       bal += hSpeed;
-               }
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_read_bal=bal;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 2: utotal;
-}
-
-static ssize_t pmac_ctx_s16_read(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       int bal = expand_read_bal;
-       short *fp = (short *) &frame[*frameUsed];
-       short __user *up = (short __user *) userPtr;
-       int stereo = dmasound.soft.stereo;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               int datal,datar;
-
-               if (bal<0 && userCount == 0)
-                       break;
-
-               datal = *fp++;
-               datal = (datal * software_input_volume) >> 7;
-               if (stereo) {
-                       datar = *fp;
-                       datar = (datar * software_input_volume) >> 7;
-               }
-               fp++;
-               if (bal < 0) {
-                       if (put_user(datal, up++))
-                               return -EFAULT;
-                       if (stereo) {
-                               if (put_user(datar, up++))
-                                       return -EFAULT;
-                       }
-                       userCount--;
-                       bal += hSpeed;
-               }
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_read_bal=bal;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 4: utotal * 2;
-}
-
-static ssize_t pmac_ctx_u16_read(const u_char __user *userPtr, size_t userCount,
-                          u_char frame[], ssize_t *frameUsed,
-                          ssize_t frameLeft)
-{
-       int bal = expand_read_bal;
-       int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
-       short *fp = (short *) &frame[*frameUsed];
-       short __user *up = (short __user *) userPtr;
-       int stereo = dmasound.soft.stereo;
-       int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
-       int utotal, ftotal;
-
-       frameLeft >>= 2;
-       userCount >>= (stereo? 2: 1);
-       ftotal = frameLeft;
-       utotal = userCount;
-       while (frameLeft) {
-               int datal,datar;
-
-               if (bal<0 && userCount == 0)
-                       break;
-
-               datal = *fp++;
-               datal = (datal * software_input_volume) >> 7;
-               datal ^= mask;
-               if (stereo) {
-                       datar = *fp;
-                       datar = (datar * software_input_volume) >> 7;
-                       datar ^= mask;
-               }
-               fp++;
-               if (bal < 0) {
-                       if (put_user(datal, up++))
-                               return -EFAULT;
-                       if (stereo) {
-                               if (put_user(datar, up++))
-                                       return -EFAULT;
-                       }
-                       userCount--;
-                       bal += hSpeed;
-               }
-               frameLeft--;
-               bal -= sSpeed;
-       }
-       expand_read_bal=bal;
-       *frameUsed += (ftotal - frameLeft) * 4;
-       utotal -= userCount;
-       return stereo? utotal * 4: utotal * 2;
-}
-
-
-TRANS transAwacsNormal = {
-       .ct_ulaw=       pmac_ct_law,
-       .ct_alaw=       pmac_ct_law,
-       .ct_s8=         pmac_ct_s8,
-       .ct_u8=         pmac_ct_u8,
-       .ct_s16be=      pmac_ct_s16,
-       .ct_u16be=      pmac_ct_u16,
-       .ct_s16le=      pmac_ct_s16,
-       .ct_u16le=      pmac_ct_u16,
-};
-
-TRANS transAwacsExpand = {
-       .ct_ulaw=       pmac_ctx_law,
-       .ct_alaw=       pmac_ctx_law,
-       .ct_s8=         pmac_ctx_s8,
-       .ct_u8=         pmac_ctx_u8,
-       .ct_s16be=      pmac_ctx_s16,
-       .ct_u16be=      pmac_ctx_u16,
-       .ct_s16le=      pmac_ctx_s16,
-       .ct_u16le=      pmac_ctx_u16,
-};
-
-TRANS transAwacsNormalRead = {
-       .ct_s8=         pmac_ct_s8_read,
-       .ct_u8=         pmac_ct_u8_read,
-       .ct_s16be=      pmac_ct_s16_read,
-       .ct_u16be=      pmac_ct_u16_read,
-       .ct_s16le=      pmac_ct_s16_read,
-       .ct_u16le=      pmac_ct_u16_read,
-};
-
-TRANS transAwacsExpandRead = {
-       .ct_s8=         pmac_ctx_s8_read,
-       .ct_u8=         pmac_ctx_u8_read,
-       .ct_s16be=      pmac_ctx_s16_read,
-       .ct_u16be=      pmac_ctx_u16_read,
-       .ct_s16le=      pmac_ctx_s16_read,
-       .ct_u16le=      pmac_ctx_u16_read,
-};
-
-/* translation tables */
-/* 16 bit mu-law */
-
-static short dmasound_ulaw2dma16[] = {
-       -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956,
-       -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764,
-       -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412,
-       -11900, -11388, -10876, -10364, -9852,  -9340,  -8828,  -8316,
-       -7932,  -7676,  -7420,  -7164,  -6908,  -6652,  -6396,  -6140,
-       -5884,  -5628,  -5372,  -5116,  -4860,  -4604,  -4348,  -4092,
-       -3900,  -3772,  -3644,  -3516,  -3388,  -3260,  -3132,  -3004,
-       -2876,  -2748,  -2620,  -2492,  -2364,  -2236,  -2108,  -1980,
-       -1884,  -1820,  -1756,  -1692,  -1628,  -1564,  -1500,  -1436,
-       -1372,  -1308,  -1244,  -1180,  -1116,  -1052,  -988,   -924,
-       -876,   -844,   -812,   -780,   -748,   -716,   -684,   -652,
-       -620,   -588,   -556,   -524,   -492,   -460,   -428,   -396,
-       -372,   -356,   -340,   -324,   -308,   -292,   -276,   -260,
-       -244,   -228,   -212,   -196,   -180,   -164,   -148,   -132,
-       -120,   -112,   -104,   -96,    -88,    -80,    -72,    -64,
-       -56,    -48,    -40,    -32,    -24,    -16,    -8,     0,
-       32124,  31100,  30076,  29052,  28028,  27004,  25980,  24956,
-       23932,  22908,  21884,  20860,  19836,  18812,  17788,  16764,
-       15996,  15484,  14972,  14460,  13948,  13436,  12924,  12412,
-       11900,  11388,  10876,  10364,  9852,   9340,   8828,   8316,
-       7932,   7676,   7420,   7164,   6908,   6652,   6396,   6140,
-       5884,   5628,   5372,   5116,   4860,   4604,   4348,   4092,
-       3900,   3772,   3644,   3516,   3388,   3260,   3132,   3004,
-       2876,   2748,   2620,   2492,   2364,   2236,   2108,   1980,
-       1884,   1820,   1756,   1692,   1628,   1564,   1500,   1436,
-       1372,   1308,   1244,   1180,   1116,   1052,   988,    924,
-       876,    844,    812,    780,    748,    716,    684,    652,
-       620,    588,    556,    524,    492,    460,    428,    396,
-       372,    356,    340,    324,    308,    292,    276,    260,
-       244,    228,    212,    196,    180,    164,    148,    132,
-       120,    112,    104,    96,     88,     80,     72,     64,
-       56,     48,     40,     32,     24,     16,     8,      0,
-};
-
-/* 16 bit A-law */
-
-static short dmasound_alaw2dma16[] = {
-       -5504,  -5248,  -6016,  -5760,  -4480,  -4224,  -4992,  -4736,
-       -7552,  -7296,  -8064,  -7808,  -6528,  -6272,  -7040,  -6784,
-       -2752,  -2624,  -3008,  -2880,  -2240,  -2112,  -2496,  -2368,
-       -3776,  -3648,  -4032,  -3904,  -3264,  -3136,  -3520,  -3392,
-       -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944,
-       -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136,
-       -11008, -10496, -12032, -11520, -8960,  -8448,  -9984,  -9472,
-       -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568,
-       -344,   -328,   -376,   -360,   -280,   -264,   -312,   -296,
-       -472,   -456,   -504,   -488,   -408,   -392,   -440,   -424,
-       -88,    -72,    -120,   -104,   -24,    -8,     -56,    -40,
-       -216,   -200,   -248,   -232,   -152,   -136,   -184,   -168,
-       -1376,  -1312,  -1504,  -1440,  -1120,  -1056,  -1248,  -1184,
-       -1888,  -1824,  -2016,  -1952,  -1632,  -1568,  -1760,  -1696,
-       -688,   -656,   -752,   -720,   -560,   -528,   -624,   -592,
-       -944,   -912,   -1008,  -976,   -816,   -784,   -880,   -848,
-       5504,   5248,   6016,   5760,   4480,   4224,   4992,   4736,
-       7552,   7296,   8064,   7808,   6528,   6272,   7040,   6784,
-       2752,   2624,   3008,   2880,   2240,   2112,   2496,   2368,
-       3776,   3648,   4032,   3904,   3264,   3136,   3520,   3392,
-       22016,  20992,  24064,  23040,  17920,  16896,  19968,  18944,
-       30208,  29184,  32256,  31232,  26112,  25088,  28160,  27136,
-       11008,  10496,  12032,  11520,  8960,   8448,   9984,   9472,
-       15104,  14592,  16128,  15616,  13056,  12544,  14080,  13568,
-       344,    328,    376,    360,    280,    264,    312,    296,
-       472,    456,    504,    488,    408,    392,    440,    424,
-       88,     72,     120,    104,    24,     8,      56,     40,
-       216,    200,    248,    232,    152,    136,    184,    168,
-       1376,   1312,   1504,   1440,   1120,   1056,   1248,   1184,
-       1888,   1824,   2016,   1952,   1632,   1568,   1760,   1696,
-       688,    656,    752,    720,    560,    528,    624,    592,
-       944,    912,    1008,   976,    816,    784,    880,    848,
-};
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
deleted file mode 100644 (file)
index 5264857..0000000
+++ /dev/null
@@ -1,3131 +0,0 @@
-/*****************************************************************************/
-
-/*
- *      es1371.c  --  Creative Ensoniq ES1371.
- *
- *      Copyright (C) 1998-2001, 2003  Thomas Sailer (t.sailer@alumni.ethz.ch)
- *
- *      This program is free software; you can redistribute it and/or modify
- *      it under the terms of the GNU General Public License as published by
- *      the Free Software Foundation; either version 2 of the License, or
- *      (at your option) any later version.
- *
- *      This program is distributed in the hope that it will be useful,
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *      GNU General Public License for more details.
- *
- *      You should have received a copy of the GNU General Public License
- *      along with this program; if not, write to the Free Software
- *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Special thanks to Ensoniq
- *
- *  Supported devices:
- *  /dev/dsp    standard /dev/dsp device, (mostly) OSS compatible
- *  /dev/mixer  standard /dev/mixer device, (mostly) OSS compatible
- *  /dev/dsp1   additional DAC, like /dev/dsp, but outputs to mixer "SYNTH" setting
- *  /dev/midi   simple MIDI UART interface, no ioctl
- *
- *  NOTE: the card does not have any FM/Wavetable synthesizer, it is supposed
- *  to be done in software. That is what /dev/dac is for. By now (Q2 1998)
- *  there are several MIDI to PCM (WAV) packages, one of them is timidity.
- *
- *  Revision history
- *    04.06.1998   0.1   Initial release
- *                       Mixer stuff should be overhauled; especially optional AC97 mixer bits
- *                       should be detected. This results in strange behaviour of some mixer
- *                       settings, like master volume and mic.
- *    08.06.1998   0.2   First release using Alan Cox' soundcore instead of miscdevice
- *    03.08.1998   0.3   Do not include modversions.h
- *                       Now mixer behaviour can basically be selected between
- *                       "OSS documented" and "OSS actual" behaviour
- *    31.08.1998   0.4   Fix realplayer problems - dac.count issues
- *    27.10.1998   0.5   Fix joystick support
- *                       -- Oliver Neukum (c188@org.chemie.uni-muenchen.de)
- *    10.12.1998   0.6   Fix drain_dac trying to wait on not yet initialized DMA
- *    23.12.1998   0.7   Fix a few f_file & FMODE_ bugs
- *                       Don't wake up app until there are fragsize bytes to read/write
- *    06.01.1999   0.8   remove the silly SA_INTERRUPT flag.
- *                       hopefully killed the egcs section type conflict
- *    12.03.1999   0.9   cinfo.blocks should be reset after GETxPTR ioctl.
- *                       reported by Johan Maes <joma@telindus.be>
- *    22.03.1999   0.10  return EAGAIN instead of EBUSY when O_NONBLOCK
- *                       read/write cannot be executed
- *    07.04.1999   0.11  implemented the following ioctl's: SOUND_PCM_READ_RATE, 
- *                       SOUND_PCM_READ_CHANNELS, SOUND_PCM_READ_BITS; 
- *                       Alpha fixes reported by Peter Jones <pjones@redhat.com>
- *                       Another Alpha fix (wait_src_ready in init routine)
- *                       reported by "Ivan N. Kokshaysky" <ink@jurassic.park.msu.ru>
- *                       Note: joystick address handling might still be wrong on archs
- *                       other than i386
- *    15.06.1999   0.12  Fix bad allocation bug.
- *                       Thanks to Deti Fliegl <fliegl@in.tum.de>
- *    28.06.1999   0.13  Add pci_set_master
- *    03.08.1999   0.14  adapt to Linus' new __setup/__initcall
- *                       added kernel command line option "es1371=joystickaddr"
- *                       removed CONFIG_SOUND_ES1371_JOYPORT_BOOT kludge
- *    10.08.1999   0.15  (Re)added S/PDIF module option for cards revision >= 4.
- *                       Initial version by Dave Platt <dplatt@snulbug.mtview.ca.us>.
- *                       module_init/__setup fixes
- *    08.16.1999   0.16  Joe Cotellese <joec@ensoniq.com>
- *                       Added detection for ES1371 revision ID so that we can
- *                       detect the ES1373 and later parts.
- *                       added AC97 #defines for readability
- *                       added a /proc file system for dumping hardware state
- *                       updated SRC and CODEC w/r functions to accommodate bugs
- *                       in some versions of the ES137x chips.
- *    31.08.1999   0.17  add spin_lock_init
- *                       replaced current->state = x with set_current_state(x)
- *    03.09.1999   0.18  change read semantics for MIDI to match
- *                       OSS more closely; remove possible wakeup race
- *    21.10.1999   0.19  Round sampling rates, requested by
- *                       Kasamatsu Kenichi <t29w0267@ip.media.kyoto-u.ac.jp>
- *    27.10.1999   0.20  Added SigmaTel 3D enhancement string
- *                       Codec ID printing changes
- *    28.10.1999   0.21  More waitqueue races fixed
- *                       Joe Cotellese <joec@ensoniq.com>
- *                       Changed PCI detection routine so we can more easily
- *                       detect ES137x chip and derivatives.
- *    05.01.2000   0.22  Should now work with rev7 boards; patch by
- *                       Eric Lemar, elemar@cs.washington.edu
- *    08.01.2000   0.23  Prevent some ioctl's from returning bad count values on underrun/overrun;
- *                       Tim Janik's BSE (Bedevilled Sound Engine) found this
- *    07.02.2000   0.24  Use pci_alloc_consistent and pci_register_driver
- *    07.02.2000   0.25  Use ac97_codec
- *    01.03.2000   0.26  SPDIF patch by Mikael Bouillot <mikael.bouillot@bigfoot.com>
- *                       Use pci_module_init
- *    21.11.2000   0.27  Initialize dma buffers in poll, otherwise poll may return a bogus mask
- *    12.12.2000   0.28  More dma buffer initializations, patch from
- *                       Tjeerd Mulder <tjeerd.mulder@fujitsu-siemens.com>
- *    05.01.2001   0.29  Hopefully updates will not be required anymore when Creative bumps
- *                       the CT5880 revision.
- *                       suggested by Stephan Müller <smueller@chronox.de>
- *    31.01.2001   0.30  Register/Unregister gameport
- *                       Fix SETTRIGGER non OSS API conformity
- *    14.07.2001   0.31  Add list of laptops needing amplifier control
- *    03.01.2003   0.32  open_mode fixes from Georg Acher <acher@in.tum.de>
- */
-
-/*****************************************************************************/
-      
-#include <linux/interrupt.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/ioport.h>
-#include <linux/sched.h>
-#include <linux/delay.h>
-#include <linux/sound.h>
-#include <linux/slab.h>
-#include <linux/soundcard.h>
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/poll.h>
-#include <linux/bitops.h>
-#include <linux/proc_fs.h>
-#include <linux/spinlock.h>
-#include <linux/smp_lock.h>
-#include <linux/ac97_codec.h>
-#include <linux/gameport.h>
-#include <linux/wait.h>
-#include <linux/dma-mapping.h>
-#include <linux/mutex.h>
-#include <linux/mm.h>
-#include <linux/kernel.h>
-
-#include <asm/io.h>
-#include <asm/page.h>
-#include <asm/uaccess.h>
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK
-#endif
-
-/* --------------------------------------------------------------------- */
-
-#undef OSS_DOCUMENTED_MIXER_SEMANTICS
-#define ES1371_DEBUG
-#define DBG(x) {}
-/*#define DBG(x) {x}*/
-
-/* --------------------------------------------------------------------- */
-
-#ifndef PCI_VENDOR_ID_ENSONIQ
-#define PCI_VENDOR_ID_ENSONIQ        0x1274    
-#endif
-
-#ifndef PCI_VENDOR_ID_ECTIVA
-#define PCI_VENDOR_ID_ECTIVA         0x1102
-#endif
-
-#ifndef PCI_DEVICE_ID_ENSONIQ_ES1371
-#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371
-#endif
-
-#ifndef PCI_DEVICE_ID_ENSONIQ_CT5880
-#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
-#endif
-
-#ifndef PCI_DEVICE_ID_ECTIVA_EV1938
-#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938
-#endif
-
-/* ES1371 chip ID */
-/* This is a little confusing because all ES1371 compatible chips have the
-   same DEVICE_ID, the only thing differentiating them is the REV_ID field.
-   This is only significant if you want to enable features on the later parts.
-   Yes, I know it's stupid and why didn't we use the sub IDs?
-*/
-#define ES1371REV_ES1373_A  0x04
-#define ES1371REV_ES1373_B  0x06
-#define ES1371REV_CT5880_A  0x07
-#define CT5880REV_CT5880_C  0x02
-#define CT5880REV_CT5880_D  0x03
-#define ES1371REV_ES1371_B  0x09
-#define EV1938REV_EV1938_A  0x00
-#define ES1371REV_ES1373_8  0x08
-
-#define ES1371_MAGIC  ((PCI_VENDOR_ID_ENSONIQ<<16)|PCI_DEVICE_ID_ENSONIQ_ES1371)
-
-#define ES1371_EXTENT             0x40
-#define JOY_EXTENT                8
-
-#define ES1371_REG_CONTROL        0x00
-#define ES1371_REG_STATUS         0x04 /* on the 5880 it is control/status */
-#define ES1371_REG_UART_DATA      0x08
-#define ES1371_REG_UART_STATUS    0x09
-#define ES1371_REG_UART_CONTROL   0x09
-#define ES1371_REG_UART_TEST      0x0a
-#define ES1371_REG_MEMPAGE        0x0c
-#define ES1371_REG_SRCONV         0x10
-#define ES1371_REG_CODEC          0x14
-#define ES1371_REG_LEGACY         0x18
-#define ES1371_REG_SERIAL_CONTROL 0x20
-#define ES1371_REG_DAC1_SCOUNT    0x24
-#define ES1371_REG_DAC2_SCOUNT    0x28
-#define ES1371_REG_ADC_SCOUNT     0x2c
-
-#define ES1371_REG_DAC1_FRAMEADR  0xc30
-#define ES1371_REG_DAC1_FRAMECNT  0xc34
-#define ES1371_REG_DAC2_FRAMEADR  0xc38
-#define ES1371_REG_DAC2_FRAMECNT  0xc3c
-#define ES1371_REG_ADC_FRAMEADR   0xd30
-#define ES1371_REG_ADC_FRAMECNT   0xd34
-
-#define ES1371_FMT_U8_MONO     0
-#define ES1371_FMT_U8_STEREO   1
-#define ES1371_FMT_S16_MONO    2
-#define ES1371_FMT_S16_STEREO  3
-#define ES1371_FMT_STEREO      1
-#define ES1371_FMT_S16         2
-#define ES1371_FMT_MASK        3
-
-static const unsigned sample_size[] = { 1, 2, 2, 4 };
-static const unsigned sample_shift[] = { 0, 1, 1, 2 };
-
-#define CTRL_RECEN_B    0x08000000  /* 1 = don't mix analog in to digital out */
-#define CTRL_SPDIFEN_B  0x04000000
-#define CTRL_JOY_SHIFT  24
-#define CTRL_JOY_MASK   3
-#define CTRL_JOY_200    0x00000000  /* joystick base address */
-#define CTRL_JOY_208    0x01000000
-#define CTRL_JOY_210    0x02000000
-#define CTRL_JOY_218    0x03000000
-#define CTRL_GPIO_IN0   0x00100000  /* general purpose inputs/outputs */
-#define CTRL_GPIO_IN1   0x00200000
-#define CTRL_GPIO_IN2   0x00400000
-#define CTRL_GPIO_IN3   0x00800000
-#define CTRL_GPIO_OUT0  0x00010000
-#define CTRL_GPIO_OUT1  0x00020000
-#define CTRL_GPIO_OUT2  0x00040000
-#define CTRL_GPIO_OUT3  0x00080000
-#define CTRL_MSFMTSEL   0x00008000  /* MPEG serial data fmt: 0 = Sony, 1 = I2S */
-#define CTRL_SYNCRES    0x00004000  /* AC97 warm reset */
-#define CTRL_ADCSTOP    0x00002000  /* stop ADC transfers */
-#define CTRL_PWR_INTRM  0x00001000  /* 1 = power level ints enabled */
-#define CTRL_M_CB       0x00000800  /* recording source: 0 = ADC, 1 = MPEG */
-#define CTRL_CCB_INTRM  0x00000400  /* 1 = CCB "voice" ints enabled */
-#define CTRL_PDLEV0     0x00000000  /* power down level */
-#define CTRL_PDLEV1     0x00000100
-#define CTRL_PDLEV2     0x00000200
-#define CTRL_PDLEV3     0x00000300
-#define CTRL_BREQ       0x00000080  /* 1 = test mode (internal mem test) */
-#define CTRL_DAC1_EN    0x00000040  /* enable DAC1 */
-#define CTRL_DAC2_EN    0x00000020  /* enable DAC2 */
-#define CTRL_ADC_EN     0x00000010  /* enable ADC */
-#define CTRL_UART_EN    0x00000008  /* enable MIDI uart */
-#define CTRL_JYSTK_EN   0x00000004  /* enable Joystick port */
-#define CTRL_XTALCLKDIS 0x00000002  /* 1 = disable crystal clock input */
-#define CTRL_PCICLKDIS  0x00000001  /* 1 = disable PCI clock distribution */
-
-
-#define STAT_INTR       0x80000000  /* wired or of all interrupt bits */
-#define CSTAT_5880_AC97_RST 0x20000000 /* CT5880 Reset bit */
-#define STAT_EN_SPDIF   0x00040000  /* enable S/PDIF circuitry */
-#define STAT_TS_SPDIF   0x00020000  /* test S/PDIF circuitry */
-#define STAT_TESTMODE   0x00010000  /* test ASIC */
-#define STAT_SYNC_ERR   0x00000100  /* 1 = codec sync error */
-#define STAT_VC         0x000000c0  /* CCB int source, 0=DAC1, 1=DAC2, 2=ADC, 3=undef */
-#define STAT_SH_VC      6
-#define STAT_MPWR       0x00000020  /* power level interrupt */
-#define STAT_MCCB       0x00000010  /* CCB int pending */
-#define STAT_UART       0x00000008  /* UART int pending */
-#define STAT_DAC1       0x00000004  /* DAC1 int pending */
-#define STAT_DAC2       0x00000002  /* DAC2 int pending */
-#define STAT_ADC        0x00000001  /* ADC int pending */
-
-#define USTAT_RXINT     0x80        /* UART rx int pending */
-#define USTAT_TXINT     0x04        /* UART tx int pending */
-#define USTAT_TXRDY     0x02        /* UART tx ready */
-#define USTAT_RXRDY     0x01        /* UART rx ready */
-
-#define UCTRL_RXINTEN   0x80        /* 1 = enable RX ints */
-#define UCTRL_TXINTEN   0x60        /* TX int enable field mask */
-#define UCTRL_ENA_TXINT 0x20        /* enable TX int */
-#define UCTRL_CNTRL     0x03        /* control field */
-#define UCTRL_CNTRL_SWR 0x03        /* software reset command */
-
-/* sample rate converter */
-#define SRC_OKSTATE        1
-
-#define SRC_RAMADDR_MASK   0xfe000000
-#define SRC_RAMADDR_SHIFT  25
-#define SRC_DAC1FREEZE     (1UL << 21)
-#define SRC_DAC2FREEZE      (1UL << 20)
-#define SRC_ADCFREEZE      (1UL << 19)
-
-
-#define SRC_WE             0x01000000  /* read/write control for SRC RAM */
-#define SRC_BUSY           0x00800000  /* SRC busy */
-#define SRC_DIS            0x00400000  /* 1 = disable SRC */
-#define SRC_DDAC1          0x00200000  /* 1 = disable accum update for DAC1 */
-#define SRC_DDAC2          0x00100000  /* 1 = disable accum update for DAC2 */
-#define SRC_DADC           0x00080000  /* 1 = disable accum update for ADC2 */
-#define SRC_CTLMASK        0x00780000
-#define SRC_RAMDATA_MASK   0x0000ffff
-#define SRC_RAMDATA_SHIFT  0
-
-#define SRCREG_ADC      0x78
-#define SRCREG_DAC1     0x70
-#define SRCREG_DAC2     0x74
-#define SRCREG_VOL_ADC  0x6c
-#define SRCREG_VOL_DAC1 0x7c
-#define SRCREG_VOL_DAC2 0x7e
-
-#define SRCREG_TRUNC_N     0x00
-#define SRCREG_INT_REGS    0x01
-#define SRCREG_ACCUM_FRAC  0x02
-#define SRCREG_VFREQ_FRAC  0x03
-
-#define CODEC_PIRD        0x00800000  /* 0 = write AC97 register */
-#define CODEC_PIADD_MASK  0x007f0000
-#define CODEC_PIADD_SHIFT 16
-#define CODEC_PIDAT_MASK  0x0000ffff
-#define CODEC_PIDAT_SHIFT 0
-
-#define CODEC_RDY         0x80000000  /* AC97 read data valid */
-#define CODEC_WIP         0x40000000  /* AC97 write in progress */
-#define CODEC_PORD        0x00800000  /* 0 = write AC97 register */
-#define CODEC_POADD_MASK  0x007f0000
-#define CODEC_POADD_SHIFT 16
-#define CODEC_PODAT_MASK  0x0000ffff
-#define CODEC_PODAT_SHIFT 0
-
-
-#define LEGACY_JFAST      0x80000000  /* fast joystick timing */
-#define LEGACY_FIRQ       0x01000000  /* force IRQ */
-
-#define SCTRL_DACTEST     0x00400000  /* 1 = DAC test, test vector generation purposes */
-#define SCTRL_P2ENDINC    0x00380000  /*  */
-#define SCTRL_SH_P2ENDINC 19
-#define SCTRL_P2STINC     0x00070000  /*  */
-#define SCTRL_SH_P2STINC  16
-#define SCTRL_R1LOOPSEL   0x00008000  /* 0 = loop mode */
-#define SCTRL_P2LOOPSEL   0x00004000  /* 0 = loop mode */
-#define SCTRL_P1LOOPSEL   0x00002000  /* 0 = loop mode */
-#define SCTRL_P2PAUSE     0x00001000  /* 1 = pause mode */
-#define SCTRL_P1PAUSE     0x00000800  /* 1 = pause mode */
-#define SCTRL_R1INTEN     0x00000400  /* enable interrupt */
-#define SCTRL_P2INTEN     0x00000200  /* enable interrupt */
-#define SCTRL_P1INTEN     0x00000100  /* enable interrupt */
-#define SCTRL_P1SCTRLD    0x00000080  /* reload sample count register for DAC1 */
-#define SCTRL_P2DACSEN    0x00000040  /* 1 = DAC2 play back last sample when disabled */
-#define SCTRL_R1SEB       0x00000020  /* 1 = 16bit */
-#define SCTRL_R1SMB       0x00000010  /* 1 = stereo */
-#define SCTRL_R1FMT       0x00000030  /* format mask */
-#define SCTRL_SH_R1FMT    4
-#define SCTRL_P2SEB       0x00000008  /* 1 = 16bit */
-#define SCTRL_P2SMB       0x00000004  /* 1 = stereo */
-#define SCTRL_P2FMT       0x0000000c  /* format mask */
-#define SCTRL_SH_P2FMT    2
-#define SCTRL_P1SEB       0x00000002  /* 1 = 16bit */
-#define SCTRL_P1SMB       0x00000001  /* 1 = stereo */
-#define SCTRL_P1FMT       0x00000003  /* format mask */
-#define SCTRL_SH_P1FMT    0
-
-
-/* misc stuff */
-#define POLL_COUNT   0x1000
-#define FMODE_DAC         4           /* slight misuse of mode_t */
-
-/* MIDI buffer sizes */
-
-#define MIDIINBUF  256
-#define MIDIOUTBUF 256
-
-#define FMODE_MIDI_SHIFT 3
-#define FMODE_MIDI_READ  (FMODE_READ << FMODE_MIDI_SHIFT)
-#define FMODE_MIDI_WRITE (FMODE_WRITE << FMODE_MIDI_SHIFT)
-
-#define ES1371_MODULE_NAME "es1371"
-#define PFX ES1371_MODULE_NAME ": "
-
-/* --------------------------------------------------------------------- */
-
-struct es1371_state {
-       /* magic */
-       unsigned int magic;
-
-       /* list of es1371 devices */
-       struct list_head devs;
-
-       /* the corresponding pci_dev structure */
-       struct pci_dev *dev;
-
-       /* soundcore stuff */
-       int dev_audio;
-       int dev_dac;
-       int dev_midi;
-       
-       /* hardware resources */
-       unsigned long io; /* long for SPARC */
-       unsigned int irq;
-
-       /* PCI ID's */
-       u16 vendor;
-       u16 device;
-        u8 rev; /* the chip revision */
-
-       /* options */
-       int spdif_volume; /* S/PDIF output is enabled if != -1 */
-
-#ifdef ES1371_DEBUG
-        /* debug /proc entry */
-       struct proc_dir_entry *ps;
-#endif /* ES1371_DEBUG */
-
-       struct ac97_codec *codec;
-
-       /* wave stuff */
-       unsigned ctrl;
-       unsigned sctrl;
-       unsigned dac1rate, dac2rate, adcrate;
-
-       spinlock_t lock;
-       struct mutex open_mutex;
-       mode_t open_mode;
-       wait_queue_head_t open_wait;
-
-       struct dmabuf {
-               void *rawbuf;
-               dma_addr_t dmaaddr;
-               unsigned buforder;
-               unsigned numfrag;
-               unsigned fragshift;
-               unsigned hwptr, swptr;
-               unsigned total_bytes;
-               int count;
-               unsigned error; /* over/underrun */
-               wait_queue_head_t wait;
-               /* redundant, but makes calculations easier */
-               unsigned fragsize;
-               unsigned dmasize;
-               unsigned fragsamples;
-               /* OSS stuff */
-               unsigned mapped:1;
-               unsigned ready:1;
-               unsigned endcleared:1;
-               unsigned enabled:1;
-               unsigned ossfragshift;
-               int ossmaxfrags;
-               unsigned subdivision;
-       } dma_dac1, dma_dac2, dma_adc;
-
-       /* midi stuff */
-       struct {
-               unsigned ird, iwr, icnt;
-               unsigned ord, owr, ocnt;
-               wait_queue_head_t iwait;
-               wait_queue_head_t owait;
-               unsigned char ibuf[MIDIINBUF];
-               unsigned char obuf[MIDIOUTBUF];
-       } midi;
-
-#ifdef SUPPORT_JOYSTICK
-       struct gameport *gameport;
-#endif
-
-       struct mutex sem;
-};
-
-/* --------------------------------------------------------------------- */
-
-static LIST_HEAD(devs);
-
-/* --------------------------------------------------------------------- */
-
-static inline unsigned ld2(unsigned int x)
-{
-       unsigned r = 0;
-       
-       if (x >= 0x10000) {
-               x >>= 16;
-               r += 16;
-       }
-       if (x >= 0x100) {
-               x >>= 8;
-               r += 8;
-       }
-       if (x >= 0x10) {
-               x >>= 4;
-               r += 4;
-       }
-       if (x >= 4) {
-               x >>= 2;
-               r += 2;
-       }
-       if (x >= 2)
-               r++;
-       return r;
-}
-
-/* --------------------------------------------------------------------- */
-
-static unsigned wait_src_ready(struct es1371_state *s)
-{
-       unsigned int t, r;
-
-       for (t = 0; t < POLL_COUNT; t++) {
-               if (!((r = inl(s->io + ES1371_REG_SRCONV)) & SRC_BUSY))
-                       return r;
-               udelay(1);
-       }
-       printk(KERN_DEBUG PFX "sample rate converter timeout r = 0x%08x\n", r);
-       return r;
-}
-
-static unsigned src_read(struct es1371_state *s, unsigned reg)
-{
-        unsigned int temp,i,orig;
-
-        /* wait for ready */
-        temp = wait_src_ready (s);
-
-        /* we can only access the SRC at certain times, make sure
-           we're allowed to before we read */
-           
-        orig = temp;
-        /* expose the SRC state bits */
-        outl ( (temp & SRC_CTLMASK) | (reg << SRC_RAMADDR_SHIFT) | 0x10000UL,
-               s->io + ES1371_REG_SRCONV);
-
-        /* now, wait for busy and the correct time to read */
-        temp = wait_src_ready (s);
-
-        if ( (temp & 0x00870000UL ) != ( SRC_OKSTATE << 16 )){
-                /* wait for the right state */
-                for (i=0; i<POLL_COUNT; i++){
-                        temp = inl (s->io + ES1371_REG_SRCONV);
-                        if ( (temp & 0x00870000UL ) == ( SRC_OKSTATE << 16 ))
-                                break;
-                }
-        }
-
-        /* hide the state bits */
-        outl ((orig & SRC_CTLMASK) | (reg << SRC_RAMADDR_SHIFT), s->io + ES1371_REG_SRCONV);
-        return temp;
-                        
-                
-}
-
-static void src_write(struct es1371_state *s, unsigned reg, unsigned data)
-{
-      
-       unsigned int r;
-
-       r = wait_src_ready(s) & (SRC_DIS | SRC_DDAC1 | SRC_DDAC2 | SRC_DADC);
-       r |= (reg << SRC_RAMADDR_SHIFT) & SRC_RAMADDR_MASK;
-       r |= (data << SRC_RAMDATA_SHIFT) & SRC_RAMDATA_MASK;
-       outl(r | SRC_WE, s->io + ES1371_REG_SRCONV);
-
-}
-
-/* --------------------------------------------------------------------- */
-
-/* most of the following here is black magic */
-static void set_adc_rate(struct es1371_state *s, unsigned rate)
-{
-       unsigned long flags;
-       unsigned int n, truncm, freq;
-
-       if (rate > 48000)
-               rate = 48000;
-       if (rate < 4000)
-               rate = 4000;
-       n = rate / 3000;
-       if ((1 << n) & ((1 << 15) | (1 << 13) | (1 << 11) | (1 << 9)))
-               n--;
-       truncm = (21 * n - 1) | 1;
-        freq = ((48000UL << 15) / rate) * n;
-       s->adcrate = (48000UL << 15) / (freq / n);
-       spin_lock_irqsave(&s->lock, flags);
-       if (rate >= 24000) {
-               if (truncm > 239)
-                       truncm = 239;
-               src_write(s, SRCREG_ADC+SRCREG_TRUNC_N, 
-                         (((239 - truncm) >> 1) << 9) | (n << 4));
-       } else {
-               if (truncm > 119)
-                       truncm = 119;
-               src_write(s, SRCREG_ADC+SRCREG_TRUNC_N, 
-                         0x8000 | (((119 - truncm) >> 1) << 9) | (n << 4));
-       }               
-       src_write(s, SRCREG_ADC+SRCREG_INT_REGS, 
-                 (src_read(s, SRCREG_ADC+SRCREG_INT_REGS) & 0x00ff) |
-                 ((freq >> 5) & 0xfc00));
-       src_write(s, SRCREG_ADC+SRCREG_VFREQ_FRAC, freq & 0x7fff);
-       src_write(s, SRCREG_VOL_ADC, n << 8);
-       src_write(s, SRCREG_VOL_ADC+1, n << 8);
-       spin_unlock_irqrestore(&s->lock, flags);
-}
-
-
-static void set_dac1_rate(struct es1371_state *s, unsigned rate)
-{
-       unsigned long flags;
-       unsigned int freq, r;
-
-       if (rate > 48000)
-               rate = 48000;
-       if (rate < 4000)
-               rate = 4000;
-        freq = ((rate << 15) + 1500) / 3000;
-       s->dac1rate = (freq * 3000 + 16384) >> 15;
-       spin_lock_irqsave(&s->lock, flags);
-       r = (wait_src_ready(s) & (SRC_DIS | SRC_DDAC2 | SRC_DADC)) | SRC_DDAC1;
-       outl(r, s->io + ES1371_REG_SRCONV);
-       src_write(s, SRCREG_DAC1+SRCREG_INT_REGS, 
-                 (src_read(s, SRCREG_DAC1+SRCREG_INT_REGS) & 0x00ff) |
-                 ((freq >> 5) & 0xfc00));
-       src_write(s, SRCREG_DAC1+SRCREG_VFREQ_FRAC, freq & 0x7fff);
-       r = (wait_src_ready(s) & (SRC_DIS | SRC_DDAC2 | SRC_DADC));
-       outl(r, s->io + ES1371_REG_SRCONV);
-       spin_unlock_irqrestore(&s->lock, flags);
-}
-
-static void set_dac2_rate(struct es1371_state *s, unsigned rate)
-{
-       unsigned long flags;
-       unsigned int freq, r;
-
-       if (rate > 48000)
-               rate = 48000;
-       if (rate < 4000)
-               rate = 4000;
-        freq = ((rate << 15) + 1500) / 3000;
-       s->dac2rate = (freq * 3000 + 16384) >> 15;
-       spin_lock_irqsave(&s->lock, flags);
-       r = (wait_src_ready(s) & (SRC_DIS | SRC_DDAC1 | SRC_DADC)) | SRC_DDAC2;
-       outl(r, s->io + ES1371_REG_SRCONV);
-       src_write(s, SRCREG_DAC2+SRCREG_INT_REGS, 
-                 (src_read(s, SRCREG_DAC2+SRCREG_INT_REGS) & 0x00ff) |
-                 ((freq >> 5) & 0xfc00));
-       src_write(s, SRCREG_DAC2+SRCREG_VFREQ_FRAC, freq & 0x7fff);
-       r = (wait_src_ready(s) & (SRC_DIS | SRC_DDAC1 | SRC_DADC));
-       outl(r, s->io + ES1371_REG_SRCONV);
-       spin_unlock_irqrestore(&s->lock, flags);
-}
-
-/* --------------------------------------------------------------------- */
-
-static void __devinit src_init(struct es1371_state *s)
-{
-        unsigned int i;
-
-        /* before we enable or disable the SRC we need
-           to wait for it to become ready */
-        wait_src_ready(s);
-
-        outl(SRC_DIS, s->io + ES1371_REG_SRCONV);
-
-        for (i = 0; i < 0x80; i++)
-                src_write(s, i, 0);
-
-        src_write(s, SRCREG_DAC1+SRCREG_TRUNC_N, 16 << 4);
-        src_write(s, SRCREG_DAC1+SRCREG_INT_REGS, 16 << 10);
-        src_write(s, SRCREG_DAC2+SRCREG_TRUNC_N, 16 << 4);
-        src_write(s, SRCREG_DAC2+SRCREG_INT_REGS, 16 << 10);
-        src_write(s, SRCREG_VOL_ADC, 1 << 12);
-        src_write(s, SRCREG_VOL_ADC+1, 1 << 12);
-        src_write(s, SRCREG_VOL_DAC1, 1 << 12);
-        src_write(s, SRCREG_VOL_DAC1+1, 1 << 12);
-        src_write(s, SRCREG_VOL_DAC2, 1 << 12);
-        src_write(s, SRCREG_VOL_DAC2+1, 1 << 12);
-        set_adc_rate(s, 22050);
-        set_dac1_rate(s, 22050);
-        set_dac2_rate(s, 22050);
-
-        /* WARNING:
-         * enabling the sample rate converter without properly programming
-         * its parameters causes the chip to lock up (the SRC busy bit will
-         * be stuck high, and I've found no way to rectify this other than
-         * power cycle)
-         */
-        wait_src_ready(s);
-        outl(0, s->io+ES1371_REG_SRCONV);
-}
-
-/* --------------------------------------------------------------------- */
-
-static void wrcodec(struct ac97_codec *codec, u8 addr, u16 data)
-{
-       struct es1371_state *s = (struct es1371_state *)codec->private_data;
-       unsigned long flags;
-       unsigned t, x;
-        
-       spin_lock_irqsave(&s->lock, flags);
-       for (t = 0; t < POLL_COUNT; t++)
-               if (!(inl(s->io+ES1371_REG_CODEC) & CODEC_WIP))
-                       break;
-
-        /* save the current state for later */
-        x = wait_src_ready(s);
-
-        /* enable SRC state data in SRC mux */
-       outl((x & (SRC_DIS | SRC_DDAC1 | SRC_DDAC2 | SRC_DADC)) | 0x00010000,
-            s->io+ES1371_REG_SRCONV);
-
-        /* wait for not busy (state 0) first to avoid
-           transition states */
-        for (t=0; t<POLL_COUNT; t++){
-                if((inl(s->io+ES1371_REG_SRCONV) & 0x00870000) ==0 )
-                    break;
-                udelay(1);
-        }
-        
-        /* wait for a SAFE time to write addr/data and then do it, dammit */
-        for (t=0; t<POLL_COUNT; t++){
-                if((inl(s->io+ES1371_REG_SRCONV) & 0x00870000) ==0x00010000)
-                    break;
-                udelay(1);
-        }
-
-       outl(((addr << CODEC_POADD_SHIFT) & CODEC_POADD_MASK) |
-            ((data << CODEC_PODAT_SHIFT) & CODEC_PODAT_MASK), s->io+ES1371_REG_CODEC);
-
-       /* restore SRC reg */
-       wait_src_ready(s);
-       outl(x, s->io+ES1371_REG_SRCONV);
-       spin_unlock_irqrestore(&s->lock, flags);
-}
-
-static u16 rdcodec(struct ac97_codec *codec, u8 addr)
-{
-       struct es1371_state *s = (struct es1371_state *)codec->private_data;
-       unsigned long flags;
-       unsigned t, x;
-
-       spin_lock_irqsave(&s->lock, flags);
-       
-        /* wait for WIP to go away */
-       for (t = 0; t < 0x1000; t++)
-               if (!(inl(s->io+ES1371_REG_CODEC) & CODEC_WIP))
-                       break;
-
-       /* save the current state for later */
-       x = (wait_src_ready(s) & (SRC_DIS | SRC_DDAC1 | SRC_DDAC2 | SRC_DADC));
-
-       /* enable SRC state data in SRC mux */
-       outl( x | 0x00010000,
-              s->io+ES1371_REG_SRCONV);
-
-        /* wait for not busy (state 0) first to avoid
-           transition states */
-        for (t=0; t<POLL_COUNT; t++){
-                if((inl(s->io+ES1371_REG_SRCONV) & 0x00870000) ==0 )
-                    break;
-                udelay(1);
-        }
-        
-        /* wait for a SAFE time to write addr/data and then do it, dammit */
-        for (t=0; t<POLL_COUNT; t++){
-                if((inl(s->io+ES1371_REG_SRCONV) & 0x00870000) ==0x00010000)
-                    break;
-                udelay(1);
-        }
-
-       outl(((addr << CODEC_POADD_SHIFT) & CODEC_POADD_MASK) | CODEC_PORD, s->io+ES1371_REG_CODEC);
-       /* restore SRC reg */
-       wait_src_ready(s);
-       outl(x, s->io+ES1371_REG_SRCONV);
-
-        /* wait for WIP again */
-       for (t = 0; t < 0x1000; t++)
-               if (!(inl(s->io+ES1371_REG_CODEC) & CODEC_WIP))
-                       break;
-        
-       /* now wait for the stinkin' data (RDY) */
-       for (t = 0; t < POLL_COUNT; t++)
-               if ((x = inl(s->io+ES1371_REG_CODEC)) & CODEC_RDY)
-                       break;
-        
-       spin_unlock_irqrestore(&s->lock, flags);
-       return ((x & CODEC_PIDAT_MASK) >> CODEC_PIDAT_SHIFT);
-}
-
-/* --------------------------------------------------------------------- */
-
-static inline void stop_adc(struct es1371_state *s)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&s->lock, flags);
-       s->ctrl &= ~CTRL_ADC_EN;
-       outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       spin_unlock_irqrestore(&s->lock, flags);
-}      
-
-static inline void stop_dac1(struct es1371_state *s)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&s->lock, flags);
-       s->ctrl &= ~CTRL_DAC1_EN;
-       outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       spin_unlock_irqrestore(&s->lock, flags);
-}      
-
-static inline void stop_dac2(struct es1371_state *s)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&s->lock, flags);
-       s->ctrl &= ~CTRL_DAC2_EN;
-       outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       spin_unlock_irqrestore(&s->lock, flags);
-}      
-
-static void start_dac1(struct es1371_state *s)
-{
-       unsigned long flags;
-       unsigned fragremain, fshift;
-
-       spin_lock_irqsave(&s->lock, flags);
-       if (!(s->ctrl & CTRL_DAC1_EN) && (s->dma_dac1.mapped || s->dma_dac1.count > 0)
-           && s->dma_dac1.ready) {
-               s->ctrl |= CTRL_DAC1_EN;
-               s->sctrl = (s->sctrl & ~(SCTRL_P1LOOPSEL | SCTRL_P1PAUSE | SCTRL_P1SCTRLD)) | SCTRL_P1INTEN;
-               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-               fragremain = ((- s->dma_dac1.hwptr) & (s->dma_dac1.fragsize-1));
-               fshift = sample_shift[(s->sctrl & SCTRL_P1FMT) >> SCTRL_SH_P1FMT];
-               if (fragremain < 2*fshift)
-                       fragremain = s->dma_dac1.fragsize;
-               outl((fragremain >> fshift) - 1, s->io+ES1371_REG_DAC1_SCOUNT);
-               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-               outl((s->dma_dac1.fragsize >> fshift) - 1, s->io+ES1371_REG_DAC1_SCOUNT);
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-}      
-
-static void start_dac2(struct es1371_state *s)
-{
-       unsigned long flags;
-       unsigned fragremain, fshift;
-
-       spin_lock_irqsave(&s->lock, flags);
-       if (!(s->ctrl & CTRL_DAC2_EN) && (s->dma_dac2.mapped || s->dma_dac2.count > 0)
-           && s->dma_dac2.ready) {
-               s->ctrl |= CTRL_DAC2_EN;
-               s->sctrl = (s->sctrl & ~(SCTRL_P2LOOPSEL | SCTRL_P2PAUSE | SCTRL_P2DACSEN | 
-                                        SCTRL_P2ENDINC | SCTRL_P2STINC)) | SCTRL_P2INTEN |
-                       (((s->sctrl & SCTRL_P2FMT) ? 2 : 1) << SCTRL_SH_P2ENDINC) | 
-                       (0 << SCTRL_SH_P2STINC);
-               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-               fragremain = ((- s->dma_dac2.hwptr) & (s->dma_dac2.fragsize-1));
-               fshift = sample_shift[(s->sctrl & SCTRL_P2FMT) >> SCTRL_SH_P2FMT];
-               if (fragremain < 2*fshift)
-                       fragremain = s->dma_dac2.fragsize;
-               outl((fragremain >> fshift) - 1, s->io+ES1371_REG_DAC2_SCOUNT);
-               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-               outl((s->dma_dac2.fragsize >> fshift) - 1, s->io+ES1371_REG_DAC2_SCOUNT);
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-}      
-
-static void start_adc(struct es1371_state *s)
-{
-       unsigned long flags;
-       unsigned fragremain, fshift;
-
-       spin_lock_irqsave(&s->lock, flags);
-       if (!(s->ctrl & CTRL_ADC_EN) && (s->dma_adc.mapped || s->dma_adc.count < (signed)(s->dma_adc.dmasize - 2*s->dma_adc.fragsize))
-           && s->dma_adc.ready) {
-               s->ctrl |= CTRL_ADC_EN;
-               s->sctrl = (s->sctrl & ~SCTRL_R1LOOPSEL) | SCTRL_R1INTEN;
-               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-               fragremain = ((- s->dma_adc.hwptr) & (s->dma_adc.fragsize-1));
-               fshift = sample_shift[(s->sctrl & SCTRL_R1FMT) >> SCTRL_SH_R1FMT];
-               if (fragremain < 2*fshift)
-                       fragremain = s->dma_adc.fragsize;
-               outl((fragremain >> fshift) - 1, s->io+ES1371_REG_ADC_SCOUNT);
-               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-               outl((s->dma_adc.fragsize >> fshift) - 1, s->io+ES1371_REG_ADC_SCOUNT);
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-}      
-
-/* --------------------------------------------------------------------- */
-
-#define DMABUF_DEFAULTORDER (17-PAGE_SHIFT)
-#define DMABUF_MINORDER 1
-
-
-static inline void dealloc_dmabuf(struct es1371_state *s, struct dmabuf *db)
-{
-       struct page *page, *pend;
-
-       if (db->rawbuf) {
-               /* undo marking the pages as reserved */
-               pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
-               for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-                       ClearPageReserved(page);
-               pci_free_consistent(s->dev, PAGE_SIZE << db->buforder, db->rawbuf, db->dmaaddr);
-       }
-       db->rawbuf = NULL;
-       db->mapped = db->ready = 0;
-}
-
-static int prog_dmabuf(struct es1371_state *s, struct dmabuf *db, unsigned rate, unsigned fmt, unsigned reg)
-{
-       int order;
-       unsigned bytepersec;
-       unsigned bufs;
-       struct page *page, *pend;
-
-       db->hwptr = db->swptr = db->total_bytes = db->count = db->error = db->endcleared = 0;
-       if (!db->rawbuf) {
-               db->ready = db->mapped = 0;
-               for (order = DMABUF_DEFAULTORDER; order >= DMABUF_MINORDER; order--)
-                       if ((db->rawbuf = pci_alloc_consistent(s->dev, PAGE_SIZE << order, &db->dmaaddr)))
-                               break;
-               if (!db->rawbuf)
-                       return -ENOMEM;
-               db->buforder = order;
-               /* now mark the pages as reserved; otherwise remap_pfn_range doesn't do what we want */
-               pend = virt_to_page(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
-               for (page = virt_to_page(db->rawbuf); page <= pend; page++)
-                       SetPageReserved(page);
-       }
-       fmt &= ES1371_FMT_MASK;
-       bytepersec = rate << sample_shift[fmt];
-       bufs = PAGE_SIZE << db->buforder;
-       if (db->ossfragshift) {
-               if ((1000 << db->ossfragshift) < bytepersec)
-                       db->fragshift = ld2(bytepersec/1000);
-               else
-                       db->fragshift = db->ossfragshift;
-       } else {
-               db->fragshift = ld2(bytepersec/100/(db->subdivision ? db->subdivision : 1));
-               if (db->fragshift < 3)
-                       db->fragshift = 3;
-       }
-       db->numfrag = bufs >> db->fragshift;
-       while (db->numfrag < 4 && db->fragshift > 3) {
-               db->fragshift--;
-               db->numfrag = bufs >> db->fragshift;
-       }
-       db->fragsize = 1 << db->fragshift;
-       if (db->ossmaxfrags >= 4 && db->ossmaxfrags < db->numfrag)
-               db->numfrag = db->ossmaxfrags;
-       db->fragsamples = db->fragsize >> sample_shift[fmt];
-       db->dmasize = db->numfrag << db->fragshift;
-       memset(db->rawbuf, (fmt & ES1371_FMT_S16) ? 0 : 0x80, db->dmasize);
-       outl((reg >> 8) & 15, s->io+ES1371_REG_MEMPAGE);
-       outl(db->dmaaddr, s->io+(reg & 0xff));
-       outl((db->dmasize >> 2)-1, s->io+((reg + 4) & 0xff));
-       db->enabled = 1;
-       db->ready = 1;
-       return 0;
-}
-
-static inline int prog_dmabuf_adc(struct es1371_state *s)
-{
-       stop_adc(s);
-       return prog_dmabuf(s, &s->dma_adc, s->adcrate, (s->sctrl >> SCTRL_SH_R1FMT) & ES1371_FMT_MASK, 
-                          ES1371_REG_ADC_FRAMEADR);
-}
-
-static inline int prog_dmabuf_dac2(struct es1371_state *s)
-{
-       stop_dac2(s);
-       return prog_dmabuf(s, &s->dma_dac2, s->dac2rate, (s->sctrl >> SCTRL_SH_P2FMT) & ES1371_FMT_MASK, 
-                          ES1371_REG_DAC2_FRAMEADR);
-}
-
-static inline int prog_dmabuf_dac1(struct es1371_state *s)
-{
-       stop_dac1(s);
-       return prog_dmabuf(s, &s->dma_dac1, s->dac1rate, (s->sctrl >> SCTRL_SH_P1FMT) & ES1371_FMT_MASK,
-                          ES1371_REG_DAC1_FRAMEADR);
-}
-
-static inline unsigned get_hwptr(struct es1371_state *s, struct dmabuf *db, unsigned reg)
-{
-       unsigned hwptr, diff;
-
-       outl((reg >> 8) & 15, s->io+ES1371_REG_MEMPAGE);
-       hwptr = (inl(s->io+(reg & 0xff)) >> 14) & 0x3fffc;
-       diff = (db->dmasize + hwptr - db->hwptr) % db->dmasize;
-       db->hwptr = hwptr;
-       return diff;
-}
-
-static inline void clear_advance(void *buf, unsigned bsize, unsigned bptr, unsigned len, unsigned char c)
-{
-       if (bptr + len > bsize) {
-               unsigned x = bsize - bptr;
-               memset(((char *)buf) + bptr, c, x);
-               bptr = 0;
-               len -= x;
-       }
-       memset(((char *)buf) + bptr, c, len);
-}
-
-/* call with spinlock held! */
-static void es1371_update_ptr(struct es1371_state *s)
-{
-       int diff;
-
-       /* update ADC pointer */
-       if (s->ctrl & CTRL_ADC_EN) {
-               diff = get_hwptr(s, &s->dma_adc, ES1371_REG_ADC_FRAMECNT);
-               s->dma_adc.total_bytes += diff;
-               s->dma_adc.count += diff;
-               if (s->dma_adc.count >= (signed)s->dma_adc.fragsize) 
-                       wake_up(&s->dma_adc.wait);
-               if (!s->dma_adc.mapped) {
-                       if (s->dma_adc.count > (signed)(s->dma_adc.dmasize - ((3 * s->dma_adc.fragsize) >> 1))) {
-                               s->ctrl &= ~CTRL_ADC_EN;
-                               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-                               s->dma_adc.error++;
-                       }
-               }
-       }
-       /* update DAC1 pointer */
-       if (s->ctrl & CTRL_DAC1_EN) {
-               diff = get_hwptr(s, &s->dma_dac1, ES1371_REG_DAC1_FRAMECNT);
-               s->dma_dac1.total_bytes += diff;
-               if (s->dma_dac1.mapped) {
-                       s->dma_dac1.count += diff;
-                       if (s->dma_dac1.count >= (signed)s->dma_dac1.fragsize)
-                               wake_up(&s->dma_dac1.wait);
-               } else {
-                       s->dma_dac1.count -= diff;
-                       if (s->dma_dac1.count <= 0) {
-                               s->ctrl &= ~CTRL_DAC1_EN;
-                               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-                               s->dma_dac1.error++;
-                       } else if (s->dma_dac1.count <= (signed)s->dma_dac1.fragsize && !s->dma_dac1.endcleared) {
-                               clear_advance(s->dma_dac1.rawbuf, s->dma_dac1.dmasize, s->dma_dac1.swptr, 
-                                             s->dma_dac1.fragsize, (s->sctrl & SCTRL_P1SEB) ? 0 : 0x80);
-                               s->dma_dac1.endcleared = 1;
-                       }
-                       if (s->dma_dac1.count + (signed)s->dma_dac1.fragsize <= (signed)s->dma_dac1.dmasize)
-                               wake_up(&s->dma_dac1.wait);
-               }
-       }
-       /* update DAC2 pointer */
-       if (s->ctrl & CTRL_DAC2_EN) {
-               diff = get_hwptr(s, &s->dma_dac2, ES1371_REG_DAC2_FRAMECNT);
-               s->dma_dac2.total_bytes += diff;
-               if (s->dma_dac2.mapped) {
-                       s->dma_dac2.count += diff;
-                       if (s->dma_dac2.count >= (signed)s->dma_dac2.fragsize)
-                               wake_up(&s->dma_dac2.wait);
-               } else {
-                       s->dma_dac2.count -= diff;
-                       if (s->dma_dac2.count <= 0) {
-                               s->ctrl &= ~CTRL_DAC2_EN;
-                               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-                               s->dma_dac2.error++;
-                       } else if (s->dma_dac2.count <= (signed)s->dma_dac2.fragsize && !s->dma_dac2.endcleared) {
-                               clear_advance(s->dma_dac2.rawbuf, s->dma_dac2.dmasize, s->dma_dac2.swptr, 
-                                             s->dma_dac2.fragsize, (s->sctrl & SCTRL_P2SEB) ? 0 : 0x80);
-                               s->dma_dac2.endcleared = 1;
-                       }
-                       if (s->dma_dac2.count + (signed)s->dma_dac2.fragsize <= (signed)s->dma_dac2.dmasize)
-                               wake_up(&s->dma_dac2.wait);
-               }
-       }
-}
-
-/* hold spinlock for the following! */
-static void es1371_handle_midi(struct es1371_state *s)
-{
-       unsigned char ch;
-       int wake;
-
-       if (!(s->ctrl & CTRL_UART_EN))
-               return;
-       wake = 0;
-       while (inb(s->io+ES1371_REG_UART_STATUS) & USTAT_RXRDY) {
-               ch = inb(s->io+ES1371_REG_UART_DATA);
-               if (s->midi.icnt < MIDIINBUF) {
-                       s->midi.ibuf[s->midi.iwr] = ch;
-                       s->midi.iwr = (s->midi.iwr + 1) % MIDIINBUF;
-                       s->midi.icnt++;
-               }
-               wake = 1;
-       }
-       if (wake)
-               wake_up(&s->midi.iwait);
-       wake = 0;
-       while ((inb(s->io+ES1371_REG_UART_STATUS) & USTAT_TXRDY) && s->midi.ocnt > 0) {
-               outb(s->midi.obuf[s->midi.ord], s->io+ES1371_REG_UART_DATA);
-               s->midi.ord = (s->midi.ord + 1) % MIDIOUTBUF;
-               s->midi.ocnt--;
-               if (s->midi.ocnt < MIDIOUTBUF-16)
-                       wake = 1;
-       }
-       if (wake)
-               wake_up(&s->midi.owait);
-       outb((s->midi.ocnt > 0) ? UCTRL_RXINTEN | UCTRL_ENA_TXINT : UCTRL_RXINTEN, s->io+ES1371_REG_UART_CONTROL);
-}
-
-static irqreturn_t es1371_interrupt(int irq, void *dev_id)
-{
-        struct es1371_state *s = dev_id;
-       unsigned int intsrc, sctl;
-       
-       /* fastpath out, to ease interrupt sharing */
-       intsrc = inl(s->io+ES1371_REG_STATUS);
-       if (!(intsrc & 0x80000000))
-               return IRQ_NONE;
-       spin_lock(&s->lock);
-       /* clear audio interrupts first */
-       sctl = s->sctrl;
-       if (intsrc & STAT_ADC)
-               sctl &= ~SCTRL_R1INTEN;
-       if (intsrc & STAT_DAC1)
-               sctl &= ~SCTRL_P1INTEN;
-       if (intsrc & STAT_DAC2)
-               sctl &= ~SCTRL_P2INTEN;
-       outl(sctl, s->io+ES1371_REG_SERIAL_CONTROL);
-       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-       es1371_update_ptr(s);
-       es1371_handle_midi(s);
-       spin_unlock(&s->lock);
-       return IRQ_HANDLED;
-}
-
-/* --------------------------------------------------------------------- */
-
-static const char invalid_magic[] = KERN_CRIT PFX "invalid magic value\n";
-
-#define VALIDATE_STATE(s)                         \
-({                                                \
-       if (!(s) || (s)->magic != ES1371_MAGIC) { \
-               printk(invalid_magic);            \
-               return -ENXIO;                    \
-       }                                         \
-})
-
-/* --------------------------------------------------------------------- */
-
-/* Conversion table for S/PDIF PCM volume emulation through the SRC */
-/* dB-linear table of DAC vol values; -0dB to -46.5dB with mute */
-static const unsigned short DACVolTable[101] =
-{
-       0x1000, 0x0f2a, 0x0e60, 0x0da0, 0x0cea, 0x0c3e, 0x0b9a, 0x0aff,
-       0x0a6d, 0x09e1, 0x095e, 0x08e1, 0x086a, 0x07fa, 0x078f, 0x072a,
-       0x06cb, 0x0670, 0x061a, 0x05c9, 0x057b, 0x0532, 0x04ed, 0x04ab,
-       0x046d, 0x0432, 0x03fa, 0x03c5, 0x0392, 0x0363, 0x0335, 0x030b,
-       0x02e2, 0x02bc, 0x0297, 0x0275, 0x0254, 0x0235, 0x0217, 0x01fb,
-       0x01e1, 0x01c8, 0x01b0, 0x0199, 0x0184, 0x0170, 0x015d, 0x014b,
-       0x0139, 0x0129, 0x0119, 0x010b, 0x00fd, 0x00f0, 0x00e3, 0x00d7,
-       0x00cc, 0x00c1, 0x00b7, 0x00ae, 0x00a5, 0x009c, 0x0094, 0x008c,
-       0x0085, 0x007e, 0x0077, 0x0071, 0x006b, 0x0066, 0x0060, 0x005b,
-       0x0057, 0x0052, 0x004e, 0x004a, 0x0046, 0x0042, 0x003f, 0x003c,
-       0x0038, 0x0036, 0x0033, 0x0030, 0x002e, 0x002b, 0x0029, 0x0027,
-       0x0025, 0x0023, 0x0021, 0x001f, 0x001e, 0x001c, 0x001b, 0x0019,
-       0x0018, 0x0017, 0x0016, 0x0014, 0x0000
-};
-
-/*
- * when we are in S/PDIF mode, we want to disable any analog output so
- * we filter the mixer ioctls 
- */
-static int mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd, unsigned long arg)
-{
-       struct es1371_state *s = (struct es1371_state *)codec->private_data;
-       int val;
-       unsigned long flags;
-       unsigned int left, right;
-
-       VALIDATE_STATE(s);
-       /* filter mixer ioctls to catch PCM and MASTER volume when in S/PDIF mode */
-       if (s->spdif_volume == -1)
-               return codec->mixer_ioctl(codec, cmd, arg);
-       switch (cmd) {
-       case SOUND_MIXER_WRITE_VOLUME:
-               return 0;
-
-       case SOUND_MIXER_WRITE_PCM:   /* use SRC for PCM volume */
-               if (get_user(val, (int __user *)arg))
-                       return -EFAULT;
-               right = ((val >> 8)  & 0xff);
-               left = (val  & 0xff);
-               if (right > 100)
-                       right = 100;
-               if (left > 100)
-                       left = 100;
-               s->spdif_volume = (right << 8) | left;
-               spin_lock_irqsave(&s->lock, flags);
-               src_write(s, SRCREG_VOL_DAC2, DACVolTable[100 - left]);
-               src_write(s, SRCREG_VOL_DAC2+1, DACVolTable[100 - right]);
-               spin_unlock_irqrestore(&s->lock, flags);
-               return 0;
-       
-       case SOUND_MIXER_READ_PCM:
-               return put_user(s->spdif_volume, (int __user *)arg);
-       }
-       return codec->mixer_ioctl(codec, cmd, arg);
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * AC97 Mixer Register to Connections mapping of the Concert 97 board
- *
- * AC97_MASTER_VOL_STEREO   Line Out
- * AC97_MASTER_VOL_MONO     TAD Output
- * AC97_PCBEEP_VOL          none
- * AC97_PHONE_VOL           TAD Input (mono)
- * AC97_MIC_VOL             MIC Input (mono)
- * AC97_LINEIN_VOL          Line Input (stereo)
- * AC97_CD_VOL              CD Input (stereo)
- * AC97_VIDEO_VOL           none
- * AC97_AUX_VOL             Aux Input (stereo)
- * AC97_PCMOUT_VOL          Wave Output (stereo)
- */
-
-static int es1371_open_mixdev(struct inode *inode, struct file *file)
-{
-       int minor = iminor(inode);
-       struct list_head *list;
-       struct es1371_state *s;
-
-       for (list = devs.next; ; list = list->next) {
-               if (list == &devs)
-                       return -ENODEV;
-               s = list_entry(list, struct es1371_state, devs);
-               if (s->codec->dev_mixer == minor)
-                       break;
-       }
-               VALIDATE_STATE(s);
-       file->private_data = s;
-       return nonseekable_open(inode, file);
-}
-
-static int es1371_release_mixdev(struct inode *inode, struct file *file)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       
-       VALIDATE_STATE(s);
-       return 0;
-}
-
-static int es1371_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       struct ac97_codec *codec = s->codec;
-
-       return mixdev_ioctl(codec, cmd, arg);
-}
-
-static /*const*/ struct file_operations es1371_mixer_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .ioctl          = es1371_ioctl_mixdev,
-       .open           = es1371_open_mixdev,
-       .release        = es1371_release_mixdev,
-};
-
-/* --------------------------------------------------------------------- */
-
-static int drain_dac1(struct es1371_state *s, int nonblock)
-{
-       DECLARE_WAITQUEUE(wait, current);
-       unsigned long flags;
-       int count, tmo;
-       
-       if (s->dma_dac1.mapped || !s->dma_dac1.ready)
-               return 0;
-        add_wait_queue(&s->dma_dac1.wait, &wait);
-        for (;;) {
-               __set_current_state(TASK_INTERRUPTIBLE);
-                spin_lock_irqsave(&s->lock, flags);
-               count = s->dma_dac1.count;
-                spin_unlock_irqrestore(&s->lock, flags);
-               if (count <= 0)
-                       break;
-               if (signal_pending(current))
-                        break;
-                if (nonblock) {
-                        remove_wait_queue(&s->dma_dac1.wait, &wait);
-                        set_current_state(TASK_RUNNING);
-                        return -EBUSY;
-                }
-               tmo = 3 * HZ * (count + s->dma_dac1.fragsize) / 2 / s->dac1rate;
-               tmo >>= sample_shift[(s->sctrl & SCTRL_P1FMT) >> SCTRL_SH_P1FMT];
-               if (!schedule_timeout(tmo + 1))
-                       DBG(printk(KERN_DEBUG PFX "dac1 dma timed out??\n");)
-        }
-        remove_wait_queue(&s->dma_dac1.wait, &wait);
-        set_current_state(TASK_RUNNING);
-        if (signal_pending(current))
-                return -ERESTARTSYS;
-        return 0;
-}
-
-static int drain_dac2(struct es1371_state *s, int nonblock)
-{
-       DECLARE_WAITQUEUE(wait, current);
-       unsigned long flags;
-       int count, tmo;
-
-       if (s->dma_dac2.mapped || !s->dma_dac2.ready)
-               return 0;
-        add_wait_queue(&s->dma_dac2.wait, &wait);
-        for (;;) {
-               __set_current_state(TASK_UNINTERRUPTIBLE);
-                spin_lock_irqsave(&s->lock, flags);
-               count = s->dma_dac2.count;
-                spin_unlock_irqrestore(&s->lock, flags);
-               if (count <= 0)
-                       break;
-               if (signal_pending(current))
-                        break;
-                if (nonblock) {
-                        remove_wait_queue(&s->dma_dac2.wait, &wait);
-                        set_current_state(TASK_RUNNING);
-                        return -EBUSY;
-                }
-               tmo = 3 * HZ * (count + s->dma_dac2.fragsize) / 2 / s->dac2rate;
-               tmo >>= sample_shift[(s->sctrl & SCTRL_P2FMT) >> SCTRL_SH_P2FMT];
-               if (!schedule_timeout(tmo + 1))
-                       DBG(printk(KERN_DEBUG PFX "dac2 dma timed out??\n");)
-        }
-        remove_wait_queue(&s->dma_dac2.wait, &wait);
-        set_current_state(TASK_RUNNING);
-        if (signal_pending(current))
-                return -ERESTARTSYS;
-        return 0;
-}
-
-/* --------------------------------------------------------------------- */
-
-static ssize_t es1371_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
-       ssize_t ret = 0;
-       unsigned long flags;
-       unsigned swptr;
-       int cnt;
-
-       VALIDATE_STATE(s);
-       if (s->dma_adc.mapped)
-               return -ENXIO;
-       if (!access_ok(VERIFY_WRITE, buffer, count))
-               return -EFAULT;
-       mutex_lock(&s->sem);
-       if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
-               goto out2;
-       
-       add_wait_queue(&s->dma_adc.wait, &wait);
-       while (count > 0) {
-               spin_lock_irqsave(&s->lock, flags);
-               swptr = s->dma_adc.swptr;
-               cnt = s->dma_adc.dmasize-swptr;
-               if (s->dma_adc.count < cnt)
-                       cnt = s->dma_adc.count;
-               if (cnt <= 0)
-                       __set_current_state(TASK_INTERRUPTIBLE);
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (cnt > count)
-                       cnt = count;
-               if (cnt <= 0) {
-                       if (s->dma_adc.enabled)
-                               start_adc(s);
-                       if (file->f_flags & O_NONBLOCK) {
-                               if (!ret)
-                                       ret = -EAGAIN;
-                               goto out;
-                       }
-                       mutex_unlock(&s->sem);
-                       schedule();
-                       if (signal_pending(current)) {
-                               if (!ret)
-                                       ret = -ERESTARTSYS;
-                               goto out2;
-                       }
-                       mutex_lock(&s->sem);
-                       if (s->dma_adc.mapped)
-                       {
-                               ret = -ENXIO;
-                               goto out;
-                       }
-                       continue;
-               }
-               if (copy_to_user(buffer, s->dma_adc.rawbuf + swptr, cnt)) {
-                       if (!ret)
-                               ret = -EFAULT;
-                       goto out;
-               }
-               swptr = (swptr + cnt) % s->dma_adc.dmasize;
-               spin_lock_irqsave(&s->lock, flags);
-               s->dma_adc.swptr = swptr;
-               s->dma_adc.count -= cnt;
-               spin_unlock_irqrestore(&s->lock, flags);
-               count -= cnt;
-               buffer += cnt;
-               ret += cnt;
-               if (s->dma_adc.enabled)
-                       start_adc(s);
-       }
-out:
-       mutex_unlock(&s->sem);
-out2:
-       remove_wait_queue(&s->dma_adc.wait, &wait);
-       set_current_state(TASK_RUNNING);
-       return ret;
-}
-
-static ssize_t es1371_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
-       ssize_t ret;
-       unsigned long flags;
-       unsigned swptr;
-       int cnt;
-
-       VALIDATE_STATE(s);
-       if (s->dma_dac2.mapped)
-               return -ENXIO;
-       if (!access_ok(VERIFY_READ, buffer, count))
-               return -EFAULT;
-       mutex_lock(&s->sem);
-       if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s)))
-               goto out3;
-       ret = 0;
-       add_wait_queue(&s->dma_dac2.wait, &wait);
-       while (count > 0) {
-               spin_lock_irqsave(&s->lock, flags);
-               if (s->dma_dac2.count < 0) {
-                       s->dma_dac2.count = 0;
-                       s->dma_dac2.swptr = s->dma_dac2.hwptr;
-               }
-               swptr = s->dma_dac2.swptr;
-               cnt = s->dma_dac2.dmasize-swptr;
-               if (s->dma_dac2.count + cnt > s->dma_dac2.dmasize)
-                       cnt = s->dma_dac2.dmasize - s->dma_dac2.count;
-               if (cnt <= 0)
-                       __set_current_state(TASK_INTERRUPTIBLE);
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (cnt > count)
-                       cnt = count;
-               if (cnt <= 0) {
-                       if (s->dma_dac2.enabled)
-                               start_dac2(s);
-                       if (file->f_flags & O_NONBLOCK) {
-                               if (!ret)
-                                       ret = -EAGAIN;
-                               goto out;
-                       }       
-                       mutex_unlock(&s->sem);
-                       schedule();
-                       if (signal_pending(current)) {
-                               if (!ret)
-                                       ret = -ERESTARTSYS;
-                               goto out2;
-                       }
-                       mutex_lock(&s->sem);
-                       if (s->dma_dac2.mapped)
-                       {
-                               ret = -ENXIO;
-                               goto out;
-                       }
-                       continue;
-               }
-               if (copy_from_user(s->dma_dac2.rawbuf + swptr, buffer, cnt)) {
-                       if (!ret)
-                               ret = -EFAULT;
-                       goto out;
-               }
-               swptr = (swptr + cnt) % s->dma_dac2.dmasize;
-               spin_lock_irqsave(&s->lock, flags);
-               s->dma_dac2.swptr = swptr;
-               s->dma_dac2.count += cnt;
-               s->dma_dac2.endcleared = 0;
-               spin_unlock_irqrestore(&s->lock, flags);
-               count -= cnt;
-               buffer += cnt;
-               ret += cnt;
-               if (s->dma_dac2.enabled)
-                       start_dac2(s);
-       }
-out:
-       mutex_unlock(&s->sem);
-out2:
-       remove_wait_queue(&s->dma_dac2.wait, &wait);
-out3:  
-       set_current_state(TASK_RUNNING);
-       return ret;
-}
-
-/* No kernel lock - we have our own spinlock */
-static unsigned int es1371_poll(struct file *file, struct poll_table_struct *wait)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       unsigned long flags;
-       unsigned int mask = 0;
-
-       VALIDATE_STATE(s);
-       if (file->f_mode & FMODE_WRITE) {
-               if (!s->dma_dac2.ready && prog_dmabuf_dac2(s))
-                       return 0;
-               poll_wait(file, &s->dma_dac2.wait, wait);
-       }
-       if (file->f_mode & FMODE_READ) {
-               if (!s->dma_adc.ready && prog_dmabuf_adc(s))
-                       return 0;
-               poll_wait(file, &s->dma_adc.wait, wait);
-       }
-       spin_lock_irqsave(&s->lock, flags);
-       es1371_update_ptr(s);
-       if (file->f_mode & FMODE_READ) {
-                       if (s->dma_adc.count >= (signed)s->dma_adc.fragsize)
-                               mask |= POLLIN | POLLRDNORM;
-       }
-       if (file->f_mode & FMODE_WRITE) {
-               if (s->dma_dac2.mapped) {
-                       if (s->dma_dac2.count >= (signed)s->dma_dac2.fragsize) 
-                               mask |= POLLOUT | POLLWRNORM;
-               } else {
-                       if ((signed)s->dma_dac2.dmasize >= s->dma_dac2.count + (signed)s->dma_dac2.fragsize)
-                               mask |= POLLOUT | POLLWRNORM;
-               }
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-       return mask;
-}
-
-static int es1371_mmap(struct file *file, struct vm_area_struct *vma)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       struct dmabuf *db;
-       int ret = 0;
-       unsigned long size;
-
-       VALIDATE_STATE(s);
-       lock_kernel();
-       mutex_lock(&s->sem);
-       
-       if (vma->vm_flags & VM_WRITE) {
-               if ((ret = prog_dmabuf_dac2(s)) != 0) {
-                       goto out;
-               }
-               db = &s->dma_dac2;
-       } else if (vma->vm_flags & VM_READ) {
-               if ((ret = prog_dmabuf_adc(s)) != 0) {
-                       goto out;
-               }
-               db = &s->dma_adc;
-       } else {
-               ret = -EINVAL;
-               goto out;
-       }
-       if (vma->vm_pgoff != 0) {
-               ret = -EINVAL;
-               goto out;
-       }
-       size = vma->vm_end - vma->vm_start;
-       if (size > (PAGE_SIZE << db->buforder)) {
-               ret = -EINVAL;
-               goto out;
-       }
-       if (remap_pfn_range(vma, vma->vm_start,
-                               virt_to_phys(db->rawbuf) >> PAGE_SHIFT,
-                               size, vma->vm_page_prot)) {
-               ret = -EAGAIN;
-               goto out;
-       }
-       db->mapped = 1;
-out:
-       mutex_unlock(&s->sem);
-       unlock_kernel();
-       return ret;
-}
-
-static int es1371_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       unsigned long flags;
-        audio_buf_info abinfo;
-        count_info cinfo;
-       int count;
-       int val, mapped, ret;
-       void __user *argp = (void __user *)arg;
-       int __user *p = argp;
-
-       VALIDATE_STATE(s);
-        mapped = ((file->f_mode & FMODE_WRITE) && s->dma_dac2.mapped) ||
-               ((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
-       switch (cmd) {
-       case OSS_GETVERSION:
-               return put_user(SOUND_VERSION, p);
-
-       case SNDCTL_DSP_SYNC:
-               if (file->f_mode & FMODE_WRITE)
-                       return drain_dac2(s, 0/*file->f_flags & O_NONBLOCK*/);
-               return 0;
-               
-       case SNDCTL_DSP_SETDUPLEX:
-               return 0;
-
-       case SNDCTL_DSP_GETCAPS:
-               return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
-               
-        case SNDCTL_DSP_RESET:
-               if (file->f_mode & FMODE_WRITE) {
-                       stop_dac2(s);
-                       synchronize_irq(s->irq);
-                       s->dma_dac2.swptr = s->dma_dac2.hwptr = s->dma_dac2.count = s->dma_dac2.total_bytes = 0;
-               }
-               if (file->f_mode & FMODE_READ) {
-                       stop_adc(s);
-                       synchronize_irq(s->irq);
-                       s->dma_adc.swptr = s->dma_adc.hwptr = s->dma_adc.count = s->dma_adc.total_bytes = 0;
-               }
-               return 0;
-
-        case SNDCTL_DSP_SPEED:
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (val >= 0) {
-                       if (file->f_mode & FMODE_READ) {
-                               stop_adc(s);
-                               s->dma_adc.ready = 0;
-                               set_adc_rate(s, val);
-                       }
-                       if (file->f_mode & FMODE_WRITE) {
-                               stop_dac2(s);
-                               s->dma_dac2.ready = 0;
-                               set_dac2_rate(s, val);
-                       }
-               }
-               return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, p);
-
-        case SNDCTL_DSP_STEREO:
-               if (get_user(val, p))
-                       return -EFAULT;
-               if (file->f_mode & FMODE_READ) {
-                       stop_adc(s);
-                       s->dma_adc.ready = 0;
-                       spin_lock_irqsave(&s->lock, flags);
-                       if (val)
-                               s->sctrl |= SCTRL_R1SMB;
-                       else
-                               s->sctrl &= ~SCTRL_R1SMB;
-                       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                       spin_unlock_irqrestore(&s->lock, flags);
-               }
-               if (file->f_mode & FMODE_WRITE) {
-                       stop_dac2(s);
-                       s->dma_dac2.ready = 0;
-                       spin_lock_irqsave(&s->lock, flags);
-                       if (val)
-                               s->sctrl |= SCTRL_P2SMB;
-                       else
-                               s->sctrl &= ~SCTRL_P2SMB;
-                       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                       spin_unlock_irqrestore(&s->lock, flags);
-                }
-               return 0;
-
-        case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (val != 0) {
-                       if (file->f_mode & FMODE_READ) {
-                               stop_adc(s);
-                               s->dma_adc.ready = 0;
-                               spin_lock_irqsave(&s->lock, flags);
-                               if (val >= 2)
-                                       s->sctrl |= SCTRL_R1SMB;
-                               else
-                                       s->sctrl &= ~SCTRL_R1SMB;
-                               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                               spin_unlock_irqrestore(&s->lock, flags);
-                       }
-                       if (file->f_mode & FMODE_WRITE) {
-                               stop_dac2(s);
-                               s->dma_dac2.ready = 0;
-                               spin_lock_irqsave(&s->lock, flags);
-                               if (val >= 2)
-                                       s->sctrl |= SCTRL_P2SMB;
-                               else
-                                       s->sctrl &= ~SCTRL_P2SMB;
-                               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                               spin_unlock_irqrestore(&s->lock, flags);
-                       }
-               }
-               return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, p);
-               
-       case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, p);
-               
-       case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-               if (get_user(val, p))
-                       return -EFAULT;
-               if (val != AFMT_QUERY) {
-                       if (file->f_mode & FMODE_READ) {
-                               stop_adc(s);
-                               s->dma_adc.ready = 0;
-                               spin_lock_irqsave(&s->lock, flags);
-                               if (val == AFMT_S16_LE)
-                                       s->sctrl |= SCTRL_R1SEB;
-                               else
-                                       s->sctrl &= ~SCTRL_R1SEB;
-                               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                               spin_unlock_irqrestore(&s->lock, flags);
-                       }
-                       if (file->f_mode & FMODE_WRITE) {
-                               stop_dac2(s);
-                               s->dma_dac2.ready = 0;
-                               spin_lock_irqsave(&s->lock, flags);
-                               if (val == AFMT_S16_LE)
-                                       s->sctrl |= SCTRL_P2SEB;
-                               else
-                                       s->sctrl &= ~SCTRL_P2SEB;
-                               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                               spin_unlock_irqrestore(&s->lock, flags);
-                       }
-               }
-               return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 
-                               AFMT_S16_LE : AFMT_U8, p);
-               
-       case SNDCTL_DSP_POST:
-                return 0;
-
-        case SNDCTL_DSP_GETTRIGGER:
-               val = 0;
-               if (file->f_mode & FMODE_READ && s->ctrl & CTRL_ADC_EN) 
-                       val |= PCM_ENABLE_INPUT;
-               if (file->f_mode & FMODE_WRITE && s->ctrl & CTRL_DAC2_EN) 
-                       val |= PCM_ENABLE_OUTPUT;
-               return put_user(val, p);
-               
-       case SNDCTL_DSP_SETTRIGGER:
-               if (get_user(val, p))
-                       return -EFAULT;
-               if (file->f_mode & FMODE_READ) {
-                       if (val & PCM_ENABLE_INPUT) {
-                               if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
-                                       return ret;
-                               s->dma_adc.enabled = 1;
-                               start_adc(s);
-                       } else {
-                               s->dma_adc.enabled = 0;
-                               stop_adc(s);
-                       }
-               }
-               if (file->f_mode & FMODE_WRITE) {
-                       if (val & PCM_ENABLE_OUTPUT) {
-                               if (!s->dma_dac2.ready && (ret = prog_dmabuf_dac2(s)))
-                                       return ret;
-                               s->dma_dac2.enabled = 1;
-                               start_dac2(s);
-                       } else {
-                               s->dma_dac2.enabled = 0;
-                               stop_dac2(s);
-                       }
-               }
-               return 0;
-
-       case SNDCTL_DSP_GETOSPACE:
-               if (!(file->f_mode & FMODE_WRITE))
-                       return -EINVAL;
-               if (!s->dma_dac2.ready && (val = prog_dmabuf_dac2(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-               abinfo.fragsize = s->dma_dac2.fragsize;
-               count = s->dma_dac2.count;
-               if (count < 0)
-                       count = 0;
-                abinfo.bytes = s->dma_dac2.dmasize - count;
-                abinfo.fragstotal = s->dma_dac2.numfrag;
-                abinfo.fragments = abinfo.bytes >> s->dma_dac2.fragshift;      
-               spin_unlock_irqrestore(&s->lock, flags);
-               return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
-
-       case SNDCTL_DSP_GETISPACE:
-               if (!(file->f_mode & FMODE_READ))
-                       return -EINVAL;
-               if (!s->dma_adc.ready && (val = prog_dmabuf_adc(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-               abinfo.fragsize = s->dma_adc.fragsize;
-               count = s->dma_adc.count;
-               if (count < 0)
-                       count = 0;
-                abinfo.bytes = count;
-                abinfo.fragstotal = s->dma_adc.numfrag;
-                abinfo.fragments = abinfo.bytes >> s->dma_adc.fragshift;      
-               spin_unlock_irqrestore(&s->lock, flags);
-               return copy_to_user(argp, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
-               
-        case SNDCTL_DSP_NONBLOCK:
-                file->f_flags |= O_NONBLOCK;
-                return 0;
-
-        case SNDCTL_DSP_GETODELAY:
-               if (!(file->f_mode & FMODE_WRITE))
-                       return -EINVAL;
-               if (!s->dma_dac2.ready && (val = prog_dmabuf_dac2(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-                count = s->dma_dac2.count;
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (count < 0)
-                       count = 0;
-               return put_user(count, p);
-
-        case SNDCTL_DSP_GETIPTR:
-               if (!(file->f_mode & FMODE_READ))
-                       return -EINVAL;
-               if (!s->dma_adc.ready && (val = prog_dmabuf_adc(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-                cinfo.bytes = s->dma_adc.total_bytes;
-               count = s->dma_adc.count;
-               if (count < 0)
-                       count = 0;
-                cinfo.blocks = count >> s->dma_adc.fragshift;
-                cinfo.ptr = s->dma_adc.hwptr;
-               if (s->dma_adc.mapped)
-                       s->dma_adc.count &= s->dma_adc.fragsize-1;
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
-                       return -EFAULT;
-               return 0;
-
-        case SNDCTL_DSP_GETOPTR:
-               if (!(file->f_mode & FMODE_WRITE))
-                       return -EINVAL;
-               if (!s->dma_dac2.ready && (val = prog_dmabuf_dac2(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-                cinfo.bytes = s->dma_dac2.total_bytes;
-               count = s->dma_dac2.count;
-               if (count < 0)
-                       count = 0;
-                cinfo.blocks = count >> s->dma_dac2.fragshift;
-                cinfo.ptr = s->dma_dac2.hwptr;
-               if (s->dma_dac2.mapped)
-                       s->dma_dac2.count &= s->dma_dac2.fragsize-1;
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (copy_to_user(argp, &cinfo, sizeof(cinfo)))
-                       return -EFAULT;
-               return 0;
-
-        case SNDCTL_DSP_GETBLKSIZE:
-               if (file->f_mode & FMODE_WRITE) {
-                       if ((val = prog_dmabuf_dac2(s)))
-                               return val;
-                       return put_user(s->dma_dac2.fragsize, p);
-               }
-               if ((val = prog_dmabuf_adc(s)))
-                       return val;
-               return put_user(s->dma_adc.fragsize, p);
-
-        case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (file->f_mode & FMODE_READ) {
-                       s->dma_adc.ossfragshift = val & 0xffff;
-                       s->dma_adc.ossmaxfrags = (val >> 16) & 0xffff;
-                       if (s->dma_adc.ossfragshift < 4)
-                               s->dma_adc.ossfragshift = 4;
-                       if (s->dma_adc.ossfragshift > 15)
-                               s->dma_adc.ossfragshift = 15;
-                       if (s->dma_adc.ossmaxfrags < 4)
-                               s->dma_adc.ossmaxfrags = 4;
-               }
-               if (file->f_mode & FMODE_WRITE) {
-                       s->dma_dac2.ossfragshift = val & 0xffff;
-                       s->dma_dac2.ossmaxfrags = (val >> 16) & 0xffff;
-                       if (s->dma_dac2.ossfragshift < 4)
-                               s->dma_dac2.ossfragshift = 4;
-                       if (s->dma_dac2.ossfragshift > 15)
-                               s->dma_dac2.ossfragshift = 15;
-                       if (s->dma_dac2.ossmaxfrags < 4)
-                               s->dma_dac2.ossmaxfrags = 4;
-               }
-               return 0;
-
-        case SNDCTL_DSP_SUBDIVIDE:
-               if ((file->f_mode & FMODE_READ && s->dma_adc.subdivision) ||
-                   (file->f_mode & FMODE_WRITE && s->dma_dac2.subdivision))
-                       return -EINVAL;
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (val != 1 && val != 2 && val != 4)
-                       return -EINVAL;
-               if (file->f_mode & FMODE_READ)
-                       s->dma_adc.subdivision = val;
-               if (file->f_mode & FMODE_WRITE)
-                       s->dma_dac2.subdivision = val;
-               return 0;
-
-        case SOUND_PCM_READ_RATE:
-               return put_user((file->f_mode & FMODE_READ) ? s->adcrate : s->dac2rate, p);
-
-        case SOUND_PCM_READ_CHANNELS:
-               return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SMB : SCTRL_P2SMB)) ? 2 : 1, p);
-               
-        case SOUND_PCM_READ_BITS:
-               return put_user((s->sctrl & ((file->f_mode & FMODE_READ) ? SCTRL_R1SEB : SCTRL_P2SEB)) ? 16 : 8, p);
-
-        case SOUND_PCM_WRITE_FILTER:
-        case SNDCTL_DSP_SETSYNCRO:
-        case SOUND_PCM_READ_FILTER:
-                return -EINVAL;
-               
-       }
-       return mixdev_ioctl(s->codec, cmd, arg);
-}
-
-static int es1371_open(struct inode *inode, struct file *file)
-{
-       int minor = iminor(inode);
-       DECLARE_WAITQUEUE(wait, current);
-       unsigned long flags;
-       struct list_head *list;
-       struct es1371_state *s;
-
-       for (list = devs.next; ; list = list->next) {
-               if (list == &devs)
-                       return -ENODEV;
-               s = list_entry(list, struct es1371_state, devs);
-               if (!((s->dev_audio ^ minor) & ~0xf))
-                       break;
-       }
-               VALIDATE_STATE(s);
-       file->private_data = s;
-       /* wait for device to become free */
-       mutex_lock(&s->open_mutex);
-       while (s->open_mode & file->f_mode) {
-               if (file->f_flags & O_NONBLOCK) {
-                       mutex_unlock(&s->open_mutex);
-                       return -EBUSY;
-               }
-               add_wait_queue(&s->open_wait, &wait);
-               __set_current_state(TASK_INTERRUPTIBLE);
-               mutex_unlock(&s->open_mutex);
-               schedule();
-               remove_wait_queue(&s->open_wait, &wait);
-               set_current_state(TASK_RUNNING);
-               if (signal_pending(current))
-                       return -ERESTARTSYS;
-               mutex_lock(&s->open_mutex);
-       }
-       if (file->f_mode & FMODE_READ) {
-               s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags = s->dma_adc.subdivision = 0;
-               s->dma_adc.enabled = 1;
-               set_adc_rate(s, 8000);
-       }
-       if (file->f_mode & FMODE_WRITE) {
-               s->dma_dac2.ossfragshift = s->dma_dac2.ossmaxfrags = s->dma_dac2.subdivision = 0;
-               s->dma_dac2.enabled = 1;
-               set_dac2_rate(s, 8000);
-       }
-       spin_lock_irqsave(&s->lock, flags);
-       if (file->f_mode & FMODE_READ) {
-               s->sctrl &= ~SCTRL_R1FMT;
-               if ((minor & 0xf) == SND_DEV_DSP16)
-                       s->sctrl |= ES1371_FMT_S16_MONO << SCTRL_SH_R1FMT;
-               else
-                       s->sctrl |= ES1371_FMT_U8_MONO << SCTRL_SH_R1FMT;
-       }
-       if (file->f_mode & FMODE_WRITE) {
-               s->sctrl &= ~SCTRL_P2FMT;
-               if ((minor & 0xf) == SND_DEV_DSP16)
-                       s->sctrl |= ES1371_FMT_S16_MONO << SCTRL_SH_P2FMT;
-               else
-                       s->sctrl |= ES1371_FMT_U8_MONO << SCTRL_SH_P2FMT;
-       }
-       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-       spin_unlock_irqrestore(&s->lock, flags);
-       s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
-       mutex_unlock(&s->open_mutex);
-       mutex_init(&s->sem);
-       return nonseekable_open(inode, file);
-}
-
-static int es1371_release(struct inode *inode, struct file *file)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-
-       VALIDATE_STATE(s);
-       lock_kernel();
-       if (file->f_mode & FMODE_WRITE)
-               drain_dac2(s, file->f_flags & O_NONBLOCK);
-       mutex_lock(&s->open_mutex);
-       if (file->f_mode & FMODE_WRITE) {
-               stop_dac2(s);
-               dealloc_dmabuf(s, &s->dma_dac2);
-       }
-       if (file->f_mode & FMODE_READ) {
-               stop_adc(s);
-               dealloc_dmabuf(s, &s->dma_adc);
-       }
-       s->open_mode &= ~(file->f_mode & (FMODE_READ|FMODE_WRITE));
-       mutex_unlock(&s->open_mutex);
-       wake_up(&s->open_wait);
-       unlock_kernel();
-       return 0;
-}
-
-static /*const*/ struct file_operations es1371_audio_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .read           = es1371_read,
-       .write          = es1371_write,
-       .poll           = es1371_poll,
-       .ioctl          = es1371_ioctl,
-       .mmap           = es1371_mmap,
-       .open           = es1371_open,
-       .release        = es1371_release,
-};
-
-/* --------------------------------------------------------------------- */
-
-static ssize_t es1371_write_dac(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
-       ssize_t ret = 0;
-       unsigned long flags;
-       unsigned swptr;
-       int cnt;
-
-       VALIDATE_STATE(s);
-       if (s->dma_dac1.mapped)
-               return -ENXIO;
-       if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
-               return ret;
-       if (!access_ok(VERIFY_READ, buffer, count))
-               return -EFAULT;
-       add_wait_queue(&s->dma_dac1.wait, &wait);
-       while (count > 0) {
-               spin_lock_irqsave(&s->lock, flags);
-               if (s->dma_dac1.count < 0) {
-                       s->dma_dac1.count = 0;
-                       s->dma_dac1.swptr = s->dma_dac1.hwptr;
-               }
-               swptr = s->dma_dac1.swptr;
-               cnt = s->dma_dac1.dmasize-swptr;
-               if (s->dma_dac1.count + cnt > s->dma_dac1.dmasize)
-                       cnt = s->dma_dac1.dmasize - s->dma_dac1.count;
-               if (cnt <= 0)
-                       __set_current_state(TASK_INTERRUPTIBLE);
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (cnt > count)
-                       cnt = count;
-               if (cnt <= 0) {
-                       if (s->dma_dac1.enabled)
-                               start_dac1(s);
-                       if (file->f_flags & O_NONBLOCK) {
-                               if (!ret)
-                                       ret = -EAGAIN;
-                               break;
-                       }
-                       schedule();
-                       if (signal_pending(current)) {
-                               if (!ret)
-                                       ret = -ERESTARTSYS;
-                               break;
-                       }
-                       continue;
-               }
-               if (copy_from_user(s->dma_dac1.rawbuf + swptr, buffer, cnt)) {
-                       if (!ret)
-                               ret = -EFAULT;
-                       break;
-               }
-               swptr = (swptr + cnt) % s->dma_dac1.dmasize;
-               spin_lock_irqsave(&s->lock, flags);
-               s->dma_dac1.swptr = swptr;
-               s->dma_dac1.count += cnt;
-               s->dma_dac1.endcleared = 0;
-               spin_unlock_irqrestore(&s->lock, flags);
-               count -= cnt;
-               buffer += cnt;
-               ret += cnt;
-               if (s->dma_dac1.enabled)
-                       start_dac1(s);
-       }
-       remove_wait_queue(&s->dma_dac1.wait, &wait);
-       set_current_state(TASK_RUNNING);
-       return ret;
-}
-
-/* No kernel lock - we have our own spinlock */
-static unsigned int es1371_poll_dac(struct file *file, struct poll_table_struct *wait)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       unsigned long flags;
-       unsigned int mask = 0;
-
-       VALIDATE_STATE(s);
-       if (!s->dma_dac1.ready && prog_dmabuf_dac1(s))
-               return 0;
-       poll_wait(file, &s->dma_dac1.wait, wait);
-       spin_lock_irqsave(&s->lock, flags);
-       es1371_update_ptr(s);
-       if (s->dma_dac1.mapped) {
-               if (s->dma_dac1.count >= (signed)s->dma_dac1.fragsize)
-                       mask |= POLLOUT | POLLWRNORM;
-       } else {
-               if ((signed)s->dma_dac1.dmasize >= s->dma_dac1.count + (signed)s->dma_dac1.fragsize)
-                       mask |= POLLOUT | POLLWRNORM;
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-       return mask;
-}
-
-static int es1371_mmap_dac(struct file *file, struct vm_area_struct *vma)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       int ret;
-       unsigned long size;
-
-       VALIDATE_STATE(s);
-       if (!(vma->vm_flags & VM_WRITE))
-               return -EINVAL;
-       lock_kernel();
-       if ((ret = prog_dmabuf_dac1(s)) != 0)
-               goto out;
-       ret = -EINVAL;
-       if (vma->vm_pgoff != 0)
-               goto out;
-       size = vma->vm_end - vma->vm_start;
-       if (size > (PAGE_SIZE << s->dma_dac1.buforder))
-               goto out;
-       ret = -EAGAIN;
-       if (remap_pfn_range(vma, vma->vm_start,
-                       virt_to_phys(s->dma_dac1.rawbuf) >> PAGE_SHIFT,
-                       size, vma->vm_page_prot))
-               goto out;
-       s->dma_dac1.mapped = 1;
-       ret = 0;
-out:
-       unlock_kernel();
-       return ret;
-}
-
-static int es1371_ioctl_dac(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       unsigned long flags;
-        audio_buf_info abinfo;
-        count_info cinfo;
-       int count;
-       int val, ret;
-       int __user *p = (int __user *)arg;
-
-       VALIDATE_STATE(s);
-       switch (cmd) {
-       case OSS_GETVERSION:
-               return put_user(SOUND_VERSION, p);
-
-       case SNDCTL_DSP_SYNC:
-               return drain_dac1(s, 0/*file->f_flags & O_NONBLOCK*/);
-               
-       case SNDCTL_DSP_SETDUPLEX:
-               return -EINVAL;
-
-       case SNDCTL_DSP_GETCAPS:
-               return put_user(DSP_CAP_REALTIME | DSP_CAP_TRIGGER | DSP_CAP_MMAP, p);
-               
-        case SNDCTL_DSP_RESET:
-               stop_dac1(s);
-               synchronize_irq(s->irq);
-               s->dma_dac1.swptr = s->dma_dac1.hwptr = s->dma_dac1.count = s->dma_dac1.total_bytes = 0;
-               return 0;
-
-        case SNDCTL_DSP_SPEED:
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (val >= 0) {
-                       stop_dac1(s);
-                       s->dma_dac1.ready = 0;
-                       set_dac1_rate(s, val);
-               }
-               return put_user(s->dac1rate, p);
-
-        case SNDCTL_DSP_STEREO:
-               if (get_user(val, p))
-                       return -EFAULT;
-               stop_dac1(s);
-               s->dma_dac1.ready = 0;
-               spin_lock_irqsave(&s->lock, flags);
-               if (val)
-                       s->sctrl |= SCTRL_P1SMB;
-               else
-                       s->sctrl &= ~SCTRL_P1SMB;
-               outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-               spin_unlock_irqrestore(&s->lock, flags);
-               return 0;
-
-        case SNDCTL_DSP_CHANNELS:
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (val != 0) {
-                       stop_dac1(s);
-                       s->dma_dac1.ready = 0;
-                       spin_lock_irqsave(&s->lock, flags);
-                       if (val >= 2)
-                               s->sctrl |= SCTRL_P1SMB;
-                       else
-                               s->sctrl &= ~SCTRL_P1SMB;
-                       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                       spin_unlock_irqrestore(&s->lock, flags);
-               }
-               return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, p);
-               
-        case SNDCTL_DSP_GETFMTS: /* Returns a mask */
-                return put_user(AFMT_S16_LE|AFMT_U8, p);
-               
-        case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-               if (get_user(val, p))
-                       return -EFAULT;
-               if (val != AFMT_QUERY) {
-                       stop_dac1(s);
-                       s->dma_dac1.ready = 0;
-                       spin_lock_irqsave(&s->lock, flags);
-                       if (val == AFMT_S16_LE)
-                               s->sctrl |= SCTRL_P1SEB;
-                       else
-                               s->sctrl &= ~SCTRL_P1SEB;
-                       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-                       spin_unlock_irqrestore(&s->lock, flags);
-               }
-               return put_user((s->sctrl & SCTRL_P1SEB) ? AFMT_S16_LE : AFMT_U8, p);
-
-        case SNDCTL_DSP_POST:
-                return 0;
-
-        case SNDCTL_DSP_GETTRIGGER:
-               return put_user((s->ctrl & CTRL_DAC1_EN) ? PCM_ENABLE_OUTPUT : 0, p);
-                                               
-       case SNDCTL_DSP_SETTRIGGER:
-               if (get_user(val, p))
-                       return -EFAULT;
-               if (val & PCM_ENABLE_OUTPUT) {
-                       if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
-                               return ret;
-                       s->dma_dac1.enabled = 1;
-                       start_dac1(s);
-               } else {
-                       s->dma_dac1.enabled = 0;
-                       stop_dac1(s);
-               }
-               return 0;
-
-       case SNDCTL_DSP_GETOSPACE:
-               if (!s->dma_dac1.ready && (val = prog_dmabuf_dac1(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-               abinfo.fragsize = s->dma_dac1.fragsize;
-               count = s->dma_dac1.count;
-               if (count < 0)
-                       count = 0;
-                abinfo.bytes = s->dma_dac1.dmasize - count;
-                abinfo.fragstotal = s->dma_dac1.numfrag;
-                abinfo.fragments = abinfo.bytes >> s->dma_dac1.fragshift;      
-               spin_unlock_irqrestore(&s->lock, flags);
-               return copy_to_user((void __user *)arg, &abinfo, sizeof(abinfo)) ? -EFAULT : 0;
-
-        case SNDCTL_DSP_NONBLOCK:
-                file->f_flags |= O_NONBLOCK;
-                return 0;
-
-        case SNDCTL_DSP_GETODELAY:
-               if (!s->dma_dac1.ready && (val = prog_dmabuf_dac1(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-                count = s->dma_dac1.count;
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (count < 0)
-                       count = 0;
-               return put_user(count, p);
-
-        case SNDCTL_DSP_GETOPTR:
-               if (!s->dma_dac1.ready && (val = prog_dmabuf_dac1(s)) != 0)
-                       return val;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_update_ptr(s);
-                cinfo.bytes = s->dma_dac1.total_bytes;
-               count = s->dma_dac1.count;
-               if (count < 0)
-                       count = 0;
-                cinfo.blocks = count >> s->dma_dac1.fragshift;
-                cinfo.ptr = s->dma_dac1.hwptr;
-               if (s->dma_dac1.mapped)
-                       s->dma_dac1.count &= s->dma_dac1.fragsize-1;
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (copy_to_user((void __user *)arg, &cinfo, sizeof(cinfo)))
-                       return -EFAULT;
-               return 0;
-
-        case SNDCTL_DSP_GETBLKSIZE:
-               if ((val = prog_dmabuf_dac1(s)))
-                       return val;
-                return put_user(s->dma_dac1.fragsize, p);
-
-        case SNDCTL_DSP_SETFRAGMENT:
-                if (get_user(val, p))
-                       return -EFAULT;
-               s->dma_dac1.ossfragshift = val & 0xffff;
-               s->dma_dac1.ossmaxfrags = (val >> 16) & 0xffff;
-               if (s->dma_dac1.ossfragshift < 4)
-                       s->dma_dac1.ossfragshift = 4;
-               if (s->dma_dac1.ossfragshift > 15)
-                       s->dma_dac1.ossfragshift = 15;
-               if (s->dma_dac1.ossmaxfrags < 4)
-                       s->dma_dac1.ossmaxfrags = 4;
-               return 0;
-
-        case SNDCTL_DSP_SUBDIVIDE:
-               if (s->dma_dac1.subdivision)
-                       return -EINVAL;
-                if (get_user(val, p))
-                       return -EFAULT;
-               if (val != 1 && val != 2 && val != 4)
-                       return -EINVAL;
-               s->dma_dac1.subdivision = val;
-               return 0;
-
-        case SOUND_PCM_READ_RATE:
-               return put_user(s->dac1rate, p);
-
-        case SOUND_PCM_READ_CHANNELS:
-               return put_user((s->sctrl & SCTRL_P1SMB) ? 2 : 1, p);
-
-        case SOUND_PCM_READ_BITS:
-               return put_user((s->sctrl & SCTRL_P1SEB) ? 16 : 8, p);
-
-        case SOUND_PCM_WRITE_FILTER:
-        case SNDCTL_DSP_SETSYNCRO:
-        case SOUND_PCM_READ_FILTER:
-                return -EINVAL;
-               
-       }
-       return mixdev_ioctl(s->codec, cmd, arg);
-}
-
-static int es1371_open_dac(struct inode *inode, struct file *file)
-{
-       int minor = iminor(inode);
-       DECLARE_WAITQUEUE(wait, current);
-       unsigned long flags;
-       struct list_head *list;
-       struct es1371_state *s;
-
-       for (list = devs.next; ; list = list->next) {
-               if (list == &devs)
-                       return -ENODEV;
-               s = list_entry(list, struct es1371_state, devs);
-               if (!((s->dev_dac ^ minor) & ~0xf))
-                       break;
-       }
-               VALIDATE_STATE(s);
-               /* we allow opening with O_RDWR, most programs do it although they will only write */
-#if 0
-       if (file->f_mode & FMODE_READ)
-               return -EPERM;
-#endif
-       if (!(file->f_mode & FMODE_WRITE))
-               return -EINVAL;
-               file->private_data = s;
-       /* wait for device to become free */
-       mutex_lock(&s->open_mutex);
-       while (s->open_mode & FMODE_DAC) {
-               if (file->f_flags & O_NONBLOCK) {
-                       mutex_unlock(&s->open_mutex);
-                       return -EBUSY;
-               }
-               add_wait_queue(&s->open_wait, &wait);
-               __set_current_state(TASK_INTERRUPTIBLE);
-               mutex_unlock(&s->open_mutex);
-               schedule();
-               remove_wait_queue(&s->open_wait, &wait);
-               set_current_state(TASK_RUNNING);
-               if (signal_pending(current))
-                       return -ERESTARTSYS;
-               mutex_lock(&s->open_mutex);
-       }
-       s->dma_dac1.ossfragshift = s->dma_dac1.ossmaxfrags = s->dma_dac1.subdivision = 0;
-       s->dma_dac1.enabled = 1;
-       set_dac1_rate(s, 8000);
-       spin_lock_irqsave(&s->lock, flags);
-       s->sctrl &= ~SCTRL_P1FMT;
-       if ((minor & 0xf) == SND_DEV_DSP16)
-               s->sctrl |= ES1371_FMT_S16_MONO << SCTRL_SH_P1FMT;
-       else
-               s->sctrl |= ES1371_FMT_U8_MONO << SCTRL_SH_P1FMT;
-       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-       spin_unlock_irqrestore(&s->lock, flags);
-       s->open_mode |= FMODE_DAC;
-       mutex_unlock(&s->open_mutex);
-       return nonseekable_open(inode, file);
-}
-
-static int es1371_release_dac(struct inode *inode, struct file *file)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-
-       VALIDATE_STATE(s);
-       lock_kernel();
-       drain_dac1(s, file->f_flags & O_NONBLOCK);
-       mutex_lock(&s->open_mutex);
-       stop_dac1(s);
-       dealloc_dmabuf(s, &s->dma_dac1);
-       s->open_mode &= ~FMODE_DAC;
-       mutex_unlock(&s->open_mutex);
-       wake_up(&s->open_wait);
-       unlock_kernel();
-       return 0;
-}
-
-static /*const*/ struct file_operations es1371_dac_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .write          = es1371_write_dac,
-       .poll           = es1371_poll_dac,
-       .ioctl          = es1371_ioctl_dac,
-       .mmap           = es1371_mmap_dac,
-       .open           = es1371_open_dac,
-       .release        = es1371_release_dac,
-};
-
-/* --------------------------------------------------------------------- */
-
-static ssize_t es1371_midi_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
-       ssize_t ret;
-       unsigned long flags;
-       unsigned ptr;
-       int cnt;
-
-       VALIDATE_STATE(s);
-       if (!access_ok(VERIFY_WRITE, buffer, count))
-               return -EFAULT;
-       if (count == 0)
-               return 0;
-       ret = 0;
-        add_wait_queue(&s->midi.iwait, &wait);
-       while (count > 0) {
-               spin_lock_irqsave(&s->lock, flags);
-               ptr = s->midi.ird;
-               cnt = MIDIINBUF - ptr;
-               if (s->midi.icnt < cnt)
-                       cnt = s->midi.icnt;
-               if (cnt <= 0)
-                       __set_current_state(TASK_INTERRUPTIBLE);
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (cnt > count)
-                       cnt = count;
-               if (cnt <= 0) {
-                       if (file->f_flags & O_NONBLOCK) {
-                               if (!ret)
-                                       ret = -EAGAIN;
-                               break;
-                       }
-                       schedule();
-                       if (signal_pending(current)) {
-                               if (!ret)
-                                       ret = -ERESTARTSYS;
-                               break;
-                       }
-                       continue;
-               }
-               if (copy_to_user(buffer, s->midi.ibuf + ptr, cnt)) {
-                       if (!ret)
-                               ret = -EFAULT;
-                       break;
-               }
-               ptr = (ptr + cnt) % MIDIINBUF;
-               spin_lock_irqsave(&s->lock, flags);
-               s->midi.ird = ptr;
-               s->midi.icnt -= cnt;
-               spin_unlock_irqrestore(&s->lock, flags);
-               count -= cnt;
-               buffer += cnt;
-               ret += cnt;
-               break;
-       }
-       __set_current_state(TASK_RUNNING);
-       remove_wait_queue(&s->midi.iwait, &wait);
-       return ret;
-}
-
-static ssize_t es1371_midi_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
-       ssize_t ret;
-       unsigned long flags;
-       unsigned ptr;
-       int cnt;
-
-       VALIDATE_STATE(s);
-       if (!access_ok(VERIFY_READ, buffer, count))
-               return -EFAULT;
-       if (count == 0)
-               return 0;
-       ret = 0;
-        add_wait_queue(&s->midi.owait, &wait);
-       while (count > 0) {
-               spin_lock_irqsave(&s->lock, flags);
-               ptr = s->midi.owr;
-               cnt = MIDIOUTBUF - ptr;
-               if (s->midi.ocnt + cnt > MIDIOUTBUF)
-                       cnt = MIDIOUTBUF - s->midi.ocnt;
-               if (cnt <= 0) {
-                       __set_current_state(TASK_INTERRUPTIBLE);
-                       es1371_handle_midi(s);
-               }
-               spin_unlock_irqrestore(&s->lock, flags);
-               if (cnt > count)
-                       cnt = count;
-               if (cnt <= 0) {
-                       if (file->f_flags & O_NONBLOCK) {
-                               if (!ret)
-                                       ret = -EAGAIN;
-                               break;
-                       }
-                       schedule();
-                       if (signal_pending(current)) {
-                               if (!ret)
-                                       ret = -ERESTARTSYS;
-                               break;
-                       }
-                       continue;
-               }
-               if (copy_from_user(s->midi.obuf + ptr, buffer, cnt)) {
-                       if (!ret)
-                               ret = -EFAULT;
-                       break;
-               }
-               ptr = (ptr + cnt) % MIDIOUTBUF;
-               spin_lock_irqsave(&s->lock, flags);
-               s->midi.owr = ptr;
-               s->midi.ocnt += cnt;
-               spin_unlock_irqrestore(&s->lock, flags);
-               count -= cnt;
-               buffer += cnt;
-               ret += cnt;
-               spin_lock_irqsave(&s->lock, flags);
-               es1371_handle_midi(s);
-               spin_unlock_irqrestore(&s->lock, flags);
-       }
-       __set_current_state(TASK_RUNNING);
-       remove_wait_queue(&s->midi.owait, &wait);
-       return ret;
-}
-
-/* No kernel lock - we have our own spinlock */
-static unsigned int es1371_midi_poll(struct file *file, struct poll_table_struct *wait)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       unsigned long flags;
-       unsigned int mask = 0;
-
-       VALIDATE_STATE(s);
-       if (file->f_mode & FMODE_WRITE)
-               poll_wait(file, &s->midi.owait, wait);
-       if (file->f_mode & FMODE_READ)
-               poll_wait(file, &s->midi.iwait, wait);
-       spin_lock_irqsave(&s->lock, flags);
-       if (file->f_mode & FMODE_READ) {
-               if (s->midi.icnt > 0)
-                       mask |= POLLIN | POLLRDNORM;
-       }
-       if (file->f_mode & FMODE_WRITE) {
-               if (s->midi.ocnt < MIDIOUTBUF)
-                       mask |= POLLOUT | POLLWRNORM;
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-       return mask;
-}
-
-static int es1371_midi_open(struct inode *inode, struct file *file)
-{
-       int minor = iminor(inode);
-       DECLARE_WAITQUEUE(wait, current);
-       unsigned long flags;
-       struct list_head *list;
-       struct es1371_state *s;
-
-       for (list = devs.next; ; list = list->next) {
-               if (list == &devs)
-                       return -ENODEV;
-               s = list_entry(list, struct es1371_state, devs);
-               if (s->dev_midi == minor)
-                       break;
-       }
-               VALIDATE_STATE(s);
-       file->private_data = s;
-       /* wait for device to become free */
-       mutex_lock(&s->open_mutex);
-       while (s->open_mode & (file->f_mode << FMODE_MIDI_SHIFT)) {
-               if (file->f_flags & O_NONBLOCK) {
-                       mutex_unlock(&s->open_mutex);
-                       return -EBUSY;
-               }
-               add_wait_queue(&s->open_wait, &wait);
-               __set_current_state(TASK_INTERRUPTIBLE);
-               mutex_unlock(&s->open_mutex);
-               schedule();
-               remove_wait_queue(&s->open_wait, &wait);
-               set_current_state(TASK_RUNNING);
-               if (signal_pending(current))
-                       return -ERESTARTSYS;
-               mutex_lock(&s->open_mutex);
-       }
-       spin_lock_irqsave(&s->lock, flags);
-       if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
-               s->midi.ird = s->midi.iwr = s->midi.icnt = 0;
-               s->midi.ord = s->midi.owr = s->midi.ocnt = 0;
-               outb(UCTRL_CNTRL_SWR, s->io+ES1371_REG_UART_CONTROL);
-               outb(0, s->io+ES1371_REG_UART_CONTROL);
-               outb(0, s->io+ES1371_REG_UART_TEST);
-       }
-       if (file->f_mode & FMODE_READ) {
-               s->midi.ird = s->midi.iwr = s->midi.icnt = 0;
-       }
-       if (file->f_mode & FMODE_WRITE) {
-               s->midi.ord = s->midi.owr = s->midi.ocnt = 0;
-       }
-       s->ctrl |= CTRL_UART_EN;
-       outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       es1371_handle_midi(s);
-       spin_unlock_irqrestore(&s->lock, flags);
-       s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
-       mutex_unlock(&s->open_mutex);
-       return nonseekable_open(inode, file);
-}
-
-static int es1371_midi_release(struct inode *inode, struct file *file)
-{
-       struct es1371_state *s = (struct es1371_state *)file->private_data;
-       DECLARE_WAITQUEUE(wait, current);
-       unsigned long flags;
-       unsigned count, tmo;
-
-       VALIDATE_STATE(s);
-       lock_kernel();
-       if (file->f_mode & FMODE_WRITE) {
-               add_wait_queue(&s->midi.owait, &wait);
-               for (;;) {
-                       __set_current_state(TASK_INTERRUPTIBLE);
-                       spin_lock_irqsave(&s->lock, flags);
-                       count = s->midi.ocnt;
-                       spin_unlock_irqrestore(&s->lock, flags);
-                       if (count <= 0)
-                               break;
-                       if (signal_pending(current))
-                               break;
-                       if (file->f_flags & O_NONBLOCK)
-                               break;
-                       tmo = (count * HZ) / 3100;
-                       if (!schedule_timeout(tmo ? : 1) && tmo)
-                               printk(KERN_DEBUG PFX "midi timed out??\n");
-               }
-               remove_wait_queue(&s->midi.owait, &wait);
-               set_current_state(TASK_RUNNING);
-       }
-       mutex_lock(&s->open_mutex);
-       s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
-       spin_lock_irqsave(&s->lock, flags);
-       if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
-               s->ctrl &= ~CTRL_UART_EN;
-               outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       }
-       spin_unlock_irqrestore(&s->lock, flags);
-       mutex_unlock(&s->open_mutex);
-       wake_up(&s->open_wait);
-       unlock_kernel();
-       return 0;
-}
-
-static /*const*/ struct file_operations es1371_midi_fops = {
-       .owner          = THIS_MODULE,
-       .llseek         = no_llseek,
-       .read           = es1371_midi_read,
-       .write          = es1371_midi_write,
-       .poll           = es1371_midi_poll,
-       .open           = es1371_midi_open,
-       .release        = es1371_midi_release,
-};
-
-/* --------------------------------------------------------------------- */
-
-/*
- * for debugging purposes, we'll create a proc device that dumps the
- * CODEC chipstate
- */
-
-#ifdef ES1371_DEBUG
-static int proc_es1371_dump (char *buf, char **start, off_t fpos, int length, int *eof, void *data)
-{
-       struct es1371_state *s;
-        int cnt, len = 0;
-
-       if (list_empty(&devs))
-               return 0;
-       s = list_entry(devs.next, struct es1371_state, devs);
-        /* print out header */
-        len += sprintf(buf + len, "\t\tCreative ES137x Debug Dump-o-matic\n");
-
-        /* print out CODEC state */
-        len += sprintf (buf + len, "AC97 CODEC state\n");
-       for (cnt=0; cnt <= 0x7e; cnt = cnt +2)
-                len+= sprintf (buf + len, "reg:0x%02x  val:0x%04x\n", cnt, rdcodec(s->codec, cnt));
-
-        if (fpos >=len){
-                *start = buf;
-                *eof =1;
-                return 0;
-        }
-        *start = buf + fpos;
-        if ((len -= fpos) > length)
-                return length;
-        *eof =1;
-        return len;
-
-}
-#endif /* ES1371_DEBUG */
-
-/* --------------------------------------------------------------------- */
-
-/* maximum number of devices; only used for command line params */
-#define NR_DEVICE 5
-
-static int spdif[NR_DEVICE];
-static int nomix[NR_DEVICE];
-static int amplifier[NR_DEVICE];
-
-static unsigned int devindex;
-
-module_param_array(spdif, bool, NULL, 0);
-MODULE_PARM_DESC(spdif, "if 1 the output is in S/PDIF digital mode");
-module_param_array(nomix, bool, NULL, 0);
-MODULE_PARM_DESC(nomix, "if 1 no analog audio is mixed to the digital output");
-module_param_array(amplifier, bool, NULL, 0);
-MODULE_PARM_DESC(amplifier, "Set to 1 if the machine needs the amp control enabling (many laptops)");
-
-MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");
-MODULE_DESCRIPTION("ES1371 AudioPCI97 Driver");
-MODULE_LICENSE("GPL");
-
-
-/* --------------------------------------------------------------------- */
-
-static struct initvol {
-       int mixch;
-       int vol;
-} initvol[] __devinitdata = {
-       { SOUND_MIXER_WRITE_LINE, 0x4040 },
-       { SOUND_MIXER_WRITE_CD, 0x4040 },
-       { MIXER_WRITE(SOUND_MIXER_VIDEO), 0x4040 },
-       { SOUND_MIXER_WRITE_LINE1, 0x4040 },
-       { SOUND_MIXER_WRITE_PCM, 0x4040 },
-       { SOUND_MIXER_WRITE_VOLUME, 0x4040 },
-       { MIXER_WRITE(SOUND_MIXER_PHONEOUT), 0x4040 },
-       { SOUND_MIXER_WRITE_OGAIN, 0x4040 },
-       { MIXER_WRITE(SOUND_MIXER_PHONEIN), 0x4040 },
-       { SOUND_MIXER_WRITE_SPEAKER, 0x4040 },
-       { SOUND_MIXER_WRITE_MIC, 0x4040 },
-       { SOUND_MIXER_WRITE_RECLEV, 0x4040 },
-       { SOUND_MIXER_WRITE_IGAIN, 0x4040 }
-};
-
-static struct
-{
-       short svid, sdid;
-} amplifier_needed[] = 
-{
-       { 0x107B, 0x2150 },             /* Gateway Solo 2150 */
-       { 0x13BD, 0x100C },             /* Mebius PC-MJ100V */
-       { 0x1102, 0x5938 },             /* Targa Xtender 300 */
-       { 0x1102, 0x8938 },             /* IPC notebook */
-       { PCI_ANY_ID, PCI_ANY_ID }
-};
-
-#ifdef SUPPORT_JOYSTICK
-
-static int __devinit es1371_register_gameport(struct es1371_state *s)
-{
-       struct gameport *gp;
-       int gpio;
-
-       for (gpio = 0x218; gpio >= 0x200; gpio -= 0x08)
-               if (request_region(gpio, JOY_EXTENT, "es1371"))
-                       break;
-
-       if (gpio < 0x200) {
-               printk(KERN_ERR PFX "no free joystick address found\n");
-               return -EBUSY;
-       }
-
-       s->gameport = gp = gameport_allocate_port();
-       if (!gp) {
-               printk(KERN_ERR PFX "can not allocate memory for gameport\n");
-               release_region(gpio, JOY_EXTENT);
-               return -ENOMEM;
-       }
-
-       gameport_set_name(gp, "ESS1371 Gameport");
-       gameport_set_phys(gp, "isa%04x/gameport0", gpio);
-       gp->dev.parent = &s->dev->dev;
-       gp->io = gpio;
-
-       s->ctrl |= CTRL_JYSTK_EN | (((gpio >> 3) & CTRL_JOY_MASK) << CTRL_JOY_SHIFT);
-       outl(s->ctrl, s->io + ES1371_REG_CONTROL);
-
-       gameport_register_port(gp);
-
-       return 0;
-}
-
-static inline void es1371_unregister_gameport(struct es1371_state *s)
-{
-       if (s->gameport) {
-               int gpio = s->gameport->io;
-               gameport_unregister_port(s->gameport);
-               release_region(gpio, JOY_EXTENT);
-
-       }
-}
-
-#else
-static inline int es1371_register_gameport(struct es1371_state *s) { return -ENOSYS; }
-static inline void es1371_unregister_gameport(struct es1371_state *s) { }
-#endif /* SUPPORT_JOYSTICK */
-
-
-static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_device_id *pciid)
-{
-       struct es1371_state *s;
-       mm_segment_t fs;
-       int i, val, res = -1;
-       int idx;
-       unsigned long tmo;
-       signed long tmo2;
-       unsigned int cssr;
-
-       if ((res=pci_enable_device(pcidev)))
-               return res;
-
-       if (!(pci_resource_flags(pcidev, 0) & IORESOURCE_IO))
-               return -ENODEV;
-       if (pcidev->irq == 0) 
-               return -ENODEV;
-       i = pci_set_dma_mask(pcidev, DMA_32BIT_MASK);
-       if (i) {
-               printk(KERN_WARNING "es1371: architecture does not support 32bit PCI busmaster DMA\n");
-               return i;
-       }
-       if (!(s = kzalloc(sizeof(struct es1371_state), GFP_KERNEL))) {
-               printk(KERN_WARNING PFX "out of memory\n");
-               return -ENOMEM;
-       }
-       
-       s->codec = ac97_alloc_codec();
-       if(s->codec == NULL)
-               goto err_codec;
-               
-       init_waitqueue_head(&s->dma_adc.wait);
-       init_waitqueue_head(&s->dma_dac1.wait);
-       init_waitqueue_head(&s->dma_dac2.wait);
-       init_waitqueue_head(&s->open_wait);
-       init_waitqueue_head(&s->midi.iwait);
-       init_waitqueue_head(&s->midi.owait);
-       mutex_init(&s->open_mutex);
-       spin_lock_init(&s->lock);
-       s->magic = ES1371_MAGIC;
-       s->dev = pcidev;
-       s->io = pci_resource_start(pcidev, 0);
-       s->irq = pcidev->irq;
-       s->vendor = pcidev->vendor;
-       s->device = pcidev->device;
-       s->rev = pcidev->revision;
-       s->codec->private_data = s;
-       s->codec->id = 0;
-       s->codec->codec_read = rdcodec;
-       s->codec->codec_write = wrcodec;
-       printk(KERN_INFO PFX "found chip, vendor id 0x%04x device id 0x%04x revision 0x%02x\n",
-              s->vendor, s->device, s->rev);
-       if (!request_region(s->io, ES1371_EXTENT, "es1371")) {
-               printk(KERN_ERR PFX "io ports %#lx-%#lx in use\n", s->io, s->io+ES1371_EXTENT-1);
-               res = -EBUSY;
-               goto err_region;
-       }
-       if ((res=request_irq(s->irq, es1371_interrupt, IRQF_SHARED, "es1371",s))) {
-               printk(KERN_ERR PFX "irq %u in use\n", s->irq);
-               goto err_irq;
-       }
-       printk(KERN_INFO PFX "found es1371 rev %d at io %#lx irq %u\n",
-              s->rev, s->io, s->irq);
-       /* register devices */
-       if ((res=(s->dev_audio = register_sound_dsp(&es1371_audio_fops,-1)))<0)
-               goto err_dev1;
-       if ((res=(s->codec->dev_mixer = register_sound_mixer(&es1371_mixer_fops, -1))) < 0)
-               goto err_dev2;
-       if ((res=(s->dev_dac = register_sound_dsp(&es1371_dac_fops, -1))) < 0)
-               goto err_dev3;
-       if ((res=(s->dev_midi = register_sound_midi(&es1371_midi_fops, -1)))<0 )
-               goto err_dev4;
-#ifdef ES1371_DEBUG
-       /* initialize the debug proc device */
-       s->ps = create_proc_read_entry("es1371",0,NULL,proc_es1371_dump,NULL);
-#endif /* ES1371_DEBUG */
-       
-       /* initialize codec registers */
-       s->ctrl = 0;
-
-       /* Check amplifier requirements */
-       
-       if (amplifier[devindex])
-               s->ctrl |= CTRL_GPIO_OUT0;
-       else for(idx = 0; amplifier_needed[idx].svid != PCI_ANY_ID; idx++)
-       {
-               if(pcidev->subsystem_vendor == amplifier_needed[idx].svid &&
-                  pcidev->subsystem_device == amplifier_needed[idx].sdid)
-               {
-                       s->ctrl |= CTRL_GPIO_OUT0;   /* turn internal amplifier on */
-                       printk(KERN_INFO PFX "Enabling internal amplifier.\n");
-               }
-       }
-
-       s->sctrl = 0;
-       cssr = 0;
-       s->spdif_volume = -1;
-       /* check to see if s/pdif mode is being requested */
-       if (spdif[devindex]) {
-               if (s->rev >= 4) {
-                       printk(KERN_INFO PFX "enabling S/PDIF output\n");
-                       s->spdif_volume = 0;
-                       cssr |= STAT_EN_SPDIF;
-                       s->ctrl |= CTRL_SPDIFEN_B;
-                       if (nomix[devindex]) /* don't mix analog inputs to s/pdif output */
-                               s->ctrl |= CTRL_RECEN_B;
-               } else {
-                       printk(KERN_ERR PFX "revision %d does not support S/PDIF\n", s->rev);
-               }
-       }
-       /* initialize the chips */
-       outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       outl(s->sctrl, s->io+ES1371_REG_SERIAL_CONTROL);
-       outl(LEGACY_JFAST, s->io+ES1371_REG_LEGACY);
-       pci_set_master(pcidev);  /* enable bus mastering */
-       /* if we are a 5880 turn on the AC97 */
-       if (s->vendor == PCI_VENDOR_ID_ENSONIQ &&
-           ((s->device == PCI_DEVICE_ID_ENSONIQ_CT5880 && s->rev >= CT5880REV_CT5880_C) || 
-            (s->device == PCI_DEVICE_ID_ENSONIQ_ES1371 && s->rev == ES1371REV_CT5880_A) || 
-            (s->device == PCI_DEVICE_ID_ENSONIQ_ES1371 && s->rev == ES1371REV_ES1373_8))) { 
-               cssr |= CSTAT_5880_AC97_RST;
-               outl(cssr, s->io+ES1371_REG_STATUS);
-               /* need to delay around 20ms(bleech) to give
-                  some CODECs enough time to wakeup */
-               tmo = jiffies + (HZ / 50) + 1;
-               for (;;) {
-                       tmo2 = tmo - jiffies;
-                       if (tmo2 <= 0)
-                               break;
-                       schedule_timeout(tmo2);
-               }
-       }
-       /* AC97 warm reset to start the bitclk */
-       outl(s->ctrl | CTRL_SYNCRES, s->io+ES1371_REG_CONTROL);
-       udelay(2);
-       outl(s->ctrl, s->io+ES1371_REG_CONTROL);
-       /* init the sample rate converter */
-       src_init(s);
-       /* codec init */
-       if (!ac97_probe_codec(s->codec)) {
-               res = -ENODEV;
-               goto err_gp;
-       }
-       /* set default values */
-
-       fs = get_fs();
-       set_fs(KERNEL_DS);
-       val = SOUND_MASK_LINE;
-       mixdev_ioctl(s->codec, SOUND_MIXER_WRITE_RECSRC, (unsigned long)&val);
-       for (i = 0; i < ARRAY_SIZE(initvol); i++) {
-               val = initvol[i].vol;
-               mixdev_ioctl(s->codec, initvol[i].mixch, (unsigned long)&val);
-       }
-       /* mute master and PCM when in S/PDIF mode */
-       if (s->spdif_volume != -1) {
-               val = 0x0000;
-               s->codec->mixer_ioctl(s->codec, SOUND_MIXER_WRITE_VOLUME, (unsigned long)&val);
-               s->codec->mixer_ioctl(s->codec, SOUND_MIXER_WRITE_PCM, (unsigned long)&val);
-       }
-       set_fs(fs);
-       /* turn on S/PDIF output driver if requested */
-       outl(cssr, s->io+ES1371_REG_STATUS);
-
-       es1371_register_gameport(s);
-
-       /* store it in the driver field */
-       pci_set_drvdata(pcidev, s);
-       /* put it into driver list */
-       list_add_tail(&s->devs, &devs);
-       /* increment devindex */
-       if (devindex < NR_DEVICE-1)
-               devindex++;
-       return 0;
-
- err_gp:
-#ifdef ES1371_DEBUG
-       if (s->ps)
-               remove_proc_entry("es1371", NULL);
-#endif
-       unregister_sound_midi(s->dev_midi);
- err_dev4:
-       unregister_sound_dsp(s->dev_dac);
- err_dev3:
-       unregister_sound_mixer(s->codec->dev_mixer);
- err_dev2:
-       unregister_sound_dsp(s->dev_audio);
- err_dev1:
-       printk(KERN_ERR PFX "cannot register misc device\n");
-       free_irq(s->irq, s);
- err_irq:
-       release_region(s->io, ES1371_EXTENT);
- err_region:
- err_codec:
-       ac97_release_codec(s->codec);
-       kfree(s);
-       return res;
-}
-
-static void __devexit es1371_remove(struct pci_dev *dev)
-{
-       struct es1371_state *s = pci_get_drvdata(dev);
-
-       if (!s)
-               return;
-       list_del(&s->devs);
-#ifdef ES1371_DEBUG
-       if (s->ps)
-               remove_proc_entry("es1371", NULL);
-#endif /* ES1371_DEBUG */
-       outl(0, s->io+ES1371_REG_CONTROL); /* switch everything off */
-       outl(0, s->io+ES1371_REG_SERIAL_CONTROL); /* clear serial interrupts */
-       synchronize_irq(s->irq);
-       free_irq(s->irq, s);
-       es1371_unregister_gameport(s);
-       release_region(s->io, ES1371_EXTENT);
-       unregister_sound_dsp(s->dev_audio);
-       unregister_sound_mixer(s->codec->dev_mixer);
-       unregister_sound_dsp(s->dev_dac);
-       unregister_sound_midi(s->dev_midi);
-       ac97_release_codec(s->codec);
-       kfree(s);
-       pci_set_drvdata(dev, NULL);
-}
-
-static struct pci_device_id id_table[] = {
-       { PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1371, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
-       { PCI_VENDOR_ID_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_CT5880, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
-       { PCI_VENDOR_ID_ECTIVA, PCI_DEVICE_ID_ECTIVA_EV1938, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
-       { 0, }
-};
-
-MODULE_DEVICE_TABLE(pci, id_table);
-
-static struct pci_driver es1371_driver = {
-       .name           = "es1371",
-       .id_table       = id_table,
-       .probe          = es1371_probe,
-       .remove         = __devexit_p(es1371_remove),
-};
-
-static int __init init_es1371(void)
-{
-       printk(KERN_INFO PFX "version v0.32 time " __TIME__ " " __DATE__ "\n");
-       return pci_register_driver(&es1371_driver);
-}
-
-static void __exit cleanup_es1371(void)
-{
-       printk(KERN_INFO PFX "unloading\n");
-       pci_unregister_driver(&es1371_driver);
-}
-
-module_init(init_es1371);
-module_exit(cleanup_es1371);
-
-/* --------------------------------------------------------------------- */
-
-#ifndef MODULE
-
-/* format is: es1371=[spdif,[nomix,[amplifier]]] */
-
-static int __init es1371_setup(char *str)
-{
-       static unsigned __initdata nr_dev = 0;
-
-       if (nr_dev >= NR_DEVICE)
-               return 0;
-
-       (void)
-        ((get_option(&str, &spdif[nr_dev]) == 2)
-         && (get_option(&str, &nomix[nr_dev]) == 2)
-         && (get_option(&str, &amplifier[nr_dev])));
-
-       nr_dev++;
-       return 1;
-}
-
-__setup("es1371=", es1371_setup);
-
-#endif /* MODULE */