# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet v2.6.0-test6 -> 1.1451 # fs/xfs/linux/xfs_lrw.c 1.30 -> 1.32 # net/core/link_watch.c 1.5 -> 1.6 # drivers/media/video/saa7110.c 1.15 -> 1.16 # arch/sparc64/kernel/entry.S 1.28 -> 1.29 # scripts/pnmtologo.c 1.4 -> 1.6 # net/ipv4/netfilter/ip_conntrack_proto_udp.c 1.6 -> 1.7 # include/asm-parisc/pdc.h 1.2 -> 1.3 # include/asm-parisc/ioctl.h 1.1 -> 1.2 # drivers/net/irda/via-ircc.c 1.5 -> 1.6 # net/ipv4/netfilter/ip_conntrack_core.c 1.37 -> 1.40 # fs/ufs/super.c 1.36 -> 1.37 # net/core/utils.c 1.2 -> 1.3 # Documentation/DocBook/kernel-api.tmpl 1.28 -> 1.29 # drivers/block/ps2esdi.c 1.69 -> 1.70 # drivers/scsi/megaraid.c 1.54 -> 1.55 # arch/sparc64/kernel/smp.c 1.62 -> 1.63 # drivers/net/eexpress.c 1.14 -> 1.15 # drivers/net/irda/nsc-ircc.c 1.28 -> 1.29 # fs/xfs/xfs_mount.h 1.21 -> 1.23 # include/linux/acpi.h 1.28 -> 1.29 # drivers/net/irda/girbil.c 1.7 -> 1.8 # drivers/ide/pci/via82cxxx.c 1.15 -> 1.16 # arch/parisc/math-emu/fpudispatch.c 1.2 -> 1.3 # arch/parisc/kernel/pci.c 1.13 -> 1.14 # drivers/scsi/sym53c8xx_2/sym_hipd.c 1.12 -> 1.13 # include/asm-cris/cacheflush.h 1.1 -> 1.2 # include/asm-arm/arch-tbox/vmalloc.h 1.3 -> 1.4 # sound/oss/opl3sa2.c 1.22 -> 1.23 # drivers/block/swim_iop.c 1.26 -> 1.27 # drivers/block/as-iosched.c 1.23 -> 1.26 # fs/adfs/super.c 1.25 -> 1.26 # drivers/ide/pci/hpt34x.h 1.4 -> 1.5 # drivers/media/video/bt856.c 1.15 -> 1.16 # kernel/rcupdate.c 1.6 -> 1.7 # fs/xfs/xfs_trans_inode.c 1.4 -> 1.5 # drivers/char/vme_scc.c 1.25 -> 1.26 # fs/libfs.c 1.25 -> 1.26 # drivers/media/video/cpia_pp.c 1.11 -> 1.12 # include/asm-arm/arch-clps711x/vmalloc.h 1.2 -> 1.3 # include/asm-parisc/bitops.h 1.5 -> 1.6 # kernel/ksyms.c 1.219 -> 1.232 # net/ipv4/ipvs/ip_vs_wrr.c 1.2 -> 1.3 # net/ipv4/netfilter/ip_conntrack_proto_icmp.c 1.5 -> 1.6 # drivers/ide/pci/pdcadma.h 1.4 -> (deleted) # arch/arm/kernel/signal.c 1.23 -> 1.24 # include/asm-sparc64/pgtable.h 1.29 -> 1.30 # drivers/pci/quirks.c 1.33 -> 1.34 # drivers/scsi/g_NCR5380.h 1.10 -> 1.11 # arch/arm/mach-integrator/lm.c 1.1 -> 1.2 # drivers/isdn/hardware/eicon/mntfunc.c 1.3 -> 1.4 # fs/xfs/xfs_buf_item.c 1.11 -> 1.12 # drivers/char/Kconfig 1.22 -> 1.23 # drivers/video/Kconfig 1.25 -> 1.30 # net/sched/sch_generic.c 1.8 -> 1.9 # include/linux/toshiba.h 1.2 -> 1.3 # drivers/net/irda/vlsi_ir.c 1.27 -> 1.28 # drivers/char/isicom.c 1.25 -> 1.26 # arch/x86_64/ia32/ia32_binfmt.c 1.17 -> 1.18 # fs/xfs/pagebuf/page_buf.c 1.61.1.1 -> 1.68 # drivers/media/video/saa7185.c 1.17 -> 1.18 # net/sctp/associola.c 1.59 -> 1.61 # net/core/flow.c 1.14 -> 1.15 # arch/x86_64/kernel/setup.c 1.21.1.2 -> 1.23 # include/linux/mm.h 1.130 -> 1.132 # fs/file_table.c 1.26 -> 1.27 # arch/ia64/sn/io/sn2/module.c 1.3 -> 1.4 # include/asm-arm/arch-integrator/irqs.h 1.1 -> 1.2 # drivers/serial/8250.c 1.36 -> 1.38 # net/core/neighbour.c 1.18 -> 1.19 # lib/Makefile 1.27 -> 1.28 # arch/i386/kernel/cpu/cpufreq/longhaul.c 1.35 -> 1.37 # drivers/ide/pci/amd74xx.h 1.7 -> 1.8 # drivers/ide/pci/cs5530.h 1.4 -> 1.5 # fs/fat/dir.c 1.20 -> 1.21 # drivers/net/irda/ep7211_ir.c 1.4 -> 1.5 # drivers/acpi/toshiba_acpi.c 1.12 -> 1.13 # fs/xfs/xfs_trans_buf.c 1.8 -> 1.9 # include/asm-ppc64/cacheflush.h 1.3 -> 1.4 # net/ipv4/ip_input.c 1.19 -> 1.20 # drivers/ide/pci/piix.c 1.17 -> 1.18 # net/sctp/sm_statefuns.c 1.63 -> 1.64 # fs/ext2/inode.c 1.70 -> 1.71 # drivers/usb/core/inode.c 1.53 -> 1.54 # drivers/ide/pci/pdc202xx_new.h 1.7 -> 1.8 # drivers/ide/pci/ns87415.h 1.4 -> 1.5 # drivers/char/random.c 1.39 -> 1.40 # drivers/scsi/sun3_scsi.h 1.8 -> 1.9 # drivers/acpi/dispatcher/dswload.c 1.22 -> 1.23 # net/802/p8023.c 1.2 -> 1.3 # net/802/tr.c 1.15 -> 1.16 # include/asm-sparc/unistd.h 1.25 -> 1.26 # drivers/scsi/sun3_scsi.c 1.18 -> 1.19 # Documentation/cpu-freq/user-guide.txt 1.9 -> 1.10 # drivers/char/dz.c 1.26 -> 1.27 # arch/parisc/kernel/inventory.c 1.3 -> 1.4 # include/asm-mips/pgtable-64.h 1.1 -> 1.2 # drivers/acpi/pci_link.c 1.17 -> 1.20 # include/asm-i386/highmem.h 1.12 -> 1.13 # arch/alpha/kernel/core_marvel.c 1.14 -> 1.15 # drivers/media/radio/radio-gemtek-pci.c 1.8 -> 1.9 # include/asm-arm/arch-integrator/vmalloc.h 1.2 -> 1.3 # arch/parisc/kernel/firmware.c 1.1 -> 1.2 # include/linux/serialP.h 1.10 -> 1.11 # include/acpi/acstruct.h 1.14 -> 1.15 # include/linux/sched.h 1.167 -> 1.168 # arch/i386/kernel/cpu/cpufreq/acpi.c 1.10 -> 1.11 # arch/parisc/lib/io.c 1.2 -> 1.3 # include/asm-arm/arch-adifcc/vmalloc.h 1.2 -> 1.3 # drivers/block/ll_rw_blk.c 1.216 -> 1.217 # drivers/net/Space.c 1.39 -> 1.41 # net/sched/estimator.c 1.3 -> 1.4 # kernel/sysctl.c 1.53 -> 1.55 # drivers/usb/serial/keyspan_usa28msg.h 1.5 -> 1.6 # arch/cris/mm/ioremap.c 1.4 -> 1.5 # include/asm-arm26/pgtable.h 1.2 -> 1.3 # drivers/usb/serial/keyspan.c 1.49 -> 1.50 # net/ipv4/xfrm4_tunnel.c 1.8 -> 1.9 # drivers/media/video/bt819.c 1.13 -> 1.14 # fs/xfs/xfs_log_priv.h 1.13 -> 1.14 # arch/parisc/kernel/asm-offsets.c 1.3 -> 1.4 # drivers/media/dvb/ttpci/budget-ci.c 1.4 -> 1.5 # include/asm-arm/arch-epxa10db/vmalloc.h 1.2 -> 1.3 # drivers/media/video/videodev.c 1.27 -> 1.29 # net/ipv4/protocol.c 1.7 -> 1.8 # arch/parisc/kernel/ptrace.c 1.9 -> 1.10 # include/asm-i386/mman.h 1.4 -> 1.5 # arch/arm/lib/lib1funcs.S 1.4 -> 1.5 # fs/smbfs/inode.c 1.44 -> 1.45 # fs/dcache.c 1.61 -> 1.62 # net/sctp/endpointola.c 1.28 -> 1.29 # arch/i386/kernel/cpu/mcheck/mce.h 1.2 -> 1.3 # drivers/isdn/hardware/eicon/divasmain.c 1.15 -> 1.16 # sound/oss/ac97_codec.c 1.18 -> 1.19 # net/ipv4/af_inet.c 1.58 -> 1.60 # drivers/net/arcnet/com20020-isa.c 1.9 -> 1.10 # drivers/media/dvb/ttpci/budget-patch.c 1.6 -> 1.7 # include/asm-sparc64/visasm.h 1.4 -> 1.5 # include/asm-arm/arch-pxa/irqs.h 1.4 -> 1.5 # sound/oss/dmasound/tas3001c.c 1.1 -> 1.2 # net/sctp/sm_make_chunk.c 1.61 -> 1.64 # drivers/block/cpqarray.c 1.80 -> 1.81 # arch/s390/mm/ioremap.c 1.7 -> 1.8 # drivers/net/loopback.c 1.9 -> 1.10 # drivers/usb/host/uhci-debug.c 1.6 -> 1.7 # arch/i386/Kconfig 1.83 -> 1.86 # drivers/cdrom/cdrom.c 1.40 -> 1.41 # net/ipv4/netfilter/ip_nat_core.c 1.32 -> 1.34 # include/linux/elf.h 1.25 -> 1.26 # drivers/ide/pci/generic.h 1.6 -> 1.7 # drivers/mtd/nand/autcpu12.c 1.3 -> 1.4 # fs/jfs/jfs_imap.c 1.27 -> 1.28 # net/ipv4/netfilter/ip_nat_helper.c 1.17 -> 1.19 # drivers/net/arcnet/com20020-pci.c 1.16 -> 1.17 # include/asm-arm/arch-shark/vmalloc.h 1.2 -> 1.3 # fs/jbd/journal.c 1.64 -> 1.65 # net/ipv4/udp.c 1.50 -> 1.51 # drivers/cdrom/sbpcd.c 1.48 -> 1.49 # include/asm-sparc64/unistd.h 1.24 -> 1.25 # drivers/acpi/parser/psparse.c 1.21 -> 1.22 # drivers/scsi/g_NCR5380.c 1.23 -> 1.24 # arch/alpha/kernel/setup.c 1.36 -> 1.37 # fs/nfsd/nfsctl.c 1.37 -> 1.38 # arch/arm/mach-sa1100/leds.c 1.11 -> 1.12 # include/asm-arm/arch-l7200/vmalloc.h 1.2 -> 1.3 # arch/ppc/mm/pgtable.c 1.14 -> 1.15 # drivers/ide/legacy/umc8672.c 1.10 -> 1.11 # drivers/ide/legacy/qd65xx.c 1.8 -> 1.9 # drivers/ide/legacy/ali14xx.c 1.9 -> 1.10 # include/asm-x86_64/cacheflush.h 1.4 -> 1.5 # include/asm-arm/arch-pxa/lubbock.h 1.2 -> 1.3 # drivers/ide/pci/Makefile 1.8 -> 1.9 # fs/xfs/xfs_vfsops.c 1.44.1.2 -> 1.46 # include/net/pkt_sched.h 1.6 -> 1.7 # sound/oss/ite8172.c 1.23 -> 1.25 # drivers/usb/serial/keyspan_usa49msg.h 1.6 -> 1.7 # include/asm-ia64/cacheflush.h 1.4 -> 1.5 # arch/i386/kernel/cpu/cpufreq/Kconfig 1.9 -> 1.11 # include/asm-parisc/page.h 1.4 -> 1.5 # drivers/ide/pci/piix.h 1.7 -> 1.8 # arch/parisc/math-emu/types.h 1.1 -> (deleted) # drivers/char/cyclades.c 1.30 -> 1.31 # drivers/net/ibmlana.c 1.10 -> 1.11 # net/sched/sch_fifo.c 1.5 -> 1.6 # security/dummy.c 1.27 -> 1.28 # arch/parisc/kernel/entry.S 1.11 -> 1.12 # include/asm-ppc/pgtable.h 1.25 -> 1.26 # drivers/char/watchdog/amd7xx_tco.c 1.7 -> 1.8 # include/linux/istallion.h 1.4 -> 1.5 # drivers/char/i8k.c 1.8 -> 1.9 # drivers/block/Kconfig 1.11 -> 1.14 # drivers/video/pm3fb.c 1.9 -> 1.10 # arch/arm/mach-sa1100/pm.c 1.13 -> 1.14 # net/sched/cls_api.c 1.5 -> 1.6 # sound/oss/btaudio.c 1.20 -> 1.22 # net/ipv4/devinet.c 1.20 -> 1.21 # include/asm-m68k/zorro.h 1.4 -> 1.5 # fs/xfs/xfs_fs.h 1.8 -> 1.9 # drivers/media/video/bw-qcam.c 1.13 -> 1.14 # include/asm-arm/arch-anakin/vmalloc.h 1.2 -> 1.3 # drivers/net/wan/comx-hw-munich.c 1.14 -> 1.15 # sound/oss/dmasound/dac3550a.c 1.1 -> 1.2 # arch/m68k/kernel/time.c 1.11 -> 1.12 # fs/xfs/xfs_types.h 1.11 -> 1.12 # drivers/net/wan/dscc4.c 1.48 -> 1.49 # net/core/ethtool.c 1.7 -> 1.8 # drivers/char/ftape/lowlevel/fdc-io.c 1.11 -> 1.12 # include/linux/rcupdate.h 1.3 -> 1.4 # net/bridge/netfilter/Kconfig 1.8 -> 1.9 # arch/i386/mm/ioremap.c 1.18 -> 1.19 # include/asm-parisc/keyboard.h 1.2 -> 1.3 # drivers/net/wan/syncppp.c 1.15 -> 1.16 # include/linux/mca.h 1.7 -> 1.8 # arch/i386/kernel/entry.S 1.67 -> 1.69 # arch/x86_64/kernel/i387.c 1.7 -> 1.8 # drivers/ide/pci/sc1200.h 1.2 -> 1.3 # include/net/sctp/sctp.h 1.50 -> 1.52 # drivers/char/ser_a2232.c 1.18 -> 1.19 # arch/i386/kernel/cpu/intel.c 1.22 -> 1.23 # net/ipv4/tcp.c 1.46 -> 1.48 # drivers/ide/pci/slc90e66.h 1.4 -> 1.5 # drivers/eisa/eisa-bus.c 1.12 -> 1.13 # fs/xfs/linux/xfs_stats.h 1.5 -> 1.7 # drivers/video/console/sticore.c 1.14 -> 1.15 # arch/alpha/kernel/smp.c 1.37 -> 1.38 # net/ipv4/ip_fragment.c 1.10 -> 1.11 # drivers/ide/ide.c 1.96 -> 1.102 # arch/alpha/kernel/core_titan.c 1.20 -> 1.21 # include/asm-alpha/pgtable.h 1.19 -> 1.20 # drivers/scsi/ncr53c8xx.c 1.36 -> 1.37 # drivers/ide/legacy/dtc2278.c 1.9 -> 1.10 # net/ipv4/ip_sockglue.c 1.17 -> 1.18 # fs/xfs/quota/xfs_qm.h 1.4 -> 1.5 # include/asm-ia64/pgtable.h 1.28 -> 1.29 # mm/bootmem.c 1.21 -> 1.22 # arch/arm/kernel/entry-armv.S 1.34 -> 1.35 # arch/i386/kernel/mpparse.c 1.50 -> 1.55 # drivers/net/arcnet/com20020.c 1.8 -> 1.9 # drivers/media/dvb/dvb-core/dvbdev.h 1.8 -> 1.9 # arch/parisc/kernel/unaligned.c 1.3 -> 1.4 # drivers/acpi/asus_acpi.c 1.1 -> 1.4 # include/sound/sndmagic.h 1.13 -> 1.14 # drivers/char/lp_old98.c 1.3 -> 1.4 # drivers/acpi/executer/exfldio.c 1.22 -> 1.23 # arch/arm/mach-integrator/impd1.c 1.3 -> 1.4 # net/ipv4/tcp_ipv4.c 1.67 -> 1.68 # fs/hfs/file.c 1.14 -> 1.15 # fs/xfs/linux/xfs_iops.c 1.36 -> 1.37 # net/core/filter.c 1.7 -> 1.8 # drivers/mtd/chips/cfi_cmdset_0020.c 1.1 -> 1.3 # include/asm-sparc/cacheflush.h 1.3 -> 1.4 # net/core/dev_mcast.c 1.1 -> 1.2 # arch/sparc64/defconfig 1.100 -> 1.101 # fs/xfs/linux/xfs_vnode.c 1.19 -> 1.20 # include/asm-parisc/atomic.h 1.3 -> 1.4 # Documentation/iostats.txt 1.1 -> 1.2 # mm/filemap.c 1.208 -> 1.209 # fs/namei.c 1.85 -> 1.87 # include/asm-v850/cacheflush.h 1.4 -> 1.5 # fs/hfs/super.c 1.23 -> 1.24 # net/ipv4/netfilter/ip_conntrack_proto_generic.c 1.5 -> 1.6 # drivers/isdn/i4l/isdn_common.c 1.79 -> 1.80 # drivers/net/wan/sbni.c 1.25 -> 1.26 # fs/xfs/xfs_mount.c 1.35 -> 1.37 # drivers/char/pcmcia/synclink_cs.c 1.26 -> 1.27 # drivers/ide/pci/cs5530.c 1.14 -> 1.15 # net/socket.c 1.68 -> 1.69 # include/asm-parisc/irq.h 1.5 -> 1.6 # Documentation/cachetlb.txt 1.8 -> 1.9 # arch/parisc/mm/ioremap.c 1.1 -> 1.2 # drivers/ide/pci/siimage.c 1.15 -> 1.16 # arch/arm/Makefile 1.50 -> 1.51 # arch/sparc64/mm/init.c 1.50 -> 1.51 # drivers/pci/hotplug/pci_hotplug.h 1.10 -> 1.11 # net/xfrm/xfrm_algo.c 1.11 -> 1.13 # arch/arm/mach-pxa/lubbock.c 1.12 -> 1.13 # include/asm-arm/arch-ebsa110/vmalloc.h 1.3 -> 1.4 # arch/i386/kernel/dmi_scan.c 1.44.1.1 -> 1.48 # drivers/net/irda/w83977af_ir.c 1.22 -> 1.23 # drivers/media/video/bttvp.h 1.14 -> 1.15 # net/sctp/sysctl.c 1.13 -> 1.14 # init/do_mounts.c 1.55.1.2 -> 1.58 # fs/exec.c 1.96 -> 1.97 # drivers/scsi/nsp32.c 1.21 -> 1.22 # drivers/ide/pci/hpt34x.c 1.15 -> 1.16 # drivers/ide/pci/opti621.c 1.13 -> 1.14 # net/core/scm.c 1.8 -> 1.9 # include/asm-h8300/cacheflush.h 1.1 -> 1.2 # include/asm-parisc/dma-mapping.h 1.3 -> 1.4 # arch/parisc/kernel/irq.c 1.17 -> 1.18 # drivers/acpi/tables.c 1.15 -> 1.16 # drivers/net/at1700.c 1.18 -> 1.19 # arch/parisc/kernel/binfmt_elf32.c 1.4 -> 1.5 # drivers/ide/pci/it8172.h 1.4 -> 1.5 # drivers/net/irda/ali-ircc.c 1.22 -> 1.23 # net/ipv4/netfilter/ip_nat_rule.c 1.11 -> 1.12 # sound/parisc/harmony.c 1.2 -> 1.3 # arch/parisc/kernel/time.c 1.11 -> 1.12 # drivers/char/sx.c 1.40 -> 1.41 # drivers/net/ne3210.c 1.9 -> 1.10 # net/netsyms.c 1.99 -> (deleted) # include/asm-arm/arch-ebsa285/vmalloc.h 1.3 -> 1.4 # drivers/media/video/saa7111.c 1.18 -> 1.19 # drivers/sbus/char/bbc_envctrl.c 1.5 -> 1.6 # drivers/ide/pci/cmd64x.h 1.4 -> 1.5 # drivers/char/dtlk.c 1.14 -> 1.15 # arch/arm/kernel/traps.c 1.28 -> 1.29 # net/Makefile 1.24 -> 1.25 # drivers/media/video/tuner-3036.c 1.9 -> 1.10 # include/asm-sh/cacheflush.h 1.1 -> 1.2 # include/asm-parisc/rt_sigframe.h 1.1 -> 1.2 # arch/sparc64/kernel/systbls.S 1.47 -> 1.48 # fs/befs/linuxvfs.c 1.12 -> 1.15 # drivers/char/serial167.c 1.30 -> 1.31 # include/linux/usb.h 1.90 -> 1.91 # drivers/mtd/devices/lart.c 1.2 -> 1.3 # drivers/net/irda/donauboe.c 1.13 -> 1.14 # net/sched/sch_api.c 1.10 -> 1.12 # arch/i386/kernel/cpu/cpufreq/Makefile 1.9 -> 1.10 # include/asm-parisc/param.h 1.2 -> 1.3 # fs/super.c 1.107 -> 1.109 # fs/xfs/xfs_da_btree.h 1.6 -> 1.7 # net/ipv4/netfilter/ip_conntrack_standalone.c 1.21 -> 1.22 # fs/fat/inode.c 1.76 -> 1.77 # fs/binfmt_elf.c 1.53 -> 1.56 # net/core/dv.c 1.8 -> 1.9 # include/net/sctp/sm.h 1.29 -> 1.31 # drivers/acpi/pci_irq.c 1.21 -> 1.22 # drivers/media/video/c-qcam.c 1.10 -> 1.11 # drivers/ide/pci/ns87415.c 1.12 -> 1.13 # include/linux/moduleparam.h 1.3 -> 1.4 # fs/xfs/quota/xfs_dquot.c 1.8 -> 1.9 # fs/jfs/super.c 1.43 -> 1.44 # drivers/sbus/char/jsflash.c 1.32 -> 1.33 # include/asm-m68k/pci.h 1.5 -> 1.6 # fs/xfs/pagebuf/page_buf_internal.h 1.10 -> 1.12 # drivers/net/irda/ma600.c 1.6 -> 1.7 # arch/sparc/kernel/entry.S 1.15 -> 1.16 # drivers/char/ip2/i2os.h 1.3 -> 1.4 # arch/parisc/math-emu/Makefile 1.2 -> 1.3 # arch/parisc/math-emu/denormal.c 1.1 -> 1.2 # net/core/netfilter.c 1.25 -> 1.26 # net/ipv4/utils.c 1.3 -> 1.4 # net/irda/irda_device.c 1.23 -> 1.26 # fs/affs/file.c 1.26 -> 1.27 # include/linux/pci.h 1.107 -> 1.108 # drivers/acpi/dispatcher/dsutils.c 1.19 -> 1.20 # arch/i386/kernel/setup.c 1.96.1.1 -> 1.100 # drivers/mtd/mtdcore.c 1.5 -> 1.6 # arch/i386/kernel/smpboot.c 1.65 -> 1.66 # fs/xfs/support/move.h 1.3 -> 1.4 # drivers/net/3c523.c 1.12 -> 1.13 # include/net/scm.h 1.4 -> 1.5 # arch/ia64/kernel/acpi.c 1.50 -> 1.51 # arch/mips/mm/ioremap.c 1.4 -> 1.5 # arch/parisc/mm/init.c 1.12 -> 1.13 # drivers/net/tokenring/smctr.c 1.25 -> 1.26 # sound/oss/dmasound/Kconfig 1.3 -> 1.4 # drivers/ide/ide-floppy.c 1.32 -> 1.33 # drivers/ide/pci/sis5513.c 1.18 -> 1.19 # drivers/media/video/zr36120.c 1.20 -> 1.21 # include/asm-arm/arch-nexuspci/vmalloc.h 1.2 -> 1.3 # include/asm-arm/arch-pxa/vmalloc.h 1.2 -> 1.3 # drivers/acpi/namespace/nsutils.c 1.24 -> 1.25 # net/netlink/af_netlink.c 1.34 -> 1.35 # arch/sparc/kernel/systbls.S 1.23 -> 1.24 # net/802/hippi.c 1.3 -> 1.4 # net/core/dev.c 1.109 -> 1.114 # drivers/net/irda/irda-usb.c 1.44 -> 1.45 # drivers/ide/legacy/pdc4030.c 1.16 -> 1.18 # drivers/net/irda/act200l.c 1.6 -> 1.7 # drivers/char/generic_serial.c 1.13 -> 1.14 # drivers/usb/misc/brlvger.c 1.22 -> 1.23 # drivers/char/dsp56k.c 1.14 -> 1.15 # arch/alpha/kernel/time.c 1.21 -> 1.23 # drivers/i2c/i2c-sensor.c 1.28 -> 1.29 # drivers/isdn/hardware/eicon/divamnt.c 1.9 -> 1.10 # drivers/net/irda/esi.c 1.5 -> 1.6 # drivers/media/dvb/dvb-core/dvb_functions.h 1.2 -> 1.3 # drivers/ide/pci/generic.c 1.10 -> 1.11 # include/asm-i386/cacheflush.h 1.4 -> 1.5 # fs/hfs/file_cap.c 1.10 -> 1.11 # arch/i386/kernel/cpu/mcheck/winchip.c 1.1 -> 1.2 # include/acpi/acdisasm.h 1.1 -> 1.2 # include/asm-mips/pgtable-32.h 1.1 -> 1.2 # net/bridge/netfilter/ebt_vlan.c 1.7 -> 1.8 # net/ethernet/eth.c 1.5 -> 1.6 # fs/ext3/symlink.c 1.4 -> 1.5 # include/asm-arm/arch-integrator/platform.h 1.2 -> 1.3 # arch/arm/Kconfig 1.38 -> 1.40 # drivers/ide/pci/siimage.h 1.7 -> 1.8 # drivers/media/video/meye.h 1.9 -> 1.10 # drivers/scsi/a2091.c 1.12 -> 1.13 # drivers/ide/ide-proc.c 1.13 -> 1.14 # arch/arm/kernel/setup.c 1.37 -> 1.38 # fs/xfs/xfs_log_recover.c 1.31.1.1 -> 1.34 # sound/oss/swarm_cs4297a.c 1.5 -> 1.6 # fs/xfs/support/move.c 1.5 -> 1.6 # drivers/isdn/hardware/eicon/dqueue.c 1.2 -> 1.3 # drivers/net/mac8390.c 1.12 -> 1.13 # drivers/net/irda/litelink.c 1.5 -> 1.6 # drivers/net/irda/tekram.c 1.8 -> 1.9 # drivers/acpi/ec.c 1.24 -> 1.25 # drivers/scsi/sym53c8xx_comm.h 1.14 -> 1.15 # include/linux/sysctl.h 1.51 -> 1.52 # drivers/media/video/videocodec.c 1.1 -> 1.2 # drivers/media/video/zoran_device.c 1.4 -> 1.5 # drivers/usb/serial/keyspan_usa26msg.h 1.6 -> 1.7 # drivers/media/dvb/ttpci/budget.c 1.5 -> 1.6 # include/linux/list.h 1.34 -> 1.35 # drivers/net/3c527.c 1.15 -> 1.16 # include/asm-sparc/pgtable.h 1.16 -> 1.17 # sound/oss/dmasound/tas_common.c 1.1 -> 1.2 # fs/Kconfig 1.35 -> 1.37 # drivers/media/video/zoran_card.c 1.6 -> 1.7 # drivers/mtd/chips/sharp.c 1.9 -> 1.10 # include/linux/highuid.h 1.1 -> 1.2 # fs/buffer.c 1.214 -> 1.215 # mm/vmalloc.c 1.27 -> 1.28 # arch/i386/kernel/cpu/mcheck/k7.c 1.5 -> 1.7 # fs/hpfs/super.c 1.27 -> 1.28 # include/linux/skbuff.h 1.32 -> 1.33 # fs/xfs/pagebuf/page_buf.h 1.32 -> 1.34 # arch/i386/kernel/cpu/mcheck/p5.c 1.1 -> 1.2 # arch/m68k/Kconfig 1.22 -> 1.25 # drivers/media/video/vpx3220.c 1.3 -> 1.4 # fs/hpfs/hpfs_fn.h 1.16 -> 1.17 # arch/arm/lib/io-readsw-armv4.S 1.4 -> 1.5 # drivers/char/pcxx.c 1.21 -> 1.22 # arch/arm/mach-pxa/pm.c 1.5 -> 1.6 # arch/ppc64/kernel/process.c 1.39 -> 1.40 # arch/sh/mm/ioremap.c 1.5 -> 1.6 # arch/parisc/Kconfig 1.24 -> 1.25 # MAINTAINERS 1.168 -> 1.173 # drivers/ide/pci/sc1200.c 1.9 -> 1.11 # include/linux/sctp.h 1.8 -> 1.9 # drivers/acpi/bus.c 1.33 -> 1.34 # net/core/dst.c 1.13 -> 1.14 # drivers/char/rio/rio_linux.c 1.30 -> 1.31 # net/ipv4/ipvs/ip_vs_wlc.c 1.2 -> 1.3 # arch/ia64/sn/io/sn2/pic.c 1.4 -> 1.5 # net/core/datagram.c 1.10 -> 1.11 # drivers/ide/pci/sis5513.h 1.4 -> 1.5 # drivers/char/istallion.c 1.32 -> 1.33 # drivers/char/raw.c 1.36 -> 1.37 # drivers/telephony/phonedev.c 1.8 -> 1.9 # net/bridge/netfilter/Makefile 1.7 -> 1.8 # drivers/mtd/chips/map_rom.c 1.6 -> 1.7 # drivers/net/irda/sir_dev.c 1.6 -> 1.7 # mm/highmem.c 1.44 -> 1.45 # drivers/net/irda/smsc-ircc2.c 1.1 -> 1.7 # net/unix/af_unix.c 1.54 -> 1.55 # drivers/video/sstfb.c 1.27 -> 1.28 # arch/i386/kernel/cpu/mcheck/p4.c 1.3 -> 1.4 # drivers/net/wireless/arlan-main.c 1.28 -> 1.31 # arch/arm/mm/ioremap.c 1.4 -> 1.5 # arch/sparc64/kernel/module.c 1.15 -> 1.16 # arch/i386/kernel/cpu/mcheck/p6.c 1.1 -> 1.2 # drivers/ide/pci/via82cxxx.h 1.4 -> 1.5 # fs/xfs/xfs_dinode.h 1.4 -> 1.5 # include/asm-i386/unistd.h 1.29 -> 1.30 # include/asm-m68k/cacheflush.h 1.5 -> 1.6 # init/do_mounts.h 1.6.1.3 -> 1.10 # sound/oss/au1000.c 1.4 -> 1.6 # fs/udf/super.c 1.35 -> 1.37 # drivers/net/sk_mca.c 1.15 -> 1.16 # fs/ext2/super.c 1.53 -> 1.54 # arch/parisc/lib/checksum.c 1.3 -> 1.4 # net/sctp/sm_sideeffect.c 1.48 -> 1.49 # drivers/media/dvb/ttpci/av7110.c 1.5 -> 1.7 # include/asm-arm/arch-iop3xx/vmalloc.h 1.4 -> 1.5 # fs/hfs/file_hdr.c 1.11 -> 1.12 # Makefile 1.431.1.1 -> 1.434 # fs/fcntl.c 1.29 -> 1.30 # drivers/parisc/superio.c 1.6 -> 1.7 # sound/pci/cmipci.c 1.26 -> 1.27 # drivers/pci/power.c 1.6 -> (deleted) # drivers/acpi/events/evregion.c 1.19 -> 1.20 # drivers/acpi/dispatcher/dsfield.c 1.18 -> 1.19 # drivers/isdn/hardware/eicon/os_capi.h 1.1 -> 1.2 # fs/freevxfs/vxfs_immed.c 1.3 -> 1.4 # fs/ext3/inode.c 1.85 -> 1.86 # arch/m68k/sun3/config.c 1.10 -> 1.11 # include/linux/raw.h 1.2 -> 1.3 # drivers/char/agp/amd64-agp.c 1.63 -> 1.64 # drivers/net/irda/irport.c 1.20 -> 1.21 # fs/xfs/xfs_attr_fetch.c 1.4 -> (deleted) # include/linux/ftape.h 1.4 -> 1.5 # drivers/mtd/maps/sun_uflash.c 1.4 -> 1.5 # drivers/char/mxser.c 1.28 -> 1.29 # net/ipv4/tcp_output.c 1.31 -> 1.32 # fs/affs/super.c 1.39 -> 1.40 # drivers/usb/serial/keyspan.h 1.19 -> 1.20 # include/asm-i386/elf.h 1.9 -> 1.11 # include/asm-ia64/elf.h 1.13 -> 1.14 # include/asm-alpha/cacheflush.h 1.2 -> 1.3 # include/linux/hdlcdrv.h 1.3 -> 1.4 # drivers/char/rocket.c 1.33 -> 1.34 # scripts/bin2c.c 1.1 -> 1.2 # Documentation/crypto/api-intro.txt 1.15 -> 1.16 # arch/alpha/kernel/core_irongate.c 1.11 -> 1.12 # include/asm-arm/arch-rpc/vmalloc.h 1.2 -> 1.3 # arch/arm/kernel/time.c 1.19 -> 1.20 # arch/arm/mach-integrator/core.c 1.13 -> 1.14 # drivers/media/video/cpia.c 1.27 -> 1.28 # arch/h8300/README 1.1 -> 1.2 # CREDITS 1.99 -> 1.100 # net/ipv4/ip_options.c 1.3 -> 1.4 # fs/seq_file.c 1.11 -> 1.12 # arch/arm/mach-integrator/pci_v3.c 1.16 -> 1.17 # fs/xfs/xfs_error.h 1.7.1.1 -> 1.9 # arch/sparc64/mm/ultra.S 1.24 -> 1.25 # include/asm-sparc64/tlbflush.h 1.6 -> 1.7 # kernel/module.c 1.92 -> 1.93 # net/core/skbuff.c 1.30 -> 1.31 # drivers/mca/mca-proc.c 1.2 -> 1.3 # include/linux/security.h 1.25 -> 1.26 # include/asm-x86_64/pgtable.h 1.22 -> 1.23 # include/asm-parisc/pci.h 1.8 -> 1.9 # drivers/scsi/qlogicfc.c 1.37 -> 1.38 # include/asm-arm26/cacheflush.h 1.1 -> 1.2 # include/asm-ppc64/elf.h 1.12 -> 1.13 # include/asm-parisc/elf.h 1.7 -> 1.8 # net/ipv4/sysctl_net_ipv4.c 1.12 -> 1.13 # drivers/media/video/saa7134/saa7134.h 1.6 -> 1.7 # include/linux/hfs_fs.h 1.9 -> 1.10 # net/core/sock.c 1.27 -> 1.28 # include/linux/dqblk_xfs.h 1.3 -> 1.4 # fs/autofs4/inode.c 1.13 -> 1.14 # drivers/ide/pci/pdc202xx_new.c 1.18 -> 1.19 # include/asm-mips/highmem.h 1.1 -> 1.2 # include/linux/netfilter_ipv4/ip_conntrack_tuple.h 1.3 -> 1.4 # fs/xfs/xfs_trans.h 1.7 -> 1.8 # fs/autofs/inode.c 1.15 -> 1.16 # drivers/isdn/hardware/eicon/platform.h 1.5 -> 1.6 # include/asm-i386/pgtable.h 1.37 -> 1.38 # arch/i386/kernel/cpu/mcheck/mce.c 1.2 -> 1.3 # drivers/char/stallion.c 1.35 -> 1.36 # include/acpi/acconfig.h 1.42 -> 1.44 # net/ipv4/tcp_input.c 1.45 -> 1.46 # arch/m68k/atari/stram.c 1.28 -> 1.29 # include/asm-ppc/cacheflush.h 1.5 -> 1.6 # drivers/usb/input/Kconfig 1.8 -> 1.9 # net/ipv4/tcp_minisocks.c 1.41 -> 1.42 # include/asm-arm/arch-integrator/time.h 1.6 -> 1.7 # drivers/ide/pci/slc90e66.c 1.13 -> 1.14 # drivers/ide/pci/pdcadma.c 1.13 -> (deleted) # fs/xfs/xfs_da_btree.c 1.10 -> 1.11 # drivers/usb/storage/unusual_devs.h 1.54 -> 1.56 # net/ipv4/netfilter/ip_conntrack_irc.c 1.15 -> 1.16 # drivers/mtd/devices/pmc551.c 1.12 -> 1.13 # net/core/wireless.c 1.14 -> 1.15 # sound/oss/harmony.c 1.5 -> 1.6 # drivers/mtd/maps/integrator-flash.c 1.4 -> 1.5 # fs/xfs/xfsidbg.c 1.34.1.1 -> 1.36 # net/ipv4/netfilter/ip_nat_standalone.c 1.26 -> 1.28 # drivers/ide/pci/it8172.c 1.11 -> 1.12 # include/asm-mips/cacheflush.h 1.2 -> 1.3 # fs/jfs/jfs_debug.c 1.5 -> 1.6 # include/asm-s390/pgtable.h 1.19 -> 1.20 # net/802/fddi.c 1.2 -> 1.3 # kernel/sched.c 1.213 -> 1.216 # sound/oss/ali5455.c 1.5 -> 1.6 # drivers/media/video/planb.c 1.17 -> 1.18 # include/asm-ppc/zorro.h 1.1 -> 1.2 # drivers/ide/legacy/ht6560b.c 1.8 -> 1.9 # fs/efs/super.c 1.19 -> 1.20 # include/asm-x86_64/elf.h 1.6 -> 1.7 # arch/arm/lib/io-readsl-armv4.S 1.4 -> 1.5 # kernel/params.c 1.5 -> 1.6 # Documentation/zorro.txt 1.2 -> 1.3 # net/ipv4/ipvs/ip_vs_lblcr.c 1.5 -> 1.6 # drivers/pci/hotplug/cpqphp.h 1.11 -> 1.12 # drivers/pci/hotplug/pci_hotplug_core.c 1.41 -> 1.42 # drivers/input/mouse/Kconfig 1.10 -> 1.11 # net/ipv4/netfilter/ipt_REJECT.c 1.23 -> 1.24 # drivers/media/video/pms.c 1.13 -> 1.14 # drivers/acpi/dispatcher/dsopcode.c 1.20 -> 1.21 # drivers/media/video/saa7114.c 1.4 -> 1.5 # drivers/media/dvb/dvb-core/dvb_functions.c 1.3 -> 1.4 # drivers/char/agp/via-agp.c 1.52 -> 1.53 # net/sctp/bind_addr.c 1.21 -> 1.22 # arch/arm/mach-integrator/Kconfig 1.2 -> 1.3 # sound/oss/dmasound/tas3004.c 1.1 -> 1.2 # drivers/net/Kconfig 1.50 -> 1.55 # drivers/i2c/busses/Kconfig 1.28 -> 1.29 # drivers/char/ftape/compressor/zftape-compress.c 1.8 -> 1.9 # net/ipv4/arp.c 1.30 -> 1.32 # arch/parisc/kernel/sys_parisc.c 1.9 -> 1.10 # arch/i386/kernel/acpi/boot.c 1.31 -> 1.32 # include/linux/stallion.h 1.4 -> 1.5 # include/asm-m68k/pgtable.h 1.8 -> 1.9 # drivers/acpi/dispatcher/dswstate.c 1.19 -> 1.20 # include/asm-arm/arch-cl7500/vmalloc.h 1.2 -> 1.3 # drivers/scsi/sym53c8xx_2/sym_misc.c 1.1 -> 1.2 # arch/m68k/q40/q40ints.c 1.13 -> 1.15 # include/asm-parisc/pgtable.h 1.13 -> 1.15 # arch/parisc/kernel/drivers.c 1.7 -> 1.8 # drivers/ide/pci/cmd64x.c 1.13 -> 1.14 # arch/arm/mach-pxa/irq.c 1.7 -> 1.8 # drivers/usb/host/uhci-hcd.c 1.45 -> 1.46 # arch/arm/mach-integrator/Makefile 1.10 -> 1.11 # fs/xfs/xfs_dir_leaf.c 1.13 -> 1.14 # drivers/media/video/zoran_procfs.c 1.6 -> 1.7 # include/asm-i386/acpi.h 1.8 -> 1.9 # drivers/mtd/chips/gen_probe.c 1.3 -> 1.4 # drivers/ide/pci/opti621.h 1.4 -> 1.5 # fs/proc/inode.c 1.25 -> 1.26 # fs/hugetlbfs/inode.c 1.33 -> 1.34 # net/ipv4/ipvs/ip_vs_lblc.c 1.4 -> 1.5 # drivers/scsi/Kconfig 1.32 -> 1.39 # fs/ext3/super.c 1.76 -> 1.77 # fs/xfs/linux/xfs_aops.c 1.45 -> 1.48 # arch/arm/boot/compressed/head.S 1.18 -> 1.19 # arch/arm/kernel/process.c 1.30 -> 1.31 # drivers/media/dvb/ttusb-dec/ttusb_dec.c 1.4 -> 1.5 # drivers/media/video/stradis.c 1.16 -> 1.17 # arch/alpha/mm/init.c 1.18 -> 1.19 # drivers/input/joystick/analog.c 1.16 -> 1.17 # include/linux/netfilter_ipv4/ip_nat_rule.h 1.2 -> 1.3 # include/asm-arm/cacheflush.h 1.4 -> 1.5 # security/selinux/ss/services.c 1.1 -> 1.2 # drivers/pci/Makefile 1.34 -> 1.35 # drivers/acpi/namespace/nsdump.c 1.19 -> 1.20 # drivers/media/video/adv7175.c 1.18 -> 1.19 # net/ipv4/inetpeer.c 1.7 -> 1.8 # fs/xfs/linux/xfs_super.c 1.60.1.2 -> 1.62 # arch/m68k/Makefile 1.13 -> 1.14 # net/irda/irsyms.c 1.17 -> 1.18 # drivers/sbus/char/cpwatchdog.c 1.12 -> 1.13 # fs/xfs/linux/xfs_stats.c 1.7 -> 1.8 # drivers/media/video/adv7170.c 1.4 -> 1.5 # drivers/scsi/gvp11.c 1.12 -> 1.13 # net/ipv4/tcp_timer.c 1.16 -> 1.17 # drivers/media/video/v4l2-common.c 1.2 -> 1.3 # arch/arm/lib/io-writesw-armv4.S 1.4 -> 1.5 # fs/xfs/xfs_bmap.c 1.16 -> 1.17 # include/asm-m68knommu/cacheflush.h 1.4 -> 1.5 # drivers/acpi/dispatcher/dsinit.c 1.9 -> 1.10 # drivers/char/misc.c 1.24 -> 1.25 # net/sched/police.c 1.3 -> 1.4 # drivers/char/moxa.c 1.26 -> 1.27 # drivers/pci/pool.c 1.15 -> 1.16 # drivers/char/toshiba.c 1.9 -> 1.11 # net/ipv4/ipvs/ip_vs_lc.c 1.2 -> 1.3 # fs/xfs/xfs_error.c 1.11 -> 1.12 # net/ipv4/icmp.c 1.36 -> 1.37 # drivers/net/irda/old_belkin.c 1.7 -> 1.8 # include/asm-arm/unistd.h 1.17 -> 1.18 # arch/x86_64/mm/ioremap.c 1.10 -> 1.11 # drivers/acpi/executer/excreate.c 1.17 -> 1.18 # security/selinux/hooks.c 1.7 -> 1.8 # drivers/net/tokenring/madgemc.c 1.16 -> 1.17 # fs/compat_ioctl.c 1.6 -> 1.8 # Documentation/ioctl-number.txt 1.10 -> 1.11 # include/asm-ppc64/pgtable.h 1.24 -> 1.25 # arch/arm/kernel/apm.c 1.4 -> 1.5 # drivers/acpi/Makefile 1.35 -> 1.36 # drivers/input/keyboard/Kconfig 1.9 -> 1.10 # include/linux/compat_ioctl.h 1.9 -> 1.10 # arch/parisc/kernel/setup.c 1.8 -> 1.9 # net/ipv4/ipvs/ip_vs_sed.c 1.2 -> 1.3 # fs/isofs/inode.c 1.35 -> 1.36 # drivers/acpi/namespace/nssearch.c 1.19 -> 1.20 # drivers/net/irda/mcp2120.c 1.6 -> 1.7 # drivers/media/common/saa7146_i2c.c 1.6 -> 1.7 # fs/ext3/file.c 1.14 -> 1.15 # drivers/block/cciss.c 1.95 -> 1.97 # include/asm-parisc/cacheflush.h 1.5 -> 1.6 # fs/xfs/xfs_buf.h 1.14 -> 1.15 # include/asm-parisc/pgalloc.h 1.8 -> 1.9 # fs/xfs/xfs_inode.c 1.35 -> 1.36 # include/asm-ppc/highmem.h 1.14 -> 1.15 # fs/hpfs/file.c 1.13 -> 1.14 # arch/parisc/kernel/signal.c 1.11 -> 1.12 # include/asm-sparc64/cacheflush.h 1.2 -> 1.4 # fs/xfs/xfs_rw.c 1.10.1.1 -> 1.12 # arch/arm/mach-pxa/leds.c 1.3 -> 1.4 # net/ipv4/ip_output.c 1.43 -> 1.44 # net/ipv4/igmp.c 1.39 -> 1.40 # drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 1.4 -> 1.6 # fs/inode.c 1.105 -> 1.106 # include/net/sctp/command.h 1.14 -> 1.15 # net/ipv4/netfilter/ip_conntrack_proto_tcp.c 1.9 -> 1.10 # include/linux/mca-legacy.h 1.3 -> 1.4 # net/ipv4/route.c 1.71 -> 1.72 # drivers/isdn/hardware/eicon/debuglib.h 1.2 -> 1.3 # drivers/acpi/dispatcher/dswscope.c 1.13 -> 1.14 # include/asm-sparc/highmem.h 1.8 -> 1.9 # include/asm-parisc/tlbflush.h 1.1 -> 1.2 # drivers/block/acsi.c 1.54 -> 1.55 # include/net/sctp/structs.h 1.73 -> 1.75 # drivers/net/ne2.c 1.10 -> 1.11 # drivers/block/scsi_ioctl.c 1.34 -> 1.35 # arch/ppc/mm/cachemap.c 1.9 -> 1.10 # drivers/usb/storage/freecom.c 1.27 -> 1.28 # net/ipv4/fib_frontend.c 1.13 -> 1.14 # include/asm-arm/arch-sa1100/vmalloc.h 1.2 -> 1.3 # drivers/acpi/Kconfig 1.20.1.1 -> 1.26 # arch/parisc/kernel/syscall.S 1.14 -> 1.15 # drivers/scsi/sym53c8xx_2/sym_glue.h 1.14 -> 1.15 # drivers/telephony/ixj.h 1.7 -> 1.8 # arch/arm/kernel/pm.c 1.6 -> 1.8 # drivers/ide/pci/amd74xx.c 1.20 -> 1.21 # include/asm-s390/cacheflush.h 1.2 -> 1.3 # drivers/scsi/qla1280.c 1.49 -> 1.50 # arch/parisc/kernel/parisc_ksyms.c 1.11 -> 1.12 # drivers/char/amiserial.c 1.27 -> 1.28 # net/ethernet/pe2.c 1.2 -> 1.3 # drivers/usb/misc/speedtch.c 1.98 -> 1.101 # fs/xfs/linux/xfs_vnode.h 1.18 -> 1.20 # fs/xfs/xfs_log.c 1.25.1.1 -> 1.27 # net/ipv4/ipvs/ip_vs_nq.c 1.2 -> 1.3 # arch/arm/mach-integrator/pci.c 1.8 -> 1.9 # fs/jfs/symlink.c 1.5 -> 1.6 # kernel/ptrace.c 1.31 -> 1.32 # arch/i386/kernel/i387.c 1.16 -> 1.17 # net/ipv6/netfilter/ip6t_ipv6header.c 1.5 -> 1.6 # include/asm-parisc/processor.h 1.12 -> 1.13 # fs/xfs/xfs_vnodeops.c 1.40 -> 1.45 # net/core/iovec.c 1.9 -> 1.10 # arch/parisc/kernel/traps.c 1.11 -> 1.12 # fs/block_dev.c 1.143 -> 1.144 # drivers/char/ip2main.c 1.41 -> 1.42 # net/ipv4/ipip.c 1.32 -> 1.33 # include/asm-sh/pgtable.h 1.18 -> 1.19 # fs/xfs/xfs_dir2.c 1.8 -> 1.9 # arch/parisc/kernel/module.c 1.7 -> 1.8 # fs/udf/inode.c 1.33 -> 1.35 # net/core/rtnetlink.c 1.17 -> 1.18 # drivers/video/stifb.c 1.18 -> 1.19 # drivers/scsi/sun3_scsi_vme.c 1.7 -> 1.8 # include/asm-cris/arch-v10/pgtable.h 1.1 -> 1.2 # fs/xfs/linux/xfs_sysctl.c 1.15 -> 1.16 # drivers/net/irda/actisys.c 1.8 -> 1.9 # net/sctp/socket.c 1.96 -> 1.99 # drivers/mca/mca-legacy.c 1.5 -> 1.6 # include/net/irda/irda_device.h 1.8 -> 1.10 # fs/xfs/xfs_log.h 1.6 -> 1.7 # include/asm-um/pgtable.h 1.11 -> 1.12 # include/asm-m68k/bitops.h 1.8 -> 1.9 # drivers/media/video/zr36120_i2c.c 1.2 -> 1.3 # (new) -> 1.1 arch/parisc/kernel/syscall_table.S # (new) -> 1.1 include/linux/netfilter_bridge/ebt_limit.h # (new) -> 1.1 lib/parser.c # (new) -> 1.1 drivers/usb/serial/keyspan_usa90msg.h # (new) -> 1.1 net/bridge/netfilter/ebt_limit.c # (new) -> 1.2 arch/i386/kernel/cpu/cpufreq/powernow-k8.c # (new) -> 1.1 arch/i386/kernel/cpu/cpufreq/powernow-k8.h # (new) -> 1.1 include/asm-arm/mach/flash.h # (new) -> 1.18 arch/arm/mach-integrator/integrator_ap.c # (new) -> 1.1 include/linux/parser.h # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/27 torvalds@home.osdl.org 1.1342.1.33 # Linux 2.6.0-test6 # -------------------------------------------- # 03/09/27 len.brown@intel.com 1.1342.1.34 # Merge intel.com:/home/lenb/bk/linux-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0 # -------------------------------------------- # 03/09/27 len.brown@intel.com 1.1342.8.1 # Merge intel.com:/home/lenb/bk/linux-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-release-2.6.0 # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.1 # o NET: move net/core/dev.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.2 # o NET: move net/core/sock.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.10.1 # [MCA] include linux/mca-legacy.h directly, to access deprecated MCA API # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.10.2 # [MCA] convert mca-proc to use not-deprecated functions # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.10.3 # [MCA] don't include linux/mca-legacy.h from linux/mca.h. # # As the functions and definitions in linux/mca-legacy.h are deprecated, # require that users explicitly include linux/mca-legacy.h as needed. # # Prior to this change, _all_ users of linux/mca.h (i.e. proper users) # issued a warning at compile time, when the MCA legacy API was enabled. # Now only actual users of the legacy API cause warnings, not all MCA drivers. # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.10.4 # [wireless arlan] fix modular build # # 'probe' module parameter is only used when arlan is built as a module. # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.10.5 # Misc warning fixes: # * block/cciss: eliminate "comparison always false" warning # * char/agp/amd64-agp: properly suffix 64-bit constants # * ide/legacy/pdc4030: fix incomplete conversion to new IDE module API # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.3 # o NET: move net/core/neighbour.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.11.1 # [janitor] Replace bcopy() uses with memcpy(), where possible. # # Affects: JFS, scsi/{sym,sym2}, arch/ia64/sn/io/sn2/{module,pic}.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.4 # o NET: move net/ipv4/tcp_ipv4.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.5 # o NET: move net/ipv4/af_inet.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 jgarzik@redhat.com 1.1342.10.6 # [BK] "bk ignore" aic7xxx auto-generated files # -------------------------------------------- # 03/09/28 davej@redhat.com 1.1342.5.4 # [CPUFREQ] powernow-k8 compile fix # -------------------------------------------- # 03/09/28 romieu@fr.zoreil.com 1.1342.12.1 # [PATCH] Fix debug statement after return in drivers/net/wireless/arlan-main.c # # This patch applies to 2.5.68 and is listed on kbugs.org. The debug statement # is never executed because it is after a return. # -------------------------------------------- # 03/09/28 shemminger@osdl.org 1.1342.12.2 # [PATCH] Fix warnings in hamradio/baycom build # # Sorry, overlooked the corresponding .h file in that patch, here it is. # -------------------------------------------- # 03/09/28 mzyngier@freesurf.fr 1.1342.12.3 # [PATCH] ne3210 update # # The enclosed patch ports the ne3210 driver over the EISA probing API. # # It also fixes some ioremap/isa_memcopy_fromio problems (depending on # where the card memory was mapped) by using ioremap unconditionally and # letting memcopy_fromio do the right thing. # # Finally, it removes the card from Space.c (warning, potential # interface renumbering !). # # The module options are currently disabled, until Rusty's # module_param_array() patch is included. I will re-introduce them ASAP. # # Quite heavily tested on x86. # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.6 # o NET: move net/ipv4/tcp.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.7 # o NET: move net/core/skbuff.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.8 # o NET: move net/socket.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.9 # o NET: move net/netlink/af_netlink.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.10 # o NET: move net/core/netfilter.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.11 # o NET: move net/ipv4/udp.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.12 # o NET: move net/ipv4/tcp_output.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.13 # o NET: move net/core/rtnetlink.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.14 # o NET: move net/sched/sch_generic.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.15 # o NET: move net/sched/police.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 torvalds@home.osdl.org 1.1342.10.7 # Merge bk://kernel.bkbits.net/jgarzik/misc-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/09/28 torvalds@home.osdl.org 1.1342.10.8 # Merge bk://kernel.bkbits.net/jgarzik/bcopy-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.16 # o NET: move net/ipv4/ip_sockglue.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.17 # o NET: move net/ipv4/devinet.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.18 # o NET: move net/core/ethtool.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.19 # o NET: move net/ipv4/tcp_minisocks.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.20 # o NET: move net/ipv4/tcp_input.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.21 # o NET: move net/ipv4/tcp_timer.c EXPORT_SYMBOLs from net/netsyms.c # # Also move the EXPORT_SYMBOL(tcp_statistics) to net/ipv4/tcp.c, so that # finally the tcp.h header can be removed from net/netsyms.c, ctags doesn't # catches the variables defined with DEFINE_SNMP_STAT :-\ # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.22 # o NET: move net/ipv4/ip_output.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.23 # o NET: move net/ipv4/arp.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.24 # o NET: move net/core/wireless.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.25 # o NET: move net/core/datagram.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.26 # o NET: move net/sched/sch_api.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.27 # o NET: move net/core/scm.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.28 # o NET: move net/core/iovec.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.29 # o NET: move net/core/utils.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.30 # o NET: move net/core/dst.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.31 # o NET: move net/core/dev_mcast.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.32 # o NET: move net/core/flow.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.33 # o NET: move net/core/filter.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.34 # o NET: move net/core/dv.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.35 # o NET: move net/core/link_watch.c EXPORT_SYMBOLs from net/netsyms.c # # Also fix a typo. # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.36 # o NET: move net/ipv4/route.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.37 # o NET: move net/ipv4/igmp.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.38 # o NET: move net/ipv4/icmp.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.39 # o NET: move net/ipv4/fib_frontend.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.40 # o NET: move net/ipv4/protocol.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.41 # o NET: move net/ipv4/ip_options.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.42 # o NET: move net/ipv4/tcp_output.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.43 # o NET: move net/ipv4/ip_fragment.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.44 # o NET: move net/ipv4/inetpeer.c EXPORT_SYMBOLs from net/netsyms.c # # And some leftovers from previous changesets also moved to net/core/dev.c # and net/sched/sch_api.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.45 # o NET: move net/ipv4/{ip_input,sysctl_net_ipv4}.c EXPORT_SYMBOLs from net/netsyms.c # # And also a leftover to net/ipv4/af_inet.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.46 # o NET: move net/802/*.c EXPORT_SYMBOLs from net/netsyms.c # # Also add #include to include/net/pkt_sched.h, as it uses # functions defined on this include (netif_queue_stopped, etc). Ah, the other # datalink stuff was moved as well (eth.c, pe2.c) # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.47 # o NET: move rest of net/sched/*.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.48 # o NET: move net/xfrm/xfrm_algo.c EXPORT_SYMBOL_GPLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.49 # o NET: move drivers/net/Space.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.50 # o NET: move drivers/net/loopback.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.51 # o NET: move fs/fcntl.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/28 acme@conectiva.com.br 1.1342.9.52 # o NET: move fs/file_table.c EXPORT_SYMBOLs from net/netsyms.c # -------------------------------------------- # 03/09/29 acme@conectiva.com.br 1.1342.9.53 # o NET: net/netsyms.c bites the dust # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.5.5 # [CPUFREQ] Fix ordering in kconfig. # -------------------------------------------- # 03/09/29 trini@org.rmk.(none) 1.1267.1.18 # [SERIAL] Make the Startech UART detection 'more correct' # -------------------------------------------- # 03/09/29 len.brown@intel.com 1.1267.30.9 # [ACPI] CONFIG_ACPI_RELAXED_AML from 2.4 # http://bugzilla.kernel.org/show_bug.cgi?id=1248 # -------------------------------------------- # 03/09/29 len.brown@intel.com 1.1342.1.35 # Merge intel.com:/home/lenb/bk/linux-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0 # -------------------------------------------- # 03/09/29 len.brown@intel.com 1.1342.8.2 # Merge intel.com:/home/lenb/bk/linux-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-release-2.6.0 # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.9 # [PATCH] affs sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.10 # [PATCH] befs sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.11 # [PATCH] ext3 sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.12 # [PATCH] fat sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.13 # [PATCH] freevxfs sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.14 # [PATCH] hfs sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.15 # [PATCH] hpfs sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.16 # [PATCH] jbd sparse fixes # -------------------------------------------- # 03/09/29 Andries.Brouwer@cwi.nl 1.1342.10.17 # [PATCH] jfs sparse fixes # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.18 # [PATCH] m68k zImage # # m68k: Build a zImage (vmlinux.gz) instead of an uncompressed image by default # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.19 # [PATCH] Q40/Q60 interrupts # # Q40/Q60: Must handle keyboard interrupts even before they are registered (from # Richard Zidlicky) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.20 # [PATCH] Sun-3 bootmem # # Sun-3: Use init_bootmem_node() instead of init_bootmem() for Sun-3, to avoid # setting min/max_low_pfn in init_bootmem(). This was screwing up SCSI, and the # new method is more like m68k/motorola. (from Sam Creasey) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.21 # [PATCH] Sun-3 SCSI # # Sun-3 SCSI updates (from Sam Creasey): # - Define sun3scsi_release() in sun3_scsi and sun3_scsi_vme so that the # drivers will actually be loaded by the SCSI subsystem. # - Remove some warnings. # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.22 # [PATCH] Q40/Q60 interrupts # # Q40/Q60: Fix warnings, add diagnostic message (from Richard Zidlicky) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.23 # [PATCH] M68k PCI # # M68k PCI: Include , like all other archs do # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.24 # [PATCH] M68k bitops # # M68k bitops: Make input parameters of *find*bit() routines const: # - find_first_zero_bit() # - find_next_zero_bit() # - sched_find_first_bit() # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.25 # [PATCH] Atari ST-RAM missing include # # Atari ST-RAM: Add missing include # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.26 # [PATCH] Mac SWIM floppy missing include # # Mac SWIM floppy: Add missing include # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.27 # [PATCH] Atari ACSI fix # # Atari ACSI: Add missing include and fix duplicate parameter type # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.28 # [PATCH] Macintosh 8390 Ethernet update # # Mac8390: Update for netdevice/8390 core changes in 2.5.8 # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.29 # [PATCH] Atari Hades support is broken # # Atari Hades support is broken (needs updates for the new PCI code) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.30 # [PATCH] Atari ST-RAM swap is broken # # Atari ST-RAM swap is broken (needs swap updates) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.31 # [PATCH] Macintosh SWIM IOP floppy is broken # # Macintosh SWIM IOP floppy is broken (needs bio updates) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.32 # [PATCH] Atari ACSI is broken # # Atari ACSI is broken (needs bio updates) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.33 # [PATCH] 53c7xx SCSI core is broken # # 53c7xx SCSI core is broken (needs SCSI updates (has_cmdblocks and device # lists)), breaking the following drivers: # - Amiga A4000T SCSI # - Amiga A4091 SCSI # - Amiga WarpEngine SCSI # - Amiga Blizzard PowerUP 603e+ SCSI # - MVME16x NCR53C710 SCSI # - BVME6000 NCR53C710 SCSI # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.34 # [PATCH] Amiga A2091 SCSI is broken # # Amiga A2091 SCSI is broken (needs SCSI device list updates and # a2091_bus_reset()) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.35 # [PATCH] Amiga GVP-II SCSI is broken # # Amiga GVP-II SCSI is broken (needs SCSI device list updates and # gvp11_bus_reset()) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.36 # [PATCH] Atari Bionet Ethernet is broken # # Atari Bionet Ethernet is broken (needs netif updates and broken ACSI) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.37 # [PATCH] Atari Pamsnet Ethernet is broken # # Atari Pamsnet Ethernet is broken (needs netif updates and broken ACSI) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.38 # [PATCH] MVME166/7 CD2401 serial is broken # # MVME166/7 CD2401 serial is broken (needs taskqueue updates) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.39 # [PATCH] Macintosh CS89x0 Ethernet is broken # # Macintosh CS89x0 Ethernet is broken (needs netif updates) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.40 # [PATCH] Atari frame buffer device is broken # # Atari frame buffer device is broken (needs update to new fbdev framework and # new iplan2p* drawing operations) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.41 # [PATCH] Amiga CyberVision 64 frame buffer device is broken # # Amiga CyberVision 64 frame buffer device is broken (needs update to new fbdev # framework) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.42 # [PATCH] Amiga Retina Z3 frame buffer device is broken # # Amiga Retina Z3 frame buffer device is broken (needs update to new fbdev # framework) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.43 # [PATCH] Amiga Cybervision 64/3D frame buffer device is broken # # Amiga Cybervision 64/3D frame buffer device is broken (needs update to new # fbdev framework) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.44 # [PATCH] Sun-3/3x frame buffer device is broken # # Sun-3/3x frame buffer device is broken (needs update to new fbdev and sbuslib # frameworks) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.45 # [PATCH] Atari NCR5380 SCSI is broken # # Atari NCR5380 SCSI is broken (needs old update_timeout() from scsi_obsolete) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.46 # [PATCH] Macintosh SMC 9194 Ethernet is broken # # Macintosh SMC 9194 Ethernet is broken (needs NuBus I/O abstractions) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.47 # [PATCH] Dmasound config # # Dmasound: Use select to get CONFIG_DMASOUND defined for all subdrivers (from # Christoph Hellwig). # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.48 # [PATCH] Amiga Zorro bus doc updates # # Amiga Zorro bus: Update the docs to match the current situation. # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.49 # [PATCH] Amiga A2091 SCSI fix # # A2091 SCSI: Fix compilation by getting rid of the obsolete SCSI host instance # loop and using per-card interrupt handlers instead. # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.50 # [PATCH] Amiga GVP-II SCSI fix # # GVP-II SCSI: Fix compilation by getting rid of the obsolete SCSI host instance # loop and using per-card interrupt handlers instead. # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.51 # [PATCH] Zorro include guards # # Zorro: Make closing include guards consistent with opening include guards # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.52 # [PATCH] Amiga A2232 Serial typo # # A2232 Serial: Fix typo # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.53 # [PATCH] M68k sched_clock() # # M68k: Add sched_clock() (introduced in 2.6.0-test6) # -------------------------------------------- # 03/09/29 geert@linux-m68k.org 1.1342.10.54 # [PATCH] Generic serial warning # # Generic serial: jiffies are unsigned long # -------------------------------------------- # 03/09/29 torvalds@home.osdl.org 1.1342.10.55 # Select the i8042 driver for mouse and keyboard only on PC's. # Other architectures have other low-level serial chips. # # Make "PC" configuration shorthand (same as "X86 && !EMBEDDED" # right now, but other PC-like architectures may start using it) # -------------------------------------------- # 03/09/29 sri@us.ibm.com 1.1217.15.5 # [SCTP] Convert tv_add from static inline to a macro to fix an obscure # assembler problem with parisc64. # -------------------------------------------- # 03/09/29 piggin@cyberone.com.au 1.1342.10.56 # [PATCH] remove bogus UP on SMP kernel error # # This removes a bogus error message in the bogomips reporting code when # running an SMP kernel on UP. It makes the output consistent with what # you see on an SMP box. I noticed this while testing, but it recently # annoyed me again when booting a knoppix CD - its the first line you'll # see. # -------------------------------------------- # 03/09/29 axboe@suse.de 1.1342.10.57 # [PATCH] kill CDROM_SEND_PACKET # # The CDROM_SEND_PACKET ioctl is both slow and ugly, this patch keeps the # functionality but utilizes the much better sg_io() framework. # -------------------------------------------- # 03/09/29 bunk@fs.tum.de 1.1342.10.58 # [PATCH] select for fs/Kconfig # # This switches fs/Kconfig to use select where appropriate (affects # nfs{,d} and afs). # -------------------------------------------- # 03/09/29 smurf@play.smurf.noris.de 1.1342.10.59 # [PATCH] minor edit typo # # Editor wraparound and comments don't always like each other. # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.60 # [PATCH] megaraid ULL fix. # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.61 # [PATCH] K7 MCE handler fixes. # # Don't poke bank 0 on Athlon, some of them don't like it # and raise spurious MCEs. # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.62 # [PATCH] Correct address in MAINTAINERS # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.63 # [PATCH] ULL fixes for qlogicfc # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.64 # [PATCH] Cleanup SEP errata workaround. # # This looks a little simpler, and has the same effect. # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.65 # [PATCH] fix leak in btaudio # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.66 # [PATCH] logic thinko in i2c # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.67 # [PATCH] Correct URL in h8300 README # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1342.10.68 # [PATCH] VIA Typo in i2c. # -------------------------------------------- # 03/09/29 davej@redhat.com 1.1267.73.1 # [AGPGART] New VIA AGP PCI id. # -------------------------------------------- # 03/09/29 armin@melware.de 1.1342.10.69 # [PATCH] Eicon ISDN driver: fix compile error # # fix compiler error of badly punctuated macro definitions. # -------------------------------------------- # 03/09/29 armin@melware.de 1.1342.10.70 # [PATCH] Eicon ISDN driver: cleanups # # Removed doubled header file includes. # Removed includes of version.h. # Removed the use of __KERNEL_SYSCALLS__ # -------------------------------------------- # 03/09/29 bgerst@didntduck.org 1.1342.10.71 # [PATCH] i386 do_machine_check() is redundant. # # This removes "do_machine_check()" in favour of just calling the # appropriate machine check handler directly from the lowlevel exception # code. # -------------------------------------------- # 03/09/29 sri@us.ibm.com 1.1342.13.1 # Merge us.ibm.com:/home/sridhar/BK/linux-2.6.0-test6 # into us.ibm.com:/home/sridhar/BK/lksctp-2.6.0-test6 # -------------------------------------------- # 03/09/29 lxiep@us.ibm.com 1.1347 # [PATCH] PCI Hotplug: export hotplug_slots subsys # # This is needed for the PPC64 PCI hotplug driver. # -------------------------------------------- # 03/09/29 greg@kroah.com 1.1348 # Merge kroah.com:/home/greg/linux/BK/bleed-2.5 # into kroah.com:/home/greg/linux/BK/pci-2.6 # -------------------------------------------- # 03/09/29 davej@wopr.codemonkey.org.uk 1.1342.10.72 # Merge wopr.codemonkey.org.uk:/home/davej/src/bk-linus # into wopr.codemonkey.org.uk:/home/davej/src/cpufreq # -------------------------------------------- # 03/09/29 davej@wopr.codemonkey.org.uk 1.1342.14.1 # Merge wopr.codemonkey.org.uk:/home/davej/src/bk-linus # into wopr.codemonkey.org.uk:/home/davej/src/agpgart # -------------------------------------------- # 03/09/29 adobriyan@mail.ru 1.1349 # [PATCH] PCI: Remove setting TASK_RUNNING after schedule_timeout in /drivers/pci/ # -------------------------------------------- # 03/09/29 sandeen@sgi.com 1.1305.5.3 # [XFS] Fix large filesystem mounts on 64-bit platforms (2.6.x change only) # # SGI Modid: 2.5.x-xfs:slinx:159170a # -------------------------------------------- # 03/09/29 sandeen@sgi.com 1.1305.5.4 # [XFS] Fix arg sent to XFS_SEND_DATA - vnode, not bhv # # SGI Modid: 2.5.x-xfs:slinx:159068a # -------------------------------------------- # 03/09/29 lord@jen.americas.sgi.com 1.1305.5.5 # [XFS] Re-work pagebuf & xfs stats to use per-cpu variables - # big globals that are written all the time # # SGI Modid: 2.5.x-xfs:slinx:159069a # -------------------------------------------- # 03/09/29 sandeen@sgi.com 1.1305.5.6 # [XFS] Re-work pagebuf stats macros to help support per-cpu data # # SGI Modid: 2.5.x-xfs:slinx:158653a # -------------------------------------------- # 03/09/29 lord@sgi.com 1.1305.5.7 # [XFS] Close some holes in the metadata flush logic used during unmount, # make sure we have no pending I/O completion calls for metadata, # and that we only keep hold of metadata buffers for I/O completion # if we want to. Still not perfect, but better than it was. # # SGI Modid: 2.5.x-xfs:slinx:158933a # -------------------------------------------- # 03/09/29 rmk@flint.arm.linux.org.uk 1.1267.1.19 # [SERIAL] Change maintainer entry for serial. # # Finally admit defeat and change the maintainers entry for 8250/16x50 # serial. # -------------------------------------------- # 03/09/29 torvalds@home.osdl.org 1.1342.15.1 # Merge bk://bk.arm.linux.org.uk/linux-2.6-serial # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/09/29 B.Zolnierkiewicz@elka.pw.edu.pl 1.1342.15.2 # [PATCH] fix /proc/ide/hdX/settings # # Blind strncpy()->strlcpy() conversion in 2.5.70 # made it impossible to change any setting, revert it. # -------------------------------------------- # 03/09/29 B.Zolnierkiewicz@elka.pw.edu.pl 1.1342.15.3 # [PATCH] update ali14xx driver # # - common ali14xx_init() for built-in and module # - do not call findPort() twice # - touch hwifs only if chipset was found and initialized # - release hwif only if hwif->chipset == ide_ali14xx # - when releasing hwif, restore hwif->channel to the default value # - mark exit functions with __exit # - do not use ide_hwifs[] directly # - minor cleanups # -------------------------------------------- # 03/09/29 B.Zolnierkiewicz@elka.pw.edu.pl 1.1342.15.4 # [PATCH] update dtc2278 driver # # - common dtc2278_init() for built-in and module # - touch hwifs only if hwif->chipset == ide_unknown for both ports, # so we don't thrash already used hwifs when loading module # - release hwif only if hwif->chipset == ide_dtc2278 # - mark exit functions with __exit # - do not use ide_hwifs[] directly # - minor cleanups # -------------------------------------------- # 03/09/29 B.Zolnierkiewicz@elka.pw.edu.pl 1.1342.15.5 # [PATCH] update ht6560b driver # # - common ht6560b_init() for built-in and module # - release hwif only if hwif->chipset == ide_ht6560b # - when releasing hwif, restore hwif->channel to the default value # - mark exit functions with __exit # - do not use ide_hwifs[] directly # - minor cleanups # -------------------------------------------- # 03/09/29 B.Zolnierkiewicz@elka.pw.edu.pl 1.1342.15.6 # [PATCH] update qd65xx driver # # - common qd65xx_init() for built-in and module # - release hwif only if hwif->chipset == ide_qd65xx # - mark exit functions with __exit # - do not use ide_hwifs[] directly # - minor cleanups # -------------------------------------------- # 03/09/29 B.Zolnierkiewicz@elka.pw.edu.pl 1.1342.15.7 # [PATCH] update umc8672 driver # # - common umc8672_init() for built-in and module # - release hwif only if hwif->chipset == ide_umc8672 # - mark exit functions with __exit # - do not use ide_hwifs[] directly # - minor cleanups # -------------------------------------------- # 03/09/29 acme@conectiva.com.br 1.1342.16.1 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/namei.c # -------------------------------------------- # 03/09/29 acme@conectiva.com.br 1.1342.16.2 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/buffer.c # -------------------------------------------- # 03/09/29 acme@conectiva.com.br 1.1342.16.3 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/dcache.c # -------------------------------------------- # 03/09/29 acme@conectiva.com.br 1.1342.16.4 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to kernel/sched.c # -------------------------------------------- # 03/09/29 acme@conectiva.com.br 1.1342.16.5 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/libfs.c # -------------------------------------------- # 03/09/29 torvalds@home.osdl.org 1.1342.15.8 # Merge bk://kernel.bkbits.net/acme/ksyms-2.6 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/09/29 len.brown@intel.com 1.1267.30.10 # [ACPI] ACPI Component Architecture 20030918 (Bob Moore) # # Found and fixed a longstanding problem with the late execution of # the various deferred AML opcodes (such as Operation Regions, # Buffer Fields, Buffers, and Packages)... # This fixes the "region size computed incorrectly" problem. # # Fixed several 64-bit issues with prototypes, casting and data types. # # Removed duplicate prototype from acdisasm.h # -------------------------------------------- # 03/09/29 len.brown@intel.com 1.1342.1.36 # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0 # -------------------------------------------- # 03/09/30 davej@redhat.com 1.1342.10.73 # [CPUFREQ] Longhaul >v1 can't use EBLCR for FSB, has to calculate it instead. # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1267.30.11 # [ACPI] CONFIG_ACPI is no longer necessary to enable HT (from 2.4.23) # if (CONFIG_ACPI || CONFIG_SMP) CONFIG_ACPI_BOOT=y # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1267.30.12 # [ACPI] add CONFIG_ACPI_RELAXED_AML to config menu # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1267.30.13 # [ACPI] acpi_pci_link_allocate() should stick with irq.active if set. (Andrew de Quincey) # Fixes OSDL #1186 "broken USB" and others # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1267.30.14 # [ACPI] GV3 IO port is 16-bits (Venkatesh Pallipadi) # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1342.1.37 # Merge intel.com:/home/lenb/src/linux-acpi-test-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0 # -------------------------------------------- # 03/09/30 zaitcev@redhat.com 1.1342.15.9 # [SPARC]: jsflash update # # Parts of this come from a janitor named Domen, unfortunately, # I forgot his e-mail... Anyhow, it's obvious that janitors # did not try to compile result of their efforts, this version # at least builds. # -------------------------------------------- # 03/09/30 urban.widmark@enlight.net 1.1342.15.10 # [SMBFS]: Create OLD_TO_NEW_foo macros in highuid.h and use # them instead of direct references to low2highfoo. # -------------------------------------------- # 03/09/30 ja@ssi.bg 1.1342.17.1 # [KERNEL]: Introduce list_for_each_entry_continue. # -------------------------------------------- # 03/09/30 ja@ssi.bg 1.1342.17.2 # [IPVS]: Simplify ip_vs_wrr_gcd_weight # -------------------------------------------- # 03/09/30 ja@ssi.bg 1.1342.17.3 # [IPVS]: The NQ scheduler must not return servers with weight 0. # -------------------------------------------- # 03/09/30 ja@ssi.bg 1.1342.17.4 # [IPVS]: Use list_for_each_entry_continue in some schedulers. # -------------------------------------------- # 03/09/30 bdschuym@pandora.be 1.1342.17.5 # [EBTABLES]: Add ebt_limit match. # # The patch below adds the ebt_limit match, which is the equivalent of # the iptables limit match. This enables limiting the number of frames # processed per time unit. # # The patch is from Tom Marshall . # -------------------------------------------- # 03/09/30 davem@nuts.ninka.net 1.1342.17.6 # [KERNEL]: Do not export set_cpus_allowed twice, and only if CONFIG_SMP. # -------------------------------------------- # 03/09/30 davem@nuts.ninka.net 1.1342.17.7 # [IPV4]: Do pskb_may_pull in arp_rcv() not arp_process(). # -------------------------------------------- # 03/09/30 davem@nuts.ninka.net 1.1342.17.8 # [IPV4]: In arp_rcv(), inspect skb->nh.arph after pskb_may_pull() not before. # -------------------------------------------- # 03/09/30 herbert@gondor.apana.org.au 1.1342.17.9 # [IPIP]: Avoid duplicate policy checks. # -------------------------------------------- # 03/09/30 bdschuym@pandora.be 1.1342.17.10 # [EBTABLES]: Use vlan_hdr not vlan_ethhdr in ebt_vlan.c # -------------------------------------------- # 03/09/30 davem@nuts.ninka.net 1.1342.15.11 # [SPARC64]: Always use sethi+jmpl to reach VISenter{,half}. # -------------------------------------------- # 03/09/30 davem@nuts.ninka.net 1.1342.9.54 # Merge bk://kernel.bkbits.net/acme/netsyms-2.6 # into nuts.ninka.net:/disk1/davem/BK/net-2.5 # -------------------------------------------- # 03/09/30 dfages@arkoon.net 1.1342.9.55 # [NET]: Fix HW_FLOWCONTROL on SMP. # -------------------------------------------- # 03/09/30 lord@kernel.bkbits.net 1.1342.18.1 # Merge kernel.bkbits.net:/home/repos/linux-2.5 # into kernel.bkbits.net:/home/lord/xfs-2.6 # -------------------------------------------- # 03/09/30 lord@sgi.com 1.1305.5.8 # [XFS] When calculating the number of pages to probe for an unwritten extent, # use the size of the extent, not the page count of the pagebuf which is # initialized to zero. # # SGI Modid: 2.5.x-xfs:slinx:159206a # -------------------------------------------- # 03/09/30 lord@jen.americas.sgi.com 1.1342.18.2 # Merge ssh://lord@kernel.bkbits.net/xfs-2.6 # into jen.americas.sgi.com:/src/lord/bitkeeper/xfs-2.6 # -------------------------------------------- # 03/09/30 torvalds@home.osdl.org 1.1342.9.56 # Merge bk://kernel.bkbits.net/davem/sparc-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1342.1.38 # [ACPI] acpi4asus-0.24a-0.25-2.6.0-test (Karol Kozimor) # -------------------------------------------- # 03/09/30 greg@kroah.com 1.1342.9.57 # Merge kroah.com:/home/linux/BK/bleed-2.5 # into kroah.com:/home/linux/BK/gregkh-2.6 # -------------------------------------------- # 03/09/30 greg@kroah.com 1.1350 # Merge kroah.com:/home/linux/BK/bleed-2.5 # into kroah.com:/home/linux/BK/pci-2.5 # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1342.1.39 # [ACPI] acpi4asus-0.25-0.26.diff (Karol Kozimor) # -------------------------------------------- # 03/09/30 stern@rowland.harvard.edu 1.1342.9.58 # [PATCH] USB: unusual_devs.h update # -------------------------------------------- # 03/09/30 mdharm-usb@one-eyed-alien.net 1.1342.9.59 # [PATCH] USB: fix freecom.c # # This patch for 2.6 fixes freecom.c -- an error in return-code # interpretation was introduced somewhere during 2.5. # # This also adds a few more checks to try to catch commands that appear to # want to move data, but of length 0. This is likely a bug in some higher # layer -- I'll bring it up on linux-scsi. # -------------------------------------------- # 03/09/30 wim@iguana.be 1.1342.9.60 # [PATCH] USB: problem with uhci-hcd in versions 2.6.0-test5 and 2.6.0-test6 # # I saw that you also reported problems with USB/uhci-hcd on your systems. Can you test # the following patch and see if it works now? # -------------------------------------------- # 03/09/30 joe@perches.com 1.1342.9.61 # [PATCH] USB: include/linux/usb.h # # Reduce constant string space by reusing __FILE__ # -------------------------------------------- # 03/09/30 rtjohnso@eecs.berkeley.edu 1.1351 # [PATCH] PCI: __init documetation # # It might not have prevented me from reporting the potential bug, but I # would've known you'd thought about it, it might help future developers, # and it's unlikely to become dangerously wrong. # -------------------------------------------- # 03/09/30 baldrick@free.fr 1.1342.9.62 # [PATCH] USB speedtouch: extra debug messages # -------------------------------------------- # 03/09/30 baldrick@free.fr 1.1342.9.63 # [PATCH] USB speedtouch: reduce memory usage # # Currently, incoming packets are reassembled in a sk_buff which is then # sent to the upper layers. The sk_buff needs to be big enough to hold the # worst case packet since the size cannot be known in advance. This would # not be so bad if the ATM layer paid attention to the mtu (usually 1500 bytes), # but for some reason it blithely ignores it and typically passes 9188 bytes # as the maximum size. This means that at best 5/6 of the space in every # sk_buff is wasted. So instead let's just allocate an assembly buffer (sarb) # which gets reused for every packet, and copy each assembled packet into # a minimally sized sk_buff before sending. # -------------------------------------------- # 03/09/30 baldrick@free.fr 1.1342.9.64 # [PATCH] USB speedtouch: neater check # # This change was applied to 2.4, but not to 2.5. # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1342.1.40 # [ACPI] build fix: remove 2nd __exit from asus_acpi.c # -------------------------------------------- # 03/09/30 len.brown@intel.com 1.1342.1.41 # [ACPI] deal with lack of acpi prt entries gracefully (Jesse Barnes) # -------------------------------------------- # 03/10/01 len.brown@intel.com 1.1342.1.42 # Merge intel.com:/home/lenb/bk/linux-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0 # -------------------------------------------- # 03/10/01 len.brown@intel.com 1.1342.8.3 # Merge intel.com:/home/lenb/bk/linux-2.6.0 # into intel.com:/home/lenb/bk/linux-acpi-release-2.6.0 # -------------------------------------------- # 03/10/01 len.brown@intel.com 1.1342.1.43 # Merge # -------------------------------------------- # 03/09/30 willy@debian.org 1.1352 # [PATCH] Remove ELF_CORE_SYNC # # ELF_CORE_SYNC and dump_smp_unlazy_fpu seem to have been introduced # by Ingo around 2.5.43, but as far as I can tell, never used. # -------------------------------------------- # 03/09/30 willy@debian.org 1.1353 # [PATCH] PA-RISC updates # # PA-RISC updates for 2.6.0-test6 # - Some more support for 64-bit userspace # - Move many EXPORT_SYMBOLs out of parisc_ksyms.c # - Make both the OSS and ALSA harmony drivers build # - ioctl typechecking # - Make math-emu build without warnings. # - Persuade SuckyIO to not crash the machine. # -------------------------------------------- # 03/09/30 akpm@osdl.org 1.1354 # [NET]: Fix xfrm_algo.c module exports. # -------------------------------------------- # 03/09/30 drepper@redhat.com 1.1355 # [NET]: Use task->tgid instead of task->pid in SCM credentials code. # -------------------------------------------- # 03/09/30 petri.koistinen@iki.fi 1.1356 # [NET]: Modernize network device help text. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1357 # [IRDA]: Get rid of destructor for irda devices. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1358 # [IRDA]: Add alloc_irdadev() interface. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1359 # [IRDA]: Convert irport to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1360 # [IRDA]: Convert ali-ircc to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1361 # [IRDA]: Convert donauboe to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1362 # [IRDA]: Convert nsc-ircc to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1363 # [IRDA]: Convert w83977af_ir to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1364 # [IRDA]: Convert sir to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1365 # [IRDA]: Convert via-ircc to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1366 # [IRDA]: Use unregister_netdev instead of explicit reference to rtnl_lock. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1367 # [IRDA]: Use register_netdev instead of explicit reference to rtnl_lock. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1368 # [IRDA]: In smsc-ircc2 use request_region instead of check_region. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1369 # [IRDA]: In smsc-ircc2 use request_region earlier in the setup process. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1370 # [IRDA]: In smsc-ircc2, fix whitespace and indentation. # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1371 # [IRDA]: Convert smsc-ircc2 to alloc_irdadev(). # -------------------------------------------- # 03/10/01 shemminger@osdl.org 1.1372 # [IRDA]: Convert irda-usb to alloc_irdadev(). # -------------------------------------------- # 03/10/01 axboe@suse.de 1.1353.1.1 # [PATCH] make ide-floppy work # # ide-floppy has screwy bio handling. I rewrote it and got confirmation # from one tester (the only one :) that it actually works now. # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1373 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1374 # Merge http://linux-acpi.bkbits.net/linux-acpi-release-2.6.0 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1375 # Merge bk://linux-dj.bkbits.net/agpgart # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1376 # Merge bk://linux-dj.bkbits.net/cpufreq # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/01 viro@parcelfarce.linux.theplanet.co.uk 1.1377 # [PATCH] EFS set_blocksize() error handling # # There doesn't seem to be any active maintainer for EFS: It's either # abandoned, or never required specific patches too badly (also quite # possible in this case). # # It went into the tree in 2.3.2 and from there to 2.6.0-test6 I see # nothing that would look like maintainer's update. OTOH, it's read-only # and shouldn't be too badly broken (or hard to keep alive). # # Outside of trunk (i.e. in 2.4.16--) we have a backport of global 2.5 # change (sb_bread()) and check for set_blocksize() failures (from Alan). # This is the 2.6.x equivalent. # -------------------------------------------- # 03/10/01 piggin@cyberone.com.au 1.1378 # [PATCH] AS fix # # This picks up another place where aliases where getting lost. And adds # a couple of checks. I can't hang the osdl database thingy anymore. # # The transfer alias list loops could probably quite nicely be changed to # # if (unlikely(!list_empty( old_queuelist ))) # __list_splice( old_queuelist, new_queuelist.prev); # -------------------------------------------- # 03/10/01 riel@surriel.com 1.1379 # [PATCH] syscall number for vserver # # Vserver is a patch that implements BSD jail style virtual host semantics # inside Linux, where every process not only runs in its own namespace (it # reuses the chroot code for that, should switch to CLONE_NEWNS for 2.6), # but also its own hostname and IP address as well as its own view of # /proc. # # Because of that added functionality, it needs more than what is # available in the LSM framework (which can only allow/deny permissions, # not alter return values). # # The source code has been running stable for the last few years and is in # use at quite a few service providers. The Fedora project also wants to # use vserver for their build system. However, vserver for 2.4 just tacks # their syscalls onto the end of the syscall table and the userland tools # find those "dynamic numbers" somehow ... EWWWW. # # For 2.6 I'd like to do things right. At the moment the vserver patch # has sys_new_s_context and sys_set_ipv4root calls, but since we'll # probably end up getting an ipv6 call too and people are planning future # functionality, I guess it would be more appropriate to multiplex these # through one sys_vserver patch, in the same way sys_ipc works. # # For your reference, you can find more information about # vserver on these pages: # # http://www.13thfloor.at/VServer/ # http://www.solucorp.qc.ca/miscprj/s_context.hc # # I estimate the project has about a dozen developers now. We are # planning on making the implementation for 2.6 fairly lightweight, # reusing infrastructure from other code where possible and only doing # things through sys_vserver where there is no other way. # # This small change just adds sys_vserver to the syscall table. # -------------------------------------------- # 03/10/01 joern@wohnheim.fh-wedel.de 1.1380 # [PATCH] Fix wrong CONFIG_* in comment # # Our tools are somewhat too stupid. They find a mistyped CONFIG_HIGMEM # (missing 'H') and assume a dependency on config/higmem.h. Fix the comment. # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.2 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to mm/filemap.c # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.3 # o kernel/ksyms.c: set_cpus_schedule was EXPORT_SYMBOL_GPL, bring it back # # Originally, before this set of patches moving stuff out from kernel/ksyms.c, # set_cpus_schedule was EXPORT_SYMBOL_GPL, my mistake, bring it back. # # Also follow Andrew Morton's suggestions of moving the EXPORT_SYMBOL{_GPL) even # closer to the place where the symbol exported is defined, i.e. just after the # symbol definition, this makes mistakes more difficult to happen, as when the # symbol definition is #ifdefed the EXPORT_SYMBOL{_GPL} is in the same block. # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1381 # Merge bk://kernel.bkbits.net/acme/ksyms-2.6 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1382 # Fix bogus preprocessor end comment to match the real scope. # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.4 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/block_dev.c # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.5 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/super.c # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.6 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to kernel/sysctl.c # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.7 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/inode.c # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.8 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/exec.c # -------------------------------------------- # 03/10/01 acme@parisc.kerneljanitors.org 1.1353.1.9 # o kernel/ksyms.c: move relevant EXPORT_SYMBOLs to fs/seq_file.c # -------------------------------------------- # 03/10/01 torvalds@home.osdl.org 1.1383 # Merge bk://kernel.bkbits.net/acme/ksyms-2.6 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/01 svm@kozmix.org 1.1384 # [PATCH] fix btaudio error case # # Free the right buffer on allocation error # -------------------------------------------- # 03/10/01 bfennema@falcon.csc.calpoly.edu 1.1385 # [PATCH] UDF oops on inode read failure # # This fixes an oops with failed inode reads on UDF # -------------------------------------------- # 03/10/01 Jay.Estabrook@hp.com 1.1386 # [PATCH] for Alpha against 2.6.0-test6 # # Here is a very small set of fixes for Linux/axp, with a new one for # "sched_clock" just introduced. # # Note that all but the arch/alpha/mm/init.c are required for a clean # build, since warnings->errors is still on. # # The arch/alpha/mm/init.c stuff is from Jeff for MARVEL, and MUST be there # for any machines running the latest firmware... # -------------------------------------------- # 03/10/01 ink@jurassic.park.msu.ru 1.1387 # [PATCH] Alpha cypress CPU frequency calibration # # This fixes (again...) CPU frequency calibration on some platforms with # the Cypress chip. That is, at some point CLOCK_TICK_RATE has been # changed to represent RTC reference clock instead of PIC one. Which # makes calibrate_cc_with_pic() produce utterly bogus results. # -------------------------------------------- # 03/10/01 jes@wildopensource.com 1.1388 # [PATCH] qla1280 locking update # # This fixes the qla1280 driver to not try to release an unlocked spinlock # at boot time - as well as a couple of other minor mods. # # I also changed the MMIO option to be dependant on X86_VISWS as it's # really a chipset problem and not something each and every driver should # be asking for. # # Getting a global CONFIG_MMIO_IS_BROKEN option would probable be a win # here. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1389 # [PATCH] dscc4 warning fixes # # - ifdef out a couple of unused functions # # - remove unused label # # - __setup function is not used when compiled as a module. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1390 # [PATCH] Fix memory leak in hugetlbfs # # From: "Chen, Kenneth W" # # The hugetlbfs_fill_super() doesn't free up memory allocated for sbinfo on # the way out in case of parsing error (and a few others). This leads to # memory leak If root tries to mount a hugetlbfs with invalid mount option. # Here is a patch that fix the problem. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1391 # [PATCH] Fix double request_region in com20020 # # From: Herbert Xu # # Currently com20020 and com20020_cs both call request_region on the same # block of ports leading to a conflict. This patch resolves this by moving # request_region out of the generic driver and into the isa/pci/cs drivers. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1392 # [PATCH] Add bin2c copyrights # # From: Oliver Xymoron # # I just noticed the ikconfig stuff made it into mainline via -mm. I # also just noticed that it's based in part on a patch I posted almost 5 # years ago: # # http://groups.google.com/groups?q=oliver+xymoron+config.gz&hl=en&lr=&ie=UTF-8&selm=fa.j8fsl5v.g08fjo%40ifi.uio.no&rnum=2 # # Sadly, after wandering aimlessly in the desert of unloved patches all # those years, all attribution got lost. This adds a copyright + license # to scripts/bin2c.c, which hasn't aged a day. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1393 # [PATCH] Add missing label in isdn_common.c # # From: Herbert Xu # # The last change to isdn_common.c removed a label that is used when # ISDN_PPP is defined. This patch puts it back. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1394 # [PATCH] dev_t forward compatibility fix # # From: Andries.Brouwer@cwi.nl # # ext2 used a 32-bit field for dev_t, with possibly undefined storage # following; thus, no action was required to go to 32-bit dev_t, but going to # 64-bit dev_t required some subtlety: 0 was written in the first word and # the 64 bits in the following two. Al truncated my 64-bit stuff to 32 bits # but did not understand why there was this split, and wrote 0 followed by a # single word. We should at least zero the word following to have # well-defined storage later. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1395 # [PATCH] x86 mman.h fix # # Remove duplicated #defines # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1396 # [PATCH] memory writeback/invalidation fixes # # From: "David S. Miller" # # This attempts to take care of 2 of the MM todos I had on # my backlog: # # 1) Zap the stupid flush_cache_all() thing with more meaningful # interfaces. # # 2) Resolve the ptrace user page access issues, first stage. # # The "first stage" mentioned for #2 is simply creating the # user page accesor interfaces. The next stage needs to be # mucking with get_user_pages() so that we can control when # the flush_dcache_page() occurs. Then we: # # 1) For every platform where flush_dcache_page() is a non-nop # add a call to the beginning of copy_{from,to}_user_page(). # 2) Make access_process_vm() set the "no dcache flush" bit in # it's call to get_user_pages(). # # The idea also was that we'd consolidate the write etc. boolean # args passed to get_user_pages() into flag bits too. # # But at least with the below, we can delete that reminder FIXME # comment from kernel/ptrace.c, the platforms have the necessary # tools and just need to make use of it :) # # As a bonus I noticed that VMALLOC_VMADDR() did absolutely nothing. # # After all of this I only have 1 real TODO left, and that's dealing # with the SMP TLB/pte invalidation stuff, very low priority until # someone starts doing more work with sparc32/SMP in 2.6.x :) # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1397 # [PATCH] table-driven filesystems option parsing # # From: "Randy.Dunlap" , Will Dyson , me # # Add generic filesystem options parser (infrastructure) and use it to parse # mount options in several filesystems (adfs, affs, autofs, autofs4, ext2, # ext3, fat, hfs, hpfs, isofs, jfs, procfs, udf, and ufs). # # It saves between 128 and 512 bytes per filesystem. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1398 # [PATCH] module parameter array fixes # # From: Rusty Russell # # Found this while converting netfilter modules to use the new # parameters. Also fixes an out-by-one error in maximum elements you # can put in array. # # The current "intarray" module params were never tested, and um, suck. # Only one person uses them, and it looks painful. # # Since noone uses them, replace them with tested versions. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1399 # [PATCH] check permission in ->open for /proc/sys/ # # From: Christoph Hellwig # # It's the only abuse of proc_iops left (except the totally b0rked comx # driver). The patch is from Al, I just forward-ported it from 2.4. # # Background: struct proc_dir_entry has a struct inode_operations *proc_iops # member, it's from Linux's stoneage and used internally by procfs to assign # either the link or directory inode ops. # # Unfortunately some drivers started to abuse it do do bad things like create # on lookup (that's the comx thingy which relies on unexported symbols and thus # is broken for modular builds since mid-2.3) or various ->permission tricks # (all gone by now). # # After this patch is gone I have another one that kills proc_iops and just # uses a normal conditional inside procfs to assign the right one directly. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1400 # [PATCH] fix memleak in mtd/chips/cfi_cmdset_0020.c # # From: Felipe W Damasio # # If other kmallocs failed after successfully allocating a "struct mtd_info", # it should be freed before returning NULL. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1401 # [PATCH] Fix bug in SELinux convert_context # # From: Stephen Smalley # # This patch fixes a bug introduced by earlier code cleanups in the SELinux # convert_context code that manifests upon a policy reload that removes # previously valid security attributes. Thanks to Magosanyi Arpad for # reporting the bug. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1402 # [PATCH] Pass nameidata to security_inode_permission hook # # From: Stephen Smalley # # This patch changes the security_inode_permission hook to also take a # nameidata parameter in addition to the existing inode and mask parameters. # # A nameidata is already passed (although sometimes NULL) to # fs/namei.c:permission(), and the patch changes exec_permission_lite() to # also take a nameidata parameter so that it can pass it along to the # security hook. # # The patch includes corresponding changes to the SELinux module to use the # nameidata information when it is available; this allows SELinux to include # pathname information in audit messages when a nameidata structure was # supplied. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1403 # [PATCH] scripts/pnmtologo.c warning fixes # # From: Rolf Eike Beer # # this patch makes some ints to unsigned ints. They are only used as loop # counters and compared to unsigned ints. GCC 3.3 doesn't like this. They # will never be negative anyway, so we could easily shut him up. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1404 # [PATCH] befs: fix resource leak on register_filesystem failure # # From: Will Dyson # # Remember to free the inode cache if register_filesystem() fails. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1405 # [PATCH] misc fixes # # - mpparse printk should be in hex (john stultz ) # # - fiddle with RCU copyright messages (Dipankar Sarma ) # # - use print_dev_t() for sysfs dev file in videodev.c (Gerd Knorr # ) # # - comx-hw-munich.c 64-bit warning fix (Vinay K Nallamothu # ) # # - random.c return val fix # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1406 # [PATCH] /proc/PID/auxv file and NT_AUXV core note # # From: Roland McGrath # # gdb really needs some way to know the AT_SYSINFO_EHDR value for a process # being debugged or for the dead process described by a core file. Without # this value, it can't find the information necessary to show backtraces of # threads waiting in system calls. There are any number of ways this # information could be made available. Here is one solution that provides # more debugging information in a clean and general fashion. # # I've added access to the AT_* values passed to a process for third parties # to examine for debugging purposes. The same data passed on the stack at # startup is made available in /proc/PID/auxv and is written in an NT_AUXV # note in core dumps. (Both of these are consistent with what Solaris does # using the same names.) # # Here are two different patches that implement the same thing differently. # The first patch uses a ref-counted data structure to copy the aux vector # and shares among forked mm's until they exec and get a new one. The second # patch avoids the complexity of that data structure by simply expanding the # mm_struct with space to hold a copy of the data. Both patches work # correctly; I have examined the new /proc/PID/auxv file and core dumps. # # I hope you will consider including one of these patches, or at least some # way of getting at this information from the debugger. I am certainly open # to other suggestions on implementing this feature, and to suggestions on # alternative interfaces for getting the AT_SYSINFO_EHDR value cleanly. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1407 # [PATCH] update Documentation/iostats.txt # # From: Rick Lindsley # # One typo corrected, and the references to 2.5 are minimized and mostly # changed to 2.6. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1408 # [PATCH] Fix compile warning in g_NCR5380 # # From: Andries.Brouwer@cwi.nl # # `generic_NCR5380_biosparam' declared `static' but never defined # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1409 # [PATCH] Fix allyesconfig for HugeTLB-less archs # # From: Geert Uytterhoeven # # Make that allyesconfig works on architectures that don't support HugeTLBs. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1410 # [PATCH] ioctl32 fix to SG_IO # # From: Arun Sharma # # A minor bug fix to the ioctl32 code handling SG_IO. sgio->dxferp is not # initialzed properly. # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1411 # [PATCH] Update James Morris's email address # # From: James Morris # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1412 # [PATCH] update unistd.h for sys_vserver # -------------------------------------------- # 03/10/02 akpm@osdl.org 1.1413 # [PATCH] Disable floppy and the related ioctl32s on some platforms # # From: Arun Sharma # # Based on some earlier discussion: # # http://marc.theaimsgroup.com/?t=106015010700002&r=1&w=2 # # here's a new patch that attempts to disable BLK_DEV_FD on platforms which # don't support it. The patch also attempts to remove the duplication of the # logic in compat_ioctl.h. # -------------------------------------------- # 03/10/02 viro@parcelfarce.linux.theplanet.co.uk 1.1414 # [PATCH] Better UDF oops fix # # Rather than not kfree'ing the UDF data in the case of a bad inode (which # still _may_ have had the UDF data already allocated to it), make sure to # initialize the pointer to NULL properly when we're done with it. # -------------------------------------------- # 03/10/02 arun.sharma@intel.com 1.1387.1.1 # [COMPAT]: Fix net bonding driver ioctl translations. # -------------------------------------------- # 03/10/02 davem@kernel.bkbits.net 1.1415 # Merge davem@nuts.ninka.net:/disk1/davem/BK/net-2.5 # into kernel.bkbits.net:/home/davem/net-2.5 # -------------------------------------------- # 03/10/02 piggin@cyberone.com.au 1.1416 # [PATCH] AS buglet # # This one won't cause hangs, but can trip some WARNs. # -------------------------------------------- # 03/10/02 viro@parcelfarce.linux.theplanet.co.uk 1.1417 # [PATCH] Improve sget() performance # # sget() is pessimistic and assumes it won't find a superblock - and as a # result it always pre-allocates a new one before even searching for an # existing entry. If it finds an existing one, it free's the extra one it # just allocated. # # Especially with /proc usage it usually _does_ find an existing # superblock, so this is all extra work. It should allocate a new one # only if it couldn't find an old one (and re-search). # # The same way as iget() does it. # -------------------------------------------- # 03/10/02 piggin@cyberone.com.au 1.1418 # [PATCH] remove io context refcounting debug # # This removes the remains of some debugging stuff which was never really # enabled properly - it never reported memory leaks. Its not useful for # anyone but me. # # A proper solution involves counting all requests in flight and all # threads but we'll probably put that just into mm. # -------------------------------------------- # 03/10/02 sri@us.ibm.com 1.1342.13.2 # [SCTP] Fix bugs in conversions between msecs and jiffies. # -------------------------------------------- # 03/10/02 sam@mars.ravnborg.org 1.1342.7.3 # kbuild: fixes for separate output directory # # - Error out if specified directory does not exist # - Do not build the kernel three times wheh specifying "defconfig all" # - Removed warning when the target all was specified # -------------------------------------------- # 03/10/02 sam@mars.ravnborg.org 1.1419 # Merge mars.ravnborg.org:/home/sam/bk/linux-2.6 # into mars.ravnborg.org:/home/sam/bk/kbuild # -------------------------------------------- # 03/10/02 lord@jen.americas.sgi.com 1.1342.18.3 # [XFS] Either handle preemption with get/put or not, but don't # get without a put! Fix code for preemptable kernels. # # SGI Modid: 2.5.x-xfs:slinx:159379a # -------------------------------------------- # 03/10/02 lord@kernel.bkbits.net 1.1418.1.1 # Merge kernel.bkbits.net:/home/repos/linux-2.5 # into kernel.bkbits.net:/home/lord/xfs-2.6 # -------------------------------------------- # 03/10/02 lord@penguin.americas.sgi.com 1.1418.1.2 # Merge ssh://lord@kernel.bkbits.net/xfs-2.6 # into penguin.americas.sgi.com:/src/lord/bitkeeper/xfs-2.6 # -------------------------------------------- # 03/10/02 laforge@netfilter.org 1.1418.2.1 # [NETFILTER]: Fix UDP checksum in ip_nat_mangle_udp_packet, remove skb->csum hacks # -------------------------------------------- # 03/10/02 kaber@trash.net 1.1418.2.2 # [NETFILTER]: Don't call ip_conntrack_put with ip_conntrack_lock held # -------------------------------------------- # 03/10/02 laforge@netfilter.org 1.1418.2.3 # [NETFILTER]: LOCAL_OUT NAT fix. # # the 25_natcore-nohelper.patch (incorporated in 2.4.22) did actually make # things not better. If a NAT rule was matched, num_manips can still be 0. # However, some helpers (like PPTP) need to _always mangle the packets, # even if there is no NAT mapping for a particular connection. # On the other hand, as soon as CONFIG_IP_NF_LOCAL_NAT was disabled, # we did end up half-mangling local (non-NAT'ed) connections. This patch # removes the LOCAL_OUT hook from the NAT core unless CONFIG_IP_NF_NAT_LOCAL # is enabled. # -------------------------------------------- # 03/10/02 mirage@kaotik.org 1.1418.2.4 # [NETFILTER]: Add support for mIRC's 'server lookup' DCC address detection to ip_conntrack_irc.c # -------------------------------------------- # 03/10/02 kadlec@blackhole.kfki.hu 1.1418.2.5 # [NETFILTER]: Make conntrack timeouts become sysctls. # # This patch introduces the /proc/sys/net/ipv4/netfilter/ directory for=20 # the tuneable parameters of the conntrack engine of netfilter. # # The parameters which can currently be fine-tuned (if required at all)=20 # are the ip_conntrack_max, and the conntrack timeout parameters in seconds. # # The default timeout value for the TCP CLOSE_WAIT state is raised to 3 # days, which should cause less problems with long-lived half-closed TCP # sessions. # # For the sake of compatibility with 2.4,=20 # /proc/sys/net/ipv4/netfilter/ip_conntrack_max is duplicated as=20 # /proc/sys/net/ipv4/ip_conntrack_max as well. # -------------------------------------------- # 03/10/02 rusty@rustcorp.com.au 1.1418.2.6 # [NETFILTER]: LOCAL_OUT NAT fix, part 2. # # Balazs Scheidler pointed out that we can fail to call ip_nat_setup_info # for local NAT, which causes the connection to be added twice. Boom. # Also move the hash table insertion into ip_nat_setup_info. # -------------------------------------------- # 03/10/02 kaber@trash.net 1.1418.2.7 # [NETFILTER]: Add size check for udp packet mangling. # -------------------------------------------- # 03/10/02 kaber@trash.net 1.1418.2.8 # [NETFILTER]: Fix REJECT is used in LOCAL_OUT. # -------------------------------------------- # 03/10/02 laforge@netfilter.org 1.1418.2.9 # [NETFILTER]: Cosmetic update to ip6t_ipv6header. # -------------------------------------------- # 03/10/02 laforge@netfilter.org 1.1418.2.10 # [NETFILTER]: Fix SO_ORIGINAL_DST, broken by earlier endianness fixes. # -------------------------------------------- # 03/10/03 shemminger@osdl.org 1.1418.2.11 # [NET]: Consolidate skb delivery. # -------------------------------------------- # 03/10/03 shemminger@osdl.org 1.1418.2.12 # [NET]: More likely/unlikely in skbuff.h # -------------------------------------------- # 03/10/03 rmk@flint.arm.linux.org.uk 1.1342.19.1 # [ARM] Fix ARM "make help" output # # Remove "initrd" target from help - it isn't a user target. # -------------------------------------------- # 03/10/03 davem@nuts.ninka.net 1.1418.2.13 # [NETFILTER]: Add sysctl values missing from recent commit. # -------------------------------------------- # 03/10/03 davem@nuts.ninka.net 1.1418.3.1 # [ELF]: Handle auxv bits more cleanly in mixed 32/64 bit environments. # -------------------------------------------- # 03/10/03 davem@nuts.ninka.net 1.1418.2.14 # Merge http://linux-lksctp.bkbits.net/lksctp-2.5 # into nuts.ninka.net:/disk1/davem/BK/net-2.5 # -------------------------------------------- # 03/10/03 davem@nuts.ninka.net 1.1418.3.2 # [ELF]: Fix bug in previous change, forgot to advance ei_index over AT_NULL entry. # -------------------------------------------- # 03/10/03 davem@nuts.ninka.net 1.1418.3.3 # [SPARC64]: vmap/vunmap cache flushing need not do anything. # # We do though need an I-cache flush on spitfire chips when # doing a module load. # # Happily this allows us to kill off flush_cache_all() from # sparc64. # -------------------------------------------- # 03/10/03 lord@jen.americas.sgi.com 1.1418.1.3 # [XFS] Code cleanup # # SGI Modid: 2.5.x-xfs:slinx:159439a # -------------------------------------------- # 03/10/03 torvalds@home.osdl.org 1.1418.2.15 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/03 lord@sgi.com 1.1418.1.4 # [XFS] Code cleanup # # SGI Modid: 2.5.x-xfs:slinx:159439b # -------------------------------------------- # 03/10/03 roland@redhat.com 1.1418.2.16 # [PATCH] fix vsyscall page in core dumps # # My change to core dumps that was included with the vsyscall DSO # implementation had a bug (braino on my part). Core dumps don't include the # full page of the vsyscall DSO, and so don't accurately represent the whole # memory image of the process. This patch fixes it. I have tested it on # x86, but not tested the same change to 32-bit core dumps on AMD64 (haven't # even compiled on AMD64). # # I've also included the corresponding change for the IA64 code that was # copied blindly from the x86 vsyscall implementation, which looks like more # change than it is since I preserved the formatting of the copied code # instead of arbitrarily diddling it along with the trivial symbol name # changes. I haven't compiled or tested on ia64. # -------------------------------------------- # 03/10/03 B.Zolnierkiewicz@elka.pw.edu.pl 1.1418.2.17 # [PATCH] small cleanup for VIA IDE driver # # ide_pci_setup_ports() from setup-pci.c checks if port is disabled, if so # d->init_setup_dma() and d->init_hwif() won't be called. There is no # need to check it once again inside init_hwif_via82cxxx(), # init_dma_via82cxxx() and via82cxxx_tune_drive() (hwif->tuneproc will be # NULL for disabled port). # # Therefore remove via_enabled variable and now unnecessary # init_dma_via82cxx(). Also do not set .init_{iops, dma} to NULL in # via82cxxx.h (via82cxxx_chipsets[] is declared static). Bump driver's # version number to reflect changes. # # Acked by Vojtech # -------------------------------------------- # 03/10/03 B.Zolnierkiewicz@elka.pw.edu.pl 1.1418.2.18 # [PATCH] update pdc4030 driver # # - common pdc4030_init() for built-in and module # - kill init_pdc4030() and enable_promise_support flag (no longer needed) # - minor cleanups # -------------------------------------------- # 03/10/03 B.Zolnierkiewicz@elka.pw.edu.pl 1.1418.2.19 # [PATCH] small cleanup for AMD/nVidia IDE driver # # ide_pci_setup_ports() from setup-pci.c checks if port is disabled, if so # d->init_setup_dma() and d->init_hwif() won't be called. There is no need # to check it once again inside init_hwif_amd74xx(), init_dma_amd74xx() # and amd74xx_tune_drive() (hwif->tuneproc will be NULL for disabled port). # # Therefore remove amd_enabled variable and now unnecessary init_dma_amd74xx(). # Also do not set .init_{iops, dma} to NULL in amd74xx.h (amd74xx_chipsets[] # is declared static). Bump driver's version number to reflect changes. # # Almost identical to the previous VIA case. # -------------------------------------------- # 03/10/03 greg@kroah.com 1.1418.4.1 # Merge kroah.com:/home/greg/linux/BK/bleed-2.5 # into kroah.com:/home/greg/linux/BK/gregkh-2.6 # -------------------------------------------- # 03/10/03 greg@kroah.com 1.1418.4.2 # [PATCH] USB: convert usbfs to use new fs parser code. # -------------------------------------------- # 03/10/03 lord@sgi.com 1.1418.1.5 # [XFS] small cleanup # # SGI Modid: 2.5.x-xfs:slinx:159477a # -------------------------------------------- # 03/10/03 lord@kernel.bkbits.net 1.1418.1.6 # Merge kernel.bkbits.net:/home/repos/linux-2.5 # into kernel.bkbits.net:/home/lord/xfs-2.6 # -------------------------------------------- # 03/10/03 elenstev@mesatop.com 1.1418.4.3 # [PATCH] USB: remove reference to modules.txt in drivers/usb/input/Kconfig # # This patch removes the reference to Documentation/modules.txt, # which has been removed. The patch was made against the current # 2.6-bk tree. # -------------------------------------------- # 03/10/03 dan@reactivated.net 1.1418.4.4 # [PATCH] USB brlvger: Debug code fixes # # When compiling this driver with WRITE_DEBUG defined (for extra debug output), # gcc outputs warnings for three similar printf statements. # # The specifier in each printf statement is not totally correct. # This patch removes these warnings. # -------------------------------------------- # 03/10/03 lcapitulino@prefeitura.sp.gov.br 1.1418.4.5 # [PATCH] USB: fix drivers/usb/host/uhci-debug.c warning when !CONFIG_PROC_FS. # # I'm getting this when compiling USB with all options enabled: # # drivers/usb/host/uhci-debug.c:417: warning: `uhci_sprint_schedule' defined but not used # # my suggestion is to put under the #ifdef/#endif the functions which are # only used by the proc ones too. If one of them become necessary when # CONFIG_PROC_FS=n, the #ifdef/#endif for that function can be removed: # -------------------------------------------- # 03/10/03 greg@kroah.com 1.1418.2.20 # Merge kroah.com:/home/greg/linux/BK/bleed-2.5 # into kroah.com:/home/greg/linux/BK/gregkh-2.6 # -------------------------------------------- # 03/10/03 greg@kroah.com 1.1418.2.21 # [PATCH] USB: port keyspan patch from 2.4 to 2.6 # # Original patch from lucy@innosys.com # # Changes include: # Add support for new USA19H(s) USB Serial Adapter # Improve handing of config/control messages for all devices # # Note that the new adapter doesn't currently require a firmware download. # We will add support for re-programming the eeprom with updated firmware # when new firmware is required. # -------------------------------------------- # 03/10/03 greg@kroah.com 1.1418.2.22 # [PATCH] USB: fix up some non-GPL friendly license wording. # # Keyspan/InnoSys approved this change. # -------------------------------------------- # 03/10/03 torvalds@home.osdl.org 1.1418.1.7 # Merge bk://kernel.bkbits.net/lord/xfs-2.6 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/03 torvalds@home.osdl.org 1.1420 # Merge bk://linux-sam.bkbits.net/kbuild # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1421 # [PATCH] janitor: fix cciss for !CONFIG_PROC_FS # # From: Luiz Capitulino # # Fix a warning about 'proc_cciss' and `cciss_proc_get_info' defined but # not used. They are only called when CONFIG_PROC_FS=y. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1422 # [PATCH] janitor: Audit av7110_ir_init # # From: Daniele # # - Audit av7110_ir_init # - On saa7146_register_extension failure report back its return code # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1423 # [PATCH] janitor: opl3sa2 cleanups/checker # # From: Daniele # # - remove unneeded block of code in opl3sa3_mixer_ioctl # - remove unused function opl3sa3_set_wide # - From Stanford Checker: # /home/junfeng/linux-tainted/sound/oss/opl3sa2.c:539:opl3sa3_mixer_ioctl: # ERROR:TAINTED:53 9:539: dereferencing tainted ptr 'arg' # ..fixed user space pointer referce too on ioctl functions # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1424 # [PATCH] janitor: cleanup includes (sound/oss) # # From: Randy Hron # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1425 # [PATCH] janitor: cleanup includes (drivers/char) # # From: Randy Hron # # Cleanup of version.h in drivers/char plus a few in include/linux # that are used in drivers/char. # # Duplicate #includes removed. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1426 # [PATCH] janitor: fix toshiba for !CONFIG_PROC_FS # # From: Luiz Capitulino # # Fix warning in drivers/char/toshiba.c: `tosh_get_info' defined but not # used # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1427 # [PATCH] janitor: saa7146_register_extension failure report back its # # From: Daniele # # - On saa7146_register_extension failure report back its return code # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1428 # [PATCH] janitor: convert strtok to strsep (sound/oss) # # From: maximilian attems # # convert two missed strtok to strsep (sound/oss) # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1429 # [PATCH] janitor: init_nfsd() error handling # # From: Daniele Bellucci # # This is a little register_filesystem audit for nfsd. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1430 # [PATCH] janitor: cleanup includes (mtd) # # From: Randy Hron # # version.h cleanup and duplicate #includes removed. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1431 # [PATCH] janitor: cpqarray for !CONFIG_PROC_FS # # From: Luiz Capitulino # # Fix cpqarray.c warnings: `proc_array' and `ida_proc_get_info' defined # but not used # # ida_proc_get_info() is only called when CONFIG_PROC_FS=y. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1432 # [PATCH] janitor: saa7146_register_extension failure report (ttpci) # # From: Daniele # # - On saa7146_register_extension failure report back its return code # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1433 # [PATCH] janitor: cleanup includes (media/video) # # From: Randy Hron # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1434 # [PATCH] janitor: cleanup includes (oss/dmasound) # # From: Randy Hron # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1435 # [PATCH] janitor: cleanup includes (wireless/arlan) # # From: rwhron@earthlink.net # # Remove unneeded version.h include # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1436 # [PATCH] janitor: Audit copy_to_user (ttusb) # # From: Daniele # # - Audit copy_to_user in drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1437 # [PATCH] janitor: fix for not CONFIG_PROC_FS # # From: Luiz Capitulino # # Fix cmipci.c warnings: unused variable `entry', `snd_cmipci_proc_read' # defined but not used # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1438 # [PATCH] janitor: cleanup includes (drivers/media) # # From: Randy Hron # # version.h cleanup and remove duplicate #includes. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1439 # [PATCH] janitor: cleanup includes (cdrom) # # From: Randy Hron # # Remove unneeded include of version.h. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1440 # [PATCH] janitor: saa7146_register_extension (ci) failure report # # From: Daniele # # - On saa7146_register_extension failure report back its return code # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1441 # [PATCH] janitor: cleanup includes (telephony) # # From: Randy Hron # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1442 # [PATCH] janitor: cleanup includes (drivers/video) # # From: Randy Hron # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1443 # [PATCH] janitor: cleanup includes (acpi) # # From: rwhron@earthlink.net # -------------------------------------------- # 03/10/03 shemminger@osdl.org 1.1420.1.1 # [NET]: syncppp needs to pullup headers. # -------------------------------------------- # 03/10/03 shemminger@osdl.org 1.1420.1.2 # [IRDA]: Dongle module owner support. # -------------------------------------------- # 03/10/03 rddunlap@osdl.org 1.1420.1.3 # [NET]: Remove verify_area() in net/wan/sbni (from domen@coderock.org) # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.2 # [ARM] Select decompressor mmu handling based upon the architecture IDs. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.3 # [ARM] Remove redundant include of net/bluetooth/Kconfig # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.4 # [ARM] Add ARMv5TEJ to processor architecture list. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.5 # [ARM] Add system device for LEDs. # # This allows us to make the suspend/resume handling local to the LEDs # code itself, rather than being scattered in several files. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.6 # [ARM] leds.c, being so basic, needs linux/compiler.h # # linux/init.h doesn't include linux/compiler.h, but needs some # definitions (the __attribute_unused__ stuff) from compiler.h. # Since this affects only two files, we include linux/compiler.h # directly into the affected files. # # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.7 # [ARM] Make ARM use Pat's generic PM suspend to RAM support # # Hook the PXA and SA11x0 platform core power into the generic PM core. # Add support for freezing userspace processes. Make our apm emulation # call the generic PM suspend to memory infrastructure. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.8 # [ARM] Make die() more correct. # # Use 'tsk' when accessing comm and pid members. # Use regs->ARM_sp not regs + 1 for base of stack dump. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.9 # [ARM] Prepare Integrator support code for multiple machine support. # # Split Integrator/AP and Integrator/PP2 specific support from the # Integrator core code. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.10 # [ARM] Clean up Integrator interrupt number definitions. # # This allows us to expand the interrupt numbers on the primary # interrupt controller. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.11 # [ARM] Move Integrator flash map to driver model. # # Since we want to support multiple platforms, we also move the # Integrator flash driver over to the driver model. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.12 # [ARM] Add sysdev model for Integrator/AP. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.13 # [ARM] Update Integrator IRQ decoding. # # This takes account of the other IRQ changes, and makes the interrupt # decoding more efficient. # -------------------------------------------- # 03/10/04 mikpe@csd.uu.se 1.1444 # [PATCH] fix drivers/char/misc.c module autoloading breakage # # drivers/char/misc.c was changed to use the common list macros instead of # its own list code. The first open does load the module and increment # its use count, but a bug causes a failure to be reported anyway. This # causes an error return to user-space where there is none, and makes the # module non-unloadable. # # Fixed like this. # -------------------------------------------- # 03/10/04 dan@reactivated.net 1.1445 # [PATCH] (2.6.0-test6-bk) DocBook: Kernel-api build fix # # Witht he EXPORT_SYMBOL cleanups, net/netsyms.c has been removed. The # kernel-api DocBook docs still refer to this file, and because this file # is gone, "make htmldocs" and similar fails. # # This just removes the reference and so fixes this docbook problem. # -------------------------------------------- # 03/10/04 akpm@osdl.org 1.1446 # [PATCH] fix skb leak # # This reverts a broken part of the recent "Consolidate skb delivery" patch. # # It was doing an extra increment of skb->users, causing machine death after # just a few seconds of NFS activity. # -------------------------------------------- # 03/10/04 akpm@osdl.org 1.1447 # [PATCH] more raw driver minor numbers # # From: Badari Pulavarty # # Since we have larger dev_t now, here is the patch to support large # number of RAW devices. The userlevel command "raw" also needs changes to # use this support - which in turn needs new glibc. # -------------------------------------------- # 03/10/04 hunold@convergence.de 1.1448 # [PATCH] DVB: MAINTAINERS, CREDITS, ioctl-number.txt updates # # - MAINTAINERS: # - add the LinuxTV.org project as the DVB driver maintainer # - add me as the saa7146 v4l2 driver maintainer # - CREDITS: add me as the saa7146 v4l2 driver author # - Documentation/ioctl-number.txt: # - remove bogus reference to Linux DVD API, which never really existed # - remove bogus referenc to Philips saa7146 driver, which never came # to life # -------------------------------------------- # 03/10/04 nico@org.rmk.(none) 1.1267.74.1 # [ARM PATCH] 1674/1: better ARM division routines # # Patch from Nicolas Pitre # # Here's my rewrite of the ARM division routines: # # - take advantage of the clz instruction on ARMv5+ # - simpler and faster code for modulo routines # - fast path for power of 2 divisors # - other miscellaneous optimizations # # This code has already been merged into gcc-3.4. # -------------------------------------------- # 03/10/04 dsaxena@com.rmk.(none) 1.1342.19.14 # [ARM PATCH] 1624/1: BE support for io-readsl-armv4.S, io-reads-armv4.S, io-writesw-armv4.S # # Patch from Deepak Saxena # # -------------------------------------------- # 03/10/04 robin.farine@ch.rmk.(none) 1.1342.19.15 # [ARM PATCH] 1675/1: remove definitions of non-implemented system calls from include/asm-arm/unistd.h # # Patch from Robin Farine # # Remove the definitions of system call numbers from include/asm-arm/unistd.h for which the corresponding vector in arch/arm/kernel/calls.S points to sys_ni_syscall. # # # # Since the new glibc (2.3.2) implements some of the system call wrapper functions based on the presence or absence of such definitions, only implemented system calls should have a corresponding __NR_xyz preprocessor symbol in unistd.h. # # -------------------------------------------- # 03/10/04 nico@org.rmk.(none) 1.1267.74.2 # [ARM PATCH] 1660/1: misc PXA/Lubbock fixes # # Patch from Nicolas Pitre # # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.4 # [IRDA]: Missing header file change from dongle owner changes. # -------------------------------------------- # 03/10/04 shields@msrl.com 1.1420.2.1 # [SPARC64]: Fix watchdog on CP1500/Netra-t1. # -------------------------------------------- # 03/10/04 sheilds@msrl.com 1.1420.2.2 # [SPARC64]: Fix typo in bbc_envctrl.c # -------------------------------------------- # 03/10/04 davem@nuts.ninka.net 1.1420.2.3 # [SPARC]: Reserve syscall slot for VSERVER. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.5 # [IRDA]: Tekram dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.6 # [IRDA]: act200l dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.7 # [IRDA]: actisys dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.8 # [IRDA]: ep7211_ir dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.9 # [IRDA]: esi dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.10 # [IRDA]: girbil dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.11 # [IRDA]: litelink dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.12 # [IRDA]: ma600 dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.13 # [IRDA]: mcp2120 dongle module conversion. # -------------------------------------------- # 03/10/04 shemminger@osdl.org 1.1420.1.14 # [IRDA]: old_belkin dongle module conversion. # -------------------------------------------- # 03/10/04 rmk@flint.arm.linux.org.uk 1.1342.19.16 # Merge # -------------------------------------------- # 03/10/04 davem@nuts.ninka.net 1.1449 # Merge nuts.ninka.net:/disk1/davem/BK/sparcwork-2.5 # into nuts.ninka.net:/disk1/davem/BK/sparc-2.5 # -------------------------------------------- # 03/10/04 davem@nuts.ninka.net 1.1448.1.1 # Merge nuts.ninka.net:/disk1/davem/BK/network-2.5 # into nuts.ninka.net:/disk1/davem/BK/net-2.5 # -------------------------------------------- # 03/10/04 davem@nuts.ninka.net 1.1450 # [SPARC64]: Update defconfig. # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.1 # [PATCH] cmd64x: kill dummy init_dma_cmd64x() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.2 # [PATCH] cs5530: kill dummy init_dma_cs5530() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.3 # [PATCH] generic: kill dummy init_dma_generic() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.4 # [PATCH] hpt34x: kill dummy init_dma_hpt34x() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.5 # [PATCH] it8172: kill dummy init_dma_it8172() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.6 # [PATCH] ns87415: kill dummy init_dma_ns87415() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.7 # [PATCH] opti621: kill dummy init_dma_opti621() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.8 # [PATCH] pdc202xx_new: kill dummy init_dma_pdc202new() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.9 # [PATCH] piix: kill dummy init_dma_piix() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.10 # [PATCH] sc1200: kill dummy init_dma_sc1200() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.11 # [PATCH] siimage: kill dummy init_dma_siimage() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.12 # [PATCH] sis5513: kill dummy init_dma_sis5513() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.13 # [PATCH] slc90e66: kill dummy init_dma_slc90e66() # -------------------------------------------- # 03/10/04 B.Zolnierkiewicz@elka.pw.edu.pl 1.1448.2.14 # [PATCH] remove PDC-ADMA placeholders # # They do not contain any real code. # -------------------------------------------- # 03/10/04 torvalds@home.osdl.org 1.1448.2.15 # Merge bk://bk.arm.linux.org.uk/linux-2.6-rmk # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/04 torvalds@home.osdl.org 1.1448.1.2 # Merge bk://kernel.bkbits.net/davem/net-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # 03/10/04 torvalds@home.osdl.org 1.1451 # Merge bk://kernel.bkbits.net/davem/sparc-2.5 # into home.osdl.org:/home/torvalds/v2.5/linux # -------------------------------------------- # diff -Nru a/CREDITS b/CREDITS --- a/CREDITS Sun Oct 5 00:33:09 2003 +++ b/CREDITS Sun Oct 5 00:33:09 2003 @@ -1459,6 +1459,13 @@ S: Roscommon S: Ireland +N: Michael Hunold +E: michael@mihu.de +W: http://www.mihu.de/linux/ +D: Generic saa7146 video4linux-2 driver core, +D: Driver for the "Multimedia eXtension Board", "dpc7146", +D: "Hexium Orion", "Hexium Gemini" + N: Miguel de Icaza Amozurrutia E: miguel@nuclecu.unam.mx D: Linux/SPARC team, Midnight Commander maintainer diff -Nru a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl --- a/Documentation/DocBook/kernel-api.tmpl Sun Oct 5 00:33:05 2003 +++ b/Documentation/DocBook/kernel-api.tmpl Sun Oct 5 00:33:05 2003 @@ -318,6 +318,5 @@ diff -Nru a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt --- a/Documentation/cachetlb.txt Sun Oct 5 00:33:08 2003 +++ b/Documentation/cachetlb.txt Sun Oct 5 00:33:08 2003 @@ -59,9 +59,9 @@ address translations from the TLB. After running, this interface must make sure that any previous page table modifications for the address space 'vma->vm_mm' in the range - 'start' to 'end' will be visible to the cpu. That is, after + 'start' to 'end-1' will be visible to the cpu. That is, after running, here will be no entries in the TLB for 'mm' for - virtual addresses in the range 'start' to 'end'. + virtual addresses in the range 'start' to 'end-1'. The "vma" is the backing store being used for the region. Primarily, this is used for munmap() type operations. @@ -100,7 +100,7 @@ unsigned long start, unsigned long end) The software page tables for address space 'mm' for virtual - addresses in the range 'start' to 'end' are being torn down. + addresses in the range 'start' to 'end-1' are being torn down. Some platforms cache the lowest level of the software page tables in a linear virtually mapped array, to make TLB miss processing @@ -165,15 +165,7 @@ Here are the routines, one by one: -1) void flush_cache_all(void) - - The most severe flush of all. After this interface runs, - the entire cpu cache is flushed. - - This is usually invoked when the kernel page tables are - changed, since such translations are "global" in nature. - -2) void flush_cache_mm(struct mm_struct *mm) +1) void flush_cache_mm(struct mm_struct *mm) This interface flushes an entire user address space from the caches. That is, after running, there will be no cache @@ -183,13 +175,13 @@ page table operations such as what happens during fork, exit, and exec. -3) void flush_cache_range(struct vm_area_struct *vma, +2) void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) Here we are flushing a specific range of (user) virtual addresses from the cache. After running, there will be no entries in the cache for 'vma->vm_mm' for virtual addresses in - the range 'start' to 'end'. + the range 'start' to 'end-1'. The "vma" is the backing store being used for the region. Primarily, this is used for munmap() type operations. @@ -200,7 +192,7 @@ call flush_cache_page (see below) for each entry which may be modified. -4) void flush_cache_page(struct vm_area_struct *vma, unsigned long addr) +3) void flush_cache_page(struct vm_area_struct *vma, unsigned long addr) This time we need to remove a PAGE_SIZE sized range from the cache. The 'vma' is the backing structure used by @@ -215,6 +207,30 @@ This is used primarily during fault processing. +4) void flush_cache_kmaps(void) + + This routine need only be implemented if the platform utilizes + highmem. It will be called right before all of the kmaps + are invalidated. + + After running, there will be no entries in the cache for + the kernel virtual address range PKMAP_ADDR(0) to + PKMAP_ADDR(LAST_PKMAP). + + This routing should be implemented in asm/highmem.h + +5) void flush_cache_vmap(unsigned long start, unsigned long end) + void flush_cache_vunmap(unsigned long start, unsigned long end) + + Here in these two interfaces we are flushing a specific range + of (kernel) virtual addresses from the cache. After running, + there will be no entries in the cache for the kernel address + space for virtual addresses in the range 'start' to 'end-1'. + + The first of these two routines is invoked after map_vm_area() + has installed the page table entries. The second is invoked + before unmap_vm_area() deletes the page table entries. + There exists another whole class of cpu cache issues which currently require a whole different set of interfaces to handle properly. The biggest problem is that of virtual aliasing in the data cache @@ -317,23 +333,32 @@ dirty. Again, see sparc64 for examples of how to deal with this. + void copy_to_user_page(struct vm_area_struct *vma, struct page *page, + unsigned long user_vaddr, + void *dst, void *src, int len) + void copy_from_user_page(struct vm_area_struct *vma, struct page *page, + unsigned long user_vaddr, + void *dst, void *src, int len) + When the kernel needs to copy arbitrary data in and out + of arbitrary user pages (f.e. for ptrace()) it will use + these two routines. + + The page has been kmap()'d, and flush_cache_page() has + just been called for the user mapping of this page (if + necessary). + + Any necessary cache flushing or other coherency operations + that need to occur should happen here. If the processor's + instruction cache does not snoop cpu stores, it is very + likely that you will need to flush the instruction cache + for copy_to_user_page(). + void flush_icache_range(unsigned long start, unsigned long end) When the kernel stores into addresses that it will execute out of (eg when loading modules), this function is called. If the icache does not snoop stores then this routine will need to flush it. - - void flush_icache_user_range(struct vm_area_struct *vma, - struct page *page, unsigned long addr, int len) - This is called when the kernel stores into addresses that are - part of the address space of a user process (which may be some - other process than the current process). The addr argument - gives the virtual address in that process's address space, - page is the page which is being modified, and len indicates - how many bytes have been modified. The modified region must - not cross a page boundary. Currently this is only called from - kernel/ptrace.c. void flush_icache_page(struct vm_area_struct *vma, struct page *page) All the functionality of flush_icache_page can be implemented in diff -Nru a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt --- a/Documentation/cpu-freq/user-guide.txt Sun Oct 5 00:33:06 2003 +++ b/Documentation/cpu-freq/user-guide.txt Sun Oct 5 00:33:06 2003 @@ -57,6 +57,8 @@ AMD mobile K6-3+ AMD mobile Duron AMD mobile Athlon +AMD Opteron +AMD Athlon 64 Cyrix Media GXm Intel mobile PIII and Intel mobile PIII-M on certain chipsets Intel Pentium 4, Intel Xeon diff -Nru a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt --- a/Documentation/crypto/api-intro.txt Sun Oct 5 00:33:09 2003 +++ b/Documentation/crypto/api-intro.txt Sun Oct 5 00:33:09 2003 @@ -126,7 +126,7 @@ BUGS Send bug reports to: -James Morris +James Morris Cc: David S. Miller @@ -220,5 +220,5 @@ Generic scatterwalk code by Adam J. Richter Please send any credits updates or corrections to: -James Morris +James Morris diff -Nru a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt --- a/Documentation/ioctl-number.txt Sun Oct 5 00:33:10 2003 +++ b/Documentation/ioctl-number.txt Sun Oct 5 00:33:10 2003 @@ -175,10 +175,6 @@ 0xA0 all linux/sdp/sdp.h Industrial Device Project -0xA2 00-0F DVD decoder driver in development: - -0xA3 00-1F Philips SAA7146 dirver in development: - 0xA3 80-8F Port ACL in development: 0xA3 90-9F linux/dtlk.h diff -Nru a/Documentation/iostats.txt b/Documentation/iostats.txt --- a/Documentation/iostats.txt Sun Oct 5 00:33:07 2003 +++ b/Documentation/iostats.txt Sun Oct 5 00:33:07 2003 @@ -1,22 +1,22 @@ I/O statistics fields --------------- -Last modified 5/15/03 +Last modified Sep 30, 2003 -In 2.4.20 (and some versions before, with patches), and 2.5.45, -more extensive disk statistics were introduced to help measure disk +Since 2.4.20 (and some versions before, with patches), and 2.5.45, +more extensive disk statistics have been introduced to help measure disk activity. Tools such as sar and iostat typically interpret these and do the work for you, but in case you are interested in creating your own tools, the fields are explained here. -In most versions of the 2.4 patch, the information is found as additional -fields in /proc/partitions. In 2.5, the same information is found in -two places: one is in the file /proc/diskstats (appears in 2.5.69 and -beyond), and the other is within the sysfs file system, which must be -mounted in order to obtain the information. Throughout this document -we'll assume that sysfs is mounted on /sys, although of course it may -be mounted anywhere. In 2.5, both /proc/diskstats and sysfs use the -same source for the information and so should not differ. +In 2.4 now, the information is found as additional fields in +/proc/partitions. In 2.6, the same information is found in two +places: one is in the file /proc/diskstats, and the other is within +the sysfs file system, which must be mounted in order to obtain +the information. Throughout this document we'll assume that sysfs +is mounted on /sys, although of course it may be mounted anywhere. +Both /proc/diskstats and sysfs use the same source for the information +and so should not differ. Here are examples of these different formats: @@ -25,15 +25,15 @@ 3 1 9221278 hda1 35486 0 35496 38030 0 0 0 0 0 38030 38030 -2.5 sysfs: +2.6 sysfs: 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 35486 38030 38030 38030 -2.5 diskstats: +2.6 diskstats: 3 0 hda 446216 784926 9550688 4382310 424847 312726 5922052 19310380 0 3376340 23705160 3 1 hda1 35486 38030 38030 38030 -On 2.4 you might execute "grep 'hda ' /proc/partitions". On 2.5, you have +On 2.4 you might execute "grep 'hda ' /proc/partitions". On 2.6, you have a choice of "cat /sys/block/hda/stat" or "grep 'hda ' /proc/diskstats". The advantage of one over the other is that the sysfs choice works well if you are watching a known, small set of disks. /proc/diskstats may @@ -43,7 +43,7 @@ In 2.4, the statistics fields are those after the device name. In the above example, the first field of statistics would be 446216. -By contrast, in 2.5 if you look at /sys/block/hda/stat, you'll +By contrast, in 2.6 if you look at /sys/block/hda/stat, you'll find just the eleven fields, beginning with 446216. If you look at /proc/diskstats, the eleven fields will be preceded by the major and minor device numbers, and device name. Each of these formats provide @@ -93,35 +93,35 @@ To avoid introducing performance bottlenecks, no locks are held while modifying these counters. This implies that minor inaccuracies may be introduced when changes collide, so (for instance) adding up all the -read I/Os issued per partition should equal those made to the disks -... but due to the lack of locking it may only be very close. +read I/Os issued per partition should equal those made to the disks ... +but due to the lack of locking it may only be very close. -In release 2.5.65 the 2.5 counters were made per-cpu, which made the lack -of locking almost a non-issue. When the statistics are read, the per-cpu -counters are summed (possibly overflowing the unsigned 32-bit variable -they are summed to) and the result given to the user. There is no -convenient user interface for accessing the per-cpu counters themselves. +In 2.6, there are counters for each cpu, which made the lack of locking +almost a non-issue. When the statistics are read, the per-cpu counters +are summed (possibly overflowing the unsigned 32-bit variable they are +summed to) and the result given to the user. There is no convenient +user interface for accessing the per-cpu counters themselves. Disks vs Partitions ------------------- -There were significant changes between 2.4 and 2.5 in the I/O subsystem. +There were significant changes between 2.4 and 2.6 in the I/O subsystem. As a result, some statistic information disappeared. The translation from a disk address relative to a partition to the disk address relative to the host disk happens much earlier. All merges and timings now happen at the disk level rather than at both the disk and partition level as -in 2.4. Consequently, you'll see a different statistics output on 2.5 for +in 2.4. Consequently, you'll see a different statistics output on 2.6 for partitions from that for disks. There are only *four* fields available -for partitions on 2.5 machines. This is reflected in the examples above. +for partitions on 2.6 machines. This is reflected in the examples above. Field 1 -- # of reads issued This is the total number of reads issued to this partition. Field 2 -- # of sectors read This is the total number of sectors requested to be read from this partition. -Field 3 -- # of reads issued +Field 3 -- # of writes issued This is the total number of writes issued to this partition. -Field 4 -- # of sectors read +Field 4 -- # of sectors written This is the total number of sectors requested to be written to this partition. @@ -135,14 +135,16 @@ Additional notes ---------------- -In 2.5, sysfs is not mounted by default. Here's the line you'll want -to add to your /etc/fstab: +In 2.6, sysfs is not mounted by default. If your distribution of +Linux hasn't added it already, here's the line you'll want to add to +your /etc/fstab: none /sys sysfs defaults 0 0 -In 2.5, at the same time that disk statistics appeared in sysfs, they were -removed from /proc/stat. In 2.4, they appear in both /proc/partitions -and /proc/stat. +In 2.6, all disk statistics were removed from /proc/stat. In 2.4, they +appear in both /proc/partitions and /proc/stat, although the ones in +/proc/stat take a very different format from those in /proc/partitions +(see proc(5), if your system has it.) -- ricklind@us.ibm.com diff -Nru a/Documentation/zorro.txt b/Documentation/zorro.txt --- a/Documentation/zorro.txt Sun Oct 5 00:33:09 2003 +++ b/Documentation/zorro.txt Sun Oct 5 00:33:09 2003 @@ -2,7 +2,7 @@ ---------------------------------------- Written by Geert Uytterhoeven -Last revised: February 27, 2000 +Last revised: September 5, 2003 1. Introduction @@ -75,7 +75,7 @@ The treatment of these regions depends on the type of Zorro space: - Zorro II address space is always mapped and does not have to be mapped - explicitly using ioremap(). + explicitly using z_ioremap(). Conversion from bus/physical Zorro II addresses to kernel virtual addresses and vice versa is done using: @@ -83,22 +83,20 @@ virt_addr = ZTWO_VADDR(bus_addr); bus_addr = ZTWO_PADDR(virt_addr); - - Zorro III address space must be mapped explicitly using ioremap() first + - Zorro III address space must be mapped explicitly using z_ioremap() first before it can be accessed: - virt_addr = ioremap(bus_addr, size); + virt_addr = z_ioremap(bus_addr, size); ... - iounmap(virt_addr); + z_iounmap(virt_addr); 5. References ------------- linux/include/linux/zorro.h -linux/include/linux/ioport.h -linux/include/asm-m68k/io.h -linux/include/asm-m68k/amigahw.h -linux/include/asm-ppc/io.h +linux/include/asm-{m68k,ppc}/zorro.h +linux/include/linux/zorro_ids.h linux/drivers/zorro /proc/bus/zorro diff -Nru a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS Sun Oct 5 00:33:08 2003 +++ b/MAINTAINERS Sun Oct 5 00:33:08 2003 @@ -114,8 +114,8 @@ S: Maintained 8250/16?50 (AND CLONE UARTS) SERIAL DRIVER -P: Theodore Ts'o -M: tytso@mit.edu +P: Russell King +M: rmk+serial@arm.linux.org.uk L: linux-serial@vger.kernel.org W: http://serial.sourceforge.net S: Maintained @@ -284,6 +284,16 @@ L: linux-net@vger.kernel.org S: Maintained +ASUS ACPI EXTRAS DRIVER +P: Karol Kozimor +M: sziwan@users.sourceforge.net +P: Julien Lerouge +M: julien.lerouge@free.fr +L: acpi4asus-user@lists.sourceforge.net +W: http://sourceforge.net/projects/acpi4asus +W: http://julien.lerouge.free.fr +S: Maintained + ATM P: Chas Williams M: chas@cmf.nrl.navy.mil @@ -509,7 +519,7 @@ CRYPTO API P: James Morris -M: jmorris@intercode.com.au +M: jmorris@redhat.com P: David S. Miller M: davem@redhat.com W http://samba.org/~jamesm/crypto/ @@ -624,7 +634,7 @@ P: Christoph Lameter M: christoph@lameter.com W: http://www.digi.com -L: digilnux@dgii.com +L: digilnux@digi.com S: Orphaned DIRECTORY NOTIFICATION @@ -669,6 +679,12 @@ M: romieu@ensta.fr S: Maintained +DVB SUBSYSTEM AND DRIVERS +P: LinuxTV.org Project +L: linux-dvb@linuxtv.org +W: http://linuxtv.org/developer/dvb.xml +S: Supported + EATA-DMA SCSI DRIVER P: Michael Neuffer L: linux-eata@i-connect.net, linux-scsi@vger.kernel.org @@ -1386,7 +1402,7 @@ P: Pekka Savola (ipv6) M: pekkas@netcore.fi P: James Morris -M: jmorris@intercode.com.au +M: jmorris@redhat.com P: Hideaki YOSHIFUJI M: yoshfuji@linux-ipv6.org L: netdev@oss.sgi.com @@ -1657,6 +1673,12 @@ L: linux-390@vm.marist.edu W: http://oss.software.ibm.com/developerworks/opensource/linux390 S: Supported + +SAA7146 VIDEO4LINUX-2 DRIVER +P: Michael Hunold +M: michael@mihu.de +W: http://www.mihu.de/linux/saa7146 +S: Maintained SA1100 SUPPORT P: Nicolas Pitre diff -Nru a/Makefile b/Makefile --- a/Makefile Sun Oct 5 00:33:09 2003 +++ b/Makefile Sun Oct 5 00:33:09 2003 @@ -37,7 +37,7 @@ endif endif ifndef KBUILD_VERBOSE - KBUILD_VERBOSE = 0 + KBUILD_VERBOSE = 0 endif # Call sparse as part of compilation of C files @@ -79,16 +79,24 @@ endif endif +# That's our default target when none is given on the command line +.PHONY: all +all: + ifneq ($(KBUILD_OUTPUT),) # Invoke a second make in the output directory, passing relevant variables - KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT); /bin/pwd) +# check that the output directory actually exists +saved-output := $(KBUILD_OUTPUT) +KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) +$(if $(wildcard $(KBUILD_OUTPUT)),, \ + $(error output directory "$(saved-output)" does not exist)) -.PHONY: $(MAKECMDGOALS) all +.PHONY: $(MAKECMDGOALS) -$(MAKECMDGOALS) all: +$(filter-out all,$(MAKECMDGOALS)) all: $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \ - KBUILD_CHECK=$(KBUILD_CHECK) -f $(CURDIR)/Makefile $(MAKECMDGOALS) + KBUILD_CHECK=$(KBUILD_CHECK) -f $(CURDIR)/Makefile $@ # Leave processing to above invocation of make skip-makefile := 1 @@ -156,13 +164,6 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer HOSTCXXFLAGS = -O2 - -# That's our default target when none is given on the command line -# Note that 'modules' will be added as a prerequisite as well, -# in the CONFIG_MODULES part below - -all: vmlinux - # Decide whether to build built-in, modular, or both. # Normally, just do built-in. @@ -366,6 +367,12 @@ # Build targets only - this includes vmlinux, arch specific targets, clean # targets and others. In general all targets except *config targets. +# That's our default target when none is given on the command line +# Note that 'modules' will be added as a prerequisite as well, +# in the CONFIG_MODULES part below + +all: vmlinux + # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ drivers-y := drivers/ sound/ @@ -753,7 +760,7 @@ .menuconfig.log \ include/asm \ .hdepend include/linux/modversions.h \ - tags TAGS cscope.out kernel.spec \ + tags TAGS cscope* kernel.spec \ .tmp* # Directories removed with 'make mrproper' @@ -877,7 +884,7 @@ @echo ' mrproper - remove all generated files + config + various backup files' @echo '' @echo 'Configuration targets:' - @$(MAKE) -f scripts/kconfig/Makefile help + @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help @echo '' @echo 'Other generic targets:' @echo ' all - Build all targets marked with [*]' @@ -890,7 +897,7 @@ @echo ' tags/TAGS - Generate tags file for editors' @echo '' @echo 'Documentation targets:' - @$(MAKE) -f Documentation/DocBook/Makefile dochelp + @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp @echo '' @echo 'Architecture specific targets ($(ARCH)):' @$(if $(archhelp),$(archhelp),\ diff -Nru a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c --- a/arch/alpha/kernel/core_irongate.c Sun Oct 5 00:33:09 2003 +++ b/arch/alpha/kernel/core_irongate.c Sun Oct 5 00:33:09 2003 @@ -391,7 +391,7 @@ cur_gatt = phys_to_virt(GET_GATT(baddr) & ~1); pte = cur_gatt[GET_GATT_OFF(baddr)] & ~1; - if (__alpha_remap_area_pages(VMALLOC_VMADDR(vaddr), + if (__alpha_remap_area_pages(vaddr, pte, PAGE_SIZE, 0)) { printk("AGP ioremap: FAILED to map...\n"); vfree(area->addr); diff -Nru a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c --- a/arch/alpha/kernel/core_marvel.c Sun Oct 5 00:33:06 2003 +++ b/arch/alpha/kernel/core_marvel.c Sun Oct 5 00:33:06 2003 @@ -696,7 +696,7 @@ } pfn >>= 1; /* make it a true pfn */ - if (__alpha_remap_area_pages(VMALLOC_VMADDR(vaddr), + if (__alpha_remap_area_pages(vaddr, pfn << PAGE_SHIFT, PAGE_SIZE, 0)) { printk("FAILED to map...\n"); diff -Nru a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c --- a/arch/alpha/kernel/core_titan.c Sun Oct 5 00:33:07 2003 +++ b/arch/alpha/kernel/core_titan.c Sun Oct 5 00:33:07 2003 @@ -534,7 +534,7 @@ } pfn >>= 1; /* make it a true pfn */ - if (__alpha_remap_area_pages(VMALLOC_VMADDR(vaddr), + if (__alpha_remap_area_pages(vaddr, pfn << PAGE_SHIFT, PAGE_SIZE, 0)) { printk("FAILED to map...\n"); diff -Nru a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c --- a/arch/alpha/kernel/setup.c Sun Oct 5 00:33:07 2003 +++ b/arch/alpha/kernel/setup.c Sun Oct 5 00:33:07 2003 @@ -1203,7 +1203,7 @@ platform_string(), nr_processors); #ifdef CONFIG_SMP - seq_printf(f, "cpus active\t\t: %d\n" + seq_printf(f, "cpus active\t\t: %ld\n" "cpu active mask\t\t: %016lx\n", num_online_cpus(), cpu_present_mask); #endif diff -Nru a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c --- a/arch/alpha/kernel/smp.c Sun Oct 5 00:33:07 2003 +++ b/arch/alpha/kernel/smp.c Sun Oct 5 00:33:07 2003 @@ -597,7 +597,7 @@ if (cpu_online(cpu)) bogosum += cpu_data[cpu].loops_per_jiffy; - printk(KERN_INFO "SMP: Total of %d processors activated " + printk(KERN_INFO "SMP: Total of %ld processors activated " "(%lu.%02lu BogoMIPS).\n", num_online_cpus(), (bogosum + 2500) / (500000/HZ), diff -Nru a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c --- a/arch/alpha/kernel/time.c Sun Oct 5 00:33:08 2003 +++ b/arch/alpha/kernel/time.c Sun Oct 5 00:33:08 2003 @@ -89,6 +89,16 @@ return result; } +/* + * Scheduler clock - returns current time in nanosec units. + * + * Copied from ARM code for expediency... ;-} + */ +unsigned long long sched_clock(void) +{ + return (unsigned long long)jiffies * (1000000000 / HZ); +} + /* * timer_interrupt() needs to keep up the real-time clock, @@ -239,8 +249,9 @@ * arch/i386/time.c. */ -#define CALIBRATE_LATCH (52 * LATCH) -#define CALIBRATE_TIME (52 * 1000020 / HZ) +#define PIC_TICK_RATE 1193180UL +#define CALIBRATE_LATCH 0xffff +#define TIMEOUT_COUNT 0x100000 static unsigned long __init calibrate_cc_with_pic(void) @@ -263,19 +274,15 @@ cc = rpcc(); do { - count+=100; /* by 1 takes too long to timeout from 0 */ - } while ((inb(0x61) & 0x20) == 0 && count > 0); + count++; + } while ((inb(0x61) & 0x20) == 0 && count < TIMEOUT_COUNT); cc = rpcc() - cc; /* Error: ECTCNEVERSET or ECPUTOOFAST. */ - if (count <= 100) - return 0; - - /* Error: ECPUTOOSLOW. */ - if (cc <= CALIBRATE_TIME) + if (count <= 1 || count == TIMEOUT_COUNT) return 0; - return (cc * 1000000UL) / CALIBRATE_TIME; + return ((long)cc * PIC_TICK_RATE) / (CALIBRATE_LATCH + 1); } /* The Linux interpretation of the CMOS clock register contents: diff -Nru a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c --- a/arch/alpha/mm/init.c Sun Oct 5 00:33:10 2003 +++ b/arch/alpha/mm/init.c Sun Oct 5 00:33:10 2003 @@ -210,7 +210,8 @@ /* Allocate one PGD and one PMD. In the case of SRM, we'll need these to actually remap the console. There is an assumption here that only one of each is needed, and this allows for 8MB. - Currently (late 1999), big consoles are still under 4MB. + On systems with larger consoles, additional pages will be + allocated as needed during the mapping process. In the case of not SRM, but not CONFIG_ALPHA_LARGE_VMALLOC, we need to allocate the PGD we use for vmalloc before we start @@ -237,6 +238,15 @@ unsigned long pfn = crb->map[i].pa >> PAGE_SHIFT; crb->map[i].va = vaddr; for (j = 0; j < crb->map[i].count; ++j) { + /* Newer console's (especially on larger + systems) may require more pages of + PTEs. Grab additional pages as needed. */ + if (pmd != pmd_offset(pgd, vaddr)) { + memset(kernel_end, 0, PAGE_SIZE); + pmd = pmd_offset(pgd, vaddr); + pmd_set(pmd, (pte_t *)kernel_end); + kernel_end += PAGE_SIZE; + } set_pte(pte_offset_kernel(pmd, vaddr), pfn_pte(pfn, PAGE_KERNEL)); pfn++; diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig --- a/arch/arm/Kconfig Sun Oct 5 00:33:08 2003 +++ b/arch/arm/Kconfig Sun Oct 5 00:33:08 2003 @@ -239,7 +239,7 @@ # Now handle the bus types config PCI - bool "PCI support" if ARCH_INTEGRATOR + bool "PCI support" if ARCH_INTEGRATOR_AP default y if ARCH_FTVPCI || ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX help Find out whether you have a PCI motherboard. PCI is the name of a @@ -644,8 +644,6 @@ source "drivers/misc/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Kernel hacking" diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile --- a/arch/arm/Makefile Sun Oct 5 00:33:08 2003 +++ b/arch/arm/Makefile Sun Oct 5 00:33:08 2003 @@ -182,7 +182,6 @@ echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' echo ' bootpImage - Combined zImage and initial RAM disk' - echo ' initrd - Create an initial image' echo ' install - Install uncompressed kernel' echo ' zinstall - Install compressed kernel' echo ' Install using (your) ~/bin/installkernel or' diff -Nru a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S --- a/arch/arm/boot/compressed/head.S Sun Oct 5 00:33:10 2003 +++ b/arch/arm/boot/compressed/head.S Sun Oct 5 00:33:10 2003 @@ -477,6 +477,12 @@ @ b __arm6_cache_off @ b __armv3_cache_flush + .word 0x00000000 @ old ARM ID + .word 0x0000f000 + mov pc, lr + mov pc, lr + mov pc, lr + .word 0x41007000 @ ARM7/710 .word 0xfff8fe00 b __arm7_cache_off @@ -489,6 +495,14 @@ b __armv4_cache_off mov pc, lr + .word 0x00007000 @ ARM7 IDs + .word 0x0000f000 + mov pc, lr + mov pc, lr + mov pc, lr + + @ Everything from here on will be the new ID system. + .word 0x41129200 @ ARM920T .word 0xff00fff0 b __armv4_cache_on @@ -507,8 +521,16 @@ b __armv4_cache_off b __armv4_cache_flush - .word 0x69050000 @ xscale - .word 0xffff0000 + @ These match on the architecture ID + + .word 0x00050000 @ ARMv5TE + .word 0x000f0000 + b __armv4_cache_on + b __armv4_cache_off + b __armv4_cache_flush + + .word 0x00060000 @ ARMv5TEJ + .word 0x000f0000 b __armv4_cache_on b __armv4_cache_off b __armv4_cache_flush diff -Nru a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c --- a/arch/arm/kernel/apm.c Sun Oct 5 00:33:10 2003 +++ b/arch/arm/kernel/apm.c Sun Oct 5 00:33:10 2003 @@ -179,13 +179,10 @@ wake_up_interruptible(&apm_waitqueue); } -/* defined in pm.c */ -extern int suspend(void); - static int apm_suspend(void) { struct list_head *l; - int err = suspend(); + int err = pm_suspend(PM_SUSPEND_MEM); /* * Anyone on the APM queues will think we're still suspended. diff -Nru a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S --- a/arch/arm/kernel/entry-armv.S Sun Oct 5 00:33:07 2003 +++ b/arch/arm/kernel/entry-armv.S Sun Oct 5 00:33:07 2003 @@ -439,20 +439,25 @@ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp /* FIXME: should not be using soo many LDRs here */ - ldr \irqnr, =IO_ADDRESS(INTEGRATOR_IC_BASE) - ldr \irqstat, [\irqnr, #IRQ_STATUS] @ get masked status - ldr \irqnr, =IO_ADDRESS(INTEGRATOR_HDR_BASE) - ldr \irqnr, [\irqnr, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)] - orr \irqstat, \irqstat, \irqnr, lsl #INTEGRATOR_CM_INT0 + ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE) + mov \irqnr, #IRQ_PIC_START + ldr \irqstat, [\base, #IRQ_STATUS] @ get masked status + ldr \base, =IO_ADDRESS(INTEGRATOR_HDR_BASE) + teq \irqstat, #0 + ldreq \irqstat, [\base, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)] + moveq \irqnr, #IRQ_CIC_START - mov \irqnr, #0 -1001: tst \irqstat, #1 +1001: tst \irqstat, #15 bne 1002f + add \irqnr, \irqnr, #4 + movs \irqstat, \irqstat, lsr #4 + bne 1001b +1002: tst \irqstat, #1 + bne 1003f add \irqnr, \irqnr, #1 - mov \irqstat, \irqstat, lsr #1 - cmp \irqnr, #22 - bcc 1001b -1002: /* EQ will be set if we reach 22 */ + movs \irqstat, \irqstat, lsr #1 + bne 1002b +1003: /* EQ will be set if no irqs pending */ .endm .macro irq_prio_table diff -Nru a/arch/arm/kernel/pm.c b/arch/arm/kernel/pm.c --- a/arch/arm/kernel/pm.c Sun Oct 5 00:33:10 2003 +++ b/arch/arm/kernel/pm.c Sun Oct 5 00:33:10 2003 @@ -9,68 +9,18 @@ * sleep. */ #include +#include +#include #include -#include -#include #include #include -#include -#include - -/* - * Tell the linker that pm_do_suspend may not be present. - */ -extern int pm_do_suspend(void) __attribute__((weak)); - -int suspend(void) -{ - int ret; - - if (!pm_do_suspend) - return -ENOSYS; - - /* - * Suspend "legacy" devices. - */ - ret = pm_send_all(PM_SUSPEND, (void *)3); - if (ret != 0) - goto out; - - ret = device_suspend(3); - if (ret) - goto resume_legacy; - - local_irq_disable(); - leds_event(led_stop); - - sysdev_suspend(3); - - ret = pm_do_suspend(); - - sysdev_resume(); - - leds_event(led_start); - local_irq_enable(); - - device_resume(); - - resume_legacy: - pm_send_all(PM_RESUME, (void *)0); - - out: - return ret; -} - #ifdef CONFIG_SYSCTL /* * We really want this to die. It's a disgusting hack using unallocated * sysctl numbers. We should be using a real interface. */ -#include -#include - static int pm_sysctl_proc_handler(ctl_table *ctl, int write, struct file *filp, void *buffer, size_t *lenp) @@ -79,7 +29,7 @@ printk("PM: task %s (pid %d) uses deprecated sysctl PM interface\n", current->comm, current->pid); if (write) - ret = suspend(); + ret = pm_suspend(PM_SUSPEND_MEM); return ret; } diff -Nru a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c --- a/arch/arm/kernel/process.c Sun Oct 5 00:33:10 2003 +++ b/arch/arm/kernel/process.c Sun Oct 5 00:33:10 2003 @@ -117,12 +117,10 @@ void machine_halt(void) { - leds_event(led_halted); } void machine_power_off(void) { - leds_event(led_halted); if (pm_power_off) pm_power_off(); } diff -Nru a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c --- a/arch/arm/kernel/setup.c Sun Oct 5 00:33:08 2003 +++ b/arch/arm/kernel/setup.c Sun Oct 5 00:33:08 2003 @@ -182,7 +182,7 @@ "5", "5T", "5TE", - "?(8)", + "5TEJ", "?(9)", "?(10)", "?(11)", diff -Nru a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c --- a/arch/arm/kernel/signal.c Sun Oct 5 00:33:05 2003 +++ b/arch/arm/kernel/signal.c Sun Oct 5 00:33:05 2003 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -539,6 +540,11 @@ if (!user_mode(regs)) return 0; + if (current->flags & PF_FREEZE) { + refrigerator(0); + goto no_signal; + } + if (current->ptrace & PT_SINGLESTEP) ptrace_cancel_bpt(current); @@ -550,6 +556,7 @@ return 1; } + no_signal: /* * No signal to deliver to the process - restart the syscall. */ diff -Nru a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c --- a/arch/arm/kernel/time.c Sun Oct 5 00:33:09 2003 +++ b/arch/arm/kernel/time.c Sun Oct 5 00:33:09 2003 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -72,8 +73,6 @@ */ unsigned long long sched_clock(void) { - unsigned long long this_offset; - return (unsigned long long)jiffies * (1000000000 / HZ); } @@ -136,6 +135,47 @@ } void (*leds_event)(led_event_t) = dummy_leds_event; + +static int leds_suspend(struct sys_device *dev, u32 state) +{ + leds_event(led_stop); + return 0; +} + +static int leds_resume(struct sys_device *dev) +{ + leds_event(led_start); + return 0; +} + +static int leds_shutdown(struct sys_device *dev) +{ + leds_event(led_halted); + return 0; +} + +static struct sysdev_class leds_sysclass = { + set_kset_name("leds"), + .shutdown = leds_shutdown, + .suspend = leds_suspend, + .resume = leds_resume, +}; + +static struct sys_device leds_device = { + .id = 0, + .cls = &leds_sysclass, +}; + +static int __init leds_init(void) +{ + int ret; + ret = sysdev_class_register(&leds_sysclass); + if (ret == 0) + ret = sys_device_register(&leds_device); + return ret; +} + +device_initcall(leds_init); EXPORT_SYMBOL(leds_event); #endif diff -Nru a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c --- a/arch/arm/kernel/traps.c Sun Oct 5 00:33:08 2003 +++ b/arch/arm/kernel/traps.c Sun Oct 5 00:33:08 2003 @@ -212,10 +212,10 @@ printk("CPU: %d\n", smp_processor_id()); show_regs(regs); printk("Process %s (pid: %d, stack limit = 0x%p)\n", - current->comm, current->pid, tsk->thread_info + 1); + tsk->comm, tsk->pid, tsk->thread_info + 1); if (!user_mode(regs) || in_interrupt()) { - dump_mem("Stack: ", (unsigned long)(regs + 1), 8192+(unsigned long)tsk->thread_info); + dump_mem("Stack: ", regs->ARM_sp, 8192+(unsigned long)tsk->thread_info); dump_backtrace(regs, tsk); dump_instr(regs); } diff -Nru a/arch/arm/lib/io-readsl-armv4.S b/arch/arm/lib/io-readsl-armv4.S --- a/arch/arm/lib/io-readsl-armv4.S Sun Oct 5 00:33:09 2003 +++ b/arch/arm/lib/io-readsl-armv4.S Sun Oct 5 00:33:09 2003 @@ -9,7 +9,6 @@ */ #include #include -#include /* * Note that some reads can be aligned on half-word boundaries. @@ -31,6 +30,10 @@ blt 4f bgt 6f +#ifndef __ARMEB__ + + /* little endian code */ + strh ip, [r1], #2 mov ip, ip, lsr #16 3: subs r2, r2, #1 @@ -67,4 +70,49 @@ mov ip, ip, lsr #16 strb ip, [r1] mov pc, lr + +#else + + /* big endian code */ + + + mov r3, ip, lsr #16 + strh r3, [r1], #2 +3: mov r3, ip, lsl #16 + subs r2, r2, #1 + ldrne ip, [r0] + orrne r3, r3, ip, lsr #16 + strne r3, [r1], #4 + bne 3b + strh ip, [r1], #2 + mov pc, lr + +4: mov r3, ip, lsr #24 + strb r3, [r1], #1 + mov r3, ip, lsr #8 + strh r3, [r1], #2 +5: mov r3, ip, lsl #24 + subs r2, r2, #1 + ldrne ip, [r0] + orrne r3, r3, ip, lsr #8 + strne r3, [r1], #4 + bne 5b + strb ip, [r1], #1 + mov pc, lr + +6: mov r3, ip, lsr #24 + strb r3, [r1], #1 +7: mov r3, ip, lsl #8 + subs r2, r2, #1 + ldrne ip, [r0] + orrne r3, r3, ip, lsr #24 + strne r3, [r1], #4 + bne 7b + mov r3, ip, lsr #8 + strh r3, [r1], #2 + strb ip, [r1], #1 + mov pc, lr + +#endif + diff -Nru a/arch/arm/lib/io-readsw-armv4.S b/arch/arm/lib/io-readsw-armv4.S --- a/arch/arm/lib/io-readsw-armv4.S Sun Oct 5 00:33:08 2003 +++ b/arch/arm/lib/io-readsw-armv4.S Sun Oct 5 00:33:08 2003 @@ -9,7 +9,14 @@ */ #include #include -#include + + .macro pack, rd, hw1, hw2 +#ifndef __ARMEB__ + orr \rd, \hw1, \hw2, lsl #16 +#else + orr \rd, \hw2, \hw1, lsl #16 +#endif + .endm .insw_bad_alignment: adr r0, .insw_bad_align_msg @@ -41,19 +48,19 @@ .insw_8_lp: ldrh r3, [r0] ldrh r4, [r0] - orr r3, r3, r4, lsl #16 + pack r3, r3, r4 ldrh r4, [r0] ldrh r5, [r0] - orr r4, r4, r5, lsl #16 + pack r4, r4, r5 ldrh r5, [r0] ldrh ip, [r0] - orr r5, r5, ip, lsl #16 + pack r5, r5, ip ldrh ip, [r0] ldrh lr, [r0] - orr ip, ip, lr, lsl #16 + pack ip, ip, lr stmia r1!, {r3 - r5, ip} @@ -68,11 +75,11 @@ ldrh r3, [r0] ldrh r4, [r0] - orr r3, r3, r4, lsl #16 + pack r3, r3, r4 ldrh r4, [r0] ldrh ip, [r0] - orr r4, r4, ip, lsl #16 + pack r4, r4, ip stmia r1!, {r3, r4} @@ -81,7 +88,7 @@ ldrh r3, [r0] ldrh ip, [r0] - orr r3, r3, ip, lsl #16 + pack r3, r3, ip str r3, [r1], #4 diff -Nru a/arch/arm/lib/io-writesw-armv4.S b/arch/arm/lib/io-writesw-armv4.S --- a/arch/arm/lib/io-writesw-armv4.S Sun Oct 5 00:33:10 2003 +++ b/arch/arm/lib/io-writesw-armv4.S Sun Oct 5 00:33:10 2003 @@ -9,7 +9,18 @@ */ #include #include -#include + + .macro outword, rd +#ifndef __ARMEB__ + strh \rd, [r0] + mov \rd, \rd, lsr #16 + strh \rd, [r0] +#else + mov lr, \rd, lsr #16 + strh lr, [r0] + strh \rd, [r0] +#endif + .endm .outsw_bad_alignment: adr r0, .outsw_bad_align_msg @@ -40,20 +51,10 @@ bmi .no_outsw_8 .outsw_8_lp: ldmia r1!, {r3, r4, r5, ip} - - strh r3, [r0] - mov r3, r3, lsr #16 - strh r3, [r0] - strh r4, [r0] - mov r4, r4, lsr #16 - strh r4, [r0] - strh r5, [r0] - mov r5, r5, lsr #16 - strh r5, [r0] - strh ip, [r0] - mov ip, ip, lsr #16 - strh ip, [r0] - + outword r3 + outword r4 + outword r5 + outword ip subs r2, r2, #8 bpl .outsw_8_lp @@ -64,20 +65,14 @@ beq .no_outsw_4 ldmia r1!, {r3, ip} - strh r3, [r0] - mov r3, r3, lsr #16 - strh r3, [r0] - strh ip, [r0] - mov ip, ip, lsr #16 - strh ip, [r0] + outword r3 + outword ip .no_outsw_4: tst r2, #2 beq .no_outsw_2 ldr r3, [r1], #4 - strh r3, [r0] - mov r3, r3, lsr #16 - strh r3, [r0] + outword r3 .no_outsw_2: tst r2, #1 ldrneh r3, [r1] diff -Nru a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S --- a/arch/arm/lib/lib1funcs.S Sun Oct 5 00:33:06 2003 +++ b/arch/arm/lib/lib1funcs.S Sun Oct 5 00:33:06 2003 @@ -1,7 +1,12 @@ -@ libgcc1 routines for ARM cpu. -@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk) +/* + * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines + * + * Author: Nicolas Pitre + * - contributed to gcc-3.4 on Sep 30, 2003 + * - adapted for the Linux kernel on Oct 2, 2003 + */ -/* Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. +/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -10,11 +15,12 @@ In addition to the permissions in the GNU General Public License, the Free Software Foundation gives you unlimited permission to link the -compiled version of this file with other programs, and to distribute -those programs without any restriction coming from the use of this -file. (The General Public License restrictions do apply in other -respects; for example, they cover modification of the file, and -distribution when not linked into another program.) +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,286 +32,283 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. - */ -/* This code is derived from gcc 2.95.3 - * 29/07/01 Adapted for linux - * 27/03/03 Ian Molton Clean up CONFIG_CPU - */ #include #include -#include -#define RET mov -#define RETc(x) mov##x -#define RETCOND - -dividend .req r0 -divisor .req r1 -result .req r2 -overdone .req r2 -curbit .req r3 + +.macro ARM_DIV_BODY dividend, divisor, result, curbit + +#if __LINUX_ARM_ARCH__ >= 5 + + clz \curbit, \divisor + clz \result, \dividend + sub \result, \curbit, \result + mov \curbit, #1 + mov \divisor, \divisor, lsl \result + mov \curbit, \curbit, lsl \result + mov \result, #0 -ENTRY(__udivsi3) - cmp divisor, #0 - beq Ldiv0 - mov curbit, #1 - mov result, #0 - cmp dividend, divisor - bcc Lgot_result_udivsi3 -1: +#else + + @ Initially shift the divisor left 3 bits if possible, + @ set curbit accordingly. This allows for curbit to be located + @ at the left end of each 4 bit nibbles in the division loop + @ to save one loop in most cases. + tst \divisor, #0xe0000000 + moveq \divisor, \divisor, lsl #3 + moveq \curbit, #8 + movne \curbit, #1 + @ Unless the divisor is very big, shift it up in multiples of @ four bits, since this is the amount of unwinding in the main @ division loop. Continue shifting until the divisor is @ larger than the dividend. - cmp divisor, #0x10000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #4 - movcc curbit, curbit, lsl #4 - bcc 1b +1: cmp \divisor, #0x10000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #4 + movlo \curbit, \curbit, lsl #4 + blo 1b -2: @ For very big divisors, we must shift it a bit at a time, or @ we will be in danger of overflowing. - cmp divisor, #0x80000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #1 - movcc curbit, curbit, lsl #1 - bcc 2b - -3: - @ Test for possible subtractions, and note which bits - @ are done in the result. On the final pass, this may subtract - @ too much from the dividend, but the result will be ok, since the - @ "bit" will have been shifted out at the bottom. - cmp dividend, divisor - subcs dividend, dividend, divisor - orrcs result, result, curbit - cmp dividend, divisor, lsr #1 - subcs dividend, dividend, divisor, lsr #1 - orrcs result, result, curbit, lsr #1 - cmp dividend, divisor, lsr #2 - subcs dividend, dividend, divisor, lsr #2 - orrcs result, result, curbit, lsr #2 - cmp dividend, divisor, lsr #3 - subcs dividend, dividend, divisor, lsr #3 - orrcs result, result, curbit, lsr #3 - cmp dividend, #0 @ Early termination? - movnes curbit, curbit, lsr #4 @ No, any more bits to do? - movne divisor, divisor, lsr #4 - bne 3b -Lgot_result_udivsi3: - mov r0, result - RET pc, lr +1: cmp \divisor, #0x80000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #1 + movlo \curbit, \curbit, lsl #1 + blo 1b -Ldiv0: - str lr, [sp, #-4]! - bl __div0 - mov r0, #0 @ about as wrong as it could be - ldmia sp!, {pc}RETCOND + mov \result, #0 -/* __umodsi3 ----------------------- */ +#endif + + @ Division loop +1: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + orrhs \result, \result, \curbit + cmp \dividend, \divisor, lsr #1 + subhs \dividend, \dividend, \divisor, lsr #1 + orrhs \result, \result, \curbit, lsr #1 + cmp \dividend, \divisor, lsr #2 + subhs \dividend, \dividend, \divisor, lsr #2 + orrhs \result, \result, \curbit, lsr #2 + cmp \dividend, \divisor, lsr #3 + subhs \dividend, \dividend, \divisor, lsr #3 + orrhs \result, \result, \curbit, lsr #3 + cmp \dividend, #0 @ Early termination? + movnes \curbit, \curbit, lsr #4 @ No, any more bits to do? + movne \divisor, \divisor, lsr #4 + bne 1b + +.endm + + +.macro ARM_DIV2_ORDER divisor, order + +#if __LINUX_ARM_ARCH__ >= 5 + + clz \order, \divisor + rsb \order, \order, #31 + +#else + + cmp \divisor, #(1 << 16) + movhs \divisor, \divisor, lsr #16 + movhs \order, #16 + movlo \order, #0 + + cmp \divisor, #(1 << 8) + movhs \divisor, \divisor, lsr #8 + addhs \order, \order, #8 + + cmp \divisor, #(1 << 4) + movhs \divisor, \divisor, lsr #4 + addhs \order, \order, #4 + + cmp \divisor, #(1 << 2) + addhi \order, \order, #3 + addls \order, \order, \divisor, lsr #1 + +#endif + +.endm + + +.macro ARM_MOD_BODY dividend, divisor, order, spare + +#if __LINUX_ARM_ARCH__ >= 5 + + clz \order, \divisor + clz \spare, \dividend + sub \order, \order, \spare + mov \divisor, \divisor, lsl \order + +#else + + mov \order, #0 -ENTRY(__umodsi3) - cmp divisor, #0 - beq Ldiv0 - mov curbit, #1 - cmp dividend, divisor - RETc(cc) pc, lr -1: @ Unless the divisor is very big, shift it up in multiples of @ four bits, since this is the amount of unwinding in the main @ division loop. Continue shifting until the divisor is @ larger than the dividend. - cmp divisor, #0x10000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #4 - movcc curbit, curbit, lsl #4 - bcc 1b +1: cmp \divisor, #0x10000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #4 + addlo \order, \order, #4 + blo 1b -2: @ For very big divisors, we must shift it a bit at a time, or @ we will be in danger of overflowing. - cmp divisor, #0x80000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #1 - movcc curbit, curbit, lsl #1 - bcc 2b - -3: - @ Test for possible subtractions. On the final pass, this may - @ subtract too much from the dividend, so keep track of which - @ subtractions are done, we can fix them up afterwards... - mov overdone, #0 - cmp dividend, divisor - subcs dividend, dividend, divisor - cmp dividend, divisor, lsr #1 - subcs dividend, dividend, divisor, lsr #1 - orrcs overdone, overdone, curbit, ror #1 - cmp dividend, divisor, lsr #2 - subcs dividend, dividend, divisor, lsr #2 - orrcs overdone, overdone, curbit, ror #2 - cmp dividend, divisor, lsr #3 - subcs dividend, dividend, divisor, lsr #3 - orrcs overdone, overdone, curbit, ror #3 - mov ip, curbit - cmp dividend, #0 @ Early termination? - movnes curbit, curbit, lsr #4 @ No, any more bits to do? - movne divisor, divisor, lsr #4 - bne 3b - - @ Any subtractions that we should not have done will be recorded in - @ the top three bits of "overdone". Exactly which were not needed - @ are governed by the position of the bit, stored in ip. - @ If we terminated early, because dividend became zero, - @ then none of the below will match, since the bit in ip will not be - @ in the bottom nibble. - ands overdone, overdone, #0xe0000000 - RETc(eq) pc, lr @ No fixups needed - tst overdone, ip, ror #3 - addne dividend, dividend, divisor, lsr #3 - tst overdone, ip, ror #2 - addne dividend, dividend, divisor, lsr #2 - tst overdone, ip, ror #1 - addne dividend, dividend, divisor, lsr #1 - RET pc, lr +1: cmp \divisor, #0x80000000 + cmplo \divisor, \dividend + movlo \divisor, \divisor, lsl #1 + addlo \order, \order, #1 + blo 1b + +#endif + + @ Perform all needed substractions to keep only the reminder. + @ Do comparisons in batch of 4 first. + subs \order, \order, #3 @ yes, 3 is intended here + blt 2f + +1: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + cmp \dividend, \divisor, lsr #1 + subhs \dividend, \dividend, \divisor, lsr #1 + cmp \dividend, \divisor, lsr #2 + subhs \dividend, \dividend, \divisor, lsr #2 + cmp \dividend, \divisor, lsr #3 + subhs \dividend, \dividend, \divisor, lsr #3 + cmp \dividend, #1 + mov \divisor, \divisor, lsr #4 + subges \order, \order, #4 + bge 1b + + tst \order, #3 + teqne \dividend, #0 + beq 5f + + @ Either 1, 2 or 3 comparison/substractions are left. +2: cmn \order, #2 + blt 4f + beq 3f + cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + mov \divisor, \divisor, lsr #1 +3: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor + mov \divisor, \divisor, lsr #1 +4: cmp \dividend, \divisor + subhs \dividend, \dividend, \divisor +5: +.endm + + +ENTRY(__udivsi3) + + subs r2, r1, #1 + moveq pc, lr + bcc Ldiv0 + cmp r0, r1 + bls 11f + tst r1, r2 + beq 12f + + ARM_DIV_BODY r0, r1, r2, r3 + + mov r0, r2 + mov pc, lr + +11: moveq r0, #1 + movne r0, #0 + mov pc, lr + +12: ARM_DIV2_ORDER r1, r2 + + mov r0, r0, lsr r2 + mov pc, lr + + +ENTRY(__umodsi3) + + subs r2, r1, #1 @ compare divisor with 1 + bcc Ldiv0 + cmpne r0, r1 @ compare dividend with divisor + moveq r0, #0 + tsthi r1, r2 @ see if divisor is power of 2 + andeq r0, r0, r2 + movls pc, lr + + ARM_MOD_BODY r0, r1, r2, r3 + + mov pc, lr + ENTRY(__divsi3) - eor ip, dividend, divisor @ Save the sign of the result. - mov curbit, #1 - mov result, #0 - cmp divisor, #0 - rsbmi divisor, divisor, #0 @ Loops below use unsigned. + + cmp r1, #0 + eor ip, r0, r1 @ save the sign of the result. beq Ldiv0 - cmp dividend, #0 - rsbmi dividend, dividend, #0 - cmp dividend, divisor - bcc Lgot_result_divsi3 + rsbmi r1, r1, #0 @ loops below use unsigned. + subs r2, r1, #1 @ division by 1 or -1 ? + beq 10f + movs r3, r0 + rsbmi r3, r0, #0 @ positive dividend value + cmp r3, r1 + bls 11f + tst r1, r2 @ divisor is power of 2 ? + beq 12f -1: - @ Unless the divisor is very big, shift it up in multiples of - @ four bits, since this is the amount of unwinding in the main - @ division loop. Continue shifting until the divisor is - @ larger than the dividend. - cmp divisor, #0x10000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #4 - movcc curbit, curbit, lsl #4 - bcc 1b + ARM_DIV_BODY r3, r1, r0, r2 -2: - @ For very big divisors, we must shift it a bit at a time, or - @ we will be in danger of overflowing. - cmp divisor, #0x80000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #1 - movcc curbit, curbit, lsl #1 - bcc 2b - -3: - @ Test for possible subtractions, and note which bits - @ are done in the result. On the final pass, this may subtract - @ too much from the dividend, but the result will be ok, since the - @ "bit" will have been shifted out at the bottom. - cmp dividend, divisor - subcs dividend, dividend, divisor - orrcs result, result, curbit - cmp dividend, divisor, lsr #1 - subcs dividend, dividend, divisor, lsr #1 - orrcs result, result, curbit, lsr #1 - cmp dividend, divisor, lsr #2 - subcs dividend, dividend, divisor, lsr #2 - orrcs result, result, curbit, lsr #2 - cmp dividend, divisor, lsr #3 - subcs dividend, dividend, divisor, lsr #3 - orrcs result, result, curbit, lsr #3 - cmp dividend, #0 @ Early termination? - movnes curbit, curbit, lsr #4 @ No, any more bits to do? - movne divisor, divisor, lsr #4 - bne 3b -Lgot_result_divsi3: - mov r0, result cmp ip, #0 rsbmi r0, r0, #0 - RET pc, lr + mov pc, lr + +10: teq ip, r0 @ same sign ? + rsbmi r0, r0, #0 + mov pc, lr + +11: movlo r0, #0 + moveq r0, ip, asr #31 + orreq r0, r0, #1 + mov pc, lr + +12: ARM_DIV2_ORDER r1, r2 + + cmp ip, #0 + mov r0, r3, lsr r2 + rsbmi r0, r0, #0 + mov pc, lr + ENTRY(__modsi3) - mov curbit, #1 - cmp divisor, #0 - rsbmi divisor, divisor, #0 @ Loops below use unsigned. + + cmp r1, #0 beq Ldiv0 - @ Need to save the sign of the dividend, unfortunately, we need - @ ip later on; this is faster than pushing lr and using that. - str dividend, [sp, #-4]! - cmp dividend, #0 - rsbmi dividend, dividend, #0 - cmp dividend, divisor - bcc Lgot_result_modsi3 + rsbmi r1, r1, #0 @ loops below use unsigned. + movs ip, r0 @ preserve sign of dividend + rsbmi r0, r0, #0 @ if negative make positive + subs r2, r1, #1 @ compare divisor with 1 + cmpne r0, r1 @ compare dividend with divisor + moveq r0, #0 + tsthi r1, r2 @ see if divisor is power of 2 + andeq r0, r0, r2 + bls 10f + + ARM_MOD_BODY r0, r1, r2, r3 + +10: cmp ip, #0 + rsbmi r0, r0, #0 + mov pc, lr + + +Ldiv0: + + str lr, [sp, #-4]! + bl __div0 + mov r0, #0 @ About as wrong as it could be. + ldr pc, [sp], #4 -1: - @ Unless the divisor is very big, shift it up in multiples of - @ four bits, since this is the amount of unwinding in the main - @ division loop. Continue shifting until the divisor is - @ larger than the dividend. - cmp divisor, #0x10000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #4 - movcc curbit, curbit, lsl #4 - bcc 1b -2: - @ For very big divisors, we must shift it a bit at a time, or - @ we will be in danger of overflowing. - cmp divisor, #0x80000000 - cmpcc divisor, dividend - movcc divisor, divisor, lsl #1 - movcc curbit, curbit, lsl #1 - bcc 2b - -3: - @ Test for possible subtractions. On the final pass, this may - @ subtract too much from the dividend, so keep track of which - @ subtractions are done, we can fix them up afterwards... - mov overdone, #0 - cmp dividend, divisor - subcs dividend, dividend, divisor - cmp dividend, divisor, lsr #1 - subcs dividend, dividend, divisor, lsr #1 - orrcs overdone, overdone, curbit, ror #1 - cmp dividend, divisor, lsr #2 - subcs dividend, dividend, divisor, lsr #2 - orrcs overdone, overdone, curbit, ror #2 - cmp dividend, divisor, lsr #3 - subcs dividend, dividend, divisor, lsr #3 - orrcs overdone, overdone, curbit, ror #3 - mov ip, curbit - cmp dividend, #0 @ Early termination? - movnes curbit, curbit, lsr #4 @ No, any more bits to do? - movne divisor, divisor, lsr #4 - bne 3b - - @ Any subtractions that we should not have done will be recorded in - @ the top three bits of "overdone". Exactly which were not needed - @ are governed by the position of the bit, stored in ip. - @ If we terminated early, because dividend became zero, - @ then none of the below will match, since the bit in ip will not be - @ in the bottom nibble. - ands overdone, overdone, #0xe0000000 - beq Lgot_result_modsi3 - tst overdone, ip, ror #3 - addne dividend, dividend, divisor, lsr #3 - tst overdone, ip, ror #2 - addne dividend, dividend, divisor, lsr #2 - tst overdone, ip, ror #1 - addne dividend, dividend, divisor, lsr #1 -Lgot_result_modsi3: - ldr ip, [sp], #4 - cmp ip, #0 - rsbmi dividend, dividend, #0 - RET pc, lr diff -Nru a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig --- a/arch/arm/mach-integrator/Kconfig Sun Oct 5 00:33:09 2003 +++ b/arch/arm/mach-integrator/Kconfig Sun Oct 5 00:33:09 2003 @@ -1,8 +1,15 @@ menu "Integrator Options" depends on ARCH_INTEGRATOR +config ARCH_INTEGRATOR_AP + bool "Support Integrator/AP and Integrator/PP2 platforms" + help + Include support for the ARM(R) Integrator/AP and + Integrator/PP2 platforms. + config INTEGRATOR_IMPD1 tristate "Include support for Integrator/IM-PD1" + depends on ARCH_INTEGRATOR_AP help The IM-PD1 is an add-on logic module for the Integrator which allows ARM(R) Ltd PrimeCells to be developed and evaluated. diff -Nru a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile --- a/arch/arm/mach-integrator/Makefile Sun Oct 5 00:33:10 2003 +++ b/arch/arm/mach-integrator/Makefile Sun Oct 5 00:33:10 2003 @@ -4,9 +4,10 @@ # Object file lists. -obj-y := core.o lm.o time.o +obj-y := core.o lm.o time.o +obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o -obj-$(CONFIG_LEDS) += leds.o -obj-$(CONFIG_PCI) += pci_v3.o pci.o +obj-$(CONFIG_LEDS) += leds.o +obj-$(CONFIG_PCI) += pci_v3.o pci.o obj-$(CONFIG_CPU_FREQ_INTEGRATOR) += cpu.o obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o diff -Nru a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c --- a/arch/arm/mach-integrator/core.c Sun Oct 5 00:33:09 2003 +++ b/arch/arm/mach-integrator/core.c Sun Oct 5 00:33:09 2003 @@ -1,134 +1,59 @@ /* - * linux/arch/arm/mach-integrator/arch.c + * linux/arch/arm/mach-integrator/core.c * - * Copyright (C) 2000 Deep Blue Solutions Ltd + * Copyright (C) 2000-2003 Deep Blue Solutions 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. - * - * 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 + * it under the terms of the GNU General Public License version 2, as + * published by the Free Software Foundation. */ #include #include #include -#include #include -#include -#include #include -#include #include -#include -#include #include -#include - -#include -#include -#include -#include - -/* - * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx - * is the (PA >> 12). - * - * Setup a VA for the Integrator interrupt controller (for header #0, - * just for now). - */ -#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) -#define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) -#define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_IC_OFFSET - -/* - * Logical Physical - * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) - * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) - * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) - * ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) - * ef000000 Cache flush - * f1000000 10000000 Core module registers - * f1100000 11000000 System controller registers - * f1200000 12000000 EBI registers - * f1300000 13000000 Counter/Timer - * f1400000 14000000 Interrupt controller - * f1500000 15000000 RTC - * f1600000 16000000 UART 0 - * f1700000 17000000 UART 1 - * f1a00000 1a000000 Debug LEDs - * f1b00000 1b000000 GPIO - */ - -static struct map_desc integrator_io_desc[] __initdata = { - { IO_ADDRESS(INTEGRATOR_HDR_BASE), INTEGRATOR_HDR_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_SC_BASE), INTEGRATOR_SC_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_RTC_BASE), INTEGRATOR_RTC_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, - { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE }, - { PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M, MT_DEVICE }, - { PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M, MT_DEVICE }, - { PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_64K, MT_DEVICE }, - { PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K, MT_DEVICE } +static struct amba_device rtc_device = { + .dev = { + .bus_id = "mb:15", + }, + .res = { + .start = INTEGRATOR_RTC_BASE, + .end = INTEGRATOR_RTC_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = IRQ_RTCINT, + .periphid = 0x00041030, }; -static void __init integrator_map_io(void) -{ - iotable_init(integrator_io_desc, ARRAY_SIZE(integrator_io_desc)); -} - -#define ALLPCI ( (1 << IRQ_PCIINT0) | (1 << IRQ_PCIINT1) | (1 << IRQ_PCIINT2) | (1 << IRQ_PCIINT3) ) - -static void sc_mask_irq(unsigned int irq) -{ - writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); -} - -static void sc_unmask_irq(unsigned int irq) -{ - writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET); -} - -static struct irqchip sc_chip = { - .ack = sc_mask_irq, - .mask = sc_mask_irq, - .unmask = sc_unmask_irq, +static struct amba_device uart0_device = { + .dev = { + .bus_id = "mb:16", + }, + .res = { + .start = INTEGRATOR_UART0_BASE, + .end = INTEGRATOR_UART0_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = IRQ_UARTINT0, + .periphid = 0x0041010, }; -static void __init integrator_init_irq(void) -{ - unsigned int i; - - /* Disable all interrupts initially. */ - /* Do the core module ones */ - writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); - - /* do the header card stuff next */ - writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); - writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); - - for (i = 0; i < NR_IRQS; i++) { - if (((1 << i) && INTEGRATOR_SC_VALID_INT) != 0) { - set_irq_chip(i, &sc_chip); - set_irq_handler(i, do_level_IRQ); - set_irq_flags(i, IRQF_VALID | IRQF_PROBE); - } - } -} +static struct amba_device uart1_device = { + .dev = { + .bus_id = "mb:17", + }, + .res = { + .start = INTEGRATOR_UART1_BASE, + .end = INTEGRATOR_UART1_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = IRQ_UARTINT1, + .periphid = 0x0041010, +}; static struct amba_device kmi0_device = { .dev = { @@ -136,7 +61,7 @@ }, .res = { .start = KMI0_BASE, - .end = KMI0_BASE + KMI_SIZE - 1, + .end = KMI0_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, }, .irq = IRQ_KMIINT0, @@ -149,7 +74,7 @@ }, .res = { .start = KMI1_BASE, - .end = KMI1_BASE + KMI_SIZE - 1, + .end = KMI1_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, }, .irq = IRQ_KMIINT1, @@ -157,52 +82,23 @@ }; static struct amba_device *amba_devs[] __initdata = { + &rtc_device, + &uart0_device, + &uart1_device, &kmi0_device, &kmi1_device, }; -static int __init register_devices(void) +static int __init integrator_init(void) { - unsigned long sc_dec; int i; for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; - amba_device_register(d, &iomem_resource); } - sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); - for (i = 0; i < 4; i++) { - struct lm_device *lmdev; - - if ((sc_dec & (16 << i)) == 0) - continue; - - lmdev = kmalloc(sizeof(struct lm_device), GFP_KERNEL); - if (!lmdev) - continue; - - memset(lmdev, 0, sizeof(struct lm_device)); - - lmdev->resource.start = 0xc0000000 + 0x10000000 * i; - lmdev->resource.end = lmdev->resource.start + 0x0fffffff; - lmdev->resource.flags = IORESOURCE_MEM; - lmdev->irq = IRQ_EXPINT0 + i; - lmdev->id = i; - - lm_device_register(lmdev); - } - return 0; } -arch_initcall(register_devices); - -MACHINE_START(INTEGRATOR, "ARM-Integrator") - MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") - BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) - BOOT_PARAMS(0x00000100) - MAPIO(integrator_map_io) - INITIRQ(integrator_init_irq) -MACHINE_END +arch_initcall(integrator_init); diff -Nru a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/arm/mach-integrator/integrator_ap.c Sun Oct 5 00:33:10 2003 @@ -0,0 +1,294 @@ +/* + * linux/arch/arm/mach-integrator/integrator_ap.c + * + * Copyright (C) 2000-2003 Deep Blue Solutions 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. + * + * 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 +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + + +/* + * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx + * is the (PA >> 12). + * + * Setup a VA for the Integrator interrupt controller (for header #0, + * just for now). + */ +#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) +#define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) +#define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) +#define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_IC_OFFSET + +/* + * Logical Physical + * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) + * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) + * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) + * ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) + * ef000000 Cache flush + * f1000000 10000000 Core module registers + * f1100000 11000000 System controller registers + * f1200000 12000000 EBI registers + * f1300000 13000000 Counter/Timer + * f1400000 14000000 Interrupt controller + * f1500000 15000000 RTC + * f1600000 16000000 UART 0 + * f1700000 17000000 UART 1 + * f1a00000 1a000000 Debug LEDs + * f1b00000 1b000000 GPIO + */ + +static struct map_desc ap_io_desc[] __initdata = { + { IO_ADDRESS(INTEGRATOR_HDR_BASE), INTEGRATOR_HDR_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_SC_BASE), INTEGRATOR_SC_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_EBI_BASE), INTEGRATOR_EBI_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_CT_BASE), INTEGRATOR_CT_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_IC_BASE), INTEGRATOR_IC_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_RTC_BASE), INTEGRATOR_RTC_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_UART0_BASE), INTEGRATOR_UART0_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_UART1_BASE), INTEGRATOR_UART1_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_DBG_BASE), INTEGRATOR_DBG_BASE, SZ_4K, MT_DEVICE }, + { IO_ADDRESS(INTEGRATOR_GPIO_BASE), INTEGRATOR_GPIO_BASE, SZ_4K, MT_DEVICE }, + { PCI_MEMORY_VADDR, PHYS_PCI_MEM_BASE, SZ_16M, MT_DEVICE }, + { PCI_CONFIG_VADDR, PHYS_PCI_CONFIG_BASE, SZ_16M, MT_DEVICE }, + { PCI_V3_VADDR, PHYS_PCI_V3_BASE, SZ_64K, MT_DEVICE }, + { PCI_IO_VADDR, PHYS_PCI_IO_BASE, SZ_64K, MT_DEVICE } +}; + +static void __init ap_map_io(void) +{ + iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); +} + +#define INTEGRATOR_SC_VALID_INT 0x003fffff + +static void sc_mask_irq(unsigned int irq) +{ + writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); +} + +static void sc_unmask_irq(unsigned int irq) +{ + writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET); +} + +static struct irqchip sc_chip = { + .ack = sc_mask_irq, + .mask = sc_mask_irq, + .unmask = sc_unmask_irq, +}; + +static void __init ap_init_irq(void) +{ + unsigned int i; + + /* Disable all interrupts initially. */ + /* Do the core module ones */ + writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); + + /* do the header card stuff next */ + writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); + writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); + + for (i = 0; i < NR_IRQS; i++) { + if (((1 << i) && INTEGRATOR_SC_VALID_INT) != 0) { + set_irq_chip(i, &sc_chip); + set_irq_handler(i, do_level_IRQ); + set_irq_flags(i, IRQF_VALID | IRQF_PROBE); + } + } +} + +#ifdef CONFIG_PM +static unsigned long ic_irq_enable; + +static int irq_suspend(struct sys_device *dev, u32 state) +{ + ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE); + return 0; +} + +static int irq_resume(struct sys_device *dev) +{ + /* disable all irq sources */ + writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); + writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); + writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); + + writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET); + return 0; +} +#else +#define irq_suspend NULL +#define irq_resume NULL +#endif + +static struct sysdev_class irq_class = { + set_kset_name("irq"), + .suspend = irq_suspend, + .resume = irq_resume, +}; + +static struct sys_device irq_device = { + .id = 0, + .cls = &irq_class, +}; + +static int __init irq_init_sysfs(void) +{ + int ret = sysdev_class_register(&irq_class); + if (ret == 0) + ret = sys_device_register(&irq_device); + return ret; +} + +device_initcall(irq_init_sysfs); + +/* + * Flash handling. + */ +#define SC_CTRLC (VA_SC_BASE + INTEGRATOR_SC_CTRLC_OFFSET) +#define SC_CTRLS (VA_SC_BASE + INTEGRATOR_SC_CTRLS_OFFSET) +#define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET) +#define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET) + +static int ap_flash_init(void) +{ + u32 tmp; + + writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC); + + tmp = readl(EBI_CSR1) | INTEGRATOR_EBI_WRITE_ENABLE; + writel(tmp, EBI_CSR1); + + if (!(readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE)) { + writel(0xa05f, EBI_LOCK); + writel(tmp, EBI_CSR1); + writel(0, EBI_LOCK); + } + return 0; +} + +static void ap_flash_exit(void) +{ + u32 tmp; + + writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC); + + tmp = readl(EBI_CSR1) & ~INTEGRATOR_EBI_WRITE_ENABLE; + writel(tmp, EBI_CSR1); + + if (readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE) { + writel(0xa05f, EBI_LOCK); + writel(tmp, EBI_CSR1); + writel(0, EBI_LOCK); + } +} + +static void ap_flash_set_vpp(int on) +{ + unsigned long reg = on ? SC_CTRLS : SC_CTRLC; + + writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg); +} + +static struct flash_platform_data ap_flash_data = { + .map_name = "cfi_probe", + .width = 4, + .init = ap_flash_init, + .exit = ap_flash_exit, + .set_vpp = ap_flash_set_vpp, +}; + +static struct resource cfi_flash_resource = { + .start = INTEGRATOR_FLASH_BASE, + .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device cfi_flash_device = { + .name = "armflash", + .id = 0, + .dev = { + .platform_data = &ap_flash_data, + }, + .num_resources = 1, + .resource = &cfi_flash_resource, +}; + +static int __init ap_init(void) +{ + unsigned long sc_dec; + int i; + + platform_add_device(&cfi_flash_device); + + sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); + for (i = 0; i < 4; i++) { + struct lm_device *lmdev; + + if ((sc_dec & (16 << i)) == 0) + continue; + + lmdev = kmalloc(sizeof(struct lm_device), GFP_KERNEL); + if (!lmdev) + continue; + + memset(lmdev, 0, sizeof(struct lm_device)); + + lmdev->resource.start = 0xc0000000 + 0x10000000 * i; + lmdev->resource.end = lmdev->resource.start + 0x0fffffff; + lmdev->resource.flags = IORESOURCE_MEM; + lmdev->irq = IRQ_AP_EXPINT0 + i; + lmdev->id = i; + + lm_device_register(lmdev); + } + + return 0; +} + +arch_initcall(ap_init); + +MACHINE_START(INTEGRATOR, "ARM-Integrator") + MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") + BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) + BOOT_PARAMS(0x00000100) + MAPIO(ap_map_io) + INITIRQ(ap_init_irq) +MACHINE_END diff -Nru a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c --- a/arch/arm/mach-integrator/pci.c Sun Oct 5 00:33:10 2003 +++ b/arch/arm/mach-integrator/pci.c Sun Oct 5 00:33:10 2003 @@ -96,7 +96,7 @@ } static int irq_tab[4] __initdata = { - IRQ_PCIINT0, IRQ_PCIINT1, IRQ_PCIINT2, IRQ_PCIINT3 + IRQ_AP_PCIINT0, IRQ_AP_PCIINT1, IRQ_AP_PCIINT2, IRQ_AP_PCIINT3 }; /* diff -Nru a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c --- a/arch/arm/mach-integrator/pci_v3.c Sun Oct 5 00:33:09 2003 +++ b/arch/arm/mach-integrator/pci_v3.c Sun Oct 5 00:33:09 2003 @@ -575,7 +575,7 @@ /* * Grab the PCI error interrupt. */ - ret = request_irq(IRQ_V3INT, v3_irq, 0, "V3", NULL); + ret = request_irq(IRQ_AP_V3INT, v3_irq, 0, "V3", NULL); if (ret) printk(KERN_ERR "PCI: unable to grab PCI error " "interrupt: %d\n", ret); @@ -596,7 +596,7 @@ v3_writeb(V3_LB_IMASK, 0x68); #if 0 - ret = request_irq(IRQ_LBUSTIMEOUT, lb_timeout, 0, "bus timeout", NULL); + ret = request_irq(IRQ_AP_LBUSTIMEOUT, lb_timeout, 0, "bus timeout", NULL); if (ret) printk(KERN_ERR "PCI: unable to grab local bus timeout " "interrupt: %d\n", ret); diff -Nru a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c --- a/arch/arm/mach-pxa/irq.c Sun Oct 5 00:33:10 2003 +++ b/arch/arm/mach-pxa/irq.c Sun Oct 5 00:33:10 2003 @@ -58,7 +58,19 @@ { int gpio, idx; - gpio = irq - ((irq >= IRQ_GPIO(2)) ? IRQ_GPIO(2) + 2 : IRQ_GPIO(0)); + gpio = IRQ_TO_GPIO(irq); + idx = gpio >> 5; + + if (type == IRQT_PROBE) { + /* Don't mess with enabled GPIOs using preconfigured edges or + GPIOs set to alternate function during probe */ + if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx]) & + GPIO_bit(gpio)) + return 0; + if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2))) + return 0; + type = __IRQT_RISEDGE | __IRQT_FALEDGE; + } printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); @@ -78,10 +90,8 @@ printk("edges\n"); - idx = gpio >> 5; GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx]; GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx]; - return 0; } diff -Nru a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c --- a/arch/arm/mach-pxa/leds.c Sun Oct 5 00:33:10 2003 +++ b/arch/arm/mach-pxa/leds.c Sun Oct 5 00:33:10 2003 @@ -7,6 +7,7 @@ * * Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc. */ +#include #include #include diff -Nru a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c --- a/arch/arm/mach-pxa/lubbock.c Sun Oct 5 00:33:08 2003 +++ b/arch/arm/mach-pxa/lubbock.c Sun Oct 5 00:33:08 2003 @@ -78,7 +78,7 @@ pxa_init_irq(); /* setup extra lubbock irqs */ - for (irq = LUBBOCK_IRQ(0); irq <= LUBBOCK_IRQ(5); irq++) { + for (irq = LUBBOCK_IRQ(0); irq <= LUBBOCK_LAST_IRQ; irq++) { set_irq_chip(irq, &lubbock_irq_chip); set_irq_handler(irq, do_level_IRQ); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); @@ -124,6 +124,7 @@ { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE }, /* CPLD */ { 0xf1000000, 0x0c000000, 0x00100000, MT_DEVICE }, /* LAN91C96 IO */ { 0xf1100000, 0x0e000000, 0x00100000, MT_DEVICE }, /* LAN91C96 Attr */ + { 0xf4000000, 0x10000000, 0x00800000, MT_DEVICE }, /* SA1111 */ }; static void __init lubbock_map_io(void) diff -Nru a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c --- a/arch/arm/mach-pxa/pm.c Sun Oct 5 00:33:08 2003 +++ b/arch/arm/mach-pxa/pm.c Sun Oct 5 00:33:08 2003 @@ -11,13 +11,14 @@ * modify it under the terms of the GNU General Public License. */ #include +#include +#include #include #include #include #include #include -#include /* @@ -60,13 +61,16 @@ }; -int pm_do_suspend(void) +static int pxa_pm_enter(u32 state) { unsigned long sleep_save[SLEEP_SAVE_SIZE]; unsigned long checksum = 0; unsigned long delta; int i; + if (state != PM_SUSPEND_MEM) + return -EINVAL; + /* preserve current time */ delta = xtime.tv_sec - RCNR; @@ -194,3 +198,37 @@ { return virt_to_phys(sp); } + +/* + * Called after processes are frozen, but before we shut down devices. + */ +static int pxa_pm_prepare(u32 state) +{ + return 0; +} + +/* + * Called after devices are re-setup, but before processes are thawed. + */ +static int pxa_pm_finish(u32 state) +{ + return 0; +} + +/* + * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk. + */ +static struct pm_ops pxa_pm_ops = { + .pm_disk_mode = PM_DISK_FIRMWARE, + .prepare = pxa_pm_prepare, + .enter = pxa_pm_enter, + .finish = pxa_pm_finish, +}; + +static int __init pxa_pm_init(void) +{ + pm_set_ops(&pxa_pm_ops); + return 0; +} + +late_initcall(pxa_pm_init); diff -Nru a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c --- a/arch/arm/mach-sa1100/leds.c Sun Oct 5 00:33:07 2003 +++ b/arch/arm/mach-sa1100/leds.c Sun Oct 5 00:33:07 2003 @@ -5,6 +5,7 @@ * * Copyright (C) 2001 Nicolas Pitre */ +#include #include #include diff -Nru a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c --- a/arch/arm/mach-sa1100/pm.c Sun Oct 5 00:33:07 2003 +++ b/arch/arm/mach-sa1100/pm.c Sun Oct 5 00:33:07 2003 @@ -22,6 +22,8 @@ * 2002-05-27: Nicolas Pitre Killed sleep.h and the kmalloced save array. * Storage is local on the stack now. */ +#include +#include #include #include @@ -54,11 +56,14 @@ }; -int pm_do_suspend(void) +static int sa11x0_pm_enter(u32 state) { unsigned long sleep_save[SLEEP_SAVE_SIZE]; unsigned long delta, gpio; + if (state != PM_SUSPEND_MEM) + return -EINVAL; + /* preserve current time */ delta = xtime.tv_sec - RCNR; gpio = GPLR; @@ -139,3 +144,37 @@ { return virt_to_phys(sp); } + +/* + * Called after processes are frozen, but before we shut down devices. + */ +static int sa11x0_pm_prepare(u32 state) +{ + return 0; +} + +/* + * Called after devices are re-setup, but before processes are thawed. + */ +static int sa11x0_pm_finish(u32 state) +{ + return 0; +} + +/* + * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk. + */ +static struct pm_ops sa11x0_pm_ops = { + .pm_disk_mode = PM_DISK_FIRMWARE, + .prepare = sa11x0_pm_prepare, + .enter = sa11x0_pm_enter, + .finish = sa11x0_pm_finish, +}; + +static int __init sa11x0_pm_init(void) +{ + pm_set_ops(&sa11x0_pm_ops); + return 0; +} + +late_initcall(sa11x0_pm_init); diff -Nru a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c --- a/arch/arm/mm/ioremap.c Sun Oct 5 00:33:09 2003 +++ b/arch/arm/mm/ioremap.c Sun Oct 5 00:33:09 2003 @@ -150,7 +150,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vfree(addr); return NULL; } diff -Nru a/arch/cris/mm/ioremap.c b/arch/cris/mm/ioremap.c --- a/arch/cris/mm/ioremap.c Sun Oct 5 00:33:06 2003 +++ b/arch/cris/mm/ioremap.c Sun Oct 5 00:33:06 2003 @@ -157,7 +157,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vfree(addr); return NULL; } diff -Nru a/arch/h8300/README b/arch/h8300/README --- a/arch/h8300/README Sun Oct 5 00:33:09 2003 +++ b/arch/h8300/README Sun Oct 5 00:33:09 2003 @@ -16,7 +16,7 @@ 3.H8MAX Under development - see http://www.strawbelly-linux.com (Japanese Only) + see http://www.strawberry-linux.com (Japanese Only) * Toolchain Version gcc-3.1 or higher and patch diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig Sun Oct 5 00:33:06 2003 +++ b/arch/i386/Kconfig Sun Oct 5 00:33:06 2003 @@ -1303,3 +1303,8 @@ bool depends on SMP || X86_VISWS default y + +config PC + bool + depends on X86 && !EMBEDDED + default y diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c --- a/arch/i386/kernel/acpi/boot.c Sun Oct 5 00:33:09 2003 +++ b/arch/i386/kernel/acpi/boot.c Sun Oct 5 00:33:09 2003 @@ -183,8 +183,7 @@ #endif /*CONFIG_X86_LOCAL_APIC*/ -#ifdef CONFIG_X86_IO_APIC - +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) static int __init acpi_parse_ioapic ( @@ -368,7 +367,6 @@ result = acpi_table_parse(ACPI_APIC, acpi_parse_madt); if (!result) { - printk(KERN_WARNING PREFIX "MADT not present\n"); return 0; } else if (result < 0) { @@ -416,7 +414,7 @@ #endif /*CONFIG_X86_LOCAL_APIC*/ -#ifdef CONFIG_X86_IO_APIC +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) /* * I/O APIC @@ -472,7 +470,8 @@ acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC; acpi_ioapic = 1; -#endif /*CONFIG_X86_IO_APIC*/ + +#endif /* CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER */ #ifdef CONFIG_X86_LOCAL_APIC if (acpi_lapic && acpi_ioapic) { @@ -480,6 +479,7 @@ clustered_apic_check(); } #endif + #ifdef CONFIG_HPET_TIMER acpi_table_parse(ACPI_HPET, acpi_parse_hpet); #endif diff -Nru a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig --- a/arch/i386/kernel/cpu/cpufreq/Kconfig Sun Oct 5 00:33:07 2003 +++ b/arch/i386/kernel/cpu/cpufreq/Kconfig Sun Oct 5 00:33:07 2003 @@ -88,6 +88,16 @@ If in doubt, say N. +config X86_POWERNOW_K8 + tristate "AMD Opteron/Athlon64 PowerNow!" + depends on CPU_FREQ_TABLE + help + This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors. + + For details, take a look at linux/Documentation/cpu-freq. + + If in doubt, say N. + config X86_GX_SUSPMOD tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation" depends on CPU_FREQ diff -Nru a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile --- a/arch/i386/kernel/cpu/cpufreq/Makefile Sun Oct 5 00:33:08 2003 +++ b/arch/i386/kernel/cpu/cpufreq/Makefile Sun Oct 5 00:33:08 2003 @@ -1,5 +1,6 @@ obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o +obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o obj-$(CONFIG_X86_LONGHAUL) += longhaul.o obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o diff -Nru a/arch/i386/kernel/cpu/cpufreq/acpi.c b/arch/i386/kernel/cpu/cpufreq/acpi.c --- a/arch/i386/kernel/cpu/cpufreq/acpi.c Sun Oct 5 00:33:06 2003 +++ b/arch/i386/kernel/cpu/cpufreq/acpi.c Sun Oct 5 00:33:06 2003 @@ -231,7 +231,7 @@ int state) { u16 port = 0; - u8 value = 0; + u16 value = 0; int i = 0; struct cpufreq_freqs cpufreq_freqs; @@ -282,9 +282,9 @@ value = (u16) perf->states[state].control; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Writing 0x%02x to port 0x%04x\n", value, port)); + "Writing 0x%04x to port 0x%04x\n", value, port)); - outb(value, port); + outw(value, port); /* * Then we read the 'status_register' and compare the value with the @@ -296,12 +296,12 @@ port = perf->status_register; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Looking for 0x%02x from port 0x%04x\n", - (u8) perf->states[state].status, port)); + "Looking for 0x%04x from port 0x%04x\n", + (u16) perf->states[state].status, port)); for (i=0; i<100; i++) { - value = inb(port); - if (value == (u8) perf->states[state].status) + value = inw(port); + if (value == (u16) perf->states[state].status) break; udelay(10); } @@ -309,7 +309,7 @@ /* notify cpufreq */ cpufreq_notify_transition(&cpufreq_freqs, CPUFREQ_POSTCHANGE); - if (value != perf->states[state].status) { + if (value != (u16) perf->states[state].status) { unsigned int tmp = cpufreq_freqs.new; cpufreq_freqs.new = cpufreq_freqs.old; cpufreq_freqs.old = tmp; diff -Nru a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c Sun Oct 5 00:33:05 2003 +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c Sun Oct 5 00:33:05 2003 @@ -70,21 +70,6 @@ } -static unsigned int longhaul_get_cpu_fsb (void) -{ - unsigned long lo, hi; - unsigned int eblcr_fsb_table[] = { 66, 133, 100, -1 }; - unsigned int invalue=0; - - if (fsb == 0) { - rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi); - invalue = (lo & (1<<18|1<<19)) >>18; - fsb = eblcr_fsb_table[invalue]; - } - return fsb; -} - - static int longhaul_get_cpu_mult (void) { unsigned long invalue=0,lo, hi; @@ -168,7 +153,7 @@ break; /* - * Longhaul v3. (Ezra-T [C5M], Nehemiag [C5N]) + * Longhaul v3. (Ezra-T [C5M], Nehemiah [C5N]) * This can also do voltage scaling, but see above. * Ezra-T was alleged to do FSB scaling too, but it never worked in practice. */ @@ -193,6 +178,39 @@ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); } +/* + * Centaur decided to make life a little more tricky. + * Only longhaul v1 is allowed to read EBLCR BSEL[0:1]. + * Samuel2 and above have to try and guess what the FSB is. + * We do this by assuming we booted at maximum multiplier, and interpolate + * between that value multiplied by possible FSBs and cpu_mhz which + * was calculated at boot time. Really ugly, but no other way to do this. + */ +static int _guess (int guess, int maxmult) +{ + int target; + + target = ((maxmult/10)*guess); + if (maxmult%10 != 0) + target += (guess/2); + target &= ~0xf; + return target; +} + +static int guess_fsb(int maxmult) +{ + int speed = (cpu_khz/1000) & ~0xf; + int i; + int speeds[3] = { 66, 100, 133 }; + + for (i=0; i<3; i++) { + if (_guess(speeds[i],maxmult) == speed) + return speeds[i]; + } + return 0; +} + + static int __init longhaul_get_ranges (void) { @@ -203,8 +221,8 @@ -1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 }; unsigned int j, k = 0; union msr_longhaul longhaul; - - fsb = longhaul_get_cpu_fsb(); + unsigned long lo, hi; + unsigned int eblcr_fsb_table[] = { 66, 133, 100, -1 }; switch (longhaul_version) { case 1: @@ -212,6 +230,9 @@ Assume min=3.0x & max = whatever we booted at. */ minmult = 30; maxmult = longhaul_get_cpu_mult(); + rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi); + invalue = (lo & (1<<18|1<<19)) >>18; + fsb = eblcr_fsb_table[invalue]; break; case 2 ... 3: @@ -222,14 +243,13 @@ invalue += 16; maxmult=multipliers[invalue]; -#if 0 invalue = longhaul.bits.MinMHzBR; - if (longhaul.bits.MinMHzBR4); - invalue += 16; - minmult = multipliers[invalue]; -#else - minmult = 30; /* as per spec */ -#endif + if (longhaul.bits.MinMHzBR4 == 1) + minmult = 30; + else + minmult = multipliers[invalue]; + + fsb = guess_fsb(maxmult); break; } diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c Sun Oct 5 00:33:10 2003 @@ -0,0 +1,1020 @@ +/* + * (c) 2003 Advanced Micro Devices, Inc. + * Your use of this code is subject to the terms and conditions of the + * GNU general public license version 2. See "../../../COPYING" or + * http://www.gnu.org/licenses/gpl.html + * + * Support : paul.devriendt@amd.com + * + * Based on the powernow-k7.c module written by Dave Jones. + * (C) 2003 Dave Jones on behalf of SuSE Labs + * Licensed under the terms of the GNU GPL License version 2. + * Based upon datasheets & sample CPUs kindly provided by AMD. + * + * Processor information obtained from Chapter 9 (Power and Thermal Management) + * of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD + * Opteron Processors", revision 3.03, available for download from www.amd.com + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define PFX "powernow-k8: " +#define BFX PFX "BIOS error: " +#define VERSION "version 1.00.08 - September 26, 2003" +#include "powernow-k8.h" + +#ifdef CONFIG_PREEMPT +#warning this driver has not been tested on a preempt system +#endif + +static u32 vstable; /* voltage stabalization time, from PSB, units 20 us */ +static u32 plllock; /* pll lock time, from PSB, units 1 us */ +static u32 numps; /* number of p-states, from PSB */ +static u32 rvo; /* ramp voltage offset, from PSB */ +static u32 irt; /* isochronous relief time, from PSB */ +static u32 vidmvs; /* usable value calculated from mvs, from PSB */ +struct pst_s *ppst; /* array of p states, valid for this part */ +static u32 currvid; /* keep track of the current fid / vid */ +static u32 currfid; + +/* +The PSB table supplied by BIOS allows for the definition of the number of +p-states that can be used when running on a/c, and the number of p-states +that can be used when running on battery. This allows laptop manufacturers +to force the system to save power when running from battery. The relationship +is : + 1 <= number_of_battery_p_states <= maximum_number_of_p_states + +This driver does NOT have the support in it to detect transitions from +a/c power to battery power, and thus trigger the transition to a lower +p-state if required. This is because I need ACPI and the 2.6 kernel to do +this, and this is a 2.4 kernel driver. Check back for a new improved driver +for the 2.6 kernel soon. + +This code therefore assumes it is on battery at all times, and thus +restricts performance to number_of_battery_p_states. For desktops, + number_of_battery_p_states == maximum_number_of_pstates, +so this is not actually a restriction. +*/ + +static u32 batps; /* limit on the number of p states when on battery */ + /* - set by BIOS in the PSB/PST */ + +static struct cpufreq_driver cpufreq_amd64_driver = { + .verify = drv_verify, + .target = drv_target, + .init = drv_cpu_init, + .name = "cpufreq-amd64", + .owner = THIS_MODULE, +}; + +#define SEARCH_UP 1 +#define SEARCH_DOWN 0 + +/* Return a frequency in MHz, given an input fid */ +u32 +find_freq_from_fid(u32 fid) +{ + return 800 + (fid * 100); +} + +/* Return a fid matching an input frequency in MHz */ +u32 +find_fid_from_freq(u32 freq) +{ + return (freq - 800) / 100; +} + +/* Return the vco fid for an input fid */ +static u32 +convert_fid_to_vco_fid(u32 fid) +{ + if (fid < HI_FID_TABLE_BOTTOM) { + return 8 + (2 * fid); + } else { + return fid; + } +} + +/* Sort the fid/vid frequency table into ascending order by fid. The spec */ +/* implies that it will be sorted by BIOS, but, it only implies it, and I */ +/* prefer not to trust when I can check. */ +/* Yes, it is a simple bubble sort, but the PST is really small, so the */ +/* choice of algorithm is pretty irrelevant. */ +static inline void +sort_pst(struct pst_s *ppst, u32 numpstates) +{ + u32 i; + u8 tempfid; + u8 tempvid; + int swaps = 1; + + while (swaps) { + swaps = 0; + for (i = 0; i < (numpstates - 1); i++) { + if (ppst[i].fid > ppst[i + 1].fid) { + swaps = 1; + tempfid = ppst[i].fid; + tempvid = ppst[i].vid; + ppst[i].fid = ppst[i + 1].fid; + ppst[i].vid = ppst[i + 1].vid; + ppst[i + 1].fid = tempfid; + ppst[i + 1].vid = tempvid; + } + } + } + + return; +} + +/* Return 1 if the pending bit is set. Unless we are actually just told the */ +/* processor to transition a state, seeing this bit set is really bad news. */ +static inline int +pending_bit_stuck(void) +{ + u32 lo; + u32 hi; + + rdmsr(MSR_FIDVID_STATUS, lo, hi); + return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0; +} + +/* Update the global current fid / vid values from the status msr. Returns 1 */ +/* on error. */ +static int +query_current_values_with_pending_wait(void) +{ + u32 lo; + u32 hi; + u32 i = 0; + + lo = MSR_S_LO_CHANGE_PENDING; + while (lo & MSR_S_LO_CHANGE_PENDING) { + if (i++ > 0x1000000) { + printk(KERN_ERR PFX "detected change pending stuck\n"); + return 1; + } + rdmsr(MSR_FIDVID_STATUS, lo, hi); + } + + currvid = hi & MSR_S_HI_CURRENT_VID; + currfid = lo & MSR_S_LO_CURRENT_FID; + + return 0; +} + +/* the isochronous relief time */ +static inline void +count_off_irt(void) +{ + udelay((1 << irt) * 10); + return; +} + +/* the voltage stabalization time */ +static inline void +count_off_vst(void) +{ + udelay(vstable * VST_UNITS_20US); + return; +} + +/* write the new fid value along with the other control fields to the msr */ +static int +write_new_fid(u32 fid) +{ + u32 lo; + u32 savevid = currvid; + + if ((fid & INVALID_FID_MASK) || (currvid & INVALID_VID_MASK)) { + printk(KERN_ERR PFX "internal error - overflow on fid write\n"); + return 1; + } + + lo = fid | (currvid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; + + dprintk(KERN_DEBUG PFX "writing fid %x, lo %x, hi %x\n", + fid, lo, plllock * PLL_LOCK_CONVERSION); + + wrmsr(MSR_FIDVID_CTL, lo, plllock * PLL_LOCK_CONVERSION); + + if (query_current_values_with_pending_wait()) + return 1; + + count_off_irt(); + + if (savevid != currvid) { + printk(KERN_ERR PFX + "vid changed on fid transition, save %x, currvid %x\n", + savevid, currvid); + return 1; + } + + if (fid != currfid) { + printk(KERN_ERR PFX + "fid transition failed, fid %x, currfid %x\n", + fid, currfid); + return 1; + } + + return 0; +} + +/* Write a new vid to the hardware */ +static int +write_new_vid(u32 vid) +{ + u32 lo; + u32 savefid = currfid; + + if ((currfid & INVALID_FID_MASK) || (vid & INVALID_VID_MASK)) { + printk(KERN_ERR PFX "internal error - overflow on vid write\n"); + return 1; + } + + lo = currfid | (vid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; + + dprintk(KERN_DEBUG PFX "writing vid %x, lo %x, hi %x\n", + vid, lo, STOP_GRANT_5NS); + + wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS); + + if (query_current_values_with_pending_wait()) { + return 1; + } + + if (savefid != currfid) { + printk(KERN_ERR PFX + "fid changed on vid transition, save %x currfid %x\n", + savefid, currfid); + return 1; + } + + if (vid != currvid) { + printk(KERN_ERR PFX + "vid transition failed, vid %x, currvid %x\n", + vid, currvid); + return 1; + } + + return 0; +} + +/* Reduce the vid by the max of step or reqvid. */ +/* Decreasing vid codes represent increasing voltages : */ +/* vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of 0x1f is off. */ +static int +decrease_vid_code_by_step(u32 reqvid, u32 step) +{ + if ((currvid - reqvid) > step) + reqvid = currvid - step; + + if (write_new_vid(reqvid)) + return 1; + + count_off_vst(); + + return 0; +} + +/* Change the fid and vid, by the 3 phases. */ +static inline int +transition_fid_vid(u32 reqfid, u32 reqvid) +{ + if (core_voltage_pre_transition(reqvid)) + return 1; + + if (core_frequency_transition(reqfid)) + return 1; + + if (core_voltage_post_transition(reqvid)) + return 1; + + if (query_current_values_with_pending_wait()) + return 1; + + if ((reqfid != currfid) || (reqvid != currvid)) { + printk(KERN_ERR PFX "failed: req 0x%x 0x%x, curr 0x%x 0x%x\n", + reqfid, reqvid, currfid, currvid); + return 1; + } + + dprintk(KERN_INFO PFX + "transitioned: new fid 0x%x, vid 0x%x\n", currfid, currvid); + + return 0; +} + +/* Phase 1 - core voltage transition ... setup appropriate voltage for the */ +/* fid transition. */ +static inline int +core_voltage_pre_transition(u32 reqvid) +{ + u32 rvosteps = rvo; + u32 savefid = currfid; + + dprintk(KERN_DEBUG PFX + "ph1: start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo %x\n", + currfid, currvid, reqvid, rvo); + + while (currvid > reqvid) { + dprintk(KERN_DEBUG PFX "ph1: curr 0x%x, requesting vid 0x%x\n", + currvid, reqvid); + if (decrease_vid_code_by_step(reqvid, vidmvs)) + return 1; + } + + while (rvosteps > 0) { + if (currvid == 0) { + rvosteps = 0; + } else { + dprintk(KERN_DEBUG PFX + "ph1: changing vid for rvo, requesting 0x%x\n", + currvid - 1); + if (decrease_vid_code_by_step(currvid - 1, 1)) + return 1; + rvosteps--; + } + } + + if (query_current_values_with_pending_wait()) + return 1; + + if (savefid != currfid) { + printk(KERN_ERR PFX "ph1 err, currfid changed 0x%x\n", currfid); + return 1; + } + + dprintk(KERN_DEBUG PFX "ph1 complete, currfid 0x%x, currvid 0x%x\n", + currfid, currvid); + + return 0; +} + +/* Phase 2 - core frequency transition */ +static inline int +core_frequency_transition(u32 reqfid) +{ + u32 vcoreqfid; + u32 vcocurrfid; + u32 vcofiddiff; + u32 savevid = currvid; + + if ((reqfid < HI_FID_TABLE_BOTTOM) && (currfid < HI_FID_TABLE_BOTTOM)) { + printk(KERN_ERR PFX "ph2 illegal lo-lo transition 0x%x 0x%x\n", + reqfid, currfid); + return 1; + } + + if (currfid == reqfid) { + printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n", currfid); + return 0; + } + + dprintk(KERN_DEBUG PFX + "ph2 starting, currfid 0x%x, currvid 0x%x, reqfid 0x%x\n", + currfid, currvid, reqfid); + + vcoreqfid = convert_fid_to_vco_fid(reqfid); + vcocurrfid = convert_fid_to_vco_fid(currfid); + vcofiddiff = vcocurrfid > vcoreqfid ? vcocurrfid - vcoreqfid + : vcoreqfid - vcocurrfid; + + while (vcofiddiff > 2) { + if (reqfid > currfid) { + if (currfid > LO_FID_TABLE_TOP) { + if (write_new_fid(currfid + 2)) { + return 1; + } + } else { + if (write_new_fid + (2 + convert_fid_to_vco_fid(currfid))) { + return 1; + } + } + } else { + if (write_new_fid(currfid - 2)) + return 1; + } + + vcocurrfid = convert_fid_to_vco_fid(currfid); + vcofiddiff = vcocurrfid > vcoreqfid ? vcocurrfid - vcoreqfid + : vcoreqfid - vcocurrfid; + } + + if (write_new_fid(reqfid)) + return 1; + + if (query_current_values_with_pending_wait()) + return 1; + + if (currfid != reqfid) { + printk(KERN_ERR PFX + "ph2 mismatch, failed fid transition, curr %x, req %x\n", + currfid, reqfid); + return 1; + } + + if (savevid != currvid) { + printk(KERN_ERR PFX + "ph2 vid changed, save %x, curr %x\n", savevid, + currvid); + return 1; + } + + dprintk(KERN_DEBUG PFX "ph2 complete, currfid 0x%x, currvid 0x%x\n", + currfid, currvid); + + return 0; +} + +/* Phase 3 - core voltage transition flow ... jump to the final vid. */ +static inline int +core_voltage_post_transition(u32 reqvid) +{ + u32 savefid = currfid; + u32 savereqvid = reqvid; + + dprintk(KERN_DEBUG PFX "ph3 starting, currfid 0x%x, currvid 0x%x\n", + currfid, currvid); + + if (reqvid != currvid) { + if (write_new_vid(reqvid)) + return 1; + + if (savefid != currfid) { + printk(KERN_ERR PFX + "ph3: bad fid change, save %x, curr %x\n", + savefid, currfid); + return 1; + } + + if (currvid != reqvid) { + printk(KERN_ERR PFX + "ph3: failed vid transition\n, req %x, curr %x", + reqvid, currvid); + return 1; + } + } + + if (query_current_values_with_pending_wait()) + return 1; + + if (savereqvid != currvid) { + dprintk(KERN_ERR PFX "ph3 failed, currvid 0x%x\n", currvid); + return 1; + } + + if (savefid != currfid) { + dprintk(KERN_ERR PFX "ph3 failed, currfid changed 0x%x\n", + currfid); + return 1; + } + + dprintk(KERN_DEBUG PFX "ph3 complete, currfid 0x%x, currvid 0x%x\n", + currfid, currvid); + + return 0; +} + +static inline int +check_supported_cpu(void) +{ + struct cpuinfo_x86 *c = cpu_data; + u32 eax, ebx, ecx, edx; + + if (num_online_cpus() != 1) { + printk(KERN_INFO PFX "multiprocessor systems not supported\n"); + return 0; + } + + if (c->x86_vendor != X86_VENDOR_AMD) { + printk(KERN_INFO PFX "Not an AMD processor\n"); + return 0; + } + + eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); + if ((eax & CPUID_XFAM_MOD) == ATHLON64_XFAM_MOD) { + dprintk(KERN_DEBUG PFX "AMD Althon 64 Processor found\n"); + if ((eax & CPUID_F1_STEP) < ATHLON64_REV_C0) { + printk(KERN_INFO PFX "Revision C0 or better " + "AMD Athlon 64 processor required\n"); + return 0; + } + } else if ((eax & CPUID_XFAM_MOD) == OPTERON_XFAM_MOD) { + dprintk(KERN_DEBUG PFX "AMD Opteron Processor found\n"); + } else { + printk(KERN_INFO PFX + "AMD Athlon 64 or AMD Opteron processor required\n"); + return 0; + } + + eax = cpuid_eax(CPUID_GET_MAX_CAPABILITIES); + if (eax < CPUID_FREQ_VOLT_CAPABILITIES) { + printk(KERN_INFO PFX + "No frequency change capabilities detected\n"); + return 0; + } + + cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx); + if ((edx & P_STATE_TRANSITION_CAPABLE) != P_STATE_TRANSITION_CAPABLE) { + printk(KERN_INFO PFX "Power state transitions not supported\n"); + return 0; + } + + printk(KERN_INFO PFX "Found AMD Athlon 64 / Opteron processor " + "supporting p-state transitions\n"); + + return 1; +} + +/* Find and validate the PSB/PST table in BIOS. */ +static inline int +find_psb_table(void) +{ + struct psb_s *psb; + struct pst_s *pst; + unsigned i, j; + u32 lastfid; + u32 mvs; + u8 maxvid; + + for (i = 0xc0000; i < 0xffff0; i += 0x10) { + /* Scan BIOS looking for the signature. */ + /* It can not be at ffff0 - it is too big. */ + + psb = phys_to_virt(i); + if (memcmp(psb, PSB_ID_STRING, PSB_ID_STRING_LEN) != 0) + continue; + + dprintk(KERN_DEBUG PFX "found PSB header at 0x%p\n", psb); + + dprintk(KERN_DEBUG PFX "table vers: 0x%x\n", psb->tableversion); + if (psb->tableversion != PSB_VERSION_1_4) { + printk(KERN_INFO BFX "PSB table is not v1.4\n"); + return -ENODEV; + } + + dprintk(KERN_DEBUG PFX "flags: 0x%x\n", psb->flags1); + if (psb->flags1) { + printk(KERN_ERR BFX "unknown flags\n"); + return -ENODEV; + } + + vstable = psb->voltagestabilizationtime; + printk(KERN_INFO PFX "voltage stable time: %d (units 20us)\n", + vstable); + + dprintk(KERN_DEBUG PFX "flags2: 0x%x\n", psb->flags2); + rvo = psb->flags2 & 3; + irt = ((psb->flags2) >> 2) & 3; + mvs = ((psb->flags2) >> 4) & 3; + vidmvs = 1 << mvs; + batps = ((psb->flags2) >> 6) & 3; + printk(KERN_INFO PFX "p states on battery: %d ", batps); + switch (batps) { + case 0: + printk("- all available\n"); + break; + case 1: + printk("- only the minimum\n"); + break; + case 2: + printk("- only the 2 lowest\n"); + break; + case 3: + printk("- only the 3 lowest\n"); + break; + } + printk(KERN_INFO PFX "ramp voltage offset: %d\n", rvo); + printk(KERN_INFO PFX "isochronous relief time: %d\n", irt); + printk(KERN_INFO PFX "maximum voltage step: %d\n", mvs); + + dprintk(KERN_DEBUG PFX "numpst: 0x%x\n", psb->numpst); + if (psb->numpst != 1) { + printk(KERN_ERR BFX "numpst must be 1\n"); + return -ENODEV; + } + + dprintk(KERN_DEBUG PFX "cpuid: 0x%x\n", psb->cpuid); + + plllock = psb->plllocktime; + printk(KERN_INFO PFX "pll lock time: 0x%x\n", plllock); + + maxvid = psb->maxvid; + printk(KERN_INFO PFX "maxfid: 0x%x\n", psb->maxfid); + printk(KERN_INFO PFX "maxvid: 0x%x\n", maxvid); + + numps = psb->numpstates; + printk(KERN_INFO PFX "numpstates: 0x%x\n", numps); + if (numps < 2) { + printk(KERN_ERR BFX "no p states to transition\n"); + return -ENODEV; + } + + if (batps == 0) { + batps = numps; + } else if (batps > numps) { + printk(KERN_ERR BFX "batterypstates > numpstates\n"); + batps = numps; + } else { + printk(KERN_ERR PFX + "Restricting operation to %d p-states\n", batps); + printk(KERN_ERR PFX + "Check for an updated driver to access all " + "%d p-states\n", numps); + } + + if ((numps <= 1) || (batps <= 1)) { + printk(KERN_ERR PFX "only 1 p-state to transition\n"); + return -ENODEV; + } + + ppst = kmalloc(sizeof (struct pst_s) * numps, GFP_KERNEL); + if (!ppst) { + printk(KERN_ERR PFX "ppst memory alloc failure\n"); + return -ENOMEM; + } + + pst = (struct pst_s *) (psb + 1); + for (j = 0; j < numps; j++) { + ppst[j].fid = pst[j].fid; + ppst[j].vid = pst[j].vid; + printk(KERN_INFO PFX + " %d : fid 0x%x, vid 0x%x\n", j, + ppst[j].fid, ppst[j].vid); + } + sort_pst(ppst, numps); + + lastfid = ppst[0].fid; + if (lastfid > LO_FID_TABLE_TOP) + printk(KERN_INFO BFX "first fid not in lo freq tbl\n"); + + if ((lastfid > MAX_FID) || (lastfid & 1) || (ppst[0].vid > LEAST_VID)) { + printk(KERN_ERR BFX "first fid/vid bad (0x%x - 0x%x)\n", + lastfid, ppst[0].vid); + kfree(ppst); + return -ENODEV; + } + + for (j = 1; j < numps; j++) { + if ((lastfid >= ppst[j].fid) + || (ppst[j].fid & 1) + || (ppst[j].fid < HI_FID_TABLE_BOTTOM) + || (ppst[j].fid > MAX_FID) + || (ppst[j].vid > LEAST_VID)) { + printk(KERN_ERR BFX + "invalid fid/vid in pst(%x %x)\n", + ppst[j].fid, ppst[j].vid); + kfree(ppst); + return -ENODEV; + } + lastfid = ppst[j].fid; + } + + for (j = 0; j < numps; j++) { + if (ppst[j].vid < rvo) { /* vid+rvo >= 0 */ + printk(KERN_ERR BFX + "0 vid exceeded with pstate %d\n", j); + return -ENODEV; + } + if (ppst[j].vid < maxvid+rvo) { /* vid+rvo >= maxvid */ + printk(KERN_ERR BFX + "maxvid exceeded with pstate %d\n", j); + return -ENODEV; + } + } + + if (query_current_values_with_pending_wait()) { + kfree(ppst); + return -EIO; + } + + printk(KERN_INFO PFX "currfid 0x%x, currvid 0x%x\n", + currfid, currvid); + + for (j = 0; j < numps; j++) + if ((ppst[j].fid==currfid) && (ppst[j].vid==currvid)) + return (0); + + printk(KERN_ERR BFX "currfid/vid do not match PST, ignoring\n"); + return 0; + } + + printk(KERN_ERR BFX "no PSB\n"); + return -ENODEV; +} + +/* Converts a frequency (that might not necessarily be a multiple of 200) */ +/* to a fid. */ +u32 +find_closest_fid(u32 freq, int searchup) +{ + if (searchup == SEARCH_UP) + freq += MIN_FREQ_RESOLUTION - 1; + + freq = (freq / MIN_FREQ_RESOLUTION) * MIN_FREQ_RESOLUTION; + + if (freq < MIN_FREQ) + freq = MIN_FREQ; + else if (freq > MAX_FREQ) + freq = MAX_FREQ; + + return find_fid_from_freq(freq); +} + +static int +find_match(u32 * ptargfreq, u32 * pmin, u32 * pmax, int searchup, u32 * pfid, + u32 * pvid) +{ + u32 availpstates = batps; + u32 targfid = find_closest_fid(*ptargfreq, searchup); + u32 minfid = find_closest_fid(*pmin, SEARCH_DOWN); + u32 maxfid = find_closest_fid(*pmax, SEARCH_UP); + u32 minidx = 0; + u32 maxidx = availpstates - 1; + u32 targidx = 0xffffffff; + int i; + + dprintk(KERN_DEBUG PFX "find match: freq %d MHz, min %d, max %d\n", + *ptargfreq, *pmin, *pmax); + + /* Restrict values to the frequency choices in the PST */ + if (minfid < ppst[0].fid) + minfid = ppst[0].fid; + if (maxfid > ppst[maxidx].fid) + maxfid = ppst[maxidx].fid; + + /* Find appropriate PST index for the minimim fid */ + for (i = 0; i < (int) availpstates; i++) { + if (minfid >= ppst[i].fid) + minidx = i; + } + + /* Find appropriate PST index for the maximum fid */ + for (i = availpstates - 1; i >= 0; i--) { + if (maxfid <= ppst[i].fid) + maxidx = i; + } + + if (minidx > maxidx) + maxidx = minidx; + + /* Frequency ids are now constrained by limits matching PST entries */ + minfid = ppst[minidx].fid; + maxfid = ppst[maxidx].fid; + + /* Limit the target frequency to these limits */ + if (targfid < minfid) + targfid = minfid; + else if (targfid > maxfid) + targfid = maxfid; + + /* Find the best target index into the PST, contrained by the range */ + if (searchup == SEARCH_UP) { + for (i = maxidx; i >= (int) minidx; i--) { + if (targfid <= ppst[i].fid) + targidx = i; + } + } else { + for (i = minidx; i <= (int) maxidx; i++) { + if (targfid >= ppst[i].fid) + targidx = i; + } + } + + if (targidx == 0xffffffff) { + printk(KERN_ERR PFX "could not find target\n"); + return 1; + } + + *pmin = find_freq_from_fid(minfid); + *pmax = find_freq_from_fid(maxfid); + *ptargfreq = find_freq_from_fid(ppst[targidx].fid); + + if (pfid) + *pfid = ppst[targidx].fid; + if (pvid) + *pvid = ppst[targidx].vid; + + return 0; +} + +/* Take a frequency, and issue the fid/vid transition command */ +static inline int +transition_frequency(u32 * preq, u32 * pmin, u32 * pmax, u32 searchup) +{ + u32 fid; + u32 vid; + int res; + struct cpufreq_freqs freqs; + + if (find_match(preq, pmin, pmax, searchup, &fid, &vid)) + return 1; + + dprintk(KERN_DEBUG PFX "table matched fid 0x%x, giving vid 0x%x\n", + fid, vid); + + if (query_current_values_with_pending_wait()) + return 1; + + if ((currvid == vid) && (currfid == fid)) { + dprintk(KERN_DEBUG PFX + "target matches current values (fid 0x%x, vid 0x%x)\n", + fid, vid); + return 0; + } + + if ((fid < HI_FID_TABLE_BOTTOM) && (currfid < HI_FID_TABLE_BOTTOM)) { + printk(KERN_ERR PFX + "ignoring illegal change in lo freq table-%x to %x\n", + currfid, fid); + return 1; + } + + dprintk(KERN_DEBUG PFX "changing to fid 0x%x, vid 0x%x\n", fid, vid); + + freqs.cpu = 0; /* only true because SMP not supported */ + + freqs.old = find_freq_from_fid(currfid); + freqs.new = find_freq_from_fid(fid); + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + + res = transition_fid_vid(fid, vid); + + freqs.new = find_freq_from_fid(currfid); + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); + + return res; +} + +/* Driver entry point to switch to the target frequency */ +static int +drv_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) +{ + u32 checkfid = currfid; + u32 checkvid = currvid; + u32 reqfreq = targfreq / 1000; + u32 minfreq = pol->min / 1000; + u32 maxfreq = pol->max / 1000; + + if (ppst == 0) { + printk(KERN_ERR PFX "targ: ppst 0\n"); + return -ENODEV; + } + + if (pending_bit_stuck()) { + printk(KERN_ERR PFX "drv targ fail: change pending bit set\n"); + return -EIO; + } + + dprintk(KERN_DEBUG PFX "targ: %d kHz, min %d, max %d, relation %d\n", + targfreq, pol->min, pol->max, relation); + + if (query_current_values_with_pending_wait()) + return -EIO; + + dprintk(KERN_DEBUG PFX "targ: curr fid 0x%x, vid 0x%x\n", + currfid, currvid); + + if ((checkvid != currvid) || (checkfid != currfid)) { + printk(KERN_ERR PFX + "error - out of sync, fid 0x%x 0x%x, vid 0x%x 0x%x\n", + checkfid, currfid, checkvid, currvid); + } + + if (transition_frequency(&reqfreq, &minfreq, &maxfreq, + relation == + CPUFREQ_RELATION_H ? SEARCH_UP : SEARCH_DOWN)) + { + printk(KERN_ERR PFX "transition frequency failed\n"); + return 1; + } + + pol->cur = 1000 * find_freq_from_fid(currfid); + + return 0; +} + +/* Driver entry point to verify the policy and range of frequencies */ +static int +drv_verify(struct cpufreq_policy *pol) +{ + u32 min = pol->min / 1000; + u32 max = pol->max / 1000; + u32 targ = min; + int res; + + if (ppst == 0) { + printk(KERN_ERR PFX "verify - ppst 0\n"); + return -ENODEV; + } + + if (pending_bit_stuck()) { + printk(KERN_ERR PFX "failing verify, change pending bit set\n"); + return -EIO; + } + + dprintk(KERN_DEBUG PFX + "ver: cpu%d, min %d, max %d, cur %d, pol %d\n", pol->cpu, + pol->min, pol->max, pol->cur, pol->policy); + + if (pol->cpu != 0) { + printk(KERN_ERR PFX "verify - cpu not 0\n"); + return -ENODEV; + } + + res = find_match(&targ, &min, &max, + pol->policy == CPUFREQ_POLICY_POWERSAVE ? + SEARCH_DOWN : SEARCH_UP, 0, 0); + if (!res) { + pol->min = min * 1000; + pol->max = max * 1000; + } + return res; +} + +/* per CPU init entry point to the driver */ +static int __init +drv_cpu_init(struct cpufreq_policy *pol) +{ + if (pol->cpu != 0) { + printk(KERN_ERR PFX "init not cpu 0\n"); + return -ENODEV; + } + + pol->policy = CPUFREQ_POLICY_PERFORMANCE; /* boot as fast as we can */ + + /* Take a crude guess here. */ + pol->cpuinfo.transition_latency = ((rvo + 8) * vstable * VST_UNITS_20US) + + (3 * (1 << irt) * 10); + + if (query_current_values_with_pending_wait()) + return -EIO; + + pol->cur = 1000 * find_freq_from_fid(currfid); + dprintk(KERN_DEBUG PFX "policy current frequency %d kHz\n", pol->cur); + + /* min/max the cpu is capable of */ + pol->cpuinfo.min_freq = 1000 * find_freq_from_fid(ppst[0].fid); + pol->cpuinfo.max_freq = 1000 * find_freq_from_fid(ppst[numps-1].fid); + pol->min = 1000 * find_freq_from_fid(ppst[0].fid); + pol->max = 1000 * find_freq_from_fid(ppst[batps - 1].fid); + + printk(KERN_INFO PFX "cpu_init done, current fid 0x%x, vid 0x%x\n", + currfid, currvid); + + return 0; +} + +/* driver entry point for init */ +static int __init +drv_init(void) +{ + int rc; + + printk(KERN_INFO PFX VERSION "\n"); + + if (check_supported_cpu() == 0) + return -ENODEV; + + rc = find_psb_table(); + if (rc) + return rc; + + if (pending_bit_stuck()) { + printk(KERN_ERR PFX "drv_init fail, change pending bit set\n"); + kfree(ppst); + return -EIO; + } + + return cpufreq_register_driver(&cpufreq_amd64_driver); +} + +/* driver entry point for term */ +static void __exit +drv_exit(void) +{ + dprintk(KERN_INFO PFX "drv_exit\n"); + + cpufreq_unregister_driver(&cpufreq_amd64_driver); + kfree(ppst); +} + +MODULE_AUTHOR("Paul Devriendt "); +MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); +MODULE_LICENSE("GPL"); + +module_init(drv_init); +module_exit(drv_exit); diff -Nru a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.h Sun Oct 5 00:33:10 2003 @@ -0,0 +1,126 @@ +/* + * (c) 2003 Advanced Micro Devices, Inc. + * Your use of this code is subject to the terms and conditions of the + * GNU general public license version 2. See "../../../COPYING" or + * http://www.gnu.org/licenses/gpl.html + */ + +/* processor's cpuid instruction support */ +#define CPUID_PROCESSOR_SIGNATURE 1 /* function 1 */ +#define CPUID_F1_FAM 0x00000f00 /* family mask */ +#define CPUID_F1_XFAM 0x0ff00000 /* extended family mask */ +#define CPUID_F1_MOD 0x000000f0 /* model mask */ +#define CPUID_F1_STEP 0x0000000f /* stepping level mask */ +#define CPUID_XFAM_MOD 0x0ff00ff0 /* xtended fam, fam + model */ +#define ATHLON64_XFAM_MOD 0x00000f40 /* xtended fam, fam + model */ +#define OPTERON_XFAM_MOD 0x00000f50 /* xtended fam, fam + model */ +#define ATHLON64_REV_C0 8 +#define CPUID_GET_MAX_CAPABILITIES 0x80000000 +#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007 +#define P_STATE_TRANSITION_CAPABLE 6 + +/* Model Specific Registers for p-state transitions. MSRs are 64-bit. For */ +/* writes (wrmsr - opcode 0f 30), the register number is placed in ecx, and */ +/* the value to write is placed in edx:eax. For reads (rdmsr - opcode 0f 32), */ +/* the register number is placed in ecx, and the data is returned in edx:eax. */ + +#define MSR_FIDVID_CTL 0xc0010041 +#define MSR_FIDVID_STATUS 0xc0010042 + +/* Field definitions within the FID VID Low Control MSR : */ +#define MSR_C_LO_INIT_FID_VID 0x00010000 +#define MSR_C_LO_NEW_VID 0x00001f00 +#define MSR_C_LO_NEW_FID 0x0000002f +#define MSR_C_LO_VID_SHIFT 8 + +/* Field definitions within the FID VID High Control MSR : */ +#define MSR_C_HI_STP_GNT_TO 0x000fffff + +/* Field definitions within the FID VID Low Status MSR : */ +#define MSR_S_LO_CHANGE_PENDING 0x80000000 /* cleared when completed */ +#define MSR_S_LO_MAX_RAMP_VID 0x1f000000 +#define MSR_S_LO_MAX_FID 0x003f0000 +#define MSR_S_LO_START_FID 0x00003f00 +#define MSR_S_LO_CURRENT_FID 0x0000003f + +/* Field definitions within the FID VID High Status MSR : */ +#define MSR_S_HI_MAX_WORKING_VID 0x001f0000 +#define MSR_S_HI_START_VID 0x00001f00 +#define MSR_S_HI_CURRENT_VID 0x0000001f + +/* fids (frequency identifiers) are arranged in 2 tables - lo and hi */ +#define LO_FID_TABLE_TOP 6 +#define HI_FID_TABLE_BOTTOM 8 + +#define LO_VCOFREQ_TABLE_TOP 1400 /* corresponding vco frequency values */ +#define HI_VCOFREQ_TABLE_BOTTOM 1600 + +#define MIN_FREQ_RESOLUTION 200 /* fids jump by 2 matching freq jumps by 200 */ + +#define MAX_FID 0x2a /* Spec only gives FID values as far as 5 GHz */ + +#define LEAST_VID 0x1e /* Lowest (numerically highest) useful vid value */ + +#define MIN_FREQ 800 /* Min and max freqs, per spec */ +#define MAX_FREQ 5000 + +#define INVALID_FID_MASK 0xffffffc1 /* not a valid fid if these bits are set */ + +#define INVALID_VID_MASK 0xffffffe0 /* not a valid vid if these bits are set */ + +#define STOP_GRANT_5NS 1 /* min poss memory access latency for voltage change */ + +#define PLL_LOCK_CONVERSION (1000/5) /* ms to ns, then divide by clock period */ + +#define MAXIMUM_VID_STEPS 1 /* Current cpus only allow a single step of 25mV */ + +#define VST_UNITS_20US 20 /* Voltage Stabalization Time is in units of 20us */ + +/* +Version 1.4 of the PSB table. This table is constructed by BIOS and is +to tell the OS's power management driver which VIDs and FIDs are +supported by this particular processor. This information is obtained from +the data sheets for each processor model by the system vendor and +incorporated into the BIOS. +If the data in the PSB / PST is wrong, then this driver will program the +wrong values into hardware, which is very likely to lead to a crash. +*/ + +#define PSB_ID_STRING "AMDK7PNOW!" +#define PSB_ID_STRING_LEN 10 + +#define PSB_VERSION_1_4 0x14 + +struct psb_s { + u8 signature[10]; + u8 tableversion; + u8 flags1; + u16 voltagestabilizationtime; + u8 flags2; + u8 numpst; + u32 cpuid; + u8 plllocktime; + u8 maxfid; + u8 maxvid; + u8 numpstates; +}; + +/* Pairs of fid/vid values are appended to the version 1.4 PSB table. */ +struct pst_s { + u8 fid; + u8 vid; +}; + +#ifdef DEBUG +#define dprintk(msg...) printk(msg) +#else +#define dprintk(msg...) do { } while(0) +#endif + +static inline int core_voltage_pre_transition(u32 reqvid); +static inline int core_voltage_post_transition(u32 reqvid); +static inline int core_frequency_transition(u32 reqfid); +static int drv_verify(struct cpufreq_policy *pol); +static int drv_target(struct cpufreq_policy *pol, unsigned targfreq, + unsigned relation); +static int __init drv_cpu_init(struct cpufreq_policy *pol); diff -Nru a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c --- a/arch/i386/kernel/cpu/intel.c Sun Oct 5 00:33:07 2003 +++ b/arch/i386/kernel/cpu/intel.c Sun Oct 5 00:33:07 2003 @@ -238,12 +238,9 @@ } /* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until model 3 mask 3 */ - if ( c->x86 == 6) { - unsigned model_mask = (c->x86_model << 8) + c->x86_mask; - if (model_mask < 0x0303) - clear_bit(X86_FEATURE_SEP, c->x86_capability); - } - + if ((c->x86<<8 | c->x86_model<<4 | c->x86_mask) < 0x633) + clear_bit(X86_FEATURE_SEP, c->x86_capability); + /* Names for the Pentium II/Celeron processors detectable only by also checking the cache size. Dixon is NOT a Celeron. */ diff -Nru a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/i386/kernel/cpu/mcheck/k7.c --- a/arch/i386/kernel/cpu/mcheck/k7.c Sun Oct 5 00:33:08 2003 +++ b/arch/i386/kernel/cpu/mcheck/k7.c Sun Oct 5 00:33:08 2003 @@ -17,7 +17,7 @@ #include "mce.h" /* Machine Check Handler For AMD Athlon/Duron */ -static void k7_machine_check(struct pt_regs * regs, long error_code) +static asmlinkage void k7_machine_check(struct pt_regs * regs, long error_code) { int recover=1; u32 alow, ahigh, high, low; @@ -31,7 +31,7 @@ printk (KERN_EMERG "CPU %d: Machine Check Exception: %08x%08x\n", smp_processor_id(), mcgsth, mcgstl); - for (i=0; i"), - MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1011"), NO_MATCH }}, - { force_acpi_ht, "ABIT i440BX-W83977", { MATCH(DMI_BOARD_VENDOR, "ABIT "), MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), @@ -978,7 +973,10 @@ { disable_acpi_pci, "ASUS A7V", { MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), MATCH(DMI_BOARD_NAME, ""), - MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), NO_MATCH }}, + /* newer BIOS, Revision 1011, does work */ + MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), + NO_MATCH }}, + #endif { NULL, } diff -Nru a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S --- a/arch/i386/kernel/entry.S Sun Oct 5 00:33:07 2003 +++ b/arch/i386/kernel/entry.S Sun Oct 5 00:33:07 2003 @@ -595,7 +595,7 @@ #ifdef CONFIG_X86_MCE ENTRY(machine_check) pushl $0 - pushl $do_machine_check + pushl machine_check_vector jmp error_code #endif @@ -879,5 +879,6 @@ .long sys_tgkill /* 270 */ .long sys_utimes .long sys_fadvise64_64 + .long sys_ni_syscall /* sys_vserver */ nr_syscalls=(.-sys_call_table)/4 diff -Nru a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c --- a/arch/i386/kernel/i387.c Sun Oct 5 00:33:10 2003 +++ b/arch/i386/kernel/i387.c Sun Oct 5 00:33:10 2003 @@ -549,13 +549,3 @@ } return fpvalid; } - - -#ifdef CONFIG_SMP -void dump_smp_unlazy_fpu(void) -{ - unlazy_fpu(current); - return; -} -#endif - diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c --- a/arch/i386/kernel/mpparse.c Sun Oct 5 00:33:07 2003 +++ b/arch/i386/kernel/mpparse.c Sun Oct 5 00:33:07 2003 @@ -169,7 +169,7 @@ if (num_processors >= NR_CPUS) { printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot " - "boot CPU(apicid 0x%d).\n", NR_CPUS, m->mpc_apicid); + "boot CPU(apicid 0x%x).\n", NR_CPUS, m->mpc_apicid); return; } num_processors++; @@ -830,7 +830,7 @@ MP_processor_info(&processor); } -#ifdef CONFIG_X86_IO_APIC +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) #define MP_ISA_BUS 0 #define MP_MAX_IOAPIC_PIN 127 @@ -1019,10 +1019,6 @@ } } -#ifdef CONFIG_ACPI - -/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */ - extern FADT_DESCRIPTOR acpi_fadt; void __init mp_config_ioapic_for_sci(int irq) @@ -1031,6 +1027,7 @@ int ioapic_pin; struct acpi_table_madt *madt; struct acpi_table_int_src_ovr *entry = NULL; + acpi_interrupt_flags flags; void *madt_end; acpi_status status; @@ -1049,32 +1046,37 @@ while ((void *) entry < madt_end) { if (entry->header.type == ACPI_MADT_INT_SRC_OVR && - acpi_fadt.sci_int == entry->bus_irq) { - /* - * See the note at the end of ACPI 2.0b section - * 5.2.10.8 for what this is about. - */ - if (entry->bus_irq != entry->global_irq) { - acpi_fadt.sci_int = entry->global_irq; - irq = entry->global_irq; - break; - } - else - return; - } - + acpi_fadt.sci_int == entry->bus_irq) + goto found; + entry = (struct acpi_table_int_src_ovr *) ((unsigned long) entry + entry->header.length); } } + /* + * Although the ACPI spec says that the SCI should be level/low + * don't reprogram it unless there is an explicit MADT OVR entry + * instructing us to do so -- otherwise we break Tyan boards which + * have the SCI wired edge/high but no MADT OVR. + */ + return; + +found: + /* + * See the note at the end of ACPI 2.0b section + * 5.2.10.8 for what this is about. + */ + flags = entry->flags; + acpi_fadt.sci_int = entry->global_irq; + irq = entry->global_irq; ioapic = mp_find_ioapic(irq); ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start; - io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); // Active low, level triggered + io_apic_set_pci_routing(ioapic, ioapic_pin, irq, + (flags.trigger >> 1) , (flags.polarity >> 1)); } -#endif /* CONFIG_ACPI */ #ifdef CONFIG_ACPI_PCI @@ -1110,8 +1112,10 @@ } /* Don't set up the ACPI SCI because it's already set up */ - if (acpi_fadt.sci_int == irq) + if (acpi_fadt.sci_int == irq) { + entry->irq = irq; /*we still need to set entry's irq*/ continue; + } ioapic = mp_find_ioapic(irq); if (ioapic < 0) @@ -1154,5 +1158,5 @@ } #endif /*CONFIG_ACPI_PCI*/ -#endif /* CONFIG_X86_IO_APIC */ +#endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/ #endif /*CONFIG_ACPI_BOOT*/ diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c --- a/arch/i386/kernel/setup.c Sun Oct 5 00:33:08 2003 +++ b/arch/i386/kernel/setup.c Sun Oct 5 00:33:08 2003 @@ -64,10 +64,10 @@ unsigned long mmu_cr4_features; EXPORT_SYMBOL_GPL(mmu_cr4_features); -#ifdef CONFIG_ACPI - int acpi_disabled __initdata = 0; +#ifdef CONFIG_ACPI_INTERPRETER + int acpi_disabled = 0; #else - int acpi_disabled __initdata = 1; + int acpi_disabled = 1; #endif EXPORT_SYMBOL(acpi_disabled); diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c --- a/arch/i386/kernel/smpboot.c Sun Oct 5 00:33:08 2003 +++ b/arch/i386/kernel/smpboot.c Sun Oct 5 00:33:08 2003 @@ -937,6 +937,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) { int apicid, cpu, bit, kicked; + unsigned long bogosum = 0; /* * Setup boot CPU information @@ -1048,26 +1049,25 @@ /* * Allow the user to impress friends. */ - Dprintk("Before bogomips.\n"); - if (!cpucount) { - printk(KERN_ERR "Error: only one processor found.\n"); - } else { - unsigned long bogosum = 0; - for (cpu = 0; cpu < NR_CPUS; cpu++) - if (cpu_isset(cpu, cpu_callout_map)) - bogosum += cpu_data[cpu].loops_per_jiffy; - printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", - cpucount+1, - bogosum/(500000/HZ), - (bogosum/(5000/HZ))%100); - Dprintk("Before bogocount - setting activated=1.\n"); - } + for (cpu = 0; cpu < NR_CPUS; cpu++) + if (cpu_isset(cpu, cpu_callout_map)) + bogosum += cpu_data[cpu].loops_per_jiffy; + printk(KERN_INFO + "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", + cpucount+1, + bogosum/(500000/HZ), + (bogosum/(5000/HZ))%100); + + Dprintk("Before bogocount - setting activated=1.\n"); if (smp_b_stepping) printk(KERN_WARNING "WARNING: SMP operation may be unreliable with B stepping processors.\n"); - /* Don't taint if we are running SMP kernel on a single non-MP approved Athlon */ + /* + * Don't taint if we are running SMP kernel on a single non-MP + * approved Athlon + */ if (tainted & TAINT_UNSAFE_SMP) { if (cpucount) printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n"); diff -Nru a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c --- a/arch/i386/mm/ioremap.c Sun Oct 5 00:33:07 2003 +++ b/arch/i386/mm/ioremap.c Sun Oct 5 00:33:07 2003 @@ -158,7 +158,7 @@ return NULL; area->phys_addr = phys_addr; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vunmap(addr); return NULL; } diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c --- a/arch/ia64/kernel/acpi.c Sun Oct 5 00:33:08 2003 +++ b/arch/ia64/kernel/acpi.c Sun Oct 5 00:33:08 2003 @@ -56,7 +56,7 @@ unsigned char acpi_kbd_controller_present = 1; -int acpi_disabled __initdata; /* XXX this shouldn't be needed---we can't boot without ACPI! */ +int acpi_disabled; /* XXX this shouldn't be needed---we can't boot without ACPI! */ const char * acpi_get_sysname (void) diff -Nru a/arch/ia64/sn/io/sn2/module.c b/arch/ia64/sn/io/sn2/module.c --- a/arch/ia64/sn/io/sn2/module.c Sun Oct 5 00:33:05 2003 +++ b/arch/ia64/sn/io/sn2/module.c Sun Oct 5 00:33:05 2003 @@ -166,7 +166,6 @@ { lboard_t *board; klmod_serial_num_t *comp; - char * bcopy(const char * src, char * dest, int count); char serial_number[16]; /* @@ -215,9 +214,9 @@ #endif if (comp->snum.snum_str[0] != '\0') { - bcopy(comp->snum.snum_str, - m->sys_snum, - MAX_SERIAL_NUM_SIZE); + memcpy(m->sys_snum, + comp->snum.snum_str, + MAX_SERIAL_NUM_SIZE); m->sys_snum_valid = 1; } } diff -Nru a/arch/ia64/sn/io/sn2/pic.c b/arch/ia64/sn/io/sn2/pic.c --- a/arch/ia64/sn/io/sn2/pic.c Sun Oct 5 00:33:09 2003 +++ b/arch/ia64/sn/io/sn2/pic.c Sun Oct 5 00:33:09 2003 @@ -29,8 +29,6 @@ #include #include -extern char *bcopy(const char * src, char * dest, int count); - #define PCI_BUS_NO_1 1 @@ -51,7 +49,7 @@ (arbitrary_info_t *)&pinv) == GRAPH_SUCCESS) { NEW(peer_pinv); - bcopy((const char *)pinv, (char *)peer_pinv, sizeof(inventory_t)); + memcpy(peer_pinv, pinv, sizeof(inventory_t)); if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_INVENT, (arbitrary_info_t)peer_pinv) != GRAPH_SUCCESS) { DEL(peer_pinv); diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig --- a/arch/m68k/Kconfig Sun Oct 5 00:33:08 2003 +++ b/arch/m68k/Kconfig Sun Oct 5 00:33:08 2003 @@ -87,7 +87,7 @@ config HADES bool "Hades support" - depends on ATARI + depends on ATARI && BROKEN help This option enables support for the Hades Atari clone. If you plan to use this kernel on a Hades, say Y here; otherwise say N. @@ -361,7 +361,7 @@ config STRAM_SWAP bool "Support for ST-RAM as swap space" - depends on ATARI + depends on ATARI && BROKEN ---help--- Some Atari 68k macines (including the 520STF and 1020STE) divide their addressible memory into ST and TT sections. The TT section @@ -961,7 +961,7 @@ config SERIAL167 bool "CD2401 support for MVME166/7 serial ports" - depends on MVME16x + depends on MVME16x && BROKEN help This is the driver for the serial ports on the Motorola MVME166, 167, and 172 boards. Everyone using one of these boards should say diff -Nru a/arch/m68k/Makefile b/arch/m68k/Makefile --- a/arch/m68k/Makefile Sun Oct 5 00:33:10 2003 +++ b/arch/m68k/Makefile Sun Oct 5 00:33:10 2003 @@ -76,6 +76,8 @@ core-$(CONFIG_M68060) += arch/m68k/ifpsp060/ core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/ +all: zImage + lilo: vmlinux if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi diff -Nru a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c --- a/arch/m68k/atari/stram.c Sun Oct 5 00:33:09 2003 +++ b/arch/m68k/atari/stram.c Sun Oct 5 00:33:09 2003 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff -Nru a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c --- a/arch/m68k/kernel/time.c Sun Oct 5 00:33:07 2003 +++ b/arch/m68k/kernel/time.c Sun Oct 5 00:33:07 2003 @@ -171,3 +171,12 @@ write_sequnlock_irq(&xtime_lock); return 0; } + +/* + * Scheduler clock - returns current time in ns units. + */ +unsigned long long sched_clock(void) +{ + return (unsigned long long)jiffies*(1000000000/HZ); +} + diff -Nru a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c --- a/arch/m68k/q40/q40ints.c Sun Oct 5 00:33:10 2003 +++ b/arch/m68k/q40/q40ints.c Sun Oct 5 00:33:10 2003 @@ -200,7 +200,9 @@ irqreturn_t q40_process_int (int level, struct pt_regs *fp) { - printk("unexpected interrupt %x\n",level); + printk("unexpected interrupt vec=%x, pc=%lx, d0=%lx, d0_orig=%lx, d1=%lx, d2=%lx\n", + level, fp->pc, fp->d0, fp->orig_d0, fp->d1, fp->d2); + printk("\tIIRQ_REG = %x, EIRQ_REG = %x\n",master_inb(IIRQ_REG),master_inb(EIRQ_REG)); return IRQ_HANDLED; } @@ -378,7 +380,7 @@ /*printk("reenabling irq %d\n",irq); */ #endif } -// used to do 'goto repeat;' her, this delayed bh processing too long +// used to do 'goto repeat;' here, this delayed bh processing too long return IRQ_HANDLED; } } @@ -387,6 +389,7 @@ } iirq: mir=master_inb(IIRQ_REG); + /* should test whether keyboard irq is really enabled, doing it in defhand */ if (mir&Q40_IRQ_KEYB_MASK) { irq_tab[Q40_IRQ_KEYBOARD].count++; irq_tab[Q40_IRQ_KEYBOARD].handler(Q40_IRQ_KEYBOARD,irq_tab[Q40_IRQ_KEYBOARD].dev_id,fp); @@ -413,7 +416,9 @@ static irqreturn_t q40_defhand (int irq, void *dev_id, struct pt_regs *fp) { - printk ("Unknown q40 interrupt 0x%02x\n", irq); + if (irq!=Q40_IRQ_KEYBOARD) + printk ("Unknown q40 interrupt %d\n", irq); + else master_outb(-1,KEYBOARD_UNLOCK_REG); return IRQ_NONE; } static irqreturn_t sys_default_handler(int lev, void *dev_id, struct pt_regs *regs) diff -Nru a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c --- a/arch/m68k/sun3/config.c Sun Oct 5 00:33:09 2003 +++ b/arch/m68k/sun3/config.c Sun Oct 5 00:33:09 2003 @@ -129,7 +129,7 @@ high_memory = (void *)memory_end; availmem = memory_start; - availmem += init_bootmem(start_page, num_pages); + availmem += init_bootmem_node(NODE_DATA(0), start_page, 0, num_pages); availmem = (availmem + (PAGE_SIZE-1)) & PAGE_MASK; free_bootmem(__pa(availmem), memory_end - (availmem)); diff -Nru a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c --- a/arch/mips/mm/ioremap.c Sun Oct 5 00:33:08 2003 +++ b/arch/mips/mm/ioremap.c Sun Oct 5 00:33:08 2003 @@ -162,7 +162,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vunmap(addr); return NULL; } diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig --- a/arch/parisc/Kconfig Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/Kconfig Sun Oct 5 00:33:08 2003 @@ -150,6 +150,7 @@ config HPUX bool "Support for HP-UX binaries" + depends on !PARISC64 config NR_CPUS int "Maximum number of CPUs (2-32)" @@ -189,6 +190,8 @@ #source drivers/ieee1394/Kconfig #source drivers/message/i2o/Kconfig + +source "net/Kconfig" #source "drivers/isdn/Kconfig" diff -Nru a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c --- a/arch/parisc/kernel/asm-offsets.c Sun Oct 5 00:33:06 2003 +++ b/arch/parisc/kernel/asm-offsets.c Sun Oct 5 00:33:06 2003 @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -248,6 +249,9 @@ DEFINE(DTLB_OFF_STRIDE, offsetof(struct pdc_cache_info, dt_off_stride)); DEFINE(DTLB_OFF_COUNT, offsetof(struct pdc_cache_info, dt_off_count)); DEFINE(DTLB_LOOP, offsetof(struct pdc_cache_info, dt_loop)); + BLANK(); + DEFINE(PA_BLOCKSTEP_BIT, 31-PT_BLOCKSTEP_BIT); + DEFINE(PA_SINGLESTEP_BIT, 31-PT_SINGLESTEP_BIT); BLANK(); return 0; } diff -Nru a/arch/parisc/kernel/binfmt_elf32.c b/arch/parisc/kernel/binfmt_elf32.c --- a/arch/parisc/kernel/binfmt_elf32.c Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/kernel/binfmt_elf32.c Sun Oct 5 00:33:08 2003 @@ -88,7 +88,9 @@ */ #define SET_PERSONALITY(ex, ibcs2) \ - current->personality = PER_LINUX_32BIT + current->personality = PER_LINUX32; \ + current->thread.map_base = DEFAULT_MAP_BASE32; \ + current->thread.task_size = DEFAULT_TASK_SIZE32 \ #define jiffies_to_timeval jiffies_to_compat_timeval static __inline__ void @@ -99,3 +101,25 @@ } #include "../../../fs/binfmt_elf.c" + +/* Set up a separate execution domain for ELF32 binaries running + * on an ELF64 kernel */ + +static struct exec_domain parisc32_exec_domain = { + .name = "Linux/ELF32", + .pers_low = PER_LINUX32, + .pers_high = PER_LINUX32, +}; + +static int __init parisc32_exec_init(void) +{ + /* steal the identity signal mappings from the default domain */ + parisc32_exec_domain.signal_map = default_exec_domain.signal_map; + parisc32_exec_domain.signal_invmap = default_exec_domain.signal_invmap; + + register_exec_domain(&parisc32_exec_domain); + + return 0; +} + +__initcall(parisc32_exec_init); diff -Nru a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c --- a/arch/parisc/kernel/drivers.c Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/drivers.c Sun Oct 5 00:33:10 2003 @@ -28,6 +28,7 @@ /* See comments in include/asm-parisc/pci.h */ struct hppa_dma_ops *hppa_dma_ops; +EXPORT_SYMBOL(hppa_dma_ops); static struct parisc_device root; @@ -155,6 +156,7 @@ return driver_register(&driver->drv); } +EXPORT_SYMBOL(register_parisc_driver); /** * count_parisc_driver - count # of devices this driver would match @@ -187,6 +189,7 @@ driver_unregister(&driver->drv); return 0; } +EXPORT_SYMBOL(unregister_parisc_driver); static struct parisc_device *find_device_by_addr(unsigned long hpa) { @@ -257,7 +260,7 @@ path.mod = dev->hw_path; return print_hwpath(&path, output); } - +EXPORT_SYMBOL(print_pa_hwpath); #if defined(CONFIG_PCI) || defined(CONFIG_ISA) /** @@ -289,6 +292,7 @@ padev = padev->parent; } } +EXPORT_SYMBOL(get_pci_node_path); /** * print_pci_hwpath - Returns hardware path for PCI devices @@ -306,6 +310,8 @@ get_pci_node_path(dev, &path); return print_hwpath(&path, output); } +EXPORT_SYMBOL(print_pci_hwpath); + #endif /* defined(CONFIG_PCI) || defined(CONFIG_ISA) */ diff -Nru a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S --- a/arch/parisc/kernel/entry.S Sun Oct 5 00:33:07 2003 +++ b/arch/parisc/kernel/entry.S Sun Oct 5 00:33:07 2003 @@ -2225,18 +2225,23 @@ LDREG TI_TASK(%r1),%r1 STREG %r28,TASK_PT_GR28(%r1) - /* Save other hpux returns if personality is PER_HPUX */ +#ifdef CONFIG_HPUX /* cannot be easily included */ #define PER_HPUX 0x10 LDREG TASK_PERSONALITY(%r1),%r19 -#warning the ldo+CMPIB could probably be done better but 0x10 i soutside of range of CMPIB + + /* We can't use "CMPIB<> PER_HPUX" since "im5" field is sign extended */ ldo -PER_HPUX(%r19), %r19 CMPIB<>,n 0,%r19,1f + + /* Save other hpux returns if personality is PER_HPUX */ STREG %r22,TASK_PT_GR22(%r1) STREG %r29,TASK_PT_GR29(%r1) 1: +#endif /* CONFIG_HPUX */ + /* Seems to me that dp could be wrong here, if the syscall involved * calling a module, and nothing got round to restoring dp on return. */ @@ -2315,18 +2320,16 @@ depi 3,31,2,%r31 /* ensure return to user mode. */ #ifdef __LP64__ - /* Since we are returning to a 32 bit user process, we always - * clear the W bit. This means that the be (and mtsp) gets - * executed in narrow mode, but that is OK, since we are - * returning to a 32 bit process. When we support 64 bit processes - * we won't clear the W bit, so the be will run in wide mode. - */ - - be 0(%sr3,%r31) /* return to user space */ + /* decide whether to reset the wide mode bit + * + * For a syscall, the W bit is stored in the lowest bit + * of sp. Extract it and reset W if it is zero */ + extrd,u,*<> %r30,63,1,%r1 rsm PSW_SM_W, %r0 -#else - be,n 0(%sr3,%r31) /* return to user space */ + /* now reset the lowest bit of sp if it was set */ + xor %r30,%r1,%r30 #endif + be,n 0(%sr3,%r31) /* return to user space */ /* We have to return via an RFI, so that PSW T and R bits can be set * appropriately. @@ -2340,12 +2343,19 @@ LDREG TASK_PT_PSW(%r1),%r2 /* Get old PSW */ ldi 0x0b,%r20 /* Create new PSW */ depi -1,13,1,%r20 /* C, Q, D, and I bits */ - bb,>=,n %r19,15,try_tbit /* PT_SINGLESTEP */ + + /* The values of PA_SINGLESTEP_BIT and PA_BLOCKSTEP_BIT are + * set in include/linux/ptrace.h and converted to PA bitmap + * numbers in asm-offsets.c */ + + /* if ((%r19.PA_SINGLESTEP_BIT)) { %r20.27=1} */ + extru,= %r19,PA_SINGLESTEP_BIT,1,%r0 depi -1,27,1,%r20 /* R bit */ -try_tbit: - bb,>=,n %r19,14,psw_setup /* PT_BLOCKSTEP, see ptrace.c */ + + /* if ((%r19.PA_BLOCKSTEP_BIT)) { %r20.7=1} */ + extru,= %r19,PA_BLOCKSTEP_BIT,1,%r0 depi -1,7,1,%r20 /* T bit */ -psw_setup: + STREG %r20,TASK_PT_PSW(%r1) /* Always store space registers, since sr3 can be changed (e.g. fork) */ diff -Nru a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c --- a/arch/parisc/kernel/firmware.c Sun Oct 5 00:33:06 2003 +++ b/arch/parisc/kernel/firmware.c Sun Oct 5 00:33:06 2003 @@ -41,19 +41,20 @@ * prumpf 991016 */ +#include + +#include +#include #include +#include #include #include -#include -#include #include #include #include #include /* for boot_cpu_data */ -#include - static spinlock_t pdc_lock = SPIN_LOCK_UNLOCKED; static unsigned long pdc_result[32] __attribute__ ((aligned (8))); static unsigned long pdc_result2[32] __attribute__ ((aligned (8))); @@ -151,6 +152,7 @@ return retval; } +EXPORT_SYMBOL(pdc_add_valid); /** * pdc_chassis_info - Return chassis information. @@ -264,6 +266,7 @@ return retval; } +EXPORT_SYMBOL(pdc_iodc_read); /** * pdc_system_map_find_mods - Locate unarchitected modules. @@ -518,6 +521,7 @@ return retval; } +EXPORT_SYMBOL(pdc_lan_station_id); /** @@ -594,6 +598,7 @@ spin_unlock_irq(&pdc_lock); return retval >= PDC_OK; } +EXPORT_SYMBOL(pdc_get_initiator); /** @@ -660,6 +665,7 @@ return retval; } +EXPORT_SYMBOL(pdc_tod_read); /** * pdc_tod_set - Set the Time-Of-Day clock. @@ -678,6 +684,7 @@ return retval; } +EXPORT_SYMBOL(pdc_tod_set); #ifdef __LP64__ int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, @@ -772,20 +779,34 @@ } /* - * pdc_suspend_usb - Stop USB controller + * pdc_io_reset - Hack to avoid overlapping range registers of Bridges devices. + * Primarily a problem on T600 (which parisc-linux doesn't support) but + * who knows what other platform firmware might do with this OS "hook". + */ +void pdc_io_reset(void) +{ + spin_lock_irq(&pdc_lock); + mem_pdc_call(PDC_IO, PDC_IO_RESET, 0); + spin_unlock_irq(&pdc_lock); +} + +/* + * pdc_io_reset_devices - Hack to Stop USB controller * * If PDC used the usb controller, the usb controller * is still running and will crash the machines during iommu * setup, because of still running DMA. This PDC call - * stops the USB controller + * stops the USB controller. + * Normally called after calling pdc_io_reset(). */ -void pdc_suspend_usb(void) +void pdc_io_reset_devices(void) { spin_lock_irq(&pdc_lock); - mem_pdc_call(PDC_IO, PDC_IO_SUSPEND_USB, 0); + mem_pdc_call(PDC_IO, PDC_IO_RESET_DEVICES, 0); spin_unlock_irq(&pdc_lock); } + /** * pdc_iodc_putc - Console character print using IODC. * @c: the character to output. @@ -905,6 +926,7 @@ return retval; } +EXPORT_SYMBOL(pdc_sti_call); #ifdef __LP64__ /** diff -Nru a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c --- a/arch/parisc/kernel/inventory.c Sun Oct 5 00:33:06 2003 +++ b/arch/parisc/kernel/inventory.c Sun Oct 5 00:33:06 2003 @@ -526,12 +526,14 @@ int i; long status = PDC_OK; +#if defined(CONFIG_IOMMU_SBA) && defined(CONFIG_SUPERIO) /* - * first stop the usb controller, otherwise the machine - * might crash during iommu setup + * Stop the suckyio usb controller on Astro based systems. + * Otherwise the machine might crash during iommu setup. */ -#warning We still probably need to worry about USB here, but how? - /* pdc_suspend_usb(); */ + pdc_io_reset(); + pdc_io_reset_devices(); +#endif for (i = 0; status != PDC_BAD_PROC && status != PDC_NE_MOD; i++) { struct parisc_device *dev; diff -Nru a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c --- a/arch/parisc/kernel/irq.c Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/kernel/irq.c Sun Oct 5 00:33:08 2003 @@ -193,6 +193,7 @@ else BUG(); } +EXPORT_SYMBOL(disable_irq); void enable_irq(int irq) { @@ -208,6 +209,7 @@ else BUG(); } +EXPORT_SYMBOL(enable_irq); int show_interrupts(struct seq_file *p, void *v) { @@ -698,6 +700,7 @@ { while (in_irq()) ; } +EXPORT_SYMBOL(synchronize_irq); #endif @@ -847,6 +850,7 @@ { return 0; } +EXPORT_SYMBOL(probe_irq_mask); void __init init_IRQ(void) { diff -Nru a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c --- a/arch/parisc/kernel/module.c Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/module.c Sun Oct 5 00:33:10 2003 @@ -73,10 +73,7 @@ Elf32_Addr addr; }; -struct fdesc_entry { - Elf32_Addr addr; - Elf32_Addr gp; -}; +#define Elf_Fdesc Elf32_Fdesc struct stub_entry { Elf32_Word insns[2]; /* each stub entry has two insns */ @@ -86,11 +83,7 @@ Elf64_Addr addr; }; -struct fdesc_entry { - Elf64_Addr dummy[2]; - Elf64_Addr addr; - Elf64_Addr gp; -}; +#define Elf_Fdesc Elf64_Fdesc struct stub_entry { Elf64_Word insns[4]; /* each stub entry has four insns */ @@ -276,7 +269,7 @@ me->core_size = ALIGN(me->core_size, 16); me->arch.fdesc_offset = me->core_size; - me->core_size += fdescs * sizeof(struct fdesc_entry); + me->core_size += fdescs * sizeof(Elf_Fdesc); me->core_size = ALIGN(me->core_size, 16); me->arch.stub_offset = me->core_size; @@ -322,7 +315,7 @@ #ifdef __LP64__ static Elf_Addr get_fdesc(struct module *me, unsigned long value) { - struct fdesc_entry *fdesc = me->module_core + me->arch.fdesc_offset; + Elf_Fdesc *fdesc = me->module_core + me->arch.fdesc_offset; if (!value) { printk(KERN_ERR "%s: zero OPD requested!\n", me->name); @@ -664,7 +657,7 @@ *loc64 = get_fdesc(me, val+addend); DEBUGP("FDESC for %s at %p points to %lx\n", strtab + sym->st_name, *loc64, - ((struct fdesc_entry *)*loc64)->addr); + ((Elf_Fdesc *)*loc64)->addr); } else { /* if the symbol is not local to this * module then val+addend is a pointer @@ -696,10 +689,10 @@ Elf_Sym *newptr, *oldptr; Elf_Shdr *symhdr = NULL; #ifdef DEBUG - struct fdesc_entry *entry; + Elf_Fdesc *entry; u32 *addr; - entry = (struct fdesc_entry *)me->init; + entry = (Elf_Fdesc *)me->init; printk("FINALIZE, ->init FPTR is %p, GP %lx ADDR %lx\n", entry, entry->gp, entry->addr); addr = (u32 *)entry->addr; diff -Nru a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c --- a/arch/parisc/kernel/parisc_ksyms.c Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/parisc_ksyms.c Sun Oct 5 00:33:10 2003 @@ -26,19 +26,6 @@ EXPORT_SYMBOL(strstr); EXPORT_SYMBOL(strpbrk); -#include /* struct parisc_device for asm/pci.h */ -#include -EXPORT_SYMBOL(hppa_dma_ops); -#if defined(CONFIG_PCI) || defined(CONFIG_ISA) -EXPORT_SYMBOL(get_pci_node_path); -#endif - -#include -#include -EXPORT_SYMBOL(enable_irq); -EXPORT_SYMBOL(disable_irq); -EXPORT_SYMBOL(probe_irq_mask); - #include EXPORT_SYMBOL(kernel_thread); EXPORT_SYMBOL(boot_cpu_data); @@ -46,10 +33,6 @@ #include EXPORT_SYMBOL(pm_power_off); -#ifdef CONFIG_SMP -EXPORT_SYMBOL(synchronize_irq); -#endif /* CONFIG_SMP */ - #include EXPORT_SYMBOL(__xchg8); EXPORT_SYMBOL(__xchg32); @@ -74,14 +57,6 @@ EXPORT_SYMBOL($global$); #endif -EXPORT_SYMBOL(register_parisc_driver); -EXPORT_SYMBOL(unregister_parisc_driver); -EXPORT_SYMBOL(print_pci_hwpath); -EXPORT_SYMBOL(print_pa_hwpath); -EXPORT_SYMBOL(pdc_iodc_read); -EXPORT_SYMBOL(pdc_tod_read); -EXPORT_SYMBOL(pdc_tod_set); - #include EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); @@ -89,22 +64,6 @@ EXPORT_SYMBOL(__memcpy_fromio); EXPORT_SYMBOL(__memset_io); -#if defined(CONFIG_PCI) || defined(CONFIG_ISA) -EXPORT_SYMBOL(inb); -EXPORT_SYMBOL(inw); -EXPORT_SYMBOL(inl); -EXPORT_SYMBOL(outb); -EXPORT_SYMBOL(outw); -EXPORT_SYMBOL(outl); - -EXPORT_SYMBOL(insb); -EXPORT_SYMBOL(insw); -EXPORT_SYMBOL(insl); -EXPORT_SYMBOL(outsb); -EXPORT_SYMBOL(outsw); -EXPORT_SYMBOL(outsl); -#endif - #include EXPORT_SYMBOL(flush_kernel_dcache_range_asm); EXPORT_SYMBOL(flush_kernel_dcache_page); @@ -130,17 +89,6 @@ EXPORT_SYMBOL(__down_interruptible); EXPORT_SYMBOL(__down); -#include -#include -EXPORT_SYMBOL(csum_partial_copy_nocheck); -EXPORT_SYMBOL(csum_partial_copy_from_user); - -#include -EXPORT_SYMBOL(pdc_add_valid); -EXPORT_SYMBOL(pdc_lan_station_id); -EXPORT_SYMBOL(pdc_get_initiator); -EXPORT_SYMBOL(pdc_sti_call); - extern void $$divI(void); extern void $$divU(void); extern void $$remI(void); @@ -218,6 +166,3 @@ extern void $$dyncall(void); EXPORT_SYMBOL($$dyncall); #endif - -#include -EXPORT_SYMBOL(vmalloc_start); diff -Nru a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c --- a/arch/parisc/kernel/pci.c Sun Oct 5 00:33:05 2003 +++ b/arch/parisc/kernel/pci.c Sun Oct 5 00:33:05 2003 @@ -88,7 +88,8 @@ EISA_IN(size); \ if (!parisc_pci_hba[b]) return (u##size) -1; \ return pci_port->in##type(parisc_pci_hba[b], PCI_PORT_ADDR(addr)); \ -} +} \ +EXPORT_SYMBOL(in##type); PCI_PORT_IN(b, 8) PCI_PORT_IN(w, 16) @@ -102,7 +103,8 @@ EISA_OUT(size); \ if (!parisc_pci_hba[b]) return; \ pci_port->out##type(parisc_pci_hba[b], PCI_PORT_ADDR(addr), d); \ -} +} \ +EXPORT_SYMBOL(out##type); PCI_PORT_OUT(b, 8) PCI_PORT_OUT(w, 16) diff -Nru a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c --- a/arch/parisc/kernel/ptrace.c Sun Oct 5 00:33:06 2003 +++ b/arch/parisc/kernel/ptrace.c Sun Oct 5 00:33:06 2003 @@ -23,16 +23,6 @@ #include #include -/* These are used in entry.S, syscall_restore_rfi. We need to record the - * current stepping mode somewhere other than in PSW, because there is no - * concept of saving and restoring the users PSW over a syscall. We choose - * to use these two bits in task->ptrace. These bits must not clash with - * any PT_* defined in include/linux/sched.h, and must match with the bit - * tests in entry.S - */ -#define PT_SINGLESTEP 0x10000 -#define PT_BLOCKSTEP 0x20000 - /* PSW bits we allow the debugger to modify */ #define USER_PSW_BITS (PSW_N | PSW_V | PSW_CB) diff -Nru a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c --- a/arch/parisc/kernel/setup.c Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/setup.c Sun Oct 5 00:33:10 2003 @@ -43,6 +43,7 @@ #include #include /* for pa7300lc_init() proto */ #include +#include #define COMMAND_LINE_SIZE 1024 char saved_command_line[COMMAND_LINE_SIZE]; @@ -208,27 +209,32 @@ proc_runway_root = proc_mkdir("bus/runway", 0); } break; + default: + /* FIXME: this was added to prevent the compiler + * complaining about missing pcx, pcxs and pcxt + * I'm assuming they have neither gsc nor runway */ + break; } } static struct resource central_bus = { .name = "Central Bus", - .start = (unsigned long)0xfffffffffff80000, - .end = (unsigned long)0xfffffffffffaffff, + .start = F_EXTEND(0xfff80000), + .end = F_EXTEND(0xfffaffff), .flags = IORESOURCE_MEM, }; static struct resource local_broadcast = { .name = "Local Broadcast", - .start = (unsigned long)0xfffffffffffb0000, - .end = (unsigned long)0xfffffffffffdffff, + .start = F_EXTEND(0xfffb0000), + .end = F_EXTEND(0xfffdffff), .flags = IORESOURCE_MEM, }; static struct resource global_broadcast = { .name = "Global Broadcast", - .start = (unsigned long)0xfffffffffffe0000, - .end = (unsigned long)0xffffffffffffffff, + .start = F_EXTEND(0xfffe0000), + .end = F_EXTEND(0xffffffff), .flags = IORESOURCE_MEM, }; diff -Nru a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c --- a/arch/parisc/kernel/signal.c Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/signal.c Sun Oct 5 00:33:10 2003 @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include #include @@ -41,8 +43,11 @@ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -/* Use this to get at 32-bit user passed pointers. - * See sys_sparc32.c for description about these. */ +/* gcc will complain if a pointer is cast to an integer of different + * size. If you really need to do this (and we do for an ELF32 user + * application in an ELF64 kernel) then you have to do a cast to an + * integer of the same size first. The A() macro accomplishes + * this. */ #define A(__x) ((unsigned long)(__x)) int do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall); @@ -166,11 +171,17 @@ struct rt_sigframe *frame; struct siginfo si; sigset_t set; - unsigned long usp = regs->gr[30]; + unsigned long usp = (regs->gr[30] & ~(0x01UL)); + unsigned long sigframe_size = PARISC_RT_SIGFRAME_SIZE; +#ifdef __LP64__ + if(personality(current->personality) == PER_LINUX32) + sigframe_size = PARISC_RT_SIGFRAME_SIZE32; +#endif + /* Unwind the user stack to get the rt_sigframe structure. */ frame = (struct rt_sigframe *) - (usp - PARISC_RT_SIGFRAME_SIZE); + (usp - sigframe_size); DBG(("in sys_rt_sigreturn, frame is %p\n", frame)); if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) @@ -271,11 +282,12 @@ sigset_t *set, struct pt_regs *regs, int in_syscall) { struct rt_sigframe *frame; - unsigned long rp, usp, haddr; + unsigned long rp, usp; + unsigned long haddr, sigframe_size; struct siginfo si; int err = 0; - usp = regs->gr[30]; + usp = (regs->gr[30] & ~(0x01UL)); frame = get_sigframe(ka, usp, sizeof(*frame)); DBG(("setup_rt_frame 1: frame %p info %p\n", frame, info)); @@ -308,64 +320,86 @@ } #endif -#undef CACHE_FLUSHING_IS_NOT_BROKEN -#ifdef CACHE_FLUSHING_IS_NOT_BROKEN + flush_user_dcache_range((unsigned long) &frame->tramp[0], + (unsigned long) &frame->tramp[4]); flush_user_icache_range((unsigned long) &frame->tramp[0], (unsigned long) &frame->tramp[4]); -#else - /* It should *always* be cache line-aligned, but the compiler - sometimes screws up. */ - asm volatile("fdc 0(%%sr3,%0)\n\t" - "fdc %1(%%sr3,%0)\n\t" - "sync\n\t" - "fic 0(%%sr3,%0)\n\t" - "fic %1(%%sr3,%0)\n\t" - "sync\n\t" - : : "r" (frame->tramp), "r" (L1_CACHE_BYTES)); -#endif rp = (unsigned long) frame->tramp; if (err) goto give_sigsegv; -/* Much more has to happen with signals than this -- but it'll at least */ -/* provide a pointer to some places which definitely need a look. */ -#define HACK u32 - - haddr = (HACK)A(ka->sa.sa_handler); - /* ARGH! Fucking brain damage. You don't want to know. */ - if (haddr & 2) { - HACK *plabel; - HACK ltp; - - plabel = (HACK *) (haddr & ~3); - err |= __get_user(haddr, plabel); - err |= __get_user(ltp, plabel + 1); + haddr = A(ka->sa.sa_handler); + /* The sa_handler may be a pointer to a function descriptor */ +#ifdef __LP64__ + if(personality(current->personality) == PER_LINUX32) { +#endif + if (haddr & PA_PLABEL_FDESC) { + Elf32_Fdesc fdesc; + Elf32_Fdesc *ufdesc = (Elf32_Fdesc *)A(haddr & ~3); + + err = __copy_from_user(&fdesc, ufdesc, sizeof(fdesc)); + + if (err) + goto give_sigsegv; + + haddr = fdesc.addr; + regs->gr[19] = fdesc.gp; + } +#ifdef __LP64__ + } else { + Elf64_Fdesc fdesc; + Elf64_Fdesc *ufdesc = (Elf64_Fdesc *)A(haddr & ~3); + + err = __copy_from_user(&fdesc, ufdesc, sizeof(fdesc)); + if (err) goto give_sigsegv; - regs->gr[19] = ltp; + + haddr = fdesc.addr; + regs->gr[19] = fdesc.gp; + DBG(("64 bit signal, exe=%#lx, r19=%#lx, in_syscall=%d\n", + haddr, regs->gr[19], in_syscall)); } +#endif /* The syscall return path will create IAOQ values from r31. */ - if (in_syscall) - regs->gr[31] = (HACK) haddr; - else { - regs->gr[0] = USER_PSW; - regs->iaoq[0] = (HACK) haddr | 3; + sigframe_size = PARISC_RT_SIGFRAME_SIZE; +#ifdef __LP64__ + if(personality(current->personality) == PER_LINUX32) + sigframe_size = PARISC_RT_SIGFRAME_SIZE32; +#endif + if (in_syscall) { + regs->gr[31] = haddr; +#ifdef __LP64__ + if(personality(current->personality) == PER_LINUX) + sigframe_size |= 1; +#endif + } else { + unsigned long psw = USER_PSW; +#ifdef __LP64__ + if(personality(current->personality) == PER_LINUX) + psw |= PSW_W; +#endif + + regs->gr[0] = psw; + regs->iaoq[0] = haddr | 3; regs->iaoq[1] = regs->iaoq[0] + 4; } regs->gr[2] = rp; /* userland return pointer */ regs->gr[26] = sig; /* signal number */ - regs->gr[25] = (HACK)A(&frame->info); /* siginfo pointer */ - regs->gr[24] = (HACK)A(&frame->uc); /* ucontext pointer */ + regs->gr[25] = A(&frame->info); /* siginfo pointer */ + regs->gr[24] = A(&frame->uc); /* ucontext pointer */ + DBG(("making sigreturn frame: %#lx + %#x = %#lx\n", - regs->gr[30], PARISC_RT_SIGFRAME_SIZE, - regs->gr[30] + PARISC_RT_SIGFRAME_SIZE)); + regs->gr[30], sigframe_size, + regs->gr[30] + sigframe_size)); /* Raise the user stack pointer to make a proper call frame. */ - regs->gr[30] = ((HACK)A(frame) + PARISC_RT_SIGFRAME_SIZE); + regs->gr[30] = (A(frame) + sigframe_size); + DBG(("SIG deliver (%s:%d): frame=0x%p sp=%#lx iaoq=%#lx/%#lx rp=%#lx\n", current->comm, current->pid, frame, regs->gr[30], diff -Nru a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c --- a/arch/parisc/kernel/sys_parisc.c Sun Oct 5 00:33:09 2003 +++ b/arch/parisc/kernel/sys_parisc.c Sun Oct 5 00:33:09 2003 @@ -65,7 +65,7 @@ */ static int get_offset(struct address_space *mapping) { - int offset = (int) mapping << (PAGE_SHIFT - 8); + int offset = (unsigned long) mapping << (PAGE_SHIFT - 8); return offset & 0x3FF000; } #endif @@ -165,12 +165,13 @@ return raddr; } - /* Fucking broken ABI */ #ifdef CONFIG_PARISC64 extern asmlinkage long sys_truncate(const char *, unsigned long); extern asmlinkage long sys_ftruncate(unsigned int, unsigned long); +extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long); + asmlinkage long parisc_truncate64(const char * path, unsigned int high, unsigned int low) { @@ -181,6 +182,21 @@ unsigned int high, unsigned int low) { return sys_ftruncate(fd, (long)high << 32 | low); +} + +/* stubs for the benefit of the syscall_table since truncate64 and truncate + * are identical on LP64 */ +asmlinkage long sys_truncate64(const char * path, unsigned long length) +{ + return sys_truncate(path, length); +} +asmlinkage long sys_ftruncate64(unsigned int fd, unsigned long length) +{ + return sys_ftruncate(fd, length); +} +asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + return sys_fcntl(fd, cmd, arg); } #else diff -Nru a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S --- a/arch/parisc/kernel/syscall.S Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/syscall.S Sun Oct 5 00:33:10 2003 @@ -69,9 +69,14 @@ * exit from the syscall, and also use that value to know * whether to do narrow or wide syscalls. -PB */ - ssm PSW_SM_W, %r0 + ssm PSW_SM_W, %r1 + extrd,u %r1,PSW_W_BIT,1,%r1 + /* sp must be aligned on 4, so deposit the W bit setting into + * the bottom of sp temporarily */ + or,ev %r1,%r30,%r30 + b,n 1f /* The top halves of argument registers must be cleared on syscall - * entry. + * entry from narrow executable. */ depdi 0, 31, 32, %r26 depdi 0, 31, 32, %r25 @@ -79,11 +84,13 @@ depdi 0, 31, 32, %r23 depdi 0, 31, 32, %r22 depdi 0, 31, 32, %r21 +1: #endif mfctl %cr30,%r1 xor %r1,%r30,%r30 /* ye olde xor trick */ xor %r1,%r30,%r1 xor %r1,%r30,%r30 + ldo THREAD_SZ_ALGN+FRAME_SIZE(%r30),%r30 /* set up kernel stack */ /* N.B.: It is critical that we don't set sr7 to 0 until r30 @@ -104,9 +111,19 @@ PSW value is stored. This is needed for gdb and sys_ptrace. */ STREG %r0, TASK_PT_PSW(%r1) STREG %r2, TASK_PT_GR2(%r1) /* preserve rp */ + STREG %r19, TASK_PT_GR19(%r1) + LDREGM -FRAME_SIZE(%r30), %r2 /* get users sp back */ +#ifdef __LP64__ + extrd,u %r2,63,1,%r19 /* W hidden in bottom bit */ +#if 0 + xor %r19,%r2,%r2 /* clear bottom bit */ + depd,z %r19,1,1,%r19 + std %r19,TASK_PT_PSW(%r1) +#endif +#endif STREG %r2, TASK_PT_GR30(%r1) /* ... and save it */ - STREG %r19, TASK_PT_GR19(%r1) + STREG %r20, TASK_PT_GR20(%r1) STREG %r21, TASK_PT_GR21(%r1) STREG %r22, TASK_PT_GR22(%r1) @@ -130,6 +147,7 @@ #ifdef __LP64__ ldo -16(%r30),%r29 /* Reference param save area */ + copy %r19,%r2 /* W bit back to r2 */ #else /* no need to save these on stack in wide mode because the first 8 * args are passed in registers */ @@ -144,9 +162,17 @@ /* Note! We cannot use the syscall table that is mapped nearby since the gateway page is mapped execute-only. */ +#ifdef __LP64__ + ldil L%sys_call_table, %r1 + or,= %r2,%r2,%r2 + addil L%(sys_call_table64-sys_call_table), %r1 + ldo R%sys_call_table(%r1), %r19 + or,= %r2,%r2,%r2 + ldo R%sys_call_table64(%r1), %r19 +#else ldil L%sys_call_table, %r1 ldo R%sys_call_table(%r1), %r19 - +#endif comiclr,>>= __NR_Linux_syscalls, %r20, %r0 b,n .Lsyscall_nosys @@ -317,304 +343,21 @@ ldil L%syscall_exit_rfi,%r1 be,n R%syscall_exit_rfi(%sr7,%r1) -#ifdef __LP64__ -/* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and - * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific - * implementation is required on wide palinux. Use ENTRY_COMP where - * the compatability layer has a useful 32-bit implementation. - */ -#define ENTRY_SAME(_name_) .dword sys_##_name_ -#define ENTRY_DIFF(_name_) .dword sys32_##_name_ -#define ENTRY_UHOH(_name_) .dword sys32_##unimplemented -#define ENTRY_OURS(_name_) .dword parisc_##_name_ -#define ENTRY_COMP(_name_) .dword compat_sys_##_name_ -#else -#define ENTRY_SAME(_name_) .word sys_##_name_ -#define ENTRY_DIFF(_name_) .word sys_##_name_ -#define ENTRY_UHOH(_name_) .word sys_##_name_ -#define ENTRY_OURS(_name_) .word parisc_##_name_ -#define ENTRY_COMP(_name_) .word sys_##_name_ -#endif - - .align 8 + .align 4096 .export sys_call_table .Lsys_call_table: sys_call_table: - ENTRY_SAME(ni_syscall) /* 0 - old "setup()" system call*/ - ENTRY_SAME(exit) - ENTRY_SAME(fork_wrapper) - ENTRY_SAME(read) - ENTRY_SAME(write) - ENTRY_SAME(open) /* 5 */ - ENTRY_SAME(close) - ENTRY_SAME(waitpid) - ENTRY_SAME(creat) - ENTRY_SAME(link) - ENTRY_SAME(unlink) /* 10 */ - ENTRY_DIFF(execve_wrapper) - ENTRY_SAME(chdir) - /* See comments in kernel/time.c!!! Maybe we don't need this? */ - ENTRY_DIFF(time) - ENTRY_SAME(mknod) - ENTRY_SAME(chmod) /* 15 */ - ENTRY_SAME(lchown) - ENTRY_SAME(socket) - /* struct stat is MAYBE identical wide and narrow ?? */ - ENTRY_COMP(newstat) - ENTRY_DIFF(lseek) - ENTRY_SAME(getpid) /* 20 */ - /* the 'void * data' parameter may need re-packing in wide */ - ENTRY_DIFF(mount) - /* concerned about struct sockaddr in wide/narrow */ - /* ---> I think sockaddr is OK unless the compiler packs the struct */ - /* differently to align the char array */ - ENTRY_SAME(bind) - ENTRY_SAME(setuid) - ENTRY_SAME(getuid) - ENTRY_SAME(stime) /* 25 */ - ENTRY_SAME(ptrace) - ENTRY_SAME(alarm) - /* see stat comment */ - ENTRY_COMP(newfstat) - ENTRY_SAME(pause) - /* struct utimbuf uses time_t which might vary */ - ENTRY_COMP(utime) /* 30 */ - /* struct sockaddr... */ - ENTRY_SAME(connect) - ENTRY_SAME(listen) - ENTRY_SAME(access) - ENTRY_SAME(nice) - /* struct sockaddr... */ - ENTRY_SAME(accept) /* 35 */ - ENTRY_SAME(sync) - ENTRY_SAME(kill) - ENTRY_SAME(rename) - ENTRY_SAME(mkdir) - ENTRY_SAME(rmdir) /* 40 */ - ENTRY_SAME(dup) - ENTRY_SAME(pipe) - ENTRY_COMP(times) - /* struct sockaddr... */ - ENTRY_SAME(getsockname) - /* it seems possible brk() could return a >4G pointer... */ - ENTRY_SAME(brk) /* 45 */ - ENTRY_SAME(setgid) - ENTRY_SAME(getgid) - ENTRY_SAME(signal) - ENTRY_SAME(geteuid) - ENTRY_SAME(getegid) /* 50 */ - ENTRY_SAME(acct) - ENTRY_SAME(umount) - /* struct sockaddr... */ - ENTRY_SAME(getpeername) - ENTRY_COMP(ioctl) - ENTRY_COMP(fcntl) /* 55 */ - ENTRY_SAME(socketpair) - ENTRY_SAME(setpgid) - ENTRY_SAME(send) - ENTRY_SAME(newuname) - ENTRY_SAME(umask) /* 60 */ - ENTRY_SAME(chroot) - ENTRY_SAME(ustat) - ENTRY_SAME(dup2) - ENTRY_SAME(getppid) - ENTRY_SAME(getpgrp) /* 65 */ - ENTRY_SAME(setsid) - ENTRY_SAME(pivot_root) - /* I don't like this */ - ENTRY_UHOH(sgetmask) - ENTRY_UHOH(ssetmask) - ENTRY_SAME(setreuid) /* 70 */ - ENTRY_SAME(setregid) - ENTRY_SAME(mincore) - ENTRY_COMP(sigpending) - ENTRY_SAME(sethostname) - /* Following 3 have linux-common-code structs containing longs -( */ - ENTRY_COMP(setrlimit) /* 75 */ - ENTRY_COMP(getrlimit) - ENTRY_COMP(getrusage) - /* struct timeval and timezone are maybe?? consistent wide and narrow */ - ENTRY_DIFF(gettimeofday) - ENTRY_DIFF(settimeofday) - ENTRY_SAME(getgroups) /* 80 */ - ENTRY_SAME(setgroups) - /* struct socketaddr... */ - ENTRY_SAME(sendto) - ENTRY_SAME(symlink) - /* see stat comment */ - ENTRY_COMP(newlstat) - ENTRY_SAME(readlink) /* 85 */ - ENTRY_SAME(ni_syscall) /* was uselib */ - ENTRY_SAME(swapon) - ENTRY_SAME(reboot) - ENTRY_SAME(mmap2) - ENTRY_SAME(mmap) /* 90 */ - ENTRY_SAME(munmap) - ENTRY_SAME(truncate) - ENTRY_SAME(ftruncate) - ENTRY_SAME(fchmod) - ENTRY_SAME(fchown) /* 95 */ - ENTRY_SAME(getpriority) - ENTRY_SAME(setpriority) - ENTRY_SAME(recv) - ENTRY_COMP(statfs) - ENTRY_COMP(fstatfs) /* 100 */ - ENTRY_SAME(stat64) - ENTRY_SAME(ni_syscall) /* was socketcall */ - ENTRY_SAME(syslog) - /* even though manpage says struct timeval contains longs, ours has - * time_t and suseconds_t -- both of which are safe wide/narrow */ - ENTRY_COMP(setitimer) - ENTRY_COMP(getitimer) /* 105 */ - ENTRY_SAME(capget) - ENTRY_SAME(capset) - ENTRY_OURS(pread64) - ENTRY_OURS(pwrite64) - ENTRY_SAME(getcwd) /* 110 */ - ENTRY_SAME(vhangup) - ENTRY_SAME(fstat64) - ENTRY_SAME(vfork_wrapper) - /* struct rusage contains longs... */ - ENTRY_COMP(wait4) - ENTRY_SAME(swapoff) /* 115 */ - ENTRY_DIFF(sysinfo) - ENTRY_SAME(shutdown) - ENTRY_SAME(fsync) - ENTRY_SAME(madvise) - ENTRY_SAME(clone_wrapper) /* 120 */ - ENTRY_SAME(setdomainname) - ENTRY_DIFF(sendfile) - /* struct sockaddr... */ - ENTRY_SAME(recvfrom) - /* struct timex contains longs */ - ENTRY_DIFF(adjtimex) - ENTRY_SAME(mprotect) /* 125 */ - /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */ - ENTRY_COMP(sigprocmask) - ENTRY_SAME(ni_syscall) /* create_module */ - ENTRY_SAME(init_module) - ENTRY_SAME(delete_module) - ENTRY_SAME(ni_syscall) /* 130: get_kernel_syms */ - /* time_t inside struct dqblk */ - ENTRY_SAME(quotactl) - ENTRY_SAME(getpgid) - ENTRY_SAME(fchdir) - ENTRY_SAME(bdflush) - ENTRY_SAME(sysfs) /* 135 */ - ENTRY_SAME(personality) - ENTRY_SAME(ni_syscall) /* for afs_syscall */ - ENTRY_SAME(setfsuid) - ENTRY_SAME(setfsgid) - /* I think this might work */ - ENTRY_SAME(llseek) /* 140 */ - /* struct linux_dirent has longs, like 'unsigned long d_ino' which - * almost definitely should be 'ino_t d_ino' but it's too late now */ - ENTRY_DIFF(getdents) - /* it is POSSIBLE that select will be OK because even though fd_set - * contains longs, the macros and sizes are clever. */ - ENTRY_DIFF(select) - ENTRY_SAME(flock) - ENTRY_SAME(msync) - /* struct iovec contains pointers */ - ENTRY_DIFF(readv) /* 145 */ - ENTRY_DIFF(writev) - ENTRY_SAME(getsid) - ENTRY_SAME(fdatasync) - /* struct __sysctl_args is a mess */ - ENTRY_DIFF(sysctl) - ENTRY_SAME(mlock) /* 150 */ - ENTRY_SAME(munlock) - ENTRY_SAME(mlockall) - ENTRY_SAME(munlockall) - /* struct sched_param is ok for now */ - ENTRY_SAME(sched_setparam) - ENTRY_SAME(sched_getparam) /* 155 */ - ENTRY_SAME(sched_setscheduler) - ENTRY_SAME(sched_getscheduler) - ENTRY_SAME(sched_yield) - ENTRY_SAME(sched_get_priority_max) - ENTRY_SAME(sched_get_priority_min) /* 160 */ - /* These 2 would've worked if someone had defined struct timespec - * carefully, like timeval for example (which is about the same). - * Unfortunately it contains a long :-( */ - ENTRY_DIFF(sched_rr_get_interval) - ENTRY_COMP(nanosleep) - ENTRY_SAME(mremap) - ENTRY_SAME(setresuid) - ENTRY_SAME(getresuid) /* 165 */ - ENTRY_DIFF(sigaltstack_wrapper) - ENTRY_SAME(ni_syscall) /* query_module */ - ENTRY_SAME(poll) - /* structs contain pointers and an in_addr... */ - ENTRY_DIFF(nfsservctl) - ENTRY_SAME(setresgid) /* 170 */ - ENTRY_SAME(getresgid) - ENTRY_SAME(prctl) - /* signals need a careful review */ - ENTRY_SAME(rt_sigreturn_wrapper) - ENTRY_DIFF(rt_sigaction) - ENTRY_DIFF(rt_sigprocmask) /* 175 */ - ENTRY_DIFF(rt_sigpending) - ENTRY_UHOH(rt_sigtimedwait) - /* even though the struct siginfo_t is different, it appears like - * all the paths use values which should be same wide and narrow. - * Also the struct is padded to 128 bytes which means we don't have - * to worry about faulting trying to copy in a larger 64-bit - * struct from a 32-bit user-space app. - */ - ENTRY_SAME(rt_sigqueueinfo) - ENTRY_SAME(rt_sigsuspend_wrapper) /* not really SAME -- see the code */ - ENTRY_SAME(chown) /* 180 */ - /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */ - ENTRY_COMP(setsockopt) - ENTRY_SAME(getsockopt) - ENTRY_COMP(sendmsg) - ENTRY_COMP(recvmsg) - ENTRY_SAME(semop) /* 185 */ - ENTRY_SAME(semget) - ENTRY_DIFF(semctl_broken) - ENTRY_DIFF(msgsnd) - ENTRY_DIFF(msgrcv) - ENTRY_SAME(msgget) /* 190 */ - ENTRY_SAME(msgctl_broken) - ENTRY_SAME(shmat_wrapper) - ENTRY_SAME(shmdt) - ENTRY_SAME(shmget) - ENTRY_SAME(shmctl_broken) /* 195 */ - ENTRY_SAME(ni_syscall) /* streams1 */ - ENTRY_SAME(ni_syscall) /* streams2 */ - ENTRY_SAME(lstat64) - ENTRY_OURS(truncate64) - ENTRY_OURS(ftruncate64) /* 200 */ - ENTRY_SAME(getdents64) - ENTRY_COMP(fcntl64) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(ni_syscall) /* 205 */ - ENTRY_SAME(gettid) - ENTRY_OURS(readahead) - ENTRY_SAME(ni_syscall) /* tkill */ - - ENTRY_SAME(sendfile64) - ENTRY_COMP(futex) /* 210 */ - ENTRY_COMP(sched_setaffinity) - ENTRY_COMP(sched_getaffinity) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(ni_syscall) - ENTRY_SAME(io_setup) /* 215 */ - ENTRY_SAME(io_destroy) - ENTRY_SAME(io_getevents) - ENTRY_SAME(io_submit) - ENTRY_SAME(io_cancel) - ENTRY_SAME(alloc_hugepages) /* 220 */ - ENTRY_SAME(free_hugepages) - ENTRY_SAME(exit_group) - ENTRY_DIFF(lookup_dcookie) - ENTRY_SAME(epoll_create) - ENTRY_SAME(epoll_ctl) /* 225 */ - ENTRY_SAME(epoll_wait) - ENTRY_SAME(remap_file_pages) +#include "syscall_table.S" .end +#ifdef __LP64__ + .align 4096 + .export sys_call_table64 +.Lsys_call_table64: +sys_call_table64: +#define SYSCALL_TABLE_64BIT +#include "syscall_table.S" +#endif + /* Make sure nothing else is placed on this page */ diff -Nru a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/arch/parisc/kernel/syscall_table.S Sun Oct 5 00:33:10 2003 @@ -0,0 +1,304 @@ +#undef ENTRY_SAME +#undef ENTRY_DIFF +#undef ENTRY_UHOH +#undef ENTRY_COMP +#undef ENTRY_OURS +#if defined(__LP64__) && !defined(SYSCALL_TABLE_64BIT) +/* Use ENTRY_SAME for 32-bit syscalls which are the same on wide and + * narrow palinux. Use ENTRY_DIFF for those where a 32-bit specific + * implementation is required on wide palinux. Use ENTRY_COMP where + * the compatability layer has a useful 32-bit implementation. + */ +#define ENTRY_SAME(_name_) .dword sys_##_name_ +#define ENTRY_DIFF(_name_) .dword sys32_##_name_ +#define ENTRY_UHOH(_name_) .dword sys32_##unimplemented +#define ENTRY_OURS(_name_) .dword parisc_##_name_ +#define ENTRY_COMP(_name_) .dword compat_sys_##_name_ +#elif defined(__LP64__) && defined(SYSCALL_TABLE_64BIT) +#define ENTRY_SAME(_name_) .dword sys_##_name_ +#define ENTRY_DIFF(_name_) .dword sys_##_name_ +#define ENTRY_UHOH(_name_) .dword sys_##_name_ +#define ENTRY_OURS(_name_) .dword sys_##_name_ +#define ENTRY_COMP(_name_) .dword sys_##_name_ +#else +#define ENTRY_SAME(_name_) .word sys_##_name_ +#define ENTRY_DIFF(_name_) .word sys_##_name_ +#define ENTRY_UHOH(_name_) .word sys_##_name_ +#define ENTRY_OURS(_name_) .word parisc_##_name_ +#define ENTRY_COMP(_name_) .word sys_##_name_ +#endif + + ENTRY_SAME(ni_syscall) /* 0 - old "setup()" system call*/ + ENTRY_SAME(exit) + ENTRY_SAME(fork_wrapper) + ENTRY_SAME(read) + ENTRY_SAME(write) + ENTRY_SAME(open) /* 5 */ + ENTRY_SAME(close) + ENTRY_SAME(waitpid) + ENTRY_SAME(creat) + ENTRY_SAME(link) + ENTRY_SAME(unlink) /* 10 */ + ENTRY_DIFF(execve_wrapper) + ENTRY_SAME(chdir) + /* See comments in kernel/time.c!!! Maybe we don't need this? */ + ENTRY_DIFF(time) + ENTRY_SAME(mknod) + ENTRY_SAME(chmod) /* 15 */ + ENTRY_SAME(lchown) + ENTRY_SAME(socket) + /* struct stat is MAYBE identical wide and narrow ?? */ + ENTRY_COMP(newstat) + ENTRY_DIFF(lseek) + ENTRY_SAME(getpid) /* 20 */ + /* the 'void * data' parameter may need re-packing in wide */ + ENTRY_DIFF(mount) + /* concerned about struct sockaddr in wide/narrow */ + /* ---> I think sockaddr is OK unless the compiler packs the struct */ + /* differently to align the char array */ + ENTRY_SAME(bind) + ENTRY_SAME(setuid) + ENTRY_SAME(getuid) + ENTRY_SAME(stime) /* 25 */ + ENTRY_SAME(ptrace) + ENTRY_SAME(alarm) + /* see stat comment */ + ENTRY_COMP(newfstat) + ENTRY_SAME(pause) + /* struct utimbuf uses time_t which might vary */ + ENTRY_COMP(utime) /* 30 */ + /* struct sockaddr... */ + ENTRY_SAME(connect) + ENTRY_SAME(listen) + ENTRY_SAME(access) + ENTRY_SAME(nice) + /* struct sockaddr... */ + ENTRY_SAME(accept) /* 35 */ + ENTRY_SAME(sync) + ENTRY_SAME(kill) + ENTRY_SAME(rename) + ENTRY_SAME(mkdir) + ENTRY_SAME(rmdir) /* 40 */ + ENTRY_SAME(dup) + ENTRY_SAME(pipe) + ENTRY_COMP(times) + /* struct sockaddr... */ + ENTRY_SAME(getsockname) + /* it seems possible brk() could return a >4G pointer... */ + ENTRY_SAME(brk) /* 45 */ + ENTRY_SAME(setgid) + ENTRY_SAME(getgid) + ENTRY_SAME(signal) + ENTRY_SAME(geteuid) + ENTRY_SAME(getegid) /* 50 */ + ENTRY_SAME(acct) + ENTRY_SAME(umount) + /* struct sockaddr... */ + ENTRY_SAME(getpeername) + ENTRY_COMP(ioctl) + ENTRY_COMP(fcntl) /* 55 */ + ENTRY_SAME(socketpair) + ENTRY_SAME(setpgid) + ENTRY_SAME(send) + ENTRY_SAME(newuname) + ENTRY_SAME(umask) /* 60 */ + ENTRY_SAME(chroot) + ENTRY_SAME(ustat) + ENTRY_SAME(dup2) + ENTRY_SAME(getppid) + ENTRY_SAME(getpgrp) /* 65 */ + ENTRY_SAME(setsid) + ENTRY_SAME(pivot_root) + /* I don't like this */ + ENTRY_UHOH(sgetmask) + ENTRY_UHOH(ssetmask) + ENTRY_SAME(setreuid) /* 70 */ + ENTRY_SAME(setregid) + ENTRY_SAME(mincore) + ENTRY_COMP(sigpending) + ENTRY_SAME(sethostname) + /* Following 3 have linux-common-code structs containing longs -( */ + ENTRY_COMP(setrlimit) /* 75 */ + ENTRY_COMP(getrlimit) + ENTRY_COMP(getrusage) + /* struct timeval and timezone are maybe?? consistent wide and narrow */ + ENTRY_DIFF(gettimeofday) + ENTRY_DIFF(settimeofday) + ENTRY_SAME(getgroups) /* 80 */ + ENTRY_SAME(setgroups) + /* struct socketaddr... */ + ENTRY_SAME(sendto) + ENTRY_SAME(symlink) + /* see stat comment */ + ENTRY_COMP(newlstat) + ENTRY_SAME(readlink) /* 85 */ + ENTRY_SAME(ni_syscall) /* was uselib */ + ENTRY_SAME(swapon) + ENTRY_SAME(reboot) + ENTRY_SAME(mmap2) + ENTRY_SAME(mmap) /* 90 */ + ENTRY_SAME(munmap) + ENTRY_SAME(truncate) + ENTRY_SAME(ftruncate) + ENTRY_SAME(fchmod) + ENTRY_SAME(fchown) /* 95 */ + ENTRY_SAME(getpriority) + ENTRY_SAME(setpriority) + ENTRY_SAME(recv) + ENTRY_COMP(statfs) + ENTRY_COMP(fstatfs) /* 100 */ + ENTRY_SAME(stat64) + ENTRY_SAME(ni_syscall) /* was socketcall */ + ENTRY_SAME(syslog) + /* even though manpage says struct timeval contains longs, ours has + * time_t and suseconds_t -- both of which are safe wide/narrow */ + ENTRY_COMP(setitimer) + ENTRY_COMP(getitimer) /* 105 */ + ENTRY_SAME(capget) + ENTRY_SAME(capset) + ENTRY_OURS(pread64) + ENTRY_OURS(pwrite64) + ENTRY_SAME(getcwd) /* 110 */ + ENTRY_SAME(vhangup) + ENTRY_SAME(fstat64) + ENTRY_SAME(vfork_wrapper) + /* struct rusage contains longs... */ + ENTRY_COMP(wait4) + ENTRY_SAME(swapoff) /* 115 */ + ENTRY_DIFF(sysinfo) + ENTRY_SAME(shutdown) + ENTRY_SAME(fsync) + ENTRY_SAME(madvise) + ENTRY_SAME(clone_wrapper) /* 120 */ + ENTRY_SAME(setdomainname) + ENTRY_DIFF(sendfile) + /* struct sockaddr... */ + ENTRY_SAME(recvfrom) + /* struct timex contains longs */ + ENTRY_DIFF(adjtimex) + ENTRY_SAME(mprotect) /* 125 */ + /* old_sigset_t forced to 32 bits. Beware glibc sigset_t */ + ENTRY_COMP(sigprocmask) + ENTRY_SAME(ni_syscall) /* create_module */ + ENTRY_SAME(init_module) + ENTRY_SAME(delete_module) + ENTRY_SAME(ni_syscall) /* 130: get_kernel_syms */ + /* time_t inside struct dqblk */ + ENTRY_SAME(quotactl) + ENTRY_SAME(getpgid) + ENTRY_SAME(fchdir) + ENTRY_SAME(bdflush) + ENTRY_SAME(sysfs) /* 135 */ + ENTRY_SAME(personality) + ENTRY_SAME(ni_syscall) /* for afs_syscall */ + ENTRY_SAME(setfsuid) + ENTRY_SAME(setfsgid) + /* I think this might work */ + ENTRY_SAME(llseek) /* 140 */ + /* struct linux_dirent has longs, like 'unsigned long d_ino' which + * almost definitely should be 'ino_t d_ino' but it's too late now */ + ENTRY_DIFF(getdents) + /* it is POSSIBLE that select will be OK because even though fd_set + * contains longs, the macros and sizes are clever. */ + ENTRY_DIFF(select) + ENTRY_SAME(flock) + ENTRY_SAME(msync) + /* struct iovec contains pointers */ + ENTRY_DIFF(readv) /* 145 */ + ENTRY_DIFF(writev) + ENTRY_SAME(getsid) + ENTRY_SAME(fdatasync) + /* struct __sysctl_args is a mess */ + ENTRY_DIFF(sysctl) + ENTRY_SAME(mlock) /* 150 */ + ENTRY_SAME(munlock) + ENTRY_SAME(mlockall) + ENTRY_SAME(munlockall) + /* struct sched_param is ok for now */ + ENTRY_SAME(sched_setparam) + ENTRY_SAME(sched_getparam) /* 155 */ + ENTRY_SAME(sched_setscheduler) + ENTRY_SAME(sched_getscheduler) + ENTRY_SAME(sched_yield) + ENTRY_SAME(sched_get_priority_max) + ENTRY_SAME(sched_get_priority_min) /* 160 */ + /* These 2 would've worked if someone had defined struct timespec + * carefully, like timeval for example (which is about the same). + * Unfortunately it contains a long :-( */ + ENTRY_DIFF(sched_rr_get_interval) + ENTRY_COMP(nanosleep) + ENTRY_SAME(mremap) + ENTRY_SAME(setresuid) + ENTRY_SAME(getresuid) /* 165 */ + ENTRY_DIFF(sigaltstack_wrapper) + ENTRY_SAME(ni_syscall) /* query_module */ + ENTRY_SAME(poll) + /* structs contain pointers and an in_addr... */ + ENTRY_DIFF(nfsservctl) + ENTRY_SAME(setresgid) /* 170 */ + ENTRY_SAME(getresgid) + ENTRY_SAME(prctl) + /* signals need a careful review */ + ENTRY_SAME(rt_sigreturn_wrapper) + ENTRY_DIFF(rt_sigaction) + ENTRY_DIFF(rt_sigprocmask) /* 175 */ + ENTRY_DIFF(rt_sigpending) + ENTRY_UHOH(rt_sigtimedwait) + /* even though the struct siginfo_t is different, it appears like + * all the paths use values which should be same wide and narrow. + * Also the struct is padded to 128 bytes which means we don't have + * to worry about faulting trying to copy in a larger 64-bit + * struct from a 32-bit user-space app. + */ + ENTRY_SAME(rt_sigqueueinfo) + ENTRY_SAME(rt_sigsuspend_wrapper) /* not really SAME -- see the code */ + ENTRY_SAME(chown) /* 180 */ + /* setsockopt() used by iptables: SO_SET_REPLACE/SO_SET_ADD_COUNTERS */ + ENTRY_COMP(setsockopt) + ENTRY_SAME(getsockopt) + ENTRY_COMP(sendmsg) + ENTRY_COMP(recvmsg) + ENTRY_SAME(semop) /* 185 */ + ENTRY_SAME(semget) + ENTRY_DIFF(semctl_broken) + ENTRY_DIFF(msgsnd) + ENTRY_DIFF(msgrcv) + ENTRY_SAME(msgget) /* 190 */ + ENTRY_SAME(msgctl_broken) + ENTRY_SAME(shmat_wrapper) + ENTRY_SAME(shmdt) + ENTRY_SAME(shmget) + ENTRY_SAME(shmctl_broken) /* 195 */ + ENTRY_SAME(ni_syscall) /* streams1 */ + ENTRY_SAME(ni_syscall) /* streams2 */ + ENTRY_SAME(lstat64) + ENTRY_OURS(truncate64) + ENTRY_OURS(ftruncate64) /* 200 */ + ENTRY_SAME(getdents64) + ENTRY_COMP(fcntl64) + ENTRY_SAME(ni_syscall) + ENTRY_SAME(ni_syscall) + ENTRY_SAME(ni_syscall) /* 205 */ + ENTRY_SAME(gettid) + ENTRY_OURS(readahead) + ENTRY_SAME(ni_syscall) /* tkill */ + + ENTRY_SAME(sendfile64) + ENTRY_COMP(futex) /* 210 */ + ENTRY_COMP(sched_setaffinity) + ENTRY_COMP(sched_getaffinity) + ENTRY_SAME(ni_syscall) + ENTRY_SAME(ni_syscall) + ENTRY_SAME(io_setup) /* 215 */ + ENTRY_SAME(io_destroy) + ENTRY_SAME(io_getevents) + ENTRY_SAME(io_submit) + ENTRY_SAME(io_cancel) + ENTRY_SAME(alloc_hugepages) /* 220 */ + ENTRY_SAME(free_hugepages) + ENTRY_SAME(exit_group) + ENTRY_DIFF(lookup_dcookie) + ENTRY_SAME(epoll_create) + ENTRY_SAME(epoll_ctl) /* 225 */ + ENTRY_SAME(epoll_wait) + ENTRY_SAME(remap_file_pages) diff -Nru a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c --- a/arch/parisc/kernel/time.c Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/kernel/time.c Sun Oct 5 00:33:08 2003 @@ -48,7 +48,9 @@ parisc_do_profile(struct pt_regs *regs) { unsigned long pc = regs->iaoq[0]; +#if 0 extern unsigned long prof_cpu_mask; +#endif extern char _stext; profile_hook(regs); @@ -60,6 +62,10 @@ return; #if 0 + /* FIXME: when we have irq affinity to cpu, we need to + * only look at the cpus specified in this mask + */ + if (!((1 << smp_processor_id()) & prof_cpu_mask)) return; #endif @@ -206,7 +212,6 @@ * done, and then undo it! */ nsec -= gettimeoffset() * 1000; - nsec -= (jiffies - wall_jiffies) * (NSEC_PER_SEC / HZ); wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); @@ -221,6 +226,16 @@ } write_sequnlock_irq(&xtime_lock); return 0; +} + +/* + * XXX: We can do better than this. + * Returns nanoseconds + */ + +unsigned long long sched_clock(void) +{ + return (unsigned long long)jiffies * (1000000000 / HZ); } diff -Nru a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c --- a/arch/parisc/kernel/traps.c Sun Oct 5 00:33:10 2003 +++ b/arch/parisc/kernel/traps.c Sun Oct 5 00:33:10 2003 @@ -678,12 +678,13 @@ } if (user_mode(regs)) { - if (fault_space != regs->sr[7]) { + if ((fault_space>>SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) { #ifdef PRINT_USER_FAULTS if (fault_space == 0) printk(KERN_DEBUG "User Fault on Kernel Space "); else - printk(KERN_DEBUG "User Fault (long pointer) "); + printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ", + code); printk("pid=%d command='%s'\n", current->pid, current->comm); show_regs(regs); #endif diff -Nru a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c --- a/arch/parisc/kernel/unaligned.c Sun Oct 5 00:33:07 2003 +++ b/arch/parisc/kernel/unaligned.c Sun Oct 5 00:33:07 2003 @@ -369,8 +369,8 @@ void handle_unaligned(struct pt_regs *regs) { - unsigned long unaligned_count = 0; - unsigned long last_time = 0; + static unsigned long unaligned_count = 0; + static unsigned long last_time = 0; unsigned long newbase = R1(regs->iir)?regs->gr[R1(regs->iir)]:0; int modify = 0; int ret = -1; @@ -380,7 +380,6 @@ /* if the unaligned access is inside the kernel: * if the access is caused by a syscall, then we fault the calling * user process - * otherwise we halt the kernel */ if (!user_mode(regs)) { @@ -427,10 +426,10 @@ show_regs(regs); #endif } - } - if (!unaligned_enabled) - goto force_sigbus; + if (!unaligned_enabled) + goto force_sigbus; + } /* handle modification - OK, it's ugly, see the instruction manual */ switch (MAJOR_OP(regs->iir)) diff -Nru a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c --- a/arch/parisc/lib/checksum.c Sun Oct 5 00:33:09 2003 +++ b/arch/parisc/lib/checksum.c Sun Oct 5 00:33:09 2003 @@ -16,8 +16,10 @@ * * $Id: checksum.c,v 1.3 1997/12/01 17:57:34 ralf Exp $ */ -#include +#include #include + +#include #include #include #include @@ -109,6 +111,7 @@ return sum; } +EXPORT_SYMBOL(csum_partial_copy_nocheck); /* * Copy from userspace and compute checksum. If we catch an exception @@ -128,3 +131,4 @@ return csum_partial(dst, len, sum); } +EXPORT_SYMBOL(csum_partial_copy_from_user); diff -Nru a/arch/parisc/lib/io.c b/arch/parisc/lib/io.c --- a/arch/parisc/lib/io.c Sun Oct 5 00:33:06 2003 +++ b/arch/parisc/lib/io.c Sun Oct 5 00:33:06 2003 @@ -8,6 +8,7 @@ */ #include +#include #include /* Copies a block of memory to a device in an efficient manner. @@ -457,3 +458,10 @@ break; } } + +EXPORT_SYMBOL(insb); +EXPORT_SYMBOL(insw); +EXPORT_SYMBOL(insl); +EXPORT_SYMBOL(outsb); +EXPORT_SYMBOL(outsw); +EXPORT_SYMBOL(outsl); diff -Nru a/arch/parisc/math-emu/Makefile b/arch/parisc/math-emu/Makefile --- a/arch/parisc/math-emu/Makefile Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/math-emu/Makefile Sun Oct 5 00:33:08 2003 @@ -2,6 +2,11 @@ # Makefile for the linux/parisc floating point code # +# See arch/parisc/math-emu/README +CFLAGS += -Wno-parentheses -Wno-implicit-function-declaration \ + -Wno-uninitialized -Wno-strict-prototypes -Wno-return-type \ + -Wno-implicit-int + obj-y := frnd.o driver.o decode_exc.o fpudispatch.o denormal.o \ dfmpy.o sfmpy.o sfsqrt.o dfsqrt.o dfadd.o fmpyfadd.o \ sfadd.o dfsub.o sfsub.o fcnvfxt.o fcnvff.o fcnvxf.o \ diff -Nru a/arch/parisc/math-emu/denormal.c b/arch/parisc/math-emu/denormal.c --- a/arch/parisc/math-emu/denormal.c Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/math-emu/denormal.c Sun Oct 5 00:33:08 2003 @@ -47,7 +47,7 @@ #include "sgl_float.h" #include "dbl_float.h" #include "hppa.h" -#include "types.h" +#include /* #include */ #undef Fpustatus_register diff -Nru a/arch/parisc/math-emu/fpudispatch.c b/arch/parisc/math-emu/fpudispatch.c --- a/arch/parisc/math-emu/fpudispatch.c Sun Oct 5 00:33:05 2003 +++ b/arch/parisc/math-emu/fpudispatch.c Sun Oct 5 00:33:05 2003 @@ -50,7 +50,7 @@ #define FPUDEBUG 0 #include "float.h" -#include "types.h" +#include #include /* #include */ /* #include */ diff -Nru a/arch/parisc/math-emu/types.h b/arch/parisc/math-emu/types.h --- a/arch/parisc/math-emu/types.h Sun Oct 5 00:33:07 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,25 +0,0 @@ -/* - * Linux/PA-RISC Project (http://www.parisc-linux.org/) - * - * Floating-point emulation code - * Copyright (C) 2001 Hewlett-Packard (Paul Bame) - * - * 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 -#define BUG() do { \ - printk(KERN_ERR "floating-pt emulation BUG at %s:%d!\n", __FILE__, __LINE__); \ -} while (0) diff -Nru a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c --- a/arch/parisc/mm/init.c Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/mm/init.c Sun Oct 5 00:33:08 2003 @@ -430,6 +430,8 @@ & ~(VM_MAP_OFFSET-1))) void *vmalloc_start; +EXPORT_SYMBOL(vmalloc_start); + #ifdef CONFIG_PA11 unsigned long pcxl_dma_start; #endif @@ -617,8 +619,6 @@ static void __init pagetable_init(void) { int range; - - printk("pagetable_init\n"); /* Map each physical memory range to its kernel vaddr */ diff -Nru a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c --- a/arch/parisc/mm/ioremap.c Sun Oct 5 00:33:08 2003 +++ b/arch/parisc/mm/ioremap.c Sun Oct 5 00:33:08 2003 @@ -159,7 +159,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vfree(addr); return NULL; } diff -Nru a/arch/ppc/mm/cachemap.c b/arch/ppc/mm/cachemap.c --- a/arch/ppc/mm/cachemap.c Sun Oct 5 00:33:10 2003 +++ b/arch/ppc/mm/cachemap.c Sun Oct 5 00:33:10 2003 @@ -101,7 +101,7 @@ if (! area) goto out; - va = VMALLOC_VMADDR(area->addr); + va = (unsigned long) area->addr; flags = _PAGE_KERNEL | _PAGE_NO_CACHE; diff -Nru a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c --- a/arch/ppc/mm/pgtable.c Sun Oct 5 00:33:07 2003 +++ b/arch/ppc/mm/pgtable.c Sun Oct 5 00:33:07 2003 @@ -195,7 +195,7 @@ area = get_vm_area(size, VM_IOREMAP); if (area == 0) return NULL; - v = VMALLOC_VMADDR(area->addr); + v = (unsigned long) area->addr; } else { v = (ioremap_bot -= size); } diff -Nru a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c --- a/arch/ppc64/kernel/process.c Sun Oct 5 00:33:08 2003 +++ b/arch/ppc64/kernel/process.c Sun Oct 5 00:33:08 2003 @@ -70,23 +70,6 @@ #endif /* CONFIG_SMP */ } -#ifdef CONFIG_SMP -static void smp_unlazy_onefpu(void *arg) -{ - struct pt_regs *regs = current->thread.regs; - - if (!regs) - return; - if (regs->msr & MSR_FP) - giveup_fpu(current); -} - -void dump_smp_unlazy_fpu(void) -{ - smp_call_function(smp_unlazy_onefpu, NULL, 1, 1); -} -#endif - int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) { struct pt_regs *regs = tsk->thread.regs; diff -Nru a/arch/s390/mm/ioremap.c b/arch/s390/mm/ioremap.c --- a/arch/s390/mm/ioremap.c Sun Oct 5 00:33:06 2003 +++ b/arch/s390/mm/ioremap.c Sun Oct 5 00:33:06 2003 @@ -124,7 +124,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vfree(addr); return NULL; } diff -Nru a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c --- a/arch/sh/mm/ioremap.c Sun Oct 5 00:33:08 2003 +++ b/arch/sh/mm/ioremap.c Sun Oct 5 00:33:08 2003 @@ -149,7 +149,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vfree(addr); return NULL; } diff -Nru a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S --- a/arch/sparc/kernel/entry.S Sun Oct 5 00:33:08 2003 +++ b/arch/sparc/kernel/entry.S Sun Oct 5 00:33:08 2003 @@ -38,7 +38,7 @@ #define curptr g6 -#define NR_SYSCALLS 267 /* Each OS is different... */ +#define NR_SYSCALLS 268 /* Each OS is different... */ /* These are just handy. */ #define _SV save %sp, -STACKFRAME_SZ, %sp diff -Nru a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S --- a/arch/sparc/kernel/systbls.S Sun Oct 5 00:33:08 2003 +++ b/arch/sparc/kernel/systbls.S Sun Oct 5 00:33:08 2003 @@ -72,7 +72,7 @@ /*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl /*255*/ .long sys_nis_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun -/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall +/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_nis_syscall #ifdef CONFIG_SUNOS_EMUL /* Now the SunOS syscall table. */ @@ -171,6 +171,6 @@ .long sunos_nosys /*260*/ .long sunos_nosys, sunos_nosys, sunos_nosys .long sunos_nosys, sunos_nosys, sunos_nosys - .long sunos_nosys, sunos_nosys + .long sunos_nosys, sunos_nosys, sunos_nosys #endif diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig --- a/arch/sparc64/defconfig Sun Oct 5 00:33:07 2003 +++ b/arch/sparc64/defconfig Sun Oct 5 00:33:07 2003 @@ -571,6 +571,7 @@ CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_IP=m +CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_MARK=m CONFIG_BRIDGE_EBT_PKTTYPE=m CONFIG_BRIDGE_EBT_STP=m @@ -665,7 +666,7 @@ # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=m CONFIG_SUNLANCE=y CONFIG_HAPPYMEAL=y CONFIG_SUNBMAC=m @@ -729,15 +730,6 @@ CONFIG_R8169=m # CONFIG_SIS190 is not set CONFIG_SK98LIN=m -CONFIG_CONFIG_SK98LIN_T1=y -CONFIG_CONFIG_SK98LIN_T2=y -CONFIG_CONFIG_SK98LIN_T3=y -CONFIG_CONFIG_SK98LIN_T4=y -CONFIG_CONFIG_SK98LIN_T5=y -CONFIG_CONFIG_SK98LIN_T6=y -CONFIG_CONFIG_SK98LIN_T7=y -CONFIG_CONFIG_SK98LIN_T8=y -CONFIG_CONFIG_SK98LIN_T9=y CONFIG_TIGON3=m # @@ -895,6 +887,30 @@ # CONFIG_VLSI_FIR is not set # +# Bluetooth support +# +CONFIG_BT=m +CONFIG_BT_L2CAP=m +CONFIG_BT_SCO=m +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y + +# +# Bluetooth device drivers +# +CONFIG_BT_HCIUSB=m +CONFIG_BT_USB_SCO=y +# CONFIG_BT_USB_ZERO_PACKET is not set +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_BCSP_TXCRC=y +CONFIG_BT_HCIVHCI=m + +# # ISDN subsystem # CONFIG_ISDN_BOOL=y @@ -1515,30 +1531,6 @@ CONFIG_USB_SPEEDTOUCH=m CONFIG_USB_TEST=m # CONFIG_USB_GADGET is not set - -# -# Bluetooth support -# -CONFIG_BT=m -CONFIG_BT_L2CAP=m -CONFIG_BT_SCO=m -CONFIG_BT_RFCOMM=m -CONFIG_BT_RFCOMM_TTY=y -CONFIG_BT_BNEP=m -CONFIG_BT_BNEP_MC_FILTER=y -CONFIG_BT_BNEP_PROTO_FILTER=y - -# -# Bluetooth device drivers -# -CONFIG_BT_HCIUSB=m -CONFIG_BT_USB_SCO=y -# CONFIG_BT_USB_ZERO_PACKET is not set -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_H4=y -CONFIG_BT_HCIUART_BCSP=y -CONFIG_BT_HCIUART_BCSP_TXCRC=y -CONFIG_BT_HCIVHCI=m # # Watchdog diff -Nru a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S --- a/arch/sparc64/kernel/entry.S Sun Oct 5 00:33:05 2003 +++ b/arch/sparc64/kernel/entry.S Sun Oct 5 00:33:05 2003 @@ -26,7 +26,7 @@ #define curptr g6 -#define NR_SYSCALLS 267 /* Each OS is different... */ +#define NR_SYSCALLS 268 /* Each OS is different... */ .text .align 32 diff -Nru a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c --- a/arch/sparc64/kernel/module.c Sun Oct 5 00:33:09 2003 +++ b/arch/sparc64/kernel/module.c Sun Oct 5 00:33:09 2003 @@ -14,6 +14,9 @@ #include #include +#include +#include + static struct vm_struct * modvmlist = NULL; static void module_unmap(void * addr) @@ -279,6 +282,16 @@ const Elf_Shdr *sechdrs, struct module *me) { + /* Cheetah's I-cache is fully coherent. */ + if (tlb_type == spitfire) { + unsigned long va; + + flushw_all(); + for (va = 0; va < (PAGE_SIZE << 1); va += 32) + spitfire_put_icache_tag(va, 0x0); + __asm__ __volatile__("flush %g6"); + } + return 0; } diff -Nru a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c --- a/arch/sparc64/kernel/smp.c Sun Oct 5 00:33:05 2003 +++ b/arch/sparc64/kernel/smp.c Sun Oct 5 00:33:05 2003 @@ -118,7 +118,6 @@ inherit_locked_prom_mappings(0); - __flush_cache_all(); __flush_tlb_all(); smp_setup_percpu_timer(); @@ -661,7 +660,6 @@ extern unsigned long xcall_flush_tlb_kernel_range; extern unsigned long xcall_flush_tlb_all_spitfire; extern unsigned long xcall_flush_tlb_all_cheetah; -extern unsigned long xcall_flush_cache_all_spitfire; extern unsigned long xcall_report_regs; extern unsigned long xcall_receive_signal; extern unsigned long xcall_flush_dcache_page_cheetah; @@ -774,15 +772,6 @@ void smp_report_regs(void) { smp_cross_call(&xcall_report_regs, 0, 0, 0); -} - -void smp_flush_cache_all(void) -{ - /* Cheetah need do nothing. */ - if (tlb_type == spitfire) { - smp_cross_call(&xcall_flush_cache_all_spitfire, 0, 0, 0); - __flush_cache_all(); - } } void smp_flush_tlb_all(void) diff -Nru a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S --- a/arch/sparc64/kernel/systbls.S Sun Oct 5 00:33:08 2003 +++ b/arch/sparc64/kernel/systbls.S Sun Oct 5 00:33:08 2003 @@ -72,7 +72,7 @@ /*250*/ .word sys32_mremap, sys32_sysctl, sys_getsid, sys_fdatasync, sys32_nfsservctl .word sys_ni_syscall, compat_clock_settime, compat_clock_gettime, compat_clock_getres, compat_clock_nanosleep /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, compat_timer_settime, compat_timer_gettime, sys_timer_getoverrun - .word sys_timer_delete, sys32_timer_create, sys_ni_syscall + .word sys_timer_delete, sys32_timer_create, sys_ni_syscall, sys_ni_syscall /* Now the 64-bit native Linux syscall table. */ @@ -133,7 +133,7 @@ /*250*/ .word sys64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl .word sys_ni_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep /*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun - .word sys_timer_delete, sys_timer_create, sys_ni_syscall + .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_ni_syscall #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ defined(CONFIG_SOLARIS_EMUL_MODULE) @@ -233,5 +233,6 @@ .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys + .word sunos_nosys #endif diff -Nru a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c --- a/arch/sparc64/mm/init.c Sun Oct 5 00:33:08 2003 +++ b/arch/sparc64/mm/init.c Sun Oct 5 00:33:08 2003 @@ -1025,19 +1025,6 @@ } } -void __flush_cache_all(void) -{ - /* Cheetah should be fine here too. */ - if (tlb_type == spitfire) { - unsigned long va; - - flushw_all(); - for (va = 0; va < (PAGE_SIZE << 1); va += 32) - spitfire_put_icache_tag(va, 0x0); - __asm__ __volatile__("flush %g6"); - } -} - /* If not locked, zap it. */ void __flush_tlb_all(void) { diff -Nru a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S --- a/arch/sparc64/mm/ultra.S Sun Oct 5 00:33:09 2003 +++ b/arch/sparc64/mm/ultra.S Sun Oct 5 00:33:09 2003 @@ -721,20 +721,6 @@ stxa %g0, [%g2] ASI_IMMU_DEMAP retry - .globl xcall_flush_cache_all_spitfire -xcall_flush_cache_all_spitfire: - sethi %hi(16383), %g2 - or %g2, %lo(16383), %g2 - clr %g3 -1: stxa %g0, [%g3] ASI_IC_TAG - membar #Sync - add %g3, 32, %g3 - cmp %g3, %g2 - bleu,pt %xcc, 1b - nop - flush %g6 - retry - /* These just get rescheduled to PIL vectors. */ .globl xcall_call_function xcall_call_function: diff -Nru a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c --- a/arch/x86_64/ia32/ia32_binfmt.c Sun Oct 5 00:33:05 2003 +++ b/arch/x86_64/ia32/ia32_binfmt.c Sun Oct 5 00:33:05 2003 @@ -82,9 +82,12 @@ int i; \ Elf32_Off ofs = 0; \ for (i = 0; i < VSYSCALL32_EHDR->e_phnum; ++i) { \ - struct elf_phdr phdr = vsyscall_phdrs[i]; \ + struct elf32_phdr phdr = vsyscall_phdrs[i]; \ if (phdr.p_type == PT_LOAD) { \ + BUG_ON(ofs != 0); \ ofs = phdr.p_offset = offset; \ + phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \ + phdr.p_filesz = phdr.p_memsz; \ offset += phdr.p_filesz; \ } \ else \ @@ -99,10 +102,10 @@ (const struct elf32_phdr *) (VSYSCALL32_BASE \ + VSYSCALL32_EHDR->e_phoff); \ int i; \ - for (i = 0; i < VSYSCALL32_EHDR->e_phnum; ++i) { \ + for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ if (vsyscall_phdrs[i].p_type == PT_LOAD) \ DUMP_WRITE((void *) (u64) vsyscall_phdrs[i].p_vaddr, \ - vsyscall_phdrs[i].p_filesz); \ + PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ } \ } while (0) diff -Nru a/arch/x86_64/kernel/i387.c b/arch/x86_64/kernel/i387.c --- a/arch/x86_64/kernel/i387.c Sun Oct 5 00:33:07 2003 +++ b/arch/x86_64/kernel/i387.c Sun Oct 5 00:33:07 2003 @@ -138,12 +138,3 @@ } return fpvalid; } - -#ifdef CONFIG_SMP -void dump_smp_unlazy_fpu(void) -{ - unlazy_fpu(current); - return; -} -#endif - diff -Nru a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c --- a/arch/x86_64/mm/ioremap.c Sun Oct 5 00:33:10 2003 +++ b/arch/x86_64/mm/ioremap.c Sun Oct 5 00:33:10 2003 @@ -159,7 +159,7 @@ if (!area) return NULL; addr = area->addr; - if (remap_area_pages(VMALLOC_VMADDR(addr), phys_addr, size, flags)) { + if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) { vunmap(addr); return NULL; } diff -Nru a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig --- a/drivers/acpi/Kconfig Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/Kconfig Sun Oct 5 00:33:10 2003 @@ -3,34 +3,14 @@ # menu "ACPI (Advanced Configuration and Power Interface) Support" - -config ACPI_HT - bool "ACPI Processor Enumeration for HT" - depends on X86 - default y - ---help--- - ACPI enumerates both logical (a.k.a. Hyper-Threaded -- HT) - and physical processors. It is designed to obsolete several older - specifications, including the MultiProcessor Specification (MPS), - which supported only physical processors. - - CONFIG_ACPI_HT includes the minimal ACPI boot-time code - necessary to enumerate logical processors and enable HT. - - CONFIG_ACPI includes CONFIG_ACPI_HT, plus IO APIC enumeration, - and the hooks to run the ACPI AML interpreter for run-time events. - - When CONFIG_ACPI is selected, the command-line option "acpi=ht" - is available to run just the ACPI boot-time code -- just as if - only CONFIG_ACPI_HT were selected. - - Note that "acpi=off" can be used to disable all ACPI code in the kernel. - -config ACPI - bool "Full ACPI Support" depends on !X86_VISWS depends on !IA64_HP_SIM - depends on IA64 || (X86 || ACPI_HT) + depends on IA64 || X86 + +config ACPI + bool "ACPI Support" + depends on IA64 || X86 + default y ---help--- Advanced Configuration and Power Interface (ACPI) support for @@ -62,12 +42,19 @@ config ACPI_BOOT bool - depends on ACPI || ACPI_HT + depends on ACPI || X86_HT + default y + +config ACPI_INTERPRETER + bool + depends on ACPI + depends on !IA64_SGI_SN default y config ACPI_SLEEP bool "Sleep States (EXPERIMENTAL)" depends on X86 && ACPI + depends on ACPI_INTERPRETER depends on EXPERIMENTAL && PM default y ---help--- @@ -93,7 +80,8 @@ config ACPI_AC tristate "AC Adapter" - depends on X86 && ACPI + depends on X86 + depends on ACPI_INTERPRETER default m help This driver adds support for the AC Adapter object, which indicates @@ -102,7 +90,8 @@ config ACPI_BATTERY tristate "Battery" - depends on X86 && ACPI + depends on X86 + depends on ACPI_INTERPRETER default m help This driver adds support for battery information through @@ -111,7 +100,7 @@ config ACPI_BUTTON tristate "Button" - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default m help @@ -123,7 +112,7 @@ config ACPI_FAN tristate "Fan" - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default m help @@ -132,7 +121,7 @@ config ACPI_PROCESSOR tristate "Processor" - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default m help @@ -152,14 +141,15 @@ config ACPI_NUMA bool "NUMA support" - depends on ACPI + depends on ACPI_INTERPRETER depends on NUMA depends on !X86_64 default y if IA64_GENERIC || IA64_SGI_SN2 config ACPI_ASUS tristate "ASUS/Medion Laptop Extras" - depends on X86 && ACPI + depends on X86 + depends on ACPI_INTERPRETER default m ---help--- This driver provides support for extra features of ACPI-compatible @@ -170,6 +160,9 @@ display brightness and output, switching the LCD backlight on and off, and most importantly, allows you to blink those fancy LEDs intended for reporting mail and wireless status. + + Note: display switching code is currently considered EXPERIMENTAL, + toying with these values may even lock your machine. All settings are changed via /proc/acpi/asus directory entries. Owner and group for these entries can be set with asus_uid and asus_gid @@ -185,7 +178,8 @@ config ACPI_TOSHIBA tristate "Toshiba Laptop Extras" - depends on X86 && ACPI + depends on X86 + depends on ACPI_INTERPRETER default m ---help--- This driver adds support for access to certain system settings @@ -212,7 +206,7 @@ config ACPI_DEBUG bool "Debug Statements" - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default n help @@ -222,19 +216,14 @@ config ACPI_BUS bool - depends on ACPI - depends on !IA64_SGI_SN - default y - -config ACPI_INTERPRETER - bool - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default y config ACPI_EC bool - depends on X86 && ACPI + depends on X86 + depends on ACPI_INTERPRETER default y help This driver is required on some systems for the proper operation of @@ -243,19 +232,19 @@ config ACPI_POWER bool - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default y config ACPI_PCI bool - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default PCI config ACPI_SYSTEM bool - depends on ACPI + depends on ACPI_INTERPRETER depends on !IA64_SGI_SN default y help @@ -264,9 +253,21 @@ config ACPI_EFI bool - depends on ACPI + depends on ACPI_INTERPRETER depends on IA64 default y + +config ACPI_RELAXED_AML + bool "Relaxed AML" + depends on ACPI_INTERPRETER + depends on !IA64_SGI_SN + default n + help + If you say `Y' here, the ACPI interpreter will relax its checking + for valid AML and will ignore some AML mistakes, such as off-by-one + errors in region sizes. Some laptops may require this option. In + particular, many Toshiba laptops require this for correct operation + of the AC module. endmenu diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile --- a/drivers/acpi/Makefile Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/Makefile Sun Oct 5 00:33:10 2003 @@ -18,7 +18,7 @@ # ACPI Boot-Time Table Parsing # obj-$(CONFIG_ACPI_BOOT) += tables.o -obj-$(CONFIG_ACPI) += blacklist.o +obj-$(CONFIG_ACPI_INTERPRETER) += blacklist.o # # ACPI Core Subsystem (Interpreter) diff -Nru a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c --- a/drivers/acpi/asus_acpi.c Sun Oct 5 00:33:07 2003 +++ b/drivers/acpi/asus_acpi.c Sun Oct 5 00:33:07 2003 @@ -26,13 +26,17 @@ * Johann Wiesner - Small compile fixes * John Belmonte - ACPI code for Toshiba laptop was a good starting point. * - * TODO + * TODO: * add Fn key status - * Add mode selection on module loading (parameter) -> still necessary ? + * Add mode selection on module loading (parameter) -> still necessary? * Complete display switching -- may require dirty hacks? - * */ +#include +#if defined (CONFIG_MODVERSIONS) && !defined (MODVERSIONS) && defined (MODULE) +#include +#endif + #include #include #include @@ -41,7 +45,7 @@ #include #include -#define ASUS_ACPI_VERSION "0.24a" +#define ASUS_ACPI_VERSION "0.26" #define PROC_ASUS "asus" //the directory #define PROC_MLED "mled" @@ -110,20 +114,24 @@ struct model_data *methods; //methods available on the laptop u8 brightness; //brighness level enum { - L2X = 0, //L200D -> TODO check Q11 (Fn+F8) - // Calling this method simply hang the + A1X=0, //A1340D, A1300F + A2X, //A2500H + D1X, //D1 + L1X, //L1400B + L2X, //L2000D -> TODO check Q11 (Fn+F8) + // Calling this method simply hangs the // computer, ISMI method hangs the laptop. - L3X, //L3C L3D, //L3400D + L3X, //L3C + L5X, //L5C TODO this model seems to have one more + // LED, add support M2X, //M2400E + M3N, //M3700N, but also S1300N -> TODO WLED S1X, //S1300A -> TODO special keys do not work ? - D1X, //D1 - L1X, //L1400B - A1X, //A1340D, A1300F - J1X, //S200 (J1) - //TODO A1370D does not seems to have a ATK device + S2X, //S200 (J1 reported), Victor MP-XP7210 + //TODO A1370D does not seem to have an ATK device // L8400 model doesn't have ATK - END_MODEL, + END_MODEL } model; //Models currently supported u16 event_count[128]; //count for each event TODO make this better }; @@ -133,7 +141,8 @@ #define S1X_PREFIX "\\_SB.PCI0.PX40." #define L1X_PREFIX S1X_PREFIX #define A1X_PREFIX "\\_SB.PCI0.ISA.EC0." -#define J1X_PREFIX A1X_PREFIX +#define S2X_PREFIX A1X_PREFIX +#define M3N_PREFIX "\\_SB.PCI0.SBRG.EC0." static struct model_data model_conf[END_MODEL] = { /* @@ -147,33 +156,43 @@ * it seems to be a kind of switch, but what for ? * */ + {"A1X", "MLED", "\\MAIL", NULL, NULL, A1X_PREFIX "_Q10", "\\BKLI", + A1X_PREFIX "_Q0E", A1X_PREFIX "_Q0F", NULL, NULL, NULL, NULL, NULL}, + + {"A2X", "MLED", NULL, "WLED", "\\SG66", "\\Q10", "\\BAOF", + "\\Q0E", "\\Q0F", "SPLV", "GPLV", "\\CMOD", "SDSP", "\\INFB"}, + + {"D1X", "MLED", NULL, NULL, NULL, "\\Q0D", "\\GP11", + "\\Q0C", "\\Q0B", NULL, NULL, "\\BLVL", "SDSP","\\INFB"}, + + {"L1X", "MLED", NULL, "WLED", NULL, L1X_PREFIX "Q10", "\\PNOF", + L1X_PREFIX "Q0F", L1X_PREFIX "Q0E", "SPLV", "GPLV", "\\BRIT", NULL, NULL}, + {"L2X", "MLED", "\\SGP6", "WLED", "\\RCP3", "\\Q10", "\\SGP0", "\\Q0E", "\\Q0F", NULL, NULL, NULL, "SDSP", "\\INFB"}, + {"L3D", "MLED", "\\MALD", "WLED", NULL, "\\Q10", "\\BKLG", + "\\Q0E", "\\Q0F", "SPLV", "GPLV", "\\BLVL", "SDSP", "\\INFB"}, + {"L3X", "MLED", NULL, "WLED", NULL, L3X_PREFIX "_Q10", "\\GL32", L3X_PREFIX "_Q0F", L3X_PREFIX "_Q0E", "SPLV", "GPLV", "\\BLVL", "SDSP", "\\_SB.PCI0.PCI1.VGAC.NMAP"}, - {"L3D", "MLED", "\\MALD", "WLED", NULL, "\\Q10", "\\BKLG", - "\\Q0E", "\\Q0F", "SPLV", "GPLV", "\\BLVL", "SDSP", "\\INFB"}, - + {"L5X", "MLED", NULL, "WLED", "WRED", "\\Q0D", "\\BAOF", + "\\Q0C","\\Q0B", "SPLV", "GPLV", NULL, "SDSP", "\\INFB"}, + {"M2X", "MLED", NULL, "WLED", NULL, "\\Q10", "\\GP06", "\\Q0E","\\Q0F", "SPLV", "GPLV", NULL, "SDSP", "\\INFB"}, + + {"M3N", "MLED", NULL, "WLED", "\\PO33", M3N_PREFIX "_Q10", "\\BKLT", + M3N_PREFIX "_Q0F", M3N_PREFIX "_Q0E", "SPLV", "GPLV", "\\LBTN", "SDSP", + "\\ADVG"}, {"S1X", "MLED", "\\EMLE", "WLED", NULL, S1X_PREFIX "Q10", "\\PNOF", S1X_PREFIX "Q0F", S1X_PREFIX "Q0E", "SPLV", "GPLV", "\\BRIT", NULL, NULL}, - {"D1X", "MLED", NULL, NULL, NULL, "\\Q0D", "\\GP11", - "\\Q0C", "\\Q0B", NULL, NULL, "\\BLVL", "SDSP","\\INFB"}, - - {"L1X", "MLED", NULL, "WLED", NULL, L1X_PREFIX "Q10", "\\PNOF", - L1X_PREFIX "Q0F", L1X_PREFIX "Q0E", "SPLV", "GPLV", "\\BRIT", NULL, NULL}, - - {"A1X", "MLED", "\\MAIL", NULL, NULL, A1X_PREFIX "_Q10", "\\BKLI", - A1X_PREFIX "_Q0E", A1X_PREFIX "_Q0F", NULL, NULL, NULL, NULL, NULL}, - - {"J1X", "MLED", "\\MAIL", NULL, NULL, J1X_PREFIX "_Q10", "\\BKLI", - J1X_PREFIX "_Q0B", J1X_PREFIX "_Q0A", NULL, NULL, NULL, NULL, NULL} + {"S2X", "MLED", "\\MAIL", NULL, NULL, S2X_PREFIX "_Q10", "\\BKLI", + S2X_PREFIX "_Q0B", S2X_PREFIX "_Q0A", NULL, NULL, NULL, NULL, NULL} }; /* procdir we use */ @@ -234,7 +253,7 @@ output.length = sizeof(out_obj); output.pointer = &out_obj; - status = acpi_evaluate_object(handle, (char*) method, NULL, &output); + status = acpi_evaluate_object(handle, (char *) method, NULL, &output); *val = out_obj.integer.value; return (status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER); } @@ -249,6 +268,7 @@ void *data) { int len = 0; + int sfun; struct asus_hotk *hotk = (struct asus_hotk *) data; char buf[16]; //enough for all info /* @@ -257,28 +277,27 @@ */ len += sprintf(page, ACPI_HOTK_NAME " " ASUS_ACPI_VERSION "\n"); - len += - sprintf(page + len, "Model reference : %s\n", - hotk->methods->name); + len += sprintf(page + len, "Model reference : %s\n", + hotk->methods->name); + if(read_acpi_int(hotk->handle, "SFUN", &sfun)) + len += sprintf(page + len, "SFUN value : 0x%04x\n", sfun); if (asus_info) { - snprintf(buf, 5, "%s", asus_info->signature); - len += sprintf(page + len, "ACPI signature : %s\n", buf); snprintf(buf, 16, "%d", asus_info->length); - len += sprintf(page + len, "Table length : %s\n", buf); - snprintf(buf, 16, "%d", asus_info->revision); - len += sprintf(page + len, "ACPI minor version : %s\n", buf); + len += sprintf(page + len, "DSDT length : %s\n", buf); snprintf(buf, 16, "%d", asus_info->checksum); - len += sprintf(page + len, "Checksum : %s\n", buf); + len += sprintf(page + len, "DSDT checksum : %s\n", buf); + snprintf(buf, 16, "%d", asus_info->revision); + len += sprintf(page + len, "DSDT revision : %s\n", buf); snprintf(buf, 7, "%s", asus_info->oem_id); - len += sprintf(page + len, "OEM identification : %s\n", buf); + len += sprintf(page + len, "OEM id : %s\n", buf); snprintf(buf, 9, "%s", asus_info->oem_table_id); len += sprintf(page + len, "OEM table id : %s\n", buf); snprintf(buf, 16, "%x", asus_info->oem_revision); - len += sprintf(page + len, "OEM rev number : 0x%s\n", buf); + len += sprintf(page + len, "OEM revision : 0x%s\n", buf); snprintf(buf, 5, "%s", asus_info->asl_compiler_id); - len += sprintf(page + len, "ASL comp vendor ID : %s\n", buf); + len += sprintf(page + len, "ASL comp vendor id : %s\n", buf); snprintf(buf, 16, "%x", asus_info->asl_compiler_revision); - len += sprintf(page + len, "ASL comp rev number: 0x%s\n", buf); + len += sprintf(page + len, "ASL comp revision : 0x%s\n", buf); } return len; @@ -304,7 +323,7 @@ &led_status)) len = sprintf(page, "%d\n", led_status); else - printk(KERN_NOTICE "Asus ACPI: Error reading MLED " + printk(KERN_WARNING "Asus ACPI: Error reading MLED " "status\n"); } else { len = sprintf(page, "%d\n", (hotk->status & MLED_ON) ? 1 : 0); @@ -334,7 +353,7 @@ /* We don't have to check mt_mled exists if we are here :) */ if (!write_acpi_int(hotk->handle, hotk->methods->mt_mled, led_out, NULL)) - printk(KERN_NOTICE "Asus ACPI: MLED write failed\n"); + printk(KERN_WARNING "Asus ACPI: MLED write failed\n"); @@ -355,11 +374,11 @@ int led_status; if (hotk->methods->wled_status) { - if (read_acpi_int(NULL, hotk->methods->mled_status, + if (read_acpi_int(NULL, hotk->methods->wled_status, &led_status)) len = sprintf(page, "%d\n", led_status); else - printk(KERN_NOTICE "Asus ACPI: Error reading WLED " + printk(KERN_WARNING "Asus ACPI: Error reading WLED " "status\n"); } else { len = sprintf(page, "%d\n", (hotk->status & WLED_ON) ? 1 : 0); @@ -386,7 +405,7 @@ /* We don't have to check if mt_wled exists if we are here :) */ if (!write_acpi_int(hotk->handle, hotk->methods->mt_wled, led_out, NULL)) - printk(KERN_NOTICE "Asus ACPI: WLED write failed\n"); + printk(KERN_WARNING "Asus ACPI: WLED write failed\n"); return count; @@ -399,7 +418,7 @@ /* We don't have to check anything, if we are here */ if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd)) - printk(KERN_NOTICE "Asus ACPI: Error reading LCD status\n"); + printk(KERN_WARNING "Asus ACPI: Error reading LCD status\n"); if (hotk->model == L2X) lcd = ~lcd; @@ -438,7 +457,7 @@ acpi_evaluate_object(NULL, hotk->methods->mt_lcd_switch, NULL, NULL); if (ACPI_FAILURE(status)) - printk(KERN_NOTICE "Asus ACPI: Error switching LCD\n"); + printk(KERN_WARNING "Asus ACPI: Error switching LCD\n"); } return count; @@ -452,15 +471,15 @@ { acpi_status status = 0; - /* ATKD laptop */ + /* SPLV laptop */ if(hotk->methods->brightness_set) { if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set, value, NULL)) - printk(KERN_NOTICE "Asus ACPI: Error changing brightness\n"); + printk(KERN_WARNING "Asus ACPI: Error changing brightness\n"); return; } - /* HOTK laptop if we are here, act as appropriate */ + /* No SPLV method if we are here, act as appropriate */ value -= hotk->brightness; while (value != 0) { status = acpi_evaluate_object(NULL, (value > 0) ? @@ -469,7 +488,7 @@ NULL, NULL); (value > 0) ? value-- : value++; if (ACPI_FAILURE(status)) - printk(KERN_NOTICE "Asus ACPI: Error changing brightness\n"); + printk(KERN_WARNING "Asus ACPI: Error changing brightness\n"); } return; } @@ -478,15 +497,15 @@ { int value; - if(hotk->methods->brightness_get) { /* ATKD laptop */ + if(hotk->methods->brightness_get) { /* SPLV/GPLV laptop */ if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, &value)) - printk(KERN_NOTICE "Asus ACPI: Error reading brightness\n"); + printk(KERN_WARNING "Asus ACPI: Error reading brightness\n"); } else if (hotk->methods->brightness_status) { /* For D1 for example */ if (!read_acpi_int(NULL, hotk->methods->brightness_status, &value)) - printk(KERN_NOTICE "Asus ACPI: Error reading brightness\n"); - } else /* HOTK laptop */ + printk(KERN_WARNING "Asus ACPI: Error reading brightness\n"); + } else /* No GPLV method */ value = hotk->brightness; return value; } @@ -512,7 +531,7 @@ /* 0 <= value <= 15 */ set_brightness(value, hotk); } else { - printk(KERN_NOTICE "Asus ACPI: Error reading user input\n"); + printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); } return count; @@ -523,7 +542,7 @@ /* no sanity check needed for now */ if (!write_acpi_int(hotk->handle, hotk->methods->display_set, value, NULL)) - printk(KERN_NOTICE "Asus ACPI: Error setting display\n"); + printk(KERN_WARNING "Asus ACPI: Error setting display\n"); return; } @@ -540,12 +559,12 @@ struct asus_hotk *hotk = (struct asus_hotk *) data; if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value)) - printk(KERN_NOTICE "Asus ACPI: Error reading display status\n"); + printk(KERN_WARNING "Asus ACPI: Error reading display status\n"); return sprintf(page, "%d\n", value); } /* - * Preliminary support for display switching. As of now: 0x01 should activate + * Experimental support for display switching. As of now: 0x01 should activate * the LCD output, 0x02 should do for CRT, and 0x04 for TV-Out. Any combination * (bitwise) of these will suffice. I never actually tested 3 displays hooked up * simultaneously, so be warned. @@ -562,13 +581,13 @@ if (sscanf(buffer, "%d", &value) == 1) set_display(value, hotk); else { - printk(KERN_NOTICE "Asus ACPI: Error reading user input\n"); + printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); } return count; } -static int asus_hotk_add_fs(struct acpi_device *device) +static int __init asus_hotk_add_fs(struct acpi_device *device) { struct proc_dir_entry *proc; struct asus_hotk *hotk = acpi_driver_data(device); @@ -582,7 +601,7 @@ if ((asus_uid == 0) && (asus_gid == 0)){ mode = S_IFREG | S_IRUGO | S_IWUGO; - }else{ + } else { mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; } @@ -598,7 +617,7 @@ proc->uid = asus_uid; proc->gid = asus_gid;; } else { - printk(KERN_NOTICE " Unable to create " PROC_INFOS + printk(KERN_WARNING " Unable to create " PROC_INFOS " fs entry\n"); } @@ -612,7 +631,7 @@ proc->uid = asus_uid; proc->gid = asus_gid;; } else { - printk(KERN_NOTICE " Unable to create " PROC_WLED + printk(KERN_WARNING " Unable to create " PROC_WLED " fs entry\n"); } } @@ -627,7 +646,7 @@ proc->uid = asus_uid; proc->gid = asus_gid;; } else { - printk(KERN_NOTICE " Unable to create " PROC_MLED + printk(KERN_WARNING " Unable to create " PROC_MLED " fs entry\n"); } } @@ -646,7 +665,7 @@ proc->uid = asus_uid; proc->gid = asus_gid;; } else { - printk(KERN_NOTICE " Unable to create " PROC_LCD + printk(KERN_WARNING " Unable to create " PROC_LCD " fs entry\n"); } } @@ -662,7 +681,7 @@ proc->uid = asus_uid; proc->gid = asus_gid;; } else { - printk(KERN_NOTICE " Unable to create " PROC_BRN + printk(KERN_WARNING " Unable to create " PROC_BRN " fs entry\n"); } } @@ -677,19 +696,19 @@ proc->uid = asus_uid; proc->gid = asus_gid;; } else { - printk(KERN_NOTICE " Unable to create " PROC_DISP + printk(KERN_WARNING " Unable to create " PROC_DISP " fs entry\n"); } } - return (AE_OK); + return 0; } static void asus_hotk_notify(acpi_handle handle, u32 event, void *data) { /* TODO Find a better way to handle events count. Here, in data, we receive - * the hotk, so we can make anything !! + * the hotk, so we can do anything! */ struct asus_hotk *hotk = (struct asus_hotk *) data; @@ -712,19 +731,40 @@ * This function is used to initialize the hotk with right values. In this * method, we can make all the detection we want, and modify the hotk struct */ -static int asus_hotk_get_info(struct asus_hotk *hotk) +static int __init asus_hotk_get_info(struct asus_hotk *hotk) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *model = NULL; + int bsts_result; + acpi_status status; - /* - * We have to write 0 on init this far for all ASUS models + /* + * Get DSDT headers early enough to allow for differentiating between + * models, but late enough to allow acpi_bus_register_driver() to fail + * before doing anything ACPI-specific. Should we encounter a machine, + * which needs special handling (i.e. its hotkey device has a different + * HID), this bit will be moved. A global variable asus_info contains + * the DSDT header. */ + status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt); + if (ACPI_FAILURE(status)) + printk(KERN_WARNING " Couldn't get the DSDT table header\n"); + else + asus_info = (struct acpi_table_header *) dsdt.pointer; + + /* We have to write 0 on init this far for all ASUS models */ if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { - printk(KERN_NOTICE " Hotkey initialization failed\n"); + printk(KERN_ERR " Hotkey initialization failed\n"); return -ENODEV; } + /* For testing purposes */ + if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result)) + printk(KERN_WARNING " Error calling BSTS\n"); + else if (bsts_result) + printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", bsts_result); + /* * Here, we also use asus_info to make decision. For example, on INIT * method, S1X and L1X models both reports to be L84F, but they don't @@ -749,26 +789,34 @@ hotk->model = L3X; else if (strncmp(model->string.pointer, "M2", 2) == 0) hotk->model = M2X; + else if (strncmp(model->string.pointer, "M3N", 3) == 0 || + strncmp(model->string.pointer, "S1N", 3) == 0) + hotk->model = M3N; /* S1300N is similar enough */ else if (strncmp(model->string.pointer, "L2", 2) == 0) hotk->model = L2X; - else if (strncmp(model->string.pointer, "L8", 2) == 0) + else if (strncmp(model->string.pointer, "L8", 2) == 0) { /* S1300A reports L84F, but L1400B too */ - if (strncmp(asus_info->oem_table_id, "L1", 2) == 0) - hotk->model = L1X; - else + if (asus_info) { + if (strncmp(asus_info->oem_table_id, "L1", 2) == 0) + hotk->model = L1X; + } else hotk->model = S1X; + } else if (strncmp(model->string.pointer, "D1", 2) == 0) hotk->model = D1X; else if (strncmp(model->string.pointer, "A1", 2) == 0) hotk->model = A1X; + else if (strncmp(model->string.pointer, "A2", 2) == 0) + hotk->model = A2X; else if (strncmp(model->string.pointer, "J1", 2) == 0) - hotk->model = J1X; - + hotk->model = S2X; + else if (strncmp(model->string.pointer, "L5", 2) == 0) + hotk->model = L5X; if (hotk->model == END_MODEL) { /* By default use the same values, as I don't know others */ - printk("unsupported, trying default values, contact the " - "developers\n"); + printk("unsupported, trying default values, supply the " + "developers with your DSDT\n"); hotk->model = L2X; } else { printk("supported\n"); @@ -783,7 +831,7 @@ -static int asus_hotk_check(struct asus_hotk *hotk) +static int __init asus_hotk_check(struct asus_hotk *hotk) { int result = 0; @@ -797,7 +845,7 @@ if (hotk->device->status.present) { result = asus_hotk_get_info(hotk); } else { - printk(KERN_NOTICE " Hotkey device not present, aborting\n"); + printk(KERN_ERR " Hotkey device not present, aborting\n"); return(-EINVAL); } @@ -806,7 +854,7 @@ -static int asus_hotk_add(struct acpi_device *device) +static int __init asus_hotk_add(struct acpi_device *device) { struct asus_hotk *hotk = NULL; acpi_status status = AE_OK; @@ -815,6 +863,9 @@ if (!device) return(-EINVAL); + printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n", + ASUS_ACPI_VERSION); + hotk = (struct asus_hotk *) kmalloc(sizeof(struct asus_hotk), GFP_KERNEL); if (!hotk) @@ -842,25 +893,23 @@ */ status = acpi_install_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY, asus_hotk_notify, hotk); - if (ACPI_FAILURE(status)) { - printk(KERN_NOTICE - " Error installing notify handler\n"); - } else { - printk(KERN_DEBUG - " Notify Handler installed successfully\n"); - } + if (ACPI_FAILURE(status)) + printk(KERN_ERR " Error installing notify handler\n"); - /* For HOTK laptops: init the hotk->brightness value */ + /* For laptops without GPLV: init the hotk->brightness value */ if ((!hotk->methods->brightness_get) && (!hotk->methods->brightness_status) && (hotk->methods->brightness_up && hotk->methods->brightness_down)) { status = acpi_evaluate_object(NULL, hotk->methods->brightness_down, NULL, NULL); if (ACPI_FAILURE(status)) - printk(KERN_NOTICE " Error changing brightness\n"); - status = acpi_evaluate_object(NULL, hotk->methods->brightness_up, - NULL, NULL); - if (ACPI_FAILURE(status)) - printk(KERN_NOTICE " Error changing brightness\n"); + printk(KERN_WARNING " Error changing brightness\n"); + else { + status = acpi_evaluate_object(NULL, hotk->methods->brightness_up, + NULL, NULL); + if (ACPI_FAILURE(status)) + printk(KERN_WARNING " Strange, error changing" + " brightness\n"); + } } end: @@ -887,7 +936,7 @@ status = acpi_remove_notify_handler(hotk->handle, ACPI_SYSTEM_NOTIFY, asus_hotk_notify); if (ACPI_FAILURE(status)) - printk(KERN_NOTICE "Error removing notify handler\n"); + printk(KERN_ERR "Asus ACPI: Error removing notify handler\n"); kfree(hotk); @@ -899,35 +948,17 @@ static int __init asus_acpi_init(void) { - int result = 0; - acpi_status status = 0; - struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL }; - - printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n", - ASUS_ACPI_VERSION); - /* - * Here is the code to know the model we are running on. We need to - * know this before calling the acpi_bus_register_driver function, in - * case the HID for the laptop we are running on is different from - * ACPI_HOTK_HID, which I have never seen yet :) - * - * This information is then available in the global var asus_info - */ - status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt); - if (ACPI_FAILURE(status)) { - printk(KERN_NOTICE " Couldn't get the DSDT table header\n"); - } else { - asus_info = (struct acpi_table_header *) dsdt.pointer; - } + int result; asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir); - if (!asus_proc_dir) + if (!asus_proc_dir) { + printk(KERN_ERR "Asus ACPI: Unable to create /proc entry"); return(-ENODEV); + } asus_proc_dir->owner = THIS_MODULE; result = acpi_bus_register_driver(&asus_hotk_driver); if (result < 0) { - printk(KERN_NOTICE " Error registering " ACPI_HOTK_NAME " \n"); remove_proc_entry(PROC_ASUS, acpi_root_dir); return(-ENODEV); } diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c --- a/drivers/acpi/bus.c Sun Oct 5 00:33:09 2003 +++ b/drivers/acpi/bus.c Sun Oct 5 00:33:09 2003 @@ -634,8 +634,7 @@ * the EC parameters out of that. */ status = acpi_ec_ecdt_probe(); - if (ACPI_FAILURE(status)) - goto error1; + /* Ignore result. Not having an ECDT is not fatal. */ #endif status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION); diff -Nru a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c --- a/drivers/acpi/dispatcher/dsfield.c Sun Oct 5 00:33:09 2003 +++ b/drivers/acpi/dispatcher/dsfield.c Sun Oct 5 00:33:09 2003 @@ -105,27 +105,33 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } - /* - * During the load phase, we want to enter the name of the field into - * the namespace. During the execute phase (when we evaluate the size - * operand), we want to lookup the name - */ - if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) { - flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE; + if (walk_state->deferred_node) { + node = walk_state->deferred_node; + status = AE_OK; } else { - flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; - } + /* + * During the load phase, we want to enter the name of the field into + * the namespace. During the execute phase (when we evaluate the size + * operand), we want to lookup the name + */ + if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) { + flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE; + } + else { + flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; + } - /* - * Enter the name_string into the namespace - */ - status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, - ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, - flags, walk_state, &(node)); - if (ACPI_FAILURE (status)) { - ACPI_REPORT_NSERROR (arg->common.value.string, status); - return_ACPI_STATUS (status); + /* + * Enter the name_string into the namespace + */ + status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, + ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, + flags, walk_state, &(node)); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_NSERROR (arg->common.value.string, status); + return_ACPI_STATUS (status); + } } /* We could put the returned object (Node) on the object stack for later, but diff -Nru a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c --- a/drivers/acpi/dispatcher/dsinit.c Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/dispatcher/dsinit.c Sun Oct 5 00:33:10 2003 @@ -135,7 +135,7 @@ } /* - * Always parse methods to detect errors, we may delete + * Always parse methods to detect errors, we will delete * the parse tree below */ status = acpi_ds_parse_method (obj_handle); @@ -150,7 +150,7 @@ } /* - * Delete the parse tree. We simple re-parse the method + * Delete the parse tree. We simply re-parse the method * for every execution since there isn't much overhead */ acpi_ns_delete_namespace_subtree (obj_handle); diff -Nru a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c --- a/drivers/acpi/dispatcher/dsopcode.c Sun Oct 5 00:33:09 2003 +++ b/drivers/acpi/dispatcher/dsopcode.c Sun Oct 5 00:33:09 2003 @@ -65,7 +65,7 @@ * * RETURN: Status. * - * DESCRIPTION: Late execution of region or field arguments + * DESCRIPTION: Late (deferred) execution of region or field arguments * ****************************************************************************/ @@ -111,7 +111,10 @@ return_ACPI_STATUS (status); } + /* Mark this parse as a deferred opcode */ + walk_state->parse_flags = ACPI_PARSE_DEFERRED_OP; + walk_state->deferred_node = node; /* Pass1: Parse the entire declaration */ @@ -128,7 +131,7 @@ arg->common.node = node; acpi_ps_delete_parse_tree (op); - /* Evaluate the address and length arguments for the Buffer Field */ + /* Evaluate the deferred arguments */ op = acpi_ps_alloc_op (AML_INT_EVAL_SUBTREE_OP); if (!op) { @@ -144,6 +147,8 @@ return_ACPI_STATUS (AE_NO_MEMORY); } + /* Execute the opcode and arguments */ + status = acpi_ds_init_aml_walk (walk_state, op, NULL, aml_start, aml_length, NULL, NULL, 3); if (ACPI_FAILURE (status)) { @@ -151,6 +156,9 @@ return_ACPI_STATUS (status); } + /* Mark this execution as a deferred opcode */ + + walk_state->deferred_node = node; status = acpi_ps_parse_aml (walk_state); acpi_ps_delete_parse_tree (op); return_ACPI_STATUS (status); @@ -192,7 +200,7 @@ node = obj_desc->buffer_field.node; ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL)); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field JIT Init\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field Arg Init\n", node->name.ascii)); /* Execute the AML code for the term_arg arguments */ @@ -207,7 +215,7 @@ * * FUNCTION: acpi_ds_get_buffer_arguments * - * PARAMETERS: obj_desc - A valid Bufferobject + * PARAMETERS: obj_desc - A valid Buffer object * * RETURN: Status. * @@ -240,7 +248,7 @@ return_ACPI_STATUS (AE_AML_INTERNAL); } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer JIT Init\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n")); /* Execute the AML code for the term_arg arguments */ @@ -254,7 +262,7 @@ * * FUNCTION: acpi_ds_get_package_arguments * - * PARAMETERS: obj_desc - A valid Packageobject + * PARAMETERS: obj_desc - A valid Package object * * RETURN: Status. * @@ -287,7 +295,7 @@ return_ACPI_STATUS (AE_AML_INTERNAL); } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package JIT Init\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n")); /* Execute the AML code for the term_arg arguments */ @@ -335,11 +343,12 @@ node = obj_desc->region.node; - ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL)); + ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL)); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Init at AML %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Arg Init at AML %p\n", node->name.ascii, extra_desc->extra.aml_start)); + /* Execute the argument AML */ status = acpi_ds_execute_arguments (node, acpi_ns_get_parent_node (node), extra_desc->extra.aml_length, extra_desc->extra.aml_start); @@ -505,14 +514,16 @@ goto cleanup; } - /* Entire field must fit within the current length of the buffer */ if ((bit_offset + bit_count) > (8 * (u32) buffer_desc->buffer.length)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Field size %d exceeds Buffer size %d (bits)\n", - bit_offset + bit_count, 8 * (u32) buffer_desc->buffer.length)); + "Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n", + ((struct acpi_namespace_node *) result_desc)->name.ascii, + bit_offset + bit_count, + buffer_desc->buffer.node->name.ascii, + 8 * (u32) buffer_desc->buffer.length)); status = AE_AML_BUFFER_LIMIT; goto cleanup; } diff -Nru a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c --- a/drivers/acpi/dispatcher/dsutils.c Sun Oct 5 00:33:08 2003 +++ b/drivers/acpi/dispatcher/dsutils.c Sun Oct 5 00:33:08 2003 @@ -53,6 +53,7 @@ #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsutils") + #ifndef ACPI_NO_METHOD_EXECUTION /******************************************************************************* @@ -196,7 +197,6 @@ acpi_ps_get_opcode_name (op->common.parent->common.aml_opcode), op)); return_VALUE (FALSE); - } @@ -239,7 +239,6 @@ return_VOID; } - if (!acpi_ds_is_result_used (op, walk_state)) { /* * Must pop the result stack (obj_desc should be equal to result_obj) @@ -389,61 +388,77 @@ * in name_string */ + /* - * Differentiate between a namespace "create" operation - * versus a "lookup" operation (IMODE_LOAD_PASS2 vs. - * IMODE_EXECUTE) in order to support the creation of - * namespace objects during the execution of control methods. + * Special handling for buffer_field declarations. This is a deferred + * opcode that unfortunately defines the field name as the last + * parameter instead of the first. We get here when we are performing + * the deferred execution, so the actual name of the field is already + * in the namespace. We don't want to attempt to look it up again + * because we may be executing in a different scope than where the + * actual opcode exists. */ - parent_op = arg->common.parent; - op_info = acpi_ps_get_opcode_info (parent_op->common.aml_opcode); - if ((op_info->flags & AML_NSNODE) && - (parent_op->common.aml_opcode != AML_INT_METHODCALL_OP) && - (parent_op->common.aml_opcode != AML_REGION_OP) && - (parent_op->common.aml_opcode != AML_INT_NAMEPATH_OP)) { - /* Enter name into namespace if not found */ - - interpreter_mode = ACPI_IMODE_LOAD_PASS2; + if ((walk_state->deferred_node) && + (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD) && + (arg_index != 0)) { + obj_desc = ACPI_CAST_PTR (union acpi_operand_object, walk_state->deferred_node); + status = AE_OK; } + else /* All other opcodes */ { + /* + * Differentiate between a namespace "create" operation + * versus a "lookup" operation (IMODE_LOAD_PASS2 vs. + * IMODE_EXECUTE) in order to support the creation of + * namespace objects during the execution of control methods. + */ + parent_op = arg->common.parent; + op_info = acpi_ps_get_opcode_info (parent_op->common.aml_opcode); + if ((op_info->flags & AML_NSNODE) && + (parent_op->common.aml_opcode != AML_INT_METHODCALL_OP) && + (parent_op->common.aml_opcode != AML_REGION_OP) && + (parent_op->common.aml_opcode != AML_INT_NAMEPATH_OP)) { + /* Enter name into namespace if not found */ - else { - /* Return a failure if name not found */ - - interpreter_mode = ACPI_IMODE_EXECUTE; - } + interpreter_mode = ACPI_IMODE_LOAD_PASS2; + } + else { + /* Return a failure if name not found */ - status = acpi_ns_lookup (walk_state->scope_info, name_string, - ACPI_TYPE_ANY, interpreter_mode, - ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, - walk_state, - ACPI_CAST_INDIRECT_PTR (struct acpi_namespace_node, &obj_desc)); - /* - * The only case where we pass through (ignore) a NOT_FOUND - * error is for the cond_ref_of opcode. - */ - if (status == AE_NOT_FOUND) { - if (parent_op->common.aml_opcode == AML_COND_REF_OF_OP) { - /* - * For the Conditional Reference op, it's OK if - * the name is not found; We just need a way to - * indicate this to the interpreter, set the - * object to the root - */ - obj_desc = ACPI_CAST_PTR (union acpi_operand_object, acpi_gbl_root_node); - status = AE_OK; + interpreter_mode = ACPI_IMODE_EXECUTE; } - else { - /* - * We just plain didn't find it -- which is a - * very serious error at this point - */ - status = AE_AML_NAME_NOT_FOUND; + status = acpi_ns_lookup (walk_state->scope_info, name_string, + ACPI_TYPE_ANY, interpreter_mode, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, + walk_state, + ACPI_CAST_INDIRECT_PTR (struct acpi_namespace_node, &obj_desc)); + /* + * The only case where we pass through (ignore) a NOT_FOUND + * error is for the cond_ref_of opcode. + */ + if (status == AE_NOT_FOUND) { + if (parent_op->common.aml_opcode == AML_COND_REF_OF_OP) { + /* + * For the Conditional Reference op, it's OK if + * the name is not found; We just need a way to + * indicate this to the interpreter, set the + * object to the root + */ + obj_desc = ACPI_CAST_PTR (union acpi_operand_object, acpi_gbl_root_node); + status = AE_OK; + } + else { + /* + * We just plain didn't find it -- which is a + * very serious error at this point + */ + status = AE_AML_NAME_NOT_FOUND; + } } - } - if (ACPI_FAILURE (status)) { - ACPI_REPORT_NSERROR (name_string, status); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_NSERROR (name_string, status); + } } /* Free the namestring created above */ @@ -464,8 +479,6 @@ } ACPI_DEBUGGER_EXEC (acpi_db_display_argument_object (obj_desc, walk_state)); } - - else { /* Check for null name case */ @@ -480,7 +493,6 @@ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Null namepath: Arg=%p\n", arg)); } - else { opcode = arg->common.aml_opcode; } diff -Nru a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c --- a/drivers/acpi/dispatcher/dswload.c Sun Oct 5 00:33:06 2003 +++ b/drivers/acpi/dispatcher/dswload.c Sun Oct 5 00:33:06 2003 @@ -248,6 +248,14 @@ * buffer_field, or Package), the name of the object is already * in the namespace. */ + if (walk_state->deferred_node) { + /* This name is already in the namespace, get the node */ + + node = walk_state->deferred_node; + status = AE_OK; + break; + } + flags = ACPI_NS_NO_UPSEARCH; if ((walk_state->opcode != AML_SCOPE_OP) && (!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) { @@ -589,7 +597,17 @@ * Enter the named type into the internal namespace. We enter the name * as we go downward in the parse tree. Any necessary subobjects that involve * arguments to the opcode must be created as we go back up the parse tree later. + * + * Note: Name may already exist if we are executing a deferred opcode. */ + if (walk_state->deferred_node) { + /* This name is already in the namespace, get the node */ + + node = walk_state->deferred_node; + status = AE_OK; + break; + } + status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type, ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH, walk_state, &(node)); break; diff -Nru a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c --- a/drivers/acpi/dispatcher/dswscope.c Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/dispatcher/dswscope.c Sun Oct 5 00:33:10 2003 @@ -121,10 +121,9 @@ /* Make sure object type is valid */ if (!acpi_ut_valid_object_type (type)) { - ACPI_REPORT_WARNING (("ds_scope_stack_push: type code out of range\n")); + ACPI_REPORT_WARNING (("ds_scope_stack_push: Invalid object type: 0x%X\n", type)); } - /* Allocate a new scope object */ scope_info = acpi_ut_create_generic_state (); @@ -146,13 +145,13 @@ old_scope_info = walk_state->scope_info; if (old_scope_info) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, - "[%4.4s] (%10s)", + "[%4.4s] (%s)", old_scope_info->scope.node->name.ascii, acpi_ut_get_type_name (old_scope_info->common.value))); } else { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, - "[\\___] (%10s)", "ROOT")); + "[\\___] (%s)", "ROOT")); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, @@ -163,7 +162,6 @@ /* Push new scope object onto stack */ acpi_ut_push_generic_state (&walk_state->scope_info, scope_info); - return_ACPI_STATUS (AE_OK); } @@ -207,7 +205,7 @@ walk_state->scope_depth--; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[%.2d] Popped scope [%4.4s] (%10s), New scope -> ", + "[%.2d] Popped scope [%4.4s] (%s), New scope -> ", (u32) walk_state->scope_depth, scope_info->scope.node->name.ascii, acpi_ut_get_type_name (scope_info->common.value))); @@ -225,7 +223,6 @@ } acpi_ut_delete_generic_state (scope_info); - return_ACPI_STATUS (AE_OK); } diff -Nru a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c --- a/drivers/acpi/dispatcher/dswstate.c Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/dispatcher/dswstate.c Sun Oct 5 00:33:10 2003 @@ -56,11 +56,12 @@ * FUNCTION: acpi_ds_result_insert * * PARAMETERS: Object - Object to push + * Index - Where to insert the object * walk_state - Current Walk state * * RETURN: Status * - * DESCRIPTION: Push an object onto this walk's result stack + * DESCRIPTION: Insert an object onto this walk's result stack * ******************************************************************************/ @@ -114,6 +115,7 @@ * FUNCTION: acpi_ds_result_remove * * PARAMETERS: Object - Where to return the popped object + * Index - Where to extract the object * walk_state - Current Walk state * * RETURN: Status @@ -233,6 +235,7 @@ return (AE_AML_NO_RETURN_VALUE); } + /******************************************************************************* * * FUNCTION: acpi_ds_result_pop_from_bottom @@ -295,7 +298,6 @@ *object, (*object) ? acpi_ut_get_object_type_name (*object) : "NULL", state, walk_state)); - return (AE_OK); } @@ -358,8 +360,7 @@ * * FUNCTION: acpi_ds_result_stack_push * - * PARAMETERS: Object - Object to push - * walk_state - Current Walk state + * PARAMETERS: walk_state - Current Walk state * * RETURN: Status * @@ -420,7 +421,6 @@ return (AE_AML_NO_OPERAND); } - state = acpi_ut_pop_generic_state (&walk_state->results); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, @@ -572,6 +572,7 @@ } #endif + /******************************************************************************* * * FUNCTION: acpi_ds_obj_stack_pop @@ -641,6 +642,7 @@ u32 i; union acpi_operand_object *obj_desc; + ACPI_FUNCTION_NAME ("ds_obj_stack_pop_and_delete"); @@ -883,8 +885,15 @@ * FUNCTION: acpi_ds_init_aml_walk * * PARAMETERS: walk_state - New state to be initialized + * Op - Current parse op + * method_node - Control method NS node, if any + * aml_start - Start of AML + * aml_length - Length of AML + * Params - Method args, if any + * return_obj_desc - Where to store a return object, if any + * pass_number - 1, 2, or 3 * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Initialize a walk state for a pass 1 or 2 parse tree walk * @@ -927,9 +936,9 @@ if (method_node) { walk_state->parser_state.start_node = method_node; - walk_state->walk_type = ACPI_WALK_METHOD; - walk_state->method_node = method_node; - walk_state->method_desc = acpi_ns_get_attached_object (method_node); + walk_state->walk_type = ACPI_WALK_METHOD; + walk_state->method_node = method_node; + walk_state->method_desc = acpi_ns_get_attached_object (method_node); /* Push start scope on scope stack and make it current */ @@ -956,6 +965,7 @@ while (extra_op && !extra_op->common.node) { extra_op = extra_op->common.parent; } + if (!extra_op) { parser_state->start_node = NULL; } @@ -1014,7 +1024,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p walk still has a scope list\n", walk_state)); } - /* Always must free any linked control states */ + /* Always must free any linked control states */ while (walk_state->control_state) { state = walk_state->control_state; diff -Nru a/drivers/acpi/ec.c b/drivers/acpi/ec.c --- a/drivers/acpi/ec.c Sun Oct 5 00:33:08 2003 +++ b/drivers/acpi/ec.c Sun Oct 5 00:33:08 2003 @@ -32,7 +32,7 @@ #include #include #include - +#include #define _COMPONENT ACPI_EC_COMPONENT ACPI_MODULE_NAME ("acpi_ec") @@ -412,7 +412,10 @@ * The EC object is in the handler context and is needed * when calling the acpi_ec_space_handler. */ - *return_context = handler_context; + if(function == ACPI_REGION_DEACTIVATE) + *return_context = NULL; + else + *return_context = handler_context; return AE_OK; } diff -Nru a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c --- a/drivers/acpi/events/evregion.c Sun Oct 5 00:33:09 2003 +++ b/drivers/acpi/events/evregion.c Sun Oct 5 00:33:09 2003 @@ -382,7 +382,7 @@ union acpi_operand_object *obj_desc; union acpi_operand_object **last_obj_ptr; acpi_adr_space_setup region_setup; - void *region_context; + void **region_context; union acpi_operand_object *region_obj2; acpi_status status; @@ -394,7 +394,7 @@ if (!region_obj2) { return_VOID; } - region_context = region_obj2->extra.region_context; + region_context = ®ion_obj2->extra.region_context; /* Get the address handler from the region object */ @@ -450,7 +450,7 @@ region_setup = handler_obj->address_space.setup; status = region_setup (region_obj, ACPI_REGION_DEACTIVATE, - handler_obj->address_space.context, ®ion_context); + handler_obj->address_space.context, region_context); /* Init routine may fail, Just ignore errors */ diff -Nru a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c --- a/drivers/acpi/executer/excreate.c Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/executer/excreate.c Sun Oct 5 00:33:10 2003 @@ -286,7 +286,7 @@ ACPI_FUNCTION_TRACE ("ex_create_region"); - /* Get the Node from the object stack */ + /* Get the Namespace Node */ node = walk_state->op->common.node; @@ -311,7 +311,6 @@ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (%X)\n", acpi_ut_get_region_name (region_space), region_space)); - /* Create the region descriptor */ obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_REGION); @@ -375,6 +374,7 @@ ACPI_FUNCTION_TRACE ("ex_create_table_region"); + /* Get the Node from the object stack */ node = walk_state->op->common.node; @@ -392,7 +392,6 @@ status = acpi_tb_find_table (operand[1]->string.pointer, operand[2]->string.pointer, operand[3]->string.pointer, &table); - if (ACPI_FAILURE (status)) { return_ACPI_STATUS (status); } @@ -489,7 +488,6 @@ status = acpi_ns_attach_object ((struct acpi_namespace_node *) operand[0], obj_desc, ACPI_TYPE_PROCESSOR); - /* Remove local reference to the object */ acpi_ut_remove_reference (obj_desc); @@ -540,7 +538,6 @@ status = acpi_ns_attach_object ((struct acpi_namespace_node *) operand[0], obj_desc, ACPI_TYPE_POWER); - /* Remove local reference to the object */ acpi_ut_remove_reference (obj_desc); @@ -609,7 +606,6 @@ obj_desc->method.concurrency = (u8) (((method_flags & METHOD_FLAGS_SYNCH_LEVEL) >> 4) + 1); } - else { obj_desc->method.concurrency = INFINITE_CONCURRENCY; } diff -Nru a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c --- a/drivers/acpi/executer/exfldio.c Sun Oct 5 00:33:07 2003 +++ b/drivers/acpi/executer/exfldio.c Sun Oct 5 00:33:07 2003 @@ -139,7 +139,41 @@ field_datum_byte_offset, obj_desc->common_field.access_byte_width, rgn_desc->region.node->name.ascii, rgn_desc->region.length)); - return_ACPI_STATUS (AE_AML_REGION_LIMIT); + #ifdef CONFIG_ACPI_RELAXED_AML + { + /* + * Allow access to the field if it is within the region size + * rounded up to a multiple of the access byte width. This + * overcomes "off-by-one" programming errors in the AML often + * found in Toshiba laptops. These errors were allowed by + * the Microsoft ASL compiler. + */ + u32 rounded_length = ACPI_ROUND_UP(rgn_desc->region.length, + obj_desc->common_field.access_byte_width); + + if (rounded_length < (obj_desc->common_field.base_byte_offset + + field_datum_byte_offset + + obj_desc->common_field.access_byte_width)) { + return_ACPI_STATUS (AE_AML_REGION_LIMIT); + } else { + static int warn_once = 1; + if (warn_once) { + // Could also associate a flag with each field, and + // warn once for each field. + ACPI_REPORT_WARNING(( + "The ACPI AML in your computer contains errors, " + "please nag the manufacturer to correct it.\n")); + ACPI_REPORT_WARNING(( + "Allowing relaxed access to fields; " + "turn on CONFIG_ACPI_DEBUG for details.\n")); + warn_once = 0; + } + return_ACPI_STATUS (AE_OK); + } + } + #else + return_ACPI_STATUS (AE_AML_REGION_LIMIT); + #endif } return_ACPI_STATUS (AE_OK); diff -Nru a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c --- a/drivers/acpi/namespace/nsdump.c Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/namespace/nsdump.c Sun Oct 5 00:33:10 2003 @@ -234,7 +234,7 @@ case ACPI_TYPE_DEVICE: - acpi_os_printf ("Notify object: %p", obj_desc); + acpi_os_printf ("Notify Object: %p\n", obj_desc); break; @@ -371,7 +371,7 @@ case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD: - acpi_os_printf (" Off %.2X Len %.2X Acc %.2hd\n", + acpi_os_printf ("Off %.2X Len %.2X Acc %.2hd\n", (obj_desc->common_field.base_byte_offset * 8) + obj_desc->common_field.start_field_bit_offset, obj_desc->common_field.bit_length, diff -Nru a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c --- a/drivers/acpi/namespace/nssearch.c Sun Oct 5 00:33:10 2003 +++ b/drivers/acpi/namespace/nssearch.c Sun Oct 5 00:33:10 2003 @@ -96,7 +96,7 @@ scope_name = acpi_ns_get_external_pathname (node); if (scope_name) { - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (%s)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s (%p) For [%4.4s] (%s)\n", scope_name, node, (char *) &target_name, acpi_ut_get_type_name (type))); ACPI_MEM_FREE (scope_name); @@ -117,9 +117,9 @@ * Found matching entry. */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Name %4.4s Type [%s] found in scope [%4.4s] %p\n", + "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n", (char *) &target_name, acpi_ut_get_type_name (next_node->type), - next_node->name.ascii, next_node)); + next_node, node->name.ascii, node)); *return_node = next_node; return_ACPI_STATUS (AE_OK); @@ -143,7 +143,7 @@ /* Searched entire namespace level, not found */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Name %4.4s Type [%s] not found in search in scope [%4.4s] %p first child %p\n", + "Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n", (char *) &target_name, acpi_ut_get_type_name (type), node->name.ascii, node, node->child)); diff -Nru a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c --- a/drivers/acpi/namespace/nsutils.c Sun Oct 5 00:33:08 2003 +++ b/drivers/acpi/namespace/nsutils.c Sun Oct 5 00:33:08 2003 @@ -175,6 +175,11 @@ acpi_status status; + if (!node) { + acpi_os_printf ("[NULL NAME]"); + return; + } + /* Convert handle to a full pathname and print it (with supplied message) */ buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; @@ -470,11 +475,11 @@ *result = 0; if (info->fully_qualified) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (abs) \"\\%s\"\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Returning [%p] (abs) \"\\%s\"\n", internal_name, internal_name)); } else { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "returning [%p] (rel) \"%s\"\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Returning [%p] (rel) \"%s\"\n", internal_name, internal_name)); } diff -Nru a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c --- a/drivers/acpi/parser/psparse.c Sun Oct 5 00:33:07 2003 +++ b/drivers/acpi/parser/psparse.c Sun Oct 5 00:33:07 2003 @@ -437,7 +437,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - parser_state = &walk_state->parser_state; walk_state->arg_types = 0; @@ -705,10 +704,9 @@ walk_state->arg_types = 0; break; - default: - /* Op is not a constant or string, append each argument */ + /* Op is not a constant or string, append each argument to the Op */ while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) && !walk_state->arg_count) { @@ -727,23 +725,23 @@ INCREMENT_ARG_LIST (walk_state->arg_types); } + /* Special processing for certain opcodes */ + switch (op->common.aml_opcode) { case AML_METHOD_OP: - /* For a method, save the length and address of the body */ - /* - * Skip parsing of control method or opregion body, + * Skip parsing of control method * because we don't have enough info in the first pass - * to parse them correctly. + * to parse it correctly. + * + * Save the length and address of the body */ op->named.data = parser_state->aml; op->named.length = (u32) (parser_state->pkg_end - parser_state->aml); - /* - * Skip body of method. For op_regions, we must continue - * parsing because the opregion is not a standalone - * package (We don't know where the end is). - */ + + /* Skip body of method */ + parser_state->aml = parser_state->pkg_end; walk_state->arg_count = 0; break; @@ -756,15 +754,15 @@ (op->common.parent->common.aml_opcode == AML_NAME_OP) && (walk_state->descending_callback != acpi_ds_exec_begin_op)) { /* - * Skip parsing of + * Skip parsing of Buffers and Packages * because we don't have enough info in the first pass * to parse them correctly. */ op->named.data = aml_op_start; op->named.length = (u32) (parser_state->pkg_end - aml_op_start); - /* - * Skip body - */ + + /* Skip body */ + parser_state->aml = parser_state->pkg_end; walk_state->arg_count = 0; } @@ -778,6 +776,7 @@ break; default: + /* No action for all other opcodes */ break; } diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Sun Oct 5 00:33:08 2003 +++ b/drivers/acpi/pci_irq.c Sun Oct 5 00:33:08 2003 @@ -71,6 +71,9 @@ ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry"); + if (!acpi_prt.count) + return_PTR(NULL); + /* * Parse through all PRT entries looking for a match on the specified * PCI device's segment, bus, device, and pin (don't care about func). diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c --- a/drivers/acpi/pci_link.c Sun Oct 5 00:33:06 2003 +++ b/drivers/acpi/pci_link.c Sun Oct 5 00:33:06 2003 @@ -220,7 +220,6 @@ return AE_CTRL_TERMINATE; } - static int acpi_pci_link_get_current ( struct acpi_pci_link *link) @@ -279,6 +278,28 @@ return_VALUE(result); } +static int +acpi_pci_link_try_get_current ( + struct acpi_pci_link *link, + int irq) +{ + int result; + + ACPI_FUNCTION_TRACE("acpi_pci_link_try_get_current"); + + result = acpi_pci_link_get_current(link); + if (result && link->irq.active) { + return_VALUE(result); + } + + if (!link->irq.active) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "No active IRQ resource found\n")); + printk(KERN_WARNING "_CRS returns NULL! Using IRQ %d for device (%s [%s]).\n", irq, acpi_device_name(link->device), acpi_device_bid(link->device)); + link->irq.active = irq; + } + + return 0; +} static int acpi_pci_link_set ( @@ -294,6 +315,7 @@ struct acpi_buffer buffer = {sizeof(resource)+1, &resource}; int i = 0; int valid = 0; + int resource_type = 0; ACPI_FUNCTION_TRACE("acpi_pci_link_set"); @@ -317,20 +339,32 @@ } } + /* If IRQ<=15, first try with a "normal" IRQ descriptor. If that fails, try with + * an extended one */ + if (irq <= 15) { + resource_type = ACPI_RSTYPE_IRQ; + } else { + resource_type = ACPI_RSTYPE_EXT_IRQ; + } + +retry_programming: + memset(&resource, 0, sizeof(resource)); /* NOTE: PCI interrupts are always level / active_low / shared. But not all interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for parameters */ - if (irq <= 15) { + switch(resource_type) { + case ACPI_RSTYPE_IRQ: resource.res.id = ACPI_RSTYPE_IRQ; resource.res.length = sizeof(struct acpi_resource); resource.res.data.irq.edge_level = link->irq.edge_level; resource.res.data.irq.active_high_low = link->irq.active_high_low; resource.res.data.irq.number_of_interrupts = 1; resource.res.data.irq.interrupts[0] = irq; - } - else { + break; + + case ACPI_RSTYPE_EXT_IRQ: resource.res.id = ACPI_RSTYPE_EXT_IRQ; resource.res.length = sizeof(struct acpi_resource); resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER; @@ -339,11 +373,21 @@ resource.res.data.extended_irq.number_of_interrupts = 1; resource.res.data.extended_irq.interrupts[0] = irq; /* ignore resource_source, it's optional */ + break; } resource.end.id = ACPI_RSTYPE_END_TAG; /* Attempt to set the resource */ status = acpi_set_current_resources(link->handle, &buffer); + + /* if we failed and IRQ <= 15, try again with an extended descriptor */ + if (ACPI_FAILURE(status) && (resource_type == ACPI_RSTYPE_IRQ)) { + resource_type = ACPI_RSTYPE_EXT_IRQ; + printk(PREFIX "Retrying with extended IRQ descriptor\n"); + goto retry_programming; + } + + /* check for total failure */ if (ACPI_FAILURE(status)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n")); return_VALUE(-ENODEV); @@ -361,7 +405,7 @@ } /* Make sure the active IRQ is the one we requested. */ - result = acpi_pci_link_get_current(link); + result = acpi_pci_link_try_get_current(link, irq); if (result) { return_VALUE(result); } @@ -456,16 +500,16 @@ irq = link->irq.active; } else { irq = link->irq.possible[0]; - } - /* - * Select the best IRQ. This is done in reverse to promote + /* + * Select the best IRQ. This is done in reverse to promote * the use of IRQs 9, 10, 11, and >15. */ for (i=(link->irq.possible_count-1); i>0; i--) { if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]]) irq = link->irq.possible[i]; } + } /* Attempt to enable the link device at this IRQ. */ if (acpi_pci_link_set(link, irq)) { @@ -574,10 +618,6 @@ else printk(" %d", link->irq.possible[i]); } - if (!link->irq.active) - printk(", disabled"); - else if (!found) - printk(", enabled at IRQ %d", link->irq.active); printk(")\n"); /* TBD: Acquire/release lock */ diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c Sun Oct 5 00:33:08 2003 +++ b/drivers/acpi/tables.c Sun Oct 5 00:33:08 2003 @@ -69,7 +69,8 @@ static unsigned long sdt_pa; /* Physical Address */ static unsigned long sdt_count; /* Table count */ -static struct acpi_table_sdt *sdt_entry; + +static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES]; void acpi_table_print ( @@ -418,12 +419,6 @@ sdt_count = ACPI_MAX_TABLES; } - sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt)); - if (!sdt_entry) { - printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n"); - return -ENOMEM; - } - for (i = 0; i < sdt_count; i++) sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i]; } @@ -468,12 +463,6 @@ printk(KERN_WARNING PREFIX "Truncated %lu RSDT entries\n", (sdt_count - ACPI_MAX_TABLES)); sdt_count = ACPI_MAX_TABLES; - } - - sdt_entry = alloc_bootmem(sdt_count * sizeof(struct acpi_table_sdt)); - if (!sdt_entry) { - printk(KERN_ERR "ACPI: Could not allocate mem for SDT entries!\n"); - return -ENOMEM; } for (i = 0; i < sdt_count; i++) diff -Nru a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c --- a/drivers/acpi/toshiba_acpi.c Sun Oct 5 00:33:05 2003 +++ b/drivers/acpi/toshiba_acpi.c Sun Oct 5 00:33:05 2003 @@ -41,7 +41,6 @@ #include #include #include -#include #include diff -Nru a/drivers/block/Kconfig b/drivers/block/Kconfig --- a/drivers/block/Kconfig Sun Oct 5 00:33:07 2003 +++ b/drivers/block/Kconfig Sun Oct 5 00:33:07 2003 @@ -6,7 +6,7 @@ config BLK_DEV_FD tristate "Normal floppy disk support" - depends on !X86_PC9800 && !ARCH_S390 + depends on ISA || M68 || SPARC64 ---help--- If you want to use the floppy disk drive(s) of your PC under Linux, say Y. Information about this driver, especially important for IBM @@ -35,7 +35,7 @@ config BLK_DEV_SWIM_IOP bool "Macintosh IIfx/Quadra 900/Quadra 950 floppy support (EXPERIMENTAL)" - depends on MAC && EXPERIMENTAL + depends on MAC && EXPERIMENTAL && BROKEN help Say Y here to support the SWIM (Super Woz Integrated Machine) IOP floppy controller on the Macintosh IIfx and Quadra 900/950. @@ -63,7 +63,7 @@ config ATARI_ACSI tristate "Atari ACSI support" - depends on ATARI + depends on ATARI && BROKEN ---help--- This enables support for the Atari ACSI interface. The driver supports hard disks and CD-ROMs, which have 512-byte sectors, or can diff -Nru a/drivers/block/acsi.c b/drivers/block/acsi.c --- a/drivers/block/acsi.c Sun Oct 5 00:33:10 2003 +++ b/drivers/block/acsi.c Sun Oct 5 00:33:10 2003 @@ -63,6 +63,7 @@ #include /* for HDIO_GETGEO */ #include #include +#include #include #include @@ -346,7 +347,7 @@ static int acsicmd_dma( const char *cmd, char *buffer, int blocks, int rwflag, int enable); static int acsi_reqsense( char *buffer, int targ, int lun); -static void acsi_print_error(const unsigned char *errblk, int struct acsi_info_struct *aip); +static void acsi_print_error(const unsigned char *errblk, struct acsi_info_struct *aip); static irqreturn_t acsi_interrupt (int irq, void *data, struct pt_regs *fp); static void unexpected_acsi_interrupt( void ); static void bad_rw_intr( void ); diff -Nru a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c --- a/drivers/block/as-iosched.c Sun Oct 5 00:33:05 2003 +++ b/drivers/block/as-iosched.c Sun Oct 5 00:33:05 2003 @@ -173,13 +173,10 @@ /* * IO Context helper functions */ -/* Debug */ -static atomic_t nr_as_io_requests = ATOMIC_INIT(0); /* Called to deallocate the as_io_context */ static void free_as_io_context(struct as_io_context *aic) { - atomic_dec(&nr_as_io_requests); kfree(aic); } @@ -195,7 +192,6 @@ ret = kmalloc(sizeof(*ret), GFP_ATOMIC); if (ret) { - atomic_inc(&nr_as_io_requests); ret->dtor = free_as_io_context; ret->exit = exit_as_io_context; ret->state = 1 << AS_TASK_RUNNING; @@ -914,6 +910,8 @@ struct as_rq *arq = RQ_DATA(rq); struct as_io_context *aic; + WARN_ON(!list_empty(&rq->queuelist)); + if (unlikely(arq->state != AS_RQ_DISPATCHED)) return; @@ -926,6 +924,7 @@ if (ad->batch_data_dir == REQ_SYNC) ad->new_batch = 1; } + WARN_ON(ad->nr_dispatched == 0); ad->nr_dispatched--; /* @@ -1140,8 +1139,6 @@ /* * take it off the sort and fifo list, add to dispatch queue */ - as_remove_queued_request(ad->q, rq); - insert = ad->dispatch->prev; while (!list_empty(&rq->queuelist)) { @@ -1159,6 +1156,7 @@ ad->nr_dispatched++; } + as_remove_queued_request(ad->q, rq); list_add(&rq->queuelist, insert); if (arq->io_context && arq->io_context->aic) atomic_inc(&arq->io_context->aic->nr_dispatched); @@ -1325,12 +1323,27 @@ static inline void as_add_aliased_request(struct as_data *ad, struct as_rq *arq, struct as_rq *alias) { + struct request *req = arq->request; + struct list_head *insert = alias->request->queuelist.prev; + + /* + * Transfer list of aliases + */ + while (!list_empty(&req->queuelist)) { + struct request *__rq = list_entry_rq(req->queuelist.next); + struct as_rq *__arq = RQ_DATA(__rq); + + list_move_tail(&__rq->queuelist, &alias->request->queuelist); + + WARN_ON(__arq->state != AS_RQ_QUEUED); + } + /* * Another request with the same start sector on the rbtree. * Link this request to that sector. They are untangled in * as_move_to_dispatch */ - list_add_tail(&arq->request->queuelist, &alias->request->queuelist); + list_add(&arq->request->queuelist, insert); /* * Don't want to have to handle merges. @@ -1390,9 +1403,6 @@ } } - - - arq->state = AS_RQ_QUEUED; } @@ -1596,7 +1606,8 @@ */ } - q->last_merge = req; + if (arq->on_hash) + q->last_merge = req; } static void diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c Sun Oct 5 00:33:10 2003 +++ b/drivers/block/cciss.c Sun Oct 5 00:33:10 2003 @@ -111,8 +111,6 @@ static ctlr_info_t *hba[MAX_CTLR]; -static struct proc_dir_entry *proc_cciss; - static void do_cciss_request(request_queue_t *q); static int cciss_open(struct inode *inode, struct file *filep); static int cciss_release(struct inode *inode, struct file *filep); @@ -137,8 +135,6 @@ int length, int *eof, void *data); static void cciss_procinit(int i); #else -static int cciss_proc_get_info(char *buffer, char **start, off_t offset, - int length, int *eof, void *data) { return 0;} static void cciss_procinit(int i) {} #endif /* CONFIG_PROC_FS */ @@ -156,6 +152,9 @@ * Report information about this controller. */ #ifdef CONFIG_PROC_FS + +static struct proc_dir_entry *proc_cciss; + static int cciss_proc_get_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data) { @@ -636,9 +635,11 @@ { return -EINVAL; } +#if 0 /* 'buf_size' member is 16-bits, and always smaller than kmalloc limit */ /* Check kmalloc limits */ if(iocommand.buf_size > 128000) return -EINVAL; +#endif if(iocommand.buf_size > 0) { buff = kmalloc(iocommand.buf_size, GFP_KERNEL); diff -Nru a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c --- a/drivers/block/cpqarray.c Sun Oct 5 00:33:06 2003 +++ b/drivers/block/cpqarray.c Sun Oct 5 00:33:06 2003 @@ -99,8 +99,6 @@ static struct gendisk *ida_gendisk[MAX_CTLR][NWD]; -static struct proc_dir_entry *proc_array; - /* Debug... */ #define DBG(s) do { s } while(0) /* Debug (general info)... */ @@ -153,8 +151,6 @@ static int ida_proc_get_info(char *buffer, char **start, off_t offset, int length, int *eof, void *data); #else static void ida_procinit(int i) {} -static int ida_proc_get_info(char *buffer, char **start, off_t offset, - int length, int *eof, void *data) { return 0;} #endif static inline drv_info_t *get_drv(struct gendisk *disk) @@ -178,6 +174,8 @@ #ifdef CONFIG_PROC_FS + +static struct proc_dir_entry *proc_array; /* * Get us a file in /proc/array that says something about each controller. diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c Sun Oct 5 00:33:06 2003 +++ b/drivers/block/ll_rw_blk.c Sun Oct 5 00:33:06 2003 @@ -2576,8 +2576,6 @@ return 0; } -static atomic_t nr_io_contexts = ATOMIC_INIT(0); - /* * IO Context helper functions */ @@ -2592,7 +2590,6 @@ if (ioc->aic && ioc->aic->dtor) ioc->aic->dtor(ioc->aic); kfree(ioc); - atomic_dec(&nr_io_contexts); } } @@ -2633,7 +2630,6 @@ if (ret == NULL) { ret = kmalloc(sizeof(*ret), GFP_ATOMIC); if (ret) { - atomic_inc(&nr_io_contexts); atomic_set(&ret->refcount, 1); ret->pid = tsk->pid; ret->last_waited = jiffies; /* doesn't matter... */ diff -Nru a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c --- a/drivers/block/ps2esdi.c Sun Oct 5 00:33:05 2003 +++ b/drivers/block/ps2esdi.c Sun Oct 5 00:33:05 2003 @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c --- a/drivers/block/scsi_ioctl.c Sun Oct 5 00:33:10 2003 +++ b/drivers/block/scsi_ioctl.c Sun Oct 5 00:33:10 2003 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -140,40 +141,36 @@ } static int sg_io(request_queue_t *q, struct block_device *bdev, - struct sg_io_hdr *uptr) + struct sg_io_hdr *hdr) { unsigned long start_time; int reading, writing; - struct sg_io_hdr hdr; struct request *rq; struct bio *bio; char sense[SCSI_SENSE_BUFFERSIZE]; void *buffer; - if (copy_from_user(&hdr, uptr, sizeof(*uptr))) - return -EFAULT; - - if (hdr.interface_id != 'S') + if (hdr->interface_id != 'S') return -EINVAL; - if (hdr.cmd_len > sizeof(rq->cmd)) + if (hdr->cmd_len > sizeof(rq->cmd)) return -EINVAL; /* * we'll do that later */ - if (hdr.iovec_count) + if (hdr->iovec_count) return -EOPNOTSUPP; - if (hdr.dxfer_len > (q->max_sectors << 9)) + if (hdr->dxfer_len > (q->max_sectors << 9)) return -EIO; reading = writing = 0; buffer = NULL; bio = NULL; - if (hdr.dxfer_len) { - unsigned int bytes = (hdr.dxfer_len + 511) & ~511; + if (hdr->dxfer_len) { + unsigned int bytes = (hdr->dxfer_len + 511) & ~511; - switch (hdr.dxfer_direction) { + switch (hdr->dxfer_direction) { default: return -EINVAL; case SG_DXFER_TO_FROM_DEV: @@ -191,8 +188,8 @@ * first try to map it into a bio. reading from device will * be a write to vm. */ - bio = bio_map_user(bdev, (unsigned long) hdr.dxferp, - hdr.dxfer_len, reading); + bio = bio_map_user(bdev, (unsigned long) hdr->dxferp, + hdr->dxfer_len, reading); /* * if bio setup failed, fall back to slow approach @@ -203,11 +200,11 @@ return -ENOMEM; if (writing) { - if (copy_from_user(buffer, hdr.dxferp, - hdr.dxfer_len)) + if (copy_from_user(buffer, hdr->dxferp, + hdr->dxfer_len)) goto out_buffer; } else - memset(buffer, 0, hdr.dxfer_len); + memset(buffer, 0, hdr->dxfer_len); } } @@ -216,11 +213,10 @@ /* * fill in request structure */ - rq->cmd_len = hdr.cmd_len; - if (copy_from_user(rq->cmd, hdr.cmdp, hdr.cmd_len)) - goto out_request; - if (sizeof(rq->cmd) != hdr.cmd_len) - memset(rq->cmd + hdr.cmd_len, 0, sizeof(rq->cmd) - hdr.cmd_len); + rq->cmd_len = hdr->cmd_len; + memcpy(rq->cmd, hdr->cmdp, hdr->cmd_len); + if (sizeof(rq->cmd) != hdr->cmd_len) + memset(rq->cmd + hdr->cmd_len, 0, sizeof(rq->cmd) - hdr->cmd_len); memset(sense, 0, sizeof(sense)); rq->sense = sense; @@ -234,9 +230,9 @@ blk_rq_bio_prep(q, rq, bio); rq->data = buffer; - rq->data_len = hdr.dxfer_len; + rq->data_len = hdr->dxfer_len; - rq->timeout = (hdr.timeout * HZ) / 1000; + rq->timeout = (hdr->timeout * HZ) / 1000; if (!rq->timeout) rq->timeout = q->sg_timeout; if (!rq->timeout) @@ -254,33 +250,30 @@ bio_unmap_user(bio, reading); /* write to all output members */ - hdr.status = rq->errors; - hdr.masked_status = (hdr.status >> 1) & 0x1f; - hdr.msg_status = 0; - hdr.host_status = 0; - hdr.driver_status = 0; - hdr.info = 0; - if (hdr.masked_status || hdr.host_status || hdr.driver_status) - hdr.info |= SG_INFO_CHECK; - hdr.resid = rq->data_len; - hdr.duration = ((jiffies - start_time) * 1000) / HZ; - hdr.sb_len_wr = 0; + hdr->status = rq->errors; + hdr->masked_status = (hdr->status >> 1) & 0x1f; + hdr->msg_status = 0; + hdr->host_status = 0; + hdr->driver_status = 0; + hdr->info = 0; + if (hdr->masked_status || hdr->host_status || hdr->driver_status) + hdr->info |= SG_INFO_CHECK; + hdr->resid = rq->data_len; + hdr->duration = ((jiffies - start_time) * 1000) / HZ; + hdr->sb_len_wr = 0; - if (rq->sense_len && hdr.sbp) { - int len = min((unsigned int) hdr.mx_sb_len, rq->sense_len); + if (rq->sense_len && hdr->sbp) { + int len = min((unsigned int) hdr->mx_sb_len, rq->sense_len); - if (!copy_to_user(hdr.sbp, rq->sense, len)) - hdr.sb_len_wr = len; + if (!copy_to_user(hdr->sbp, rq->sense, len)) + hdr->sb_len_wr = len; } blk_put_request(rq); - if (copy_to_user(uptr, &hdr, sizeof(*uptr))) - goto out_buffer; - if (buffer) { if (reading) - if (copy_to_user(hdr.dxferp, buffer, hdr.dxfer_len)) + if (copy_to_user(hdr->dxferp, buffer, hdr->dxfer_len)) goto out_buffer; kfree(buffer); @@ -289,8 +282,6 @@ /* may not have succeeded, but output values written to control * structure (struct sg_io_hdr). */ return 0; -out_request: - blk_put_request(rq); out_buffer: kfree(buffer); return -EFAULT; @@ -437,9 +428,71 @@ case SG_EMULATED_HOST: err = sg_emulated_host(q, (int *) arg); break; - case SG_IO: - err = sg_io(q, bdev, (struct sg_io_hdr *) arg); + case SG_IO: { + struct sg_io_hdr hdr; + + if (copy_from_user(&hdr, (struct sg_io_hdr *) arg, sizeof(hdr))) { + err = -EFAULT; + break; + } + err = sg_io(q, bdev, &hdr); + if (copy_to_user((struct sg_io_hdr *) arg, &hdr, sizeof(hdr))) + err = -EFAULT; break; + } + case CDROM_SEND_PACKET: { + struct cdrom_generic_command cgc; + struct sg_io_hdr hdr; + + if (copy_from_user(&cgc, (struct cdrom_generic_command *) arg, sizeof(cgc))) { + err = -EFAULT; + break; + } + cgc.timeout = clock_t_to_jiffies(cgc.timeout); + memset(&hdr, 0, sizeof(hdr)); + hdr.interface_id = 'S'; + hdr.cmd_len = sizeof(cgc.cmd); + hdr.dxfer_len = cgc.buflen; + err = 0; + switch (cgc.data_direction) { + case CGC_DATA_UNKNOWN: + hdr.dxfer_direction = SG_DXFER_UNKNOWN; + break; + case CGC_DATA_WRITE: + hdr.dxfer_direction = SG_DXFER_TO_DEV; + break; + case CGC_DATA_READ: + hdr.dxfer_direction = SG_DXFER_FROM_DEV; + break; + case CGC_DATA_NONE: + hdr.dxfer_direction = SG_DXFER_NONE; + break; + default: + err = -EINVAL; + } + if (err) + break; + + hdr.dxferp = cgc.buffer; + hdr.sbp = (char *) cgc.sense; + if (hdr.sbp) + hdr.mx_sb_len = sizeof(struct request_sense); + hdr.timeout = cgc.timeout; + hdr.cmdp = cgc.cmd; + hdr.cmd_len = sizeof(cgc.cmd); + err = sg_io(q, bdev, &hdr); + + if (hdr.status) + err = -EIO; + + cgc.stat = err; + cgc.buflen = hdr.resid; + if (copy_to_user((struct cdrom_generic_command *) arg, &cgc, sizeof(cgc))) + err = -EFAULT; + + break; + } + /* * old junk scsi send command ioctl */ diff -Nru a/drivers/block/swim_iop.c b/drivers/block/swim_iop.c --- a/drivers/block/swim_iop.c Sun Oct 5 00:33:05 2003 +++ b/drivers/block/swim_iop.c Sun Oct 5 00:33:05 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff -Nru a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c --- a/drivers/cdrom/cdrom.c Sun Oct 5 00:33:06 2003 +++ b/drivers/cdrom/cdrom.c Sun Oct 5 00:33:06 2003 @@ -1856,57 +1856,6 @@ return cdo->generic_packet(cdi, &cgc); } -static int cdrom_do_cmd(struct cdrom_device_info *cdi, - struct cdrom_generic_command *cgc) -{ - struct request_sense *usense, sense; - unsigned char *ubuf; - int ret; - - if (cgc->data_direction == CGC_DATA_UNKNOWN) - return -EINVAL; - - if (cgc->buflen < 0 || cgc->buflen >= 131072) - return -EINVAL; - - usense = cgc->sense; - cgc->sense = &sense; - if (usense && !access_ok(VERIFY_WRITE, usense, sizeof(*usense))) { - return -EFAULT; - } - - ubuf = cgc->buffer; - if (cgc->data_direction == CGC_DATA_READ || - cgc->data_direction == CGC_DATA_WRITE) { - cgc->buffer = kmalloc(cgc->buflen, GFP_KERNEL); - if (cgc->buffer == NULL) - return -ENOMEM; - } - - - if (cgc->data_direction == CGC_DATA_READ) { - if (!access_ok(VERIFY_READ, ubuf, cgc->buflen)) { - kfree(cgc->buffer); - return -EFAULT; - } - } else if (cgc->data_direction == CGC_DATA_WRITE) { - if (copy_from_user(cgc->buffer, ubuf, cgc->buflen)) { - kfree(cgc->buffer); - return -EFAULT; - } - } - - ret = cdi->ops->generic_packet(cdi, cgc); - __copy_to_user(usense, cgc->sense, sizeof(*usense)); - if (!ret && cgc->data_direction == CGC_DATA_READ) - __copy_to_user(ubuf, cgc->buffer, cgc->buflen); - if (cgc->data_direction == CGC_DATA_READ || - cgc->data_direction == CGC_DATA_WRITE) { - kfree(cgc->buffer); - } - return ret; -} - static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, unsigned long arg) { @@ -2176,14 +2125,6 @@ return 0; } - case CDROM_SEND_PACKET: { - if (!CDROM_CAN(CDC_GENERIC_PACKET)) - return -ENOSYS; - cdinfo(CD_DO_IOCTL, "entering CDROM_SEND_PACKET\n"); - IOCTL_IN(arg, struct cdrom_generic_command, cgc); - cgc.timeout = clock_t_to_jiffies(cgc.timeout); - return cdrom_do_cmd(cdi, &cgc); - } case CDROM_NEXT_WRITABLE: { long next = 0; cdinfo(CD_DO_IOCTL, "entering CDROM_NEXT_WRITABLE\n"); diff -Nru a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c --- a/drivers/cdrom/sbpcd.c Sun Oct 5 00:33:07 2003 +++ b/drivers/cdrom/sbpcd.c Sun Oct 5 00:33:07 2003 @@ -363,7 +363,6 @@ #include -#include #include #include #include diff -Nru a/drivers/char/Kconfig b/drivers/char/Kconfig --- a/drivers/char/Kconfig Sun Oct 5 00:33:05 2003 +++ b/drivers/char/Kconfig Sun Oct 5 00:33:05 2003 @@ -954,6 +954,15 @@ Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O. See the raw(8) manpage for more details. +config MAX_RAW_DEVS + int "Maximum number of RAW devices to support (1-8192)" + depends on RAW_DRIVER + default "256" + help + The maximum number of RAW devices that are supported. + Default is 256. Increase this number in case you need lots of + raw devices. + config HANGCHECK_TIMER tristate "Hangcheck timer" depends on X86_64 || X86 diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c --- a/drivers/char/agp/amd64-agp.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/agp/amd64-agp.c Sun Oct 5 00:33:09 2003 @@ -91,9 +91,9 @@ for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { tmp = agp_bridge->driver->mask_memory(mem->memory[i], mem->type); - BUG_ON(tmp & 0xffffff0000000ffc); - pte = (tmp & 0x000000ff00000000) >> 28; - pte |=(tmp & 0x00000000fffff000); + BUG_ON(tmp & 0xffffff0000000ffcULL); + pte = (tmp & 0x000000ff00000000ULL) >> 28; + pte |=(tmp & 0x00000000fffff000ULL); pte |= GPTE_VALID | GPTE_COHERENT; agp_bridge->gatt_table[j] = pte; diff -Nru a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c --- a/drivers/char/agp/via-agp.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/agp/via-agp.c Sun Oct 5 00:33:09 2003 @@ -251,6 +251,11 @@ .chipset_name = "Pro 266", }, + { + .device_id = PCI_DEVICE_ID_VIA_XN266, + .chipset_name = "Apollo Pro266", + }, + /* VT8361 */ { .device_id = PCI_DEVICE_ID_VIA_8361, diff -Nru a/drivers/char/amiserial.c b/drivers/char/amiserial.c --- a/drivers/char/amiserial.c Sun Oct 5 00:33:10 2003 +++ b/drivers/char/amiserial.c Sun Oct 5 00:33:10 2003 @@ -32,7 +32,6 @@ */ #include -#include #undef SERIAL_PARANOIA_CHECK #define SERIAL_DO_RESTART diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c --- a/drivers/char/cyclades.c Sun Oct 5 00:33:07 2003 +++ b/drivers/char/cyclades.c Sun Oct 5 00:33:07 2003 @@ -670,7 +670,6 @@ #include #include #include -#include #include #include diff -Nru a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c --- a/drivers/char/dsp56k.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/dsp56k.c Sun Oct 5 00:33:08 2003 @@ -24,7 +24,6 @@ */ #include -#include #include /* for kmalloc() and kfree() */ #include /* for struct wait_queue etc */ #include diff -Nru a/drivers/char/dtlk.c b/drivers/char/dtlk.c --- a/drivers/char/dtlk.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/dtlk.c Sun Oct 5 00:33:08 2003 @@ -48,7 +48,6 @@ */ #include -#include #define KERNEL #include diff -Nru a/drivers/char/dz.c b/drivers/char/dz.c --- a/drivers/char/dz.c Sun Oct 5 00:33:06 2003 +++ b/drivers/char/dz.c Sun Oct 5 00:33:06 2003 @@ -23,7 +23,6 @@ /* #define DEBUG_DZ 1 */ -#include #include #include diff -Nru a/drivers/char/ftape/compressor/zftape-compress.c b/drivers/char/ftape/compressor/zftape-compress.c --- a/drivers/char/ftape/compressor/zftape-compress.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/ftape/compressor/zftape-compress.c Sun Oct 5 00:33:09 2003 @@ -31,6 +31,7 @@ char zftc_rev[] = "$Revision: 1.1.6.1 $"; char zftc_dat[] = "$Date: 1997/11/16 15:15:56 $"; +#include #include #include #include diff -Nru a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c --- a/drivers/char/ftape/lowlevel/fdc-io.c Sun Oct 5 00:33:07 2003 +++ b/drivers/char/ftape/lowlevel/fdc-io.c Sun Oct 5 00:33:07 2003 @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c --- a/drivers/char/generic_serial.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/generic_serial.c Sun Oct 5 00:33:08 2003 @@ -348,7 +348,7 @@ static int gs_wait_tx_flushed (void * ptr, int timeout) { struct gs_port *port = ptr; - long end_jiffies; + unsigned long end_jiffies; int jiffies_to_transmit, charsleft = 0, rv = 0; int rcib; diff -Nru a/drivers/char/i8k.c b/drivers/char/i8k.c --- a/drivers/char/i8k.c Sun Oct 5 00:33:07 2003 +++ b/drivers/char/i8k.c Sun Oct 5 00:33:07 2003 @@ -17,7 +17,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/char/ip2/i2os.h b/drivers/char/ip2/i2os.h --- a/drivers/char/ip2/i2os.h Sun Oct 5 00:33:08 2003 +++ b/drivers/char/ip2/i2os.h Sun Oct 5 00:33:08 2003 @@ -25,7 +25,6 @@ #include "ip2types.h" #include /* For inb, etc */ -#include //------------------------------------ // Defines for I/O instructions: diff -Nru a/drivers/char/ip2main.c b/drivers/char/ip2main.c --- a/drivers/char/ip2main.c Sun Oct 5 00:33:10 2003 +++ b/drivers/char/ip2main.c Sun Oct 5 00:33:10 2003 @@ -84,8 +84,6 @@ /************/ #include -#include - #include #include #include diff -Nru a/drivers/char/isicom.c b/drivers/char/isicom.c --- a/drivers/char/isicom.c Sun Oct 5 00:33:05 2003 +++ b/drivers/char/isicom.c Sun Oct 5 00:33:05 2003 @@ -38,7 +38,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/char/istallion.c b/drivers/char/istallion.c --- a/drivers/char/istallion.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/istallion.c Sun Oct 5 00:33:09 2003 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/char/lp_old98.c b/drivers/char/lp_old98.c --- a/drivers/char/lp_old98.c Sun Oct 5 00:33:07 2003 +++ b/drivers/char/lp_old98.c Sun Oct 5 00:33:07 2003 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c --- a/drivers/char/misc.c Sun Oct 5 00:33:10 2003 +++ b/drivers/char/misc.c Sun Oct 5 00:33:10 2003 @@ -157,12 +157,11 @@ list_for_each_entry(c, &misc_list, list) { if (c->minor == minor) { new_fops = fops_get(c->fops); - if (!new_fops) - goto fail; break; } } - goto fail; + if (!new_fops) + goto fail; } err = 0; diff -Nru a/drivers/char/moxa.c b/drivers/char/moxa.c --- a/drivers/char/moxa.c Sun Oct 5 00:33:10 2003 +++ b/drivers/char/moxa.c Sun Oct 5 00:33:10 2003 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/char/mxser.c b/drivers/char/mxser.c --- a/drivers/char/mxser.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/mxser.c Sun Oct 5 00:33:09 2003 @@ -39,7 +39,6 @@ #include #include -#include #include #include #include diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c --- a/drivers/char/pcmcia/synclink_cs.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/pcmcia/synclink_cs.c Sun Oct 5 00:33:08 2003 @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff -Nru a/drivers/char/pcxx.c b/drivers/char/pcxx.c --- a/drivers/char/pcxx.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/pcxx.c Sun Oct 5 00:33:08 2003 @@ -65,7 +65,6 @@ #include #include #include -#include #ifndef MODULE #include /* We only need it for parsing the "digi="-line */ diff -Nru a/drivers/char/random.c b/drivers/char/random.c --- a/drivers/char/random.c Sun Oct 5 00:33:06 2003 +++ b/drivers/char/random.c Sun Oct 5 00:33:06 2003 @@ -1735,7 +1735,7 @@ tmp = kmalloc(size * sizeof(__u32), GFP_KERNEL); if (!tmp) - return -EFAULT; + return -ENOMEM; spin_lock_irqsave(&random_state->lock, flags); ent_count = random_state->entropy_count; diff -Nru a/drivers/char/raw.c b/drivers/char/raw.c --- a/drivers/char/raw.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/raw.c Sun Oct 5 00:33:09 2003 @@ -20,8 +20,6 @@ #include -#define MAX_RAW_MINORS 256 - struct raw_device_data { struct block_device *binding; int inuse; diff -Nru a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c --- a/drivers/char/rio/rio_linux.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/rio/rio_linux.c Sun Oct 5 00:33:09 2003 @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/char/rocket.c b/drivers/char/rocket.c --- a/drivers/char/rocket.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/rocket.c Sun Oct 5 00:33:09 2003 @@ -85,11 +85,9 @@ #include #include #include -#include #include #include #include -#include #include #include #include diff -Nru a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c --- a/drivers/char/ser_a2232.c Sun Oct 5 00:33:07 2003 +++ b/drivers/char/ser_a2232.c Sun Oct 5 00:33:07 2003 @@ -703,7 +703,7 @@ a2232_driver->name = "ttyY"; a2232_driver->major = A2232_NORMAL_MAJOR; a2232_driver->type = TTY_DRIVER_TYPE_SERIAL; - a2232_driver->subtype = SERIAL_TTY_NORMAL; + a2232_driver->subtype = SERIAL_TYPE_NORMAL; a2232_driver->init_termios = tty_std_termios; a2232_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; diff -Nru a/drivers/char/serial167.c b/drivers/char/serial167.c --- a/drivers/char/serial167.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/serial167.c Sun Oct 5 00:33:08 2003 @@ -70,7 +70,6 @@ #include #include -#include #include #include diff -Nru a/drivers/char/stallion.c b/drivers/char/stallion.c --- a/drivers/char/stallion.c Sun Oct 5 00:33:09 2003 +++ b/drivers/char/stallion.c Sun Oct 5 00:33:09 2003 @@ -28,7 +28,6 @@ #include #include -#include /* for linux/stallion.h */ #include #include #include diff -Nru a/drivers/char/sx.c b/drivers/char/sx.c --- a/drivers/char/sx.c Sun Oct 5 00:33:08 2003 +++ b/drivers/char/sx.c Sun Oct 5 00:33:08 2003 @@ -240,7 +240,6 @@ #include "sxwindow.h" #include -#include #include "sx.h" diff -Nru a/drivers/char/toshiba.c b/drivers/char/toshiba.c --- a/drivers/char/toshiba.c Sun Oct 5 00:33:10 2003 +++ b/drivers/char/toshiba.c Sun Oct 5 00:33:10 2003 @@ -57,7 +57,6 @@ #define TOSH_DEBUG 0 #include -#include #include #include #include @@ -85,7 +84,6 @@ MODULE_PARM(tosh_fn, "i"); -static int tosh_get_info(char *, char **, off_t, int); static int tosh_ioctl(struct inode *, struct file *, unsigned int, unsigned long); @@ -104,6 +102,7 @@ /* * Read the Fn key status */ +#ifdef CONFIG_PROC_FS static int tosh_fn_status(void) { unsigned char scan; @@ -120,6 +119,7 @@ return (int) scan; } +#endif /* @@ -291,6 +291,7 @@ /* * Print the information for /proc/toshiba */ +#ifdef CONFIG_PROC_FS int tosh_get_info(char *buffer, char **start, off_t fpos, int length) { char *temp; @@ -319,6 +320,7 @@ return temp-buffer; } +#endif /* diff -Nru a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c --- a/drivers/char/vme_scc.c Sun Oct 5 00:33:05 2003 +++ b/drivers/char/vme_scc.c Sun Oct 5 00:33:05 2003 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/char/watchdog/amd7xx_tco.c b/drivers/char/watchdog/amd7xx_tco.c --- a/drivers/char/watchdog/amd7xx_tco.c Sun Oct 5 00:33:07 2003 +++ b/drivers/char/watchdog/amd7xx_tco.c Sun Oct 5 00:33:07 2003 @@ -19,13 +19,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include diff -Nru a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c --- a/drivers/eisa/eisa-bus.c Sun Oct 5 00:33:07 2003 +++ b/drivers/eisa/eisa-bus.c Sun Oct 5 00:33:07 2003 @@ -33,23 +33,22 @@ #endif #define EISA_MAX_FORCED_DEV 16 -#define EISA_FORCED_OFFSET 2 -static int enable_dev[EISA_MAX_FORCED_DEV + EISA_FORCED_OFFSET] = { 1, EISA_MAX_FORCED_DEV, }; -static int disable_dev[EISA_MAX_FORCED_DEV + EISA_FORCED_OFFSET] = { 1, EISA_MAX_FORCED_DEV, }; +static int enable_dev[EISA_MAX_FORCED_DEV]; +static int enable_dev_count; +static int disable_dev[EISA_MAX_FORCED_DEV]; +static int disable_dev_count; static int is_forced_dev (int *forced_tab, + int forced_count, struct eisa_root_device *root, struct eisa_device *edev) { int i, x; - for (i = 0; i < EISA_MAX_FORCED_DEV; i++) { - if (!forced_tab[EISA_FORCED_OFFSET + i]) - return 0; - + for (i = 0; i < forced_count; i++) { x = (root->bus_nr << 8) | edev->slot; - if (forced_tab[EISA_FORCED_OFFSET + i] == x) + if (forced_tab[i] == x) return 1; } @@ -198,10 +197,10 @@ #endif } - if (is_forced_dev (enable_dev, root, edev)) + if (is_forced_dev (enable_dev, enable_dev_count, root, edev)) edev->state = EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED; - if (is_forced_dev (disable_dev, root, edev)) + if (is_forced_dev (disable_dev, disable_dev_count, root, edev)) edev->state = EISA_CONFIG_FORCED; return 0; @@ -418,12 +417,8 @@ return 0; } -/* Couldn't use intarray with checking on... :-( */ -#undef param_check_intarray -#define param_check_intarray(name, p) - -module_param(enable_dev, intarray, 0444); -module_param(disable_dev, intarray, 0444); +module_param_array(enable_dev, int, enable_dev_count, 0444); +module_param_array(disable_dev, int, disable_dev_count, 0444); postcore_initcall (eisa_init); diff -Nru a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig --- a/drivers/i2c/busses/Kconfig Sun Oct 5 00:33:09 2003 +++ b/drivers/i2c/busses/Kconfig Sun Oct 5 00:33:09 2003 @@ -285,7 +285,7 @@ will be called i2c-velleman. config I2C_VIA - tristate "VIA 82C58B" + tristate "VIA 82C586B" depends on I2C_ALGOBIT && PCI && EXPERIMENTAL help diff -Nru a/drivers/i2c/i2c-sensor.c b/drivers/i2c/i2c-sensor.c --- a/drivers/i2c/i2c-sensor.c Sun Oct 5 00:33:08 2003 +++ b/drivers/i2c/i2c-sensor.c Sun Oct 5 00:33:08 2003 @@ -133,7 +133,7 @@ i += 2) { if (((adapter_id == address_data->probe[i]) || ((address_data-> - probe[i] == ANY_I2C_BUS) & !is_isa)) + probe[i] == ANY_I2C_BUS) && !is_isa)) && (addr == address_data->probe[i + 1])) { dev_dbg(&adapter->dev, "found probe parameter for adapter %d, addr %04x\n", adapter_id, addr); found = 1; @@ -141,7 +141,7 @@ } for (i = 0; !found && (address_data->probe_range[i] != I2C_CLIENT_END); i += 3) { if ( ((adapter_id == address_data->probe_range[i]) || - ((address_data->probe_range[i] == ANY_I2C_BUS) & !is_isa)) && + ((address_data->probe_range[i] == ANY_I2C_BUS) && !is_isa)) && (addr >= address_data->probe_range[i + 1]) && (addr <= address_data->probe_range[i + 2])) { found = 1; diff -Nru a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c --- a/drivers/ide/ide-floppy.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/ide-floppy.c Sun Oct 5 00:33:08 2003 @@ -156,7 +156,6 @@ int request_transfer; /* Bytes to transfer */ int actually_transferred; /* Bytes actually transferred */ int buffer_size; /* Size of our data buffer */ - char *b_data; /* Pointer which runs on the buffers */ int b_count; /* Missing/Available data on the current buffer */ struct request *rq; /* The corresponding request */ u8 *buffer; /* Data buffer */ @@ -515,9 +514,6 @@ u8 reserved[4]; } idefloppy_mode_parameter_header_t; -#define IDEFLOPPY_MIN(a,b) ((a)<(b) ? (a):(b)) -#define IDEFLOPPY_MAX(a,b) ((a)>(b) ? (a):(b)) - /* * Too bad. The drive wants to send us data which we are not ready to accept. * Just throw it away. @@ -575,59 +571,68 @@ static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, unsigned int bcount) { struct request *rq = pc->rq; - struct bio *bio = rq->bio; - int count; + struct bio_vec *bvec; + struct bio *bio; + unsigned long flags; + char *data; + int count, i, done = 0; - while (bcount) { - if (pc->b_count == bio->bi_size) { - rq->sector += rq->current_nr_sectors; - rq->nr_sectors -= rq->current_nr_sectors; - idefloppy_do_end_request(drive, 1, 0); - if ((bio = rq->bio) != NULL) - pc->b_count = 0; - } - if (bio == NULL) { - printk(KERN_ERR "%s: bio == NULL in " - "idefloppy_input_buffers, bcount == %d\n", - drive->name, bcount); - idefloppy_discard_data(drive, bcount); - return; + rq_for_each_bio(bio, rq) { + bio_for_each_segment(bvec, bio, i) { + if (!bcount) + break; + + count = min(bvec->bv_len, bcount); + + data = bvec_kmap_irq(bvec, &flags); + atapi_input_bytes(drive, data, count); + bvec_kunmap_irq(data, &flags); + + bcount -= count; + pc->b_count += count; + done += count; } - count = IDEFLOPPY_MIN(bio->bi_size - pc->b_count, bcount); - atapi_input_bytes(drive, bio_data(bio) + pc->b_count, count); - bcount -= count; - pc->b_count += count; + } + + idefloppy_do_end_request(drive, 1, done >> 9); + + if (bcount) { + printk(KERN_ERR "%s: leftover data in idefloppy_input_buffers, bcount == %d\n", drive->name, bcount); + idefloppy_discard_data(drive, bcount); } } static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, unsigned int bcount) { struct request *rq = pc->rq; - struct bio *bio = rq->bio; - int count; - - while (bcount) { - if (!pc->b_count) { - rq->sector += rq->current_nr_sectors; - rq->nr_sectors -= rq->current_nr_sectors; - idefloppy_do_end_request(drive, 1, 0); - if ((bio = rq->bio) != NULL) { - pc->b_data = bio_data(bio); - pc->b_count = bio->bi_size; - } - } - if (bio == NULL) { - printk(KERN_ERR "%s: bio == NULL in " - "idefloppy_output_buffers, bcount == %d\n", - drive->name, bcount); - idefloppy_write_zeros(drive, bcount); - return; + struct bio *bio; + struct bio_vec *bvec; + unsigned long flags; + int count, i, done = 0; + char *data; + + rq_for_each_bio(bio, rq) { + bio_for_each_segment(bvec, bio, i) { + if (!bcount) + break; + + count = min(bvec->bv_len, bcount); + + data = bvec_kmap_irq(bvec, &flags); + atapi_output_bytes(drive, data, count); + bvec_kunmap_irq(data, &flags); + + bcount -= count; + pc->b_count += count; + done += count; } - count = IDEFLOPPY_MIN(pc->b_count, bcount); - atapi_output_bytes(drive, pc->b_data, count); - bcount -= count; - pc->b_data += count; - pc->b_count -= count; + } + + idefloppy_do_end_request(drive, 1, done >> 9); + + if (bcount) { + printk(KERN_ERR "%s: leftover data in idefloppy_output_buffers, bcount == %d\n", drive->name, bcount); + idefloppy_write_zeros(drive, bcount); } } @@ -732,8 +737,6 @@ pc->request_transfer = 0; pc->buffer = pc->pc_buffer; pc->buffer_size = IDEFLOPPY_PC_BUFFER_SIZE; - pc->b_data = NULL; -// pc->bio = NULL; pc->callback = &idefloppy_pc_callback; } @@ -1199,7 +1202,6 @@ put_unaligned(htonl(block), (unsigned int *) &pc->c[2]); pc->callback = &idefloppy_rw_callback; pc->rq = rq; - pc->b_data = rq->buffer; pc->b_count = cmd == READ ? 0 : rq->bio->bi_size; if (rq->flags & REQ_RW) set_bit(PC_WRITING, &pc->flags); diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c --- a/drivers/ide/ide-proc.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/ide-proc.c Sun Oct 5 00:33:08 2003 @@ -522,7 +522,8 @@ if (*p != ':') goto parse_error; len = IDE_MIN(p - start, MAX_LEN); - strlcpy(name, start, IDE_MIN(len, MAX_LEN)); + strncpy(name, start, IDE_MIN(len, MAX_LEN)); + name[len] = 0; if (n > 0) { --n; diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c --- a/drivers/ide/ide.c Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/ide.c Sun Oct 5 00:33:07 2003 @@ -1800,27 +1800,26 @@ #ifdef CONFIG_BLK_DEV_PDC4030 static int __initdata probe_pdc4030; -extern void init_pdc4030(void); #endif #ifdef CONFIG_BLK_DEV_ALI14XX static int __initdata probe_ali14xx; -extern void init_ali14xx(void); +extern int ali14xx_init(void); #endif #ifdef CONFIG_BLK_DEV_UMC8672 static int __initdata probe_umc8672; -extern void init_umc8672(void); +extern int umc8672_init(void); #endif #ifdef CONFIG_BLK_DEV_DTC2278 static int __initdata probe_dtc2278; -extern void init_dtc2278(void); +extern int dtc2278_init(void); #endif #ifdef CONFIG_BLK_DEV_HT6560B static int __initdata probe_ht6560b; -extern void init_ht6560b(void); +extern int ht6560b_init(void); #endif #ifdef CONFIG_BLK_DEV_QD65XX static int __initdata probe_qd65xx; -extern void init_qd65xx(void); +extern int qd65xx_init(void); #endif static int __initdata is_chipset_set[MAX_HWIFS]; @@ -2238,8 +2237,9 @@ #endif /* CONFIG_BLK_DEV_CMD640 */ #ifdef CONFIG_BLK_DEV_PDC4030 { - extern int ide_probe_for_pdc4030(void); - (void) ide_probe_for_pdc4030(); + extern int pdc4030_init(void); + if (probe_pdc4030) + (void)pdc4030_init(); } #endif /* CONFIG_BLK_DEV_PDC4030 */ #ifdef CONFIG_BLK_DEV_IDE_PMAC @@ -2595,29 +2595,25 @@ init_ide_data(); -#ifdef CONFIG_BLK_DEV_PDC4030 - if (probe_pdc4030) - init_pdc4030(); -#endif #ifdef CONFIG_BLK_DEV_ALI14XX if (probe_ali14xx) - init_ali14xx(); + (void)ali14xx_init(); #endif #ifdef CONFIG_BLK_DEV_UMC8672 if (probe_umc8672) - init_umc8672(); + (void)umc8672_init(); #endif #ifdef CONFIG_BLK_DEV_DTC2278 if (probe_dtc2278) - init_dtc2278(); + (void)dtc2278_init(); #endif #ifdef CONFIG_BLK_DEV_HT6560B if (probe_ht6560b) - init_ht6560b(); + (void)ht6560b_init(); #endif #ifdef CONFIG_BLK_DEV_QD65XX if (probe_qd65xx) - init_qd65xx(); + (void)qd65xx_init(); #endif initializing = 1; diff -Nru a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c --- a/drivers/ide/legacy/ali14xx.c Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/legacy/ali14xx.c Sun Oct 5 00:33:07 2003 @@ -198,22 +198,12 @@ return t; } -int __init probe_ali14xx (void) +static int __init ali14xx_probe(void) { - /* auto-detect IDE controller port */ - if (!findPort()) { - printk(KERN_ERR "ali14xx: not found.\n"); - return 1; - } + ide_hwif_t *hwif, *mate; - printk(KERN_DEBUG "ali14xx: base= 0x%03x, regOn = 0x%02x.\n", basePort, regOn); - ide_hwifs[0].chipset = ide_ali14xx; - ide_hwifs[1].chipset = ide_ali14xx; - ide_hwifs[0].tuneproc = &ali14xx_tune_drive; - ide_hwifs[1].tuneproc = &ali14xx_tune_drive; - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; + printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", + basePort, regOn); /* initialize controller registers */ if (!initRegisters()) { @@ -221,74 +211,59 @@ return 1; } - probe_hwif_init(&ide_hwifs[0]); - probe_hwif_init(&ide_hwifs[1]); + hwif = &ide_hwifs[0]; + mate = &ide_hwifs[1]; - return 0; -} + hwif->chipset = ide_ali14xx; + hwif->tuneproc = &ali14xx_tune_drive; + hwif->mate = mate; + + mate->chipset = ide_ali14xx; + mate->tuneproc = &ali14xx_tune_drive; + mate->mate = hwif; + mate->channel = 1; -static void ali14xx_release (void) -{ - if (ide_hwifs[0].chipset != ide_ali14xx && - ide_hwifs[1].chipset != ide_ali14xx) - return; + probe_hwif_init(hwif); + probe_hwif_init(mate); - ide_hwifs[0].chipset = ide_unknown; - ide_hwifs[1].chipset = ide_unknown; - ide_hwifs[0].tuneproc = NULL; - ide_hwifs[1].tuneproc = NULL; - ide_hwifs[0].mate = NULL; - ide_hwifs[1].mate = NULL; + return 0; } -#ifndef MODULE -/* - * init_ali14xx: - * - * called by ide.c when parsing command line - */ - -void __init init_ali14xx (void) +/* Can be called directly from ide.c. */ +int __init ali14xx_init(void) { /* auto-detect IDE controller port */ - if (findPort()) - if (probe_ali14xx()) - goto no_detect; - return; - -no_detect: + if (findPort()) { + if (ali14xx_probe()) + return -ENODEV; + return 0; + } printk(KERN_ERR "ali14xx: not found.\n"); - ali14xx_release(); + return -ENODEV; } -#else - -MODULE_AUTHOR("see local file"); -MODULE_DESCRIPTION("support of ALI 14XX IDE chipsets"); -MODULE_LICENSE("GPL"); - -static int __init ali14xx_mod_init(void) +#ifdef MODULE +static void __exit ali14xx_release_hwif(ide_hwif_t *hwif) { - /* auto-detect IDE controller port */ - if (findPort()) - if (probe_ali14xx()) { - ali14xx_release(); - return -ENODEV; - } + if (hwif->chipset != ide_ali14xx) + return; - if (ide_hwifs[0].chipset != ide_ali14xx && - ide_hwifs[1].chipset != ide_ali14xx) { - ali14xx_release(); - return -ENODEV; - } - return 0; + hwif->chipset = ide_unknown; + hwif->tuneproc = NULL; + hwif->mate = NULL; + hwif->channel = 0; } -module_init(ali14xx_mod_init); -static void __exit ali14xx_mod_exit(void) +static void __exit ali14xx_exit(void) { - ali14xx_release(); + ali14xx_release_hwif(&ide_hwifs[0]); + ali14xx_release_hwif(&ide_hwifs[1]); } -module_exit(ali14xx_mod_exit); + +module_init(ali14xx_init); +module_exit(ali14xx_exit); #endif +MODULE_AUTHOR("see local file"); +MODULE_DESCRIPTION("support of ALI 14XX IDE chipsets"); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c --- a/drivers/ide/legacy/dtc2278.c Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/legacy/dtc2278.c Sun Oct 5 00:33:07 2003 @@ -95,9 +95,16 @@ HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; } -void __init probe_dtc2278 (void) +static int __init probe_dtc2278(void) { unsigned long flags; + ide_hwif_t *hwif, *mate; + + hwif = &ide_hwifs[0]; + mate = &ide_hwifs[1]; + + if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown) + return 1; local_irq_save(flags); /* @@ -117,76 +124,60 @@ #endif local_irq_restore(flags); - ide_hwifs[0].serialized = 1; - ide_hwifs[1].serialized = 1; - ide_hwifs[0].chipset = ide_dtc2278; - ide_hwifs[1].chipset = ide_dtc2278; - ide_hwifs[0].tuneproc = &tune_dtc2278; - ide_hwifs[0].drives[0].no_unmask = 1; - ide_hwifs[0].drives[1].no_unmask = 1; - ide_hwifs[1].drives[0].no_unmask = 1; - ide_hwifs[1].drives[1].no_unmask = 1; - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; + hwif->serialized = 1; + hwif->chipset = ide_dtc2278; + hwif->tuneproc = &tune_dtc2278; + hwif->drives[0].no_unmask = 1; + hwif->drives[1].no_unmask = 1; + hwif->mate = mate; + + mate->serialized = 1; + mate->chipset = ide_dtc2278; + mate->drives[0].no_unmask = 1; + mate->drives[1].no_unmask = 1; + mate->mate = hwif; + mate->channel = 1; + + probe_hwif_init(hwif); + probe_hwif_init(mate); - probe_hwif_init(&ide_hwifs[0]); - probe_hwif_init(&ide_hwifs[1]); + return 0; } -static void dtc2278_release (void) +/* Can be called directly from ide.c. */ +int __init dtc2278_init(void) { - if (ide_hwifs[0].chipset != ide_dtc2278 && - ide_hwifs[1].chipset != ide_dtc2278) + if (probe_dtc2278()) { + printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); + return -EBUSY; + } + return 0; +} + +#ifdef MODULE +static void __exit dtc2278_release_hwif(ide_hwif_t *hwif) +{ + if (hwif->chipset != ide_dtc2278) return; - ide_hwifs[0].serialized = 0; - ide_hwifs[1].serialized = 0; - ide_hwifs[0].chipset = ide_unknown; - ide_hwifs[1].chipset = ide_unknown; - ide_hwifs[0].tuneproc = NULL; - ide_hwifs[0].drives[0].no_unmask = 0; - ide_hwifs[0].drives[1].no_unmask = 0; - ide_hwifs[1].drives[0].no_unmask = 0; - ide_hwifs[1].drives[1].no_unmask = 0; - ide_hwifs[0].mate = NULL; - ide_hwifs[1].mate = NULL; + hwif->serialized = 0; + hwif->chipset = ide_unknown; + hwif->tuneproc = NULL; + hwif->drives[0].no_unmask = 0; + hwif->drives[1].no_unmask = 0; + hwif->mate = NULL; } -#ifndef MODULE -/* - * init_dtc2278: - * - * called by ide.c when parsing command line - */ - -void __init init_dtc2278 (void) +static void __exit dtc2278_exit(void) { - probe_dtc2278(); + dtc2278_release_hwif(&ide_hwifs[0]); + dtc2278_release_hwif(&ide_hwifs[1]); } -#else +module_init(dtc2278_init); +module_exit(dtc2278_exit); +#endif MODULE_AUTHOR("See Local File"); MODULE_DESCRIPTION("support of DTC-2278 VLB IDE chipsets"); MODULE_LICENSE("GPL"); - -static int __init dtc2278_mod_init(void) -{ - probe_dtc2278(); - if (ide_hwifs[0].chipset != ide_dtc2278 && - ide_hwifs[1].chipset != ide_dtc2278) { - dtc2278_release(); - return -ENODEV; - } - return 0; -} -module_init(dtc2278_mod_init); - -static void __exit dtc2278_mod_exit(void) -{ - dtc2278_release(); -} -module_exit(dtc2278_mod_exit); -#endif - diff -Nru a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c --- a/drivers/ide/legacy/ht6560b.c Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/legacy/ht6560b.c Sun Oct 5 00:33:09 2003 @@ -304,35 +304,16 @@ #endif } -void ht6560b_release (void) -{ - if (ide_hwifs[0].chipset != ide_ht6560b && - ide_hwifs[1].chipset != ide_ht6560b) - return; - - ide_hwifs[0].chipset = ide_unknown; - ide_hwifs[1].chipset = ide_unknown; - ide_hwifs[0].tuneproc = NULL; - ide_hwifs[1].tuneproc = NULL; - ide_hwifs[0].selectproc = NULL; - ide_hwifs[1].selectproc = NULL; - ide_hwifs[0].serialized = 0; - ide_hwifs[1].serialized = 0; - ide_hwifs[0].mate = NULL; - ide_hwifs[1].mate = NULL; - - ide_hwifs[0].drives[0].drive_data = 0; - ide_hwifs[0].drives[1].drive_data = 0; - ide_hwifs[1].drives[0].drive_data = 0; - ide_hwifs[1].drives[1].drive_data = 0; - release_region(HT_CONFIG_PORT, 1); -} - -static int __init ht6560b_mod_init(void) +/* Can be called directly from ide.c. */ +int __init ht6560b_init(void) { + ide_hwif_t *hwif, *mate; int t; - if (!request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name)) { + hwif = &ide_hwifs[0]; + mate = &ide_hwifs[1]; + + if (!request_region(HT_CONFIG_PORT, 1, hwif->name)) { printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", __FUNCTION__); return -ENODEV; @@ -343,39 +324,33 @@ goto release_region; } - ide_hwifs[0].chipset = ide_ht6560b; - ide_hwifs[1].chipset = ide_ht6560b; - ide_hwifs[0].selectproc = &ht6560b_selectproc; - ide_hwifs[1].selectproc = &ht6560b_selectproc; - ide_hwifs[0].tuneproc = &tune_ht6560b; - ide_hwifs[1].tuneproc = &tune_ht6560b; - ide_hwifs[0].serialized = 1; /* is this needed? */ - ide_hwifs[1].serialized = 1; /* is this needed? */ - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; + hwif->chipset = ide_ht6560b; + hwif->selectproc = &ht6560b_selectproc; + hwif->tuneproc = &tune_ht6560b; + hwif->serialized = 1; /* is this needed? */ + hwif->mate = mate; + + mate->chipset = ide_ht6560b; + mate->selectproc = &ht6560b_selectproc; + mate->tuneproc = &tune_ht6560b; + mate->serialized = 1; /* is this needed? */ + mate->mate = hwif; + mate->channel = 1; /* * Setting default configurations for drives */ t = (HT_CONFIG_DEFAULT << 8); t |= HT_TIMING_DEFAULT; - ide_hwifs[0].drives[0].drive_data = t; - ide_hwifs[0].drives[1].drive_data = t; - t |= (HT_SECONDARY_IF << 8); - ide_hwifs[1].drives[0].drive_data = t; - ide_hwifs[1].drives[1].drive_data = t; + hwif->drives[0].drive_data = t; + hwif->drives[1].drive_data = t; - probe_hwif_init(&ide_hwifs[0]); - probe_hwif_init(&ide_hwifs[1]); + t |= (HT_SECONDARY_IF << 8); + mate->drives[0].drive_data = t; + mate->drives[1].drive_data = t; -#ifdef MODULE - if (ide_hwifs[0].chipset != ide_ht6560b && - ide_hwifs[1].chipset != ide_ht6560b) { - ht6560b_release(); - return -ENODEV; - } -#endif + probe_hwif_init(hwif); + probe_hwif_init(mate); return 0; @@ -384,24 +359,34 @@ return -ENODEV; } -MODULE_AUTHOR("See Local File"); -MODULE_DESCRIPTION("HT-6560B EIDE-controller support"); -MODULE_LICENSE("GPL"); - #ifdef MODULE -static void __exit ht6560b_mod_exit(void) +static void __exit ht6560b_release_hwif(ide_hwif_t *hwif) { - ht6560b_release(); + if (hwif->chipset != ide_ht6560b) + return; + + hwif->chipset = ide_unknown; + hwif->tuneproc = NULL; + hwif->selectproc = NULL; + hwif->serialized = 0; + hwif->mate = NULL; + hwif->channel = 0; + + hwif->drives[0].drive_data = 0; + hwif->drives[1].drive_data = 0; } -module_init(ht6560b_mod_init); -module_exit(ht6560b_mod_exit); -#else -/* - * called by ide.c when parsing command line - */ -void __init init_ht6560b (void) +static void __exit ht6560b_exit(void) { - ht6560b_mod_init(); /* ignore return value */ + ht6560b_release_hwif(&ide_hwifs[0]); + ht6560b_release_hwif(&ide_hwifs[1]); + release_region(HT_CONFIG_PORT, 1); } + +module_init(ht6560b_init); +module_exit(ht6560b_exit); #endif + +MODULE_AUTHOR("See Local File"); +MODULE_DESCRIPTION("HT-6560B EIDE-controller support"); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c --- a/drivers/ide/legacy/pdc4030.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/legacy/pdc4030.c Sun Oct 5 00:33:08 2003 @@ -147,8 +147,6 @@ return pdc4030_cmd(drive, PROMISE_IDENTIFY); } -int enable_promise_support; - /* * setup_pdc4030() * Completes the setup of a Promise DC4030 controller card, once found. @@ -296,33 +294,24 @@ } } - -int __init ide_probe_for_pdc4030(void) +int __init pdc4030_init(void) { unsigned int index; ide_hwif_t *hwif; -#ifndef MODULE - if (enable_promise_support == 0) - return; -#endif - for (index = 0; index < MAX_HWIFS; index++) { hwif = &ide_hwifs[index]; if (hwif->chipset == ide_unknown && detect_pdc4030(hwif)) { -#ifndef MODULE - setup_pdc4030(hwif); -#else - return setup_pdc4030(hwif); -#endif + if (!setup_pdc4030(hwif)) + return -ENODEV; + return 0; } } -#ifdef MODULE - return 0; -#endif + return -ENODEV; } -static void __exit release_pdc4030(ide_hwif_t *hwif, ide_hwif_t *mate) +#ifdef MODULE +static void __exit pdc4030_release_hwif(ide_hwif_t *hwif) { hwif->chipset = ide_unknown; hwif->selectproc = NULL; @@ -333,71 +322,23 @@ hwif->drives[1].keep_settings = 0; hwif->drives[0].noprobe = 0; hwif->drives[1].noprobe = 0; - - if (mate != NULL) { - mate->chipset = ide_unknown; - mate->selectproc = NULL; - mate->serialized = 0; - mate->drives[0].io_32bit = 0; - mate->drives[1].io_32bit = 0; - mate->drives[0].keep_settings = 0; - mate->drives[1].keep_settings = 0; - mate->drives[0].noprobe = 0; - mate->drives[1].noprobe = 0; - } } -#ifndef MODULE -/* - * init_pdc4030: - * - * called by ide.c when parsing command line - */ - -void __init init_pdc4030(void) +static void __exit pdc4030_exit(void) { - enable_promise_support = 1; + unsigned int index; + + for (index = 0; index < MAX_HWIFS; index++) + pdc4030_release_hwif(&ide_hwifs[index]); } -#else +module_init(pdc4030_init); +module_exit(pdc4030_exit); +#endif MODULE_AUTHOR("Peter Denison"); MODULE_DESCRIPTION("Support of Promise 4030 VLB series IDE chipsets"); MODULE_LICENSE("GPL"); - -static int __init pdc4030_mod_init(void) -{ - if (enable_promise_support == 0) - enable_promise_support = 1; - - if (!ide_probe_for_pdc4030()) - return -ENODEV; - return 0; -} -module_init(pdc4030_mod_init); - -static void __exit pdc4030_mod_exit(void) -{ - unsigned int index; - ide_hwif_t *hwif; - - if (enable_promise_support == 0) - return; - - for (index = 0; index < MAX_HWIFS; index++) { - hwif = &ide_hwifs[index]; - if (hwif->chipset == ide_pdc4030) { - ide_hwif_t *mate = &ide_hwifs[hwif->index+1]; - if (mate->chipset == ide_pdc4030) - release_pdc4030(hwif, mate); - else - release_pdc4030(hwif, NULL); - } - } - enable_promise_support = 0; -} -module_exit(pdc4030_mod_exit); -#endif /* * promise_read_intr() is the handler for disk read/multread interrupts diff -Nru a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c --- a/drivers/ide/legacy/qd65xx.c Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/legacy/qd65xx.c Sun Oct 5 00:33:07 2003 @@ -338,12 +338,12 @@ * called to setup an ata channel : adjusts attributes & links for tuning */ -void __init qd_setup (int unit, int base, int config, unsigned int data0, unsigned int data1, void (*tuneproc) (ide_drive_t *, u8 pio)) +static void __init qd_setup(ide_hwif_t *hwif, int base, int config, + unsigned int data0, unsigned int data1, + void (*tuneproc) (ide_drive_t *, u8 pio)) { - ide_hwif_t *hwif = &ide_hwifs[unit]; - hwif->chipset = ide_qd65xx; - hwif->channel = unit; + hwif->channel = hwif->index; hwif->select_data = base; hwif->config_data = config; hwif->drives[0].drive_data = data0; @@ -354,19 +354,20 @@ probe_hwif_init(hwif); } +#ifdef MODULE /* * qd_unsetup: * * called to unsetup an ata channel : back to default values, unlinks tuning */ -static void __exit qd_unsetup (int unit) +static void __exit qd_unsetup(ide_hwif_t *hwif) { - ide_hwif_t *hwif = &ide_hwifs[unit]; u8 config = hwif->config_data; int base = hwif->select_data; void *tuneproc = (void *) hwif->tuneproc; - if (!(hwif->chipset == ide_qd65xx)) return; + if (hwif->chipset != ide_qd65xx) + return; printk(KERN_NOTICE "%s: back to defaults\n", hwif->name); @@ -381,13 +382,14 @@ qd_write_reg(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); qd_write_reg(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1])); } else { - qd_write_reg(unit?QD6580_DEF_DATA2:QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); + qd_write_reg(hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); } } else { printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n"); printk(KERN_WARNING "keeping settings !\n"); } } +#endif /* * qd_probe: @@ -396,8 +398,9 @@ * return 1 if another qd may be probed */ -int __init qd_probe (int base) +static int __init qd_probe(int base) { + ide_hwif_t *hwif; u8 config; u8 unit; @@ -414,9 +417,8 @@ /* qd6500 found */ - printk(KERN_NOTICE "%s: qd6500 at %#x\n", - ide_hwifs[unit].name, base); - + hwif = &ide_hwifs[unit]; + printk(KERN_NOTICE "%s: qd6500 at %#x\n", hwif->name, base); printk(KERN_DEBUG "qd6500: config=%#x, ID3=%u\n", config, QD_ID3); @@ -425,8 +427,8 @@ return 1; } - qd_setup(unit, base, config, QD6500_DEF_DATA, - QD6500_DEF_DATA, &qd6500_tune_drive); + qd_setup(hwif, base, config, QD6500_DEF_DATA, QD6500_DEF_DATA, + &qd6500_tune_drive); return 1; } @@ -448,25 +450,31 @@ if (control & QD_CONTR_SEC_DISABLED) { /* secondary disabled */ + + hwif = &ide_hwifs[unit]; printk(KERN_INFO "%s: qd6580: single IDE board\n", - ide_hwifs[unit].name); - qd_setup(unit, base, config | (control << 8), - QD6580_DEF_DATA, QD6580_DEF_DATA2, - &qd6580_tune_drive); + hwif->name); + qd_setup(hwif, base, config | (control << 8), + QD6580_DEF_DATA, QD6580_DEF_DATA2, + &qd6580_tune_drive); qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); return 1; } else { + ide_hwif_t *mate; + + hwif = &ide_hwifs[0]; + mate = &ide_hwifs[1]; /* secondary enabled */ printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n", - ide_hwifs[0].name,ide_hwifs[1].name); + hwif->name, mate->name); - qd_setup(0, base, config | (control << 8), - QD6580_DEF_DATA, QD6580_DEF_DATA, - &qd6580_tune_drive); - qd_setup(1, base, config | (control << 8), - QD6580_DEF_DATA2, QD6580_DEF_DATA2, - &qd6580_tune_drive); + qd_setup(hwif, base, config | (control << 8), + QD6580_DEF_DATA, QD6580_DEF_DATA, + &qd6580_tune_drive); + qd_setup(mate, base, config | (control << 8), + QD6580_DEF_DATA2, QD6580_DEF_DATA2, + &qd6580_tune_drive); qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); return 0; /* no other qd65xx possible */ @@ -476,38 +484,28 @@ return 1; } -#ifndef MODULE -/* - * init_qd65xx: - * - * called by ide.c when parsing command line - */ - -void __init init_qd65xx (void) -{ - if (qd_probe(0x30)) qd_probe(0xb0); -} - -#else - -MODULE_AUTHOR("Samuel Thibault"); -MODULE_DESCRIPTION("support of qd65xx vlb ide chipset"); -MODULE_LICENSE("GPL"); - -static int __init qd65xx_mod_init(void) +/* Can be called directly from ide.c. */ +int __init qd65xx_init(void) { - if (qd_probe(0x30)) qd_probe(0xb0); + if (qd_probe(0x30)) + qd_probe(0xb0); if (ide_hwifs[0].chipset != ide_qd65xx && ide_hwifs[1].chipset != ide_qd65xx) return -ENODEV; return 0; } -module_init(qd65xx_mod_init); -static void __exit qd65xx_mod_exit(void) +#ifdef MODULE +static void __exit qd65xx_exit(void) { - qd_unsetup(0); - qd_unsetup(1); + qd_unsetup(&ide_hwifs[0]); + qd_unsetup(&ide_hwifs[1]); } -module_exit(qd65xx_mod_exit); + +module_init(qd65xx_init); +module_exit(qd65xx_exit); #endif + +MODULE_AUTHOR("Samuel Thibault"); +MODULE_DESCRIPTION("support of qd65xx vlb ide chipset"); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c --- a/drivers/ide/legacy/umc8672.c Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/legacy/umc8672.c Sun Oct 5 00:33:07 2003 @@ -124,16 +124,16 @@ spin_unlock_irqrestore(&ide_lock, flags); } -int __init probe_umc8672 (void) +static int __init umc8672_probe(void) { unsigned long flags; + ide_hwif_t *hwif, *mate; - local_irq_save(flags); if (!request_region(0x108, 2, "umc8672")) { - local_irq_restore(flags); printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n"); return 1; } + local_irq_save(flags); outb_p(0x5A,0x108); /* enable umc */ if (in_umc (0xd5) != 0xa0) { local_irq_restore(flags); @@ -146,82 +146,62 @@ umc_set_speeds (current_speeds); local_irq_restore(flags); - ide_hwifs[0].chipset = ide_umc8672; - ide_hwifs[1].chipset = ide_umc8672; - ide_hwifs[0].tuneproc = &tune_umc; - ide_hwifs[1].tuneproc = &tune_umc; - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; + hwif = &ide_hwifs[0]; + mate = &ide_hwifs[1]; - probe_hwif_init(&ide_hwifs[0]); - probe_hwif_init(&ide_hwifs[1]); + hwif->chipset = ide_umc8672; + hwif->tuneproc = &tune_umc; + hwif->mate = mate; + + mate->chipset = ide_umc8672; + mate->tuneproc = &tune_umc; + mate->mate = hwif; + mate->channel = 1; + + probe_hwif_init(hwif); + probe_hwif_init(mate); return 0; } -static void umc8672_release (void) +/* Can be called directly from ide.c. */ +int __init umc8672_init(void) { - unsigned long flags; + if (umc8672_probe()) + return -ENODEV; + return 0; +} - local_irq_save(flags); - if (ide_hwifs[0].chipset != ide_umc8672 && - ide_hwifs[1].chipset != ide_umc8672) { - local_irq_restore(flags); +#ifdef MODULE +static void __exit umc8672_release_hwif(ide_hwif_t *hwif) +{ + if (hwif->chipset != ide_umc8672) return; - } - ide_hwifs[0].chipset = ide_unknown; - ide_hwifs[1].chipset = ide_unknown; - ide_hwifs[0].tuneproc = NULL; - ide_hwifs[1].tuneproc = NULL; - ide_hwifs[0].mate = NULL; - ide_hwifs[1].mate = NULL; - ide_hwifs[0].channel = 0; - ide_hwifs[1].channel = 0; - - outb_p(0xa5,0x108); /* disable umc */ - - release_region(0x108, 2); - local_irq_restore(flags); + hwif->chipset = ide_unknown; + hwif->tuneproc = NULL; + hwif->mate = NULL; + hwif->channel = 0; } -#ifndef MODULE -/* - * init_umc8672: - * - * called by ide.c when parsing command line - */ - -void __init init_umc8672 (void) +static void __exit umc8672_exit(void) { - if (probe_umc8672()) - printk(KERN_ERR "init_umc8672: umc8672 controller not found.\n"); -} + unsigned long flags; -#else + umc8672_release_hwif(&ide_hwifs[0]); + umc8672_release_hwif(&ide_hwifs[1]); -MODULE_AUTHOR("Wolfram Podien"); -MODULE_DESCRIPTION("Support for UMC 8672 IDE chipset"); -MODULE_LICENSE("GPL"); + local_irq_save(flags); + outb_p(0xa5, 0x108); /* disable umc */ + local_irq_restore(flags); -static int __init umc8672_mod_init(void) -{ - if (probe_umc8672()) - return -ENODEV; - if (ide_hwifs[0].chipset != ide_umc8672 && - ide_hwifs[1].chipset != ide_umc8672) { - umc8672_release(); - return -ENODEV; - } - return 0; + release_region(0x108, 2); } -module_init(umc8672_mod_init); -static void __exit umc8672_mod_exit(void) -{ - umc8672_release(); -} -module_exit(umc8672_mod_exit); +module_init(umc8672_init); +module_exit(umc8672_exit); #endif +MODULE_AUTHOR("Wolfram Podien"); +MODULE_DESCRIPTION("Support for UMC 8672 IDE chipset"); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile --- a/drivers/ide/pci/Makefile Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/pci/Makefile Sun Oct 5 00:33:07 2003 @@ -18,7 +18,6 @@ obj-$(CONFIG_BLK_DEV_OPTI621) += opti621.o obj-$(CONFIG_BLK_DEV_PDC202XX_OLD) += pdc202xx_old.o obj-$(CONFIG_BLK_DEV_PDC202XX_NEW) += pdc202xx_new.o -obj-$(CONFIG_BLK_DEV_PDC_ADMA) += pdcadma.o ide-adma.o obj-$(CONFIG_BLK_DEV_PIIX) += piix.o obj-$(CONFIG_BLK_DEV_RZ1000) += rz1000.o obj-$(CONFIG_BLK_DEV_SVWKS) += serverworks.o diff -Nru a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c --- a/drivers/ide/pci/amd74xx.c Sun Oct 5 00:33:10 2003 +++ b/drivers/ide/pci/amd74xx.c Sun Oct 5 00:33:10 2003 @@ -1,5 +1,5 @@ /* - * Version 2.9 + * Version 2.11 * * AMD 755/756/766/8111 and nVidia nForce IDE driver for Linux. * @@ -65,7 +65,6 @@ }; static struct amd_ide_chip *amd_config; -static unsigned char amd_enabled; static unsigned int amd_80w; static unsigned int amd_clock; @@ -103,7 +102,7 @@ amd_print("----------AMD BusMastering IDE Configuration----------------"); - amd_print("Driver Version: 2.9"); + amd_print("Driver Version: 2.11"); amd_print("South Bridge: %s", pci_name(bmide_dev)); pci_read_config_byte(dev, PCI_REVISION_ID, &t); @@ -250,9 +249,6 @@ static void amd74xx_tune_drive(ide_drive_t *drive, u8 pio) { - if (!((amd_enabled >> HWIF(drive)->channel) & 1)) - return; - if (pio == 255) { amd_set_drive(drive, ide_find_best_mode(drive, XFER_PIO | XFER_EPIO)); return; @@ -330,9 +326,6 @@ break; } - pci_read_config_dword(dev, AMD_IDE_ENABLE, &u); - amd_enabled = ((u & 1) ? 2 : 0) | ((u & 2) ? 1 : 0); - /* * Take care of prefetch & postwrite. */ @@ -408,23 +401,13 @@ hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; - if (!(hwif->udma_four)) - hwif->udma_four = ((amd_enabled & amd_80w) >> hwif->channel) & 1; + if (!hwif->udma_four) + hwif->udma_four = (amd_80w >> hwif->channel) & 1; hwif->ide_dma_check = &amd74xx_ide_dma_check; if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->autodma; hwif->drives[1].autodma = hwif->autodma; -} - -/* - * We allow the BM-DMA driver only work on enabled interfaces. - */ - -static void __init init_dma_amd74xx(ide_hwif_t *hwif, unsigned long dmabase) -{ - if ((amd_enabled >> hwif->channel) & 1) - ide_setup_dma(hwif, dmabase, 8); } extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/amd74xx.h b/drivers/ide/pci/amd74xx.h --- a/drivers/ide/pci/amd74xx.h Sun Oct 5 00:33:05 2003 +++ b/drivers/ide/pci/amd74xx.h Sun Oct 5 00:33:05 2003 @@ -27,7 +27,6 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *); static void init_hwif_amd74xx(ide_hwif_t *); -static void init_dma_amd74xx(ide_hwif_t *, unsigned long); static ide_pci_device_t amd74xx_chipsets[] __devinitdata = { { /* 0 */ @@ -35,9 +34,7 @@ .device = PCI_DEVICE_ID_AMD_COBRA_7401, .name = "AMD7401", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, @@ -48,9 +45,7 @@ .device = PCI_DEVICE_ID_AMD_VIPER_7409, .name = "AMD7409", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, @@ -61,9 +56,7 @@ .device = PCI_DEVICE_ID_AMD_VIPER_7411, .name = "AMD7411", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, @@ -74,9 +67,7 @@ .device = PCI_DEVICE_ID_AMD_OPUS_7441, .name = "AMD7441", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, @@ -87,9 +78,7 @@ .device = PCI_DEVICE_ID_AMD_8111_IDE, .name = "AMD8111", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .autodma = AUTODMA, .channels = 2, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, @@ -101,9 +90,7 @@ .device = PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, .name = "NFORCE", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, @@ -115,9 +102,7 @@ .device = PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, .name = "NFORCE2", .init_chipset = init_chipset_amd74xx, - .init_iops = NULL, .init_hwif = init_hwif_amd74xx, - .init_dma = init_dma_amd74xx, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, diff -Nru a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c --- a/drivers/ide/pci/cmd64x.c Sun Oct 5 00:33:10 2003 +++ b/drivers/ide/pci/cmd64x.c Sun Oct 5 00:33:10 2003 @@ -742,11 +742,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff -Nru a/drivers/ide/pci/cmd64x.h b/drivers/ide/pci/cmd64x.h --- a/drivers/ide/pci/cmd64x.h Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/cmd64x.h Sun Oct 5 00:33:08 2003 @@ -81,7 +81,6 @@ static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *); static void init_hwif_cmd64x(ide_hwif_t *); -static void init_dma_cmd64x(ide_hwif_t *, unsigned long); static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { { /* 0 */ @@ -91,7 +90,6 @@ .init_chipset = init_chipset_cmd64x, .init_iops = NULL, .init_hwif = init_hwif_cmd64x, - .init_dma = init_dma_cmd64x, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -104,7 +102,6 @@ .init_chipset = init_chipset_cmd64x, .init_iops = NULL, .init_hwif = init_hwif_cmd64x, - .init_dma = init_dma_cmd64x, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x51,0x80,0x80}}, @@ -117,7 +114,6 @@ .init_chipset = init_chipset_cmd64x, .init_iops = NULL, .init_hwif = init_hwif_cmd64x, - .init_dma = init_dma_cmd64x, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -130,7 +126,6 @@ .init_chipset = init_chipset_cmd64x, .init_iops = NULL, .init_hwif = init_hwif_cmd64x, - .init_dma = init_dma_cmd64x, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c --- a/drivers/ide/pci/cs5530.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/cs5530.c Sun Oct 5 00:33:08 2003 @@ -404,19 +404,6 @@ hwif->drives[1].autodma = hwif->autodma; } -/** - * init_dma_cs5530 - set up for DMA - * @hwif: interface - * @dmabase: DMA base address - * - * FIXME: this can go away - */ - -static void __init init_dma_cs5530 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/cs5530.h b/drivers/ide/pci/cs5530.h --- a/drivers/ide/pci/cs5530.h Sun Oct 5 00:33:05 2003 +++ b/drivers/ide/pci/cs5530.h Sun Oct 5 00:33:05 2003 @@ -27,7 +27,6 @@ static unsigned int init_chipset_cs5530(struct pci_dev *, const char *); static void init_hwif_cs5530(ide_hwif_t *); -static void init_dma_cs5530(ide_hwif_t *, unsigned long); static ide_pci_device_t cs5530_chipsets[] __devinitdata = { { /* 0 */ @@ -37,7 +36,6 @@ .init_chipset = init_chipset_cs5530, .init_iops = NULL, .init_hwif = init_hwif_cs5530, - .init_dma = init_dma_cs5530, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c --- a/drivers/ide/pci/generic.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/generic.c Sun Oct 5 00:33:08 2003 @@ -72,11 +72,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void init_dma_generic (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); #if 0 diff -Nru a/drivers/ide/pci/generic.h b/drivers/ide/pci/generic.h --- a/drivers/ide/pci/generic.h Sun Oct 5 00:33:06 2003 +++ b/drivers/ide/pci/generic.h Sun Oct 5 00:33:06 2003 @@ -7,7 +7,6 @@ static unsigned int init_chipset_generic(struct pci_dev *, const char *); static void init_hwif_generic(ide_hwif_t *); -static void init_dma_generic(ide_hwif_t *, unsigned long); static ide_pci_device_t generic_chipsets[] __devinitdata = { { /* 0 */ @@ -17,7 +16,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, @@ -30,7 +28,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -43,7 +40,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -56,7 +52,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = NODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -69,7 +64,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = NODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -82,7 +76,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = NODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -95,7 +88,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -108,7 +100,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -121,7 +112,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -134,7 +124,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -157,7 +146,6 @@ .init_chipset = init_chipset_generic, .init_iops = NULL, .init_hwif = init_hwif_generic, - .init_dma = init_dma_generic, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c --- a/drivers/ide/pci/hpt34x.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/hpt34x.c Sun Oct 5 00:33:08 2003 @@ -315,11 +315,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void __init init_dma_hpt34x (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff -Nru a/drivers/ide/pci/hpt34x.h b/drivers/ide/pci/hpt34x.h --- a/drivers/ide/pci/hpt34x.h Sun Oct 5 00:33:05 2003 +++ b/drivers/ide/pci/hpt34x.h Sun Oct 5 00:33:05 2003 @@ -33,7 +33,6 @@ static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *); static void init_hwif_hpt34x(ide_hwif_t *); -static void init_dma_hpt34x(ide_hwif_t *, unsigned long); static ide_pci_device_t hpt34x_chipsets[] __devinitdata = { { /* 0 */ @@ -43,7 +42,6 @@ .init_chipset = init_chipset_hpt34x, .init_iops = NULL, .init_hwif = init_hwif_hpt34x, - .init_dma = init_dma_hpt34x, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c --- a/drivers/ide/pci/it8172.c Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/pci/it8172.c Sun Oct 5 00:33:09 2003 @@ -284,11 +284,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void __init init_dma_it8172 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); static int __devinit it8172_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff -Nru a/drivers/ide/pci/it8172.h b/drivers/ide/pci/it8172.h --- a/drivers/ide/pci/it8172.h Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/it8172.h Sun Oct 5 00:33:08 2003 @@ -17,7 +17,6 @@ static void init_setup_it8172(struct pci_dev *, ide_pci_device_t *); static unsigned int init_chipset_it8172(struct pci_dev *, const char *); static void init_hwif_it8172(ide_hwif_t *); -static void init_dma_it8172(ide_hwif_t *, unsigned long); static ide_pci_device_t it8172_chipsets[] __devinitdata = { { /* 0 */ @@ -28,7 +27,6 @@ .init_chipset = init_chipset_it8172, .init_iops = NULL, .init_hwif = init_hwif_it8172, - .init_dma = init_dma_it8172, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x40,0x00,0x01}}, diff -Nru a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c --- a/drivers/ide/pci/ns87415.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/ns87415.c Sun Oct 5 00:33:08 2003 @@ -217,11 +217,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void __init init_dma_ns87415 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id) diff -Nru a/drivers/ide/pci/ns87415.h b/drivers/ide/pci/ns87415.h --- a/drivers/ide/pci/ns87415.h Sun Oct 5 00:33:06 2003 +++ b/drivers/ide/pci/ns87415.h Sun Oct 5 00:33:06 2003 @@ -6,7 +6,6 @@ #include static void init_hwif_ns87415(ide_hwif_t *); -static void init_dma_ns87415(ide_hwif_t *, unsigned long); static ide_pci_device_t ns87415_chipsets[] __devinitdata = { { /* 0 */ @@ -16,7 +15,6 @@ .init_chipset = NULL, .init_iops = NULL, .init_hwif = init_hwif_ns87415, - .init_dma = init_dma_ns87415, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c --- a/drivers/ide/pci/opti621.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/opti621.c Sun Oct 5 00:33:08 2003 @@ -348,11 +348,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void __init init_dma_opti621 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d) diff -Nru a/drivers/ide/pci/opti621.h b/drivers/ide/pci/opti621.h --- a/drivers/ide/pci/opti621.h Sun Oct 5 00:33:10 2003 +++ b/drivers/ide/pci/opti621.h Sun Oct 5 00:33:10 2003 @@ -7,7 +7,6 @@ static void init_setup_opti621(struct pci_dev *, ide_pci_device_t *); static void init_hwif_opti621(ide_hwif_t *); -static void init_dma_opti621(ide_hwif_t *, unsigned long); static ide_pci_device_t opti621_chipsets[] __devinitdata = { { /* 0 */ @@ -18,7 +17,6 @@ .init_chipset = NULL, .init_iops = NULL, .init_hwif = init_hwif_opti621, - .init_dma = init_dma_opti621, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, @@ -32,7 +30,6 @@ .init_chipset = NULL, .init_iops = NULL, .init_hwif = init_hwif_opti621, - .init_dma = init_dma_opti621, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, diff -Nru a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c --- a/drivers/ide/pci/pdc202xx_new.c Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/pci/pdc202xx_new.c Sun Oct 5 00:33:09 2003 @@ -563,11 +563,6 @@ #endif /* PDC202_DEBUG_CABLE */ } -static void __init init_dma_pdc202new (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/pdc202xx_new.h b/drivers/ide/pci/pdc202xx_new.h --- a/drivers/ide/pci/pdc202xx_new.h Sun Oct 5 00:33:06 2003 +++ b/drivers/ide/pci/pdc202xx_new.h Sun Oct 5 00:33:06 2003 @@ -188,7 +188,6 @@ static void init_setup_pdc20276(struct pci_dev *dev, ide_pci_device_t *d); static unsigned int init_chipset_pdcnew(struct pci_dev *, const char *); static void init_hwif_pdc202new(ide_hwif_t *); -static void init_dma_pdc202new(ide_hwif_t *, unsigned long); static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { { /* 0 */ @@ -199,7 +198,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -213,7 +211,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -227,7 +224,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, #ifdef CONFIG_PDC202XX_FORCE @@ -245,7 +241,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -259,7 +254,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -273,7 +267,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, #ifdef CONFIG_PDC202XX_FORCE @@ -291,7 +284,6 @@ .init_chipset = init_chipset_pdcnew, .init_iops = NULL, .init_hwif = init_hwif_pdc202new, - .init_dma = init_dma_pdc202new, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/pdcadma.c b/drivers/ide/pci/pdcadma.c --- a/drivers/ide/pci/pdcadma.c Sun Oct 5 00:33:09 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,162 +0,0 @@ -/* - * linux/drivers/ide/pci/pdcadma.c Version 0.05 Sept 10, 2002 - * - * Copyright (C) 1999-2000 Andre Hedrick - * May be copied or modified under the terms of the GNU General Public License - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "pdcadma.h" - -#if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static u8 pdcadma_proc = 0; -#define PDC_MAX_DEVS 5 -static struct pci_dev *pdc_devs[PDC_MAX_DEVS]; -static int n_pdc_devs; - -static int pdcadma_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - int i; - - for (i = 0; i < n_pdc_devs; i++) { - struct pci_dev *dev = pdc_devs[i]; - unsigned long bibma = pci_resource_start(dev, 4); - - p += sprintf(p, "\n " - "PDC ADMA %04X Chipset.\n", dev->device); - p += sprintf(p, "UDMA\n"); - p += sprintf(p, "PIO\n"); - - } - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) */ - -/* - * pdcadma_dma functions() initiates/aborts (U)DMA read/write - * operations on a drive. - */ -#if 0 - int (*ide_dma_read)(ide_drive_t *drive); - int (*ide_dma_write)(ide_drive_t *drive); - int (*ide_dma_begin)(ide_drive_t *drive); - int (*ide_dma_end)(ide_drive_t *drive); - int (*ide_dma_check)(ide_drive_t *drive); - int (*ide_dma_on)(ide_drive_t *drive); - int (*ide_dma_off)(ide_drive_t *drive); - int (*ide_dma_off_quietly)(ide_drive_t *drive); - int (*ide_dma_test_irq)(ide_drive_t *drive); - int (*ide_dma_host_on)(ide_drive_t *drive); - int (*ide_dma_host_off)(ide_drive_t *drive); - int (*ide_dma_bad_drive)(ide_drive_t *drive); - int (*ide_dma_good_drive)(ide_drive_t *drive); - int (*ide_dma_count)(ide_drive_t *drive); - int (*ide_dma_verbose)(ide_drive_t *drive); - int (*ide_dma_retune)(ide_drive_t *drive); - int (*ide_dma_lostirq)(ide_drive_t *drive); - int (*ide_dma_timeout)(ide_drive_t *drive); - -#endif - -static unsigned int __init init_chipset_pdcadma (struct pci_dev *dev, const char *name) -{ -#if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) - pdc_devs[n_pdc_devs++] = dev; - - if (!pdcadma_proc) { - pdcadma_proc = 1; - ide_pci_register_host_proc(&pdcadma_procs[0]); - } -#endif /* DISPLAY_PDCADMA_TIMINGS && CONFIG_PROC_FS */ - return 0; -} - -static void __init init_hwif_pdcadma (ide_hwif_t *hwif) -{ - hwif->autodma = 0; - hwif->dma_base = 0; - -// hwif->tuneproc = &pdcadma_tune_drive; -// hwif->speedproc = &pdcadma_tune_chipset; - -// if (hwif->dma_base) { -// hwif->autodma = 1; -// } - - hwif->udma_four = 1; - -// hwif->atapi_dma = 1; -// hwif->ultra_mask = 0x7f; -// hwif->mwdma_mask = 0x07; -// hwif->swdma_mask = 0x07; - -} - -static void __init init_dma_pdcadma (ide_hwif_t *hwif, unsigned long dmabase) -{ -#if 0 - ide_setup_dma(hwif, dmabase, 8); -#endif -} - -extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); - -static int __devinit pdcadma_init_one(struct pci_dev *dev, const struct pci_device_id *id) -{ - ide_pci_device_t *d = &pdcadma_chipsets[id->driver_data]; - if (dev->device != d->device) - BUG(); - ide_setup_pci_device(dev, d); - MOD_INC_USE_COUNT; - return 1; -} - -static struct pci_device_id pdcadma_pci_tbl[] = { - { PCI_VENDOR_ID_PDC, PCI_DEVICE_ID_PDC_1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { 0, }, -}; - -static struct pci_driver driver = { - .name = "PDCADMA-IDE", - .id_table = pdcadma_pci_tbl, - .probe = pdcadma_init_one, -}; - -static int pdcadma_ide_init(void) -{ - return ide_pci_register_driver(&driver); -} - -static void pdcadma_ide_exit(void) -{ - ide_pci_unregister_driver(&driver); -} - -module_init(pdcadma_ide_init); -module_exit(pdcadma_ide_exit); - -MODULE_AUTHOR("Andre Hedrick"); -MODULE_DESCRIPTION("PCI driver module for PDCADMA IDE"); -MODULE_LICENSE("GPL"); diff -Nru a/drivers/ide/pci/pdcadma.h b/drivers/ide/pci/pdcadma.h --- a/drivers/ide/pci/pdcadma.h Sun Oct 5 00:33:05 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,56 +0,0 @@ -#ifndef PDC_ADMA_H -#define PDC_ADMA_H - -#include -#include -#include - -#undef DISPLAY_PDCADMA_TIMINGS - -#if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static u8 pdcadma_proc; - -static int pdcadma_get_info(char *, char **, off_t, int); - -static ide_pci_host_proc_t pdcadma_procs[] __initdata = { - { - .name = "pdcadma", - .set = 1, - .get_info = pdcadma_get_info, - .parent = NULL, - }, -}; -#endif /* defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) */ - -static void init_setup_pdcadma(struct pci_dev *, ide_pci_device_t *); -static unsigned int init_chipset_pdcadma(struct pci_dev *, const char *); -static void init_hwif_pdcadma(ide_hwif_t *); -static void init_dma_pdcadma(ide_hwif_t *, unsigned long); - -static ide_pci_device_t pdcadma_chipsets[] __devinitdata = { - { /* 0 */ - .vendor = PCI_VENDOR_ID_PDC, - .device = PCI_DEVICE_ID_PDC_1841, - .name = "PDCADMA", - .init_setup = init_setup_pdcadma, - .init_chipset = init_chipset_pdcadma, - .init_iops = NULL, - .init_hwif = init_hwif_pdcadma, - .init_dma = init_dma_pdcadma, - .channels = 2, - .autodma = NODMA, - .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, - .bootable = OFF_BOARD, - .extra = 0, - },{ - .vendor = 0, - .device = 0, - .channels = 0, - .bootable = EOL, - } -}; - -#endif /* PDC_ADMA_H */ diff -Nru a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c --- a/drivers/ide/pci/piix.c Sun Oct 5 00:33:05 2003 +++ b/drivers/ide/pci/piix.c Sun Oct 5 00:33:05 2003 @@ -709,21 +709,6 @@ hwif->drives[0].autodma = hwif->autodma; } -/** - * init_dma_piix - set up the PIIX DMA - * @hwif: IDE interface - * @dmabase: DMA PCI base - * - * Set up the DMA on the PIIX controller, providing a DMA base is - * available. The PIIX follows the normal specs so we do nothing - * magical here. - */ - -static void __init init_dma_piix (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); /** diff -Nru a/drivers/ide/pci/piix.h b/drivers/ide/pci/piix.h --- a/drivers/ide/pci/piix.h Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/pci/piix.h Sun Oct 5 00:33:07 2003 @@ -30,8 +30,6 @@ static void init_setup_piix(struct pci_dev *, ide_pci_device_t *); static unsigned int __devinit init_chipset_piix(struct pci_dev *, const char *); static void init_hwif_piix(ide_hwif_t *); -static void init_dma_piix(ide_hwif_t *, unsigned long); - /* * Table of the various PIIX capability blocks @@ -47,7 +45,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -61,7 +58,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -75,7 +71,6 @@ .init_chipset = NULL, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = NULL, .channels = 2, .autodma = NODMA, .enablebits = {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}}, @@ -89,7 +84,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -103,7 +97,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -117,7 +110,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -131,7 +123,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -145,7 +136,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -159,7 +149,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -173,7 +162,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -187,7 +175,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -201,7 +188,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -215,7 +201,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -229,7 +214,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -243,7 +227,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -257,7 +240,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -271,7 +253,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -285,7 +266,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, @@ -299,7 +279,6 @@ .init_chipset = init_chipset_piix, .init_iops = NULL, .init_hwif = init_hwif_piix, - .init_dma = init_dma_piix, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, diff -Nru a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c --- a/drivers/ide/pci/sc1200.c Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/pci/sc1200.c Sun Oct 5 00:33:09 2003 @@ -396,44 +396,44 @@ __u32 regs[4]; } sc1200_saved_state_t; -static int sc1200_save_state (struct pci_dev *dev, u32 state) + +static int sc1200_suspend (struct pci_dev *dev, u32 state) { ide_hwif_t *hwif = NULL; -printk("SC1200: save_state(%u)\n", state); - if (state != 0) - return 0; // we only save state when going from full power to less - // - // Loop over all interfaces that are part of this PCI device: - // - while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) { - sc1200_saved_state_t *ss; - unsigned int basereg, r; - // - // allocate a permanent save area, if not already allocated - // - ss = (sc1200_saved_state_t *)hwif->config_data; - if (ss == NULL) { - ss = kmalloc(sizeof(sc1200_saved_state_t), GFP_KERNEL); - if (ss == NULL) - return -ENOMEM; - (sc1200_saved_state_t *)hwif->config_data = ss; - } - ss = (sc1200_saved_state_t *)hwif->config_data; + printk("SC1200: suspend(%u)\n", state); + + if (state == 0) { + // we only save state when going from full power to less + // - // Save timing registers: this may be unnecessary if BIOS also does it + // Loop over all interfaces that are part of this PCI device: // - basereg = hwif->channel ? 0x50 : 0x40; - for (r = 0; r < 4; ++r) { - pci_read_config_dword (hwif->pci_dev, basereg + (r<<2), &ss->regs[r]); + while ((hwif = lookup_pci_dev(hwif, dev)) != NULL) { + sc1200_saved_state_t *ss; + unsigned int basereg, r; + // + // allocate a permanent save area, if not already allocated + // + ss = (sc1200_saved_state_t *)hwif->config_data; + if (ss == NULL) { + ss = kmalloc(sizeof(sc1200_saved_state_t), GFP_KERNEL); + if (ss == NULL) + return -ENOMEM; + (sc1200_saved_state_t *)hwif->config_data = ss; + } + ss = (sc1200_saved_state_t *)hwif->config_data; + // + // Save timing registers: this may be unnecessary if + // BIOS also does it + // + basereg = hwif->channel ? 0x50 : 0x40; + for (r = 0; r < 4; ++r) { + pci_read_config_dword (hwif->pci_dev, basereg + (r<<2), &ss->regs[r]); + } } } - return 0; -} -static int sc1200_suspend (struct pci_dev *dev, u32 state) -{ - printk("SC1200: suspend(%u)\n", state); /* You don't need to iterate over disks -- sysfs should have done that for you already */ pci_disable_device(dev); @@ -545,11 +545,6 @@ hwif->drives[1].autodma = hwif->autodma; } -static void __init init_dma_sc1200 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); @@ -572,7 +567,6 @@ .name = "SC1200 IDE", .id_table = sc1200_pci_tbl, .probe = sc1200_init_one, - .save_state = sc1200_save_state, .suspend = sc1200_suspend, .resume = sc1200_resume, }; diff -Nru a/drivers/ide/pci/sc1200.h b/drivers/ide/pci/sc1200.h --- a/drivers/ide/pci/sc1200.h Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/pci/sc1200.h Sun Oct 5 00:33:07 2003 @@ -27,7 +27,6 @@ static unsigned int init_chipset_sc1200(struct pci_dev *, const char *); static void init_hwif_sc1200(ide_hwif_t *); -static void init_dma_sc1200(ide_hwif_t *, unsigned long); static ide_pci_device_t sc1200_chipsets[] __devinitdata = { { /* 0 */ @@ -37,7 +36,6 @@ .init_chipset = init_chipset_sc1200, .init_iops = NULL, .init_hwif = init_hwif_sc1200, - .init_dma = init_dma_sc1200, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c --- a/drivers/ide/pci/siimage.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/siimage.c Sun Oct 5 00:33:08 2003 @@ -1150,20 +1150,6 @@ hwif->drives[1].autodma = hwif->autodma; } -/** - * init_dma_siimage - set up IDE DMA - * @hwif: interface - * @dmabase: DMA base address to use - * - * For the SI chips this requires no special set up so we can just - * let the IDE DMA core do the usual work. - */ - -static void __init init_dma_siimage (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/siimage.h b/drivers/ide/pci/siimage.h --- a/drivers/ide/pci/siimage.h Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/siimage.h Sun Oct 5 00:33:08 2003 @@ -44,7 +44,6 @@ static unsigned int init_chipset_siimage(struct pci_dev *, const char *); static void init_iops_siimage(ide_hwif_t *); static void init_hwif_siimage(ide_hwif_t *); -static void init_dma_siimage(ide_hwif_t *, unsigned long); static ide_pci_device_t siimage_chipsets[] __devinitdata = { { /* 0 */ @@ -54,7 +53,6 @@ .init_chipset = init_chipset_siimage, .init_iops = init_iops_siimage, .init_hwif = init_hwif_siimage, - .init_dma = init_dma_siimage, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -67,7 +65,6 @@ .init_chipset = init_chipset_siimage, .init_iops = init_iops_siimage, .init_hwif = init_hwif_siimage, - .init_dma = init_dma_siimage, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, @@ -80,7 +77,6 @@ .init_chipset = init_chipset_siimage, .init_iops = init_iops_siimage, .init_hwif = init_hwif_siimage, - .init_dma = init_dma_siimage, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, diff -Nru a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c --- a/drivers/ide/pci/sis5513.c Sun Oct 5 00:33:08 2003 +++ b/drivers/ide/pci/sis5513.c Sun Oct 5 00:33:08 2003 @@ -942,11 +942,6 @@ return; } -static void __init init_dma_sis5513 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/sis5513.h b/drivers/ide/pci/sis5513.h --- a/drivers/ide/pci/sis5513.h Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/pci/sis5513.h Sun Oct 5 00:33:09 2003 @@ -27,7 +27,6 @@ static unsigned int init_chipset_sis5513(struct pci_dev *, const char *); static void init_hwif_sis5513(ide_hwif_t *); -static void init_dma_sis5513(ide_hwif_t *, unsigned long); static ide_pci_device_t sis5513_chipsets[] __devinitdata = { { /* 0 */ @@ -37,7 +36,6 @@ .init_chipset = init_chipset_sis5513, .init_iops = NULL, .init_hwif = init_hwif_sis5513, - .init_dma = init_dma_sis5513, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, diff -Nru a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c --- a/drivers/ide/pci/slc90e66.c Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/pci/slc90e66.c Sun Oct 5 00:33:09 2003 @@ -362,11 +362,6 @@ #endif /* !CONFIG_BLK_DEV_IDEDMA */ } -static void __init init_dma_slc90e66 (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} - extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/slc90e66.h b/drivers/ide/pci/slc90e66.h --- a/drivers/ide/pci/slc90e66.h Sun Oct 5 00:33:07 2003 +++ b/drivers/ide/pci/slc90e66.h Sun Oct 5 00:33:07 2003 @@ -29,7 +29,6 @@ static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *); static void init_hwif_slc90e66(ide_hwif_t *); -static void init_dma_slc90e66(ide_hwif_t *, unsigned long); static ide_pci_device_t slc90e66_chipsets[] __devinitdata = { { /* 0 */ @@ -39,7 +38,6 @@ .init_chipset = init_chipset_slc90e66, .init_iops = NULL, .init_hwif = init_hwif_slc90e66, - .init_dma = init_dma_slc90e66, .channels = 2, .autodma = AUTODMA, .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, diff -Nru a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c --- a/drivers/ide/pci/via82cxxx.c Sun Oct 5 00:33:05 2003 +++ b/drivers/ide/pci/via82cxxx.c Sun Oct 5 00:33:05 2003 @@ -1,6 +1,6 @@ /* * - * Version 3.37 + * Version 3.38 * * VIA IDE driver for Linux. Supported southbridges: * @@ -96,7 +96,6 @@ }; static struct via_isa_bridge *via_config; -static unsigned char via_enabled; static unsigned int via_80w; static unsigned int via_clock; static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" }; @@ -146,7 +145,7 @@ via_print("----------VIA BusMastering IDE Configuration" "----------------"); - via_print("Driver Version: 3.37"); + via_print("Driver Version: 3.38"); via_print("South Bridge: VIA %s", via_config->name); @@ -370,9 +369,6 @@ static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio) { - if (!((via_enabled >> HWIF(drive)->channel) & 1)) - return; - if (pio == 255) { via_set_drive(drive, ide_find_best_mode(drive, XFER_PIO | XFER_EPIO)); @@ -506,7 +502,6 @@ */ pci_read_config_byte(dev, VIA_IDE_ENABLE, &v); - via_enabled = ((v & 1) ? 2 : 0) | ((v & 2) ? 1 : 0); /* * Set up FIFO sizes and thresholds. @@ -523,9 +518,9 @@ /* Fix FIFO split between channels */ if (via_config->flags & VIA_SET_FIFO) { t &= (t & 0x9f); - switch (via_enabled) { - case 1: t |= 0x00; break; /* 16 on primary */ - case 2: t |= 0x60; break; /* 16 on secondary */ + switch (v & 3) { + case 2: t |= 0x00; break; /* 16 on primary */ + case 1: t |= 0x60; break; /* 16 on secondary */ case 3: t |= 0x20; break; /* 8 pri 8 sec */ } } @@ -603,27 +598,13 @@ hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; - if (!(hwif->udma_four)) - hwif->udma_four = ((via_enabled & via_80w) >> hwif->channel) & 1; + if (!hwif->udma_four) + hwif->udma_four = (via_80w >> hwif->channel) & 1; hwif->ide_dma_check = &via82cxxx_ide_dma_check; if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->autodma; hwif->drives[1].autodma = hwif->autodma; -} - -/** - * init_dma_via82cxxx - set up for IDE DMA - * @hwif: IDE interface - * @dmabase: DMA base address - * - * We allow the BM-DMA driver to only work on enabled interfaces. - */ - -static void __init init_dma_via82cxxx(ide_hwif_t *hwif, unsigned long dmabase) -{ - if ((via_enabled >> hwif->channel) & 1) - ide_setup_dma(hwif, dmabase, 8); } extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); diff -Nru a/drivers/ide/pci/via82cxxx.h b/drivers/ide/pci/via82cxxx.h --- a/drivers/ide/pci/via82cxxx.h Sun Oct 5 00:33:09 2003 +++ b/drivers/ide/pci/via82cxxx.h Sun Oct 5 00:33:09 2003 @@ -27,7 +27,6 @@ static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *); static void init_hwif_via82cxxx(ide_hwif_t *); -static void init_dma_via82cxxx(ide_hwif_t *, unsigned long); static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { { /* 0 */ @@ -35,9 +34,7 @@ .device = PCI_DEVICE_ID_VIA_82C576_1, .name = "VP_IDE", .init_chipset = init_chipset_via82cxxx, - .init_iops = NULL, .init_hwif = init_hwif_via82cxxx, - .init_dma = init_dma_via82cxxx, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, @@ -48,9 +45,7 @@ .device = PCI_DEVICE_ID_VIA_82C586_1, .name = "VP_IDE", .init_chipset = init_chipset_via82cxxx, - .init_iops = NULL, .init_hwif = init_hwif_via82cxxx, - .init_dma = init_dma_via82cxxx, .channels = 2, .autodma = NOAUTODMA, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, diff -Nru a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c --- a/drivers/input/joystick/analog.c Sun Oct 5 00:33:10 2003 +++ b/drivers/input/joystick/analog.c Sun Oct 5 00:33:10 2003 @@ -159,7 +159,7 @@ #define DELTA(x,y) ((y)-(x)) #define TIME_NAME "TSC" #elif __alpha__ -#define GET_TIME(x) do { x = get_cycles(x); } while (0) +#define GET_TIME(x) do { x = get_cycles(); } while (0) #define DELTA(x,y) ((y)-(x)) #define TIME_NAME "PCC" #else diff -Nru a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig --- a/drivers/input/keyboard/Kconfig Sun Oct 5 00:33:10 2003 +++ b/drivers/input/keyboard/Kconfig Sun Oct 5 00:33:10 2003 @@ -12,10 +12,11 @@ If unsure, say Y. config KEYBOARD_ATKBD - tristate "AT keyboard support" if EMBEDDED || !X86 + tristate "AT keyboard support" if !PC default y depends on INPUT && INPUT_KEYBOARD - select SERIO_I8042 + select SERIO + select SERIO_I8042 if PC help Say Y here if you want to use a standard AT or PS/2 keyboard. Usually you'll need this, unless you have a different type keyboard (USB, ADB diff -Nru a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig --- a/drivers/input/mouse/Kconfig Sun Oct 5 00:33:09 2003 +++ b/drivers/input/mouse/Kconfig Sun Oct 5 00:33:09 2003 @@ -15,7 +15,8 @@ tristate "PS/2 mouse" default y depends on INPUT && INPUT_MOUSE - select SERIO_I8042 + select SERIO + select SERIO_I8042 if PC ---help--- Say Y here if you have a PS/2 mouse connected to your system. This includes the standard 2 or 3-button PS/2 mouse, as well as PS/2 diff -Nru a/drivers/isdn/hardware/eicon/debuglib.h b/drivers/isdn/hardware/eicon/debuglib.h --- a/drivers/isdn/hardware/eicon/debuglib.h Sun Oct 5 00:33:10 2003 +++ b/drivers/isdn/hardware/eicon/debuglib.h Sun Oct 5 00:33:10 2003 @@ -103,28 +103,28 @@ #define DL_TO_KERNEL 0x40000000 #ifdef DIVA_NO_DEBUGLIB -#define myDbgPrint_LOG(x,...) do { } while(0); -#define myDbgPrint_FTL(x,...) do { } while(0); -#define myDbgPrint_ERR(x,...) do { } while(0); -#define myDbgPrint_TRC(x,...) do { } while(0); -#define myDbgPrint_MXLOG(x,...) do { } while(0); -#define myDbgPrint_EVL(x,...) do { } while(0); -#define myDbgPrint_REG(x,...) do { } while(0); -#define myDbgPrint_MEM(x,...) do { } while(0); -#define myDbgPrint_SPL(x,...) do { } while(0); -#define myDbgPrint_IRP(x,...) do { } while(0); -#define myDbgPrint_TIM(x,...) do { } while(0); -#define myDbgPrint_BLK(x,...) do { } while(0); -#define myDbgPrint_TAPI(x,...) do { } while(0); -#define myDbgPrint_NDIS(x,...) do { } while(0); -#define myDbgPrint_CONN(x,...) do { } while(0); -#define myDbgPrint_STAT(x,...) do { } while(0); -#define myDbgPrint_SEND(x,...) do { } while(0); -#define myDbgPrint_RECV(x,...) do { } while(0); -#define myDbgPrint_PRV0(x,...) do { } while(0); -#define myDbgPrint_PRV1(x,...) do { } while(0); -#define myDbgPrint_PRV2(x,...) do { } while(0); -#define myDbgPrint_PRV3(x,...) do { } while(0); +#define myDbgPrint_LOG(x...) do { } while(0); +#define myDbgPrint_FTL(x...) do { } while(0); +#define myDbgPrint_ERR(x...) do { } while(0); +#define myDbgPrint_TRC(x...) do { } while(0); +#define myDbgPrint_MXLOG(x...) do { } while(0); +#define myDbgPrint_EVL(x...) do { } while(0); +#define myDbgPrint_REG(x...) do { } while(0); +#define myDbgPrint_MEM(x...) do { } while(0); +#define myDbgPrint_SPL(x...) do { } while(0); +#define myDbgPrint_IRP(x...) do { } while(0); +#define myDbgPrint_TIM(x...) do { } while(0); +#define myDbgPrint_BLK(x...) do { } while(0); +#define myDbgPrint_TAPI(x...) do { } while(0); +#define myDbgPrint_NDIS(x...) do { } while(0); +#define myDbgPrint_CONN(x...) do { } while(0); +#define myDbgPrint_STAT(x...) do { } while(0); +#define myDbgPrint_SEND(x...) do { } while(0); +#define myDbgPrint_RECV(x...) do { } while(0); +#define myDbgPrint_PRV0(x...) do { } while(0); +#define myDbgPrint_PRV1(x...) do { } while(0); +#define myDbgPrint_PRV2(x...) do { } while(0); +#define myDbgPrint_PRV3(x...) do { } while(0); #define DBG_TEST(func,args) do { } while(0); #define DBG_EVL_ID(args) do { } while(0); diff -Nru a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c --- a/drivers/isdn/hardware/eicon/divamnt.c Sun Oct 5 00:33:08 2003 +++ b/drivers/isdn/hardware/eicon/divamnt.c Sun Oct 5 00:33:08 2003 @@ -1,4 +1,4 @@ -/* $Id: divamnt.c,v 1.27 2003/09/09 06:46:29 schindler Exp $ +/* $Id: divamnt.c,v 1.28 2003/09/18 06:57:18 schindler Exp $ * * Driver for Eicon DIVA Server ISDN cards. * Maint module @@ -24,10 +24,9 @@ #include "platform.h" #include "di_defs.h" #include "divasync.h" -#include "di_defs.h" #include "debug_if.h" -static char *main_revision = "$Revision: 1.27 $"; +static char *main_revision = "$Revision: 1.28 $"; static int major; diff -Nru a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c --- a/drivers/isdn/hardware/eicon/divasmain.c Sun Oct 5 00:33:06 2003 +++ b/drivers/isdn/hardware/eicon/divasmain.c Sun Oct 5 00:33:06 2003 @@ -1,4 +1,4 @@ -/* $Id: divasmain.c,v 1.40 2003/09/10 08:02:33 schindler Exp $ +/* $Id: divasmain.c,v 1.43 2003/09/22 08:57:31 schindler Exp $ * * Low level driver for Eicon DIVA Server ISDN cards. * @@ -9,13 +9,11 @@ * of the GNU General Public License, incorporated herein by reference. */ -#define __KERNEL_SYSCALLS__ #include #include #include #include #include -#include #include #include #include @@ -43,7 +41,7 @@ #include "diva_dma.h" #include "diva_pci.h" -static char *main_revision = "$Revision: 1.40 $"; +static char *main_revision = "$Revision: 1.43 $"; static int major; diff -Nru a/drivers/isdn/hardware/eicon/dqueue.c b/drivers/isdn/hardware/eicon/dqueue.c --- a/drivers/isdn/hardware/eicon/dqueue.c Sun Oct 5 00:33:08 2003 +++ b/drivers/isdn/hardware/eicon/dqueue.c Sun Oct 5 00:33:08 2003 @@ -1,10 +1,10 @@ -/* $Id: dqueue.c,v 1.1.2.2 2001/02/11 14:40:41 armin Exp $ +/* $Id: dqueue.c,v 1.5 2003/04/12 21:40:49 schindler Exp $ * * Driver for Eicon DIVA Server ISDN cards. * User Mode IDI Interface * - * Copyright 2000,2001 by Armin Schindler (mac@melware.de) - * Copyright 2000,2001 Cytronics & Melware (info@melware.de) + * Copyright 2000-2003 by Armin Schindler (mac@melware.de) + * Copyright 2000-2003 Cytronics & Melware (info@melware.de) * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. diff -Nru a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c --- a/drivers/isdn/hardware/eicon/mntfunc.c Sun Oct 5 00:33:05 2003 +++ b/drivers/isdn/hardware/eicon/mntfunc.c Sun Oct 5 00:33:05 2003 @@ -1,4 +1,4 @@ -/* $Id: mntfunc.c,v 1.15 2003/08/25 14:49:53 schindler Exp $ +/* $Id: mntfunc.c,v 1.16 2003/09/18 06:57:17 schindler Exp $ * * Driver for Eicon DIVA Server ISDN cards. * Maint module @@ -14,7 +14,6 @@ #include "platform.h" #include "di_defs.h" #include "divasync.h" -#include "di_defs.h" #include "debug_if.h" extern char *DRIVERRELEASE_MNT; diff -Nru a/drivers/isdn/hardware/eicon/os_capi.h b/drivers/isdn/hardware/eicon/os_capi.h --- a/drivers/isdn/hardware/eicon/os_capi.h Sun Oct 5 00:33:09 2003 +++ b/drivers/isdn/hardware/eicon/os_capi.h Sun Oct 5 00:33:09 2003 @@ -1,10 +1,10 @@ -/* $Id: os_capi.h,v 1.1.2.2 2002/10/02 14:38:38 armin Exp $ +/* $Id: os_capi.h,v 1.7 2003/04/12 21:40:49 schindler Exp $ * * ISDN interface module for Eicon active cards DIVA. * CAPI Interface OS include files * - * Copyright 2000-2002 by Armin Schindler (mac@melware.de) - * Copyright 2000-2002 Cytronics & Melware (info@melware.de) + * Copyright 2000-2003 by Armin Schindler (mac@melware.de) + * Copyright 2000-2003 Cytronics & Melware (info@melware.de) * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. diff -Nru a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h --- a/drivers/isdn/hardware/eicon/platform.h Sun Oct 5 00:33:09 2003 +++ b/drivers/isdn/hardware/eicon/platform.h Sun Oct 5 00:33:09 2003 @@ -1,4 +1,4 @@ -/* $Id: platform.h,v 1.31 2003/09/08 15:15:22 schindler Exp $ +/* $Id: platform.h,v 1.32 2003/09/18 06:59:59 schindler Exp $ * * platform.h * @@ -19,7 +19,6 @@ #endif #include -#include #include #include #include diff -Nru a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c --- a/drivers/isdn/i4l/isdn_common.c Sun Oct 5 00:33:07 2003 +++ b/drivers/isdn/i4l/isdn_common.c Sun Oct 5 00:33:07 2003 @@ -2229,8 +2229,10 @@ isdn_info_update(); return 0; -/* err_tty_modem:*/ +#ifdef CONFIG_ISDN_PPP + err_tty_modem: isdn_tty_exit(); +#endif err_cleanup_devfs: isdn_cleanup_devfs(); unregister_chrdev(ISDN_MAJOR, "isdn"); diff -Nru a/drivers/mca/mca-legacy.c b/drivers/mca/mca-legacy.c --- a/drivers/mca/mca-legacy.c Sun Oct 5 00:33:10 2003 +++ b/drivers/mca/mca-legacy.c Sun Oct 5 00:33:10 2003 @@ -28,7 +28,7 @@ #include #include -#include +#include #include /* NOTE: This structure is stack allocated */ diff -Nru a/drivers/mca/mca-proc.c b/drivers/mca/mca-proc.c --- a/drivers/mca/mca-proc.c Sun Oct 5 00:33:09 2003 +++ b/drivers/mca/mca-proc.c Sun Oct 5 00:33:09 2003 @@ -120,12 +120,13 @@ len += sprintf(buf+len, "Id: %02x%02x\n", mca_dev->pos[1], mca_dev->pos[0]); len += sprintf(buf+len, "Enabled: %s\nPOS: ", - mca_isenabled(slot) ? "Yes" : "No"); + mca_device_status(mca_dev) == MCA_ADAPTER_NORMAL ? + "Yes" : "No"); for(i=0; i<8; i++) { len += sprintf(buf+len, "%02x ", mca_dev->pos[i]); } len += sprintf(buf+len, "\nDriver Installed: %s", - mca_is_adapter_used(slot) ? "Yes" : "No"); + mca_device_claimed(mca_dev) ? "Yes" : "No"); buf[len++] = '\n'; buf[len] = 0; @@ -189,6 +190,7 @@ /* Initialize /proc/mca entries for existing adapters */ for(i = 0; i < MCA_NUMADAPTERS; i++) { + enum MCA_AdapterStatus status; mca_dev = mca_find_device_by_slot(i); if(!mca_dev) continue; @@ -200,7 +202,10 @@ else if(i == MCA_INTEGSCSI) sprintf(mca_dev->procname,"scsi"); else if(i == MCA_MOTHERBOARD) sprintf(mca_dev->procname,"planar"); - if(!mca_isadapter(i)) continue; + status = mca_device_status(mca_dev); + if (status != MCA_ADAPTER_NORMAL && + status != MCA_ADAPTER_DISABLED) + continue; node = create_proc_read_entry(mca_dev->procname, 0, proc_mca, mca_read_proc, (void *)mca_dev); diff -Nru a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c --- a/drivers/media/common/saa7146_i2c.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/common/saa7146_i2c.c Sun Oct 5 00:33:10 2003 @@ -1,3 +1,4 @@ +#include #include /* helper function */ diff -Nru a/drivers/media/dvb/dvb-core/dvb_functions.c b/drivers/media/dvb/dvb-core/dvb_functions.c --- a/drivers/media/dvb/dvb-core/dvb_functions.c Sun Oct 5 00:33:09 2003 +++ b/drivers/media/dvb/dvb-core/dvb_functions.c Sun Oct 5 00:33:09 2003 @@ -1,4 +1,3 @@ -#include #include #include #include diff -Nru a/drivers/media/dvb/dvb-core/dvb_functions.h b/drivers/media/dvb/dvb-core/dvb_functions.h --- a/drivers/media/dvb/dvb-core/dvb_functions.h Sun Oct 5 00:33:08 2003 +++ b/drivers/media/dvb/dvb-core/dvb_functions.h Sun Oct 5 00:33:08 2003 @@ -1,8 +1,6 @@ #ifndef __DVB_FUNCTIONS_H__ #define __DVB_FUNCTIONS_H__ -#include - /** * a sleeping delay function, waits i ms * diff -Nru a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h --- a/drivers/media/dvb/dvb-core/dvbdev.h Sun Oct 5 00:33:07 2003 +++ b/drivers/media/dvb/dvb-core/dvbdev.h Sun Oct 5 00:33:07 2003 @@ -28,7 +28,6 @@ #include #include #include -#include #include #define DVB_MAJOR 250 diff -Nru a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c --- a/drivers/media/dvb/ttpci/av7110.c Sun Oct 5 00:33:09 2003 +++ b/drivers/media/dvb/ttpci/av7110.c Sun Oct 5 00:33:09 2003 @@ -55,10 +55,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -4745,12 +4743,19 @@ static int __init av7110_init(void) { - if (saa7146_register_extension(&av7110_extension)) - return -ENODEV; + int retval; + retval = saa7146_register_extension(&av7110_extension); + if (retval) + goto failed_saa7146_register; - av7110_ir_init(); - + retval = av7110_ir_init(); + if (retval) + goto failed_av7110_ir_init; return 0; +failed_av7110_ir_init: + saa7146_unregister_extension(&av7110_extension); +failed_saa7146_register: + return retval; } diff -Nru a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c --- a/drivers/media/dvb/ttpci/budget-ci.c Sun Oct 5 00:33:06 2003 +++ b/drivers/media/dvb/ttpci/budget-ci.c Sun Oct 5 00:33:06 2003 @@ -384,10 +384,7 @@ static int __init budget_ci_init(void) { - if (saa7146_register_extension(&budget_extension)) - return -ENODEV; - - return 0; + return saa7146_register_extension(&budget_extension); } diff -Nru a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c --- a/drivers/media/dvb/ttpci/budget-patch.c Sun Oct 5 00:33:06 2003 +++ b/drivers/media/dvb/ttpci/budget-patch.c Sun Oct 5 00:33:06 2003 @@ -247,10 +247,7 @@ static int __init budget_patch_init(void) { - if (saa7146_register_extension(&budget_extension)) - return -ENODEV; - - return 0; + return saa7146_register_extension(&budget_extension); } diff -Nru a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c --- a/drivers/media/dvb/ttpci/budget.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/dvb/ttpci/budget.c Sun Oct 5 00:33:08 2003 @@ -228,10 +228,7 @@ static int __init budget_init(void) { - if (saa7146_register_extension(&budget_extension)) - return -ENODEV; - - return 0; + return saa7146_register_extension(&budget_extension); } diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Sun Oct 5 00:33:10 2003 @@ -9,6 +9,7 @@ * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. */ +#include #include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #include "dvb_functions.h" @@ -1055,7 +1055,8 @@ if (tc < 0) return 0; - copy_to_user(buf, stc_firmware + *offset, tc); + if (copy_to_user(buf, stc_firmware + *offset, tc)) + return -EFAULT; *offset += tc; diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c Sun Oct 5 00:33:10 2003 @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff -Nru a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c --- a/drivers/media/radio/radio-gemtek-pci.c Sun Oct 5 00:33:06 2003 +++ b/drivers/media/radio/radio-gemtek-pci.c Sun Oct 5 00:33:06 2003 @@ -37,7 +37,6 @@ *************************************************************************** */ -#include #include #include #include diff -Nru a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c --- a/drivers/media/video/adv7170.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/video/adv7170.c Sun Oct 5 00:33:10 2003 @@ -28,8 +28,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -49,7 +47,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Analog Devices ADV7170 video encoder driver"); diff -Nru a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c --- a/drivers/media/video/adv7175.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/video/adv7175.c Sun Oct 5 00:33:10 2003 @@ -24,8 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -45,7 +43,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver"); diff -Nru a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c --- a/drivers/media/video/bt819.c Sun Oct 5 00:33:06 2003 +++ b/drivers/media/video/bt819.c Sun Oct 5 00:33:06 2003 @@ -28,8 +28,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -49,7 +47,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Brooktree-819 video decoder driver"); diff -Nru a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c --- a/drivers/media/video/bt856.c Sun Oct 5 00:33:05 2003 +++ b/drivers/media/video/bt856.c Sun Oct 5 00:33:05 2003 @@ -28,8 +28,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -49,7 +47,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Brooktree-856A video encoder driver"); diff -Nru a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h --- a/drivers/media/video/bttvp.h Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/bttvp.h Sun Oct 5 00:33:08 2003 @@ -25,6 +25,7 @@ #define _BTTVP_H_ +#include #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,11) #include diff -Nru a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c --- a/drivers/media/video/bw-qcam.c Sun Oct 5 00:33:07 2003 +++ b/drivers/media/video/bw-qcam.c Sun Oct 5 00:33:07 2003 @@ -72,7 +72,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c --- a/drivers/media/video/c-qcam.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/c-qcam.c Sun Oct 5 00:33:08 2003 @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c --- a/drivers/media/video/cpia.c Sun Oct 5 00:33:09 2003 +++ b/drivers/media/video/cpia.c Sun Oct 5 00:33:09 2003 @@ -29,7 +29,6 @@ #include #include -#include #include #include #include diff -Nru a/drivers/media/video/cpia_pp.c b/drivers/media/video/cpia_pp.c --- a/drivers/media/video/cpia_pp.c Sun Oct 5 00:33:05 2003 +++ b/drivers/media/video/cpia_pp.c Sun Oct 5 00:33:05 2003 @@ -26,7 +26,6 @@ /* #define _CPIA_DEBUG_ 1 */ #include -#include #include #include diff -Nru a/drivers/media/video/meye.h b/drivers/media/video/meye.h --- a/drivers/media/video/meye.h Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/meye.h Sun Oct 5 00:33:08 2003 @@ -36,8 +36,6 @@ #include #include #include -#include -#include /****************************************************************************/ /* Motion JPEG chip registers */ diff -Nru a/drivers/media/video/planb.c b/drivers/media/video/planb.c --- a/drivers/media/video/planb.c Sun Oct 5 00:33:09 2003 +++ b/drivers/media/video/planb.c Sun Oct 5 00:33:09 2003 @@ -27,7 +27,6 @@ /* $Id: planb.c,v 1.18 1999/05/02 17:36:34 mlan Exp $ */ -#include #include #include #include diff -Nru a/drivers/media/video/pms.c b/drivers/media/video/pms.c --- a/drivers/media/video/pms.c Sun Oct 5 00:33:09 2003 +++ b/drivers/media/video/pms.c Sun Oct 5 00:33:09 2003 @@ -30,7 +30,6 @@ #include #include #include -#include #include diff -Nru a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c --- a/drivers/media/video/saa7110.c Sun Oct 5 00:33:05 2003 +++ b/drivers/media/video/saa7110.c Sun Oct 5 00:33:05 2003 @@ -25,8 +25,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include diff -Nru a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c --- a/drivers/media/video/saa7111.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/saa7111.c Sun Oct 5 00:33:08 2003 @@ -24,8 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -45,7 +43,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Philips SAA7111 video decoder driver"); diff -Nru a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c --- a/drivers/media/video/saa7114.c Sun Oct 5 00:33:09 2003 +++ b/drivers/media/video/saa7114.c Sun Oct 5 00:33:09 2003 @@ -28,8 +28,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -51,7 +49,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Philips SAA7114H video decoder driver"); diff -Nru a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h --- a/drivers/media/video/saa7134/saa7134.h Sun Oct 5 00:33:09 2003 +++ b/drivers/media/video/saa7134/saa7134.h Sun Oct 5 00:33:09 2003 @@ -18,6 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include diff -Nru a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c --- a/drivers/media/video/saa7185.c Sun Oct 5 00:33:05 2003 +++ b/drivers/media/video/saa7185.c Sun Oct 5 00:33:05 2003 @@ -24,8 +24,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include - #include #include #include @@ -45,7 +43,6 @@ #include #include -#include #include MODULE_DESCRIPTION("Philips SAA7185 video encoder driver"); diff -Nru a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c --- a/drivers/media/video/stradis.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/video/stradis.c Sun Oct 5 00:33:10 2003 @@ -20,7 +20,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/media/video/tuner-3036.c b/drivers/media/video/tuner-3036.c --- a/drivers/media/video/tuner-3036.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/tuner-3036.c Sun Oct 5 00:33:08 2003 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff -Nru a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c --- a/drivers/media/video/v4l2-common.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/video/v4l2-common.c Sun Oct 5 00:33:10 2003 @@ -45,7 +45,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c --- a/drivers/media/video/videocodec.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/videocodec.c Sun Oct 5 00:33:08 2003 @@ -29,7 +29,6 @@ #define VIDEOCODEC_VERSION "v0.2" -#include #include #include #include diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c --- a/drivers/media/video/videodev.c Sun Oct 5 00:33:06 2003 +++ b/drivers/media/video/videodev.c Sun Oct 5 00:33:06 2003 @@ -15,7 +15,6 @@ * - Added procfs support */ -#include #include #include #include @@ -27,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -52,7 +50,7 @@ { struct video_device *vfd = container_of(cd, struct video_device, class_dev); dev_t dev = MKDEV(VIDEO_MAJOR, vfd->minor); - return sprintf(buf,"%04x\n",old_encode_dev(dev)); + return print_dev_t(buf,dev); } static CLASS_DEVICE_ATTR(name, S_IRUGO, show_name, NULL); diff -Nru a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c --- a/drivers/media/video/vpx3220.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/vpx3220.c Sun Oct 5 00:33:08 2003 @@ -18,7 +18,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include #include #include #include diff -Nru a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c --- a/drivers/media/video/zoran_card.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/zoran_card.c Sun Oct 5 00:33:08 2003 @@ -28,7 +28,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c --- a/drivers/media/video/zoran_device.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/zoran_device.c Sun Oct 5 00:33:08 2003 @@ -28,7 +28,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c --- a/drivers/media/video/zoran_procfs.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/video/zoran_procfs.c Sun Oct 5 00:33:10 2003 @@ -28,7 +28,6 @@ */ #include -#include #include #include #include diff -Nru a/drivers/media/video/zr36120.c b/drivers/media/video/zr36120.c --- a/drivers/media/video/zr36120.c Sun Oct 5 00:33:08 2003 +++ b/drivers/media/video/zr36120.c Sun Oct 5 00:33:08 2003 @@ -36,7 +36,6 @@ #include #include -#include #include #include "tuner.h" diff -Nru a/drivers/media/video/zr36120_i2c.c b/drivers/media/video/zr36120_i2c.c --- a/drivers/media/video/zr36120_i2c.c Sun Oct 5 00:33:10 2003 +++ b/drivers/media/video/zr36120_i2c.c Sun Oct 5 00:33:10 2003 @@ -22,7 +22,6 @@ #include #include -#include #include #include diff -Nru a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c --- a/drivers/mtd/chips/cfi_cmdset_0020.c Sun Oct 5 00:33:07 2003 +++ b/drivers/mtd/chips/cfi_cmdset_0020.c Sun Oct 5 00:33:07 2003 @@ -17,6 +17,7 @@ * - added a writev function */ +#include #include #include #include @@ -26,7 +27,6 @@ #include #include -#include #include #include #include @@ -208,6 +208,7 @@ if (!mtd->eraseregions) { printk(KERN_ERR "Failed to allocate memory for MTD erase region info\n"); kfree(cfi->cmdset_priv); + kfree(mtd); return NULL; } @@ -232,6 +233,7 @@ printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize); kfree(mtd->eraseregions); kfree(cfi->cmdset_priv); + kfree(mtd); return NULL; } diff -Nru a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c --- a/drivers/mtd/chips/gen_probe.c Sun Oct 5 00:33:10 2003 +++ b/drivers/mtd/chips/gen_probe.c Sun Oct 5 00:33:10 2003 @@ -11,7 +11,6 @@ #include #include #include -#include #include static struct mtd_info *check_cmd_set(struct map_info *, int); diff -Nru a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c --- a/drivers/mtd/chips/map_rom.c Sun Oct 5 00:33:09 2003 +++ b/drivers/mtd/chips/map_rom.c Sun Oct 5 00:33:09 2003 @@ -4,7 +4,6 @@ * $Id: map_rom.c,v 1.20 2003/05/28 12:51:49 dwmw2 Exp $ */ -#include #include #include #include diff -Nru a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c --- a/drivers/mtd/chips/sharp.c Sun Oct 5 00:33:08 2003 +++ b/drivers/mtd/chips/sharp.c Sun Oct 5 00:33:08 2003 @@ -22,7 +22,6 @@ #include #include -#include #include #include #include diff -Nru a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c --- a/drivers/mtd/devices/lart.c Sun Oct 5 00:33:08 2003 +++ b/drivers/mtd/devices/lart.c Sun Oct 5 00:33:08 2003 @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #ifdef HAVE_PARTITIONS diff -Nru a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c --- a/drivers/mtd/devices/pmc551.c Sun Oct 5 00:33:09 2003 +++ b/drivers/mtd/devices/pmc551.c Sun Oct 5 00:33:09 2003 @@ -82,6 +82,7 @@ * * Comb the init routine. It's still a bit cludgy on a few things. */ +#include #include #include #include diff -Nru a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c --- a/drivers/mtd/maps/integrator-flash.c Sun Oct 5 00:33:09 2003 +++ b/drivers/mtd/maps/integrator-flash.c Sun Oct 5 00:33:09 2003 @@ -31,223 +31,181 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include -// board specific stuff - sorry, it should be in arch/arm/mach-*. -#ifdef CONFIG_ARCH_INTEGRATOR - -#define FLASH_BASE INTEGRATOR_FLASH_BASE -#define FLASH_SIZE INTEGRATOR_FLASH_SIZE - -#define FLASH_PART_SIZE 0x400000 - -#define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) -#define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) -#define EBI_CSR1 (IO_ADDRESS(INTEGRATOR_EBI_BASE) + INTEGRATOR_EBI_CSR1_OFFSET) -#define EBI_LOCK (IO_ADDRESS(INTEGRATOR_EBI_BASE) + INTEGRATOR_EBI_LOCK_OFFSET) - -/* - * Initialise the flash access systems: - * - Disable VPP - * - Assert WP - * - Set write enable bit in EBI reg - */ -static void armflash_flash_init(void) -{ - unsigned int tmp; - - __raw_writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC); - - tmp = __raw_readl(EBI_CSR1) | INTEGRATOR_EBI_WRITE_ENABLE; - __raw_writel(tmp, EBI_CSR1); - - if (!(__raw_readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE)) { - __raw_writel(0xa05f, EBI_LOCK); - __raw_writel(tmp, EBI_CSR1); - __raw_writel(0, EBI_LOCK); - } -} - -/* - * Shutdown the flash access systems: - * - Disable VPP - * - Assert WP - * - Clear write enable bit in EBI reg - */ -static void armflash_flash_exit(void) -{ - unsigned int tmp; - - __raw_writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC); - - /* - * Clear the write enable bit in system controller EBI register. - */ - tmp = __raw_readl(EBI_CSR1) & ~INTEGRATOR_EBI_WRITE_ENABLE; - __raw_writel(tmp, EBI_CSR1); - - if (__raw_readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE) { - __raw_writel(0xa05f, EBI_LOCK); - __raw_writel(tmp, EBI_CSR1); - __raw_writel(0, EBI_LOCK); - } -} - -static void armflash_flash_wp(int on) -{ - unsigned int reg; - - if (on) - reg = SC_CTRLC; - else - reg = SC_CTRLS; - - __raw_writel(INTEGRATOR_SC_CTRL_nFLWP, reg); -} - -static void armflash_set_vpp(struct map_info *map, int on) -{ - unsigned int reg; - - if (on) - reg = SC_CTRLS; - else - reg = SC_CTRLC; - - __raw_writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg); -} -#endif - #ifdef CONFIG_ARCH_P720T - #define FLASH_BASE (0x04000000) #define FLASH_SIZE (64*1024*1024) +#endif -#define FLASH_PART_SIZE (4*1024*1024) -#define FLASH_BLOCK_SIZE (128*1024) +struct armflash_info { + struct flash_platform_data *plat; + struct resource *res; + struct mtd_partition *parts; + struct mtd_info *mtd; + struct map_info map; +}; -static void armflash_flash_init(void) +static void armflash_set_vpp(struct map_info *map, int on) { -} + struct armflash_info *info = container_of(map, struct armflash_info, map); -static void armflash_flash_exit(void) -{ + if (info->plat && info->plat->set_vpp) + info->plat->set_vpp(on); } -static void armflash_flash_wp(int on) -{ -} +static const char *probes[] = { "RedBoot", "afs", NULL }; -static void armflash_set_vpp(struct map_info *map, int on) +static int armflash_probe(struct device *_dev) { -} -#endif + struct platform_device *dev = to_platform_device(_dev); + struct flash_platform_data *plat = dev->dev.platform_data; + struct resource *res = dev->resource; + unsigned int size = res->end - res->start + 1; + struct armflash_info *info; + int err; + void *base; + info = kmalloc(sizeof(struct armflash_info), GFP_KERNEL); + if (!info) { + err = -ENOMEM; + goto out; + } -static struct map_info armflash_map = -{ - .name = "AFS", - .set_vpp = armflash_set_vpp, - .phys = FLASH_BASE, -}; + memset(info, 0, sizeof(struct armflash_info)); -static struct mtd_info *mtd; -static struct mtd_partition *parts; -static const char *probes[] = { "RedBoot", "afs", NULL }; + info->plat = plat; + if (plat && plat->init) { + err = plat->init(); + if (err) + goto no_resource; + } -static int __init armflash_cfi_init(void *base, u_int size) -{ - int ret; + info->res = request_mem_region(res->start, size, "armflash"); + if (!info->res) { + err = -EBUSY; + goto no_resource; + } - armflash_flash_init(); - armflash_flash_wp(1); + base = ioremap(res->start, size); + if (!base) { + err = -ENOMEM; + goto no_mem; + } /* * look for CFI based flash parts fitted to this board */ - armflash_map.size = size; - armflash_map.buswidth = 4; - armflash_map.virt = (unsigned long) base; + info->map.size = size; + info->map.buswidth = plat->width; + info->map.phys = res->start; + info->map.virt = (unsigned long) base; + info->map.name = dev->dev.bus_id; + info->map.set_vpp = armflash_set_vpp; - simple_map_init(&armflash_map); + simple_map_init(&info->map); /* * Also, the CFI layer automatically works out what size * of chips we have, and does the necessary identification * for us automatically. */ - mtd = do_map_probe("cfi_probe", &armflash_map); - if (!mtd) - return -ENXIO; - - mtd->owner = THIS_MODULE; - - ret = parse_mtd_partitions(mtd, probes, &parts, (void *)0); - if (ret > 0) { - ret = add_mtd_partitions(mtd, parts, ret); - if (ret) - printk(KERN_ERR "mtd partition registration " - "failed: %d\n", ret); + info->mtd = do_map_probe(plat->map_name, &info->map); + if (!info->mtd) { + err = -ENXIO; + goto no_device; } + info->mtd->owner = THIS_MODULE; + + err = parse_mtd_partitions(info->mtd, probes, &info->parts, 0); + if (err > 0) { + err = add_mtd_partitions(info->mtd, info->parts, err); + if (err) + printk(KERN_ERR + "mtd partition registration failed: %d\n", err); + } + + if (err == 0) + dev_set_drvdata(&dev->dev, info); + /* * If we got an error, free all resources. */ - if (ret < 0) { - del_mtd_partitions(mtd); - map_destroy(mtd); - } + if (err < 0) { + if (info->mtd) { + del_mtd_partitions(info->mtd); + map_destroy(info->mtd); + } + if (info->parts) + kfree(info->parts); - return ret; -} - -static void armflash_cfi_exit(void) -{ - if (mtd) { - del_mtd_partitions(mtd); - map_destroy(mtd); + no_device: + iounmap(base); + no_mem: + release_mem_region(res->start, size); + no_resource: + if (plat && plat->exit) + plat->exit(); + kfree(info); } - if (parts) - kfree(parts); + out: + return err; } -static int __init armflash_init(void) +static int armflash_remove(struct device *_dev) { - int err = -EBUSY; - void *base; + struct platform_device *dev = to_platform_device(_dev); + struct armflash_info *info = dev_get_drvdata(&dev->dev); - if (request_mem_region(FLASH_BASE, FLASH_SIZE, "flash") == NULL) - goto out; + dev_set_drvdata(&dev->dev, NULL); - base = ioremap(FLASH_BASE, FLASH_SIZE); - err = -ENOMEM; - if (base == NULL) - goto release; + if (info) { + if (info->mtd) { + del_mtd_partitions(info->mtd); + map_destroy(info->mtd); + } + if (info->parts) + kfree(info->parts); - err = armflash_cfi_init(base, FLASH_SIZE); - if (err) { - iounmap(base); -release: - release_mem_region(FLASH_BASE, FLASH_SIZE); + iounmap((void *)info->map.virt); + release_resource(info->res); + kfree(info->res); + + if (info->plat && info->plat->exit) + info->plat->exit(); + + kfree(info); } -out: - return err; + + return 0; +} + +static struct device_driver armflash_driver = { + .name = "armflash", + .bus = &platform_bus_type, + .probe = armflash_probe, + .remove = armflash_remove, +}; + +static int __init armflash_init(void) +{ + return driver_register(&armflash_driver); } static void __exit armflash_exit(void) { - armflash_cfi_exit(); - iounmap((void *)armflash_map.virt); - release_mem_region(FLASH_BASE, FLASH_SIZE); - armflash_flash_exit(); + driver_unregister(&armflash_driver); } module_init(armflash_init); diff -Nru a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c --- a/drivers/mtd/maps/sun_uflash.c Sun Oct 5 00:33:09 2003 +++ b/drivers/mtd/maps/sun_uflash.c Sun Oct 5 00:33:09 2003 @@ -12,7 +12,6 @@ #include #include -#include #include #include #include diff -Nru a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c --- a/drivers/mtd/mtdcore.c Sun Oct 5 00:33:08 2003 +++ b/drivers/mtd/mtdcore.c Sun Oct 5 00:33:08 2003 @@ -6,6 +6,7 @@ * */ +#include #include #include #include diff -Nru a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c --- a/drivers/mtd/nand/autcpu12.c Sun Oct 5 00:33:06 2003 +++ b/drivers/mtd/nand/autcpu12.c Sun Oct 5 00:33:06 2003 @@ -27,6 +27,7 @@ * 10-06-2002 TG 128K card support added */ +#include #include #include #include diff -Nru a/drivers/net/3c523.c b/drivers/net/3c523.c --- a/drivers/net/3c523.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/3c523.c Sun Oct 5 00:33:08 2003 @@ -102,7 +102,7 @@ #include #include #include -#include +#include #include #include diff -Nru a/drivers/net/3c527.c b/drivers/net/3c527.c --- a/drivers/net/3c527.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/3c527.c Sun Oct 5 00:33:08 2003 @@ -92,7 +92,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Sun Oct 5 00:33:09 2003 +++ b/drivers/net/Kconfig Sun Oct 5 00:33:09 2003 @@ -8,32 +8,18 @@ bool "Network device support" ---help--- You can say N here if you don't intend to connect your Linux box to - any other computer at all or if all your connections will be over a - telephone line with a modem either via UUCP (UUCP is a protocol to - forward mail and news between unix hosts over telephone lines; read - the UUCP-HOWTO, available from - ) or dialing up a shell - account or a BBS, even using term (term is a program which gives you - almost full Internet connectivity if you have a regular dial up - shell account on some Internet connected Unix computer. Read - ). + any other computer at all. You'll have to say Y if your computer contains a network card that - you want to use under Linux (make sure you know its name because you - will be asked for it and read the Ethernet-HOWTO (especially if you - plan to use more than one network card under Linux)) or if you want - to use SLIP (Serial Line Internet Protocol is the protocol used to - send Internet traffic over telephone lines or null modem cables) or - CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better - and newer replacement for SLIP) or PLIP (Parallel Line Internet - Protocol is mainly used to create a mini network by connecting the - parallel ports of two local machines) or AX.25/KISS (protocol for - sending Internet traffic over amateur radio links). - - Make sure to read the NET-3-HOWTO. Eventually, you will have to read - Olaf Kirch's excellent and free book "Network Administrator's - Guide", to be found in . If - unsure, say Y. + you want to use under Linux. If you are going to run SLIP or PPP over + telephone line or null modem cable you need say Y here. Connecting + two machines with parallel ports using PLIP needs this, as well as + AX.25/KISS for sending Internet traffic over amateur radio links. + + See also "The Linux Network Administrator's Guide" by Olaf Kirch and + Terry Dawson. Available at . + + If unsure, say Y. if NETDEVICES source "drivers/net/arcnet/Kconfig" @@ -332,7 +318,7 @@ config MAC89x0 tristate "Macintosh CS89x0 based ethernet cards" - depends on NETDEVICES && MAC + depends on NETDEVICES && MAC && BROKEN ---help--- Support for CS89x0 chipset based Ethernet cards. If you have a Nubus or LC-PDS network (Ethernet) card of this type, say Y and @@ -405,7 +391,7 @@ config ATARI_BIONET tristate "BioNet-100 support" - depends on NETDEVICES && ATARI && ATARI_ACSI!=n + depends on NETDEVICES && ATARI && ATARI_ACSI!=n && BROKEN help Say Y to include support for BioData's BioNet-100 Ethernet adapter for the ACSI port. The driver works (has to work...) with a polled @@ -413,7 +399,7 @@ config ATARI_PAMSNET tristate "PAMsNet support" - depends on NETDEVICES && ATARI && ATARI_ACSI!=n + depends on NETDEVICES && ATARI && ATARI_ACSI!=n && BROKEN help Say Y to include support for the PAMsNet Ethernet adapter for the ACSI port ("ACSI node"). The driver works (has to work...) with a @@ -808,7 +794,7 @@ config SMC9194 tristate "SMC 9194 support" - depends on NET_VENDOR_SMC && (ISA || MAC) + depends on NET_VENDOR_SMC && (ISA || MAC && BROKEN) select CRC32 ---help--- This is support for the SMC9xxx based Ethernet cards. Choose this diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Sun Oct 5 00:33:06 2003 +++ b/drivers/net/Space.c Sun Oct 5 00:33:06 2003 @@ -67,7 +67,6 @@ extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); -extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); @@ -155,9 +154,6 @@ #ifdef CONFIG_LNE390 {lne390_probe, 0}, #endif -#ifdef CONFIG_NE3210 - {ne3210_probe, 0}, -#endif {NULL, 0}, }; @@ -480,3 +476,5 @@ struct net_device *dev_base; rwlock_t dev_base_lock = RW_LOCK_UNLOCKED; +EXPORT_SYMBOL(dev_base); +EXPORT_SYMBOL(dev_base_lock); diff -Nru a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c --- a/drivers/net/arcnet/com20020-isa.c Sun Oct 5 00:33:06 2003 +++ b/drivers/net/arcnet/com20020-isa.c Sun Oct 5 00:33:06 2003 @@ -53,6 +53,7 @@ int ioaddr; unsigned long airqmask; struct arcnet_local *lp = dev->priv; + int err; BUGLVL(D_NORMAL) printk(VERSION); @@ -62,17 +63,20 @@ "must specify the base address!\n"); return -ENODEV; } - if (check_region(ioaddr, ARCNET_TOTAL_SIZE)) { + if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) { BUGMSG(D_NORMAL, "IO region %xh-%xh already allocated.\n", ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1); return -ENXIO; } if (ASTATUS() == 0xFF) { BUGMSG(D_NORMAL, "IO address %x empty\n", ioaddr); - return -ENODEV; + err = -ENODEV; + goto out; + } + if (com20020_check(dev)) { + err = -ENODEV; + goto out; } - if (com20020_check(dev)) - return -ENODEV; if (!dev->irq) { /* if we do this, we're sure to get an IRQ since the @@ -96,13 +100,21 @@ dev->irq = probe_irq_off(airqmask); if (dev->irq <= 0) { BUGMSG(D_NORMAL, "Autoprobe IRQ failed.\n"); - return -ENODEV; + err = -ENODEV; + goto out; } } } lp->card_name = "ISA COM20020"; - return com20020_found(dev, 0); + if ((err = com20020_found(dev, 0)) != 0) + goto out; + + return 0; + +out: + release_region(ioaddr, ARCNET_TOTAL_SIZE); + return err; } @@ -170,6 +182,7 @@ void cleanup_module(void) { com20020_remove(my_dev); + release_region(my_dev->base_addr, ARCNET_TOTAL_SIZE); } #else diff -Nru a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c --- a/drivers/net/arcnet/com20020-pci.c Sun Oct 5 00:33:06 2003 +++ b/drivers/net/arcnet/com20020-pci.c Sun Oct 5 00:33:06 2003 @@ -115,20 +115,20 @@ BUGMSG(D_NORMAL, "IO address %Xh was reported by PCI BIOS, " "but seems empty!\n", ioaddr); err = -EIO; - goto out_priv; + goto out_port; } if (com20020_check(dev)) { err = -EIO; - goto out_priv; + goto out_port; } - release_region(ioaddr, ARCNET_TOTAL_SIZE); - if ((err = com20020_found(dev, SA_SHIRQ)) != 0) - goto out_priv; + goto out_port; return 0; +out_port: + release_region(ioaddr, ARCNET_TOTAL_SIZE); out_priv: kfree(dev->priv); out_dev: @@ -138,7 +138,9 @@ static void __devexit com20020pci_remove(struct pci_dev *pdev) { - com20020_remove(pci_get_drvdata(pdev)); + struct net_device *dev = pci_get_drvdata(pdev); + com20020_remove(dev); + release_region(dev->base_addr, ARCNET_TOTAL_SIZE); } static struct pci_device_id com20020pci_id_table[] = { diff -Nru a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c --- a/drivers/net/arcnet/com20020.c Sun Oct 5 00:33:07 2003 +++ b/drivers/net/arcnet/com20020.c Sun Oct 5 00:33:07 2003 @@ -180,10 +180,6 @@ if (!dev->dev_addr[0]) dev->dev_addr[0] = inb(ioaddr + 8); /* FIXME: do this some other way! */ - /* reserve the I/O region */ - if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) - return -EBUSY; - SET_SUBADR(SUB_SETUP1); outb(lp->setup, _XREG); @@ -207,7 +203,6 @@ if (request_irq(dev->irq, &arcnet_interrupt, shared, "arcnet (COM20020)", dev)) { BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq); - release_region(ioaddr, ARCNET_TOTAL_SIZE); return -ENODEV; } @@ -227,7 +222,6 @@ clockrates[3 - ((lp->setup2 & 0xF0) >> 4) + ((lp->setup & 0x0F) >> 1)]); if (!dev->init && register_netdev(dev)) { - release_region(ioaddr, ARCNET_TOTAL_SIZE); free_irq(dev->irq, dev); return -EIO; } @@ -342,7 +336,6 @@ { unregister_netdev(dev); free_irq(dev->irq, dev); - release_region(dev->base_addr, ARCNET_TOTAL_SIZE); kfree(dev->priv); free_netdev(dev); } diff -Nru a/drivers/net/at1700.c b/drivers/net/at1700.c --- a/drivers/net/at1700.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/at1700.c Sun Oct 5 00:33:08 2003 @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/eexpress.c b/drivers/net/eexpress.c --- a/drivers/net/eexpress.c Sun Oct 5 00:33:05 2003 +++ b/drivers/net/eexpress.c Sun Oct 5 00:33:05 2003 @@ -113,7 +113,6 @@ #include #include #include -#include #include #include diff -Nru a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c --- a/drivers/net/ibmlana.c Sun Oct 5 00:33:07 2003 +++ b/drivers/net/ibmlana.c Sun Oct 5 00:33:07 2003 @@ -82,7 +82,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/irda/act200l.c b/drivers/net/irda/act200l.c --- a/drivers/net/irda/act200l.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/act200l.c Sun Oct 5 00:33:08 2003 @@ -84,12 +84,12 @@ #define ACT200L_OSCL 0x04 /* oscillator in low power, medium accuracy mode */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_ACT200L_DONGLE, - act200l_open, - act200l_close, - act200l_reset, - act200l_change_speed, + .type = IRDA_ACT200L_DONGLE, + .open = act200l_open, + .close = act200l_close, + .reset = act200l_reset, + .change_speed = act200l_change_speed, + .owner = THIS_MODULE, }; int __init act200l_init(void) @@ -112,8 +112,6 @@ /* Set the speeds we can accept */ qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x03; - - MOD_INC_USE_COUNT; } static void act200l_close(dongle_t *self) @@ -122,8 +120,6 @@ /* Power off the dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/actisys.c b/drivers/net/irda/actisys.c --- a/drivers/net/irda/actisys.c Sun Oct 5 00:33:10 2003 +++ b/drivers/net/irda/actisys.c Sun Oct 5 00:33:10 2003 @@ -64,21 +64,21 @@ #define MAX_SPEEDS 5 static struct dongle_reg dongle = { - Q_NULL, - IRDA_ACTISYS_DONGLE, - actisys_open, - actisys_close, - actisys_reset, - actisys_change_speed, + .type = IRDA_ACTISYS_DONGLE, + .open = actisys_open, + .close = actisys_close, + .reset = actisys_reset, + .change_speed = actisys_change_speed, + .owner = THIS_MODULE, }; static struct dongle_reg dongle_plus = { - Q_NULL, - IRDA_ACTISYS_PLUS_DONGLE, - actisys_open, - actisys_close, - actisys_reset, - actisys_change_speed, + .type = IRDA_ACTISYS_PLUS_DONGLE, + .open = actisys_open, + .close = actisys_close, + .reset = actisys_reset, + .change_speed = actisys_change_speed, + .owner = THIS_MODULE, }; /* @@ -128,16 +128,12 @@ qos->baud_rate.bits &= ~IR_38400; qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */ - - MOD_INC_USE_COUNT; } static void actisys_close(dongle_t *self) { /* Power off the dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c --- a/drivers/net/irda/ali-ircc.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/ali-ircc.c Sun Oct 5 00:33:08 2003 @@ -254,7 +254,7 @@ if ((ali_ircc_setup(info)) == -1) return -1; - dev = alloc_netdev(sizeof(*self), "irda%d", irda_device_setup); + dev = alloc_irdadev(sizeof(*self)); if (dev == NULL) { ERROR("%s(), can't allocate memory for control block!\n", __FUNCTION__); return -ENOMEM; diff -Nru a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c --- a/drivers/net/irda/donauboe.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/donauboe.c Sun Oct 5 00:33:08 2003 @@ -1598,8 +1598,7 @@ if ((err=pci_enable_device(pci_dev))) return err; - dev = alloc_netdev(sizeof (struct toshoboe_cb), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof (struct toshoboe_cb)); if (dev == NULL) { printk (KERN_ERR DRIVER_NAME ": can't allocate memory for " diff -Nru a/drivers/net/irda/ep7211_ir.c b/drivers/net/irda/ep7211_ir.c --- a/drivers/net/irda/ep7211_ir.c Sun Oct 5 00:33:05 2003 +++ b/drivers/net/irda/ep7211_ir.c Sun Oct 5 00:33:05 2003 @@ -24,12 +24,12 @@ static int ep7211_ir_reset(struct irda_task *task); static struct dongle_reg dongle = { - Q_NULL, - IRDA_EP7211_IR, - ep7211_ir_open, - ep7211_ir_close, - ep7211_ir_reset, - ep7211_ir_change_speed, + .type = IRDA_EP7211_IR, + .open = ep7211_ir_open, + .close = ep7211_ir_close, + .reset = ep7211_ir_reset, + .change_speed = ep7211_ir_change_speed, + .owner = THIS_MODULE, }; static void ep7211_ir_open(dongle_t *self, struct qos_info *qos) @@ -47,8 +47,6 @@ UART (interrupt #14). */ restore_flags(flags); - - MOD_INC_USE_COUNT; } static void ep7211_ir_close(dongle_t *self) @@ -66,8 +64,6 @@ reset them back to their original state. */ restore_flags(flags); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/esi.c b/drivers/net/irda/esi.c --- a/drivers/net/irda/esi.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/esi.c Sun Oct 5 00:33:08 2003 @@ -44,12 +44,12 @@ static int esi_reset(struct irda_task *task); static struct dongle_reg dongle = { - Q_NULL, - IRDA_ESI_DONGLE, - esi_open, - esi_close, - esi_reset, - esi_change_speed, + .type = IRDA_ESI_DONGLE, + .open = esi_open, + .close = esi_close, + .reset = esi_reset, + .change_speed = esi_change_speed, + .owner = THIS_MODULE, }; int __init esi_init(void) @@ -66,16 +66,12 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200; qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */ - - MOD_INC_USE_COUNT; } static void esi_close(dongle_t *dongle) { /* Power off dongle */ dongle->set_dtr_rts(dongle->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/girbil.c b/drivers/net/irda/girbil.c --- a/drivers/net/irda/girbil.c Sun Oct 5 00:33:05 2003 +++ b/drivers/net/irda/girbil.c Sun Oct 5 00:33:05 2003 @@ -63,12 +63,12 @@ #define GIRBIL_LOAD 0x51 /* Load the new baud rate value */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_GIRBIL_DONGLE, - girbil_open, - girbil_close, - girbil_reset, - girbil_change_speed, + .type = IRDA_GIRBIL_DONGLE, + .open = girbil_open, + .close = girbil_close, + .reset = girbil_reset, + .change_speed = girbil_change_speed, + .owner = THIS_MODULE, }; int __init girbil_init(void) @@ -85,16 +85,12 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x03; - - MOD_INC_USE_COUNT; } static void girbil_close(dongle_t *self) { /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c --- a/drivers/net/irda/irda-usb.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/irda-usb.c Sun Oct 5 00:33:08 2003 @@ -1176,7 +1176,7 @@ memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); /* Create a network device for us */ - netdev = alloc_netdev(0, "irda%d", irda_device_setup); + netdev = alloc_irdadev(0); if (!netdev) { ERROR("%s(), alloc_net_dev() failed!\n", __FUNCTION__); return -ENOMEM; diff -Nru a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c --- a/drivers/net/irda/irport.c Sun Oct 5 00:33:09 2003 +++ b/drivers/net/irda/irport.c Sun Oct 5 00:33:09 2003 @@ -78,7 +78,6 @@ static inline int irport_write(int iobase, int fifo_size, __u8 *buf, int len); static inline void irport_receive(struct irport_cb *self); -static int irport_net_init(struct net_device *dev); static int irport_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static inline int irport_is_receiving(struct irport_cb *self); @@ -136,30 +135,27 @@ { struct net_device *dev; struct irport_cb *self; - void *ret; - int err; IRDA_DEBUG(1, "%s()\n", __FUNCTION__); /* Lock the port that we need */ - ret = request_region(iobase, IO_EXTENT, driver_name); - if (!ret) { + if (!request_region(iobase, IO_EXTENT, driver_name)) { IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", __FUNCTION__, iobase); - return NULL; + goto err_out1; } /* * Allocate new instance of the driver */ - self = kmalloc(sizeof(struct irport_cb), GFP_KERNEL); - if (!self) { + dev = alloc_irdadev(sizeof(struct irport_cb)); + if (!dev) { ERROR("%s(), can't allocate memory for " - "control block!\n", __FUNCTION__); - release_region(iobase, IO_EXTENT); - return NULL; + "irda device!\n", __FUNCTION__); + goto err_out2; } - memset(self, 0, sizeof(struct irport_cb)); + + self = dev->priv; spin_lock_init(&self->lock); /* Need to store self somewhere */ @@ -189,8 +185,11 @@ self->rx_buff.truesize = IRDA_SKB_MAX_MTU; self->rx_buff.skb = __dev_alloc_skb(self->rx_buff.truesize, GFP_KERNEL); - if (self->rx_buff.skb == NULL) - return NULL; + if (self->rx_buff.skb == NULL) { + ERROR("%s(), can't allocate memory for " + "receive buffer!\n", __FUNCTION__); + goto err_out3; + } skb_reserve(self->rx_buff.skb, 1); self->rx_buff.head = self->rx_buff.skb->data; /* No need to memset the buffer, unless you are really pedantic */ @@ -208,30 +207,23 @@ self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL); if (self->tx_buff.head == NULL) { - kfree_skb(self->rx_buff.skb); - self->rx_buff.skb = NULL; - self->rx_buff.head = NULL; - return NULL; + ERROR("%s(), can't allocate memory for " + "transmit buffer!\n", __FUNCTION__); + goto err_out4; } memset(self->tx_buff.head, 0, self->tx_buff.truesize); } self->tx_buff.data = self->tx_buff.head; - if (!(dev = dev_alloc("irda%d", &err))) { - ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); - return NULL; - } self->netdev = dev; /* Keep track of module usage */ SET_MODULE_OWNER(dev); /* May be overridden by piggyback drivers */ - dev->priv = (void *) self; self->interrupt = irport_interrupt; self->change_speed = irport_change_speed; /* Override the network functions we need to use */ - dev->init = irport_net_init; dev->hard_start_xmit = irport_hard_xmit; dev->tx_timeout = irport_timeout; dev->watchdog_timeo = HZ; /* Allow time enough for speed change */ @@ -244,17 +236,25 @@ dev->base_addr = iobase; dev->irq = irq; - rtnl_lock(); - err = register_netdevice(dev); - rtnl_unlock(); - if (err) { + if (register_netdev(dev)) { ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); - return NULL; + goto err_out5; } MESSAGE("IrDA: Registered device %s (irport io=0x%X irq=%d)\n", dev->name, iobase, irq); return self; + err_out5: + kfree(self->tx_buff.head); + err_out4: + kfree_skb(self->rx_buff.skb); + err_out3: + free_netdev(dev); + dev_self[i] = NULL; + err_out2: + release_region(iobase, IO_EXTENT); + err_out1: + return NULL; } int irport_close(struct irport_cb *self) @@ -267,8 +267,7 @@ self->dongle = NULL; /* Remove netdevice */ - if (self->netdev) - unregister_netdev(self->netdev); + unregister_netdev(self->netdev); /* Release the IO-port that this driver is using */ IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", @@ -284,7 +283,7 @@ /* Remove ourselves */ dev_self[self->index] = NULL; - kfree(self); + free_netdev(self->netdev); return 0; } @@ -884,16 +883,6 @@ spin_unlock(&self->lock); return IRQ_RETVAL(handled); -} - -static int irport_net_init(struct net_device *dev) -{ - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(dev); - - /* Insert overrides below this line! */ - - return 0; } /* diff -Nru a/drivers/net/irda/litelink.c b/drivers/net/irda/litelink.c --- a/drivers/net/irda/litelink.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/litelink.c Sun Oct 5 00:33:08 2003 @@ -48,12 +48,12 @@ static __u32 baud_rates[] = { 115200, 57600, 38400, 19200, 9600 }; static struct dongle_reg dongle = { - Q_NULL, - IRDA_LITELINK_DONGLE, - litelink_open, - litelink_close, - litelink_reset, - litelink_change_speed, + .type = IRDA_LITELINK_DONGLE, + .open = litelink_open, + .close = litelink_close, + .reset = litelink_reset, + .change_speed = litelink_change_speed, + .owner = THIS_MODULE, }; int __init litelink_init(void) @@ -70,16 +70,12 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x7f; /* Needs 0.01 ms */ - - MOD_INC_USE_COUNT; } static void litelink_close(dongle_t *self) { /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/ma600.c b/drivers/net/irda/ma600.c --- a/drivers/net/irda/ma600.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/ma600.c Sun Oct 5 00:33:08 2003 @@ -74,12 +74,12 @@ #define MA600_2400 0x08 static struct dongle_reg dongle = { - Q_NULL, - IRDA_MA600_DONGLE, - ma600_open, - ma600_close, - ma600_reset, - ma600_change_speed, + .type = IRDA_MA600_DONGLE, + .open = ma600_open, + .close = ma600_close, + .reset = ma600_reset, + .change_speed = ma600_change_speed, + .owner = THIS_MODULE, }; int __init ma600_init(void) @@ -115,8 +115,6 @@ self->set_dtr_rts(self->dev, TRUE, TRUE); // should wait 1 second - - MOD_INC_USE_COUNT; } static void ma600_close(dongle_t *self) @@ -125,8 +123,6 @@ /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } static __u8 get_control_byte(__u32 speed) diff -Nru a/drivers/net/irda/mcp2120.c b/drivers/net/irda/mcp2120.c --- a/drivers/net/irda/mcp2120.c Sun Oct 5 00:33:10 2003 +++ b/drivers/net/irda/mcp2120.c Sun Oct 5 00:33:10 2003 @@ -40,12 +40,12 @@ #define MCP2120_COMMIT 0x11 static struct dongle_reg dongle = { - Q_NULL, - IRDA_MCP2120_DONGLE, - mcp2120_open, - mcp2120_close, - mcp2120_reset, - mcp2120_change_speed, + .type = IRDA_MCP2120_DONGLE, + .open = mcp2120_open, + .close = mcp2120_close, + .reset = mcp2120_reset, + .change_speed = mcp2120_change_speed, + .owner = THIS_MODULE, }; int __init mcp2120_init(void) @@ -62,8 +62,6 @@ { qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x01; - - MOD_INC_USE_COUNT; } static void mcp2120_close(dongle_t *self) @@ -72,8 +70,6 @@ /* reset and inhibit mcp2120 */ self->set_dtr_rts(self->dev, TRUE, TRUE); //self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c --- a/drivers/net/irda/nsc-ircc.c Sun Oct 5 00:33:05 2003 +++ b/drivers/net/irda/nsc-ircc.c Sun Oct 5 00:33:05 2003 @@ -260,8 +260,7 @@ MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name); - dev = alloc_netdev(sizeof(struct nsc_ircc_cb), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof(struct nsc_ircc_cb)); if (dev == NULL) { ERROR("%s(), can't allocate memory for " "control block!\n", __FUNCTION__); diff -Nru a/drivers/net/irda/old_belkin.c b/drivers/net/irda/old_belkin.c --- a/drivers/net/irda/old_belkin.c Sun Oct 5 00:33:10 2003 +++ b/drivers/net/irda/old_belkin.c Sun Oct 5 00:33:10 2003 @@ -74,12 +74,12 @@ /* static __u32 baud_rates[] = { 9600 }; */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_OLD_BELKIN_DONGLE, - old_belkin_open, - old_belkin_close, - old_belkin_reset, - old_belkin_change_speed, + .type = IRDA_OLD_BELKIN_DONGLE, + .open = old_belkin_open, + .close = old_belkin_close, + .reset = old_belkin_reset, + .change_speed = old_belkin_change_speed, + .owner = THIS_MODULE, }; int __init old_belkin_init(void) @@ -98,16 +98,12 @@ qos->baud_rate.bits &= IR_9600; /* Needs at least 10 ms (totally wild guess, can do probably better) */ qos->min_turn_time.bits = 0x01; - - MOD_INC_USE_COUNT; } static void old_belkin_close(dongle_t *self) { /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c --- a/drivers/net/irda/sir_dev.c Sun Oct 5 00:33:09 2003 +++ b/drivers/net/irda/sir_dev.c Sun Oct 5 00:33:09 2003 @@ -538,28 +538,6 @@ /* ----------------------------------------------------------------------------- */ -static int sirdev_init(struct net_device *ndev) -{ - struct sir_dev *dev = ndev->priv; - - SET_MODULE_OWNER(ndev); - - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(ndev); - - dev->flags = IFF_SIR | IFF_PIO; - - /* Override the network functions we need to use */ - ndev->hard_start_xmit = sirdev_hard_xmit; - ndev->open = sirdev_open; - ndev->stop = sirdev_close; - ndev->get_stats = sirdev_get_stats; - ndev->do_ioctl = sirdev_ioctl; - - return 0; -} - - struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *name) { struct net_device *ndev; @@ -577,12 +555,12 @@ /* * Allocate new instance of the device */ - dev = kmalloc(sizeof(*dev), GFP_KERNEL); - if (dev == NULL) { + ndev = alloc_irdadev(sizeof(*dev)); + if (ndev == NULL) { ERROR("%s - Can't allocate memory for IrDA control block!\n", __FUNCTION__); goto out; } - memset(dev, 0, sizeof(*dev)); + dev = ndev->priv; irda_init_max_qos_capabilies(&dev->qos); dev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; @@ -591,11 +569,6 @@ strncpy(dev->hwname, name, sizeof(dev->hwname)-1); - ndev = kmalloc(sizeof(*ndev), GFP_KERNEL); - if (ndev == NULL) - goto out_freedev; - memset(ndev, 0, sizeof(*ndev)); - atomic_set(&dev->enable_rx, 0); dev->tx_skb = NULL; @@ -609,10 +582,17 @@ dev->drv = drv; dev->netdev = ndev; - ndev->priv = (void *) dev; - ndev->init = sirdev_init; + SET_MODULE_OWNER(ndev); + + dev->flags = IFF_SIR | IFF_PIO; + + /* Override the network functions we need to use */ + ndev->hard_start_xmit = sirdev_hard_xmit; + ndev->open = sirdev_open; + ndev->stop = sirdev_close; + ndev->get_stats = sirdev_get_stats; + ndev->do_ioctl = sirdev_ioctl; - strcpy(ndev->name, "irda%d"); if (register_netdev(ndev)) { ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); goto out_freenetdev; @@ -621,9 +601,7 @@ return dev; out_freenetdev: - kfree(ndev); -out_freedev: - kfree(dev); + free_netdev(ndev); out: return NULL; } @@ -653,10 +631,9 @@ up(&dev->fsm.sem); /* Remove netdevice */ - if (dev->netdev) - unregister_netdev(dev->netdev); + unregister_netdev(dev->netdev); - kfree(dev); + free_netdev(dev->netdev); return 0; } diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Sun Oct 5 00:33:09 2003 +++ b/drivers/net/irda/smsc-ircc2.c Sun Oct 5 00:33:09 2003 @@ -140,10 +140,8 @@ static int smsc_ircc_open(unsigned int firbase, unsigned int sirbase, u8 dma, u8 irq); static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base); -static int smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); -static int smsc_ircc_setup_buffers(struct smsc_ircc_cb *self); +static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self); -static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self); static void smsc_ircc_init_chip(struct smsc_ircc_cb *self); static int __exit smsc_ircc_close(struct smsc_ircc_cb *self); static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self, int iobase); @@ -163,7 +161,6 @@ #endif static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self); static int smsc_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len); -static int smsc_ircc_net_init(struct net_device *dev); static int smsc_ircc_net_open(struct net_device *dev); static int smsc_ircc_net_close(struct net_device *dev); static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); @@ -366,38 +363,81 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) { struct smsc_ircc_cb *self; + struct net_device *dev; int err; IRDA_DEBUG(1, "%s\n", __FUNCTION__); - err= smsc_ircc_present(fir_base, sir_base); - if(err) return -ENODEV; + err = smsc_ircc_present(fir_base, sir_base); + if(err) + goto err_out; - if (dev_count>DIM(dev_self)) { + err = -ENOMEM; + if (dev_count > DIM(dev_self)) { WARNING("%s(), too many devices!\n", __FUNCTION__); - return -ENOMEM; + goto err_out1; } /* * Allocate new instance of the driver */ - self = kmalloc(sizeof(struct smsc_ircc_cb), GFP_KERNEL); - if (self == NULL) { - ERROR("%s, Can't allocate memory for control block!\n", - driver_name); - return -ENOMEM; + dev = alloc_irdadev(sizeof(struct smsc_ircc_cb)); + if (!dev) { + WARNING("%s() can't allocate net device\n", __FUNCTION__); + goto err_out1; } - memset(self, 0, sizeof(struct smsc_ircc_cb)); + + SET_MODULE_OWNER(dev); + + dev->hard_start_xmit = smsc_ircc_hard_xmit_sir; +#if SMSC_IRCC2_C_NET_TIMEOUT + dev->tx_timeout = smsc_ircc_timeout; + dev->watchdog_timeo = HZ*2; /* Allow enough time for speed change */ +#endif + dev->open = smsc_ircc_net_open; + dev->stop = smsc_ircc_net_close; + dev->do_ioctl = smsc_ircc_net_ioctl; + dev->get_stats = smsc_ircc_net_get_stats; + + self = dev->priv; + self->netdev = dev; + + /* Make ifconfig display some details */ + dev->base_addr = self->io.fir_base = fir_base; + dev->irq = self->io.irq = irq; /* Need to store self somewhere */ dev_self[dev_count++] = self; spin_lock_init(&self->lock); - err = smsc_ircc_setup_buffers(self); - if(err) return err; + self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; + self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE; + + self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize, + GFP_KERNEL|GFP_DMA); + if (self->rx_buff.head == NULL) { + ERROR("%s, Can't allocate memory for receive buffer!\n", + driver_name); + goto err_out2; + } + + self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, + GFP_KERNEL|GFP_DMA); + if (self->tx_buff.head == NULL) { + ERROR("%s, Can't allocate memory for transmit buffer!\n", + driver_name); + goto err_out3; + } + + memset(self->rx_buff.head, 0, self->rx_buff.truesize); + memset(self->tx_buff.head, 0, self->tx_buff.truesize); + + self->rx_buff.in_frame = FALSE; + self->rx_buff.state = OUTSIDE_FRAME; + self->tx_buff.data = self->tx_buff.head; + self->rx_buff.data = self->rx_buff.head; - err= smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); - if(err) return err; + smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); smsc_ircc_setup_qos(self); @@ -405,17 +445,38 @@ smsc_ircc_init_chip(self); - if(ircc_transceiver > 0 && ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS) self->transceiver = ircc_transceiver; - else smsc_ircc_probe_transceiver(self); + if(ircc_transceiver > 0 && + ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS) + self->transceiver = ircc_transceiver; + else + smsc_ircc_probe_transceiver(self); - err = smsc_ircc_setup_netdev(self); - if(err) return err; + err = register_netdev(self->netdev); + if(err) { + ERROR("%s, Network device registration failed!\n", + driver_name); + goto err_out4; + } self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, smsc_ircc_pmproc); if (self->pmdev) self->pmdev->data = self; + MESSAGE("IrDA: Registered device %s\n", dev->name); + return 0; + err_out4: + kfree(self->tx_buff.head); + err_out3: + kfree(self->rx_buff.head); + err_out2: + free_netdev(self->netdev); + dev_self[--dev_count] = NULL; + err_out1: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + release_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT); + err_out: + return err; } /* @@ -428,18 +489,19 @@ { unsigned char low, high, chip, config, dma, irq, version; - if (check_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT) < 0) { + if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, + driver_name)) { WARNING("%s: can't get fir_base of 0x%03x\n", __FUNCTION__, fir_base); - return -ENODEV; + goto out1; } -#if POSSIBLE_USED_BY_SERIAL_DRIVER - if (check_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT) < 0) { + + if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, + driver_name)) { WARNING("%s: can't get sir_base of 0x%03x\n", __FUNCTION__, sir_base); - return -ENODEV; + goto out2; } -#endif register_bank(fir_base, 3); @@ -454,54 +516,19 @@ if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { WARNING("%s(), addr 0x%04x - no device found!\n", __FUNCTION__, fir_base); - return -ENODEV; + goto out3; } MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " "firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n", chip & 0x0f, version, fir_base, sir_base, dma, irq); return 0; -} - -/* - * Function smsc_ircc_setup_buffers(self) - * - * Setup RX/TX buffers - * - */ -static int smsc_ircc_setup_buffers(struct smsc_ircc_cb *self) -{ - self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; - self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE; - - self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL|GFP_DMA); - if (self->rx_buff.head == NULL) { - ERROR("%s, Can't allocate memory for receive buffer!\n", - driver_name); - kfree(self); - return -ENOMEM; - } - - self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); - if (self->tx_buff.head == NULL) { - ERROR("%s, Can't allocate memory for transmit buffer!\n", - driver_name); - kfree(self->rx_buff.head); - kfree(self); - return -ENOMEM; - } - - memset(self->rx_buff.head, 0, self->rx_buff.truesize); - memset(self->tx_buff.head, 0, self->tx_buff.truesize); - - self->rx_buff.in_frame = FALSE; - self->rx_buff.state = OUTSIDE_FRAME; - self->tx_buff.data = self->tx_buff.head; - self->rx_buff.data = self->rx_buff.head; - - return 0; + out3: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + out2: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + out1: + return -ENODEV; } /* @@ -510,10 +537,11 @@ * Setup I/O * */ -static int smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) +static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, + unsigned int fir_base, unsigned int sir_base, + u8 dma, u8 irq) { unsigned char config, chip_dma, chip_irq; - void *ret; register_bank(fir_base, 3); config = inb(fir_base+IRCC_INTERFACE); @@ -545,27 +573,6 @@ else self->io.dma = chip_dma; - ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); - if (!ret) { - WARNING("%s(), can't get iobase of 0x%03x\n", - __FUNCTION__, self->io.fir_base); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - ret = request_region(self->io.sir_base, self->io.sir_ext, driver_name); - if (!ret) { - WARNING("%s(), can't get iobase of 0x%03x\n", - __FUNCTION__, self->io.sir_base); - release_region(self->io.fir_base, self->io.fir_ext); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - - return 0; } /* @@ -635,59 +642,6 @@ } /* - * Function smsc_ircc_setup_netdev(self) - * - * Alloc and setup network device - * - */ -static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self) -{ - struct net_device *dev; - int err; - /* Alloc netdev */ - - if (!(dev = dev_alloc("irda%d", &err))) { - ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENOMEM; - } - - dev->priv = (void *) self; - self->netdev = dev; - - dev->init = smsc_ircc_net_init; - dev->hard_start_xmit = smsc_ircc_hard_xmit_sir; - #if SMSC_IRCC2_C_NET_TIMEOUT - dev->tx_timeout = smsc_ircc_timeout; - dev->watchdog_timeo = HZ*2; /* Allow enough time for speed change */ - #endif - dev->open = smsc_ircc_net_open; - dev->stop = smsc_ircc_net_close; - dev->do_ioctl = smsc_ircc_net_ioctl; - dev->get_stats = smsc_ircc_net_get_stats; - - /* Make ifconfig display some details */ - dev->base_addr = self->io.fir_base; - dev->irq = self->io.irq; - - rtnl_lock(); - err = register_netdevice(dev); - rtnl_unlock(); - if (err) { - ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - MESSAGE("IrDA: Registered device %s\n", dev->name); - - return 0; -} - -/* * Function smsc_ircc_net_ioctl (dev, rq, cmd) * * Process IOCTL commands for this device @@ -1571,18 +1525,6 @@ } #endif /* unused */ -static int smsc_ircc_net_init(struct net_device *dev) -{ - /* Keep track of module usage */ - SET_MODULE_OWNER(dev); - - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(dev); - - /* Insert overrides below this line! */ - - return 0; -} /* * Function smsc_ircc_net_open (dev) @@ -1745,11 +1687,7 @@ pm_unregister(self->pmdev); /* Remove netdevice */ - if (self->netdev) { - rtnl_lock(); - unregister_netdevice(self->netdev); - rtnl_unlock(); - } + unregister_netdev(self->netdev); /* Make sure the irq handler is not exectuting */ spin_lock_irqsave(&self->lock, flags); @@ -1784,7 +1722,7 @@ if (self->rx_buff.head) kfree(self->rx_buff.head); - kfree(self); + free_netdev(self->netdev); return 0; } @@ -2269,32 +2207,36 @@ static int __init smsc_superio_fdc(unsigned short cfg_base) { - if (check_region(cfg_base, 2) < 0) { + int ret = -1; + + if (!request_region(cfg_base, 2, driver_name)) { WARNING("%s: can't get cfg_base of 0x%03x\n", __FUNCTION__, cfg_base); - return -1; - } + } else { + if (!smsc_superio_flat(fdc_chips_flat,cfg_base,"FDC") + ||!smsc_superio_paged(fdc_chips_paged,cfg_base,"FDC")) + ret = 0; - if (!smsc_superio_flat(fdc_chips_flat,cfg_base,"FDC")||!smsc_superio_paged(fdc_chips_paged,cfg_base,"FDC")) - return 0; + release_region(cfg_base, 2); + } - return -1; + return ret; } static int __init smsc_superio_lpc(unsigned short cfg_base) { -#if 0 - if (check_region(cfg_base, 2) < 0) { - IRDA_DEBUG(0, __FUNCTION__ ": can't get cfg_base of 0x%03x\n", - cfg_base); - return -1; - } -#endif - - if (!smsc_superio_flat(lpc_chips_flat,cfg_base,"LPC")||!smsc_superio_paged(lpc_chips_paged,cfg_base,"LPC")) - return 0; + int ret = -1; - return -1; + if (!request_region(cfg_base, 2, driver_name)) { + WARNING("%s: can't get cfg_base of 0x%03x\n", + __FUNCTION__, cfg_base); + } else { + if (!smsc_superio_flat(lpc_chips_flat,cfg_base,"LPC") + ||!smsc_superio_paged(lpc_chips_paged,cfg_base,"LPC")) + ret = 0; + release_region(cfg_base, 2); + } + return ret; } /************************************************ diff -Nru a/drivers/net/irda/tekram.c b/drivers/net/irda/tekram.c --- a/drivers/net/irda/tekram.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/tekram.c Sun Oct 5 00:33:08 2003 @@ -44,12 +44,12 @@ #define TEKRAM_PW 0x10 /* Pulse select bit */ static struct dongle_reg dongle = { - Q_NULL, - IRDA_TEKRAM_DONGLE, - tekram_open, - tekram_close, - tekram_reset, - tekram_change_speed, + .type = IRDA_TEKRAM_DONGLE, + .open = tekram_open, + .close = tekram_close, + .reset = tekram_reset, + .change_speed = tekram_change_speed, + .owner = THIS_MODULE, }; int __init tekram_init(void) @@ -69,8 +69,6 @@ qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; qos->min_turn_time.bits = 0x01; /* Needs at least 10 ms */ irda_qos_bits_to_value(qos); - - MOD_INC_USE_COUNT; } static void tekram_close(dongle_t *self) @@ -84,8 +82,6 @@ irda_task_delete(self->reset_task); if (self->speed_task) irda_task_delete(self->speed_task); - - MOD_DEC_USE_COUNT; } /* diff -Nru a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c --- a/drivers/net/irda/via-ircc.c Sun Oct 5 00:33:05 2003 +++ b/drivers/net/irda/via-ircc.c Sun Oct 5 00:33:05 2003 @@ -335,8 +335,7 @@ return -1; /* Allocate new instance of the driver */ - dev = alloc_netdev(sizeof(struct via_ircc_cb), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof(struct via_ircc_cb)); if (dev == NULL) return -ENOMEM; diff -Nru a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c --- a/drivers/net/irda/vlsi_ir.c Sun Oct 5 00:33:05 2003 +++ b/drivers/net/irda/vlsi_ir.c Sun Oct 5 00:33:05 2003 @@ -1859,15 +1859,6 @@ * otherwise we might get cheated by pci-pm. */ -static int vlsi_irda_save_state(struct pci_dev *pdev, u32 state) -{ - if (state < 1 || state > 3 ) { - ERROR("%s - %s: invalid pm state request: %u\n", - __FUNCTION__, PCIDEV_NAME(pdev), state); - return -1; - } - return 0; -} static int vlsi_irda_suspend(struct pci_dev *pdev, u32 state) { @@ -1970,7 +1961,6 @@ .probe = vlsi_irda_probe, .remove = __devexit_p(vlsi_irda_remove), #ifdef CONFIG_PM - .save_state = vlsi_irda_save_state, .suspend = vlsi_irda_suspend, .resume = vlsi_irda_resume, #endif diff -Nru a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c --- a/drivers/net/irda/w83977af_ir.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/irda/w83977af_ir.c Sun Oct 5 00:33:08 2003 @@ -170,8 +170,7 @@ /* * Allocate new instance of the driver */ - dev = alloc_netdev(sizeof(struct w83977af_ir), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof(struct w83977af_ir)); if (dev == NULL) { printk( KERN_ERR "IrDA: Can't allocate memory for " "IrDA control block!\n"); diff -Nru a/drivers/net/loopback.c b/drivers/net/loopback.c --- a/drivers/net/loopback.c Sun Oct 5 00:33:06 2003 +++ b/drivers/net/loopback.c Sun Oct 5 00:33:06 2003 @@ -30,6 +30,7 @@ */ #include #include +#include #include #include #include @@ -202,3 +203,5 @@ return register_netdev(&loopback_dev); }; + +EXPORT_SYMBOL(loopback_dev); diff -Nru a/drivers/net/mac8390.c b/drivers/net/mac8390.c --- a/drivers/net/mac8390.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/mac8390.c Sun Oct 5 00:33:08 2003 @@ -442,14 +442,14 @@ ei_status.tx_start_page = CABLETRON_TX_START_PG; ei_status.rx_start_page = CABLETRON_RX_START_PG; ei_status.stop_page = CABLETRON_RX_STOP_PG; - dev->rmem_start = dev->mem_start; - dev->rmem_end = dev->mem_start + CABLETRON_RX_STOP_PG*256; + ei_status.rmem_start = dev->mem_start; + ei_status.rmem_end = dev->mem_start + CABLETRON_RX_STOP_PG*256; } else { ei_status.tx_start_page = WD_START_PG; ei_status.rx_start_page = WD_START_PG + TX_PAGES; ei_status.stop_page = (dev->mem_end - dev->mem_start)/256; - dev->rmem_start = dev->mem_start + TX_PAGES*256; - dev->rmem_end = dev->mem_end; + ei_status.rmem_start = dev->mem_start + TX_PAGES*256; + ei_status.rmem_end = dev->mem_end; } /* Fill in model-specific information and functions */ @@ -621,12 +621,12 @@ unsigned long xfer_base = ring_offset - (WD_START_PG<<8); unsigned long xfer_start = xfer_base + dev->mem_start; - if (xfer_start + count > dev->rmem_end) { + if (xfer_start + count > ei_status.rmem_end) { /* We must wrap the input move. */ - int semi_count = dev->rmem_end - xfer_start; + int semi_count = ei_status.rmem_end - xfer_start; memcpy_fromio(skb->data, (char *)dev->mem_start + xfer_base, semi_count); count -= semi_count; - memcpy_toio(skb->data + semi_count, (char *)dev->rmem_start, count); + memcpy_toio(skb->data + semi_count, (char *)ei_status.rmem_start, count); } else { memcpy_fromio(skb->data, (char *)dev->mem_start + xfer_base, count); } @@ -657,15 +657,16 @@ /* Note the offset math is done in card memory space which is word per long onto our space. */ - - if (xfer_start + count > dev->rmem_end) + + if (xfer_start + count > ei_status.rmem_end) { /* We must wrap the input move. */ - int semi_count = dev->rmem_end - xfer_start; + int semi_count = ei_status.rmem_end - xfer_start; dayna_memcpy_fromcard(dev, skb->data, xfer_base, semi_count); count -= semi_count; - dayna_memcpy_fromcard(dev, skb->data + semi_count, - dev->rmem_start - dev->mem_start, count); + dayna_memcpy_fromcard(dev, skb->data + semi_count, + ei_status.rmem_start - dev->mem_start, + count); } else { @@ -697,15 +698,15 @@ unsigned long xfer_base = ring_offset - (WD_START_PG<<8); unsigned long xfer_start = xfer_base+dev->mem_start; - if (xfer_start + count > dev->rmem_end) + if (xfer_start + count > ei_status.rmem_end) { /* We must wrap the input move. */ - int semi_count = dev->rmem_end - xfer_start; + int semi_count = ei_status.rmem_end - xfer_start; word_memcpy_fromcard(skb->data, (char *)dev->mem_start + xfer_base, semi_count); count -= semi_count; word_memcpy_fromcard(skb->data + semi_count, - (char *)dev->rmem_start, count); + (char *)ei_status.rmem_start, count); } else { diff -Nru a/drivers/net/ne2.c b/drivers/net/ne2.c --- a/drivers/net/ne2.c Sun Oct 5 00:33:10 2003 +++ b/drivers/net/ne2.c Sun Oct 5 00:33:10 2003 @@ -70,7 +70,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/ne3210.c b/drivers/net/ne3210.c --- a/drivers/net/ne3210.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/ne3210.c Sun Oct 5 00:33:08 2003 @@ -23,6 +23,7 @@ This driver WILL NOT WORK FOR THE NE3200 - it is completely different and does not use an 8390 at all. + Updated to EISA probing API 5/2003 by Marc Zyngier. */ static const char *version = @@ -44,9 +45,6 @@ #include "8390.h" -int ne3210_probe(struct net_device *dev); -static int ne3210_probe1(struct net_device *dev, int ioaddr); - static int ne3210_open(struct net_device *dev); static int ne3210_close(struct net_device *dev); @@ -59,7 +57,6 @@ #define NE3210_START_PG 0x00 /* First page of TX buffer */ #define NE3210_STOP_PG 0x80 /* Last page +1 of RX ring */ -#define NE3210_ID_PORT 0xc80 /* Same for all EISA cards */ #define NE3210_IO_EXTENT 0x20 #define NE3210_SA_PROM 0x16 /* Start of e'net addr. */ #define NE3210_RESET_PORT 0xc84 @@ -69,10 +66,9 @@ #define NE3210_ADDR1 0x00 #define NE3210_ADDR2 0x1b -#define NE3210_ID 0x0118cc3a /* 0x3acc = 1110 10110 01100 = nvl */ - #define NE3210_CFG1 0xc84 /* NB: 0xc84 is also "reset" port. */ #define NE3210_CFG2 0xc90 +#define NE3210_CFG_EXTENT (NE3210_CFG2 - NE3210_CFG1 + 1) /* * You can OR any of the following bits together and assign it @@ -89,152 +85,108 @@ static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3}; static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0}; +static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"}; +static int ifmap_val[] __initdata = { + IF_PORT_10BASET, + IF_PORT_UNKNOWN, + IF_PORT_10BASE2, + IF_PORT_AUI, +}; -/* - * Probe for the card. The best way is to read the EISA ID if it - * is known. Then we can check the prefix of the station address - * PROM for a match against the value assigned to Novell. - */ - -int __init ne3210_probe(struct net_device *dev) +static int __init ne3210_eisa_probe (struct device *device) { - unsigned short ioaddr = dev->base_addr; - - SET_MODULE_OWNER(dev); + unsigned long ioaddr, phys_mem; + int i, retval, port_index; + struct eisa_device *edev = to_eisa_device (device); + struct net_device *dev; - if (ioaddr > 0x1ff) /* Check a single specified location. */ - return ne3210_probe1(dev, ioaddr); - else if (ioaddr > 0) /* Don't probe at all. */ - return -ENXIO; - - if (!EISA_bus) { -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: Not an EISA bus. Not probing high ports.\n"); -#endif - return -ENXIO; + /* Allocate dev->priv and fill in 8390 specific dev fields. */ + if (!(dev = alloc_ei_netdev ())) { + printk ("ne3210.c: unable to allocate memory for dev!\n"); + return -ENOMEM; } - /* EISA spec allows for up to 16 slots, but 8 is typical. */ - for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) - if (ne3210_probe1(dev, ioaddr) == 0) - return 0; - - return -ENODEV; -} - -static int __init ne3210_probe1(struct net_device *dev, int ioaddr) -{ - int i, retval; - unsigned long eisa_id; - const char *ifmap[] = {"UTP", "?", "BNC", "AUI"}; - - if (!request_region(dev->base_addr, NE3210_IO_EXTENT, dev->name)) - return -EBUSY; + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, device); + device->driver_data = dev; + ioaddr = edev->base_addr; - if (inb_p(ioaddr + NE3210_ID_PORT) == 0xff) { - retval = -ENODEV; + if (ethdev_init (dev)) { + printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); + retval = -ENOMEM; goto out; } -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + NE3210_ID_PORT)); - printk("ne3210-debug: config regs: %#x %#x\n", - inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); -#endif - - -/* Check the EISA ID of the card. */ - eisa_id = inl(ioaddr + NE3210_ID_PORT); - if (eisa_id != NE3210_ID) { - retval = -ENODEV; + if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) { + retval = -EBUSY; goto out; } - -#if 0 -/* Check the vendor ID as well. Not really required. */ - if (inb(ioaddr + NE3210_SA_PROM + 0) != NE3210_ADDR0 - || inb(ioaddr + NE3210_SA_PROM + 1) != NE3210_ADDR1 - || inb(ioaddr + NE3210_SA_PROM + 2) != NE3210_ADDR2 ) { - printk("ne3210.c: card not found"); - for(i = 0; i < ETHER_ADDR_LEN; i++) - printk(" %02x", inb(ioaddr + NE3210_SA_PROM + i)); - printk(" (invalid prefix).\n"); - retval = -ENODEV; - goto out; + if (!request_region(ioaddr + NE3210_CFG1, + NE3210_CFG_EXTENT, dev->name)) { + retval = -EBUSY; + goto out1; } + +#if NE3210_DEBUG & NE3210_D_PROBE + printk("ne3210-debug: probe at %#x, ID %s\n", ioaddr, edev->id.sig); + printk("ne3210-debug: config regs: %#x %#x\n", + inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); #endif - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); - retval = -ENOMEM; - goto out; - } + port_index = inb(ioaddr + NE3210_CFG2) >> 6; printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr:", - ioaddr/0x1000, ifmap[inb(ioaddr + NE3210_CFG2) >> 6]); + edev->slot, ifmap[port_index]); for(i = 0; i < ETHER_ADDR_LEN; i++) printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i))); - printk(".\nne3210.c: "); + /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ - if (dev->irq == 0) { - unsigned char irq_reg = inb(ioaddr + NE3210_CFG2) >> 3; - dev->irq = irq_map[irq_reg & 0x07]; - printk("using"); - } else { - /* This is useless unless we reprogram the card here too */ - if (dev->irq == 2) dev->irq = 9; /* Doh! */ - printk("assigning"); - } - printk(" IRQ %d,", dev->irq); + dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07]; + printk(".\nne3210.c: using IRQ %d, ", dev->irq); retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev); if (retval) { printk (" unable to get IRQ %d.\n", dev->irq); - goto out1; - } - - if (dev->mem_start == 0) { - unsigned char mem_reg = inb(ioaddr + NE3210_CFG2) & 0x07; - dev->mem_start = shmem_map[mem_reg] * 0x1000; - printk(" using "); - } else { - /* Should check for value in shmem_map and reprogram the card to use it */ - dev->mem_start &= 0xfff8000; - printk(" assigning "); + goto out2; } - printk("%dkB memory at physical address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); + phys_mem = shmem_map[inb(ioaddr + NE3210_CFG2) & 0x07] * 0x1000; /* BEWARE!! Some dain-bramaged EISA SCUs will allow you to put the card mem within the region covered by `normal' RAM !!! */ - if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */ - if (dev->mem_start < virt_to_phys(high_memory)) { + if (phys_mem > 1024*1024) { /* phys addr > 1MB */ + if (phys_mem < virt_to_phys(high_memory)) { printk(KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n"); printk(KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n"); printk(KERN_CRIT "ne3210.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); printk(KERN_CRIT "ne3210.c: Driver NOT installed.\n"); retval = -EINVAL; - goto out2; + goto out3; } - dev->mem_start = (unsigned long)ioremap(dev->mem_start, NE3210_STOP_PG*0x100); - if (dev->mem_start == 0) { - printk(KERN_ERR "ne3210.c: Unable to remap card memory above 1MB !!\n"); - printk(KERN_ERR "ne3210.c: Try using EISA SCU to set memory below 1MB.\n"); - printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); - retval = -EAGAIN; - goto out2; - } - ei_status.reg0 = 1; /* Use as remap flag */ - printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); } + + if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, dev->name)) { + printk ("ne3210.c: Unable to request shared memory at physical address %#lx\n", + phys_mem); + goto out3; + } + + printk("%dkB memory at physical address %#lx\n", + NE3210_STOP_PG/4, phys_mem); + dev->mem_start = (unsigned long)ioremap(phys_mem, NE3210_STOP_PG*0x100); + if (dev->mem_start == 0) { + printk(KERN_ERR "ne3210.c: Unable to remap card memory !!\n"); + printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); + retval = -EAGAIN; + goto out4; + } + printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", + NE3210_STOP_PG/4, dev->mem_start); dev->mem_end = ei_status.rmem_end = dev->mem_start + (NE3210_STOP_PG - NE3210_START_PG)*256; ei_status.rmem_start = dev->mem_start + TX_PAGES*256; @@ -247,6 +199,7 @@ ei_status.rx_start_page = NE3210_START_PG + TX_PAGES; ei_status.stop_page = NE3210_STOP_PG; ei_status.word16 = 1; + ei_status.priv = phys_mem; if (ei_debug > 0) printk(version); @@ -258,18 +211,46 @@ dev->open = &ne3210_open; dev->stop = &ne3210_close; + dev->if_port = ifmap_val[port_index]; + + if ((retval = register_netdev (dev))) + goto out5; + NS8390_init(dev, 0); return 0; -out2: - free_irq(dev->irq, dev); -out1: - kfree(dev->priv); - dev->priv = NULL; -out: - release_region(ioaddr, NE3210_IO_EXTENT); + + out5: + iounmap((void *)dev->mem_start); + out4: + release_mem_region (phys_mem, NE3210_STOP_PG*0x100); + out3: + free_irq (dev->irq, dev); + out2: + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + out1: + release_region (ioaddr, NE3210_IO_EXTENT); + out: + free_netdev (dev); + return retval; } +static int __devexit ne3210_eisa_remove (struct device *device) +{ + struct net_device *dev = device->driver_data; + unsigned long ioaddr = to_eisa_device (device)->base_addr; + + unregister_netdev (dev); + iounmap((void *)dev->mem_start); + release_mem_region (ei_status.priv, NE3210_STOP_PG*0x100); + free_irq (dev->irq, dev); + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + release_region (ioaddr, NE3210_IO_EXTENT); + free_netdev (dev); + + return 0; +} + /* * Reset by toggling the "Board Enable" bits (bit 2 and 0). */ @@ -309,7 +290,7 @@ ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { unsigned long hdr_start = dev->mem_start + ((ring_page - NE3210_START_PG)<<8); - isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); + memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ } @@ -327,12 +308,12 @@ if (xfer_start + count > ei_status.rmem_end) { /* Packet wraps over end of ring buffer. */ int semi_count = ei_status.rmem_end - xfer_start; - isa_memcpy_fromio(skb->data, xfer_start, semi_count); + memcpy_fromio(skb->data, xfer_start, semi_count); count -= semi_count; - isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); } else { /* Packet is in one chunk. */ - isa_memcpy_fromio(skb->data, xfer_start, count); + memcpy_fromio(skb->data, xfer_start, count); } } @@ -342,7 +323,7 @@ unsigned long shmem = dev->mem_start + ((start_page - NE3210_START_PG)<<8); count = (count + 3) & ~3; /* Round up to doubleword */ - isa_memcpy_toio(shmem, buf, count); + memcpy_toio(shmem, buf, count); } static int ne3210_open(struct net_device *dev) @@ -361,7 +342,23 @@ return 0; } +static struct eisa_device_id ne3210_ids[] = { + { "EGL0101" }, + { "NVL1801" }, + { "" }, +}; + +static struct eisa_driver ne3210_eisa_driver = { + .id_table = ne3210_ids, + .driver = { + .name = "ne3210", + .probe = ne3210_eisa_probe, + .remove = __devexit_p (ne3210_eisa_remove), + }, +}; + #ifdef MODULE +#if 0 #define MAX_NE3210_CARDS 4 /* Max number of NE3210 cards per module */ static struct net_device dev_ne3210[MAX_NE3210_CARDS]; static int io[MAX_NE3210_CARDS]; @@ -374,50 +371,22 @@ MODULE_PARM_DESC(io, "I/O base address(es)"); MODULE_PARM_DESC(irq, "IRQ number(s)"); MODULE_PARM_DESC(mem, "memory base address(es)"); +#endif +#endif /* MODULE */ + + MODULE_DESCRIPTION("NE3210 EISA Ethernet driver"); MODULE_LICENSE("GPL"); -int init_module(void) +int ne3210_init(void) { - int this_dev, found = 0; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_start = mem[this_dev]; - dev->init = ne3210_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "ne3210.c: No NE3210 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; - } - return -ENXIO; - } - found++; - } - return 0; + return eisa_driver_register (&ne3210_eisa_driver); } -void cleanup_module(void) +void ne3210_cleanup(void) { - int this_dev; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - if (dev->priv != NULL) { - free_irq(dev->irq, dev); - release_region(dev->base_addr, NE3210_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); - unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; - } - } + eisa_driver_unregister (&ne3210_eisa_driver); } -#endif /* MODULE */ - +module_init (ne3210_init); +module_exit (ne3210_cleanup); diff -Nru a/drivers/net/sk_mca.c b/drivers/net/sk_mca.c --- a/drivers/net/sk_mca.c Sun Oct 5 00:33:09 2003 +++ b/drivers/net/sk_mca.c Sun Oct 5 00:33:09 2003 @@ -89,7 +89,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c --- a/drivers/net/tokenring/madgemc.c Sun Oct 5 00:33:10 2003 +++ b/drivers/net/tokenring/madgemc.c Sun Oct 5 00:33:10 2003 @@ -20,7 +20,7 @@ static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n"; #include -#include +#include #include #include #include diff -Nru a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c --- a/drivers/net/tokenring/smctr.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/tokenring/smctr.c Sun Oct 5 00:33:08 2003 @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru a/drivers/net/wan/comx-hw-munich.c b/drivers/net/wan/comx-hw-munich.c --- a/drivers/net/wan/comx-hw-munich.c Sun Oct 5 00:33:07 2003 +++ b/drivers/net/wan/comx-hw-munich.c Sun Oct 5 00:33:07 2003 @@ -1849,7 +1849,7 @@ if (board->isx21) { init_timer(&board->modemline_timer); - board->modemline_timer.data = (unsigned int)board; + board->modemline_timer.data = (unsigned long)board; board->modemline_timer.function = pcicom_modemline; board->modemline_timer.expires = jiffies + HZ; add_timer((struct timer_list *)&board->modemline_timer); diff -Nru a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c --- a/drivers/net/wan/dscc4.c Sun Oct 5 00:33:07 2003 +++ b/drivers/net/wan/dscc4.c Sun Oct 5 00:33:07 2003 @@ -592,6 +592,7 @@ return (i >= 0 ) ? i : -EAGAIN; } +#if 0 static void dscc4_rx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev) { unsigned long flags; @@ -606,6 +607,9 @@ spin_unlock_irqrestore(&dpriv->pci_priv->lock, flags); } +#endif + +#if 0 static void dscc4_tx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev) { u16 i = 0; @@ -625,6 +629,7 @@ if (dscc4_do_action(dev, "Rdt") < 0) printk(KERN_ERR "%s: Tx reset failed\n", dev->name); } +#endif /* TODO: (ab)use this function to refill a completely depleted RX ring. */ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv, @@ -1092,7 +1097,6 @@ err_disable_scc_events: scc_writel(0xffffffff, dpriv, dev, IMR); -err_free_ring: scc_patchl(PowerUp | Vis, 0, dpriv, dev, CCR0); dscc4_release_ring(dpriv); err_out: @@ -2006,6 +2010,7 @@ return 0; } +#ifndef MODULE static int __init dscc4_setup(char *str) { int *args[] = { &debug, &quartz, NULL }, **p = args; @@ -2016,6 +2021,7 @@ } __setup("dscc4.setup=", dscc4_setup); +#endif static struct pci_device_id dscc4_pci_tbl[] = { { PCI_VENDOR_ID_SIEMENS, PCI_DEVICE_ID_SIEMENS_DSCC4, diff -Nru a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c --- a/drivers/net/wan/sbni.c Sun Oct 5 00:33:08 2003 +++ b/drivers/net/wan/sbni.c Sun Oct 5 00:33:08 2003 @@ -1300,12 +1300,9 @@ switch( cmd ) { case SIOCDEVGETINSTATS : - error = verify_area( VERIFY_WRITE, ifr->ifr_data, - sizeof(struct sbni_in_stats) ); - if( !error ) - if (copy_to_user( ifr->ifr_data, &nl->in_stats, - sizeof(struct sbni_in_stats) )) - return -EFAULT; + if (copy_to_user( ifr->ifr_data, &nl->in_stats, + sizeof(struct sbni_in_stats) )) + error = -EFAULT; break; case SIOCDEVRESINSTATS : @@ -1321,11 +1318,8 @@ flags.rxl = nl->cur_rxl_index; flags.fixed_rxl = nl->delta_rxl == 0; - error = verify_area( VERIFY_WRITE, ifr->ifr_data, - sizeof flags ); - if( !error ) - if (copy_to_user( ifr->ifr_data, &flags, sizeof flags )) - return -EFAULT; + if (copy_to_user( ifr->ifr_data, &flags, sizeof flags )) + error = -EFAULT; break; case SIOCDEVSHWSTATE : @@ -1352,10 +1346,6 @@ case SIOCDEVENSLAVE : if( current->euid != 0 ) /* root only */ return -EPERM; - - if( (error = verify_area( VERIFY_READ, ifr->ifr_data, - sizeof slave_name )) != 0 ) - return error; if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name )) return -EFAULT; diff -Nru a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c --- a/drivers/net/wan/syncppp.c Sun Oct 5 00:33:07 2003 +++ b/drivers/net/wan/syncppp.c Sun Oct 5 00:33:07 2003 @@ -236,7 +236,7 @@ sp->ipkts++; } - if (skb->len <= PPP_HEADER_LEN) { + if (!pskb_may_pull(skb, PPP_HEADER_LEN)) { /* Too small packet, drop it. */ if (sp->pp_flags & PP_DEBUG) printk (KERN_DEBUG "%s: input packet is too small, %d bytes\n", @@ -473,7 +473,7 @@ u8 *p, opt[6]; u32 rmagic; - if (len < 4) { + if (!pskb_may_pull(skb, sizeof(struct lcp_header))) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid lcp packet length: %d bytes\n", dev->name, len); @@ -707,7 +707,9 @@ struct cisco_packet *h; struct net_device *dev = sp->pp_if; - if (skb->len != CISCO_PACKET_LEN && skb->len != CISCO_BIG_PACKET_LEN) { + if (!pskb_may_pull(skb, sizeof(struct cisco_packet)) + || (skb->len != CISCO_PACKET_LEN + && skb->len != CISCO_BIG_PACKET_LEN)) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid cisco packet length: %d bytes\n", dev->name, skb->len); @@ -1211,8 +1213,7 @@ struct net_device *dev = sp->pp_if; int len = skb->len; - if (len < 4) - { + if (!pskb_may_pull(skb, sizeof(struct lcp_header))) { if (sp->pp_flags & PP_DEBUG) printk (KERN_WARNING "%s: invalid ipcp packet length: %d bytes\n", dev->name, len); diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Sun Oct 5 00:33:09 2003 +++ b/drivers/net/wireless/arlan-main.c Sun Oct 5 00:33:09 2003 @@ -5,7 +5,6 @@ * This module provides support for the Arlan 655 card made by Aironet */ -#include #include #include "arlan.h" @@ -721,9 +720,9 @@ else { netif_stop_queue (dev); - return -1; IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "TX TAIL & HEAD full, return, tailStart %d headEnd %d\n", tailStarts, headEnds); + return -1; } priv->out_bytes += length; priv->out_bytes10 += length; @@ -1880,6 +1879,8 @@ } #ifdef MODULE + +static int probe = probeUNKNOWN; static int __init arlan_find_devices(void) { diff -Nru a/drivers/parisc/superio.c b/drivers/parisc/superio.c --- a/drivers/parisc/superio.c Sun Oct 5 00:33:09 2003 +++ b/drivers/parisc/superio.c Sun Oct 5 00:33:09 2003 @@ -530,11 +530,6 @@ static int __init superio_modinit(void) { -#ifdef CONFIG_SERIAL_8250 - extern int serial8250_init(void); - serial8250_init(); -#endif - return pci_module_init(&superio_driver); } @@ -543,5 +538,10 @@ pci_unregister_driver(&superio_driver); } -module_init(superio_modinit); +/* Make late initcall to ensure the serial and tty layers are initialised + * before we start superio. + * + * FIXME: does this break the superio console? + */ +late_initcall(superio_modinit); module_exit(superio_exit); diff -Nru a/drivers/pci/Makefile b/drivers/pci/Makefile --- a/drivers/pci/Makefile Sun Oct 5 00:33:10 2003 +++ b/drivers/pci/Makefile Sun Oct 5 00:33:10 2003 @@ -4,7 +4,6 @@ obj-y += access.o bus.o probe.o remove.o pci.o pool.o quirks.o \ names.o pci-driver.o search.o pci-sysfs.o -obj-$(CONFIG_PM) += power.o obj-$(CONFIG_PROC_FS) += proc.o ifndef CONFIG_SPARC64 diff -Nru a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h --- a/drivers/pci/hotplug/cpqphp.h Sun Oct 5 00:33:09 2003 +++ b/drivers/pci/hotplug/cpqphp.h Sun Oct 5 00:33:09 2003 @@ -766,7 +766,6 @@ set_current_state(TASK_INTERRUPTIBLE); /* Sleep for up to 1 second to wait for the LED to change. */ schedule_timeout(1*HZ); - set_current_state(TASK_RUNNING); remove_wait_queue(&ctrl->queue, &wait); if (signal_pending(current)) retval = -EINTR; diff -Nru a/drivers/pci/hotplug/pci_hotplug.h b/drivers/pci/hotplug/pci_hotplug.h --- a/drivers/pci/hotplug/pci_hotplug.h Sun Oct 5 00:33:08 2003 +++ b/drivers/pci/hotplug/pci_hotplug.h Sun Oct 5 00:33:08 2003 @@ -145,6 +145,7 @@ extern int pci_hp_deregister (struct hotplug_slot *slot); extern int pci_hp_change_slot_info (struct hotplug_slot *slot, struct hotplug_slot_info *info); +extern struct subsystem pci_hotplug_slots_subsys; #endif diff -Nru a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c --- a/drivers/pci/hotplug/pci_hotplug_core.c Sun Oct 5 00:33:09 2003 +++ b/drivers/pci/hotplug/pci_hotplug_core.c Sun Oct 5 00:33:09 2003 @@ -69,7 +69,7 @@ static LIST_HEAD(pci_hotplug_slot_list); -static struct subsystem hotplug_slots_subsys; +struct subsystem pci_hotplug_slots_subsys; static ssize_t hotplug_slot_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) @@ -104,7 +104,7 @@ .release = &hotplug_slot_release, }; -static decl_subsys(hotplug_slots, &hotplug_slot_ktype, NULL); +decl_subsys(pci_hotplug_slots, &hotplug_slot_ktype, NULL); /* these strings match up with the values in pci_bus_speed */ @@ -534,7 +534,7 @@ return -EINVAL; strlcpy(slot->kobj.name, slot->name, KOBJ_NAME_LEN); - kobj_set_kset_s(slot, hotplug_slots_subsys); + kobj_set_kset_s(slot, pci_hotplug_slots_subsys); /* this can fail if we have already registered a slot with the same name */ if (kobject_register(&slot->kobj)) { @@ -629,8 +629,8 @@ { int result; - kset_set_kset_s(&hotplug_slots_subsys, pci_bus_type.subsys); - result = subsystem_register(&hotplug_slots_subsys); + kset_set_kset_s(&pci_hotplug_slots_subsys, pci_bus_type.subsys); + result = subsystem_register(&pci_hotplug_slots_subsys); if (result) { err("Register subsys with error %d\n", result); goto exit; @@ -645,7 +645,7 @@ goto exit; err_subsys: - subsystem_unregister(&hotplug_slots_subsys); + subsystem_unregister(&pci_hotplug_slots_subsys); exit: return result; } @@ -653,7 +653,7 @@ static void __exit pci_hotplug_exit (void) { cpci_hotplug_exit(); - subsystem_unregister(&hotplug_slots_subsys); + subsystem_unregister(&pci_hotplug_slots_subsys); } module_init(pci_hotplug_init); @@ -665,6 +665,7 @@ MODULE_PARM(debug, "i"); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); +EXPORT_SYMBOL_GPL(pci_hotplug_slots_subsys); EXPORT_SYMBOL_GPL(pci_hp_register); EXPORT_SYMBOL_GPL(pci_hp_deregister); EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); diff -Nru a/drivers/pci/pool.c b/drivers/pci/pool.c --- a/drivers/pci/pool.c Sun Oct 5 00:33:10 2003 +++ b/drivers/pci/pool.c Sun Oct 5 00:33:10 2003 @@ -296,7 +296,6 @@ schedule_timeout (POOL_TIMEOUT_JIFFIES); - current->state = TASK_RUNNING; remove_wait_queue (&pool->waitq, &wait); goto restart; } diff -Nru a/drivers/pci/power.c b/drivers/pci/power.c --- a/drivers/pci/power.c Sun Oct 5 00:33:09 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,159 +0,0 @@ -#include -#include -#include - -/* - * PCI Power management.. - * - * This needs to be done centralized, so that we power manage PCI - * devices in the right order: we should not shut down PCI bridges - * before we've shut down the devices behind them, and we should - * not wake up devices before we've woken up the bridge to the - * device.. Eh? - * - * We do not touch devices that don't have a driver that exports - * a suspend/resume function. That is just too dangerous. If the default - * PCI suspend/resume functions work for a device, the driver can - * easily implement them (ie just have a suspend function that calls - * the pci_set_power_state() function). - */ - -static int pci_pm_save_state_device(struct pci_dev *dev, u32 state) -{ - int error = 0; - if (dev) { - struct pci_driver *driver = dev->driver; - if (driver && driver->save_state) - error = driver->save_state(dev,state); - } - return error; -} - -static int pci_pm_suspend_device(struct pci_dev *dev, u32 state) -{ - int error = 0; - if (dev) { - struct pci_driver *driver = dev->driver; - if (driver && driver->suspend) - error = driver->suspend(dev,state); - } - return error; -} - -static int pci_pm_resume_device(struct pci_dev *dev) -{ - int error = 0; - if (dev) { - struct pci_driver *driver = dev->driver; - if (driver && driver->resume) - error = driver->resume(dev); - } - return error; -} - -static int pci_pm_save_state_bus(struct pci_bus *bus, u32 state) -{ - struct list_head *list; - int error = 0; - - list_for_each(list, &bus->children) { - error = pci_pm_save_state_bus(pci_bus_b(list),state); - if (error) return error; - } - list_for_each(list, &bus->devices) { - error = pci_pm_save_state_device(pci_dev_b(list),state); - if (error) return error; - } - return 0; -} - -static int pci_pm_suspend_bus(struct pci_bus *bus, u32 state) -{ - struct list_head *list; - - /* Walk the bus children list */ - list_for_each(list, &bus->children) - pci_pm_suspend_bus(pci_bus_b(list),state); - - /* Walk the device children list */ - list_for_each(list, &bus->devices) - pci_pm_suspend_device(pci_dev_b(list),state); - return 0; -} - -static int pci_pm_resume_bus(struct pci_bus *bus) -{ - struct list_head *list; - - /* Walk the device children list */ - list_for_each(list, &bus->devices) - pci_pm_resume_device(pci_dev_b(list)); - - /* And then walk the bus children */ - list_for_each(list, &bus->children) - pci_pm_resume_bus(pci_bus_b(list)); - return 0; -} - -static int pci_pm_save_state(u32 state) -{ - struct pci_bus *bus = NULL; - int error = 0; - - while ((bus = pci_find_next_bus(bus)) != NULL) { - error = pci_pm_save_state_bus(bus,state); - if (!error) - error = pci_pm_save_state_device(bus->self,state); - } - return error; -} - -static int pci_pm_suspend(u32 state) -{ - struct pci_bus *bus = NULL; - - while ((bus = pci_find_next_bus(bus)) != NULL) { - pci_pm_suspend_bus(bus,state); - pci_pm_suspend_device(bus->self,state); - } - return 0; -} - -static int pci_pm_resume(void) -{ - struct pci_bus *bus = NULL; - - while ((bus = pci_find_next_bus(bus)) != NULL) { - pci_pm_resume_device(bus->self); - pci_pm_resume_bus(bus); - } - return 0; -} - -static int -pci_pm_callback(struct pm_dev *pm_device, pm_request_t rqst, void *data) -{ - int error = 0; - - switch (rqst) { - case PM_SAVE_STATE: - error = pci_pm_save_state((unsigned long)data); - break; - case PM_SUSPEND: - error = pci_pm_suspend((unsigned long)data); - break; - case PM_RESUME: - error = pci_pm_resume(); - break; - default: break; - } - return error; -} - -static int __init pci_pm_init(void) -{ - pm_register(PM_PCI_DEV, 0, pci_pm_callback); - return 0; -} - -subsys_initcall(pci_pm_init); diff -Nru a/drivers/pci/quirks.c b/drivers/pci/quirks.c --- a/drivers/pci/quirks.c Sun Oct 5 00:33:05 2003 +++ b/drivers/pci/quirks.c Sun Oct 5 00:33:05 2003 @@ -750,6 +750,9 @@ /* * The main table of quirks. + * + * Note: any hooks for hotpluggable devices in this table must _NOT_ + * be declared __init. */ static struct pci_fixup pci_fixups[] __devinitdata = { diff -Nru a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c --- a/drivers/sbus/char/bbc_envctrl.c Sun Oct 5 00:33:08 2003 +++ b/drivers/sbus/char/bbc_envctrl.c Sun Oct 5 00:33:08 2003 @@ -59,7 +59,7 @@ * before the hardware based power-off event is triggered. */ -/* These settings are in celcius. We use these defaults only +/* These settings are in Celsius. We use these defaults only * if we cannot interrogate the cpu-fru SEEPROM. */ struct temp_limits { diff -Nru a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c --- a/drivers/sbus/char/cpwatchdog.c Sun Oct 5 00:33:10 2003 +++ b/drivers/sbus/char/cpwatchdog.c Sun Oct 5 00:33:10 2003 @@ -539,7 +539,7 @@ static void wd_pingtimer(struct wd_timer* pTimer) { if(wd_readb(&pTimer->regs->status) & WD_S_RUNNING) { - wd_readb(&pTimer->regs->dcntr); + wd_readw(&pTimer->regs->dcntr); } } diff -Nru a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c --- a/drivers/sbus/char/jsflash.c Sun Oct 5 00:33:08 2003 +++ b/drivers/sbus/char/jsflash.c Sun Oct 5 00:33:08 2003 @@ -37,6 +37,7 @@ #include #include #include +#include #define MAJOR_NR JSFD_MAJOR @@ -187,7 +188,7 @@ static void jsfd_do_request(request_queue_t *q) { struct request *req; - + while ((req = elv_next_request(q)) != NULL) { struct jsfd_part *jdp = req->rq_disk->private_data; unsigned long offset = req->sector << 9; @@ -198,16 +199,11 @@ continue; } - if (req->cmd == WRITE) { + if (rq_data_dir(req) != READ) { printk(KERN_ERR "jsfd: write\n"); end_request(req, 0); continue; } - if (req->cmd != READ) { - printk(KERN_ERR "jsfd: bad req->cmd %d\n", req->cmd); - end_request(req, 0); - continue; - } if ((jdp->dbase & 0xff000000) != 0x20000000) { printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase); @@ -215,7 +211,6 @@ continue; } -/* printk("%s: read buf %p off %x len %x\n", req->rq_disk->disk_name, req->buffer, (int)offset, (int)len); */ /* P3 */ jsfd_read(req->buffer, jdp->dbase + offset, len); end_request(req, 1); @@ -265,9 +260,6 @@ unsigned int n; } b; - if (verify_area(VERIFY_WRITE, buf, togo)) - return -EFAULT; - if (p < JSF_BASE_ALL || p >= JSF_BASE_TOP) { return 0; } @@ -298,7 +290,8 @@ while (togo >= 4) { togo -= 4; b.n = jsf_inl(p); - copy_to_user(tmp, b.s, 4); + if (copy_to_user(tmp, b.s, 4)) + return -EFAULT; tmp += 4; p += 4; } @@ -374,19 +367,17 @@ char s[4]; } b; - if (verify_area(VERIFY_READ, (void *)arg, JSFPRGSZ)) + if (copy_from_user(&abuf, (char *)arg, JSFPRGSZ)) return -EFAULT; - copy_from_user(&abuf, (char *)arg, JSFPRGSZ); p = abuf.off; togo = abuf.size; if ((togo & 3) || (p & 3)) return -EINVAL; uptr = (char *) (unsigned long) abuf.data; - if (verify_area(VERIFY_READ, uptr, togo)) - return -EFAULT; while (togo != 0) { togo -= 4; - copy_from_user(&b.s[0], uptr, 4); + if (copy_from_user(&b.s[0], uptr, 4)) + return -EFAULT; jsf_write4(p, b.n); p += 4; uptr += 4; @@ -404,10 +395,8 @@ return -EPERM; switch (cmd) { case JSFLASH_IDENT: - if (verify_area(VERIFY_WRITE, (void *)arg, JSFIDSZ)) - return -EFAULT; - copy_to_user(arg, &jsf0.id, JSFIDSZ); - error = 0; + if (copy_to_user((void *)arg, &jsf0.id, JSFIDSZ)) + return -EFAULT; break; case JSFLASH_ERASE: error = jsf_ioctl_erase(arg); diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig --- a/drivers/scsi/Kconfig Sun Oct 5 00:33:10 2003 +++ b/drivers/scsi/Kconfig Sun Oct 5 00:33:10 2003 @@ -1148,16 +1148,6 @@ To compile this driver as a module, choose M here: the module will be called qla1280. -config SCSI_QLOGIC_1280_PIO - bool "Use PIO instead of MMIO" if !X86_VISWS - depends on SCSI_QLOGIC_1280 - default y if X86_VISWS - help - This instructs the driver to use programmed I/O ports (PIO) instead - of PCI shared memory (MMIO). This can possibly solve some problems - in case your mainboard has memory consistency issues. If unsure, - say N. - config SCSI_QLOGICPTI tristate "PTI Qlogic, ISP Driver" depends on SBUS && SCSI @@ -1435,7 +1425,7 @@ config A4000T_SCSI bool "A4000T SCSI support (EXPERIMENTAL)" - depends on AMIGA && SCSI && EXPERIMENTAL + depends on AMIGA && SCSI && EXPERIMENTAL && BROKEN help Support for the NCR53C710 SCSI controller on the Amiga 4000T. @@ -1503,7 +1493,7 @@ config A4091_SCSI bool "A4091 SCSI support (EXPERIMENTAL)" - depends on ZORRO && SCSI && EXPERIMENTAL + depends on ZORRO && SCSI && EXPERIMENTAL && BROKEN help Support for the NCR53C710 chip on the Amiga 4091 Z3 SCSI2 controller (1993). Very obscure -- the 4091 was part of an Amiga 4000 upgrade @@ -1511,7 +1501,7 @@ config WARPENGINE_SCSI bool "WarpEngine SCSI support (EXPERIMENTAL)" - depends on ZORRO && SCSI && EXPERIMENTAL + depends on ZORRO && SCSI && EXPERIMENTAL && BROKEN help Support for MacroSystem Development's WarpEngine Amiga SCSI-2 controller. Info at @@ -1519,7 +1509,7 @@ config BLZ603EPLUS_SCSI bool "Blizzard PowerUP 603e+ SCSI (EXPERIMENTAL)" - depends on ZORRO && SCSI && EXPERIMENTAL + depends on ZORRO && SCSI && EXPERIMENTAL && BROKEN help If you have an Amiga 1200 with a Phase5 Blizzard PowerUP 603e+ accelerator, say Y. Otherwise, say N. @@ -1535,7 +1525,7 @@ config ATARI_SCSI tristate "Atari native SCSI support" - depends on ATARI && SCSI + depends on ATARI && SCSI && BROKEN ---help--- If you have an Atari with built-in NCR5380 SCSI controller (TT, Falcon, ...) say Y to get it supported. Of course also, if you have @@ -1604,7 +1594,7 @@ config MVME16x_SCSI bool "NCR53C710 SCSI driver for MVME16x" - depends on MVME16x && SCSI + depends on MVME16x && SCSI && BROKEN help The Motorola MVME162, 166, 167, 172 and 177 boards use the NCR53C710 SCSI controller chip. Almost everyone using one of these boards @@ -1612,7 +1602,7 @@ config BVME6000_SCSI bool "NCR53C710 SCSI driver for BVME6000" - depends on BVME6000 && SCSI + depends on BVME6000 && SCSI && BROKEN help The BVME4000 and BVME6000 boards from BVM Ltd use the NCR53C710 SCSI controller chip. Almost everyone using one of these boards diff -Nru a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c --- a/drivers/scsi/a2091.c Sun Oct 5 00:33:08 2003 +++ b/drivers/scsi/a2091.c Sun Oct 5 00:33:08 2003 @@ -25,31 +25,20 @@ #define DMA(ptr) ((a2091_scsiregs *)((ptr)->base)) #define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata)) -static struct Scsi_Host *first_instance = NULL; -static Scsi_Host_Template *a2091_template; - -static irqreturn_t a2091_intr (int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t a2091_intr (int irq, void *_instance, struct pt_regs *fp) { unsigned long flags; unsigned int status; - struct Scsi_Host *instance; - int handled = 0; + struct Scsi_Host *instance = (struct Scsi_Host *)_instance; - for (instance = first_instance; instance && - instance->hostt == a2091_template; instance = instance->next) - { - status = DMA(instance)->ISTR; - if (!(status & (ISTR_INT_F|ISTR_INT_P))) - continue; - - if (status & ISTR_INTS) { - spin_lock_irqsave(instance->host_lock, flags); - wd33c93_intr (instance); - spin_unlock_irqrestore(instance->host_lock, flags); - handled = 1; - } - } - return IRQ_RETVAL(handled); + status = DMA(instance)->ISTR; + if (!(status & (ISTR_INT_F|ISTR_INT_P)) || !(status & ISTR_INTS)) + return IRQ_NONE; + + spin_lock_irqsave(instance->host_lock, flags); + wd33c93_intr(instance); + spin_unlock_irqrestore(instance->host_lock, flags); + return IRQ_HANDLED; } static int dma_setup (Scsi_Cmnd *cmd, int dir_in) @@ -184,8 +173,6 @@ } } -static int num_a2091 = 0; - int __init a2091_detect(Scsi_Host_Template *tpnt) { static unsigned char called = 0; @@ -193,6 +180,7 @@ unsigned long address; struct zorro_dev *z = NULL; wd33c93_regs regs; + int num_a2091 = 0; if (!MACH_IS_AMIGA || called) return 0; @@ -221,13 +209,10 @@ regs.SASR = &(DMA(instance)->SASR); regs.SCMD = &(DMA(instance)->SCMD); wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10); - if (num_a2091++ == 0) { - first_instance = instance; - a2091_template = instance->hostt; - request_irq(IRQ_AMIGA_PORTS, a2091_intr, SA_SHIRQ, "A2091 SCSI", - a2091_intr); - } + request_irq(IRQ_AMIGA_PORTS, a2091_intr, SA_SHIRQ, "A2091 SCSI", + instance); DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN; + num_a2091++; } return num_a2091; @@ -266,8 +251,7 @@ #ifdef MODULE DMA(instance)->CNTR = 0; release_mem_region(ZTWO_PADDR(instance->base), 256); - if (--num_a2091 == 0) - free_irq(IRQ_AMIGA_PORTS, a2091_intr); + free_irq(IRQ_AMIGA_PORTS, instance); wd33c93_release(); #endif return 1; diff -Nru a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c --- a/drivers/scsi/g_NCR5380.c Sun Oct 5 00:33:07 2003 +++ b/drivers/scsi/g_NCR5380.c Sun Oct 5 00:33:07 2003 @@ -527,8 +527,9 @@ * Locks: none */ -int generic_NCR5380_biosparam(struct scsi_device *sdev, - struct block_device *bdev, sector_t capacity, int *ip) +static int +generic_NCR5380_biosparam(struct scsi_device *sdev, struct block_device *bdev, + sector_t capacity, int *ip) { ip[0] = 64; ip[1] = 32; diff -Nru a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h --- a/drivers/scsi/g_NCR5380.h Sun Oct 5 00:33:05 2003 +++ b/drivers/scsi/g_NCR5380.h Sun Oct 5 00:33:05 2003 @@ -52,7 +52,6 @@ static int generic_NCR5380_host_reset(Scsi_Cmnd *); static int generic_NCR5380_device_reset(Scsi_Cmnd *); static const char* generic_NCR5380_info(struct Scsi_Host *); -static int generic_NCR5380_biosparam(struct scsi_device *, struct block_device *, sector_t, int *); #ifndef CMD_PER_LUN #define CMD_PER_LUN 2 diff -Nru a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c --- a/drivers/scsi/gvp11.c Sun Oct 5 00:33:10 2003 +++ b/drivers/scsi/gvp11.c Sun Oct 5 00:33:10 2003 @@ -25,29 +25,20 @@ #define DMA(ptr) ((gvp11_scsiregs *)((ptr)->base)) #define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata)) -static struct Scsi_Host *first_instance = NULL; -static Scsi_Host_Template *gvp11_template; - -static irqreturn_t gvp11_intr (int irq, void *dummy, struct pt_regs *fp) +static irqreturn_t gvp11_intr (int irq, void *_instance, struct pt_regs *fp) { unsigned long flags; unsigned int status; - struct Scsi_Host *instance; - int handled = 0; - - for (instance = first_instance; instance && - instance->hostt == gvp11_template; instance = instance->next) - { - status = DMA(instance)->CNTR; - if (!(status & GVP11_DMAC_INT_PENDING)) - continue; + struct Scsi_Host *instance = (struct Scsi_Host *)_instance; - spin_lock_irqsave(instance->host_lock, flags); - wd33c93_intr (instance); - spin_unlock_irqrestore(instance->host_lock, flags); - handled = 1; - } - return IRQ_RETVAL(handled); + status = DMA(instance)->CNTR; + if (!(status & GVP11_DMAC_INT_PENDING)) + return IRQ_NONE; + + spin_lock_irqsave(instance->host_lock, flags); + wd33c93_intr(instance); + spin_unlock_irqrestore(instance->host_lock, flags); + return IRQ_HANDLED; } static int gvp11_xfer_mask = 0; @@ -177,8 +168,6 @@ } } -static int num_gvp11 = 0; - #define CHECK_WD33C93 int __init gvp11_detect(Scsi_Host_Template *tpnt) @@ -190,6 +179,7 @@ struct zorro_dev *z = NULL; unsigned int default_dma_xfer_mask; wd33c93_regs regs; + int num_gvp11 = 0; #ifdef CHECK_WD33C93 volatile unsigned char *sasr_3393, *scmd_3393; unsigned char save_sasr; @@ -339,13 +329,10 @@ (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10 : WD33C93_FS_12_15); - if (num_gvp11++ == 0) { - first_instance = instance; - gvp11_template = instance->hostt; - request_irq(IRQ_AMIGA_PORTS, gvp11_intr, SA_SHIRQ, - "GVP11 SCSI", gvp11_intr); - } + request_irq(IRQ_AMIGA_PORTS, gvp11_intr, SA_SHIRQ, "GVP11 SCSI", + instance); DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE; + num_gvp11++; continue; release: @@ -391,8 +378,7 @@ #ifdef MODULE DMA(instance)->CNTR = 0; release_mem_region(ZTWO_PADDR(instance->base), 256); - if (--num_gvp11 == 0) - free_irq(IRQ_AMIGA_PORTS, gvp11_intr); + free_irq(IRQ_AMIGA_PORTS, instance); wd33c93_release(); #endif return 1; diff -Nru a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c --- a/drivers/scsi/megaraid.c Sun Oct 5 00:33:05 2003 +++ b/drivers/scsi/megaraid.c Sun Oct 5 00:33:05 2003 @@ -586,7 +586,7 @@ /* Set the Mode of addressing to 64 bit if we can */ if((adapter->flag & BOARD_64BIT)&&(sizeof(dma_addr_t) == 8)) { - pci_set_dma_mask(pdev, 0xffffffffffffffff); + pci_set_dma_mask(pdev, 0xffffffffffffffffULL); adapter->has_64bit_addr = 1; } else { diff -Nru a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c --- a/drivers/scsi/ncr53c8xx.c Sun Oct 5 00:33:07 2003 +++ b/drivers/scsi/ncr53c8xx.c Sun Oct 5 00:33:07 2003 @@ -7757,7 +7757,7 @@ cp->start.schedule.l_cmd = cpu_to_scr(SCR_JUMP); cp->start.p_phys = cpu_to_scr(CCB_PHYS(cp, phys)); - bcopy(&cp->start, &cp->restart, sizeof(cp->restart)); + memcpy(&cp->restart, &cp->start, sizeof(cp->restart)); cp->start.schedule.l_paddr = cpu_to_scr(NCB_SCRIPT_PHYS (np, idle)); cp->restart.schedule.l_paddr = cpu_to_scr(NCB_SCRIPTH_PHYS (np, abort)); diff -Nru a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c --- a/drivers/scsi/nsp32.c Sun Oct 5 00:33:08 2003 +++ b/drivers/scsi/nsp32.c Sun Oct 5 00:33:08 2003 @@ -3435,15 +3435,6 @@ * Power Management */ #ifdef CONFIG_PM -/* Save Device Context */ -static int nsp32_save_state(struct pci_dev *pdev, u32 state) -{ - struct Scsi_Host *host = pci_get_drvdata(pdev); - - nsp32_msg(KERN_INFO, "pci-save_state: stub, pdev=0x%p, state=%ld, slot=%s, host=0x%p", pdev, state, pci_name(pdev), host); - - return 0; -} /* Device suspended */ static int nsp32_suspend(struct pci_dev *pdev, u32 state) @@ -3573,7 +3564,6 @@ .probe = nsp32_probe, .remove = __devexit_p(nsp32_remove), #ifdef CONFIG_PM - .save_state = nsp32_save_state, .suspend = nsp32_suspend, .resume = nsp32_resume, .enable_wake = nsp32_enable_wake, diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c --- a/drivers/scsi/qla1280.c Sun Oct 5 00:33:10 2003 +++ b/drivers/scsi/qla1280.c Sun Oct 5 00:33:10 2003 @@ -16,10 +16,15 @@ * General Public License for more details. * ******************************************************************************/ -#define QLA1280_VERSION "3.23.36" +#define QLA1280_VERSION "3.23.37" /***************************************************************************** Revision History: - Rev 3.23.36 September 19, 2003, Christoph Hellwig + Rev 3.23.37 October 1, 2003, Jes Sorensen + - Make MMIO depend on CONFIG_X86_VISWS instead of yet another + random CONFIG option + - Clean up locking in probe path + Rev 3.23.36 October 1, 2003, Christoph Hellwig + - queuecommand only ever receives new commands - clear flags - Reintegrate lost fixes from Linux 2.5 Rev 3.23.35 August 14, 2003, Jes Sorensen - Build against 2.6 @@ -315,14 +320,14 @@ #if LINUX_VERSION_CODE >= 0x020545 #include +#include "scsi.h" #else #include +#include "scsi.h" #include "hosts.h" #include "sd.h" #endif -#include "scsi.h" - #if LINUX_VERSION_CODE < 0x020407 #error "Kernels older than 2.4.7 are no longer supported" #endif @@ -339,7 +344,10 @@ #define DEBUG_PRINT_NVRAM 0 #define DEBUG_QLA1280 0 -#ifdef CONFIG_SCSI_QLOGIC_1280_PIO +/* + * The SGI VISWS is broken and doesn't support MMIO ;-( + */ +#ifdef CONFIG_X86_VISWS #define MEMORY_MAPPED_IO 0 #else #define MEMORY_MAPPED_IO 1 @@ -414,6 +422,11 @@ #else #define HOST_LOCK ha->host->host_lock #endif +#if LINUX_VERSION_CODE < 0x020600 +#define DEV_SIMPLE_TAGS(device) device->tagged_queue +#else +#define DEV_SIMPLE_TAGS(device) device->simple_tags +#endif #if defined(__ia64__) && !defined(ia64_platform_is) #define ia64_platform_is(foo) (!strcmp(x, platform_name)) #endif @@ -647,11 +660,11 @@ #define PROC_BUF &qla1280_buffer[len] #if LINUX_VERSION_CODE < 0x020600 -static int qla1280_proc_info(char *buffer, char **start, off_t offset, int length, - int hostno, int inout) +static int qla1280_proc_info(char *buffer, char **start, off_t offset, + int length, int hostno, int inout) #else -static int qla1280_proc_info(struct Scsi_Host *host, char *buffer, char **start, - off_t offset, int length, int inout) +static int qla1280_proc_info(struct Scsi_Host *host, char *buffer, + char **start, off_t offset, int length, int inout) #endif { struct scsi_qla_host *ha; @@ -955,8 +968,8 @@ host->io_port, host->io_port + 0xff); goto error_free_irq; } - #endif + /* load the F/W, read paramaters, and init the H/W */ if (qla1280_initialize_adapter(ha)) { printk(KERN_INFO "qla1x160: Failed to initialize adapter\n"); @@ -1598,6 +1611,7 @@ return IRQ_RETVAL(handled); } + static int qla12160_set_target_parameters(struct scsi_qla_host *ha, int bus, int target) { @@ -1666,9 +1680,7 @@ int target = device->id; int status = 0; struct nvram *nv; -#if LINUX_VERSION_CODE < 0x020500 unsigned long flags; -#endif ha = (struct scsi_qla_host *)device->host->hostdata; nv = &ha->nvram; @@ -1706,17 +1718,13 @@ nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; } -#if LINUX_VERSION_CODE < 0x020500 spin_lock_irqsave(HOST_LOCK, flags); -#endif if (nv->bus[bus].target[target].parameter.f.enable_sync) { status = qla12160_set_target_parameters(ha, bus, target); } qla12160_get_target_parameters(ha, device); -#if LINUX_VERSION_CODE < 0x020500 spin_unlock_irqrestore(HOST_LOCK, flags); -#endif return status; } @@ -1995,7 +2003,7 @@ if (ha->request_ring) pci_free_consistent(ha->pdev, ((REQUEST_ENTRY_CNT + 1) * - (sizeof(request_t))), + (sizeof(request_t))), ha->request_ring, ha->request_dma); finish: LEAVE("qla1280_mem_alloc"); @@ -2088,6 +2096,9 @@ struct device_reg *reg; int status; int bus; +#if LINUX_VERSION_CODE > 0x020500 + unsigned long flags; +#endif ENTER("qla1280_initialize_adapter"); @@ -2131,6 +2142,15 @@ "NVRAM\n"); } +#if LINUX_VERSION_CODE >= 0x020500 + /* + * It's necessary to grab the spin here as qla1280_mailbox_command + * needs to be able to drop the lock unconditionally to wait + * for completion. + * In 2.4 ->detect is called with the io_request_lock held. + */ + spin_lock_irqsave(HOST_LOCK, flags); +#endif /* If firmware needs to be loaded */ if (qla1280_isp_firmware(ha)) { if (!(status = qla1280_chip_diag (ha))) { @@ -2183,6 +2203,9 @@ status = 1; out: +#if LINUX_VERSION_CODE >= 0x020500 + spin_unlock_irqrestore(HOST_LOCK, flags); +#endif if (status) dprintk(2, "qla1280_initialize_adapter: **** FAILED ****\n"); @@ -3208,18 +3231,14 @@ timer.function = qla1280_mailbox_timeout; add_timer(&timer); -#if LINUX_VERSION_CODE < 0x020500 spin_unlock_irq(HOST_LOCK); -#endif WRT_REG_WORD(®->host_cmd, HC_SET_HOST_INT); data = qla1280_debounce_register(®->istatus); wait_for_completion(&wait); del_timer_sync(&timer); -#if LINUX_VERSION_CODE < 0x020500 spin_lock_irq(HOST_LOCK); -#endif ha->mailbox_wait = NULL; @@ -3636,7 +3655,7 @@ (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); /* Enable simple tag queuing if device supports it. */ - if (cmd->device->simple_tags) + if (DEV_SIMPLE_TAGS(cmd->device)) pkt->control_flags |= cpu_to_le16(BIT_3); /* Load SCSI command packet. */ @@ -3936,7 +3955,7 @@ (SCSI_TCN_32(cmd) | BIT_7) : SCSI_TCN_32(cmd); /* Enable simple tag queuing if device supports it. */ - if (cmd->device->simple_tags) + if (DEV_SIMPLE_TAGS(cmd->device)) pkt->control_flags |= cpu_to_le16(BIT_3); /* Load SCSI command packet. */ @@ -4823,6 +4842,7 @@ return ret; } + /************************************************************************ * qla1280_check_for_dead_scsi_bus * * * @@ -4891,7 +4911,7 @@ } else printk(" Async"); - if (device->simple_tags) + if (DEV_SIMPLE_TAGS(device)) printk(", Tagged queuing: depth %d", device->queue_depth); printk("\n"); } @@ -5105,6 +5125,7 @@ return ret; } + static Scsi_Host_Template driver_template = { .proc_info = qla1280_proc_info, .name = "Qlogic ISP 1280/12160", @@ -5131,6 +5152,7 @@ }; #include "scsi_module.c" + /* * Overrides for Emacs so that we almost follow Linus's tabbing style. diff -Nru a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c --- a/drivers/scsi/qlogicfc.c Sun Oct 5 00:33:09 2003 +++ b/drivers/scsi/qlogicfc.c Sun Oct 5 00:33:09 2003 @@ -718,8 +718,8 @@ continue; /* Try to configure DMA attributes. */ - if (pci_set_dma_mask(pdev, (u64) 0xffffffffffffffff) && - pci_set_dma_mask(pdev, (u64) 0xffffffff)) + if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) && + pci_set_dma_mask(pdev, 0xffffffffULL)) continue; host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata)); diff -Nru a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c --- a/drivers/scsi/sun3_scsi.c Sun Oct 5 00:33:06 2003 +++ b/drivers/scsi/sun3_scsi.c Sun Oct 5 00:33:06 2003 @@ -308,7 +308,6 @@ return 1; } -#ifdef MODULE int sun3scsi_release (struct Scsi_Host *shpnt) { if (shpnt->irq != SCSI_IRQ_NONE) @@ -318,7 +317,6 @@ return 0; } -#endif #ifdef RESET_BOOT /* diff -Nru a/drivers/scsi/sun3_scsi.h b/drivers/scsi/sun3_scsi.h --- a/drivers/scsi/sun3_scsi.h Sun Oct 5 00:33:06 2003 +++ b/drivers/scsi/sun3_scsi.h Sun Oct 5 00:33:06 2003 @@ -52,11 +52,7 @@ static const char *sun3scsi_info (struct Scsi_Host *); static int sun3scsi_bus_reset(Scsi_Cmnd *); static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); -#ifdef MODULE static int sun3scsi_release (struct Scsi_Host *); -#else -#define sun3scsi_release NULL -#endif #ifndef CMD_PER_LUN #define CMD_PER_LUN 2 diff -Nru a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c --- a/drivers/scsi/sun3_scsi_vme.c Sun Oct 5 00:33:10 2003 +++ b/drivers/scsi/sun3_scsi_vme.c Sun Oct 5 00:33:10 2003 @@ -140,7 +140,7 @@ static int sun3scsi_detect(Scsi_Host_Template * tpnt) { - unsigned long ioaddr, irq; + unsigned long ioaddr, irq = 0; static int called = 0; struct Scsi_Host *instance; int i; @@ -277,17 +277,15 @@ return 1; } -#ifdef MODULE int sun3scsi_release (struct Scsi_Host *shpnt) { if (shpnt->irq != SCSI_IRQ_NONE) free_irq (shpnt->irq, NULL); - iounmap(sun3_scsi_regp); + iounmap((void *)sun3_scsi_regp); return 0; } -#endif #ifdef RESET_BOOT /* diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h --- a/drivers/scsi/sym53c8xx_2/sym_glue.h Sun Oct 5 00:33:10 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_glue.h Sun Oct 5 00:33:10 2003 @@ -70,10 +70,6 @@ #include #include "../scsi.h" /* XXX: DID_* */ -#ifndef bcopy -#define bcopy(s, d, n) memcpy((d), (s), (n)) -#endif - #ifndef bzero #define bzero(d, n) memset((d), 0, (n)) #endif diff -Nru a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c Sun Oct 5 00:33:05 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c Sun Oct 5 00:33:05 2003 @@ -5889,9 +5889,9 @@ /* * Copy scripts to controller instance. */ - bcopy(fw->a_base, np->scripta0, np->scripta_sz); - bcopy(fw->b_base, np->scriptb0, np->scriptb_sz); - bcopy(fw->z_base, np->scriptz0, np->scriptz_sz); + memcpy(np->scripta0, fw->a_base, np->scripta_sz); + memcpy(np->scriptb0, fw->b_base, np->scriptb_sz); + memcpy(np->scriptz0, fw->z_base, np->scriptz_sz); /* * Setup variable parts in scripts and compute diff -Nru a/drivers/scsi/sym53c8xx_2/sym_misc.c b/drivers/scsi/sym53c8xx_2/sym_misc.c --- a/drivers/scsi/sym53c8xx_2/sym_misc.c Sun Oct 5 00:33:10 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_misc.c Sun Oct 5 00:33:10 2003 @@ -225,7 +225,7 @@ */ void sym_update_trans_settings(hcb_p np, tcb_p tp) { - bcopy(&tp->tinfo.user, &tp->tinfo.goal, sizeof(tp->tinfo.goal)); + memcpy(&tp->tinfo.goal, &tp->tinfo.user, sizeof(tp->tinfo.goal)); if (tp->inq_version >= 4) { switch(tp->inq_byte56 & INQ56_CLOCKING) { diff -Nru a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h --- a/drivers/scsi/sym53c8xx_comm.h Sun Oct 5 00:33:08 2003 +++ b/drivers/scsi/sym53c8xx_comm.h Sun Oct 5 00:33:08 2003 @@ -88,10 +88,6 @@ #define u_int unsigned int #define u_long unsigned long -#ifndef bcopy -#define bcopy(s, d, n) memcpy((d), (s), (n)) -#endif - #ifndef bcmp #define bcmp(s, d, n) memcmp((d), (s), (n)) #endif diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c --- a/drivers/serial/8250.c Sun Oct 5 00:33:05 2003 +++ b/drivers/serial/8250.c Sun Oct 5 00:33:05 2003 @@ -469,8 +469,14 @@ */ serial_outp(up, UART_LCR, UART_LCR_DLAB); if (serial_in(up, UART_EFR) == 0) { - DEBUG_AUTOCONF("EFRv1 "); - up->port.type = PORT_16650; + serial_outp(up, UART_EFR, 0xA8); + if (serial_in(up, UART_EFR) != 0) { + DEBUG_AUTOCONF("EFRv1 "); + up->port.type = PORT_16650; + } else { + DEBUG_AUTOCONF("Motorola 8xxx DUART "); + } + serial_outp(up, UART_EFR, 0); return; } @@ -490,7 +496,9 @@ * Attempt to switch to bank 2, read the value of the LOOP bit * from EXCR1. Switch back to bank 0, change it in MCR. Then * switch back to bank 2, read it from EXCR1 again and check - * it's changed. If so, set baud_base in EXCR2 to 921600. + * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2 + * On PowerPC we don't want to change baud_base, as we have + * a number of different divisors. -- Tom Rini */ serial_outp(up, UART_LCR, 0); status1 = serial_in(up, UART_MCR); @@ -506,12 +514,14 @@ serial_outp(up, UART_MCR, status1); if ((status2 ^ status1) & UART_MCR_LOOP) { +#ifndef CONFIG_PPC serial_outp(up, UART_LCR, 0xE0); status1 = serial_in(up, 0x04); /* EXCR1 */ status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ serial_outp(up, 0x04, status1); serial_outp(up, UART_LCR, 0); +#endif up->port.type = PORT_NS16550A; up->port.uartclk = 921600*16; diff -Nru a/drivers/telephony/ixj.h b/drivers/telephony/ixj.h --- a/drivers/telephony/ixj.h Sun Oct 5 00:33:10 2003 +++ b/drivers/telephony/ixj.h Sun Oct 5 00:33:10 2003 @@ -42,6 +42,7 @@ #define IXJ_VERSION 3031 +#include #include #include diff -Nru a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c --- a/drivers/telephony/phonedev.c Sun Oct 5 00:33:09 2003 +++ b/drivers/telephony/phonedev.c Sun Oct 5 00:33:09 2003 @@ -14,7 +14,6 @@ * phone_register_device now works with unit!=PHONE_UNIT_ANY */ -#include #include #include #include diff -Nru a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c --- a/drivers/usb/core/inode.c Sun Oct 5 00:33:05 2003 +++ b/drivers/usb/core/inode.c Sun Oct 5 00:33:06 2003 @@ -38,6 +38,7 @@ #include #include #include +#include #include static struct super_operations usbfs_ops; @@ -62,85 +63,93 @@ static umode_t busmode = S_IXUGO | S_IRUGO; static umode_t listmode = S_IRUGO; +enum { + Opt_devuid, Opt_devgid, Opt_devmode, + Opt_busuid, Opt_busgid, Opt_busmode, + Opt_listuid, Opt_listgid, Opt_listmode, + Opt_err, +}; + +static match_table_t tokens = { + {Opt_devuid, "devuid=%u"}, + {Opt_devgid, "devgid=%u"}, + {Opt_devmode, "devmode=%o"}, + {Opt_busuid, "busuid=%u"}, + {Opt_busgid, "busgid=%u"}, + {Opt_busmode, "busmode=%o"}, + {Opt_listuid, "listuid=%u"}, + {Opt_listgid, "listgid=%u"}, + {Opt_listmode, "listmode=%o"}, + {Opt_err, NULL} +}; + static int parse_options(struct super_block *s, char *data) { - char *curopt = NULL, *value; + char *p; + int option; - while ((curopt = strsep(&data, ",")) != NULL) { - if (!*curopt) + while ((p = strsep(&data, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; + if (!*p) continue; - if ((value = strchr(curopt, '=')) != NULL) - *value++ = 0; - if (!strcmp(curopt, "devuid")) { - if (!value || !value[0]) - return -EINVAL; - devuid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "devgid")) { - if (!value || !value[0]) - return -EINVAL; - devgid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "devmode")) { - if (!value || !value[0]) - return -EINVAL; - devmode = simple_strtoul(value, &value, 0) & S_IRWXUGO; - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "busuid")) { - if (!value || !value[0]) - return -EINVAL; - busuid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "busgid")) { - if (!value || !value[0]) - return -EINVAL; - busgid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "busmode")) { - if (!value || !value[0]) - return -EINVAL; - busmode = simple_strtoul(value, &value, 0) & S_IRWXUGO; - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "listuid")) { - if (!value || !value[0]) - return -EINVAL; - listuid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "listgid")) { - if (!value || !value[0]) - return -EINVAL; - listgid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } - if (!strcmp(curopt, "listmode")) { - if (!value || !value[0]) - return -EINVAL; - listmode = simple_strtoul(value, &value, 0) & S_IRWXUGO; - if (*value) - return -EINVAL; + + token = match_token(p, tokens, args); + switch (token) { + case Opt_devuid: + if (match_int(&args[0], &option)) + return -EINVAL; + devuid = option; + break; + case Opt_devgid: + if (match_int(&args[0], &option)) + return -EINVAL; + devgid = option; + break; + case Opt_devmode: + if (match_octal(&args[0], &option)) + return -EINVAL; + devmode = option & S_IRWXUGO; + break; + case Opt_busuid: + if (match_int(&args[0], &option)) + return -EINVAL; + busuid = option; + break; + case Opt_busgid: + if (match_int(&args[0], &option)) + return -EINVAL; + busgid = option; + break; + case Opt_busmode: + if (match_octal(&args[0], &option)) + return -EINVAL; + busmode = option & S_IRWXUGO; + break; + case Opt_listuid: + if (match_int(&args[0], &option)) + return -EINVAL; + listuid = option; + break; + case Opt_listgid: + if (match_int(&args[0], &option)) + return -EINVAL; + listgid = option; + break; + case Opt_listmode: + if (match_octal(&args[0], &option)) + return -EINVAL; + listmode = option & S_IRWXUGO; + break; + default: + err("usbfs: unrecognised mount option \"%s\" " + "or missing value\n", p); + return -EINVAL; } } return 0; } - - -/* --------------------------------------------------------------------- */ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev) { diff -Nru a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c --- a/drivers/usb/host/uhci-debug.c Sun Oct 5 00:33:06 2003 +++ b/drivers/usb/host/uhci-debug.c Sun Oct 5 00:33:06 2003 @@ -99,82 +99,6 @@ return out - buf; } -static int uhci_show_sc(int port, unsigned short status, char *buf, int len) -{ - char *out = buf; - - /* Try to make sure there's enough memory */ - if (len < 80) - return 0; - - out += sprintf(out, " stat%d = %04x %s%s%s%s%s%s%s%s\n", - port, - status, - (status & USBPORTSC_SUSP) ? "PortSuspend " : "", - (status & USBPORTSC_PR) ? "PortReset " : "", - (status & USBPORTSC_LSDA) ? "LowSpeed " : "", - (status & USBPORTSC_RD) ? "ResumeDetect " : "", - (status & USBPORTSC_PEC) ? "EnableChange " : "", - (status & USBPORTSC_PE) ? "PortEnabled " : "", - (status & USBPORTSC_CSC) ? "ConnectChange " : "", - (status & USBPORTSC_CCS) ? "PortConnected " : ""); - - return out - buf; -} - -static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) -{ - char *out = buf; - unsigned int io_addr = uhci->io_addr; - unsigned short usbcmd, usbstat, usbint, usbfrnum; - unsigned int flbaseadd; - unsigned char sof; - unsigned short portsc1, portsc2; - - /* Try to make sure there's enough memory */ - if (len < 80 * 6) - return 0; - - usbcmd = inw(io_addr + 0); - usbstat = inw(io_addr + 2); - usbint = inw(io_addr + 4); - usbfrnum = inw(io_addr + 6); - flbaseadd = inl(io_addr + 8); - sof = inb(io_addr + 12); - portsc1 = inw(io_addr + 16); - portsc2 = inw(io_addr + 18); - - out += sprintf(out, " usbcmd = %04x %s%s%s%s%s%s%s%s\n", - usbcmd, - (usbcmd & USBCMD_MAXP) ? "Maxp64 " : "Maxp32 ", - (usbcmd & USBCMD_CF) ? "CF " : "", - (usbcmd & USBCMD_SWDBG) ? "SWDBG " : "", - (usbcmd & USBCMD_FGR) ? "FGR " : "", - (usbcmd & USBCMD_EGSM) ? "EGSM " : "", - (usbcmd & USBCMD_GRESET) ? "GRESET " : "", - (usbcmd & USBCMD_HCRESET) ? "HCRESET " : "", - (usbcmd & USBCMD_RS) ? "RS " : ""); - - out += sprintf(out, " usbstat = %04x %s%s%s%s%s%s\n", - usbstat, - (usbstat & USBSTS_HCH) ? "HCHalted " : "", - (usbstat & USBSTS_HCPE) ? "HostControllerProcessError " : "", - (usbstat & USBSTS_HSE) ? "HostSystemError " : "", - (usbstat & USBSTS_RD) ? "ResumeDetect " : "", - (usbstat & USBSTS_ERROR) ? "USBError " : "", - (usbstat & USBSTS_USBINT) ? "USBINT " : ""); - - out += sprintf(out, " usbint = %04x\n", usbint); - out += sprintf(out, " usbfrnum = (%d)%03x\n", (usbfrnum >> 10) & 1, - 0xfff & (4*(unsigned int)usbfrnum)); - out += sprintf(out, " flbaseadd = %08x\n", flbaseadd); - out += sprintf(out, " sof = %02x\n", sof); - out += uhci_show_sc(1, portsc1, out, len - (out - buf)); - out += uhci_show_sc(2, portsc2, out, len - (out - buf)); - - return out - buf; -} - static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) { char *out = buf; @@ -274,6 +198,13 @@ return out - buf; } +#define show_frame_num() \ + if (!shown) { \ + shown = 1; \ + out += sprintf(out, "- Frame %d\n", i); \ + } + +#ifdef CONFIG_PROC_FS static const char *qh_names[] = { "skel_int128_qh", "skel_int64_qh", "skel_int32_qh", "skel_int16_qh", @@ -283,18 +214,88 @@ "skel_bulk_qh", "skel_term_qh" }; -#define show_frame_num() \ - if (!shown) { \ - shown = 1; \ - out += sprintf(out, "- Frame %d\n", i); \ - } - #define show_qh_name() \ if (!shown) { \ shown = 1; \ out += sprintf(out, "- %s\n", qh_names[i]); \ } +static int uhci_show_sc(int port, unsigned short status, char *buf, int len) +{ + char *out = buf; + + /* Try to make sure there's enough memory */ + if (len < 80) + return 0; + + out += sprintf(out, " stat%d = %04x %s%s%s%s%s%s%s%s\n", + port, + status, + (status & USBPORTSC_SUSP) ? "PortSuspend " : "", + (status & USBPORTSC_PR) ? "PortReset " : "", + (status & USBPORTSC_LSDA) ? "LowSpeed " : "", + (status & USBPORTSC_RD) ? "ResumeDetect " : "", + (status & USBPORTSC_PEC) ? "EnableChange " : "", + (status & USBPORTSC_PE) ? "PortEnabled " : "", + (status & USBPORTSC_CSC) ? "ConnectChange " : "", + (status & USBPORTSC_CCS) ? "PortConnected " : ""); + + return out - buf; +} + +static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) +{ + char *out = buf; + unsigned int io_addr = uhci->io_addr; + unsigned short usbcmd, usbstat, usbint, usbfrnum; + unsigned int flbaseadd; + unsigned char sof; + unsigned short portsc1, portsc2; + + /* Try to make sure there's enough memory */ + if (len < 80 * 6) + return 0; + + usbcmd = inw(io_addr + 0); + usbstat = inw(io_addr + 2); + usbint = inw(io_addr + 4); + usbfrnum = inw(io_addr + 6); + flbaseadd = inl(io_addr + 8); + sof = inb(io_addr + 12); + portsc1 = inw(io_addr + 16); + portsc2 = inw(io_addr + 18); + + out += sprintf(out, " usbcmd = %04x %s%s%s%s%s%s%s%s\n", + usbcmd, + (usbcmd & USBCMD_MAXP) ? "Maxp64 " : "Maxp32 ", + (usbcmd & USBCMD_CF) ? "CF " : "", + (usbcmd & USBCMD_SWDBG) ? "SWDBG " : "", + (usbcmd & USBCMD_FGR) ? "FGR " : "", + (usbcmd & USBCMD_EGSM) ? "EGSM " : "", + (usbcmd & USBCMD_GRESET) ? "GRESET " : "", + (usbcmd & USBCMD_HCRESET) ? "HCRESET " : "", + (usbcmd & USBCMD_RS) ? "RS " : ""); + + out += sprintf(out, " usbstat = %04x %s%s%s%s%s%s\n", + usbstat, + (usbstat & USBSTS_HCH) ? "HCHalted " : "", + (usbstat & USBSTS_HCPE) ? "HostControllerProcessError " : "", + (usbstat & USBSTS_HSE) ? "HostSystemError " : "", + (usbstat & USBSTS_RD) ? "ResumeDetect " : "", + (usbstat & USBSTS_ERROR) ? "USBError " : "", + (usbstat & USBSTS_USBINT) ? "USBINT " : ""); + + out += sprintf(out, " usbint = %04x\n", usbint); + out += sprintf(out, " usbfrnum = (%d)%03x\n", (usbfrnum >> 10) & 1, + 0xfff & (4*(unsigned int)usbfrnum)); + out += sprintf(out, " flbaseadd = %08x\n", flbaseadd); + out += sprintf(out, " sof = %02x\n", sof); + out += uhci_show_sc(1, portsc1, out, len - (out - buf)); + out += uhci_show_sc(2, portsc2, out, len - (out - buf)); + + return out - buf; +} + static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, char *buf, int len) { struct list_head *tmp; @@ -512,7 +513,6 @@ return out - buf; } -#ifdef CONFIG_PROC_FS #define MAX_OUTPUT (64 * 1024) static struct proc_dir_entry *uhci_proc_root = NULL; diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c Sun Oct 5 00:33:10 2003 +++ b/drivers/usb/host/uhci-hcd.c Sun Oct 5 00:33:10 2003 @@ -2185,8 +2185,8 @@ /* Maybe kick BIOS off this hardware. Then reset, so we won't get * interrupts from any previous setup. */ - pci_write_config_word(hcd->pdev, USBLEGSUP, USBLEGSUP_DEFAULT); reset_hc(uhci); + pci_write_config_word(hcd->pdev, USBLEGSUP, USBLEGSUP_DEFAULT); return 0; } diff -Nru a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig --- a/drivers/usb/input/Kconfig Sun Oct 5 00:33:09 2003 +++ b/drivers/usb/input/Kconfig Sun Oct 5 00:33:09 2003 @@ -186,8 +186,5 @@ For information about how to connect the X-Box pad to USB, see Documentation/input/xpad.txt. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called xpad. If you want to compile it as a - module, say M here and read . - + To compile this driver as a module, choose M here: the + module will be called xpad. diff -Nru a/drivers/usb/misc/brlvger.c b/drivers/usb/misc/brlvger.c --- a/drivers/usb/misc/brlvger.c Sun Oct 5 00:33:08 2003 +++ b/drivers/usb/misc/brlvger.c Sun Oct 5 00:33:08 2003 @@ -591,14 +591,14 @@ int firstpart = 6 - off; #ifdef WRITE_DEBUG - dbg3("off: %d, rs: %d, count: %d, firstpart: %d", + dbg3("off: %lld, rs: %d, count: %d, firstpart: %d", off, rs, count, firstpart); #endif firstpart = (firstpart < count) ? firstpart : count; #ifdef WRITE_DEBUG - dbg3("off: %d", off); + dbg3("off: %lld", off); dbg3("firstpart: %d", firstpart); #endif @@ -618,7 +618,7 @@ off +=2; #ifdef WRITE_DEBUG - dbg3("off: %d, rs: %d, count: %d, firstpart: %d, " + dbg3("off: %lld, rs: %d, count: %d, firstpart: %d, " "written: %d", off, rs, count, firstpart, written); #endif } diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c --- a/drivers/usb/misc/speedtch.c Sun Oct 5 00:33:10 2003 +++ b/drivers/usb/misc/speedtch.c Sun Oct 5 00:33:10 2003 @@ -189,8 +189,7 @@ struct atm_vcc *vcc; /* raw cell reassembly */ - struct sk_buff *skb; - unsigned int max_pdu; + struct sk_buff *sarb; }; /* send */ @@ -314,12 +313,10 @@ { struct udsl_vcc_data *cached_vcc = NULL; struct atm_vcc *vcc; - struct sk_buff *skb; + struct sk_buff *sarb; struct udsl_vcc_data *vcc_data; int cached_vci = 0; unsigned int i; - unsigned int length; - unsigned int pdu_length; int pti; int vci; short cached_vpi = 0; @@ -344,74 +341,73 @@ } vcc = vcc_data->vcc; + sarb = vcc_data->sarb; - if (!vcc_data->skb && !(vcc_data->skb = dev_alloc_skb (vcc_data->max_pdu))) { - dbg ("udsl_extract_cells: no memory for skb (vcc: 0x%p)!", vcc); - if (pti) - atomic_inc (&vcc->stats->rx_err); - continue; - } - - skb = vcc_data->skb; - - if (skb->len + ATM_CELL_PAYLOAD > vcc_data->max_pdu) { - dbg ("udsl_extract_cells: buffer overrun (max_pdu: %u, skb->len %u, vcc: 0x%p)", vcc_data->max_pdu, skb->len, vcc); + if (sarb->tail + ATM_CELL_PAYLOAD > sarb->end) { + dbg ("udsl_extract_cells: buffer overrun (sarb->len %u, vcc: 0x%p)!", sarb->len, vcc); /* discard cells already received */ - skb_trim (skb, 0); - DEBUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD); + skb_trim (sarb, 0); } - memcpy (skb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); - __skb_put (skb, ATM_CELL_PAYLOAD); + memcpy (sarb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD); + __skb_put (sarb, ATM_CELL_PAYLOAD); if (pti) { + struct sk_buff *skb; + unsigned int length; + unsigned int pdu_length; + length = (source [ATM_CELL_SIZE - 6] << 8) + source [ATM_CELL_SIZE - 5]; /* guard against overflow */ if (length > ATM_MAX_AAL5_PDU) { - dbg ("udsl_extract_cells: bogus length %u (vcc: 0x%p)", length, vcc); - goto drop; + dbg ("udsl_extract_cells: bogus length %u (vcc: 0x%p)!", length, vcc); + atomic_inc (&vcc->stats->rx_err); + goto out; } pdu_length = UDSL_NUM_CELLS (length) * ATM_CELL_PAYLOAD; - if (skb->len < pdu_length) { - dbg ("udsl_extract_cells: bogus pdu_length %u (skb->len: %u, vcc: 0x%p)", pdu_length, skb->len, vcc); - goto drop; + if (sarb->len < pdu_length) { + dbg ("udsl_extract_cells: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!", pdu_length, sarb->len, vcc); + atomic_inc (&vcc->stats->rx_err); + goto out; } - if (crc32_be (~0, skb->tail - pdu_length, pdu_length) != 0xc704dd7b) { - dbg ("udsl_extract_cells: packet failed crc check (vcc: 0x%p)", vcc); - goto drop; + if (crc32_be (~0, sarb->tail - pdu_length, pdu_length) != 0xc704dd7b) { + dbg ("udsl_extract_cells: packet failed crc check (vcc: 0x%p)!", vcc); + atomic_inc (&vcc->stats->rx_err); + goto out; } - if (!atm_charge (vcc, skb->truesize)) { - dbg ("udsl_extract_cells: failed atm_charge (skb->truesize: %u)", skb->truesize); - goto drop_no_stats; /* atm_charge increments rx_drop */ - } + vdbg ("udsl_extract_cells: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", length, pdu_length, vcc); - /* now that we are sure to send the skb, it is ok to change skb->data */ - if (skb->len > pdu_length) - skb_pull (skb, skb->len - pdu_length); /* discard initial junk */ + if (!(skb = dev_alloc_skb (length))) { + dbg ("udsl_extract_cells: no memory for skb (length: %u)!", length); + atomic_inc (&vcc->stats->rx_drop); + goto out; + } - skb_trim (skb, length); /* drop zero padding and trailer */ + vdbg ("udsl_extract_cells: allocated new sk_buff (skb: 0x%p, skb->truesize: %u)", skb, skb->truesize); - atomic_inc (&vcc->stats->rx); + if (!atm_charge (vcc, skb->truesize)) { + dbg ("udsl_extract_cells: failed atm_charge (skb->truesize: %u)!", skb->truesize); + dev_kfree_skb (skb); + goto out; /* atm_charge increments rx_drop */ + } - PACKETDEBUG (skb->data, skb->len); + memcpy (skb->data, sarb->tail - pdu_length, length); + __skb_put (skb, length); vdbg ("udsl_extract_cells: sending skb 0x%p, skb->len %u, skb->truesize %u", skb, skb->len, skb->truesize); - vcc->push (vcc, skb); - - vcc_data->skb = NULL; + PACKETDEBUG (skb->data, skb->len); - continue; + vcc->push (vcc, skb); -drop: - atomic_inc (&vcc->stats->rx_err); -drop_no_stats: - skb_trim (skb, 0); + atomic_inc (&vcc->stats->rx); +out: + skb_trim (sarb, 0); } } } @@ -871,6 +867,7 @@ { struct udsl_instance_data *instance = vcc->dev->dev_data; struct udsl_vcc_data *new; + unsigned int max_pdu; dbg ("udsl_atm_open: vpi %hd, vci %d", vpi, vci); @@ -883,8 +880,10 @@ return -EINVAL; /* only support AAL5 */ - if ((vcc->qos.aal != ATM_AAL5) || (vcc->qos.rxtp.max_sdu < 0) || (vcc->qos.rxtp.max_sdu > ATM_MAX_AAL5_PDU)) + if ((vcc->qos.aal != ATM_AAL5) || (vcc->qos.rxtp.max_sdu < 0) || (vcc->qos.rxtp.max_sdu > ATM_MAX_AAL5_PDU)) { + dbg ("udsl_atm_open: unsupported ATM type %d!", vcc->qos.aal); return -EINVAL; + } if (!instance->firmware_loaded) { dbg ("udsl_atm_open: firmware not loaded!"); @@ -894,11 +893,13 @@ down (&instance->serialize); /* vs self, udsl_atm_close */ if (udsl_find_vcc (instance, vpi, vci)) { + dbg ("udsl_atm_open: %hd/%d already in use!", vpi, vci); up (&instance->serialize); return -EADDRINUSE; } if (!(new = kmalloc (sizeof (struct udsl_vcc_data), GFP_KERNEL))) { + dbg ("udsl_atm_open: no memory for vcc_data!"); up (&instance->serialize); return -ENOMEM; } @@ -907,7 +908,15 @@ new->vcc = vcc; new->vpi = vpi; new->vci = vci; - new->max_pdu = max (1, UDSL_NUM_CELLS (vcc->qos.rxtp.max_sdu)) * ATM_CELL_PAYLOAD; + + /* udsl_extract_cells requires at least one cell */ + max_pdu = max (1, UDSL_NUM_CELLS (vcc->qos.rxtp.max_sdu)) * ATM_CELL_PAYLOAD; + if (!(new->sarb = alloc_skb (max_pdu, GFP_KERNEL))) { + dbg ("udsl_atm_open: no memory for SAR buffer!"); + kfree (new); + up (&instance->serialize); + return -ENOMEM; + } vcc->dev_data = new; vcc->vpi = vpi; @@ -925,7 +934,7 @@ tasklet_schedule (&instance->receive_tasklet); - dbg ("udsl_atm_open: allocated vcc data 0x%p (max_pdu: %u)", new, new->max_pdu); + dbg ("udsl_atm_open: allocated vcc data 0x%p (max_pdu: %u)", new, max_pdu); return 0; } @@ -952,9 +961,8 @@ list_del (&vcc_data->list); tasklet_enable (&instance->receive_tasklet); - if (vcc_data->skb) - dev_kfree_skb (vcc_data->skb); - vcc_data->skb = NULL; + kfree_skb (vcc_data->sarb); + vcc_data->sarb = NULL; kfree (vcc_data); vcc->dev_data = NULL; @@ -1216,7 +1224,7 @@ for (i = 0; i < num_rcv_urbs; i++) if ((result = usb_unlink_urb (instance->receivers [i].urb)) < 0) - dbg ("udsl_usb_disconnect: usb_unlink_urb on receive urb %d returned %d", i, result); + dbg ("udsl_usb_disconnect: usb_unlink_urb on receive urb %d returned %d!", i, result); /* wait for completion handlers to finish */ do { @@ -1252,7 +1260,7 @@ for (i = 0; i < num_snd_urbs; i++) if ((result = usb_unlink_urb (instance->senders [i].urb)) < 0) - dbg ("udsl_usb_disconnect: usb_unlink_urb on send urb %d returned %d", i, result); + dbg ("udsl_usb_disconnect: usb_unlink_urb on send urb %d returned %d!", i, result); /* wait for completion handlers to finish */ do { @@ -1298,11 +1306,9 @@ static int __init udsl_usb_init (void) { - struct sk_buff *skb; /* dummy for sizeof */ - dbg ("udsl_usb_init: driver version " DRIVER_VERSION); - if (sizeof (struct udsl_control) > sizeof (skb->cb)) { + if (sizeof (struct udsl_control) > sizeof (((struct sk_buff *)0)->cb)) { printk (KERN_ERR __FILE__ ": unusable with this kernel!\n"); return -EIO; } diff -Nru a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c --- a/drivers/usb/serial/keyspan.c Sun Oct 5 00:33:06 2003 +++ b/drivers/usb/serial/keyspan.c Sun Oct 5 00:33:06 2003 @@ -28,6 +28,9 @@ Change History + 2003sep04 LPM (Keyspan) add support for new single port product USA19HS. + Improve setup message handling for all devices. + Wed Feb 19 22:00:00 PST 2003 (Jeffrey S. Laing ) Merged the current (1/31/03) Keyspan code with the current (2.4.21-pre4) Linux source tree. The Linux tree lacked support for the 49WLC and @@ -172,6 +175,7 @@ int baud; int old_baud; unsigned int cflag; + unsigned int old_cflag; enum {flow_none, flow_cts, flow_xon} flow_control; int rts_state; /* Handshaking pins (outputs) */ int dtr_state; @@ -187,11 +191,12 @@ /* Include Keyspan message headers. All current Keyspan Adapters - make use of one of three message formats which are referred - to as USA-26, USA-28 and USA-49 by Keyspan and within this driver. */ + make use of one of four message formats which are referred + to as USA-26, USA-28 and USA-49, USA-90 by Keyspan and within this driver. */ #include "keyspan_usa26msg.h" #include "keyspan_usa28msg.h" #include "keyspan_usa49msg.h" +#include "keyspan_usa90msg.h" /* Functions used by new usb-serial code. */ @@ -346,8 +351,8 @@ return -ENOIOCTLCMD; } - /* Write function is generic for the three protocols used - with only a minor change for usa49 required */ + /* Write function is similar for the four protocols used + with only a minor change for usa90 (usa19hs) required */ static int keyspan_write(struct usb_serial_port *port, int from_user, const unsigned char *buf, int count) { @@ -356,18 +361,26 @@ int flip; int left, todo; struct urb *this_urb; - int err; + int err, maxDataLen, dataOffset; p_priv = usb_get_serial_port_data(port); d_details = p_priv->device_details; + if (d_details->msg_format == msg_usa90) { + maxDataLen = 64; + dataOffset = 0; + } else { + maxDataLen = 63; + dataOffset = 1; + } + dbg("%s - for port %d (%d chars), flip=%d", __FUNCTION__, port->number, count, p_priv->out_flip); for (left = count; left > 0; left -= todo) { todo = left; - if (todo > 63) - todo = 63; + if (todo > maxDataLen) + todo = maxDataLen; flip = p_priv->out_flip; @@ -390,20 +403,20 @@ break; } - /* First byte in buffer is "last flag" - unused so + /* First byte in buffer is "last flag" (except for usa19hx) - unused so for now so set to zero */ ((char *)this_urb->transfer_buffer)[0] = 0; if (from_user) { - if (copy_from_user(this_urb->transfer_buffer + 1, buf, todo)) + if (copy_from_user(this_urb->transfer_buffer + dataOffset, buf, todo)) return -EFAULT; } else { - memcpy (this_urb->transfer_buffer + 1, buf, todo); + memcpy (this_urb->transfer_buffer + dataOffset, buf, todo); } buf += todo; /* send the data out the bulk port */ - this_urb->transfer_buffer_length = todo + 1; + this_urb->transfer_buffer_length = todo + dataOffset; this_urb->transfer_flags &= ~URB_ASYNC_UNLINK; this_urb->dev = port->serial->dev; @@ -443,9 +456,12 @@ if (urb->actual_length) { /* 0x80 bit is error flag */ if ((data[0] & 0x80) == 0) { - /* no error on any byte */ + /* no errors on individual bytes, only possible overrun err*/ + if (data[0] & RXERROR_OVERRUN) + err = TTY_OVERRUN; + else err = 0; for (i = 1; i < urb->actual_length ; ++i) { - tty_insert_flip_char(tty, data[i], 0); + tty_insert_flip_char(tty, data[i], err); } } else { /* some bytes had errors, every byte has status */ @@ -474,7 +490,7 @@ return; } - /* Outdat handling is common for usa26, usa28 and usa49 messages */ + /* Outdat handling is common for all devices */ static void usa2x_outdat_callback(struct urb *urb, struct pt_regs *regs) { struct usb_serial_port *port; @@ -577,7 +593,7 @@ } -static void usa28_indat_callback(struct urb *urb, struct pt_regs *regs) +static void usa28_indat_callback(struct urb *urb, struct pt_regs *regs) { int i, err; struct usb_serial_port *port; @@ -861,29 +877,172 @@ dbg ("%s", __FUNCTION__); } +static void usa90_indat_callback(struct urb *urb, struct pt_regs *regs) +{ + int i, err; + int endpoint; + struct usb_serial_port *port; + struct keyspan_port_private *p_priv; + struct tty_struct *tty; + unsigned char *data = urb->transfer_buffer; + + dbg ("%s", __FUNCTION__); + + endpoint = usb_pipeendpoint(urb->pipe); + + if (urb->status) { + dbg("%s - nonzero status: %x on endpoint %d.", + __FUNCTION__, urb->status, endpoint); + return; + } + + port = (struct usb_serial_port *) urb->context; + p_priv = usb_get_serial_port_data(port); + + tty = port->tty; + if (urb->actual_length) { + + /* if current mode is DMA, looks like usa28 format + otherwise looks like usa26 data format */ + + if (p_priv->baud > 57600) { + for (i = 0; i < urb->actual_length ; ++i) + tty_insert_flip_char(tty, data[i], 0); + } + else { + + /* 0x80 bit is error flag */ + if ((data[0] & 0x80) == 0) { + /* no errors on individual bytes, only possible overrun err*/ + if (data[0] & RXERROR_OVERRUN) + err = TTY_OVERRUN; + else err = 0; + for (i = 1; i < urb->actual_length ; ++i) + tty_insert_flip_char(tty, data[i], err); + + } + else { + /* some bytes had errors, every byte has status */ + dbg("%s - RX error!!!!", __FUNCTION__); + for (i = 0; i + 1 < urb->actual_length; i += 2) { + int stat = data[i], flag = 0; + if (stat & RXERROR_OVERRUN) + flag |= TTY_OVERRUN; + if (stat & RXERROR_FRAMING) + flag |= TTY_FRAME; + if (stat & RXERROR_PARITY) + flag |= TTY_PARITY; + /* XXX should handle break (0x10) */ + tty_insert_flip_char(tty, data[i+1], flag); + } + } + } + tty_flip_buffer_push(tty); + } + + /* Resubmit urb so we continue receiving */ + urb->dev = port->serial->dev; + if (port->open_count) + if ((err = usb_submit_urb(urb, GFP_ATOMIC)) != 0) { + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); + } + return; +} + + +static void usa90_instat_callback(struct urb *urb, struct pt_regs *regs) +{ + unsigned char *data = urb->transfer_buffer; + struct keyspan_usa90_portStatusMessage *msg; + struct usb_serial *serial; + struct usb_serial_port *port; + struct keyspan_port_private *p_priv; + int old_dcd_state, err; + + serial = (struct usb_serial *) urb->context; + + if (urb->status) { + dbg("%s - nonzero status: %x", __FUNCTION__, urb->status); + return; + } + if (urb->actual_length < 14) { + dbg("%s - %d byte report??", __FUNCTION__, urb->actual_length); + goto exit; + } + + msg = (struct keyspan_usa90_portStatusMessage *)data; + + /* Now do something useful with the data */ + + port = serial->port[0]; + p_priv = usb_get_serial_port_data(port); + + /* Update handshaking pin state information */ + old_dcd_state = p_priv->dcd_state; + p_priv->cts_state = ((msg->cts) ? 1 : 0); + p_priv->dsr_state = ((msg->dsr) ? 1 : 0); + p_priv->dcd_state = ((msg->dcd) ? 1 : 0); + p_priv->ri_state = ((msg->ri) ? 1 : 0); + + if (port->tty && !C_CLOCAL(port->tty) + && old_dcd_state != p_priv->dcd_state) { + if (old_dcd_state) + tty_hangup(port->tty); + /* else */ + /* wake_up_interruptible(&p_priv->open_wait); */ + } + + /* Resubmit urb so we continue receiving */ + urb->dev = serial->dev; + if ((err = usb_submit_urb(urb, GFP_ATOMIC)) != 0) { + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); + } +exit: + ; +} + +static void usa90_outcont_callback(struct urb *urb, struct pt_regs *regs) +{ + struct usb_serial_port *port; + struct keyspan_port_private *p_priv; + + port = (struct usb_serial_port *) urb->context; + p_priv = usb_get_serial_port_data(port); + + if (p_priv->resend_cont) { + dbg ("%s - sending setup", __FUNCTION__); + keyspan_usa90_send_setup(port->serial, port, p_priv->resend_cont - 1); + } +} static int keyspan_write_room (struct usb_serial_port *port) { struct keyspan_port_private *p_priv; const struct keyspan_device_details *d_details; int flip; + int data_len; struct urb *this_urb; dbg("%s", __FUNCTION__); p_priv = usb_get_serial_port_data(port); d_details = p_priv->device_details; + if (d_details->msg_format == msg_usa90) + data_len = 64; + else + data_len = 63; + flip = p_priv->out_flip; /* Check both endpoints to see if any are available. */ if ((this_urb = p_priv->out_urbs[flip]) != 0) { if (this_urb->status != -EINPROGRESS) - return (63); + return (data_len); flip = (flip + 1) & d_details->outdat_endp_flip; if ((this_urb = p_priv->out_urbs[flip]) != 0) if (this_urb->status != -EINPROGRESS) - return (63); + return (data_len); } return (0); } @@ -902,17 +1061,24 @@ struct usb_serial *serial = port->serial; const struct keyspan_device_details *d_details; int i, err; + int baud_rate, device_port; struct urb *urb; + unsigned int cflag; s_priv = usb_get_serial_data(serial); p_priv = usb_get_serial_port_data(port); - d_details = s_priv->device_details; + d_details = p_priv->device_details; dbg("%s - port%d.", __FUNCTION__, port->number); /* Set some sane defaults */ p_priv->rts_state = 1; p_priv->dtr_state = 1; + p_priv->baud = 9600; + + /* force baud and lcr to be set on open */ + p_priv->old_baud = 0; + p_priv->old_cflag = 0; p_priv->out_flip = 0; p_priv->in_flip = 0; @@ -922,7 +1088,10 @@ if ((urb = p_priv->in_urbs[i]) == NULL) continue; urb->dev = serial->dev; - usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); + + /* make sure endpoint data toggle is synchronized with the device */ + + usb_clear_halt(urb->dev, urb->pipe); if ((err = usb_submit_urb(urb, GFP_KERNEL)) != 0) { dbg("%s - submit urb %d failed (%d)", __FUNCTION__, i, err); @@ -937,12 +1106,29 @@ /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */ } - // if the device is a USA49x, determine whether it is an W or WLC model - // and set the baud clock accordingly + /* get the terminal config for the setup message now so we don't + * need to send 2 of them */ + + cflag = port->tty->termios->c_cflag; + device_port = port->number - port->serial->minor; + + /* Baud rate calculation takes baud rate as an integer + so other rates can be generated if desired. */ + baud_rate = tty_get_baud_rate(port->tty); + /* If no match or invalid, leave as default */ + if (baud_rate >= 0 + && d_details->calculate_baud_rate(baud_rate, d_details->baudclk, + NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) { + p_priv->baud = baud_rate; + } + + /* set CTS/RTS handshake etc. */ + p_priv->cflag = cflag; + p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; keyspan_send_setup(port, 1); //mdelay(100); - keyspan_set_termios(port, NULL); + //keyspan_set_termios(port, NULL); return (0); } @@ -977,7 +1163,7 @@ keyspan_send_setup(port, 2); /* pilot-xfer seems to work best with this delay */ mdelay(100); - keyspan_set_termios(port, NULL); + // keyspan_set_termios(port, NULL); } /*while (p_priv->outcont_urb->status == -EINPROGRESS) { @@ -1172,6 +1358,14 @@ .outdat_callback = usa2x_outdat_callback, .inack_callback = usa49_inack_callback, .outcont_callback = usa49_outcont_callback, + }, { + /* msg_usa90 callbacks */ + .instat_callback = usa90_instat_callback, + .glocont_callback = usa28_glocont_callback, + .indat_callback = usa90_indat_callback, + .outdat_callback = usa2x_outdat_callback, + .inack_callback = usa28_inack_callback, + .outcont_callback = usa90_outcont_callback, } }; @@ -1295,6 +1489,41 @@ return (KEYSPAN_BAUD_RATE_OK); } +/* usa19hs function doesn't require prescaler */ +static int keyspan_usa19hs_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi, + u8 *rate_low, u8 *prescaler, int portnum) +{ + u32 b16, /* baud rate times 16 (actual rate used internally) */ + div; /* divisor */ + + dbg ("%s - %d.", __FUNCTION__, baud_rate); + + /* prevent divide by zero... */ + if( (b16 = (baud_rate * 16L)) == 0) + return (KEYSPAN_INVALID_BAUD_RATE); + + + + /* calculate the divisor */ + if( (div = (baudclk / b16)) == 0) + return (KEYSPAN_INVALID_BAUD_RATE); + + if(div > 0xffff) + return (KEYSPAN_INVALID_BAUD_RATE); + + /* return the counter values if non-null */ + if (rate_low) + *rate_low = (u8) (div & 0xff); + + if (rate_hi) + *rate_hi = (u8) ((div >> 8) & 0xff); + + if (rate_low && rate_hi) + dbg ("%s - %d %02x %02x.", __FUNCTION__, baud_rate, *rate_hi, *rate_low); + + return (KEYSPAN_BAUD_RATE_OK); +} + static int keyspan_usa19w_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum) { @@ -1447,6 +1676,7 @@ p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { /* dbg ("%s - already writing", __FUNCTION__); */ + mdelay(5); return(-1); } @@ -1597,6 +1827,7 @@ p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { dbg ("%s already writing", __FUNCTION__); + mdelay(5); return(-1); } @@ -1729,6 +1960,7 @@ p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { /* dbg ("%s - already writing", __FUNCTION__); */ + mdelay(5); return(-1); } @@ -1857,6 +2089,144 @@ return (0); } +static int keyspan_usa90_send_setup(struct usb_serial *serial, + struct usb_serial_port *port, + int reset_port) +{ + struct keyspan_usa90_portControlMessage msg; + struct keyspan_serial_private *s_priv; + struct keyspan_port_private *p_priv; + const struct keyspan_device_details *d_details; + struct urb *this_urb; + int err; + u8 prescaler; + + dbg ("%s", __FUNCTION__); + + s_priv = usb_get_serial_data(serial); + p_priv = usb_get_serial_port_data(port); + d_details = s_priv->device_details; + + /* only do something if we have a bulk out endpoint */ + if ((this_urb = p_priv->outcont_urb) == NULL) { + dbg("%s - oops no urb.", __FUNCTION__); + return -1; + } + + /* Save reset port val for resend. + Don't overwrite resend for open/close condition. */ + if ((reset_port + 1) > p_priv->resend_cont) + p_priv->resend_cont = reset_port + 1; + if (this_urb->status == -EINPROGRESS) { + dbg ("%s already writing", __FUNCTION__); + mdelay(5); + return(-1); + } + + memset(&msg, 0, sizeof (struct keyspan_usa90_portControlMessage)); + + /* Only set baud rate if it's changed */ + if (p_priv->old_baud != p_priv->baud) { + p_priv->old_baud = p_priv->baud; + msg.setClocking = 0x01; + if (d_details->calculate_baud_rate + (p_priv->baud, d_details->baudclk, &msg.baudHi, + &msg.baudLo, &prescaler, 0) == KEYSPAN_INVALID_BAUD_RATE ) { + dbg("%s - Invalid baud rate %d requested, using 9600.", __FUNCTION__, + p_priv->baud); + p_priv->baud = 9600; + d_details->calculate_baud_rate (p_priv->baud, d_details->baudclk, + &msg.baudHi, &msg.baudLo, &prescaler, 0); + } + msg.setRxMode = 1; + msg.setTxMode = 1; + } + + /* modes must always be correctly specified */ + if (p_priv->baud > 57600) + { + msg.rxMode = RXMODE_DMA; + msg.txMode = TXMODE_DMA; + } + else + { + msg.rxMode = RXMODE_BYHAND; + msg.txMode = TXMODE_BYHAND; + } + + msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; + switch (p_priv->cflag & CSIZE) { + case CS5: + msg.lcr |= USA_DATABITS_5; + break; + case CS6: + msg.lcr |= USA_DATABITS_6; + break; + case CS7: + msg.lcr |= USA_DATABITS_7; + break; + case CS8: + msg.lcr |= USA_DATABITS_8; + break; + } + if (p_priv->cflag & PARENB) { + /* note USA_PARITY_NONE == 0 */ + msg.lcr |= (p_priv->cflag & PARODD)? + USA_PARITY_ODD: USA_PARITY_EVEN; + } + if (p_priv->old_cflag != p_priv->cflag) { + p_priv->old_cflag = p_priv->cflag; + msg.setLcr = 0x01; + } + + if (p_priv->flow_control == flow_cts) + msg.txFlowControl = TXFLOW_CTS; + msg.setTxFlowControl = 0x01; + msg.setRxFlowControl = 0x01; + + msg.rxForwardingLength = 16; + msg.rxForwardingTimeout = 16; + msg.txAckSetting = 0; + msg.xonChar = 17; + msg.xoffChar = 19; + + /* Opening port */ + if (reset_port == 1) { + msg.portEnabled = 1; + msg.rxFlush = 1; + msg.txBreak = (p_priv->break_on); + } + /* Closing port */ + else if (reset_port == 2) { + msg.portEnabled = 0; + } + /* Sending intermediate configs */ + else { + if (port->open_count) + msg.portEnabled = 1; + msg.txBreak = (p_priv->break_on); + } + + /* Do handshaking outputs */ + msg.setRts = 0x01; + msg.rts = p_priv->rts_state; + + msg.setDtr = 0x01; + msg.dtr = p_priv->dtr_state; + + p_priv->resend_cont = 0; + memcpy (this_urb->transfer_buffer, &msg, sizeof(msg)); + + /* send the data out the device on control endpoint */ + this_urb->transfer_buffer_length = sizeof(msg); + + this_urb->dev = serial->dev; + if ((err = usb_submit_urb(this_urb, GFP_ATOMIC)) != 0) { + dbg("%s - usb_submit_urb(setup) failed (%d)", __FUNCTION__, err); + } + return (0); +} + static void keyspan_send_setup(struct usb_serial_port *port, int reset_port) { struct usb_serial *serial = port->serial; @@ -1878,8 +2248,12 @@ case msg_usa49: keyspan_usa49_send_setup(serial, port, reset_port); break; + case msg_usa90: + keyspan_usa90_send_setup(serial, port, reset_port); + break; } } + /* Gets called by the "real" driver (ie once firmware is loaded and renumeration has taken place. */ diff -Nru a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h --- a/drivers/usb/serial/keyspan.h Sun Oct 5 00:33:09 2003 +++ b/drivers/usb/serial/keyspan.h Sun Oct 5 00:33:09 2003 @@ -82,6 +82,10 @@ u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum); +static int keyspan_usa19hs_calc_baud (u32 baud_rate, u32 baudclk, + u8 *rate_hi, u8 *rate_low, + u8 *prescaler, int portnum); + static int keyspan_usa28_send_setup (struct usb_serial *serial, struct usb_serial_port *port, int reset_port); @@ -92,6 +96,9 @@ struct usb_serial_port *port, int reset_port); +static int keyspan_usa90_send_setup (struct usb_serial *serial, + struct usb_serial_port *port, + int reset_port); /* Struct used for firmware - increased size of data section to allow Keyspan's 'C' firmware struct to be used unmodified */ @@ -183,6 +190,7 @@ #define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */ #define KEYSPAN_USA19_BAUDCLK (12000000L) #define KEYSPAN_USA19W_BAUDCLK (24000000L) +#define KEYSPAN_USA19HS_BAUDCLK (14769231L) #define KEYSPAN_USA28_BAUDCLK (1843200L) #define KEYSPAN_USA28X_BAUDCLK (12000000L) #define KEYSPAN_USA49W_BAUDCLK (48000000L) @@ -215,6 +223,7 @@ #define keyspan_usa18x_product_id 0x0112 #define keyspan_usa19_product_id 0x0107 #define keyspan_usa19qi_product_id 0x010c +#define keyspan_usa19hs_product_id 0x0121 #define keyspan_mpr_product_id 0x011c #define keyspan_usa19qw_product_id 0x0119 #define keyspan_usa19w_product_id 0x0108 @@ -230,7 +239,7 @@ /* product ID value */ int product_id; - enum {msg_usa26, msg_usa28, msg_usa49} msg_format; + enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90} msg_format; /* Number of physical ports */ int num_ports; @@ -349,6 +358,22 @@ .baudclk = KEYSPAN_USA19W_BAUDCLK, }; +static const struct keyspan_device_details usa19hs_device_details = { + product_id: keyspan_usa19hs_product_id, + msg_format: msg_usa90, + num_ports: 1, + indat_endp_flip: 0, + outdat_endp_flip: 0, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {-1}, + outcont_endpoints: {0x02}, + instat_endpoint: 0x82, + glocont_endpoint: -1, + calculate_baud_rate: keyspan_usa19hs_calc_baud, + baudclk: KEYSPAN_USA19HS_BAUDCLK, +}; + static const struct keyspan_device_details usa28_device_details = { .product_id = keyspan_usa28_product_id, .msg_format = msg_usa28, @@ -437,6 +462,7 @@ &usa19qi_device_details, &usa19qw_device_details, &usa19w_device_details, + &usa19hs_device_details, &usa28_device_details, &usa28x_device_details, &usa28xa_device_details, @@ -464,6 +490,7 @@ { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, @@ -544,8 +571,8 @@ .short_name = "keyspan_1", .id_table = keyspan_1port_ids, .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = 3, - .num_bulk_out = 4, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, .num_ports = 1, .open = keyspan_open, .close = keyspan_close, diff -Nru a/drivers/usb/serial/keyspan_usa26msg.h b/drivers/usb/serial/keyspan_usa26msg.h --- a/drivers/usb/serial/keyspan_usa26msg.h Sun Oct 5 00:33:08 2003 +++ b/drivers/usb/serial/keyspan_usa26msg.h Sun Oct 5 00:33:08 2003 @@ -4,7 +4,7 @@ Copyright (C) 1998-2000 InnoSys Incorporated. All Rights Reserved This file is available under a BSD-style copyright - Keyspan USB Async Firmware to run on Anchor EZ-USB + Keyspan USB Async Message Formats for the USA28X Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -19,11 +19,7 @@ This file is available under a BSD-style copyright - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of InnoSys Incorporated may not be used to endorse or promote + 2. The name of InnoSys Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. diff -Nru a/drivers/usb/serial/keyspan_usa28msg.h b/drivers/usb/serial/keyspan_usa28msg.h --- a/drivers/usb/serial/keyspan_usa28msg.h Sun Oct 5 00:33:06 2003 +++ b/drivers/usb/serial/keyspan_usa28msg.h Sun Oct 5 00:33:06 2003 @@ -4,7 +4,7 @@ Copyright (C) 1998-2000 InnoSys Incorporated. All Rights Reserved This file is available under a BSD-style copyright - Keyspan USB Async Firmware to run on Anchor EZ-USB + Keyspan USB Async Message Formats for the USA26X Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -19,11 +19,7 @@ This file is available under a BSD-style copyright - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of InnoSys Incorporated may not be used to endorse or promote + 2. The name of InnoSys Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. diff -Nru a/drivers/usb/serial/keyspan_usa49msg.h b/drivers/usb/serial/keyspan_usa49msg.h --- a/drivers/usb/serial/keyspan_usa49msg.h Sun Oct 5 00:33:07 2003 +++ b/drivers/usb/serial/keyspan_usa49msg.h Sun Oct 5 00:33:07 2003 @@ -4,7 +4,7 @@ Copyright (C) 1998-2000 InnoSys Incorporated. All Rights Reserved This file is available under a BSD-style copyright - Keyspan USB Async Firmware to run on Anchor EZ-USB + Keyspan USB Async Message Formats for the USA49W Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -19,11 +19,7 @@ This file is available under a BSD-style copyright - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The name of InnoSys Incorporated may not be used to endorse or promote + 2. The name of InnoSys Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. diff -Nru a/drivers/usb/serial/keyspan_usa90msg.h b/drivers/usb/serial/keyspan_usa90msg.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/usb/serial/keyspan_usa90msg.h Sun Oct 5 00:33:10 2003 @@ -0,0 +1,198 @@ +/* + usa90msg.h + + Copyright (c) 1998-2003 InnoSys Incorporated. All Rights Reserved + This file is available under a BSD-style copyright + + Keyspan USB Async Message Formats for the USA19HS + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain this licence text + without modification, this list of conditions, and the following + disclaimer. The following copyright notice must appear immediately at + the beginning of all source files: + + Copyright (c) 1998-2003 InnoSys Incorporated. All Rights Reserved + + This file is available under a BSD-style copyright + + 2. The name of InnoSys Incorprated may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``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 OR CONTRIBUTORS 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. + + Revisions: + + 2003feb14 add setTxMode/txMode and cancelRxXoff to portControl + 2003mar21 change name of PARITY_0/1 to add MARK/SPACE +*/ + +#ifndef __USA90MSG__ +#define __USA90MSG__ + +struct keyspan_usa90_portControlMessage +{ + /* + there are three types of "commands" sent in the control message: + + 1. configuration changes which must be requested by setting + the corresponding "set" flag (and should only be requested + when necessary, to reduce overhead on the device): + */ + + u8 setClocking, // host requests baud rate be set + baudLo, // host does baud divisor calculation + baudHi, // host does baud divisor calculation + + setLcr, // host requests lcr be set + lcr, // use PARITY, STOPBITS, DATABITS below + + setRxMode, // set receive mode + rxMode, // RXMODE_DMA or RXMODE_BYHAND + + setTxMode, // set transmit mode + txMode, // TXMODE_DMA or TXMODE_BYHAND + + setTxFlowControl, // host requests tx flow control be set + txFlowControl , // use TX_FLOW... bits below + setRxFlowControl, // host requests rx flow control be set + rxFlowControl, // use RX_FLOW... bits below + sendXoff, // host requests XOFF transmitted immediately + sendXon, // host requests XON char transmitted + xonChar, // specified in current character format + xoffChar, // specified in current character format + + sendChar, // host requests char transmitted immediately + txChar, // character to send + + setRts, // host requests RTS output be set + rts, // 1=on, 0=off + setDtr, // host requests DTR output be set + dtr; // 1=on, 0=off + + + /* + 2. configuration data which is simply used as is + and must be specified correctly in every host message. + */ + + u8 rxForwardingLength, // forward when this number of chars available + rxForwardingTimeout, // (1-31 in ms) + txAckSetting; // 0=don't ack, 1=normal, 2-255 TBD... + /* + 3. Firmware states which cause actions if they change + and must be specified correctly in every host message. + */ + + u8 portEnabled, // 0=disabled, 1=enabled + txFlush, // 0=normal, 1=toss outbound data + txBreak, // 0=break off, 1=break on + loopbackMode; // 0=no loopback, 1=loopback enabled + + /* + 4. commands which are flags only; these are processed in order + (so that, e.g., if rxFlush and rxForward flags are set, the + port will have no data to forward); any non-zero value + is respected + */ + + u8 rxFlush, // toss inbound data + rxForward, // forward all inbound data, NOW (as if fwdLen==1) + cancelRxXoff, // cancel any receive XOFF state (_txXoff) + returnStatus; // return current status NOW +}; + +// defines for bits in lcr +#define USA_DATABITS_5 0x00 +#define USA_DATABITS_6 0x01 +#define USA_DATABITS_7 0x02 +#define USA_DATABITS_8 0x03 +#define STOPBITS_5678_1 0x00 // 1 stop bit for all byte sizes +#define STOPBITS_5_1p5 0x04 // 1.5 stop bits for 5-bit byte +#define STOPBITS_678_2 0x04 // 2 stop bits for 6-8 bit byte +#define USA_PARITY_NONE 0x00 +#define USA_PARITY_ODD 0x08 +#define USA_PARITY_EVEN 0x18 +#define PARITY_MARK_1 0x28 // force parity MARK +#define PARITY_SPACE_0 0x38 // force parity SPACE + +#define TXFLOW_CTS 0x04 +#define TXFLOW_DSR 0x08 +#define TXFLOW_XOFF 0x01 +#define TXFLOW_XOFF_ANY 0x02 +#define TXFLOW_XOFF_BITS (TXFLOW_XOFF | TXFLOW_XOFF_ANY) + +#define RXFLOW_XOFF 0x10 +#define RXFLOW_RTS 0x20 +#define RXFLOW_DTR 0x40 +#define RXFLOW_DSR_SENSITIVITY 0x80 + +#define RXMODE_BYHAND 0x00 +#define RXMODE_DMA 0x02 + +#define TXMODE_BYHAND 0x00 +#define TXMODE_DMA 0x02 + + +// all things called "StatusMessage" are sent on the status endpoint + +struct keyspan_usa90_portStatusMessage +{ + u8 msr, // reports the actual MSR register + cts, // reports CTS pin + dcd, // reports DCD pin + dsr, // reports DSR pin + ri, // reports RI pin + _txXoff, // port is in XOFF state (we received XOFF) + rxBreak, // reports break state + rxOverrun, // count of overrun errors (since last reported) + rxParity, // count of parity errors (since last reported) + rxFrame, // count of frame errors (since last reported) + portState, // PORTSTATE_xxx bits (useful for debugging) + messageAck, // message acknowledgement + charAck, // character acknowledgement + controlResponse; // (value = returnStatus) a control message has been processed +}; + +// bits in RX data message when STAT byte is included + +#define RXERROR_OVERRUN 0x02 +#define RXERROR_PARITY 0x04 +#define RXERROR_FRAMING 0x08 +#define RXERROR_BREAK 0x10 + +#define PORTSTATE_ENABLED 0x80 +#define PORTSTATE_TXFLUSH 0x01 +#define PORTSTATE_TXBREAK 0x02 +#define PORTSTATE_LOOPBACK 0x04 + +// MSR bits + +#define MSR_dCTS 0x01 // CTS has changed since last report +#define MSR_dDSR 0x02 +#define MSR_dRI 0x04 +#define MSR_dDCD 0x08 + +#define MSR_CTS 0x10 // current state of CTS +#define MSR_DSR 0x20 +#define MSR_RI 0x40 +#define MSR_DCD 0x80 + +// ie: the maximum length of an endpoint buffer +#define MAX_DATA_LEN 64 + +#endif diff -Nru a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c --- a/drivers/usb/storage/freecom.c Sun Oct 5 00:33:10 2003 +++ b/drivers/usb/storage/freecom.c Sun Oct 5 00:33:10 2003 @@ -101,7 +101,8 @@ #define FCM_PACKET_IDE_READ 0xC0 /* All packets (except for status) are 64 bytes long. */ -#define FCM_PACKET_LENGTH 64 +#define FCM_PACKET_LENGTH 64 +#define FCM_STATUS_PACKET_LENGTH 4 static int freecom_readdata (Scsi_Cmnd *srb, struct us_data *us, @@ -216,7 +217,7 @@ /* There are times we can optimize out this status read, but it * doesn't hurt us to always do it now. */ result = usb_stor_bulk_transfer_buf (us, ipipe, fst, - FCM_PACKET_LENGTH, &partial); + FCM_STATUS_PACKET_LENGTH, &partial); US_DEBUGP("foo Status result %d %u\n", result, partial); if (result != USB_STOR_XFER_GOOD) return USB_STOR_TRANSPORT_ERROR; @@ -256,10 +257,10 @@ /* get the data */ result = usb_stor_bulk_transfer_buf (us, ipipe, fst, - FCM_PACKET_LENGTH, &partial); + FCM_STATUS_PACKET_LENGTH, &partial); US_DEBUGP("bar Status result %d %u\n", result, partial); - if (result > USB_STOR_XFER_SHORT) + if (result != USB_STOR_XFER_GOOD) return USB_STOR_TRANSPORT_ERROR; US_DEBUG(pdump ((void *) fst, partial)); @@ -302,6 +303,9 @@ switch (us->srb->sc_data_direction) { case SCSI_DATA_READ: + /* catch bogus "read 0 length" case */ + if (!length) + break; /* Make sure that the status indicates that the device * wants data as well. */ if ((fst->Status & DRQ_STAT) == 0 || (fst->Reason & 3) != 2) { @@ -331,6 +335,9 @@ break; case SCSI_DATA_WRITE: + /* catch bogus "write 0 length" case */ + if (!length) + break; /* Make sure the status indicates that the device wants to * send us data. */ /* !!IMPLEMENT!! */ @@ -362,6 +369,7 @@ break; default: + /* should never hit here -- filtered in usb.c */ US_DEBUGP ("freecom unimplemented direction: %d\n", us->srb->sc_data_direction); // Return fail, SCSI seems to handle this better. diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h --- a/drivers/usb/storage/unusual_devs.h Sun Oct 5 00:33:09 2003 +++ b/drivers/usb/storage/unusual_devs.h Sun Oct 5 00:33:09 2003 @@ -394,6 +394,12 @@ "Dimage F300", US_SC_SCSI, US_PR_BULK, NULL, 0 ), +/* Reported by Miguel A. Fosas */ +UNUSUAL_DEV( 0x0686, 0x4017, 0x0001, 0x0001, + "Minolta", + "DIMAGE E223", + US_SC_SCSI, US_PR_DEVICE, NULL, 0 ), + UNUSUAL_DEV( 0x0693, 0x0002, 0x0100, 0x0100, "Hagiwara", "FlashGate SmartMedia", @@ -542,7 +548,7 @@ * - They don't like the INQUIRY command. So we must handle this command * of the SCSI layer ourselves. */ -UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9009, +UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x5009, "Casio", "QV DigitalCamera", US_SC_8070, US_PR_CB, NULL, diff -Nru a/drivers/video/Kconfig b/drivers/video/Kconfig --- a/drivers/video/Kconfig Sun Oct 5 00:33:05 2003 +++ b/drivers/video/Kconfig Sun Oct 5 00:33:05 2003 @@ -188,19 +188,19 @@ otherwise say N. config FB_CYBER - tristate "Amiga CyberVision support" - depends on FB && ZORRO + tristate "Amiga CyberVision 64 support" + depends on FB && ZORRO && BROKEN help This enables support for the Cybervision 64 graphics card from Phase5. Please note that its use is not all that intuitive (i.e. if you have any questions, be sure to ask!). Say N unless you have a Cybervision 64 or plan to get one before you next recompile the kernel. Please note that this driver DOES NOT support the - Cybervision 64 3D card, as they use incompatible video chips. + Cybervision 64/3D card, as they use incompatible video chips. config FB_VIRGE - bool "Amiga CyberVision3D support " - depends on FB && ZORRO + bool "Amiga CyberVision 64/3D support " + depends on FB && ZORRO && BROKEN help This enables support for the Cybervision 64/3D graphics card from Phase5. Please note that its use is not all that intuitive (i.e. if @@ -210,8 +210,8 @@ Cybervision 64 card, as they use incompatible video chips. config FB_RETINAZ3 - tristate "Amiga RetinaZ3 support" - depends on FB && ZORRO + tristate "Amiga Retina Z3 support" + depends on FB && ZORRO && BROKEN help This enables support for the Retina Z3 graphics card. Say N unless you have a Retina Z3 or plan to get one before you next recompile @@ -226,7 +226,7 @@ config FB_ATARI bool "Atari native chipset support" - depends on FB && ATARI + depends on FB && ATARI && BROKEN help This is the frame buffer device driver for the builtin graphics chipset found in Ataris. @@ -367,7 +367,7 @@ config FB_SUN3 bool "Sun3 framebuffer support" - depends on FB && (SUN3 || SUN3X) + depends on FB && (SUN3 || SUN3X) && BROKEN config FB_BW2 bool "BWtwo support" diff -Nru a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c --- a/drivers/video/console/sticore.c Sun Oct 5 00:33:07 2003 +++ b/drivers/video/console/sticore.c Sun Oct 5 00:33:07 2003 @@ -988,7 +988,7 @@ if (!sti) { printk(KERN_WARNING "Unable to handle STI device '%s'\n", - pd->dev.name); + pci_name(pd)); return -ENODEV; } #endif /* CONFIG_PCI */ diff -Nru a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c --- a/drivers/video/pm3fb.c Sun Oct 5 00:33:07 2003 +++ b/drivers/video/pm3fb.c Sun Oct 5 00:33:07 2003 @@ -54,7 +54,6 @@ #include #include -#include #include #include #include diff -Nru a/drivers/video/sstfb.c b/drivers/video/sstfb.c --- a/drivers/video/sstfb.c Sun Oct 5 00:33:09 2003 +++ b/drivers/video/sstfb.c Sun Oct 5 00:33:09 2003 @@ -94,7 +94,6 @@ #include #include #include -#include #include #include #include diff -Nru a/drivers/video/stifb.c b/drivers/video/stifb.c --- a/drivers/video/stifb.c Sun Oct 5 00:33:10 2003 +++ b/drivers/video/stifb.c Sun Oct 5 00:33:10 2003 @@ -1238,7 +1238,7 @@ /* get framebuffer physical and virtual base addr & len (64bit ready) */ - fix->smem_start = fb->sti->regions_phys[1] | 0xffffffff00000000; + fix->smem_start = F_EXTEND(fb->sti->regions_phys[1]); fix->smem_len = fb->sti->regions[1].region_desc.length * 4096; fix->line_length = (fb->sti->glob_cfg->total_x * bpp) / 8; diff -Nru a/fs/Kconfig b/fs/Kconfig --- a/fs/Kconfig Sun Oct 5 00:33:08 2003 +++ b/fs/Kconfig Sun Oct 5 00:33:08 2003 @@ -874,6 +874,7 @@ config HUGETLBFS bool "HugeTLB file system support" + depends X86 || IA64 || PPC64 || SPARC64 || X86_64 || BROKEN config HUGETLB_PAGE def_bool HUGETLBFS @@ -1254,6 +1255,8 @@ config NFS_FS tristate "NFS file system support" depends on INET + select LOCKD + select SUNRPC help If you are connected to some other (usually local) Unix computer (using SLIP, PLIP, PPP or Ethernet) and want to mount files residing @@ -1309,6 +1312,8 @@ config NFSD tristate "NFS server support" depends on INET + select LOCKD + select SUNRPC help If you want your Linux box to act as an NFS *server*, so that other computers on your local network which support NFS can access certain @@ -1371,8 +1376,6 @@ config LOCKD tristate - default m if NFS_FS!=y && NFSD!=y && (NFS_FS=m || NFSD=m) - default y if NFS_FS=y || NFSD=y config LOCKD_V4 bool @@ -1385,8 +1388,6 @@ config SUNRPC tristate - default m if NFS_FS!=y && NFSD!=y && (NFS_FS=m || NFSD=m) - default y if NFS_FS=y || NFSD=y config SUNRPC_GSS tristate "Provide RPCSEC_GSS authentication (EXPERIMENTAL)" @@ -1565,6 +1566,7 @@ # for fs/nls/Config.in tristate "Andrew File System support (AFS) (Experimental)" depends on INET && EXPERIMENTAL + select RXRPC help If you say Y here, you will get an experimental Andrew File System driver. It currently only supports unsecured read-only AFS access. @@ -1575,8 +1577,6 @@ config RXRPC tristate - default m if AFS_FS=m - default y if AFS_FS=y endmenu diff -Nru a/fs/adfs/super.c b/fs/adfs/super.c --- a/fs/adfs/super.c Sun Oct 5 00:33:05 2003 +++ b/fs/adfs/super.c Sun Oct 5 00:33:05 2003 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -133,50 +134,56 @@ sb->s_fs_info = NULL; } +enum {Opt_uid, Opt_gid, Opt_ownmask, Opt_othmask, Opt_err}; + +static match_table_t tokens = { + {Opt_uid, "uid=%u"}, + {Opt_gid, "gid=%u"}, + {Opt_ownmask, "ownmask=%o"}, + {Opt_othmask, "othmask=%o"}, + {Opt_err, NULL} +}; + static int parse_options(struct super_block *sb, char *options) { - char *value, *opt; + char *p; struct adfs_sb_info *asb = ADFS_SB(sb); + int option; if (!options) return 0; - while ((opt = strsep(&options, ",")) != NULL) { - if (!*opt) + while ((p = strsep(&options, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; + if (!*p) continue; - value = strchr(opt, '='); - if (value) - *value++ = '\0'; - if (!strcmp(opt, "uid")) { /* owner of all files */ - if (!value || !*value) - return -EINVAL; - asb->s_uid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } else - if (!strcmp(opt, "gid")) { /* group owner of all files */ - if (!value || !*value) - return -EINVAL; - asb->s_gid = simple_strtoul(value, &value, 0); - if (*value) - return -EINVAL; - } else - if (!strcmp(opt, "ownmask")) { /* owner permission mask */ - if (!value || !*value) - return -EINVAL; - asb->s_owner_mask = simple_strtoul(value, &value, 8); - if (*value) - return -EINVAL; - } else - if (!strcmp(opt, "othmask")) { /* others permission mask */ - if (!value || !*value) - return -EINVAL; - asb->s_other_mask = simple_strtoul(value, &value, 8); - if (*value) - return -EINVAL; - } else { /* eh? say again. */ - printk("ADFS-fs: unrecognised mount option %s\n", opt); + token = match_token(p, tokens, args); + switch (token) { + case Opt_uid: + if (match_int(args, &option)) + return -EINVAL; + asb->s_uid = option; + break; + case Opt_gid: + if (match_int(args, &option)) + return -EINVAL; + asb->s_gid = option; + break; + case Opt_ownmask: + if (match_octal(args, &option)) + return -EINVAL; + asb->s_owner_mask = option; + break; + case Opt_othmask: + if (match_octal(args, &option)) + return -EINVAL; + asb->s_other_mask = option; + break; + default: + printk("ADFS-fs: unrecognised mount option \"%s\" " + "or missing value\n", p); return -EINVAL; } } diff -Nru a/fs/affs/file.c b/fs/affs/file.c --- a/fs/affs/file.c Sun Oct 5 00:33:08 2003 +++ b/fs/affs/file.c Sun Oct 5 00:33:08 2003 @@ -39,7 +39,7 @@ static struct buffer_head *affs_alloc_extblock(struct inode *inode, struct buffer_head *bh, u32 ext); static inline struct buffer_head *affs_get_extblock(struct inode *inode, u32 ext); static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext); -static ssize_t affs_file_write(struct file *filp, const char *buf, size_t count, loff_t *ppos); +static ssize_t affs_file_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos); static int affs_file_open(struct inode *inode, struct file *filp); static int affs_file_release(struct inode *inode, struct file *filp); @@ -491,7 +491,8 @@ } static ssize_t -affs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +affs_file_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) { ssize_t retval; diff -Nru a/fs/affs/super.c b/fs/affs/super.c --- a/fs/affs/super.c Sun Oct 5 00:33:09 2003 +++ b/fs/affs/super.c Sun Oct 5 00:33:09 2003 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -142,12 +143,37 @@ .remount_fs = affs_remount, }; +enum { + Opt_bs, Opt_mode, Opt_mufs, Opt_prefix, Opt_protect, + Opt_reserved, Opt_root, Opt_setgid, Opt_setuid, + Opt_verbose, Opt_volume, Opt_ignore, Opt_err, +}; + +static match_table_t tokens = { + {Opt_bs, "bs=%d"}, + {Opt_mode, "mode=%o"}, + {Opt_mufs, "mufs"}, + {Opt_prefix, "prefix=%s"}, + {Opt_protect, "protect"}, + {Opt_reserved, "reserved=%d"}, + {Opt_root, "root=%d"}, + {Opt_setgid, "setgid=%d"}, + {Opt_setuid, "setuid=%d"}, + {Opt_verbose, "verbose"}, + {Opt_volume, "volume=%s"}, + {Opt_ignore, "grpquota"}, + {Opt_ignore, "noquota"}, + {Opt_ignore, "quota"}, + {Opt_ignore, "usrquota"}, + {Opt_err, NULL}, +}; + static int parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s32 *root, int *blocksize, char **prefix, char *volume, unsigned long *mount_opts) { - char *this_char, *value, *optn; - int f; + char *p; + substring_t args[MAX_OPT_ARGS]; /* Fill in defaults */ @@ -161,109 +187,85 @@ *mount_opts = 0; if (!options) return 1; - while ((this_char = strsep(&options, ",")) != NULL) { - if (!*this_char) + + while ((p = strsep(&options, ",")) != NULL) { + int token, n, option; + if (!*p) continue; - f = 0; - if ((value = strchr(this_char,'=')) != NULL) - *value++ = 0; - if ((optn = "protect") && !strcmp(this_char, optn)) { - if (value) - goto out_inv_arg; - *mount_opts |= SF_IMMUTABLE; - } else if ((optn = "verbose") && !strcmp(this_char, optn)) { - if (value) - goto out_inv_arg; - *mount_opts |= SF_VERBOSE; - } else if ((optn = "mufs") && !strcmp(this_char, optn)) { - if (value) - goto out_inv_arg; - *mount_opts |= SF_MUFS; - } else if ((f = !strcmp(this_char,"setuid")) || !strcmp(this_char,"setgid")) { - if (value) { - if (!*value) { - printk("AFFS: Argument for set[ug]id option missing\n"); - return 0; - } else { - (f ? *uid : *gid) = simple_strtoul(value,&value,0); - if (*value) { - printk("AFFS: Bad set[ug]id argument\n"); - return 0; - } - *mount_opts |= f ? SF_SETUID : SF_SETGID; - } + + token = match_token(p, tokens, args); + switch (token) { + case Opt_bs: + if (match_int(&args[0], &n)) + return -EINVAL; + if (n != 512 && n != 1024 && n != 2048 + && n != 4096) { + printk ("AFFS: Invalid blocksize (512, 1024, 2048, 4096 allowed)\n"); + return 0; } - } else if (!strcmp(this_char,"prefix")) { - optn = "prefix"; - if (!value || !*value) - goto out_no_arg; + *blocksize = n; + break; + case Opt_mode: + if (match_octal(&args[0], &option)) + return 1; + *mode = option & 0777; + *mount_opts |= SF_SETMODE; + break; + case Opt_mufs: + *mount_opts |= SF_MUFS; + break; + case Opt_prefix: if (*prefix) { /* Free any previous prefix */ kfree(*prefix); *prefix = NULL; } - *prefix = kmalloc(strlen(value) + 1,GFP_KERNEL); + *prefix = match_strdup(&args[0]); if (!*prefix) return 0; - strcpy(*prefix,value); *mount_opts |= SF_PREFIX; - } else if (!strcmp(this_char,"volume")) { - optn = "volume"; - if (!value || !*value) - goto out_no_arg; - strlcpy(volume,value,31); - } else if (!strcmp(this_char,"mode")) { - optn = "mode"; - if (!value || !*value) - goto out_no_arg; - *mode = simple_strtoul(value,&value,8) & 0777; - if (*value) - return 0; - *mount_opts |= SF_SETMODE; - } else if (!strcmp(this_char,"reserved")) { - optn = "reserved"; - if (!value || !*value) - goto out_no_arg; - *reserved = simple_strtoul(value,&value,0); - if (*value) - return 0; - } else if (!strcmp(this_char,"root")) { - optn = "root"; - if (!value || !*value) - goto out_no_arg; - *root = simple_strtoul(value,&value,0); - if (*value) - return 0; - } else if (!strcmp(this_char,"bs")) { - optn = "bs"; - if (!value || !*value) - goto out_no_arg; - *blocksize = simple_strtoul(value,&value,0); - if (*value) - return 0; - if (*blocksize != 512 && *blocksize != 1024 && *blocksize != 2048 - && *blocksize != 4096) { - printk ("AFFS: Invalid blocksize (512, 1024, 2048, 4096 allowed)\n"); - return 0; - } - } else if (!strcmp (this_char, "grpquota") - || !strcmp (this_char, "noquota") - || !strcmp (this_char, "quota") - || !strcmp (this_char, "usrquota")) - /* Silently ignore the quota options */ - ; - else { - printk("AFFS: Unrecognized mount option %s\n", this_char); + break; + case Opt_protect: + *mount_opts |= SF_IMMUTABLE; + break; + case Opt_reserved: + if (match_int(&args[0], reserved)) + return 1; + break; + case Opt_root: + if (match_int(&args[0], root)) + return 1; + break; + case Opt_setgid: + if (match_int(&args[0], &option)) + return 1; + *gid = option; + *mount_opts |= SF_SETGID; + break; + case Opt_setuid: + if (match_int(&args[0], &option)) + return -EINVAL; + *uid = option; + *mount_opts |= SF_SETUID; + break; + case Opt_verbose: + *mount_opts |= SF_VERBOSE; + break; + case Opt_volume: { + char *vol = match_strdup(&args[0]); + strlcpy(volume, vol, 32); + kfree(vol); + break; + } + case Opt_ignore: + /* Silently ignore the quota options */ + break; + default: + printk("AFFS: Unrecognized mount option \"%s\" " + "or missing value\n", p); return 0; } } return 1; - -out_no_arg: - printk("AFFS: The %s option requires an argument\n", optn); - return 0; -out_inv_arg: - printk("AFFS: Option %s does not take an argument\n", optn); - return 0; } /* This function definitely needs to be split up. Some fine day I'll diff -Nru a/fs/autofs/inode.c b/fs/autofs/inode.c --- a/fs/autofs/inode.c Sun Oct 5 00:33:09 2003 +++ b/fs/autofs/inode.c Sun Oct 5 00:33:09 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "autofs_i.h" #include @@ -45,10 +46,24 @@ .statfs = simple_statfs, }; +enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto}; + +static match_table_t autofs_tokens = { + {Opt_fd, "fd=%d"}, + {Opt_uid, "uid=%d"}, + {Opt_gid, "gid=%d"}, + {Opt_pgrp, "pgrp=%d"}, + {Opt_minproto, "minproto=%d"}, + {Opt_maxproto, "maxproto=%d"}, + {Opt_err, NULL} +}; + static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto) { - char *this_char, *value; - + char *p; + substring_t args[MAX_OPT_ARGS]; + int option; + *uid = current->uid; *gid = current->gid; *pgrp = process_group(current); @@ -57,55 +72,49 @@ *pipefd = -1; - if ( !options ) return 1; - while ((this_char = strsep(&options,",")) != NULL) { - if (!*this_char) + if (!options) + return 1; + + while ((p = strsep(&options, ",")) != NULL) { + int token; + if (!*p) continue; - if ((value = strchr(this_char,'=')) != NULL) - *value++ = 0; - if (!strcmp(this_char,"fd")) { - if (!value || !*value) - return 1; - *pipefd = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"uid")) { - if (!value || !*value) - return 1; - *uid = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"gid")) { - if (!value || !*value) - return 1; - *gid = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"pgrp")) { - if (!value || !*value) - return 1; - *pgrp = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"minproto")) { - if (!value || !*value) - return 1; - *minproto = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"maxproto")) { - if (!value || !*value) - return 1; - *maxproto = simple_strtoul(value,&value,0); - if (*value) - return 1; + + token = match_token(p, autofs_tokens, args); + switch (token) { + case Opt_fd: + if (match_int(&args[0], &option)) + return 1; + *pipefd = option; + break; + case Opt_uid: + if (match_int(&args[0], &option)) + return 1; + *uid = option; + break; + case Opt_gid: + if (match_int(&args[0], &option)) + return 1; + *gid = option; + break; + case Opt_pgrp: + if (match_int(&args[0], &option)) + return 1; + *pgrp = option; + break; + case Opt_minproto: + if (match_int(&args[0], &option)) + return 1; + *minproto = option; + break; + case Opt_maxproto: + if (match_int(&args[0], &option)) + return 1; + *maxproto = option; + break; + default: + return 1; } - else break; } return (*pipefd < 0); } diff -Nru a/fs/autofs4/inode.c b/fs/autofs4/inode.c --- a/fs/autofs4/inode.c Sun Oct 5 00:33:09 2003 +++ b/fs/autofs4/inode.c Sun Oct 5 00:33:09 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "autofs_i.h" #include @@ -94,11 +95,25 @@ .statfs = simple_statfs, }; +enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto}; + +static match_table_t tokens = { + {Opt_fd, "fd=%d"}, + {Opt_uid, "uid=%d"}, + {Opt_gid, "gid=%d"}, + {Opt_pgrp, "pgrp=%d"}, + {Opt_minproto, "minproto=%d"}, + {Opt_maxproto, "maxproto=%d"}, + {Opt_err, NULL} +}; + static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid_t *pgrp, int *minproto, int *maxproto) { - char *this_char, *value; - + char *p; + substring_t args[MAX_OPT_ARGS]; + int option; + *uid = current->uid; *gid = current->gid; *pgrp = process_group(current); @@ -108,55 +123,48 @@ *pipefd = -1; - if ( !options ) return 1; - while ((this_char = strsep(&options,",")) != NULL) { - if (!*this_char) + if (!options) + return 1; + + while ((p = strsep(&options, ",")) != NULL) { + int token; + if (!*p) continue; - if ((value = strchr(this_char,'=')) != NULL) - *value++ = 0; - if (!strcmp(this_char,"fd")) { - if (!value || !*value) - return 1; - *pipefd = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"uid")) { - if (!value || !*value) - return 1; - *uid = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"gid")) { - if (!value || !*value) - return 1; - *gid = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"pgrp")) { - if (!value || !*value) - return 1; - *pgrp = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"minproto")) { - if (!value || !*value) - return 1; - *minproto = simple_strtoul(value,&value,0); - if (*value) - return 1; - } - else if (!strcmp(this_char,"maxproto")) { - if (!value || !*value) - return 1; - *maxproto = simple_strtoul(value,&value,0); - if (*value) - return 1; + + token = match_token(p, tokens, args); + switch (token) { + case Opt_fd: + if (match_int(args, pipefd)) + return 1; + break; + case Opt_uid: + if (match_int(args, &option)) + return 1; + *uid = option; + break; + case Opt_gid: + if (match_int(args, &option)) + return 1; + *gid = option; + break; + case Opt_pgrp: + if (match_int(args, &option)) + return 1; + *pgrp = option; + break; + case Opt_minproto: + if (match_int(args, &option)) + return 1; + *minproto = option; + break; + case Opt_maxproto: + if (match_int(args, &option)) + return 1; + *maxproto = option; + break; + default: + return 1; } - else break; } return (*pipefd < 0); } diff -Nru a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c --- a/fs/befs/linuxvfs.c Sun Oct 5 00:33:08 2003 +++ b/fs/befs/linuxvfs.c Sun Oct 5 00:33:08 2003 @@ -13,6 +13,7 @@ #include #include #include +#include #include "befs.h" #include "btree.h" @@ -39,7 +40,7 @@ static void befs_destroy_inode(struct inode *inode); static int befs_init_inodecache(void); static void befs_destroy_inodecache(void); -static int befs_readlink(struct dentry *, char *, int); +static int befs_readlink(struct dentry *, char __user *, int); static int befs_follow_link(struct dentry *, struct nameidata *nd); static int befs_utf2nls(struct super_block *sb, const char *in, int in_len, char **out, int *out_len); @@ -494,7 +495,7 @@ } static int -befs_readlink(struct dentry *dentry, char *buffer, int buflen) +befs_readlink(struct dentry *dentry, char __user *buffer, int buflen) { struct super_block *sb = dentry->d_sb; befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); @@ -667,12 +668,27 @@ return -EILSEQ; } +/** + * Use the + * + */ +enum { + Opt_uid, Opt_gid, Opt_charset, Opt_debug, +}; + +static match_table_t befs_tokens = { + {Opt_uid, "uid=%d"}, + {Opt_gid, "gid=%d"}, + {Opt_charset, "iocharset=%s"}, + {Opt_debug, "debug"} +}; + static int parse_options(char *options, befs_mount_options * opts) { - char *this_char; - char *value; - int ret = 1; + char *p; + substring_t args[MAX_OPT_ARGS]; + int option; /* Initialize options */ opts->uid = 0; @@ -683,64 +699,56 @@ opts->debug = 0; if (!options) - return ret; - - while ((this_char = strsep(&options, ",")) != NULL) { + return 1; - if ((value = strchr(this_char, '=')) != NULL) - *value++ = 0; - - if (!strcmp(this_char, "uid")) { - if (!value || !*value) { - ret = 0; - } else { - opts->uid = simple_strtoul(value, &value, 0); - opts->use_uid = 1; - if (*value) { - printk(KERN_ERR "BEFS: Invalid uid " - "option: %s\n", value); - ret = 0; - } + while ((p = strsep(&options, ",")) != NULL) { + int token; + if (!*p) + continue; + + token = match_token(p, befs_tokens, args); + switch (token) { + case Opt_uid: + if (match_int(&args[0], &option)) + return 0; + if (option < 0) { + printk(KERN_ERR "BeFS: Invalid uid %d, " + "using default\n", option); + break; } - } else if (!strcmp(this_char, "gid")) { - if (!value || !*value) - ret = 0; - else { - opts->gid = simple_strtoul(value, &value, 0); - opts->use_gid = 1; - if (*value) { - printk(KERN_ERR - "BEFS: Invalid gid option: " - "%s\n", value); - ret = 0; - } + opts->uid = option; + opts->use_uid = 1; + break; + case Opt_gid: + if (match_int(&args[0], &option)) + return 0; + if (option < 0) { + printk(KERN_ERR "BeFS: Invalid gid %d, " + "using default\n", option); + break; } - } else if (!strcmp(this_char, "iocharset") && value) { - char *p = value; - int len; - - while (*value && *value != ',') - value++; - len = value - p; - if (len) { - char *buffer = kmalloc(len + 1, GFP_NOFS); - if (buffer) { - opts->iocharset = buffer; - memcpy(buffer, p, len); - buffer[len] = 0; - - } else { - printk(KERN_ERR "BEFS: " - "cannot allocate memory\n"); - ret = 0; - } + opts->gid = option; + opts->use_gid = 1; + break; + case Opt_charset: + kfree(opts->iocharset); + opts->iocharset = match_strdup(&args[0]); + if (!opts->iocharset) { + printk(KERN_ERR "BeFS: allocation failure for " + "iocharset string\n"); + return 0; } - } else if (!strcmp(this_char, "debug")) { + break; + case Opt_debug: opts->debug = 1; + break; + default: + printk(KERN_ERR "BeFS: Unrecognized mount option \"%s\" " + "or missing value\n", p); + return 0; } } - - return ret; + return 1; } /* This function has the responsibiltiy of getting the @@ -939,9 +947,19 @@ err = befs_init_inodecache(); if (err) - return err; + goto unaquire_none; + + err = register_filesystem(&befs_fs_type); + if (err) + goto unaquire_inodecache; + + return 0; + +unaquire_inodecache: + befs_destroy_inodecache(); - return register_filesystem(&befs_fs_type); +unaquire_none: + return err; } static void __exit diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c --- a/fs/binfmt_elf.c Sun Oct 5 00:33:08 2003 +++ b/fs/binfmt_elf.c Sun Oct 5 00:33:08 2003 @@ -134,7 +134,7 @@ elf_addr_t *sp, *u_platform; const char *k_platform = ELF_PLATFORM; int items; - elf_addr_t elf_info[40]; + elf_addr_t *elf_info; int ei_index = 0; struct task_struct *tsk = current; @@ -169,6 +169,7 @@ } /* Create the ELF interpreter info */ + elf_info = (elf_addr_t *) current->mm->saved_auxv; #define NEW_AUX_ENT(id, val) \ do { elf_info[ei_index++] = id; elf_info[ei_index++] = val; } while (0) @@ -196,8 +197,13 @@ if (k_platform) { NEW_AUX_ENT(AT_PLATFORM, (elf_addr_t)(long)u_platform); } - NEW_AUX_ENT(AT_NULL, 0); #undef NEW_AUX_ENT + /* AT_NULL is zero; clear the rest too */ + memset(&elf_info[ei_index], 0, + sizeof current->mm->saved_auxv - ei_index * sizeof elf_info[0]); + + /* And advance past the AT_NULL entry. */ + ei_index += 2; sp = STACK_ADD(p, ei_index); @@ -1186,7 +1192,7 @@ */ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file) { -#define NUM_NOTES 5 +#define NUM_NOTES 6 int has_dumped = 0; mm_segment_t fs; int segs; @@ -1196,7 +1202,7 @@ struct elfhdr *elf = NULL; off_t offset = 0, dataoff; unsigned long limit = current->rlim[RLIMIT_CORE].rlim_cur; - int numnote = NUM_NOTES; + int numnote; struct memelfnote *notes = NULL; struct elf_prstatus *prstatus = NULL; /* NT_PRSTATUS */ struct elf_prpsinfo *psinfo = NULL; /* NT_PRPSINFO */ @@ -1208,6 +1214,7 @@ elf_fpxregset_t *xfpu = NULL; #endif int thread_status_size = 0; + elf_addr_t *auxv; /* * We no longer stop all VM operations. @@ -1287,18 +1294,25 @@ fill_note(notes +2, "CORE", NT_TASKSTRUCT, sizeof(*current), current); + numnote = 3; + + auxv = (elf_addr_t *) current->mm->saved_auxv; + + i = 0; + do + i += 2; + while (auxv[i - 2] != AT_NULL); + fill_note(¬es[numnote++], "CORE", NT_AUXV, + i * sizeof (elf_addr_t), auxv); + /* Try to dump the FPU. */ if ((prstatus->pr_fpvalid = elf_core_copy_task_fpregs(current, regs, fpu))) - fill_note(notes +3, "CORE", NT_PRFPREG, sizeof(*fpu), fpu); - else - --numnote; + fill_note(notes + numnote++, + "CORE", NT_PRFPREG, sizeof(*fpu), fpu); #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) - fill_note(notes +4, "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); - else - --numnote; -#else - numnote--; + fill_note(notes + numnote++, + "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); #endif fs = get_fs(); diff -Nru a/fs/block_dev.c b/fs/block_dev.c --- a/fs/block_dev.c Sun Oct 5 00:33:10 2003 +++ b/fs/block_dev.c Sun Oct 5 00:33:10 2003 @@ -70,6 +70,8 @@ return 0; } +EXPORT_SYMBOL(set_blocksize); + int sb_set_blocksize(struct super_block *sb, int size) { int bits; @@ -82,6 +84,8 @@ return sb->s_blocksize; } +EXPORT_SYMBOL(sb_set_blocksize); + int sb_min_blocksize(struct super_block *sb, int size) { int minsize = bdev_hardsect_size(sb->s_bdev); @@ -90,6 +94,8 @@ return sb_set_blocksize(sb, size); } +EXPORT_SYMBOL(sb_min_blocksize); + static int blkdev_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh, int create) @@ -358,6 +364,8 @@ return bdev; } +EXPORT_SYMBOL(bdget); + long nr_blockdev_pages(void) { struct list_head *p; @@ -376,6 +384,8 @@ { iput(bdev->bd_inode); } + +EXPORT_SYMBOL(bdput); int bd_acquire(struct inode *inode) { @@ -444,6 +454,8 @@ return res; } +EXPORT_SYMBOL(bd_claim); + void bd_release(struct block_device *bdev) { spin_lock(&bdev_lock); @@ -454,6 +466,8 @@ spin_unlock(&bdev_lock); } +EXPORT_SYMBOL(bd_release); + /* * Tries to open block device by device number. Use it ONLY if you * really do not have anything better - i.e. when you are behind a @@ -471,6 +485,8 @@ return err ? ERR_PTR(err) : bdev; } +EXPORT_SYMBOL(open_by_devnum); + /* * This routine checks whether a removable media has been changed, * and invalidates all buffer-cache-entries in that case. This @@ -500,6 +516,8 @@ return 1; } +EXPORT_SYMBOL(check_disk_change); + static void bd_set_size(struct block_device *bdev, loff_t size) { unsigned bsize = bdev_hardsect_size(bdev); @@ -632,6 +650,8 @@ return do_open(bdev, bdev->bd_inode, &fake_file); } +EXPORT_SYMBOL(blkdev_get); + int blkdev_open(struct inode * inode, struct file * filp) { struct block_device *bdev; @@ -662,6 +682,8 @@ return res; } +EXPORT_SYMBOL(blkdev_open); + int blkdev_put(struct block_device *bdev, int kind) { int ret = 0; @@ -710,6 +732,8 @@ return ret; } +EXPORT_SYMBOL(blkdev_put); + int blkdev_close(struct inode * inode, struct file * filp) { if (inode->i_bdev->bd_holder == filp) @@ -760,6 +784,8 @@ .sendfile = generic_file_sendfile, }; +EXPORT_SYMBOL(def_blk_fops); + int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg) { int res; @@ -770,6 +796,8 @@ return res; } +EXPORT_SYMBOL(ioctl_by_bdev); + /** * lookup_bdev - lookup a struct block_device by name * @@ -854,6 +882,8 @@ return ERR_PTR(error); } +EXPORT_SYMBOL(open_bdev_excl); + /** * close_bdev_excl - release a blockdevice openen by open_bdev_excl() * @@ -867,3 +897,5 @@ bd_release(bdev); blkdev_put(bdev, kind); } + +EXPORT_SYMBOL(close_bdev_excl); diff -Nru a/fs/buffer.c b/fs/buffer.c --- a/fs/buffer.c Sun Oct 5 00:33:08 2003 +++ b/fs/buffer.c Sun Oct 5 00:33:08 2003 @@ -3035,3 +3035,31 @@ (void *)(long)smp_processor_id()); register_cpu_notifier(&buffer_nb); } + +EXPORT_SYMBOL(__bforget); +EXPORT_SYMBOL(__brelse); +EXPORT_SYMBOL(__wait_on_buffer); +EXPORT_SYMBOL(block_commit_write); +EXPORT_SYMBOL(block_prepare_write); +EXPORT_SYMBOL(block_read_full_page); +EXPORT_SYMBOL(block_sync_page); +EXPORT_SYMBOL(block_truncate_page); +EXPORT_SYMBOL(block_write_full_page); +EXPORT_SYMBOL(buffer_insert_list); +EXPORT_SYMBOL(cont_prepare_write); +EXPORT_SYMBOL(end_buffer_async_write); +EXPORT_SYMBOL(end_buffer_read_sync); +EXPORT_SYMBOL(end_buffer_write_sync); +EXPORT_SYMBOL(file_fsync); +EXPORT_SYMBOL(fsync_bdev); +EXPORT_SYMBOL(fsync_buffers_list); +EXPORT_SYMBOL(generic_block_bmap); +EXPORT_SYMBOL(generic_commit_write); +EXPORT_SYMBOL(generic_cont_expand); +EXPORT_SYMBOL(init_buffer); +EXPORT_SYMBOL(invalidate_bdev); +EXPORT_SYMBOL(ll_rw_block); +EXPORT_SYMBOL(mark_buffer_dirty); +EXPORT_SYMBOL(submit_bh); +EXPORT_SYMBOL(sync_dirty_buffer); +EXPORT_SYMBOL(unlock_buffer); diff -Nru a/fs/compat_ioctl.c b/fs/compat_ioctl.c --- a/fs/compat_ioctl.c Sun Oct 5 00:33:10 2003 +++ b/fs/compat_ioctl.c Sun Oct 5 00:33:10 2003 @@ -576,54 +576,45 @@ static int bond_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg) { - struct ifreq ifr; + struct ifreq kifr; + struct ifreq *uifr; + struct ifreq32 *ifr32 = (struct ifreq32 *) arg; mm_segment_t old_fs; - int err, len; + int err; u32 data; - - if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) - return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); - if (!ifr.ifr_data) - return -EAGAIN; + void *datap; switch (cmd) { case SIOCBONDENSLAVE: case SIOCBONDRELEASE: case SIOCBONDSETHWADDR: case SIOCBONDCHANGEACTIVE: - len = IFNAMSIZ * sizeof(char); - break; + if (copy_from_user(&kifr, ifr32, sizeof(struct ifreq32))) + return -EFAULT; + + old_fs = get_fs(); + set_fs (KERNEL_DS); + err = sys_ioctl (fd, cmd, (unsigned long)&kifr); + set_fs (old_fs); + + return err; case SIOCBONDSLAVEINFOQUERY: - len = sizeof(struct ifslave); - break; case SIOCBONDINFOQUERY: - len = sizeof(struct ifbond); - break; - default: - err = -EINVAL; - goto out; - }; + uifr = compat_alloc_user_space(sizeof(*uifr)); + if (copy_in_user(&uifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ)) + return -EFAULT; - __get_user(data, &(((struct ifreq32 *)arg)->ifr_ifru.ifru_data)); - if (copy_from_user(ifr.ifr_data, compat_ptr(data), len)) { - err = -EFAULT; - goto out; - } + if (get_user(data, &ifr32->ifr_ifru.ifru_data)) + return -EFAULT; - old_fs = get_fs(); - set_fs (KERNEL_DS); - err = sys_ioctl (fd, cmd, (unsigned long)&ifr); - set_fs (old_fs); - if (!err) { - len = copy_to_user(compat_ptr(data), ifr.ifr_data, len); - if (len) - err = -EFAULT; - } + datap = compat_ptr(data); + if (put_user(datap, &uifr->ifr_ifru.ifru_data)) + return -EFAULT; -out: - free_page((unsigned long)ifr.ifr_data); - return err; + return sys_ioctl (fd, cmd, (unsigned long)uifr); + default: + return -EINVAL; + }; } int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) @@ -1035,6 +1026,7 @@ return -EFAULT; } + sgio->dxferp = iov; return 0; } diff -Nru a/fs/dcache.c b/fs/dcache.c --- a/fs/dcache.c Sun Oct 5 00:33:06 2003 +++ b/fs/dcache.c Sun Oct 5 00:33:06 2003 @@ -1639,3 +1639,27 @@ bdev_cache_init(); chrdev_init(); } + +EXPORT_SYMBOL(d_alloc); +EXPORT_SYMBOL(d_alloc_anon); +EXPORT_SYMBOL(d_alloc_root); +EXPORT_SYMBOL(d_delete); +EXPORT_SYMBOL(d_find_alias); +EXPORT_SYMBOL(d_instantiate); +EXPORT_SYMBOL(d_invalidate); +EXPORT_SYMBOL(d_lookup); +EXPORT_SYMBOL(d_move); +EXPORT_SYMBOL(d_path); +EXPORT_SYMBOL(d_prune_aliases); +EXPORT_SYMBOL(d_rehash); +EXPORT_SYMBOL(d_splice_alias); +EXPORT_SYMBOL(d_validate); +EXPORT_SYMBOL(dget_locked); +EXPORT_SYMBOL(dput); +EXPORT_SYMBOL(find_inode_number); +EXPORT_SYMBOL(have_submounts); +EXPORT_SYMBOL(is_subdir); +EXPORT_SYMBOL(names_cachep); +EXPORT_SYMBOL(shrink_dcache_anon); +EXPORT_SYMBOL(shrink_dcache_parent); +EXPORT_SYMBOL(shrink_dcache_sb); diff -Nru a/fs/efs/super.c b/fs/efs/super.c --- a/fs/efs/super.c Sun Oct 5 00:33:09 2003 +++ b/fs/efs/super.c Sun Oct 5 00:33:09 2003 @@ -218,7 +218,11 @@ memset(sb, 0, sizeof(struct efs_sb_info)); s->s_magic = EFS_SUPER_MAGIC; - sb_set_blocksize(s, EFS_BLOCKSIZE); + if (!sb_set_blocksize(s, EFS_BLOCKSIZE)) { + printk(KERN_ERR "EFS: device does not support %d byte blocks\n", + EFS_BLOCKSIZE); + goto out_no_fs_ul; + } /* read the vh (volume header) block */ bh = sb_bread(s, 0); diff -Nru a/fs/exec.c b/fs/exec.c --- a/fs/exec.c Sun Oct 5 00:33:08 2003 +++ b/fs/exec.c Sun Oct 5 00:33:08 2003 @@ -83,6 +83,8 @@ return 0; } +EXPORT_SYMBOL(register_binfmt); + int unregister_binfmt(struct linux_binfmt * fmt) { struct linux_binfmt ** tmp = &formats; @@ -100,6 +102,8 @@ return -EINVAL; } +EXPORT_SYMBOL(unregister_binfmt); + static inline void put_binfmt(struct linux_binfmt * fmt) { module_put(fmt->module); @@ -281,6 +285,8 @@ return r; } +EXPORT_SYMBOL(copy_strings_kernel); + #ifdef CONFIG_MMU /* * This routine is used to map in a page into an address space: needed by @@ -443,6 +449,8 @@ return 0; } +EXPORT_SYMBOL(setup_arg_pages); + #define free_arg_pages(bprm) do { } while (0) #else @@ -493,6 +501,8 @@ goto out; } +EXPORT_SYMBOL(open_exec); + int kernel_read(struct file *file, unsigned long offset, char *addr, unsigned long count) { @@ -508,6 +518,8 @@ return result; } +EXPORT_SYMBOL(kernel_read); + static int exec_mmap(struct mm_struct *mm) { struct task_struct *tsk; @@ -822,6 +834,8 @@ return retval; } +EXPORT_SYMBOL(flush_old_exec); + /* * We mustn't allow tracing of suid binaries, unless * the tracer has the capability to trace anything.. @@ -878,6 +892,8 @@ return kernel_read(bprm->file,0,bprm->buf,BINPRM_BUF_SIZE); } +EXPORT_SYMBOL(prepare_binprm); + /* * This function is used to produce the new IDs and capabilities * from the old ones and the file's capabilities. @@ -918,6 +934,8 @@ security_bprm_compute_creds(bprm); } +EXPORT_SYMBOL(compute_creds); + void remove_arg_zero(struct linux_binprm *bprm) { if (bprm->argc) { @@ -942,6 +960,8 @@ } } +EXPORT_SYMBOL(remove_arg_zero); + /* * cycle the list of binary formats handler, until one recognizes the image */ @@ -1037,6 +1057,8 @@ return retval; } +EXPORT_SYMBOL(search_binary_handler); + /* * sys_execve() executes a new program. */ @@ -1133,6 +1155,8 @@ return retval; } +EXPORT_SYMBOL(do_execve); + int set_binfmt(struct linux_binfmt *new) { struct linux_binfmt *old = current->binfmt; @@ -1146,6 +1170,8 @@ module_put(old->module); return 0; } + +EXPORT_SYMBOL(set_binfmt); #define CORENAME_MAX_SIZE 64 diff -Nru a/fs/ext2/inode.c b/fs/ext2/inode.c --- a/fs/ext2/inode.c Sun Oct 5 00:33:05 2003 +++ b/fs/ext2/inode.c Sun Oct 5 00:33:05 2003 @@ -1228,6 +1228,7 @@ raw_inode->i_block[0] = 0; raw_inode->i_block[1] = cpu_to_le32(new_encode_dev(inode->i_rdev)); + raw_inode->i_block[2] = 0; } } else for (n = 0; n < EXT2_N_BLOCKS; n++) raw_inode->i_block[n] = ei->i_data[n]; diff -Nru a/fs/ext2/super.c b/fs/ext2/super.c --- a/fs/ext2/super.c Sun Oct 5 00:33:09 2003 +++ b/fs/ext2/super.c Sun Oct 5 00:33:09 2003 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -265,149 +266,157 @@ return sb_block; } -static int want_value(char *value, char *option) -{ - if (!value || !*value) { - printk(KERN_NOTICE "EXT2-fs: the %s option needs an argument\n", - option); - return -1; - } - return 0; -} - -static int want_null_value(char *value, char *option) -{ - if (*value) { - printk(KERN_NOTICE "EXT2-fs: Invalid %s argument: %s\n", - option, value); - return -1; - } - return 0; -} +enum { + Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid, + Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro, + Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov, Opt_nobh, + Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, + Opt_ignore, Opt_err, +}; -static int want_numeric(char *value, char *option, unsigned long *number) -{ - if (want_value(value, option)) - return -1; - *number = simple_strtoul(value, &value, 0); - if (want_null_value(value, option)) - return -1; - return 0; -} +static match_table_t tokens = { + {Opt_bsd_df, "bsddf"}, + {Opt_minix_df, "minixdf"}, + {Opt_grpid, "grpid"}, + {Opt_grpid, "bsdgroups"}, + {Opt_nogrpid, "nogrpid"}, + {Opt_nogrpid, "sysvgroups"}, + {Opt_resgid, "resgid=%d"}, + {Opt_resuid, "resuid=%d"}, + {Opt_sb, "sb=%d"}, + {Opt_err_cont, "errors=continue"}, + {Opt_err_panic, "errors=panic"}, + {Opt_err_ro, "errors=remount-ro"}, + {Opt_nouid32, "nouid32"}, + {Opt_nocheck, "check=none"}, + {Opt_nocheck, "nocheck"}, + {Opt_check, "check"}, + {Opt_debug, "debug"}, + {Opt_oldalloc, "oldalloc"}, + {Opt_orlov, "orlov"}, + {Opt_nobh, "nobh"}, + {Opt_user_xattr, "user_xattr"}, + {Opt_nouser_xattr, "nouser_xattr"}, + {Opt_acl, "acl"}, + {Opt_noacl, "noacl"}, + {Opt_ignore, "grpquota"}, + {Opt_ignore, "noquota"}, + {Opt_ignore, "quota"}, + {Opt_ignore, "usrquota"}, + {Opt_err, NULL} +}; -/* - * This function has been shamelessly adapted from the msdos fs - */ static int parse_options (char * options, struct ext2_sb_info *sbi) { - char * this_char; - char * value; + char * p; + substring_t args[MAX_OPT_ARGS]; + unsigned long kind = EXT2_MOUNT_ERRORS_CONT; + int option; if (!options) return 1; - while ((this_char = strsep (&options, ",")) != NULL) { - if (!*this_char) + + while ((p = strsep (&options, ",")) != NULL) { + int token; + if (!*p) continue; - if ((value = strchr (this_char, '=')) != NULL) - *value++ = 0; + + token = match_token(p, tokens, args); + switch (token) { + case Opt_bsd_df: + clear_opt (sbi->s_mount_opt, MINIX_DF); + break; + case Opt_minix_df: + set_opt (sbi->s_mount_opt, MINIX_DF); + break; + case Opt_grpid: + set_opt (sbi->s_mount_opt, GRPID); + break; + case Opt_nogrpid: + clear_opt (sbi->s_mount_opt, GRPID); + break; + case Opt_resuid: + if (match_int(&args[0], &option)) + return 0; + sbi->s_resuid = option; + break; + case Opt_resgid: + if (match_int(&args[0], &option)) + return 0; + sbi->s_resgid = option; + break; + case Opt_sb: + /* handled by get_sb_block() instead of here */ + /* *sb_block = match_int(&args[0]); */ + break; + case Opt_err_panic: + kind = EXT2_MOUNT_ERRORS_PANIC; + break; + case Opt_err_ro: + kind = EXT2_MOUNT_ERRORS_RO; + break; + case Opt_err_cont: + kind = EXT2_MOUNT_ERRORS_CONT; + break; + case Opt_nouid32: + set_opt (sbi->s_mount_opt, NO_UID32); + break; + case Opt_check: +#ifdef CONFIG_EXT2_CHECK + set_opt (sbi->s_mount_opt, CHECK); +#else + printk("EXT2 Check option not supported\n"); +#endif + break; + case Opt_nocheck: + clear_opt (sbi->s_mount_opt, CHECK); + break; + case Opt_debug: + set_opt (sbi->s_mount_opt, DEBUG); + break; + case Opt_oldalloc: + set_opt (sbi->s_mount_opt, OLDALLOC); + break; + case Opt_orlov: + clear_opt (sbi->s_mount_opt, OLDALLOC); + break; + case Opt_nobh: + set_opt (sbi->s_mount_opt, NOBH); + break; #ifdef CONFIG_EXT2_FS_XATTR - if (!strcmp (this_char, "user_xattr")) + case Opt_user_xattr: set_opt (sbi->s_mount_opt, XATTR_USER); - else if (!strcmp (this_char, "nouser_xattr")) + break; + case Opt_nouser_xattr: clear_opt (sbi->s_mount_opt, XATTR_USER); - else + break; +#else + case Opt_user_xattr: + case Opt_nouser_xattr: + printk("EXT2 (no)user_xattr options not supported\n"); + break; #endif #ifdef CONFIG_EXT2_FS_POSIX_ACL - if (!strcmp(this_char, "acl")) + case Opt_acl: set_opt(sbi->s_mount_opt, POSIX_ACL); - else if (!strcmp(this_char, "noacl")) + break; + case Opt_noacl: clear_opt(sbi->s_mount_opt, POSIX_ACL); - else -#endif - if (!strcmp (this_char, "bsddf")) - clear_opt (sbi->s_mount_opt, MINIX_DF); - else if (!strcmp (this_char, "nouid32")) { - set_opt (sbi->s_mount_opt, NO_UID32); - } - else if (!strcmp (this_char, "check")) { - if (!value || !*value || !strcmp (value, "none")) - clear_opt (sbi->s_mount_opt, CHECK); - else -#ifdef CONFIG_EXT2_CHECK - set_opt (sbi->s_mount_opt, CHECK); + break; #else - printk("EXT2 Check option not supported\n"); + case Opt_acl: + case Opt_noacl: + printk("EXT2 (no)acl options not supported\n"); + break; #endif - } - else if (!strcmp (this_char, "debug")) - set_opt (sbi->s_mount_opt, DEBUG); - else if (!strcmp (this_char, "errors")) { - if (!value || !*value) { - printk ("EXT2-fs: the errors option requires " - "an argument\n"); - return 0; - } - if (!strcmp (value, "continue")) { - clear_opt (sbi->s_mount_opt, ERRORS_RO); - clear_opt (sbi->s_mount_opt, ERRORS_PANIC); - set_opt (sbi->s_mount_opt, ERRORS_CONT); - } - else if (!strcmp (value, "remount-ro")) { - clear_opt (sbi->s_mount_opt, ERRORS_CONT); - clear_opt (sbi->s_mount_opt, ERRORS_PANIC); - set_opt (sbi->s_mount_opt, ERRORS_RO); - } - else if (!strcmp (value, "panic")) { - clear_opt (sbi->s_mount_opt, ERRORS_CONT); - clear_opt (sbi->s_mount_opt, ERRORS_RO); - set_opt (sbi->s_mount_opt, ERRORS_PANIC); - } - else { - printk ("EXT2-fs: Invalid errors option: %s\n", - value); - return 0; - } - } - else if (!strcmp (this_char, "grpid") || - !strcmp (this_char, "bsdgroups")) - set_opt (sbi->s_mount_opt, GRPID); - else if (!strcmp (this_char, "minixdf")) - set_opt (sbi->s_mount_opt, MINIX_DF); - else if (!strcmp (this_char, "nocheck")) - clear_opt (sbi->s_mount_opt, CHECK); - else if (!strcmp (this_char, "nogrpid") || - !strcmp (this_char, "sysvgroups")) - clear_opt (sbi->s_mount_opt, GRPID); - else if (!strcmp (this_char, "resgid")) { - unsigned long v; - if (want_numeric(value, "resgid", &v)) - return 0; - sbi->s_resgid = v; - } - else if (!strcmp (this_char, "resuid")) { - unsigned long v; - if (want_numeric(value, "resuid", &v)) - return 0; - sbi->s_resuid = v; - } - else if (!strcmp (this_char, "oldalloc")) - set_opt (sbi->s_mount_opt, OLDALLOC); - else if (!strcmp (this_char, "orlov")) - clear_opt (sbi->s_mount_opt, OLDALLOC); - else if (!strcmp (this_char, "nobh")) - set_opt(sbi->s_mount_opt, NOBH); - /* Silently ignore the quota options */ - else if (!strcmp (this_char, "grpquota") - || !strcmp (this_char, "noquota") - || !strcmp (this_char, "quota") - || !strcmp (this_char, "usrquota")) - /* Don't do anything ;-) */ ; - else { - printk ("EXT2-fs: Unrecognized mount option %s\n", this_char); + case Opt_ignore: + break; + default: return 0; } } + sbi->s_mount_opt |= kind; return 1; } diff -Nru a/fs/ext3/file.c b/fs/ext3/file.c --- a/fs/ext3/file.c Sun Oct 5 00:33:10 2003 +++ b/fs/ext3/file.c Sun Oct 5 00:33:10 2003 @@ -47,7 +47,7 @@ * the caller didn't specify O_LARGEFILE. On 64bit systems we force * on this flag in sys_open. */ -static int ext3_open_file (struct inode * inode, struct file * filp) +static int ext3_open_file (struct inode *inode, struct file *filp) { if (!(filp->f_flags & O_LARGEFILE) && inode->i_size > 0x7FFFFFFFLL) @@ -56,7 +56,7 @@ } static ssize_t -ext3_file_write(struct kiocb *iocb, const char *buf, size_t count, loff_t pos) +ext3_file_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos) { struct file *file = iocb->ki_filp; struct inode *inode = file->f_dentry->d_inode; @@ -117,8 +117,8 @@ .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, - .aio_read = generic_file_aio_read, - .aio_write = ext3_file_write, + .aio_read = generic_file_aio_read, + .aio_write = ext3_file_write, .readv = generic_file_readv, .writev = generic_file_writev, .ioctl = ext3_ioctl, diff -Nru a/fs/ext3/inode.c b/fs/ext3/inode.c --- a/fs/ext3/inode.c Sun Oct 5 00:33:09 2003 +++ b/fs/ext3/inode.c Sun Oct 5 00:33:09 2003 @@ -2679,6 +2679,7 @@ raw_inode->i_block[0] = 0; raw_inode->i_block[1] = cpu_to_le32(new_encode_dev(inode->i_rdev)); + raw_inode->i_block[2] = 0; } } else for (block = 0; block < EXT3_N_BLOCKS; block++) raw_inode->i_block[block] = ei->i_data[block]; diff -Nru a/fs/ext3/super.c b/fs/ext3/super.c --- a/fs/ext3/super.c Sun Oct 5 00:33:10 2003 +++ b/fs/ext3/super.c Sun Oct 5 00:33:10 2003 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -526,36 +527,54 @@ .get_parent = ext3_get_parent, }; +enum { + Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid, + Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro, + Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov, + Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_noload, + Opt_commit, Opt_journal_update, Opt_journal_inum, + Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback, + Opt_ignore, Opt_err, +}; -static int want_value(char *value, char *option) -{ - if (!value || !*value) { - printk(KERN_NOTICE "EXT3-fs: the %s option needs an argument\n", - option); - return -1; - } - return 0; -} - -static int want_null_value(char *value, char *option) -{ - if (*value) { - printk(KERN_NOTICE "EXT3-fs: Invalid %s argument: %s\n", - option, value); - return -1; - } - return 0; -} - -static int want_numeric(char *value, char *option, unsigned long *number) -{ - if (want_value(value, option)) - return -1; - *number = simple_strtoul(value, &value, 0); - if (want_null_value(value, option)) - return -1; - return 0; -} +static match_table_t tokens = { + {Opt_bsd_df, "bsddf"}, + {Opt_minix_df, "minixdf"}, + {Opt_grpid, "grpid"}, + {Opt_grpid, "bsdgroups"}, + {Opt_nogrpid, "nogrpid"}, + {Opt_nogrpid, "sysvgroups"}, + {Opt_resgid, "resgid=%d"}, + {Opt_resuid, "resuid=%d"}, + {Opt_sb, "sb=%d"}, + {Opt_err_cont, "errors=continue"}, + {Opt_err_panic, "errors=panic"}, + {Opt_err_ro, "errors=remount-ro"}, + {Opt_nouid32, "nouid32"}, + {Opt_nocheck, "nocheck"}, + {Opt_nocheck, "check=none"}, + {Opt_check, "check"}, + {Opt_debug, "debug"}, + {Opt_oldalloc, "oldalloc"}, + {Opt_orlov, "orlov"}, + {Opt_user_xattr, "user_xattr"}, + {Opt_nouser_xattr, "nouser_xattr"}, + {Opt_acl, "acl"}, + {Opt_noacl, "noacl"}, + {Opt_noload, "noload"}, + {Opt_commit, "commit=%u"}, + {Opt_journal_update, "journal=update"}, + {Opt_journal_inum, "journal=%u"}, + {Opt_abort, "abort"}, + {Opt_data_journal, "data=journal"}, + {Opt_data_ordered, "data=ordered"}, + {Opt_data_writeback, "data=writeback"}, + {Opt_ignore, "grpquota"}, + {Opt_ignore, "noquota"}, + {Opt_ignore, "quota"}, + {Opt_ignore, "usrquota"}, + {Opt_err, NULL} +}; static unsigned long get_sb_block(void **data) { @@ -577,175 +596,180 @@ return sb_block; } -/* - * This function has been shamelessly adapted from the msdos fs - */ static int parse_options (char * options, struct ext3_sb_info *sbi, unsigned long * inum, int is_remount) { - char * this_char; - char * value; + char * p; + substring_t args[MAX_OPT_ARGS]; + int data_opt = 0; + int option; if (!options) return 1; - while ((this_char = strsep (&options, ",")) != NULL) { - if (!*this_char) + + while ((p = strsep (&options, ",")) != NULL) { + int token; + if (!*p) continue; - if ((value = strchr (this_char, '=')) != NULL) - *value++ = 0; -#ifdef CONFIG_EXT3_FS_XATTR - if (!strcmp (this_char, "user_xattr")) - set_opt (sbi->s_mount_opt, XATTR_USER); - else if (!strcmp (this_char, "nouser_xattr")) - clear_opt (sbi->s_mount_opt, XATTR_USER); - else -#endif -#ifdef CONFIG_EXT3_FS_POSIX_ACL - if (!strcmp(this_char, "acl")) - set_opt (sbi->s_mount_opt, POSIX_ACL); - else if (!strcmp(this_char, "noacl")) - clear_opt (sbi->s_mount_opt, POSIX_ACL); - else -#endif - if (!strcmp (this_char, "bsddf")) + + token = match_token(p, tokens, args); + switch (token) { + case Opt_bsd_df: clear_opt (sbi->s_mount_opt, MINIX_DF); - else if (!strcmp (this_char, "nouid32")) { + break; + case Opt_minix_df: + set_opt (sbi->s_mount_opt, MINIX_DF); + break; + case Opt_grpid: + set_opt (sbi->s_mount_opt, GRPID); + break; + case Opt_nogrpid: + clear_opt (sbi->s_mount_opt, GRPID); + break; + case Opt_resuid: + if (match_int(&args[0], &option)) + return 0; + sbi->s_resuid = option; + break; + case Opt_resgid: + if (match_int(&args[0], &option)) + return 0; + sbi->s_resgid = option; + break; + case Opt_sb: + /* handled by get_sb_block() instead of here */ + /* *sb_block = match_int(&args[0]); */ + break; + case Opt_err_panic: + clear_opt (sbi->s_mount_opt, ERRORS_CONT); + clear_opt (sbi->s_mount_opt, ERRORS_RO); + set_opt (sbi->s_mount_opt, ERRORS_PANIC); + break; + case Opt_err_ro: + clear_opt (sbi->s_mount_opt, ERRORS_CONT); + clear_opt (sbi->s_mount_opt, ERRORS_PANIC); + set_opt (sbi->s_mount_opt, ERRORS_RO); + break; + case Opt_err_cont: + clear_opt (sbi->s_mount_opt, ERRORS_RO); + clear_opt (sbi->s_mount_opt, ERRORS_PANIC); + set_opt (sbi->s_mount_opt, ERRORS_CONT); + break; + case Opt_nouid32: set_opt (sbi->s_mount_opt, NO_UID32); - } - else if (!strcmp (this_char, "abort")) - set_opt (sbi->s_mount_opt, ABORT); - else if (!strcmp (this_char, "check")) { - if (!value || !*value || !strcmp (value, "none")) - clear_opt (sbi->s_mount_opt, CHECK); - else + break; + case Opt_check: #ifdef CONFIG_EXT3_CHECK - set_opt (sbi->s_mount_opt, CHECK); + set_opt (sbi->s_mount_opt, CHECK); #else - printk(KERN_ERR - "EXT3 Check option not supported\n"); + printk(KERN_ERR + "EXT3 Check option not supported\n"); #endif - } - else if (!strcmp (this_char, "debug")) - set_opt (sbi->s_mount_opt, DEBUG); - else if (!strcmp (this_char, "errors")) { - if (want_value(value, "errors")) - return 0; - if (!strcmp (value, "continue")) { - clear_opt (sbi->s_mount_opt, ERRORS_RO); - clear_opt (sbi->s_mount_opt, ERRORS_PANIC); - set_opt (sbi->s_mount_opt, ERRORS_CONT); - } - else if (!strcmp (value, "remount-ro")) { - clear_opt (sbi->s_mount_opt, ERRORS_CONT); - clear_opt (sbi->s_mount_opt, ERRORS_PANIC); - set_opt (sbi->s_mount_opt, ERRORS_RO); - } - else if (!strcmp (value, "panic")) { - clear_opt (sbi->s_mount_opt, ERRORS_CONT); - clear_opt (sbi->s_mount_opt, ERRORS_RO); - set_opt (sbi->s_mount_opt, ERRORS_PANIC); - } - else { - printk (KERN_ERR - "EXT3-fs: Invalid errors option: %s\n", - value); - return 0; - } - } - else if (!strcmp (this_char, "grpid") || - !strcmp (this_char, "bsdgroups")) - set_opt (sbi->s_mount_opt, GRPID); - else if (!strcmp (this_char, "minixdf")) - set_opt (sbi->s_mount_opt, MINIX_DF); - else if (!strcmp (this_char, "nocheck")) + break; + case Opt_nocheck: clear_opt (sbi->s_mount_opt, CHECK); - else if (!strcmp (this_char, "nogrpid") || - !strcmp (this_char, "sysvgroups")) - clear_opt (sbi->s_mount_opt, GRPID); - else if (!strcmp (this_char, "resgid")) { - unsigned long v; - if (want_numeric(value, "resgid", &v)) - return 0; - sbi->s_resgid = v; - } - else if (!strcmp (this_char, "resuid")) { - unsigned long v; - if (want_numeric(value, "resuid", &v)) - return 0; - sbi->s_resuid = v; - } - else if (!strcmp (this_char, "oldalloc")) + break; + case Opt_debug: + set_opt (sbi->s_mount_opt, DEBUG); + break; + case Opt_oldalloc: set_opt (sbi->s_mount_opt, OLDALLOC); - else if (!strcmp (this_char, "orlov")) + break; + case Opt_orlov: clear_opt (sbi->s_mount_opt, OLDALLOC); - /* Silently ignore the quota options */ - else if (!strcmp (this_char, "grpquota") - || !strcmp (this_char, "noquota") - || !strcmp (this_char, "quota") - || !strcmp (this_char, "usrquota")) - /* Don't do anything ;-) */ ; - else if (!strcmp (this_char, "journal")) { + break; +#ifdef CONFIG_EXT3_FS_XATTR + case Opt_user_xattr: + set_opt (sbi->s_mount_opt, XATTR_USER); + break; + case Opt_nouser_xattr: + clear_opt (sbi->s_mount_opt, XATTR_USER); + break; +#else + case Opt_user_xattr: + case Opt_nouser_xattr: + printk("EXT3 (no)user_xattr options not supported\n"); + break; +#endif +#ifdef CONFIG_EXT3_FS_POSIX_ACL + case Opt_acl: + set_opt(sbi->s_mount_opt, POSIX_ACL); + break; + case Opt_noacl: + clear_opt(sbi->s_mount_opt, POSIX_ACL); + break; +#else + case Opt_acl: + case Opt_noacl: + printk("EXT3 (no)acl options not supported\n"); + break; +#endif + case Opt_journal_update: /* @@@ FIXME */ /* Eventually we will want to be able to create - a journal file here. For now, only allow the - user to specify an existing inode to be the - journal file. */ + a journal file here. For now, only allow the + user to specify an existing inode to be the + journal file. */ if (is_remount) { printk(KERN_ERR "EXT3-fs: cannot specify " "journal on remount\n"); return 0; } - - if (want_value(value, "journal")) + set_opt (sbi->s_mount_opt, UPDATE_JOURNAL); + break; + case Opt_journal_inum: + if (is_remount) { + printk(KERN_ERR "EXT3-fs: cannot specify " + "journal on remount\n"); return 0; - if (!strcmp (value, "update")) - set_opt (sbi->s_mount_opt, UPDATE_JOURNAL); - else if (want_numeric(value, "journal", inum)) + } + if (match_int(&args[0], &option)) return 0; - } - else if (!strcmp (this_char, "noload")) + *inum = option; + break; + case Opt_noload: set_opt (sbi->s_mount_opt, NOLOAD); - else if (!strcmp (this_char, "data")) { - int data_opt = 0; - - if (want_value(value, "data")) + break; + case Opt_commit: + if (match_int(&args[0], &option)) return 0; - if (!strcmp (value, "journal")) - data_opt = EXT3_MOUNT_JOURNAL_DATA; - else if (!strcmp (value, "ordered")) - data_opt = EXT3_MOUNT_ORDERED_DATA; - else if (!strcmp (value, "writeback")) - data_opt = EXT3_MOUNT_WRITEBACK_DATA; - else { - printk (KERN_ERR - "EXT3-fs: Invalid data option: %s\n", - value); - return 0; - } + sbi->s_commit_interval = HZ * option; + break; + case Opt_data_journal: + data_opt = EXT3_MOUNT_JOURNAL_DATA; + goto datacheck; + case Opt_data_ordered: + data_opt = EXT3_MOUNT_ORDERED_DATA; + goto datacheck; + case Opt_data_writeback: + data_opt = EXT3_MOUNT_WRITEBACK_DATA; + datacheck: if (is_remount) { - if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS) != - data_opt) { + if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS) + != data_opt) { printk(KERN_ERR - "EXT3-fs: cannot change data " - "mode on remount\n"); + "EXT3-fs: cannot change data " + "mode on remount\n"); return 0; } } else { sbi->s_mount_opt &= ~EXT3_MOUNT_DATA_FLAGS; sbi->s_mount_opt |= data_opt; } - } else if (!strcmp (this_char, "commit")) { - unsigned long v; - if (want_numeric(value, "commit", &v)) - return 0; - sbi->s_commit_interval = (HZ * v); - } else { - printk (KERN_ERR - "EXT3-fs: Unrecognized mount option %s\n", - this_char); + break; + case Opt_abort: + set_opt(sbi->s_mount_opt, ABORT); + break; + case Opt_ignore: + break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " + "or missing value\n", p); return 0; } } + return 1; } diff -Nru a/fs/ext3/symlink.c b/fs/ext3/symlink.c --- a/fs/ext3/symlink.c Sun Oct 5 00:33:08 2003 +++ b/fs/ext3/symlink.c Sun Oct 5 00:33:08 2003 @@ -22,7 +22,8 @@ #include #include "xattr.h" -static int ext3_readlink(struct dentry *dentry, char *buffer, int buflen) +static int +ext3_readlink(struct dentry *dentry, char __user *buffer, int buflen) { struct ext3_inode_info *ei = EXT3_I(dentry->d_inode); return vfs_readlink(dentry, buffer, buflen, (char*)ei->i_data); diff -Nru a/fs/fat/dir.c b/fs/fat/dir.c --- a/fs/fat/dir.c Sun Oct 5 00:33:05 2003 +++ b/fs/fat/dir.c Sun Oct 5 00:33:05 2003 @@ -663,7 +663,7 @@ return -EINVAL; } - d1 = (struct dirent *)arg; + d1 = (struct dirent __user *)arg; if (!access_ok(VERIFY_WRITE, d1, sizeof(struct dirent[2]))) return -EFAULT; /* diff -Nru a/fs/fat/inode.c b/fs/fat/inode.c --- a/fs/fat/inode.c Sun Oct 5 00:33:08 2003 +++ b/fs/fat/inode.c Sun Oct 5 00:33:08 2003 @@ -20,6 +20,7 @@ #include #include #include +#include #include /* @@ -183,20 +184,6 @@ kfree(sbi); } -static int simple_getbool(char *s, int *setval) -{ - if (s) { - if (!strcmp(s,"1") || !strcmp(s,"yes") || !strcmp(s,"true")) - *setval = 1; - else if (!strcmp(s,"0") || !strcmp(s,"no") || !strcmp(s,"false")) - *setval = 0; - else - return 0; - } else - *setval = 1; - return 1; -} - static int fat_show_options(struct seq_file *m, struct vfsmount *mnt) { struct msdos_sb_info *sbi = MSDOS_SB(mnt->mnt_sb); @@ -259,11 +246,95 @@ return 0; } +static void print_obsolete_option(char *optname) +{ + printk(KERN_INFO "FAT: %s option is obsolete, " + "not supported now\n", optname); +} + +enum { + Opt_blocksize, Opt_charset, Opt_check_n, Opt_check_r, Opt_check_s, + Opt_fat, Opt_codepage, Opt_conv_a, Opt_conv_b, Opt_conv_t, + Opt_debug, Opt_dots, Opt_err, Opt_gid, Opt_immutable, + Opt_nocase, Opt_nodots, Opt_quiet, Opt_showexec, Opt_uid, + Opt_shortname_lower, Opt_shortname_win95, Opt_shortname_winnt, Opt_shortname_mixed, + Opt_umask, Opt_dmask, Opt_fmask, Opt_posix, Opt_cvf_format, Opt_cvf_options, + Opt_utf8_off, Opt_utf8_no, Opt_utf8_false, + Opt_utf8_on, Opt_utf8_yes, Opt_utf8_true, Opt_utf8_opt, + Opt_uni_xl_off, Opt_uni_xl_no, Opt_uni_xl_false, + Opt_uni_xl_on, Opt_uni_xl_yes, Opt_uni_xl_true, Opt_uni_xl_opt, + Opt_nonumtail_off, Opt_nonumtail_no, Opt_nonumtail_false, + Opt_nonumtail_on, Opt_nonumtail_yes, Opt_nonumtail_true, Opt_nonumtail_opt, +}; + +static match_table_t FAT_tokens = { + {Opt_check_r, "check=relaxed"}, + {Opt_check_s, "check=strict"}, + {Opt_check_n, "check=normal"}, + {Opt_check_r, "check=r"}, + {Opt_check_s, "check=s"}, + {Opt_check_n, "check=n"}, + {Opt_conv_b, "conv=binary"}, + {Opt_conv_t, "conv=text"}, + {Opt_conv_a, "conv=auto"}, + {Opt_conv_b, "conv=b"}, + {Opt_conv_t, "conv=t"}, + {Opt_conv_a, "conv=a"}, + {Opt_nodots, "nodots"}, + {Opt_nodots, "dotsOK=no"}, + {Opt_dots, "dotsOK=yes"}, + {Opt_dots, "dots"}, + {Opt_uid, "uid=%d"}, + {Opt_gid, "gid=%d"}, + {Opt_umask, "umask=%o"}, + {Opt_dmask, "dmask=%o"}, + {Opt_fmask, "fmask=%o"}, + {Opt_fat, "fat=%d"}, + {Opt_codepage, "codepage=%d"}, + {Opt_charset, "iocharset=%s"}, + {Opt_blocksize, "blocksize=%d"}, + {Opt_nocase, "nocase"}, + {Opt_cvf_format, "cvf_format=%20s"}, + {Opt_cvf_options, "cvf_options=%100s"}, + {Opt_shortname_lower, "shortname=lower"}, + {Opt_shortname_win95, "shortname=win95"}, + {Opt_shortname_winnt, "shortname=winnt"}, + {Opt_shortname_mixed, "shortname=mixed"}, + {Opt_utf8_off, "utf8=0"}, /* 0 or no or false */ + {Opt_utf8_no, "utf8=no"}, + {Opt_utf8_false, "utf8=false"}, + {Opt_utf8_on, "utf8=1"}, /* empty or 1 or yes or true */ + {Opt_utf8_yes, "utf8=yes"}, + {Opt_utf8_true, "utf8=true"}, + {Opt_utf8_opt, "utf8"}, + {Opt_uni_xl_off, "uni_xlate=0"}, /* 0 or no or false */ + {Opt_uni_xl_no, "uni_xlate=no"}, + {Opt_uni_xl_false, "uni_xlate=false"}, + {Opt_uni_xl_on, "uni_xlate=1"}, /* empty or 1 or yes or true */ + {Opt_uni_xl_yes, "uni_xlate=yes"}, + {Opt_uni_xl_true, "uni_xlate=true"}, + {Opt_uni_xl_opt, "uni_xlate"}, + {Opt_nonumtail_off, "nonumtail=0"}, /* 0 or no or false */ + {Opt_nonumtail_no, "nonumtail=no"}, + {Opt_nonumtail_false, "nonumtail=false"}, + {Opt_nonumtail_on, "nonumtail=1"}, /* empty or 1 or yes or true */ + {Opt_nonumtail_yes, "nonumtail=yes"}, + {Opt_nonumtail_true, "nonumtail=true"}, + {Opt_nonumtail_opt, "nonumtail"}, + {Opt_quiet, "quiet"}, + {Opt_showexec, "showexec"}, + {Opt_debug, "debug"}, + {Opt_immutable, "sys_immutable"}, + {Opt_posix, "posix"}, + {Opt_err, NULL} +}; + static int parse_options(char *options, int is_vfat, int *debug, struct fat_mount_options *opts) { - char *this_char, *value, *p; - int ret = 1, val, len; + char *p; + substring_t args[MAX_OPT_ARGS]; + int option; opts->isvfat = is_vfat; @@ -284,183 +355,198 @@ *debug = 0; if (!options) - goto out; - while ((this_char = strsep(&options,",")) != NULL) { - if (!*this_char) + return 1; + + while ((p = strsep(&options, ",")) != NULL) { + int token; + if (!*p) continue; - if ((value = strchr(this_char,'=')) != NULL) - *value++ = 0; - if (!strcmp(this_char,"check") && value) { - if (value[0] && !value[1] && strchr("rns",*value)) - opts->name_check = *value; - else if (!strcmp(value,"relaxed")) - opts->name_check = 'r'; - else if (!strcmp(value,"normal")) - opts->name_check = 'n'; - else if (!strcmp(value,"strict")) - opts->name_check = 's'; - else ret = 0; - } - else if (!strcmp(this_char,"conv") && value) { - printk(KERN_INFO "FAT: conv option is obsolete, " - "not supported now\n"); - } - else if (!strcmp(this_char,"nocase")) { + token = match_token(p, FAT_tokens, args); + switch (token) { + case Opt_check_s: + opts->name_check = 's'; + break; + case Opt_check_r: + opts->name_check = 'r'; + break; + case Opt_check_n: + opts->name_check = 'n'; + break; + case Opt_dots: /* msdos specific */ + if (!is_vfat) + opts->dotsOK = 1; + break; + case Opt_nodots: /* msdos specific */ + if (!is_vfat) + opts->dotsOK = 0; + break; + case Opt_nocase: if (!is_vfat) opts->nocase = 1; else { - /* for backward compatible */ + /* for backward compatibility */ opts->shortname = VFAT_SFN_DISPLAY_WIN95 | VFAT_SFN_CREATE_WIN95; } - } - else if (!strcmp(this_char,"showexec")) { + break; + case Opt_quiet: + opts->quiet = 1; + break; + case Opt_showexec: opts->showexec = 1; - } - else if (!strcmp(this_char,"uid")) { - if (!value || !*value) ret = 0; - else { - opts->fs_uid = simple_strtoul(value,&value,0); - if (*value) ret = 0; - } - } - else if (!strcmp(this_char,"gid")) { - if (!value || !*value) ret= 0; - else { - opts->fs_gid = simple_strtoul(value,&value,0); - if (*value) ret = 0; - } - } - else if (!strcmp(this_char,"umask")) { - if (!value || !*value) ret = 0; - else { - opts->fs_fmask = opts->fs_dmask = - simple_strtoul(value,&value,8); - if (*value) ret = 0; - } - } - else if (!strcmp(this_char,"fmask")) { - if (!value || !*value) ret = 0; - else { - opts->fs_fmask = simple_strtoul(value,&value,8); - if (*value) ret = 0; - } - } - else if (!strcmp(this_char,"dmask")) { - if (!value || !*value) ret = 0; - else { - opts->fs_dmask = simple_strtoul(value,&value,8); - if (*value) ret = 0; - } - } - else if (!strcmp(this_char,"debug")) { - if (value) ret = 0; - else *debug = 1; - } - else if (!strcmp(this_char,"fat")) { - printk(KERN_INFO "FAT: fat option is obsolete, " - "not supported now\n"); - } - else if (!strcmp(this_char,"quiet")) { - if (value) ret = 0; - else opts->quiet = 1; - } - else if (!strcmp(this_char,"blocksize")) { - printk(KERN_INFO "FAT: blocksize option is obsolete, " - "not supported now\n"); - } - else if (!strcmp(this_char,"sys_immutable")) { - if (value) ret = 0; - else opts->sys_immutable = 1; - } - else if (!strcmp(this_char,"codepage") && value) { - opts->codepage = simple_strtoul(value,&value,0); - if (*value) ret = 0; - } - - /* msdos specific */ - else if (!is_vfat && !strcmp(this_char,"dots")) { - opts->dotsOK = 1; - } - else if (!is_vfat && !strcmp(this_char,"nodots")) { - opts->dotsOK = 0; - } - else if (!is_vfat && !strcmp(this_char,"dotsOK") && value) { - if (!strcmp(value,"yes")) opts->dotsOK = 1; - else if (!strcmp(value,"no")) opts->dotsOK = 0; - else ret = 0; - } + break; + case Opt_debug: + *debug = 1; + break; + case Opt_immutable: + opts->sys_immutable = 1; + break; + case Opt_uid: + if (match_int(&args[0], &option)) + return 0; + opts->fs_uid = option; + break; + case Opt_gid: + if (match_int(&args[0], &option)) + return 0; + opts->fs_gid = option; + break; + case Opt_umask: + if (match_octal(&args[0], &option)) + return 0; + opts->fs_fmask = opts->fs_dmask = option; + break; + case Opt_dmask: + if (match_octal(&args[0], &option)) + return 0; + opts->fs_dmask = option; + break; + case Opt_fmask: + if (match_octal(&args[0], &option)) + return 0; + opts->fs_fmask = option; + break; + case Opt_codepage: + if (match_int(&args[0], &option)) + return 0; + opts->codepage = option; + printk("MSDOS FS: Using codepage %d\n", + opts->codepage); + break; /* vfat specific */ - else if (is_vfat && !strcmp(this_char,"iocharset") && value) { - p = value; - while (*value && *value != ',') - value++; - len = value - p; - if (len) { - char *buffer; - - if (opts->iocharset != NULL) { - kfree(opts->iocharset); - opts->iocharset = NULL; - } - buffer = kmalloc(len + 1, GFP_KERNEL); - if (buffer != NULL) { - opts->iocharset = buffer; - memcpy(buffer, p, len); - buffer[len] = 0; - } else - ret = 0; - } - } - else if (is_vfat && !strcmp(this_char,"utf8")) { - ret = simple_getbool(value, &val); - if (ret) opts->utf8 = val; - } - else if (is_vfat && !strcmp(this_char,"uni_xlate")) { - ret = simple_getbool(value, &val); - if (ret) opts->unicode_xlate = val; - } - else if (is_vfat && !strcmp(this_char,"posix")) { - printk(KERN_INFO "FAT: posix option is obsolete, " - "not supported now\n"); - } - else if (is_vfat && !strcmp(this_char,"nonumtail")) { - ret = simple_getbool(value, &val); - if (ret) { - opts->numtail = !val; + case Opt_charset: + if (is_vfat) { + kfree(opts->iocharset); + opts->iocharset = match_strdup(&args[0]); + if (!opts->iocharset) + return 0; + printk("MSDOS FS: IO charset %s\n", + opts->iocharset); } - } - else if (is_vfat && !strcmp(this_char, "shortname")) { - if (!strcmp(value, "lower")) + break; + case Opt_shortname_lower: + if (is_vfat) { opts->shortname = VFAT_SFN_DISPLAY_LOWER | VFAT_SFN_CREATE_WIN95; - else if (!strcmp(value, "win95")) + } + break; + case Opt_shortname_win95: + if (is_vfat) { opts->shortname = VFAT_SFN_DISPLAY_WIN95 | VFAT_SFN_CREATE_WIN95; - else if (!strcmp(value, "winnt")) + } + break; + case Opt_shortname_winnt: + if (is_vfat) { opts->shortname = VFAT_SFN_DISPLAY_WINNT | VFAT_SFN_CREATE_WINNT; - else if (!strcmp(value, "mixed")) + } + break; + case Opt_shortname_mixed: + if (is_vfat) { opts->shortname = VFAT_SFN_DISPLAY_WINNT | VFAT_SFN_CREATE_WIN95; - else - ret = 0; - } else { - printk(KERN_ERR "FAT: Unrecognized mount option %s\n", - this_char); - ret = 0; - } + } + break; + case Opt_utf8_off: /* 0 or no or false */ + case Opt_utf8_no: + case Opt_utf8_false: + if (is_vfat) { + opts->utf8 = 0; + } + break; + case Opt_utf8_on: /* empty or 1 or yes or true */ + case Opt_utf8_opt: + case Opt_utf8_yes: + case Opt_utf8_true: + if (is_vfat) { + opts->utf8 = 1; + } + break; + case Opt_uni_xl_off: /* 0 or no or false */ + case Opt_uni_xl_no: + case Opt_uni_xl_false: + if (is_vfat) { + opts->unicode_xlate = 0; + } + break; + case Opt_uni_xl_on: /* empty or 1 or yes or true */ + case Opt_uni_xl_yes: + case Opt_uni_xl_true: + case Opt_uni_xl_opt: + if (is_vfat) { + opts->unicode_xlate = 1; + } + break; + case Opt_nonumtail_off: /* 0 or no or false */ + case Opt_nonumtail_no: + case Opt_nonumtail_false: + if (is_vfat) { + opts->numtail = 1; /* negated option */ + } + break; + case Opt_nonumtail_on: /* empty or 1 or yes or true */ + case Opt_nonumtail_yes: + case Opt_nonumtail_true: + case Opt_nonumtail_opt: + if (is_vfat) { + opts->numtail = 0; /* negated option */ + } + break; - if (ret == 0) + /* obsolete mount options */ + case Opt_conv_b: + case Opt_conv_t: + case Opt_conv_a: + print_obsolete_option("conv"); + break; + case Opt_blocksize: + print_obsolete_option("blocksize"); + break; + case Opt_posix: + print_obsolete_option("posix"); + break; + case Opt_fat: + print_obsolete_option("fat"); + break; + case Opt_cvf_format: + case Opt_cvf_options: + print_obsolete_option("cvf"); break; + /* unknown option */ + default: + printk(KERN_ERR "FAT: Unrecognized mount option \"%s\" " + "or missing value\n", p); + return 0; + } } -out: + if (opts->unicode_xlate) opts->utf8 = 0; - return ret; + return 1; } static int fat_calc_dir_size(struct inode *inode) diff -Nru a/fs/fcntl.c b/fs/fcntl.c --- a/fs/fcntl.c Sun Oct 5 00:33:09 2003 +++ b/fs/fcntl.c Sun Oct 5 00:33:09 2003 @@ -619,3 +619,6 @@ EXPORT_SYMBOL(f_setown); EXPORT_SYMBOL(f_delown); +#ifdef CONFIG_NET +EXPORT_SYMBOL(__kill_fasync); +#endif diff -Nru a/fs/file_table.c b/fs/file_table.c --- a/fs/file_table.c Sun Oct 5 00:33:05 2003 +++ b/fs/file_table.c Sun Oct 5 00:33:05 2003 @@ -285,3 +285,5 @@ files_stat.max_files = NR_FILE; } +/* Needed by unix.o */ +EXPORT_SYMBOL(files_stat); diff -Nru a/fs/freevxfs/vxfs_immed.c b/fs/freevxfs/vxfs_immed.c --- a/fs/freevxfs/vxfs_immed.c Sun Oct 5 00:33:09 2003 +++ b/fs/freevxfs/vxfs_immed.c Sun Oct 5 00:33:09 2003 @@ -39,7 +39,7 @@ #include "vxfs_inode.h" -static int vxfs_immed_readlink(struct dentry *, char *, int); +static int vxfs_immed_readlink(struct dentry *, char __user *, int); static int vxfs_immed_follow_link(struct dentry *, struct nameidata *); static int vxfs_immed_readpage(struct file *, struct page *); @@ -77,7 +77,7 @@ * Number of bytes successfully copied to userspace. */ static int -vxfs_immed_readlink(struct dentry *dp, char *bp, int buflen) +vxfs_immed_readlink(struct dentry *dp, char __user *bp, int buflen) { struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode); diff -Nru a/fs/hfs/file.c b/fs/hfs/file.c --- a/fs/hfs/file.c Sun Oct 5 00:33:07 2003 +++ b/fs/hfs/file.c Sun Oct 5 00:33:07 2003 @@ -25,10 +25,10 @@ /*================ Forward declarations ================*/ -static hfs_rwret_t hfs_file_read(struct file *, char *, hfs_rwarg_t, +static hfs_rwret_t hfs_file_read(struct file *, char __user *, hfs_rwarg_t, loff_t *); -static hfs_rwret_t hfs_file_write(struct file *, const char *, hfs_rwarg_t, - loff_t *); +static hfs_rwret_t hfs_file_write(struct file *, const char __user *, + hfs_rwarg_t, loff_t *); static void hfs_file_truncate(struct inode *); /*================ Global variables ================*/ @@ -139,7 +139,7 @@ * user-space at the address 'buf'. Returns the number of bytes * successfully transferred. This function checks the arguments, does * some setup and then calls hfs_do_read() to do the actual transfer. */ -static hfs_rwret_t hfs_file_read(struct file * filp, char * buf, +static hfs_rwret_t hfs_file_read(struct file *filp, char __user *buf, hfs_rwarg_t count, loff_t *ppos) { struct inode *inode = filp->f_dentry->d_inode; @@ -181,7 +181,7 @@ * 'file->f_pos' from user-space at the address 'buf'. The return * value is the number of bytes actually transferred. */ -static hfs_rwret_t hfs_file_write(struct file * filp, const char * buf, +static hfs_rwret_t hfs_file_write(struct file *filp, const char __user *buf, hfs_rwarg_t count, loff_t *ppos) { struct inode *inode = filp->f_dentry->d_inode; @@ -242,7 +242,7 @@ * * Like copy_to_user() while translating CR->NL. */ -static inline void xlate_to_user(char *buf, const char *data, int count) +static inline void xlate_to_user(char __user *buf, const char *data, int count) { char ch; @@ -257,7 +257,8 @@ * * Like copy_from_user() while translating NL->CR; */ -static inline int xlate_from_user(char *data, const char *buf, int count) +static inline +int xlate_from_user(char *data, const char __user *buf, int count) { int i; @@ -290,8 +291,8 @@ * This is based on Linus's minix_file_read(). * It has been changed to take into account that HFS files have no holes. */ -hfs_s32 hfs_do_read(struct inode *inode, struct hfs_fork * fork, hfs_u32 pos, - char * buf, hfs_u32 count) +hfs_s32 hfs_do_read(struct inode *inode, struct hfs_fork *fork, hfs_u32 pos, + char __user *buf, hfs_u32 count) { hfs_s32 size, chars, offset, block, blocks, read = 0; int bhrequest, uptodate; @@ -436,8 +437,8 @@ * * This is just a minor edit of Linus's minix_file_write(). */ -hfs_s32 hfs_do_write(struct inode *inode, struct hfs_fork * fork, hfs_u32 pos, - const char * buf, hfs_u32 count) +hfs_s32 hfs_do_write(struct inode *inode, struct hfs_fork *fork, hfs_u32 pos, + const char __user *buf, hfs_u32 count) { hfs_s32 written, c; struct buffer_head * bh; diff -Nru a/fs/hfs/file_cap.c b/fs/hfs/file_cap.c --- a/fs/hfs/file_cap.c Sun Oct 5 00:33:08 2003 +++ b/fs/hfs/file_cap.c Sun Oct 5 00:33:08 2003 @@ -29,9 +29,9 @@ /*================ Forward declarations ================*/ static loff_t cap_info_llseek(struct file *, loff_t, int); -static hfs_rwret_t cap_info_read(struct file *, char *, +static hfs_rwret_t cap_info_read(struct file *, char __user *, hfs_rwarg_t, loff_t *); -static hfs_rwret_t cap_info_write(struct file *, const char *, +static hfs_rwret_t cap_info_write(struct file *, const char __user *, hfs_rwarg_t, loff_t *); /*================ Function-like macros ================*/ @@ -121,7 +121,7 @@ * 'file->f_pos' to user-space at the address 'buf'. The return value * is the number of bytes actually transferred. */ -static hfs_rwret_t cap_info_read(struct file *filp, char *buf, +static hfs_rwret_t cap_info_read(struct file *filp, char __user *buf, hfs_rwarg_t count, loff_t *ppos) { struct inode *inode = filp->f_dentry->d_inode; @@ -189,7 +189,7 @@ * '*ppos' from user-space at the address 'buf'. * The return value is the number of bytes actually transferred. */ -static hfs_rwret_t cap_info_write(struct file *filp, const char *buf, +static hfs_rwret_t cap_info_write(struct file *filp, const char __user *buf, hfs_rwarg_t count, loff_t *ppos) { struct inode *inode = filp->f_dentry->d_inode; diff -Nru a/fs/hfs/file_hdr.c b/fs/hfs/file_hdr.c --- a/fs/hfs/file_hdr.c Sun Oct 5 00:33:09 2003 +++ b/fs/hfs/file_hdr.c Sun Oct 5 00:33:09 2003 @@ -41,8 +41,9 @@ /*================ Forward declarations ================*/ static loff_t hdr_llseek(struct file *, loff_t, int); -static hfs_rwret_t hdr_read(struct file *, char *, hfs_rwarg_t, loff_t *); -static hfs_rwret_t hdr_write(struct file *, const char *, +static hfs_rwret_t hdr_read(struct file *, char __user *, + hfs_rwarg_t, loff_t *); +static hfs_rwret_t hdr_write(struct file *, const char __user *, hfs_rwarg_t, loff_t *); /*================ Global variables ================*/ @@ -382,7 +383,7 @@ * successfully transferred. */ /* XXX: what about the entry count changing on us? */ -static hfs_rwret_t hdr_read(struct file * filp, char * buf, +static hfs_rwret_t hdr_read(struct file *filp, char __user *buf, hfs_rwarg_t count, loff_t *ppos) { struct inode *inode = filp->f_dentry->d_inode; @@ -633,7 +634,7 @@ * '*ppos' from user-space at the address 'buf'. * The return value is the number of bytes actually transferred. */ -static hfs_rwret_t hdr_write(struct file *filp, const char *buf, +static hfs_rwret_t hdr_write(struct file *filp, const char __user *buf, hfs_rwarg_t count, loff_t *ppos) { struct inode *inode = filp->f_dentry->d_inode; diff -Nru a/fs/hfs/super.c b/fs/hfs/super.c --- a/fs/hfs/super.c Sun Oct 5 00:33:07 2003 +++ b/fs/hfs/super.c Sun Oct 5 00:33:07 2003 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -211,6 +212,60 @@ return 0; } +enum { + Opt_version, Opt_uid, Opt_gid, Opt_umask, Opt_part, + Opt_type, Opt_creator, Opt_quiet, Opt_afpd, + Opt_names_netatalk, Opt_names_trivial, Opt_names_alpha, Opt_names_latin, + Opt_names_7bit, Opt_names_8bit, Opt_names_cap, + Opt_fork_netatalk, Opt_fork_single, Opt_fork_double, Opt_fork_cap, + Opt_case_lower, Opt_case_asis, + Opt_conv_binary, Opt_conv_text, Opt_conv_auto, +}; + +static match_table_t tokens = { + {Opt_version, "version=%u"}, + {Opt_uid, "uid=%u"}, + {Opt_gid, "gid=%u"}, + {Opt_umask, "umask=%o"}, + {Opt_part, "part=%u"}, + {Opt_type, "type=%s"}, + {Opt_creator, "creator=%s"}, + {Opt_quiet, "quiet"}, + {Opt_afpd, "afpd"}, + {Opt_names_netatalk, "names=netatalk"}, + {Opt_names_trivial, "names=trivial"}, + {Opt_names_alpha, "names=alpha"}, + {Opt_names_latin, "names=latin"}, + {Opt_names_7bit, "names=7bit"}, + {Opt_names_8bit, "names=8bit"}, + {Opt_names_cap, "names=cap"}, + {Opt_names_netatalk, "names=n"}, + {Opt_names_trivial, "names=t"}, + {Opt_names_alpha, "names=a"}, + {Opt_names_latin, "names=l"}, + {Opt_names_7bit, "names=7"}, + {Opt_names_8bit, "names=8"}, + {Opt_names_cap, "names=c"}, + {Opt_fork_netatalk, "fork=netatalk"}, + {Opt_fork_single, "fork=single"}, + {Opt_fork_double, "fork=double"}, + {Opt_fork_cap, "fork=cap"}, + {Opt_fork_netatalk, "fork=n"}, + {Opt_fork_single, "fork=s"}, + {Opt_fork_double, "fork=d"}, + {Opt_fork_cap, "fork=c"}, + {Opt_case_lower, "case=lower"}, + {Opt_case_asis, "case=asis"}, + {Opt_case_lower, "case=l"}, + {Opt_case_asis, "case=a"}, + {Opt_conv_binary, "conv=binary"}, + {Opt_conv_text, "conv=text"}, + {Opt_conv_auto, "conv=auto"}, + {Opt_conv_binary, "conv=b"}, + {Opt_conv_text, "conv=t"}, + {Opt_conv_auto, "conv=a"}, +}; + /* * parse_options() * @@ -219,8 +274,10 @@ */ static int parse_options(char *options, struct hfs_sb_info *hsb, int *part) { - char *this_char, *value; + char *p; char names, fork; + substring_t args[MAX_OPT_ARGS]; + int option; /* initialize the sb with defaults */ memset(hsb, 0, sizeof(*hsb)); @@ -243,117 +300,109 @@ if (!options) { goto done; } - while ((this_char = strsep(&options,",")) != NULL) { - if (!*this_char) + while ((p = strsep(&options,",")) != NULL) { + int token; + if (!*p) continue; - if ((value = strchr(this_char,'=')) != NULL) { - *value++ = 0; - } - /* Numeric-valued options */ - if (!strcmp(this_char, "version")) { - if (!value || !*value) { - return 0; - } - hsb->s_version = simple_strtoul(value,&value,0); - if (*value) { - return 0; - } - } else if (!strcmp(this_char,"uid")) { - if (!value || !*value) { - return 0; - } - hsb->s_uid = simple_strtoul(value,&value,0); - if (*value) { - return 0; - } - } else if (!strcmp(this_char,"gid")) { - if (!value || !*value) { - return 0; - } - hsb->s_gid = simple_strtoul(value,&value,0); - if (*value) { - return 0; - } - } else if (!strcmp(this_char,"umask")) { - if (!value || !*value) { - return 0; - } - hsb->s_umask = simple_strtoul(value,&value,8); - if (*value) { - return 0; - } - } else if (!strcmp(this_char,"part")) { - if (!value || !*value) { - return 0; - } - *part = simple_strtoul(value,&value,0); - if (*value) { - return 0; - } - /* String-valued options */ - } else if (!strcmp(this_char,"type") && value) { - if (strlen(value) != 4) { - return 0; - } - hsb->s_type = hfs_get_nl(value); - } else if (!strcmp(this_char,"creator") && value) { - if (strlen(value) != 4) { - return 0; - } - hsb->s_creator = hfs_get_nl(value); - /* Boolean-valued options */ - } else if (!strcmp(this_char,"quiet")) { - if (value) { - return 0; - } + + token = match_token(p, tokens, args); + switch (token) { + /* Numeric-valued options */ + case Opt_version: + if (match_int(&args[0], &option)) + return 0; + hsb->s_version = option; + break; + case Opt_uid: + if (match_int(&args[0], &option)) + return 0; + hsb->s_uid = option; + break; + case Opt_gid: + if (match_int(&args[0], &option)) + return 0; + hsb->s_gid = option; + break; + case Opt_umask: + if (match_octal(&args[0], &option)) + return 0; + hsb->s_umask = option; + break; + case Opt_part: + if (match_int(&args[0], &option)) + return 0; + *part = option; + break; + /* String-valued options */ + case Opt_type: + if (strlen(args[0].from) != 4) { + return 0; + } + hsb->s_type = hfs_get_nl(args[0].from); + break; + case Opt_creator: + if (strlen(args[0].from) != 4) { + return 0; + } + hsb->s_creator = hfs_get_nl(args[0].from); + break; + /* Boolean-valued options */ + case Opt_quiet: hsb->s_quiet = 1; - } else if (!strcmp(this_char,"afpd")) { - if (value) { - return 0; - } + break; + case Opt_afpd: hsb->s_afpd = 1; - /* Multiple choice options */ - } else if (!strcmp(this_char,"names") && value) { - if ((*value && !value[1] && strchr("ntal78c",*value)) || - !strcmp(value,"netatalk") || - !strcmp(value,"trivial") || - !strcmp(value,"alpha") || - !strcmp(value,"latin") || - !strcmp(value,"7bit") || - !strcmp(value,"8bit") || - !strcmp(value,"cap")) { - names = *value; - } else { - return 0; - } - } else if (!strcmp(this_char,"fork") && value) { - if ((*value && !value[1] && strchr("nsdc",*value)) || - !strcmp(value,"netatalk") || - !strcmp(value,"single") || - !strcmp(value,"double") || - !strcmp(value,"cap")) { - fork = *value; - } else { - return 0; - } - } else if (!strcmp(this_char,"case") && value) { - if ((*value && !value[1] && strchr("la",*value)) || - !strcmp(value,"lower") || - !strcmp(value,"asis")) { - hsb->s_lowercase = (*value == 'l'); - } else { - return 0; - } - } else if (!strcmp(this_char,"conv") && value) { - if ((*value && !value[1] && strchr("bta",*value)) || - !strcmp(value,"binary") || - !strcmp(value,"text") || - !strcmp(value,"auto")) { - hsb->s_conv = *value; - } else { - return 0; - } - } else { + break; + /* Multiple choice options */ + case Opt_names_netatalk: + names = 'n'; + break; + case Opt_names_trivial: + names = 't'; + break; + case Opt_names_alpha: + names = 'a'; + break; + case Opt_names_latin: + names = 'l'; + break; + case Opt_names_7bit: + names = '7'; + break; + case Opt_names_8bit: + names = '8'; + break; + case Opt_names_cap: + names = 'c'; + break; + case Opt_fork_netatalk: + fork = 'n'; + break; + case Opt_fork_single: + fork = 's'; + break; + case Opt_fork_double: + fork = 'd'; + break; + case Opt_fork_cap: + fork = 'c'; + break; + case Opt_case_lower: + hsb->s_lowercase = 1; + break; + case Opt_case_asis: + hsb->s_lowercase = 0; + break; + case Opt_conv_binary: + hsb->s_conv = 'b'; + break; + case Opt_conv_text: + hsb->s_conv = 't'; + break; + case Opt_conv_auto: + hsb->s_conv = 'a'; + break; + default: return 0; } } diff -Nru a/fs/hpfs/file.c b/fs/hpfs/file.c --- a/fs/hpfs/file.c Sun Oct 5 00:33:10 2003 +++ b/fs/hpfs/file.c Sun Oct 5 00:33:10 2003 @@ -124,7 +124,8 @@ .bmap = _hpfs_bmap }; -ssize_t hpfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +ssize_t hpfs_file_write(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) { ssize_t retval; diff -Nru a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h --- a/fs/hpfs/hpfs_fn.h Sun Oct 5 00:33:08 2003 +++ b/fs/hpfs/hpfs_fn.h Sun Oct 5 00:33:08 2003 @@ -249,7 +249,7 @@ secno hpfs_bmap(struct inode *, unsigned); void hpfs_truncate(struct inode *); int hpfs_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_result, int create); -ssize_t hpfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos); +ssize_t hpfs_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos); /* inode.c */ diff -Nru a/fs/hpfs/super.c b/fs/hpfs/super.c --- a/fs/hpfs/super.c Sun Oct 5 00:33:08 2003 +++ b/fs/hpfs/super.c Sun Oct 5 00:33:08 2003 @@ -10,6 +10,7 @@ #include #include "hpfs_fn.h" #include +#include #include #include @@ -219,15 +220,52 @@ /* * A tiny parser for option strings, stolen from dosfs. - * * Stolen again from read-only hpfs. + * And updated for table-driven option parsing. */ +enum { + Opt_help, Opt_uid, Opt_gid, Opt_umask, Opt_case_lower, Opt_case_asis, + Opt_conv_binary, Opt_conv_text, Opt_conv_auto, + Opt_check_none, Opt_check_normal, Opt_check_strict, + Opt_err_cont, Opt_err_ro, Opt_err_panic, + Opt_eas_no, Opt_eas_ro, Opt_eas_rw, + Opt_chkdsk_no, Opt_chkdsk_errors, Opt_chkdsk_always, + Opt_timeshift, Opt_err, +}; + +static match_table_t tokens = { + {Opt_help, "help"}, + {Opt_uid, "uid=%u"}, + {Opt_gid, "gid=%u"}, + {Opt_umask, "umask=%o"}, + {Opt_case_lower, "case=lower"}, + {Opt_case_asis, "case=asis"}, + {Opt_conv_binary, "conv=binary"}, + {Opt_conv_text, "conv=text"}, + {Opt_conv_auto, "conv=auto"}, + {Opt_check_none, "check=none"}, + {Opt_check_normal, "check=normal"}, + {Opt_check_strict, "check=strict"}, + {Opt_err_cont, "errors=continue"}, + {Opt_err_ro, "errors=remount-ro"}, + {Opt_err_panic, "errors=panic"}, + {Opt_eas_no, "eas=no"}, + {Opt_eas_ro, "eas=ro"}, + {Opt_eas_rw, "eas=rw"}, + {Opt_chkdsk_no, "chkdsk=no"}, + {Opt_chkdsk_errors, "chkdsk=errors"}, + {Opt_chkdsk_always, "chkdsk=always"}, + {Opt_timeshift, "timeshift=%d"}, + {Opt_err, NULL}, +}; + int parse_opts(char *opts, uid_t *uid, gid_t *gid, umode_t *umask, int *lowercase, int *conv, int *eas, int *chk, int *errs, int *chkdsk, int *timeshift) { - char *p, *rhs; + char *p; + int option; if (!opts) return 1; @@ -235,34 +273,85 @@ /*printk("Parsing opts: '%s'\n",opts);*/ while ((p = strsep(&opts, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; if (!*p) continue; - if ((rhs = strchr(p, '=')) != 0) - *rhs++ = '\0'; - if (!strcmp(p, "help")) return 2; - if (!strcmp(p, "uid")) { - if (!rhs || !*rhs) - return 0; - *uid = simple_strtoul(rhs, &rhs, 0); - if (*rhs) - return 0; - } - else if (!strcmp(p, "gid")) { - if (!rhs || !*rhs) - return 0; - *gid = simple_strtoul(rhs, &rhs, 0); - if (*rhs) - return 0; - } - else if (!strcmp(p, "umask")) { - if (!rhs || !*rhs) - return 0; - *umask = simple_strtoul(rhs, &rhs, 8); - if (*rhs) - return 0; - } - else if (!strcmp(p, "timeshift")) { + + token = match_token(p, tokens, args); + switch (token) { + case Opt_help: + return 2; + case Opt_uid: + if (match_int(args, &option)) + return 0; + *uid = option; + break; + case Opt_gid: + if (match_int(args, &option)) + return 0; + *gid = option; + break; + case Opt_umask: + if (match_octal(args, &option)) + return 0; + *umask = option; + break; + case Opt_case_lower: + *lowercase = 1; + break; + case Opt_case_asis: + *lowercase = 0; + break; + case Opt_conv_binary: + *conv = CONV_BINARY; + break; + case Opt_conv_text: + *conv = CONV_TEXT; + break; + case Opt_conv_auto: + *conv = CONV_AUTO; + break; + case Opt_check_none: + *chk = 0; + break; + case Opt_check_normal: + *chk = 1; + break; + case Opt_check_strict: + *chk = 2; + break; + case Opt_err_cont: + *errs = 0; + break; + case Opt_err_ro: + *errs = 1; + break; + case Opt_err_panic: + *errs = 2; + break; + case Opt_eas_no: + *eas = 0; + break; + case Opt_eas_ro: + *eas = 1; + break; + case Opt_eas_rw: + *eas = 2; + break; + case Opt_chkdsk_no: + *chkdsk = 0; + break; + case Opt_chkdsk_errors: + *chkdsk = 1; + break; + case Opt_chkdsk_always: + *chkdsk = 2; + break; + case Opt_timeshift: + { int m = 1; + char *rhs = args[0].from; if (!rhs || !*rhs) return 0; if (*rhs == '-') m = -1; @@ -270,79 +359,11 @@ *timeshift = simple_strtoul(rhs, &rhs, 0) * m; if (*rhs) return 0; + break; } - else if (!strcmp(p, "case")) { - if (!rhs || !*rhs) - return 0; - if (!strcmp(rhs, "lower")) - *lowercase = 1; - else if (!strcmp(rhs, "asis")) - *lowercase = 0; - else - return 0; - } - else if (!strcmp(p, "conv")) { - if (!rhs || !*rhs) - return 0; - if (!strcmp(rhs, "binary")) - *conv = CONV_BINARY; - else if (!strcmp(rhs, "text")) - *conv = CONV_TEXT; - else if (!strcmp(rhs, "auto")) - *conv = CONV_AUTO; - else - return 0; - } - else if (!strcmp(p, "check")) { - if (!rhs || !*rhs) - return 0; - if (!strcmp(rhs, "none")) - *chk = 0; - else if (!strcmp(rhs, "normal")) - *chk = 1; - else if (!strcmp(rhs, "strict")) - *chk = 2; - else - return 0; - } - else if (!strcmp(p, "errors")) { - if (!rhs || !*rhs) - return 0; - if (!strcmp(rhs, "continue")) - *errs = 0; - else if (!strcmp(rhs, "remount-ro")) - *errs = 1; - else if (!strcmp(rhs, "panic")) - *errs = 2; - else - return 0; - } - else if (!strcmp(p, "eas")) { - if (!rhs || !*rhs) - return 0; - if (!strcmp(rhs, "no")) - *eas = 0; - else if (!strcmp(rhs, "ro")) - *eas = 1; - else if (!strcmp(rhs, "rw")) - *eas = 2; - else - return 0; - } - else if (!strcmp(p, "chkdsk")) { - if (!rhs || !*rhs) - return 0; - if (!strcmp(rhs, "no")) - *chkdsk = 0; - else if (!strcmp(rhs, "errors")) - *chkdsk = 1; - else if (!strcmp(rhs, "always")) - *chkdsk = 2; - else - return 0; - } - else + default: return 0; + } } return 1; } diff -Nru a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c --- a/fs/hugetlbfs/inode.c Sun Oct 5 00:33:10 2003 +++ b/fs/hugetlbfs/inode.c Sun Oct 5 00:33:10 2003 @@ -648,11 +648,6 @@ struct hugetlbfs_config config; struct hugetlbfs_sb_info *sbinfo; - sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); - if (!sbinfo) - return -ENOMEM; - sb->s_fs_info = sbinfo; - config.nr_blocks = -1; /* No limit on size by default */ config.nr_inodes = -1; /* No limit on number of inodes by default */ config.uid = current->fsuid; @@ -663,6 +658,10 @@ if (ret) return ret; + sbinfo = kmalloc(sizeof(struct hugetlbfs_sb_info), GFP_KERNEL); + if (!sbinfo) + return -ENOMEM; + sb->s_fs_info = sbinfo; spin_lock_init(&sbinfo->stat_lock); sbinfo->max_blocks = config.nr_blocks; sbinfo->free_blocks = config.nr_blocks; @@ -675,15 +674,18 @@ inode = hugetlbfs_get_inode(sb, config.uid, config.gid, S_IFDIR | config.mode, 0); if (!inode) - return -ENOMEM; + goto out_free; root = d_alloc_root(inode); if (!root) { iput(inode); - return -ENOMEM; + goto out_free; } sb->s_root = root; return 0; +out_free: + kfree(sbinfo); + return -ENOMEM; } int hugetlb_get_quota(struct address_space *mapping) diff -Nru a/fs/inode.c b/fs/inode.c --- a/fs/inode.c Sun Oct 5 00:33:10 2003 +++ b/fs/inode.c Sun Oct 5 00:33:10 2003 @@ -195,6 +195,8 @@ i_size_ordered_init(inode); } +EXPORT_SYMBOL(inode_init_once); + static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) { struct inode * inode = (struct inode *) foo; @@ -229,7 +231,6 @@ * that the inode is no longer useful. We just * terminate it with extreme prejudice. */ - void clear_inode(struct inode *inode) { invalidate_inode_buffers(inode); @@ -251,6 +252,8 @@ inode->i_state = I_CLEAR; } +EXPORT_SYMBOL(clear_inode); + /* * Dispose-list gets a local list with local inodes in it, so it doesn't * need to worry about list corruption and SMP locks. @@ -327,7 +330,6 @@ * fails because there are busy inodes then a non zero value is returned. * If the discard is successful all the inodes have been discarded. */ - int invalidate_inodes(struct super_block * sb) { int busy; @@ -346,6 +348,8 @@ return busy; } + +EXPORT_SYMBOL(invalidate_inodes); int __invalidate_device(struct block_device *bdev, int do_sync) { @@ -372,6 +376,8 @@ return res; } +EXPORT_SYMBOL(__invalidate_device); + static int can_unuse(struct inode *inode) { if (inode->i_state) @@ -532,7 +538,6 @@ * * Allocates a new inode for given superblock. */ - struct inode *new_inode(struct super_block *sb) { static unsigned long last_ino; @@ -552,6 +557,8 @@ return inode; } +EXPORT_SYMBOL(new_inode); + void unlock_new_inode(struct inode *inode) { /* @@ -565,6 +572,7 @@ inode->i_state &= ~(I_LOCK|I_NEW); wake_up_inode(inode); } + EXPORT_SYMBOL(unlock_new_inode); /* @@ -685,7 +693,6 @@ * With a large number of inodes live on the file system this function * currently becomes quite slow. */ - ino_t iunique(struct super_block *sb, ino_t max_reserved) { static ino_t counter; @@ -709,6 +716,8 @@ } +EXPORT_SYMBOL(iunique); + struct inode *igrab(struct inode *inode) { spin_lock(&inode_lock); @@ -725,6 +734,8 @@ return inode; } +EXPORT_SYMBOL(igrab); + /** * ifind - internal function, you want ilookup5() or iget5(). * @sb: super block of file system to search @@ -818,6 +829,7 @@ return ifind(sb, head, test, data); } + EXPORT_SYMBOL(ilookup5); /** @@ -840,6 +852,7 @@ return ifind_fast(sb, head, ino); } + EXPORT_SYMBOL(ilookup); /** @@ -880,6 +893,7 @@ */ return get_new_inode(sb, head, test, set, data); } + EXPORT_SYMBOL(iget5_locked); /** @@ -913,6 +927,7 @@ */ return get_new_inode_fast(sb, head, ino); } + EXPORT_SYMBOL(iget_locked); /** @@ -923,7 +938,6 @@ * * Add an inode to the inode hash for this superblock. */ - void __insert_inode_hash(struct inode *inode, unsigned long hashval) { struct hlist_head *head = inode_hashtable + hash(inode->i_sb, hashval); @@ -932,13 +946,14 @@ spin_unlock(&inode_lock); } +EXPORT_SYMBOL(__insert_inode_hash); + /** * remove_inode_hash - remove an inode from the hash * @inode: inode to unhash * * Remove an inode from the superblock. */ - void remove_inode_hash(struct inode *inode) { spin_lock(&inode_lock); @@ -946,6 +961,8 @@ spin_unlock(&inode_lock); } +EXPORT_SYMBOL(remove_inode_hash); + /* * Tell the filesystem that this inode is no longer of any interest and should * be completely destroyed. @@ -988,6 +1005,7 @@ BUG(); destroy_inode(inode); } + EXPORT_SYMBOL(generic_delete_inode); static void generic_forget_inode(struct inode *inode) @@ -1059,7 +1077,6 @@ * Puts an inode, dropping its usage count. If the inode use count hits * zero the inode is also then freed and may be destroyed. */ - void iput(struct inode *inode) { if (inode) { @@ -1076,6 +1093,8 @@ } } +EXPORT_SYMBOL(iput); + /** * bmap - find a block number in a file * @inode: inode of file @@ -1087,7 +1106,6 @@ * disk block relative to the disk start that holds that block of the * file. */ - sector_t bmap(struct inode * inode, sector_t block) { sector_t res = 0; @@ -1096,6 +1114,8 @@ return res; } +EXPORT_SYMBOL(bmap); + /* * Return true if the filesystem which backs this inode considers the two * passed timespecs to be sufficiently different to warrant flushing the @@ -1117,7 +1137,6 @@ * This function automatically handles read only file systems and media, * as well as the "noatime" flag and inode specific "noatime" markers. */ - void update_atime(struct inode *inode) { struct timespec now; @@ -1139,6 +1158,8 @@ } } +EXPORT_SYMBOL(update_atime); + /** * inode_update_time - update mtime and ctime time * @inode: inode accessed @@ -1170,6 +1191,7 @@ if (sync_it) mark_inode_dirty_sync(inode); } + EXPORT_SYMBOL(inode_update_time); int inode_needs_sync(struct inode *inode) @@ -1180,6 +1202,7 @@ return 1; return 0; } + EXPORT_SYMBOL(inode_needs_sync); /* @@ -1375,3 +1398,5 @@ printk(KERN_DEBUG "init_special_inode: bogus i_mode (%o)\n", mode); } + +EXPORT_SYMBOL(init_special_inode); diff -Nru a/fs/isofs/inode.c b/fs/isofs/inode.c --- a/fs/isofs/inode.c Sun Oct 5 00:33:10 2003 +++ b/fs/isofs/inode.c Sun Oct 5 00:33:10 2003 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -328,9 +329,52 @@ } #endif +enum { + Opt_block, Opt_check_r, Opt_check_s, Opt_cruft, Opt_gid, Opt_ignore, + Opt_iocharset, Opt_map_a, Opt_map_n, Opt_map_o, Opt_mode, Opt_nojoliet, + Opt_norock, Opt_sb, Opt_session, Opt_uid, Opt_unhide, Opt_utf8, Opt_err, + Opt_nocompress, +}; + +static match_table_t tokens = { + {Opt_norock, "norock"}, + {Opt_nojoliet, "nojoliet"}, + {Opt_unhide, "unhide"}, + {Opt_cruft, "cruft"}, + {Opt_utf8, "utf8"}, + {Opt_iocharset, "iocharset=%s"}, + {Opt_map_a, "map=acorn"}, + {Opt_map_a, "map=a"}, + {Opt_map_n, "map=normal"}, + {Opt_map_n, "map=n"}, + {Opt_map_o, "map=off"}, + {Opt_map_o, "map=o"}, + {Opt_session, "session=%u"}, + {Opt_sb, "sbsector=%u"}, + {Opt_check_r, "check=relaxed"}, + {Opt_check_r, "check=r"}, + {Opt_check_s, "check=strict"}, + {Opt_check_s, "check=s"}, + {Opt_uid, "uid=%u"}, + {Opt_gid, "gid=%u"}, + {Opt_mode, "mode=%u"}, + {Opt_block, "block=%u"}, + {Opt_ignore, "conv=binary"}, + {Opt_ignore, "conv=b"}, + {Opt_ignore, "conv=text"}, + {Opt_ignore, "conv=t"}, + {Opt_ignore, "conv=mtext"}, + {Opt_ignore, "conv=m"}, + {Opt_ignore, "conv=auto"}, + {Opt_ignore, "conv=a"}, + {Opt_nocompress, "nocompress"}, + {Opt_err, NULL} +}; + static int parse_options(char *options, struct iso9660_options * popt) { - char *this_char,*value; + char *p; + int option; popt->map = 'n'; popt->rock = 'y'; @@ -350,112 +394,101 @@ popt->utf8 = 0; popt->session=-1; popt->sbsector=-1; - if (!options) return 1; - while ((this_char = strsep(&options,",")) != NULL) { - if (!*this_char) + if (!options) + return 1; + + while ((p = strsep(&options, ",")) != NULL) { + int token; + substring_t args[MAX_OPT_ARGS]; + unsigned n; + + if (!*p) continue; - if (strncmp(this_char,"norock",6) == 0) { - popt->rock = 'n'; - continue; - } - if (strncmp(this_char,"nojoliet",8) == 0) { - popt->joliet = 'n'; - continue; - } - if (strncmp(this_char,"unhide",6) == 0) { - popt->unhide = 'y'; - continue; - } - if (strncmp(this_char,"cruft",5) == 0) { - popt->cruft = 'y'; - continue; - } - if (strncmp(this_char,"utf8",4) == 0) { - popt->utf8 = 1; - continue; - } - if (strncmp(this_char,"nocompress",10) == 0) { - popt->nocompress = 1; - continue; - } - if ((value = strchr(this_char,'=')) != NULL) - *value++ = 0; + token = match_token(p, tokens, args); + switch (token) { + case Opt_norock: + popt->rock = 'n'; + break; + case Opt_nojoliet: + popt->joliet = 'n'; + break; + case Opt_unhide: + popt->unhide = 'y'; + break; + case Opt_cruft: + popt->cruft = 'y'; + break; + case Opt_utf8: + popt->utf8 = 1; + break; #ifdef CONFIG_JOLIET - if (!strcmp(this_char,"iocharset") && value) { - popt->iocharset = value; - while (*value && *value != ',') - value++; - if (value == popt->iocharset) + case Opt_iocharset: + popt->iocharset = match_strdup(&args[0]); + break; +#endif + case Opt_map_a: + popt->map = 'a'; + break; + case Opt_map_o: + popt->map = 'o'; + break; + case Opt_map_n: + popt->map = 'n'; + break; + case Opt_session: + if (match_int(&args[0], &option)) return 0; - *value = 0; - } else -#endif - if (!strcmp(this_char,"map") && value) { - if (value[0] && !value[1] && strchr("ano",*value)) - popt->map = *value; - else if (!strcmp(value,"off")) popt->map = 'o'; - else if (!strcmp(value,"normal")) popt->map = 'n'; - else if (!strcmp(value,"acorn")) popt->map = 'a'; - else return 0; - } - if (!strcmp(this_char,"session") && value) { - char * vpnt = value; - unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0); - if(ivalue < 0 || ivalue >99) return 0; - popt->session=ivalue+1; - } - if (!strcmp(this_char,"sbsector") && value) { - char * vpnt = value; - unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0); - if(ivalue < 0 || ivalue >660*512) return 0; - popt->sbsector=ivalue; - } - else if (!strcmp(this_char,"check") && value) { - if (value[0] && !value[1] && strchr("rs",*value)) - popt->check = *value; - else if (!strcmp(value,"relaxed")) popt->check = 'r'; - else if (!strcmp(value,"strict")) popt->check = 's'; - else return 0; - } - else if (!strcmp(this_char,"conv") && value) { - /* no conversion is done anymore; - we still accept the same mount options, - but ignore them */ - if (value[0] && !value[1] && strchr("btma",*value)) ; - else if (!strcmp(value,"binary")) ; - else if (!strcmp(value,"text")) ; - else if (!strcmp(value,"mtext")) ; - else if (!strcmp(value,"auto")) ; - else return 0; - } - else if (value && - (!strcmp(this_char,"block") || - !strcmp(this_char,"mode") || - !strcmp(this_char,"uid") || - !strcmp(this_char,"gid"))) { - char * vpnt = value; - unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0); - if (*vpnt) return 0; - switch(*this_char) { - case 'b': - if ( ivalue != 512 - && ivalue != 1024 - && ivalue != 2048) return 0; - popt->blocksize = ivalue; - break; - case 'u': - popt->uid = ivalue; - break; - case 'g': - popt->gid = ivalue; - break; - case 'm': - popt->mode = ivalue; - break; - } + n = option; + if (n > 99) + return 0; + popt->session = n + 1; + break; + case Opt_sb: + if (match_int(&args[0], &option)) + return 0; + n = option; + if (n > 660 * 512) + return 0; + popt->sbsector = n; + break; + case Opt_check_r: + popt->check = 'r'; + break; + case Opt_check_s: + popt->check = 's'; + break; + case Opt_ignore: + break; + case Opt_uid: + if (match_int(&args[0], &option)) + return 0; + popt->uid = option; + break; + case Opt_gid: + if (match_int(&args[0], &option)) + return 0; + popt->gid = option; + break; + case Opt_mode: + if (match_int(&args[0], &option)) + return 0; + popt->mode = option; + break; + case Opt_block: + if (match_int(&args[0], &option)) + return 0; + n = option; + if (n != 512 && n != 1024 && n != 2048) + return 0; + popt->blocksize = n; + break; + case Opt_nocompress: + popt->nocompress = 1; + break; + default: + return 0; } - else return 1; } return 1; } @@ -842,6 +875,9 @@ if (opt.check == 'r') table++; s->s_root->d_op = &isofs_dentry_ops[table]; + if (opt.iocharset) + kfree(opt.iocharset); + return 0; /* @@ -879,6 +915,8 @@ out_freebh: brelse(bh); out_freesbi: + if (opt.iocharset) + kfree(opt.iocharset); kfree(sbi); s->s_fs_info = NULL; return -EINVAL; diff -Nru a/fs/jbd/journal.c b/fs/jbd/journal.c --- a/fs/jbd/journal.c Sun Oct 5 00:33:06 2003 +++ b/fs/jbd/journal.c Sun Oct 5 00:33:06 2003 @@ -1800,7 +1800,7 @@ return ret; } -int write_jbd_debug(struct file *file, const char *buffer, +int write_jbd_debug(struct file *file, const char __user *buffer, unsigned long count, void *data) { char buf[32]; diff -Nru a/fs/jfs/jfs_debug.c b/fs/jfs/jfs_debug.c --- a/fs/jfs/jfs_debug.c Sun Oct 5 00:33:09 2003 +++ b/fs/jfs/jfs_debug.c Sun Oct 5 00:33:09 2003 @@ -81,7 +81,7 @@ return len; } -static int loglevel_write(struct file *file, const char *buffer, +static int loglevel_write(struct file *file, const char __user *buffer, unsigned long count, void *data) { char c; diff -Nru a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c --- a/fs/jfs/jfs_imap.c Sun Oct 5 00:33:06 2003 +++ b/fs/jfs/jfs_imap.c Sun Oct 5 00:33:06 2003 @@ -838,7 +838,7 @@ */ if (S_ISDIR(ip->i_mode) && (ip->i_ipmnt->i_mntflag & JFS_DASD_ENABLED)) - bcopy(&ip->i_DASD, &dp->di_DASD, sizeof(struct dasd)); + memcpy(&dp->di_DASD, &ip->i_DASD, sizeof(struct dasd)); #endif /* _JFS_FASTDASD */ /* release the buffer holding the updated on-disk inode. diff -Nru a/fs/jfs/super.c b/fs/jfs/super.c --- a/fs/jfs/super.c Sun Oct 5 00:33:08 2003 +++ b/fs/jfs/super.c Sun Oct 5 00:33:08 2003 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -164,59 +165,82 @@ kfree(sbi); } +enum { + Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize, + Opt_ignore, Opt_err, +}; + +static match_table_t tokens = { + {Opt_integrity, "integrity"}, + {Opt_nointegrity, "nointegrity"}, + {Opt_iocharset, "iocharset=%s"}, + {Opt_resize, "resize=%u"}, + {Opt_ignore, "noquota"}, + {Opt_ignore, "quota"}, + {Opt_ignore, "usrquota"}, + {Opt_ignore, "grpquota"}, + {Opt_err, NULL} +}; + static int parse_options(char *options, struct super_block *sb, s64 *newLVSize, int *flag) { void *nls_map = NULL; - char *this_char; - char *value; + char *p; struct jfs_sb_info *sbi = JFS_SBI(sb); *newLVSize = 0; if (!options) return 1; - while ((this_char = strsep(&options, ",")) != NULL) { - if (!*this_char) + + while ((p = strsep(&options, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; + if (!*p) continue; - if ((value = strchr(this_char, '=')) != NULL) - *value++ = 0; - if (!strcmp(this_char, "integrity")) { + + token = match_token(p, tokens, args); + switch (token) { + case Opt_integrity: *flag &= ~JFS_NOINTEGRITY; - } else if (!strcmp(this_char, "nointegrity")) { + break; + case Opt_nointegrity: *flag |= JFS_NOINTEGRITY; - } else if (!strcmp(this_char, "iocharset")) { - if (!value || !*value) - goto needs_arg; + break; + case Opt_ignore: + /* Silently ignore the quota options */ + /* Don't do anything ;-) */ + break; + case Opt_iocharset: if (nls_map) /* specified iocharset twice! */ unload_nls(nls_map); - nls_map = load_nls(value); + nls_map = load_nls(args[0].from); if (!nls_map) { printk(KERN_ERR "JFS: charset not found\n"); goto cleanup; } - } else if (!strcmp(this_char, "resize")) { - if (!value || !*value) { + break; + case Opt_resize: + { + char *resize = args[0].from; + if (!resize || !*resize) { *newLVSize = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; if (*newLVSize == 0) printk(KERN_ERR - "JFS: Cannot determine volume size\n"); + "JFS: Cannot determine volume size\n"); } else - *newLVSize = simple_strtoull(value, &value, 0); - - /* Silently ignore the quota options */ - } else if (!strcmp(this_char, "grpquota") - || !strcmp(this_char, "noquota") - || !strcmp(this_char, "quota") - || !strcmp(this_char, "usrquota")) - /* Don't do anything ;-) */ ; - else { - printk("jfs: Unrecognized mount option %s\n", - this_char); + *newLVSize = simple_strtoull(resize, &resize, 0); + break; + } + default: + printk("jfs: Unrecognized mount option \"%s\" " + " or missing value\n", p); goto cleanup; } } + if (nls_map) { /* Discard old (if remount) */ if (sbi->nls_tab) @@ -224,8 +248,7 @@ sbi->nls_tab = nls_map; } return 1; -needs_arg: - printk(KERN_ERR "JFS: %s needs an argument\n", this_char); + cleanup: if (nls_map) unload_nls(nls_map); diff -Nru a/fs/jfs/symlink.c b/fs/jfs/symlink.c --- a/fs/jfs/symlink.c Sun Oct 5 00:33:10 2003 +++ b/fs/jfs/symlink.c Sun Oct 5 00:33:10 2003 @@ -26,7 +26,7 @@ return vfs_follow_link(nd, s); } -static int jfs_readlink(struct dentry *dentry, char *buffer, int buflen) +static int jfs_readlink(struct dentry *dentry, char __user *buffer, int buflen) { char *s = JFS_IP(dentry->d_inode)->i_inline; return vfs_readlink(dentry, buffer, buflen, s); diff -Nru a/fs/libfs.c b/fs/libfs.c --- a/fs/libfs.c Sun Oct 5 00:33:05 2003 +++ b/fs/libfs.c Sun Oct 5 00:33:05 2003 @@ -429,3 +429,26 @@ spin_unlock(&pin_fs_lock); mntput(mnt); } + +EXPORT_SYMBOL(dcache_dir_close); +EXPORT_SYMBOL(dcache_dir_lseek); +EXPORT_SYMBOL(dcache_dir_open); +EXPORT_SYMBOL(dcache_readdir); +EXPORT_SYMBOL(generic_read_dir); +EXPORT_SYMBOL(simple_commit_write); +EXPORT_SYMBOL(simple_dir_inode_operations); +EXPORT_SYMBOL(simple_dir_operations); +EXPORT_SYMBOL(simple_empty); +EXPORT_SYMBOL(simple_fill_super); +EXPORT_SYMBOL(simple_getattr); +EXPORT_SYMBOL(simple_link); +EXPORT_SYMBOL(simple_lookup); +EXPORT_SYMBOL(simple_pin_fs); +EXPORT_SYMBOL(simple_prepare_write); +EXPORT_SYMBOL(simple_readpage); +EXPORT_SYMBOL(simple_release_fs); +EXPORT_SYMBOL(simple_rename); +EXPORT_SYMBOL(simple_rmdir); +EXPORT_SYMBOL(simple_statfs); +EXPORT_SYMBOL(simple_sync_file); +EXPORT_SYMBOL(simple_unlink); diff -Nru a/fs/namei.c b/fs/namei.c --- a/fs/namei.c Sun Oct 5 00:33:07 2003 +++ b/fs/namei.c Sun Oct 5 00:33:07 2003 @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -218,7 +219,7 @@ if (retval) return retval; - return security_inode_permission(inode, mask); + return security_inode_permission(inode, mask, nd); } /* @@ -302,7 +303,8 @@ * short-cut DAC fails, then call permission() to do more * complete permission check. */ -static inline int exec_permission_lite(struct inode *inode) +static inline int exec_permission_lite(struct inode *inode, + struct nameidata *nd) { umode_t mode = inode->i_mode; @@ -325,7 +327,7 @@ return -EACCES; ok: - return security_inode_permission(inode, MAY_EXEC); + return security_inode_permission(inode, MAY_EXEC, nd); } /* @@ -584,7 +586,7 @@ struct qstr this; unsigned int c; - err = exec_permission_lite(inode); + err = exec_permission_lite(inode, nd); if (err == -EAGAIN) { err = permission(inode, MAY_EXEC, nd); } @@ -2275,3 +2277,33 @@ .readlink = page_readlink, .follow_link = page_follow_link, }; + +EXPORT_SYMBOL(__user_walk); +EXPORT_SYMBOL(follow_down); +EXPORT_SYMBOL(follow_up); +EXPORT_SYMBOL(get_write_access); /* binfmt_aout */ +EXPORT_SYMBOL(getname); +EXPORT_SYMBOL(lock_rename); +EXPORT_SYMBOL(lookup_create); +EXPORT_SYMBOL(lookup_hash); +EXPORT_SYMBOL(lookup_one_len); +EXPORT_SYMBOL(page_follow_link); +EXPORT_SYMBOL(page_readlink); +EXPORT_SYMBOL(page_symlink); +EXPORT_SYMBOL(page_symlink_inode_operations); +EXPORT_SYMBOL(path_lookup); +EXPORT_SYMBOL(path_release); +EXPORT_SYMBOL(path_walk); +EXPORT_SYMBOL(permission); +EXPORT_SYMBOL(unlock_rename); +EXPORT_SYMBOL(vfs_create); +EXPORT_SYMBOL(vfs_follow_link); +EXPORT_SYMBOL(vfs_link); +EXPORT_SYMBOL(vfs_mkdir); +EXPORT_SYMBOL(vfs_mknod); +EXPORT_SYMBOL(vfs_permission); +EXPORT_SYMBOL(vfs_readlink); +EXPORT_SYMBOL(vfs_rename); +EXPORT_SYMBOL(vfs_rmdir); +EXPORT_SYMBOL(vfs_symlink); +EXPORT_SYMBOL(vfs_unlink); diff -Nru a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c --- a/fs/nfsd/nfsctl.c Sun Oct 5 00:33:07 2003 +++ b/fs/nfsd/nfsctl.c Sun Oct 5 00:33:07 2003 @@ -429,6 +429,7 @@ static int __init init_nfsd(void) { + int retval; printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); nfsd_stat_init(); /* Statistics */ @@ -441,8 +442,16 @@ if (entry) entry->proc_fops = &exports_operations; } - register_filesystem(&nfsd_fs_type); - return 0; + retval = register_filesystem(&nfsd_fs_type); + if (retval) { + nfsd_export_shutdown(); + nfsd_cache_shutdown(); + remove_proc_entry("fs/nfs/exports", NULL); + remove_proc_entry("fs/nfs", NULL); + nfsd_stat_shutdown(); + nfsd_lockd_shutdown(); + } + return retval; } static void __exit exit_nfsd(void) diff -Nru a/fs/proc/inode.c b/fs/proc/inode.c --- a/fs/proc/inode.c Sun Oct 5 00:33:10 2003 +++ b/fs/proc/inode.c Sun Oct 5 00:33:10 2003 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -135,34 +136,47 @@ .statfs = simple_statfs, }; +enum { + Opt_uid, Opt_gid, Opt_err +}; + +static match_table_t tokens = { + {Opt_uid, "uid=%u"}, + {Opt_gid, "gid=%u"}, + {Opt_err, NULL} +}; + static int parse_options(char *options,uid_t *uid,gid_t *gid) { - char *this_char,*value; + char *p; + int option; *uid = current->uid; *gid = current->gid; if (!options) return 1; - while ((this_char = strsep(&options,",")) != NULL) { - if (!*this_char) + + while ((p = strsep(&options, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; + if (!*p) continue; - if ((value = strchr(this_char,'=')) != NULL) - *value++ = 0; - if (!strcmp(this_char,"uid")) { - if (!value || !*value) - return 0; - *uid = simple_strtoul(value,&value,0); - if (*value) - return 0; - } - else if (!strcmp(this_char,"gid")) { - if (!value || !*value) + + token = match_token(p, tokens, args); + switch (token) { + case Opt_uid: + if (match_int(args, &option)) return 0; - *gid = simple_strtoul(value,&value,0); - if (*value) + *uid = option; + break; + case Opt_gid: + if (match_int(args, &option)) return 0; + *gid = option; + break; + default: + return 0; } - else return 1; } return 1; } diff -Nru a/fs/seq_file.c b/fs/seq_file.c --- a/fs/seq_file.c Sun Oct 5 00:33:09 2003 +++ b/fs/seq_file.c Sun Oct 5 00:33:09 2003 @@ -6,6 +6,7 @@ */ #include +#include #include #include @@ -37,6 +38,8 @@ return 0; } +EXPORT_SYMBOL(seq_open); + /** * seq_read - ->read() method for sequential files. * @file, @buf, @size, @ppos: see file_operations method @@ -144,6 +147,8 @@ goto Done; } +EXPORT_SYMBOL(seq_read); + static int traverse(struct seq_file *m, loff_t offset) { loff_t pos = 0; @@ -228,6 +233,8 @@ return retval; } +EXPORT_SYMBOL(seq_lseek); + /** * seq_release - free the structures associated with sequential file. * @file: file in question @@ -244,6 +251,8 @@ return 0; } +EXPORT_SYMBOL(seq_release); + /** * seq_escape - print string into buffer, escaping some characters * @m: target buffer @@ -279,6 +288,8 @@ return 0; } +EXPORT_SYMBOL(seq_escape); + int seq_printf(struct seq_file *m, const char *f, ...) { va_list args; @@ -297,9 +308,11 @@ return -1; } +EXPORT_SYMBOL(seq_printf); + int seq_path(struct seq_file *m, - struct vfsmount *mnt, struct dentry *dentry, - char *esc) + struct vfsmount *mnt, struct dentry *dentry, + char *esc) { if (m->count < m->size) { char *s = m->buf + m->count; @@ -328,6 +341,8 @@ return -1; } +EXPORT_SYMBOL(seq_path); + static void *single_start(struct seq_file *p, loff_t *pos) { return NULL + (*pos == 0); @@ -343,7 +358,8 @@ { } -int single_open(struct file *file, int (*show)(struct seq_file *, void*), void *data) +int single_open(struct file *file, int (*show)(struct seq_file *, void *), + void *data) { struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL); int res = -ENOMEM; @@ -362,6 +378,8 @@ return res; } +EXPORT_SYMBOL(single_open); + int single_release(struct inode *inode, struct file *file) { struct seq_operations *op = ((struct seq_file *)file->private_data)->op; @@ -370,6 +388,8 @@ return res; } +EXPORT_SYMBOL(single_release); + int seq_release_private(struct inode *inode, struct file *file) { struct seq_file *seq = file->private_data; @@ -379,3 +399,4 @@ return seq_release(inode, file); } +EXPORT_SYMBOL(seq_release_private); diff -Nru a/fs/smbfs/inode.c b/fs/smbfs/inode.c --- a/fs/smbfs/inode.c Sun Oct 5 00:33:06 2003 +++ b/fs/smbfs/inode.c Sun Oct 5 00:33:06 2003 @@ -551,8 +551,8 @@ if (ver == SMB_MOUNT_OLDVERSION) { mnt->version = oldmnt->version; - mnt->uid = low2highuid(oldmnt->uid); - mnt->gid = low2highuid(oldmnt->gid); + mnt->uid = OLD_TO_NEW_UID(oldmnt->uid); + mnt->gid = OLD_TO_NEW_GID(oldmnt->gid); mnt->file_mode = (oldmnt->file_mode & S_IRWXUGO) | S_IFREG; mnt->dir_mode = (oldmnt->dir_mode & S_IRWXUGO) | S_IFDIR; diff -Nru a/fs/super.c b/fs/super.c --- a/fs/super.c Sun Oct 5 00:33:08 2003 +++ b/fs/super.c Sun Oct 5 00:33:08 2003 @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -134,6 +135,8 @@ } } +EXPORT_SYMBOL(deactivate_super); + /** * grab_super - acquire an active reference * @s - reference we are trying to make active @@ -214,6 +217,8 @@ up_write(&sb->s_umount); } +EXPORT_SYMBOL(generic_shutdown_super); + /** * sget - find or create a superblock * @type: filesystem type superblock should belong to @@ -226,13 +231,10 @@ int (*set)(struct super_block *,void *), void *data) { - struct super_block *s = alloc_super(); + struct super_block *s = NULL; struct list_head *p; int err; - if (!s) - return ERR_PTR(-ENOMEM); - retry: spin_lock(&sb_lock); if (test) list_for_each(p, &type->fs_supers) { @@ -242,9 +244,18 @@ continue; if (!grab_super(old)) goto retry; - destroy_super(s); + if (s) + destroy_super(s); return old; } + if (!s) { + spin_unlock(&sb_lock); + s = alloc_super(); + if (!s) + return ERR_PTR(-ENOMEM); + goto retry; + } + err = set(s, data); if (err) { spin_unlock(&sb_lock); @@ -259,12 +270,16 @@ return s; } +EXPORT_SYMBOL(sget); + void drop_super(struct super_block *sb) { up_read(&sb->s_umount); put_super(sb); } +EXPORT_SYMBOL(drop_super); + static inline void write_super(struct super_block *sb) { lock_super(sb); @@ -382,6 +397,8 @@ spin_unlock(&sb_lock); return NULL; } + +EXPORT_SYMBOL(get_super); struct super_block * user_get_super(dev_t dev) { @@ -405,6 +422,8 @@ return NULL; } +EXPORT_SYMBOL(user_get_super); + asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf) { struct super_block *s; @@ -534,6 +553,8 @@ return 0; } +EXPORT_SYMBOL(set_anon_super); + void kill_anon_super(struct super_block *sb) { int slot = MINOR(sb->s_dev); @@ -543,6 +564,8 @@ spin_unlock(&unnamed_dev_lock); } +EXPORT_SYMBOL(kill_anon_super); + void kill_litter_super(struct super_block *sb) { if (sb->s_root) @@ -550,6 +573,8 @@ kill_anon_super(sb); } +EXPORT_SYMBOL(kill_litter_super); + static int set_bdev_super(struct super_block *s, void *data) { s->s_bdev = data; @@ -608,6 +633,8 @@ return s; } +EXPORT_SYMBOL(get_sb_bdev); + void kill_block_super(struct super_block *sb) { struct block_device *bdev = sb->s_bdev; @@ -616,6 +643,8 @@ close_bdev_excl(bdev, BDEV_FS); } +EXPORT_SYMBOL(kill_block_super); + struct super_block *get_sb_nodev(struct file_system_type *fs_type, int flags, void *data, int (*fill_super)(struct super_block *, void *, int)) @@ -638,6 +667,8 @@ return s; } +EXPORT_SYMBOL(get_sb_nodev); + static int compare_single(struct super_block *s, void *p) { return 1; @@ -667,6 +698,8 @@ return s; } +EXPORT_SYMBOL(get_sb_single); + struct vfsmount * do_kern_mount(const char *fstype, int flags, const char *name, void *data) { @@ -709,3 +742,5 @@ { return do_kern_mount(type->name, 0, type->name, NULL); } + +EXPORT_SYMBOL(kern_mount); diff -Nru a/fs/udf/inode.c b/fs/udf/inode.c --- a/fs/udf/inode.c Sun Oct 5 00:33:10 2003 +++ b/fs/udf/inode.c Sun Oct 5 00:33:10 2003 @@ -127,6 +127,7 @@ void udf_clear_inode(struct inode *inode) { kfree(UDF_I_DATA(inode)); + UDF_I_DATA(inode) = NULL; } void udf_discard_prealloc(struct inode * inode) diff -Nru a/fs/udf/super.c b/fs/udf/super.c --- a/fs/udf/super.c Sun Oct 5 00:33:09 2003 +++ b/fs/udf/super.c Sun Oct 5 00:33:09 2003 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -132,8 +133,10 @@ struct udf_inode_info *ei = (struct udf_inode_info *) foo; if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == - SLAB_CTOR_CONSTRUCTOR) + SLAB_CTOR_CONSTRUCTOR) { + ei->i_ext.i_data = NULL; inode_init_once(&ei->vfs_inode); + } } static int init_inodecache(void) @@ -225,7 +228,7 @@ * gid= Set the default group. * umask= Set the default umask. * uid= Set the default user. - * bs= Set the block size. + * bs= Set the block size. * unhide Show otherwise hidden files. * undelete Show deleted files in lists. * adinicb Embed data in the inode (default) @@ -259,18 +262,53 @@ * uopts Pointer to mount options variable. * * POST-CONDITIONS - * 0 Mount options parsed okay. - * -1 Error parsing mount options. + * 1 Mount options parsed okay. + * 0 Error parsing mount options. * * HISTORY * July 1, 1997 - Andrew E. Mileski * Written, tested, and released. */ +enum { + Opt_novrs, Opt_nostrict, Opt_bs, Opt_unhide, Opt_undelete, + Opt_noadinicb, Opt_adinicb, Opt_shortad, Opt_longad, + Opt_gid, Opt_uid, Opt_umask, Opt_session, Opt_lastblock, + Opt_anchor, Opt_volume, Opt_partition, Opt_fileset, + Opt_rootdir, Opt_utf8, Opt_iocharset, + Opt_err +}; + +static match_table_t tokens = { + {Opt_novrs, "novrs"}, + {Opt_nostrict, "nostrict"}, + {Opt_bs, "bs=%u"}, + {Opt_unhide, "unhide"}, + {Opt_undelete, "undelete"}, + {Opt_noadinicb, "noadinicb"}, + {Opt_adinicb, "adinicb"}, + {Opt_shortad, "shortad"}, + {Opt_longad, "longad"}, + {Opt_gid, "gid=%u"}, + {Opt_uid, "uid=%u"}, + {Opt_umask, "umask=%o"}, + {Opt_session, "session=%u"}, + {Opt_lastblock, "lastblock=%u"}, + {Opt_anchor, "anchor=%u"}, + {Opt_volume, "volume=%u"}, + {Opt_partition, "partition=%u"}, + {Opt_fileset, "fileset=%u"}, + {Opt_rootdir, "rootdir=%u"}, + {Opt_utf8, "utf8"}, + {Opt_iocharset, "iocharset=%s"}, + {Opt_err, NULL} +}; + static int udf_parse_options(char *options, struct udf_options *uopt) { - char *opt, *val; + char *p; + int option; uopt->novrs = 0; uopt->blocksize = 2048; @@ -286,71 +324,106 @@ if (!options) return 1; - while ((opt = strsep(&options, ",")) != NULL) - { - if (!*opt) + while ((p = strsep(&options, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; + if (!*p) continue; - /* Make "opt=val" into two strings */ - val = strchr(opt, '='); - if (val) - *(val++) = 0; - if (!strcmp(opt, "novrs") && !val) + + token = match_token(p, tokens, args); + switch (token) { + case Opt_novrs: uopt->novrs = 1; - else if (!strcmp(opt, "bs") && val) - uopt->blocksize = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "unhide") && !val) + break; + case Opt_bs: + if (match_int(&args[0], &option)) + return 0; + uopt->blocksize = option; + break; + case Opt_unhide: uopt->flags |= (1 << UDF_FLAG_UNHIDE); - else if (!strcmp(opt, "undelete") && !val) + break; + case Opt_undelete: uopt->flags |= (1 << UDF_FLAG_UNDELETE); - else if (!strcmp(opt, "noadinicb") && !val) + break; + case Opt_noadinicb: uopt->flags &= ~(1 << UDF_FLAG_USE_AD_IN_ICB); - else if (!strcmp(opt, "adinicb") && !val) + break; + case Opt_adinicb: uopt->flags |= (1 << UDF_FLAG_USE_AD_IN_ICB); - else if (!strcmp(opt, "shortad") && !val) + break; + case Opt_shortad: uopt->flags |= (1 << UDF_FLAG_USE_SHORT_AD); - else if (!strcmp(opt, "longad") && !val) + break; + case Opt_longad: uopt->flags &= ~(1 << UDF_FLAG_USE_SHORT_AD); - else if (!strcmp(opt, "gid") && val) - uopt->gid = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "umask") && val) - uopt->umask = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "nostrict") && !val) + break; + case Opt_gid: + if (match_int(args, &option)) + return 0; + uopt->gid = option; + break; + case Opt_uid: + if (match_int(args, &option)) + return 0; + uopt->uid = option; + break; + case Opt_umask: + if (match_octal(args, &option)) + return 0; + uopt->umask = option; + break; + case Opt_nostrict: uopt->flags &= ~(1 << UDF_FLAG_STRICT); - else if (!strcmp(opt, "uid") && val) - uopt->uid = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "session") && val) - uopt->session = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "lastblock") && val) - uopt->lastblock = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "anchor") && val) - uopt->anchor = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "volume") && val) - uopt->volume = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "partition") && val) - uopt->partition = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "fileset") && val) - uopt->fileset = simple_strtoul(val, NULL, 0); - else if (!strcmp(opt, "rootdir") && val) - uopt->rootdir = simple_strtoul(val, NULL, 0); + break; + case Opt_session: + if (match_int(args, &option)) + return 0; + uopt->session = option; + break; + case Opt_lastblock: + if (match_int(args, &option)) + return 0; + uopt->lastblock = option; + break; + case Opt_anchor: + if (match_int(args, &option)) + return 0; + uopt->anchor = option; + break; + case Opt_volume: + if (match_int(args, &option)) + return 0; + uopt->volume = option; + break; + case Opt_partition: + if (match_int(args, &option)) + return 0; + uopt->partition = option; + break; + case Opt_fileset: + if (match_int(args, &option)) + return 0; + uopt->fileset = option; + break; + case Opt_rootdir: + if (match_int(args, &option)) + return 0; + uopt->rootdir = option; + break; + case Opt_utf8: + uopt->flags |= (1 << UDF_FLAG_UTF8); + break; #ifdef CONFIG_NLS - else if (!strcmp(opt, "iocharset") && val) - { - uopt->nls_map = load_nls(val); + case Opt_iocharset: + uopt->nls_map = load_nls(args[0].from); uopt->flags |= (1 << UDF_FLAG_NLS_MAP); - } + break; #endif - else if (!strcmp(opt, "utf8") && !val) - uopt->flags |= (1 << UDF_FLAG_UTF8); - else if (val) - { - printk(KERN_ERR "udf: bad mount option \"%s=%s\"\n", - opt, val); - return 0; - } - else - { - printk(KERN_ERR "udf: bad mount option \"%s\"\n", - opt); + default: + printk(KERN_ERR "udf: bad mount option \"%s\" " + "or missing value\n", + p); return 0; } } diff -Nru a/fs/ufs/super.c b/fs/ufs/super.c --- a/fs/ufs/super.c Sun Oct 5 00:33:05 2003 +++ b/fs/ufs/super.c Sun Oct 5 00:33:05 2003 @@ -79,6 +79,7 @@ #include #include #include +#include #include #include #include @@ -250,64 +251,99 @@ sb->s_id, function, error_buf); } +enum { + Opt_type_old, Opt_type_sunx86, Opt_type_sun, Opt_type_44bsd, + Opt_type_hp, Opt_type_nextstepcd, Opt_type_nextstep, + Opt_type_openstep, Opt_onerror_panic, Opt_onerror_lock, + Opt_onerror_umount, Opt_onerror_repair, Opt_err +}; + +static match_table_t tokens = { + {Opt_type_old, "ufstype=old"}, + {Opt_type_sunx86, "ufstype=sunx86"}, + {Opt_type_sun, "ufstype=sun"}, + {Opt_type_44bsd, "ufstype=44bsd"}, + {Opt_type_hp, "ufstype=hp"}, + {Opt_type_nextstepcd, "ufstype=nextstep-cd"}, + {Opt_type_nextstep, "ufstype=nextstep"}, + {Opt_type_openstep, "ufstype=openstep"}, + {Opt_onerror_panic, "onerror=panic"}, + {Opt_onerror_lock, "onerror=lock"}, + {Opt_onerror_umount, "onerror=umount"}, + {Opt_onerror_repair, "onerror=repair"}, + {Opt_err, NULL} +}; + static int ufs_parse_options (char * options, unsigned * mount_options) { - char * this_char; - char * value; + char * p; UFSD(("ENTER\n")) if (!options) return 1; - while ((this_char = strsep (&options, ",")) != NULL) { - if (!*this_char) + while ((p = strsep(&options, ",")) != NULL) { + substring_t args[MAX_OPT_ARGS]; + int token; + if (!*p) continue; - if ((value = strchr (this_char, '=')) != NULL) - *value++ = 0; - if (!strcmp (this_char, "ufstype")) { - ufs_clear_opt (*mount_options, UFSTYPE); - if (!strcmp (value, "old")) - ufs_set_opt (*mount_options, UFSTYPE_OLD); - else if (!strcmp (value, "sun")) - ufs_set_opt (*mount_options, UFSTYPE_SUN); - else if (!strcmp (value, "44bsd")) - ufs_set_opt (*mount_options, UFSTYPE_44BSD); - else if (!strcmp (value, "nextstep")) - ufs_set_opt (*mount_options, UFSTYPE_NEXTSTEP); - else if (!strcmp (value, "nextstep-cd")) - ufs_set_opt (*mount_options, UFSTYPE_NEXTSTEP_CD); - else if (!strcmp (value, "openstep")) - ufs_set_opt (*mount_options, UFSTYPE_OPENSTEP); - else if (!strcmp (value, "sunx86")) - ufs_set_opt (*mount_options, UFSTYPE_SUNx86); - else if (!strcmp (value, "hp")) - ufs_set_opt (*mount_options, UFSTYPE_HP); - else { - printk ("UFS-fs: Invalid type option: %s\n", value); - return 0; - } - } - else if (!strcmp (this_char, "onerror")) { + + token = match_token(p, tokens, args); + switch (token) { + case Opt_type_old: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_OLD); + break; + case Opt_type_sunx86: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_SUNx86); + break; + case Opt_type_sun: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_SUN); + break; + case Opt_type_44bsd: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_44BSD); + break; + case Opt_type_hp: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_HP); + break; + case Opt_type_nextstepcd: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_NEXTSTEP_CD); + break; + case Opt_type_nextstep: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_NEXTSTEP); + break; + case Opt_type_openstep: + ufs_clear_opt (*mount_options, UFSTYPE); + ufs_set_opt (*mount_options, UFSTYPE_OPENSTEP); + break; + case Opt_onerror_panic: + ufs_clear_opt (*mount_options, ONERROR); + ufs_set_opt (*mount_options, ONERROR_PANIC); + break; + case Opt_onerror_lock: + ufs_clear_opt (*mount_options, ONERROR); + ufs_set_opt (*mount_options, ONERROR_LOCK); + break; + case Opt_onerror_umount: + ufs_clear_opt (*mount_options, ONERROR); + ufs_set_opt (*mount_options, ONERROR_UMOUNT); + break; + case Opt_onerror_repair: + printk("UFS-fs: Unable to do repair on error, " + "will lock lock instead\n"); ufs_clear_opt (*mount_options, ONERROR); - if (!strcmp (value, "panic")) - ufs_set_opt (*mount_options, ONERROR_PANIC); - else if (!strcmp (value, "lock")) - ufs_set_opt (*mount_options, ONERROR_LOCK); - else if (!strcmp (value, "umount")) - ufs_set_opt (*mount_options, ONERROR_UMOUNT); - else if (!strcmp (value, "repair")) { - printk("UFS-fs: Unable to do repair on error, " - "will lock lock instead \n"); - ufs_set_opt (*mount_options, ONERROR_REPAIR); - } - else { - printk ("UFS-fs: Invalid action onerror: %s\n", value); - return 0; - } - } - else { - printk("UFS-fs: Invalid option: %s\n", this_char); + ufs_set_opt (*mount_options, ONERROR_REPAIR); + break; + default: + printk("UFS-fs: Invalid option: \"%s\" " + "or missing value\n", p); return 0; } } diff -Nru a/fs/xfs/linux/xfs_aops.c b/fs/xfs/linux/xfs_aops.c --- a/fs/xfs/linux/xfs_aops.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/linux/xfs_aops.c Sun Oct 5 00:33:10 2003 @@ -461,7 +461,8 @@ struct page *page; tlast = i_size_read(inode) >> PAGE_CACHE_SHIFT; - tloff = min(tlast, start_page->index + pb->pb_page_count - 1); + tloff = (mp->pbm_offset + mp->pbm_bsize) >> PAGE_CACHE_SHIFT; + tloff = min(tlast, tloff); for (tindex = start_page->index + 1; tindex < tloff; tindex++) { page = probe_unwritten_page(mapping, tindex, mp, pb, PAGE_CACHE_SIZE, &bs, bbits); @@ -1041,6 +1042,8 @@ do { if (buffer_uptodate(bh) && !buffer_mapped(bh)) (*unmapped) = 1; + else if (buffer_unwritten(bh) && !buffer_delay(bh)) + clear_buffer_unwritten(bh); else if (buffer_unwritten(bh)) (*unwritten) = 1; else if (buffer_delay(bh)) diff -Nru a/fs/xfs/linux/xfs_iops.c b/fs/xfs/linux/xfs_iops.c --- a/fs/xfs/linux/xfs_iops.c Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/linux/xfs_iops.c Sun Oct 5 00:33:07 2003 @@ -386,6 +386,7 @@ uio.uio_segflg = UIO_USERSPACE; uio.uio_resid = size; uio.uio_iovcnt = 1; + uio.uio_fmode = 0; VOP_READLINK(vp, &uio, NULL, error); if (error) diff -Nru a/fs/xfs/linux/xfs_lrw.c b/fs/xfs/linux/xfs_lrw.c --- a/fs/xfs/linux/xfs_lrw.c Sun Oct 5 00:33:05 2003 +++ b/fs/xfs/linux/xfs_lrw.c Sun Oct 5 00:33:05 2003 @@ -218,7 +218,7 @@ int error; vrwlock_t locktype = VRWLOCK_READ; - error = XFS_SEND_DATA(mp, DM_EVENT_READ, bdp, *offset, size, + error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), *offset, size, FILP_DELAY_FLAG(file), &locktype); if (error) { xfs_iunlock(ip, XFS_IOLOCK_SHARED); @@ -278,7 +278,7 @@ vrwlock_t locktype = VRWLOCK_READ; int error; - error = XFS_SEND_DATA(mp, DM_EVENT_READ, bdp, *offset, count, + error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), *offset, count, FILP_DELAY_FLAG(filp), &locktype); if (error) { xfs_iunlock(ip, XFS_IOLOCK_SHARED); @@ -612,7 +612,7 @@ loff_t savedsize = *offset; xfs_iunlock(xip, XFS_ILOCK_EXCL); - error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, bdp, + error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp, *offset, size, FILP_DELAY_FLAG(file), &locktype); if (error) { diff -Nru a/fs/xfs/linux/xfs_stats.c b/fs/xfs/linux/xfs_stats.c --- a/fs/xfs/linux/xfs_stats.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/linux/xfs_stats.c Sun Oct 5 00:33:10 2003 @@ -33,7 +33,7 @@ #include "xfs.h" #include -struct xfsstats xfsstats; +DEFINE_PER_CPU(struct xfsstats, xfsstats); STATIC int xfs_read_xfsstats( @@ -44,7 +44,11 @@ int *eof, void *data) { - int i, j, len; + int c, i, j, len, val; + __uint64_t xs_xstrat_bytes = 0; + __uint64_t xs_write_bytes = 0; + __uint64_t xs_read_bytes = 0; + static struct xstats_entry { char *desc; int endpoint; @@ -65,21 +69,32 @@ { "vnodes", XFSSTAT_END_VNODE_OPS }, }; + /* Loop over all stats groups */ for (i=j=len = 0; i < sizeof(xstats)/sizeof(struct xstats_entry); i++) { len += sprintf(buffer + len, xstats[i].desc); /* inner loop does each group */ while (j < xstats[i].endpoint) { - len += sprintf(buffer + len, " %u", - *(((__u32*)&xfsstats) + j)); + val = 0; + /* sum over all cpus */ + for (c = 0; c < NR_CPUS; c++) { + if (!cpu_possible(c)) continue; + val += *(((__u32*)&per_cpu(xfsstats, c) + j)); + } + len += sprintf(buffer + len, " %u", val); j++; } buffer[len++] = '\n'; } /* extra precision counters */ + for (i = 0; i < NR_CPUS; i++) { + if (!cpu_possible(i)) continue; + xs_xstrat_bytes += per_cpu(xfsstats, i).xs_xstrat_bytes; + xs_write_bytes += per_cpu(xfsstats, i).xs_write_bytes; + xs_read_bytes += per_cpu(xfsstats, i).xs_read_bytes; + } + len += sprintf(buffer + len, "xpc %Lu %Lu %Lu\n", - xfsstats.xs_xstrat_bytes, - xfsstats.xs_write_bytes, - xfsstats.xs_read_bytes); + xs_xstrat_bytes, xs_write_bytes, xs_read_bytes); len += sprintf(buffer + len, "debug %u\n", #if defined(XFSDEBUG) 1); diff -Nru a/fs/xfs/linux/xfs_stats.h b/fs/xfs/linux/xfs_stats.h --- a/fs/xfs/linux/xfs_stats.h Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/linux/xfs_stats.h Sun Oct 5 00:33:07 2003 @@ -35,6 +35,8 @@ #if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF) +#include + /* * XFS global statistics */ @@ -126,11 +128,13 @@ __uint64_t xs_read_bytes; }; -extern struct xfsstats xfsstats; +DECLARE_PER_CPU(struct xfsstats, xfsstats); -# define XFS_STATS_INC(count) ( xfsstats.count++ ) -# define XFS_STATS_DEC(count) ( xfsstats.count-- ) -# define XFS_STATS_ADD(count, inc) ( xfsstats.count += (inc) ) +/* We don't disable preempt, not too worried about poking the + * wrong cpu's stat for now */ +#define XFS_STATS_INC(count) (__get_cpu_var(xfsstats).count++) +#define XFS_STATS_DEC(count) (__get_cpu_var(xfsstats).count--) +#define XFS_STATS_ADD(count, inc) (__get_cpu_var(xfsstats).count += (inc)) extern void xfs_init_procfs(void); extern void xfs_cleanup_procfs(void); diff -Nru a/fs/xfs/linux/xfs_super.c b/fs/xfs/linux/xfs_super.c --- a/fs/xfs/linux/xfs_super.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/linux/xfs_super.c Sun Oct 5 00:33:10 2003 @@ -315,8 +315,8 @@ if (set_blocksize(btp->pbr_bdev, sectorsize)) { printk(KERN_WARNING - "XFS: Cannot set_blocksize to %u on device %u:%u\n", - sectorsize, MAJOR(btp->pbr_dev), MINOR(btp->pbr_dev)); + "XFS: Cannot set_blocksize to %u on device %s\n", + sectorsize, XFS_BUFTARG_NAME(btp)); } } diff -Nru a/fs/xfs/linux/xfs_sysctl.c b/fs/xfs/linux/xfs_sysctl.c --- a/fs/xfs/linux/xfs_sysctl.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/linux/xfs_sysctl.c Sun Oct 5 00:33:10 2003 @@ -48,17 +48,23 @@ void *buffer, size_t *lenp) { - int ret, *valp = ctl->data; + int c, ret, *valp = ctl->data; __uint32_t vn_active; ret = proc_doulongvec_minmax(ctl, write, filp, buffer, lenp); if (!ret && write && *valp) { printk("XFS Clearing xfsstats\n"); - /* save vn_active, it's a universal truth! */ - vn_active = xfsstats.vn_active; - memset(&xfsstats, 0, sizeof(xfsstats)); - xfsstats.vn_active = vn_active; + for (c = 0; c < NR_CPUS; c++) { + if (!cpu_possible(c)) continue; + preempt_disable(); + /* save vn_active, it's a universal truth! */ + vn_active = per_cpu(xfsstats, c).vn_active; + memset(&per_cpu(xfsstats, c), 0, + sizeof(struct xfsstats)); + per_cpu(xfsstats, c).vn_active = vn_active; + preempt_enable(); + } xfs_stats_clear = 0; } diff -Nru a/fs/xfs/linux/xfs_vnode.c b/fs/xfs/linux/xfs_vnode.c --- a/fs/xfs/linux/xfs_vnode.c Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/linux/xfs_vnode.c Sun Oct 5 00:33:07 2003 @@ -200,7 +200,7 @@ vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address); ASSERT(vp->v_fbhv != NULL); - va.va_mask = XFS_AT_STAT|XFS_AT_GENCOUNT; + va.va_mask = XFS_AT_STAT|XFS_AT_XFLAGS; VOP_GETATTR(vp, &va, 0, NULL, error); if (!error) { inode = LINVFS_GET_IP(vp); diff -Nru a/fs/xfs/linux/xfs_vnode.h b/fs/xfs/linux/xfs_vnode.h --- a/fs/xfs/linux/xfs_vnode.h Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/linux/xfs_vnode.h Sun Oct 5 00:33:10 2003 @@ -28,6 +28,37 @@ * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ + * + * Portions Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. */ #ifndef __XFS_VNODE_H__ #define __XFS_VNODE_H__ @@ -39,19 +70,9 @@ struct attrlist_cursor_kern; /* - * Vnode types (unrelated to on-disk inodes). VNON means no type. + * Vnode types. VNON means no type. */ -typedef enum vtype { - VNON = 0, - VREG = 1, - VDIR = 2, - VBLK = 3, - VCHR = 4, - VLNK = 5, - VFIFO = 6, - VBAD = 7, - VSOCK = 8 -} vtype_t; +enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VFIFO, VBAD, VSOCK }; typedef xfs_ino_t vnumber_t; typedef struct dentry vname_t; @@ -115,14 +136,15 @@ #define LINVFS_GET_IP(vp) (&(vp)->v_inode) /* - * Conversion between vnode types/modes and encoded type/mode as - * seen by stat(2) and mknod(2). + * Convert between vnode types and inode formats (since POSIX.1 + * defines mode word of stat structure in terms of inode formats). */ -extern enum vtype iftovt_tab[]; -extern ushort vttoif_tab[]; -#define IFTOVT(M) (iftovt_tab[((M) & S_IFMT) >> 12]) -#define VTTOIF(T) (vttoif_tab[(int)(T)]) -#define MAKEIMODE(T, M) (VTTOIF(T) | ((M) & ~S_IFMT)) +extern enum vtype iftovt_tab[]; +extern u_short vttoif_tab[]; +#define IFTOVT(mode) (iftovt_tab[((mode) & S_IFMT) >> 12]) +#define VTTOIF(indx) (vttoif_tab[(int)(indx)]) +#define MAKEIMODE(indx, mode) (int)(VTTOIF(indx) | (mode)) + /* * Vnode flags. @@ -370,31 +392,29 @@ /* * Vnode attributes. va_mask indicates those attributes the caller - * wants to set (setattr) or extract (getattr). + * wants to set or extract. */ typedef struct vattr { - int va_mask; /* bit-mask of attributes */ - vtype_t va_type; /* vnode type (for create) */ - mode_t va_mode; /* file access mode */ + int va_mask; /* bit-mask of attributes present */ + enum vtype va_type; /* vnode type (for create) */ + mode_t va_mode; /* file access mode and type */ + nlink_t va_nlink; /* number of references to file */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ - xfs_dev_t va_fsid; /* file system id (dev for now) */ - xfs_ino_t va_nodeid; /* node id */ - nlink_t va_nlink; /* number of references to file */ + xfs_ino_t va_nodeid; /* file id */ xfs_off_t va_size; /* file size in bytes */ - timespec_t va_atime; /* time of last access */ - timespec_t va_mtime; /* time of last modification */ - timespec_t va_ctime; /* time file ``created'' */ - xfs_dev_t va_rdev; /* device the file represents */ - u_long va_blksize; /* fundamental block size */ - __int64_t va_nblocks; /* # of blocks allocated */ - u_long va_vcode; /* version code */ + u_long va_blocksize; /* blocksize preferred for i/o */ + struct timespec va_atime; /* time of last access */ + struct timespec va_mtime; /* time of last modification */ + struct timespec va_ctime; /* time file changed */ + u_int va_gen; /* generation number of file */ + xfs_dev_t va_rdev; /* device the special file represents */ + __int64_t va_nblocks; /* number of blocks allocated */ u_long va_xflags; /* random extended file flags */ u_long va_extsize; /* file extent size */ u_long va_nextents; /* number of extents in file */ u_long va_anextents; /* number of attr extents in file */ int va_projid; /* project id */ - u_int va_gencount; /* object generation count */ } vattr_t; /* @@ -450,11 +470,17 @@ XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) -#define VREAD 00400 -#define VWRITE 00200 -#define VEXEC 00100 -#define VSGID 02000 /* set group id on execution */ -#define MODEMASK 07777 /* mode bits plus permission bits */ +/* + * Modes. + */ +#define VSUID S_ISUID /* set user id on execution */ +#define VSGID S_ISGID /* set group id on execution */ +#define VSVTX S_ISVTX /* save swapped text even after use */ +#define VREAD S_IRUSR /* read, write, execute permissions */ +#define VWRITE S_IWUSR +#define VEXEC S_IXUSR + +#define MODEMASK S_IALLUGO /* mode bits plus permission bits */ /* * Check whether mandatory file locking is enabled. @@ -569,13 +595,9 @@ * Flags to VOP_SETATTR/VOP_GETATTR. */ #define ATTR_UTIME 0x01 /* non-default utime(2) request */ -#define ATTR_EXEC 0x02 /* invocation from exec(2) */ -#define ATTR_COMM 0x04 /* yield common vp attributes */ #define ATTR_DMI 0x08 /* invocation from a DMI function */ #define ATTR_LAZY 0x80 /* set/get attributes lazily */ #define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */ -#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */ -#define ATTR_NOSIZETOK 0x400 /* Don't get the DVN_SIZE_READ token */ /* * Flags to VOP_FSYNC and VOP_RECLAIM. diff -Nru a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c --- a/fs/xfs/pagebuf/page_buf.c Sun Oct 5 00:33:05 2003 +++ b/fs/xfs/pagebuf/page_buf.c Sun Oct 5 00:33:05 2003 @@ -141,7 +141,7 @@ * Pagebuf statistics variables */ -struct pbstats pbstats; +DEFINE_PER_CPU(struct pbstats, pbstats); /* * Pagebuf allocation / freeing. @@ -293,7 +293,7 @@ atomic_set(&pb->pb_pin_count, 0); init_waitqueue_head(&pb->pb_waiters); - PB_STATS_INC(pbstats.pb_create); + PB_STATS_INC(pb_create); PB_TRACE(pb, PB_TRACE_REC(get), target); } @@ -485,7 +485,7 @@ page = find_or_create_page(aspace, index, gfp_mask); if (!page) { if (--retry_count > 0) { - PB_STATS_INC(pbstats.pb_page_retries); + PB_STATS_INC(pb_page_retries); pagebuf_daemon_wakeup(1); current->state = TASK_UNINTERRUPTIBLE; schedule_timeout(10); @@ -495,7 +495,7 @@ all_mapped = 0; continue; } - PB_STATS_INC(pbstats.pb_page_found); + PB_STATS_INC(pb_page_found); mark_page_accessed(page); pb->pb_pages[pi] = page; } else { @@ -645,7 +645,7 @@ h->pb_count++; list_add(&new_pb->pb_hash_list, &h->pb_hash); } else { - PB_STATS_INC(pbstats.pb_miss_locked); + PB_STATS_INC(pb_miss_locked); } spin_unlock(&h->pb_hash_lock); @@ -665,7 +665,7 @@ /* wait for buffer ownership */ PB_TRACE(pb, PB_TRACE_REC(get_lk), 0); pagebuf_lock(pb); - PB_STATS_INC(pbstats.pb_get_locked_waited); + PB_STATS_INC(pb_get_locked_waited); } else { /* We asked for a trylock and failed, no need * to look at file offset and length here, we @@ -675,7 +675,7 @@ */ pagebuf_rele(pb); - PB_STATS_INC(pbstats.pb_busy_locked); + PB_STATS_INC(pb_busy_locked); return (NULL); } } else { @@ -691,7 +691,7 @@ _PBF_ADDR_ALLOCATED | \ _PBF_MEM_ALLOCATED; PB_TRACE(pb, PB_TRACE_REC(got_lk), 0); - PB_STATS_INC(pbstats.pb_get_locked); + PB_STATS_INC(pb_get_locked); return (pb); } @@ -747,7 +747,7 @@ return (NULL); } - PB_STATS_INC(pbstats.pb_get); + PB_STATS_INC(pb_get); /* fill in any missing pages */ error = _pagebuf_lookup_pages(pb, pb->pb_target->pbr_mapping, flags); @@ -766,7 +766,7 @@ if (flags & PBF_READ) { if (PBF_NOT_DONE(pb)) { PB_TRACE(pb, PB_TRACE_REC(get_read), flags); - PB_STATS_INC(pbstats.pb_get_read); + PB_STATS_INC(pb_get_read); pagebuf_iostart(pb, flags); } else if (flags & PBF_ASYNC) { /* @@ -1677,6 +1677,9 @@ break; } + pb->pb_flags &= ~PBF_DELWRI; + pb->pb_flags |= PBF_WRITE; + list_del(&pb->pb_list); list_add(&pb->pb_list, &tmp); @@ -1688,8 +1691,6 @@ while (!list_empty(&tmp)) { pb = list_entry(tmp.next, page_buf_t, pb_list); list_del_init(&pb->pb_list); - pb->pb_flags &= ~PBF_DELWRI; - pb->pb_flags |= PBF_WRITE; pagebuf_iostrategy(pb); } @@ -1720,6 +1721,7 @@ int flush_cnt = 0; pagebuf_runall_queues(pagebuf_dataio_workqueue); + pagebuf_runall_queues(pagebuf_logio_workqueue); spin_lock(&pbd_delwrite_lock); INIT_LIST_HEAD(&tmp); @@ -1742,47 +1744,32 @@ continue; } - if (flags & PBDF_TRYLOCK) { - if (!pagebuf_cond_lock(pb)) { - pincount++; - continue; - } - } - - list_del_init(&pb->pb_list); - if (flags & PBDF_WAIT) { - list_add(&pb->pb_list, &tmp); - pb->pb_flags &= ~PBF_ASYNC; - } - - spin_unlock(&pbd_delwrite_lock); - - if ((flags & PBDF_TRYLOCK) == 0) { - pagebuf_lock(pb); - } - pb->pb_flags &= ~PBF_DELWRI; pb->pb_flags |= PBF_WRITE; + list_move(&pb->pb_list, &tmp); + } + /* ok found all the items that can be worked on + * drop the lock and process the private list */ + spin_unlock(&pbd_delwrite_lock); + + list_for_each_safe(curr, next, &tmp) { + pb = list_entry(curr, page_buf_t, pb_list); + + if (flags & PBDF_WAIT) + pb->pb_flags &= ~PBF_ASYNC; + else + list_del_init(curr); + pagebuf_lock(pb); pagebuf_iostrategy(pb); if (++flush_cnt > 32) { blk_run_queues(); flush_cnt = 0; } - - spin_lock(&pbd_delwrite_lock); } - spin_unlock(&pbd_delwrite_lock); - blk_run_queues(); - if (pinptr) - *pinptr = pincount; - - if ((flags & PBDF_WAIT) == 0) - return; - while (!list_empty(&tmp)) { pb = list_entry(tmp.next, page_buf_t, pb_list); @@ -1792,6 +1779,9 @@ pagebuf_unlock(pb); pagebuf_rele(pb); } + + if (pinptr) + *pinptr = pincount; } STATIC int @@ -1846,14 +1836,18 @@ void *buffer, size_t *lenp) { - int ret; + int c, ret; int *valp = ctl->data; ret = proc_doulongvec_minmax(ctl, write, filp, buffer, lenp); if (!ret && write && *valp) { printk("XFS Clearing pbstats\n"); - memset(&pbstats, 0, sizeof(pbstats)); + for (c = 0; c < NR_CPUS; c++) { + if (!cpu_possible(c)) continue; + memset(&per_cpu(pbstats, c), 0, + sizeof(struct pbstats)); + } pb_params.stats_clear.val = 0; } @@ -1907,13 +1901,17 @@ int *eof, void *data) { - int i, len; + int c, i, len, val; len = 0; len += sprintf(buffer + len, "pagebuf"); - for (i = 0; i < sizeof(pbstats) / sizeof(u_int32_t); i++) { - len += sprintf(buffer + len, " %u", - *(((u_int32_t*)&pbstats) + i)); + for (i = 0; i < sizeof(struct pbstats) / sizeof(u_int32_t); i++) { + val = 0; + for (c = 0 ; c < NR_CPUS; c++) { + if (!cpu_possible(c)) continue; + val += *(((u_int32_t*)&per_cpu(pbstats, c) + i)); + } + len += sprintf(buffer + len, " %u", val); } buffer[len++] = '\n'; diff -Nru a/fs/xfs/pagebuf/page_buf.h b/fs/xfs/pagebuf/page_buf.h --- a/fs/xfs/pagebuf/page_buf.h Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/pagebuf/page_buf.h Sun Oct 5 00:33:08 2003 @@ -136,9 +136,6 @@ #define PBF_NOT_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) != 0) #define PBF_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) == 0) -#define PBR_SECTOR_ONLY 1 /* only use sector size buffer heads */ -#define PBR_ALIGNED_ONLY 2 /* only use aligned I/O */ - typedef struct pb_target { dev_t pbr_dev; struct block_device *pbr_bdev; @@ -371,7 +368,6 @@ /* Delayed Write Buffer Routines */ #define PBDF_WAIT 0x01 -#define PBDF_TRYLOCK 0x02 extern void pagebuf_delwri_flush( pb_target_t *, unsigned long, diff -Nru a/fs/xfs/pagebuf/page_buf_internal.h b/fs/xfs/pagebuf/page_buf_internal.h --- a/fs/xfs/pagebuf/page_buf_internal.h Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/pagebuf/page_buf_internal.h Sun Oct 5 00:33:08 2003 @@ -37,6 +37,7 @@ #ifndef __PAGE_BUF_PRIVATE_H__ #define __PAGE_BUF_PRIVATE_H__ +#include #include "page_buf.h" #define _PAGE_BUF_INTERNAL_ @@ -120,9 +121,11 @@ u_int32_t pb_get_read; }; -extern struct pbstats pbstats; +DECLARE_PER_CPU(struct pbstats, pbstats); -#define PB_STATS_INC(count) ( count ++ ) +/* We don't disable preempt, not too worried about poking the + * wrong cpu's stat for now */ +#define PB_STATS_INC(count) (__get_cpu_var(pbstats).count++) #ifndef STATIC # define STATIC static diff -Nru a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c --- a/fs/xfs/quota/xfs_dquot.c Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/quota/xfs_dquot.c Sun Oct 5 00:33:08 2003 @@ -87,9 +87,9 @@ STATIC void xfs_qm_dqflush_done(xfs_buf_t *, xfs_dq_logitem_t *); #ifdef DEBUG -dev_t xfs_dqerror_dev = 0; -int xfs_do_dqerror = 0; -int xfs_dqreq_num = 0; +xfs_buftarg_t *xfs_dqerror_target; +int xfs_do_dqerror; +int xfs_dqreq_num; int xfs_dqerror_mod = 33; #endif @@ -911,7 +911,7 @@ #ifdef DEBUG if (xfs_do_dqerror) { - if ((xfs_dqerror_dev == mp->m_dev) && + if ((xfs_dqerror_target == mp->m_ddev_targp) && (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) { cmn_err(CE_DEBUG, "Returning error in dqget"); return (EIO); diff -Nru a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h --- a/fs/xfs/quota/xfs_qm.h Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/quota/xfs_qm.h Sun Oct 5 00:33:07 2003 @@ -165,9 +165,9 @@ * Users are allowed to have a usage exceeding their softlimit for * a period this long. */ -#define XFS_QM_BTIMELIMIT DQ_BTIMELIMIT -#define XFS_QM_RTBTIMELIMIT DQ_BTIMELIMIT -#define XFS_QM_ITIMELIMIT DQ_FTIMELIMIT +#define XFS_QM_BTIMELIMIT (7 * 24*60*60) /* 1 week */ +#define XFS_QM_RTBTIMELIMIT (7 * 24*60*60) /* 1 week */ +#define XFS_QM_ITIMELIMIT (7 * 24*60*60) /* 1 week */ #define XFS_QM_BWARNLIMIT 5 #define XFS_QM_IWARNLIMIT 5 diff -Nru a/fs/xfs/support/move.c b/fs/xfs/support/move.c --- a/fs/xfs/support/move.c Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/support/move.c Sun Oct 5 00:33:08 2003 @@ -38,57 +38,37 @@ #include "debug.h" #include "move.h" -/* - * Move "n" bytes at byte address "cp"; "rw" indicates the direction - * of the move, and the I/O parameters are provided in "uio", which is - * update to reflect the data which was moved. Returns 0 on success or - * a non-zero errno on failure. +/* Read from kernel buffer at src to user/kernel buffer defined + * by the uio structure. Advance the pointer in the uio struct + * as we go. */ int -uiomove(void *cp, size_t n, enum uio_rw rw, struct uio *uio) +uio_read(caddr_t src, size_t len, struct uio *uio) { - register struct iovec *iov; + struct iovec *iov; u_int cnt; int error; - while (n > 0 && uio->uio_resid) { + if (len > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = (u_int)iov->iov_len; - if (cnt == 0) { - uio->uio_iov++; - uio->uio_iovcnt--; - continue; - } - if (cnt > n) - cnt = (u_int)n; - switch (uio->uio_segflg) { - case UIO_USERSPACE: - if (rw == UIO_READ) - error = copy_to_user(iov->iov_base, cp, cnt); - else - error = copy_from_user(cp, iov->iov_base, cnt); + if (cnt == 0) + return 0; + if (cnt > len) + cnt = (u_int)len; + if (uio->uio_segflg == UIO_USERSPACE) { + error = copy_to_user(iov->iov_base, src, cnt); if (error) return EFAULT; - break; - - - case UIO_SYSSPACE: - if (rw == UIO_READ) - memcpy(iov->iov_base, cp, cnt); - else - memcpy(cp, iov->iov_base, cnt); - break; - - default: + } else if (uio->uio_segflg == UIO_SYSSPACE) { + memcpy(iov->iov_base, src, cnt); + } else { ASSERT(0); - break; } iov->iov_base = (void *)((char *)iov->iov_base + cnt); iov->iov_len -= cnt; uio->uio_resid -= cnt; uio->uio_offset += cnt; - cp = (void *)((char *)cp + cnt); - n -= cnt; } return 0; } diff -Nru a/fs/xfs/support/move.h b/fs/xfs/support/move.h --- a/fs/xfs/support/move.h Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/support/move.h Sun Oct 5 00:33:08 2003 @@ -48,11 +48,6 @@ } uio_t; /* - * I/O direction. - */ -typedef enum uio_rw { UIO_READ, UIO_WRITE } uio_rw_t; - -/* * Segment flag values. */ typedef enum uio_seg { @@ -60,7 +55,6 @@ UIO_SYSSPACE, /* uio_iov describes system space */ } uio_seg_t; - -extern int uiomove (void *, size_t, uio_rw_t, uio_t *); +extern int uio_read (caddr_t, size_t, uio_t *); #endif /* __XFS_SUPPORT_MOVE_H__ */ diff -Nru a/fs/xfs/xfs_attr_fetch.c b/fs/xfs/xfs_attr_fetch.c --- a/fs/xfs/xfs_attr_fetch.c Sun Oct 5 00:33:09 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ - -#include "xfs.h" - -#include "xfs_macros.h" -#include "xfs_types.h" -#include "xfs_inum.h" -#include "xfs_log.h" -#include "xfs_trans.h" -#include "xfs_sb.h" -#include "xfs_ag.h" -#include "xfs_dir.h" -#include "xfs_dir2.h" -#include "xfs_dmapi.h" -#include "xfs_mount.h" -#include "xfs_alloc_btree.h" -#include "xfs_bmap_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_itable.h" -#include "xfs_btree.h" -#include "xfs_ialloc.h" -#include "xfs_alloc.h" -#include "xfs_attr_sf.h" -#include "xfs_dir_sf.h" -#include "xfs_dir2_sf.h" -#include "xfs_dinode.h" -#include "xfs_inode_item.h" -#include "xfs_inode.h" -#include "xfs_bmap.h" -#include "xfs_da_btree.h" -#include "xfs_attr.h" -#include "xfs_attr_leaf.h" - -int -xfs_attr_fetch(xfs_inode_t *ip, char *name, char *value, int valuelen) -{ - xfs_da_args_t args; - int error; - - if (XFS_IFORK_Q(ip) == 0) - return ENOATTR; - /* - * Do the argument setup for the xfs_attr routines. - */ - memset((char *)&args, 0, sizeof(args)); - args.dp = ip; - args.flags = ATTR_ROOT; - args.whichfork = XFS_ATTR_FORK; - args.name = name; - args.namelen = strlen(name); - args.value = value; - args.valuelen = valuelen; - args.hashval = xfs_da_hashname(args.name, args.namelen); - args.oknoent = 1; - - /* - * Decide on what work routines to call based on the inode size. - */ - if (args.dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) - error = xfs_attr_shortform_getvalue(&args); - else if (xfs_bmap_one_block(args.dp, XFS_ATTR_FORK)) - error = xfs_attr_leaf_get(&args); - else - error = xfs_attr_node_get(&args); - - if (error == EEXIST) - error = 0; - - return(error); -} diff -Nru a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c --- a/fs/xfs/xfs_bmap.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_bmap.c Sun Oct 5 00:33:10 2003 @@ -5553,7 +5553,7 @@ && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && whichfork == XFS_DATA_FORK) { - error = XFS_SEND_DATA(mp, DM_EVENT_READ, bdp, 0, 0, 0, NULL); + error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL); if (error) return XFS_ERROR(error); } diff -Nru a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h --- a/fs/xfs/xfs_buf.h Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_buf.h Sun Oct 5 00:33:10 2003 @@ -194,7 +194,10 @@ (bp)->pb_target = (target) #define XFS_BUF_TARGET(bp) ((bp)->pb_target) -#define XFS_BUF_TARGET_DEV(bp) ((bp)->pb_target->pbr_dev) + +#define XFS_BUFTARG_NAME(target) \ + ({ char __b[BDEVNAME_SIZE]; bdevname((target->pbr_bdev), __b); __b; }) + #define XFS_BUF_SET_VTYPE_REF(bp, type, ref) #define XFS_BUF_SET_VTYPE(bp, type) #define XFS_BUF_SET_REF(bp, ref) diff -Nru a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c --- a/fs/xfs/xfs_buf_item.c Sun Oct 5 00:33:05 2003 +++ b/fs/xfs/xfs_buf_item.c Sun Oct 5 00:33:05 2003 @@ -1007,7 +1007,7 @@ { xfs_log_item_t *lip; static ulong lasttime; - static dev_t lastdev; + static xfs_buftarg_t *lasttarg; xfs_mount_t *mp; ASSERT(XFS_BUF_FSPRIVATE(bp, void *) != NULL); @@ -1045,15 +1045,15 @@ return; } - if ((XFS_BUF_TARGET_DEV(bp) != lastdev) || + if ((XFS_BUF_TARGET(bp) != lasttarg) || (time_after(jiffies, (lasttime + 5*HZ)))) { lasttime = jiffies; prdev("XFS write error in file system meta-data " "block 0x%Lx in %s", - XFS_BUF_TARGET_DEV(bp), + XFS_BUF_TARGET(bp), XFS_BUF_ADDR(bp), mp->m_fsname); } - lastdev = XFS_BUF_TARGET_DEV(bp); + lasttarg = XFS_BUF_TARGET(bp); if (XFS_BUF_ISASYNC(bp)) { /* diff -Nru a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c --- a/fs/xfs/xfs_da_btree.c Sun Oct 5 00:33:09 2003 +++ b/fs/xfs/xfs_da_btree.c Sun Oct 5 00:33:09 2003 @@ -2450,7 +2450,7 @@ dabuf->dirty = 0; #ifdef XFS_DABUF_DEBUG dabuf->ra = ra; - dabuf->dev = XFS_BUF_TARGET_DEV(bps[0]); + dabuf->target = XFS_BUF_TARGET(bps[0]); dabuf->blkno = XFS_BUF_ADDR(bps[0]); #endif if (nbuf == 1) { @@ -2480,7 +2480,7 @@ s = mutex_spinlock(&xfs_dabuf_global_lock); for (p = xfs_dabuf_global_list; p; p = p->next) { ASSERT(p->blkno != dabuf->blkno || - p->dev != dabuf->dev); + p->target != dabuf->target); } dabuf->prev = NULL; if (xfs_dabuf_global_list) diff -Nru a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h --- a/fs/xfs/xfs_da_btree.h Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/xfs_da_btree.h Sun Oct 5 00:33:08 2003 @@ -212,7 +212,7 @@ inst_t *ra; /* return address of caller to make */ struct xfs_dabuf *next; /* next in global chain */ struct xfs_dabuf *prev; /* previous in global chain */ - dev_t dev; /* device for buffer */ + struct xfs_buftarg *target; /* device for buffer */ xfs_daddr_t blkno; /* daddr first in bps[0] */ #endif struct xfs_buf *bps[1]; /* actually nbuf of these */ diff -Nru a/fs/xfs/xfs_dinode.h b/fs/xfs/xfs_dinode.h --- a/fs/xfs/xfs_dinode.h Sun Oct 5 00:33:09 2003 +++ b/fs/xfs/xfs_dinode.h Sun Oct 5 00:33:09 2003 @@ -439,25 +439,21 @@ /* * File types (mode field) */ -#define IFMT 0170000 /* type of file */ -#define IFIFO 0010000 /* named pipe (fifo) */ -#define IFCHR 0020000 /* character special */ -#define IFDIR 0040000 /* directory */ -#define IFBLK 0060000 /* block special */ -#define IFREG 0100000 /* regular */ -#define IFLNK 0120000 /* symbolic link */ -#define IFSOCK 0140000 /* socket */ -#define IFMNT 0160000 /* mount point */ +#define IFMT S_IFMT +#define IFSOCK S_IFSOCK +#define IFLNK S_IFLNK +#define IFREG S_IFREG +#define IFBLK S_IFBLK +#define IFDIR S_IFDIR +#define IFCHR S_IFCHR +#define IFIFO S_IFIFO -/* - * File execution and access modes. - */ -#define ISUID 04000 /* set user id on execution */ -#define ISGID 02000 /* set group id on execution */ -#define ISVTX 01000 /* sticky directory */ -#define IREAD 0400 /* read, write, execute permissions */ -#define IWRITE 0200 -#define IEXEC 0100 +#define ISUID S_ISUID +#define ISGID S_ISGID +#define ISVTX S_ISVTX +#define IREAD S_IRUSR +#define IWRITE S_IWUSR +#define IEXEC S_IXUSR #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_DINODE) xfs_dinode_t *xfs_buf_to_dinode(struct xfs_buf *bp); diff -Nru a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c --- a/fs/xfs/xfs_dir2.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_dir2.c Sun Oct 5 00:33:10 2003 @@ -773,7 +773,7 @@ idbp->d_off = pa->cook; idbp->d_name[namelen] = '\0'; memcpy(idbp->d_name, pa->name, namelen); - rval = uiomove((caddr_t)idbp, reclen, UIO_READ, uio); + rval = uio_read((caddr_t)idbp, reclen, uio); pa->done = (rval == 0); return rval; } diff -Nru a/fs/xfs/xfs_dir_leaf.c b/fs/xfs/xfs_dir_leaf.c --- a/fs/xfs/xfs_dir_leaf.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_dir_leaf.c Sun Oct 5 00:33:10 2003 @@ -2225,7 +2225,7 @@ idbp->d_off = pa->cook.o; idbp->d_name[namelen] = '\0'; memcpy(idbp->d_name, pa->name, namelen); - retval = uiomove((caddr_t)idbp, reclen, UIO_READ, uio); + retval = uio_read((caddr_t)idbp, reclen, uio); pa->done = (retval == 0); return retval; } diff -Nru a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c --- a/fs/xfs/xfs_error.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_error.c Sun Oct 5 00:33:10 2003 @@ -329,6 +329,7 @@ int linenum, inst_t *ra) { - xfs_hex_dump(p, 16); + if (level <= xfs_error_level) + xfs_hex_dump(p, 16); xfs_error_report(tag, level, mp, fname, linenum, ra); } diff -Nru a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h --- a/fs/xfs/xfs_error.h Sun Oct 5 00:33:09 2003 +++ b/fs/xfs/xfs_error.h Sun Oct 5 00:33:09 2003 @@ -32,8 +32,8 @@ #ifndef __XFS_ERROR_H__ #define __XFS_ERROR_H__ -#define prdev(fmt,dev,args...) \ - printk("XFS: device %u:%u- " fmt "\n", MAJOR(dev), MINOR(dev), ## args) +#define prdev(fmt,targ,args...) \ + printk("XFS: device %s- " fmt "\n", XFS_BUFTARG_NAME(targ), ## args) #define XFS_ERECOVER 1 /* Failure to recover log */ #define XFS_ELOGSTAT 2 /* Failure to stat log in user space */ diff -Nru a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h --- a/fs/xfs/xfs_fs.h Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/xfs_fs.h Sun Oct 5 00:33:07 2003 @@ -392,22 +392,17 @@ } xfs_fsop_attrmulti_handlereq_t; /* - * File system identifier. Should be unique (at least per machine). + * per machine unique filesystem identifier types. */ -typedef struct { - __u32 val[2]; /* file system id type */ -} xfs_fsid_t; +typedef struct { __u32 val[2]; } xfs_fsid_t; /* file system id type */ + -/* - * File identifier. Should be unique per filesystem on a single machine. - * This is typically called by a stateless file server in order to generate - * "file handles". - */ #ifndef HAVE_FID #define MAXFIDSZ 46 + typedef struct fid { __u16 fid_len; /* length of data in bytes */ - unsigned char fid_data[MAXFIDSZ]; /* data (variable length) */ + unsigned char fid_data[MAXFIDSZ]; /* data (fid_len worth) */ } fid_t; #endif diff -Nru a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c --- a/fs/xfs/xfs_inode.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_inode.c Sun Oct 5 00:33:10 2003 @@ -408,8 +408,9 @@ if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP, XFS_RANDOM_ITOBP_INOTOBP))) { #ifdef DEBUG - prdev("bad inode magic/vsn daddr 0x%llx #%d (magic=%x)", - mp->m_dev, (unsigned long long)imap.im_blkno, i, + prdev("bad inode magic/vsn daddr %lld #%d (magic=%x)", + mp->m_ddev_targp, + (unsigned long long)imap.im_blkno, i, INT_GET(dip->di_core.di_magic, ARCH_CONVERT)); #endif XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_HIGH, diff -Nru a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c --- a/fs/xfs/xfs_log.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_log.c Sun Oct 5 00:33:10 2003 @@ -65,7 +65,7 @@ STATIC int xlog_commit_record(xfs_mount_t *mp, xlog_ticket_t *ticket, xlog_in_core_t **, xfs_lsn_t *); STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, - dev_t log_dev, + xfs_buftarg_t *log_target, xfs_daddr_t blk_offset, int num_bblks); STATIC int xlog_space_left(xlog_t *log, int cycle, int bytes); @@ -155,7 +155,7 @@ */ #if defined(XLOG_NOLOG) || defined(DEBUG) int xlog_debug = 1; -dev_t xlog_devt = 0; +xfs_buftarg_t *xlog_target; #endif #if defined(XFS_LOG_TRACE) @@ -274,7 +274,7 @@ xfs_lsn_t lsn = 0; #if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug && xlog_devt == log->l_dev) + if (!xlog_debug && xlog_target == log->l_targ) return 0; #endif @@ -339,7 +339,7 @@ xlog_t *log = mp->m_log; #if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug && xlog_devt == log->l_dev) + if (!xlog_debug && xlog_target == log->l_targ) return 0; #endif @@ -378,7 +378,7 @@ int abortflg, spl; #if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug && xlog_devt == log->l_dev) + if (!xlog_debug && xlog_target == log->l_targ) return 0; #endif cb->cb_next = 0; @@ -436,7 +436,7 @@ int retval; #if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug && xlog_devt == log->l_dev) + if (!xlog_debug && xlog_target == log->l_targ) return 0; #endif retval = 0; @@ -472,7 +472,7 @@ * Mount a log filesystem * * mp - ubiquitous xfs mount point structure - * log_dev - device number of on-disk log device + * log_target - buftarg of on-disk log device * blk_offset - Start block # where block size is 512 bytes (BBSIZE) * num_bblocks - Number of BBSIZE blocks in on-disk log * @@ -480,7 +480,7 @@ */ int xfs_log_mount(xfs_mount_t *mp, - dev_t log_dev, + xfs_buftarg_t *log_target, xfs_daddr_t blk_offset, int num_bblks) { @@ -493,12 +493,11 @@ ASSERT(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY); } - mp->m_log = xlog_alloc_log(mp, log_dev, blk_offset, num_bblks); + mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks); #if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug) { - cmn_err(CE_NOTE, "log dev: %u:%u", - MAJOR(log_dev), MINOR(log_dev)); + if (!xlog_debug) { + cmn_err(CE_NOTE, "log dev: %s", XFS_BUFTARG_NAME(log_target)); return 0; } #endif @@ -606,7 +605,7 @@ } magic = { XLOG_UNMOUNT_TYPE, 0, 0 }; #if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug && xlog_devt == log->l_dev) + if (!xlog_debug && xlog_target == log->l_targ) return 0; #endif @@ -734,9 +733,9 @@ { int error; xlog_t *log = mp->m_log; -#if defined(DEBUG) || defined(XLOG_NOLOG) - if (! xlog_debug && xlog_devt == log->l_dev) { +#if defined(DEBUG) || defined(XLOG_NOLOG) + if (!xlog_debug && xlog_target == log->l_targ) { *start_lsn = 0; return 0; } @@ -761,7 +760,7 @@ SPLDECL(s); #if defined(DEBUG) || defined(XLOG_NOLOG) - if (!xlog_debug && xlog_devt == log->l_dev) + if (!xlog_debug && xlog_target == log->l_targ) return; #endif /* XXXsup tmp */ @@ -1059,14 +1058,14 @@ /* * When logbufs == 0, someone has disabled the log from the FSTAB * file. This is not a documented feature. We need to set xlog_debug - * to zero (this deactivates the log) and set xlog_devt to the + * to zero (this deactivates the log) and set xlog_target to the * appropriate dev_t. Only one filesystem may be affected as such * since this is just a performance hack to test what we might be able * to get if the log were not present. */ if (mp->m_logbufs == 0) { xlog_debug = 0; - xlog_devt = log->l_dev; + xlog_target = log->l_targ; log->l_iclog_bufs = XLOG_MIN_ICLOGS; } else #endif @@ -1089,8 +1088,8 @@ #if defined(DEBUG) || defined(XLOG_NOLOG) /* We are reactivating a filesystem after it was active */ - if (log->l_dev == xlog_devt) { - xlog_devt = 1; + if (log->l_targ == xlog_target) { + xlog_target = 1; /* XXX(hch): WTF? */ xlog_debug = 1; } #endif @@ -1176,7 +1175,7 @@ */ STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, - dev_t log_dev, + xfs_buftarg_t *log_target, xfs_daddr_t blk_offset, int num_bblks) { @@ -1191,7 +1190,7 @@ log = (xlog_t *)kmem_zalloc(sizeof(xlog_t), KM_SLEEP); log->l_mp = mp; - log->l_dev = log_dev; + log->l_targ = log_target; log->l_logsize = BBTOB(num_bblks); log->l_logBBstart = blk_offset; log->l_logBBsize = num_bblks; diff -Nru a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h --- a/fs/xfs/xfs_log.h Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_log.h Sun Oct 5 00:33:10 2003 @@ -153,10 +153,10 @@ int xfs_log_force(struct xfs_mount *mp, xfs_lsn_t lsn, uint flags); -int xfs_log_mount(struct xfs_mount *mp, - dev_t log_dev, - xfs_daddr_t start_block, - int num_bblocks); +int xfs_log_mount(struct xfs_mount *mp, + struct xfs_buftarg *log_target, + xfs_daddr_t start_block, + int num_bblocks); int xfs_log_mount_finish(struct xfs_mount *mp, int); void xfs_log_move_tail(struct xfs_mount *mp, xfs_lsn_t tail_lsn); diff -Nru a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h --- a/fs/xfs/xfs_log_priv.h Sun Oct 5 00:33:06 2003 +++ b/fs/xfs/xfs_log_priv.h Sun Oct 5 00:33:06 2003 @@ -504,7 +504,7 @@ struct xfs_mount *l_mp; /* mount point */ struct xfs_buf *l_xbuf; /* extra buffer for log * wrapping */ - dev_t l_dev; /* dev_t of log */ + struct xfs_buftarg *l_targ; /* buftarg of log */ xfs_daddr_t l_logBBstart; /* start block of log */ int l_logsize; /* size of log in bytes */ int l_logBBsize; /* size of log in BB chunks */ diff -Nru a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c --- a/fs/xfs/xfs_log_recover.c Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/xfs_log_recover.c Sun Oct 5 00:33:08 2003 @@ -2179,8 +2179,8 @@ break; default: xfs_fs_cmn_err(CE_ALERT, log->l_mp, - "xfs_log_recover: unknown buffer type 0x%x, dev %u:%u", - buf_f->blf_type, MAJOR(log->l_dev), MINOR(log->l_dev)); + "xfs_log_recover: unknown buffer type 0x%x, dev %s", + buf_f->blf_type, XFS_BUFTARG_NAME(log->l_targ)); XFS_ERROR_REPORT("xlog_recover_do_buffer_trans", XFS_ERRLEVEL_LOW, log->l_mp); return XFS_ERROR(EFSCORRUPTED); @@ -3889,9 +3889,8 @@ } cmn_err(CE_NOTE, - "Starting XFS recovery on filesystem: %s (dev: %d/%d)", - log->l_mp->m_fsname, MAJOR(log->l_dev), - MINOR(log->l_dev)); + "Starting XFS recovery on filesystem: %s (dev: %s)", + log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ)); error = xlog_do_recover(log, head_blk, tail_blk); log->l_flags |= XLOG_RECOVERY_NEEDED; @@ -3939,10 +3938,8 @@ xlog_recover_check_summary(log); cmn_err(CE_NOTE, - "Ending XFS recovery on filesystem: %s (dev: %d/%d)", - log->l_mp->m_fsname, MAJOR(log->l_dev), - MINOR(log->l_dev)); - + "Ending XFS recovery on filesystem: %s (dev: %s)", + log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ)); log->l_flags &= ~XLOG_RECOVERY_NEEDED; } else { cmn_err(CE_DEBUG, diff -Nru a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c --- a/fs/xfs/xfs_mount.c Sun Oct 5 00:33:08 2003 +++ b/fs/xfs/xfs_mount.c Sun Oct 5 00:33:08 2003 @@ -285,9 +285,9 @@ #if !XFS_BIG_BLKNOS if (unlikely( (sbp->sb_dblocks << (__uint64_t)(sbp->sb_blocklog - BBSHIFT)) - > INT_MAX || + > UINT_MAX || (sbp->sb_rblocks << (__uint64_t)(sbp->sb_blocklog - BBSHIFT)) - > INT_MAX)) { + > UINT_MAX)) { cmn_err(CE_WARN, "XFS: File system is too large to be mounted on this system."); return XFS_ERROR(E2BIG); @@ -949,7 +949,7 @@ * log's mount-time initialization. Perform 1st part recovery if needed */ if (likely(sbp->sb_logblocks > 0)) { /* check for volume case */ - error = xfs_log_mount(mp, mp->m_logdev_targp->pbr_dev, + error = xfs_log_mount(mp, mp->m_logdev_targp, XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); if (error) { @@ -980,7 +980,7 @@ if (unlikely((rip->i_d.di_mode & IFMT) != IFDIR)) { cmn_err(CE_WARN, "XFS: corrupted root inode"); prdev("Root inode %llu is not a directory", - mp->m_dev, (unsigned long long)rip->i_ino); + mp->m_ddev_targp, (unsigned long long)rip->i_ino); xfs_iunlock(rip, XFS_ILOCK_EXCL); XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, mp); diff -Nru a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h --- a/fs/xfs/xfs_mount.h Sun Oct 5 00:33:05 2003 +++ b/fs/xfs/xfs_mount.h Sun Oct 5 00:33:05 2003 @@ -91,10 +91,10 @@ * Prototypes and functions for the Data Migration subsystem. */ -typedef int (*xfs_send_data_t)(int, struct bhv_desc *, +typedef int (*xfs_send_data_t)(int, struct vnode *, xfs_off_t, size_t, int, vrwlock_t *); typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); -typedef int (*xfs_send_destroy_t)(struct bhv_desc *, dm_right_t); +typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t); typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct vnode *, dm_right_t, struct vnode *, dm_right_t, char *, char *, mode_t, int, int); @@ -109,12 +109,12 @@ xfs_send_unmount_t xfs_send_unmount; } xfs_dmops_t; -#define XFS_SEND_DATA(mp, ev,bdp,off,len,fl,lock) \ - (*(mp)->m_dm_ops.xfs_send_data)(ev,bdp,off,len,fl,lock) +#define XFS_SEND_DATA(mp, ev,vp,off,len,fl,lock) \ + (*(mp)->m_dm_ops.xfs_send_data)(ev,vp,off,len,fl,lock) #define XFS_SEND_MMAP(mp, vma,fl) \ (*(mp)->m_dm_ops.xfs_send_mmap)(vma,fl) -#define XFS_SEND_DESTROY(mp, bdp,right) \ - (*(mp)->m_dm_ops.xfs_send_destroy)(bdp,right) +#define XFS_SEND_DESTROY(mp, vp,right) \ + (*(mp)->m_dm_ops.xfs_send_destroy)(vp,right) #define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ (*(mp)->m_dm_ops.xfs_send_namesp)(ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) #define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \ diff -Nru a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c --- a/fs/xfs/xfs_rw.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_rw.c Sun Oct 5 00:33:10 2003 @@ -260,11 +260,10 @@ xfs_daddr_t blkno) { cmn_err(CE_ALERT, - "I/O error in filesystem (\"%s\") meta-data dev %u:%u block 0x%llx" + "I/O error in filesystem (\"%s\") meta-data dev %s block 0x%llx" " (\"%s\") error %d buf count %u", (!mp || !mp->m_fsname) ? "(fs name not set)" : mp->m_fsname, - MAJOR(XFS_BUF_TARGET_DEV(bp)), - MINOR(XFS_BUF_TARGET_DEV(bp)), + XFS_BUFTARG_NAME(bp->pb_target), (__uint64_t)blkno, func, XFS_BUF_GETERROR(bp), diff -Nru a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h --- a/fs/xfs/xfs_trans.h Sun Oct 5 00:33:09 2003 +++ b/fs/xfs/xfs_trans.h Sun Oct 5 00:33:09 2003 @@ -995,7 +995,6 @@ void xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *); int xfs_trans_iget(struct xfs_mount *, xfs_trans_t *, xfs_ino_t , uint, struct xfs_inode **); -void xfs_trans_iput(xfs_trans_t *, struct xfs_inode *, uint); void xfs_trans_ijoin(xfs_trans_t *, struct xfs_inode *, uint); void xfs_trans_ihold(xfs_trans_t *, struct xfs_inode *); void xfs_trans_ihold_release(xfs_trans_t *, struct xfs_inode *); diff -Nru a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c --- a/fs/xfs/xfs_trans_buf.c Sun Oct 5 00:33:05 2003 +++ b/fs/xfs/xfs_trans_buf.c Sun Oct 5 00:33:05 2003 @@ -264,7 +264,7 @@ } #ifdef DEBUG -dev_t xfs_error_dev = 0; +xfs_buftarg_t *xfs_error_target; int xfs_do_error; int xfs_req_num; int xfs_error_mod = 33; @@ -322,7 +322,7 @@ } #ifdef DEBUG if (xfs_do_error && (bp != NULL)) { - if (xfs_error_dev == target->pbr_dev) { + if (xfs_error_target == target) { if (((xfs_req_num++) % xfs_error_mod) == 0) { xfs_buf_relse(bp); printk("Returning error!\n"); @@ -425,7 +425,7 @@ } #ifdef DEBUG if (xfs_do_error && !(tp->t_flags & XFS_TRANS_DIRTY)) { - if (xfs_error_dev == target->pbr_dev) { + if (xfs_error_target == target) { if (((xfs_req_num++) % xfs_error_mod) == 0) { xfs_force_shutdown(tp->t_mountp, XFS_METADATA_IO_ERROR); diff -Nru a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c --- a/fs/xfs/xfs_trans_inode.c Sun Oct 5 00:33:05 2003 +++ b/fs/xfs/xfs_trans_inode.c Sun Oct 5 00:33:05 2003 @@ -188,106 +188,6 @@ /* - * Release the inode ip which was previously acquired with xfs_trans_iget() - * or added with xfs_trans_ijoin(). This will decrement the lock - * recursion count of the inode item. If the count goes to less than 0, - * the inode will be unlocked and disassociated from the transaction. - * - * If the inode has been modified within the transaction, it will not be - * unlocked until the transaction commits. - */ -void -xfs_trans_iput( - xfs_trans_t *tp, - xfs_inode_t *ip, - uint lock_flags) -{ - xfs_inode_log_item_t *iip; - xfs_log_item_desc_t *lidp; - - /* - * If the transaction pointer is NULL, just call xfs_iput(). - */ - if (tp == NULL) { - xfs_iput(ip, lock_flags); - } - - ASSERT(ip->i_transp == tp); - iip = ip->i_itemp; - ASSERT(iip != NULL); - - /* - * Find the item descriptor pointing to this inode's - * log item. It must be there. - */ - lidp = xfs_trans_find_item(tp, (xfs_log_item_t*)iip); - ASSERT(lidp != NULL); - ASSERT(lidp->lid_item == (xfs_log_item_t*)iip); - - /* - * Be consistent about the bookkeeping for the inode's - * io lock, but it doesn't mean much really. - */ - ASSERT((iip->ili_flags & XFS_ILI_IOLOCKED_ANY) != XFS_ILI_IOLOCKED_ANY); - if (lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) { - ASSERT(iip->ili_flags & XFS_ILI_IOLOCKED_ANY); - ASSERT((!(lock_flags & XFS_IOLOCK_EXCL)) || - (iip->ili_flags & XFS_ILI_IOLOCKED_EXCL)); - ASSERT((!(lock_flags & XFS_IOLOCK_SHARED)) || - (iip->ili_flags & - (XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED))); - if (iip->ili_iolock_recur > 0) { - iip->ili_iolock_recur--; - } - } - - /* - * If the release is just for a recursive lock on the inode lock, - * then decrement the count and return. We can assert that - * the caller is dropping an EXCL lock on the inode, because - * inode must be locked EXCL within transactions. - */ - ASSERT(lock_flags & XFS_ILOCK_EXCL); - if (iip->ili_ilock_recur > 0) { - iip->ili_ilock_recur--; - return; - } - ASSERT(iip->ili_iolock_recur == 0); - - /* - * If the inode was dirtied within this transaction, it cannot - * be released until the transaction commits. - */ - if (lidp->lid_flags & XFS_LID_DIRTY) { - return; - } - - xfs_trans_free_item(tp, lidp); - - /* - * Clear the hold and iolocked flags in the inode log item. - * We wouldn't want the next user of the inode to - * get confused. Assert that if the iolocked flag is set - * in the item then we are unlocking it in the call to xfs_iput() - * below. - */ - ASSERT((!(iip->ili_flags & XFS_ILI_IOLOCKED_ANY)) || - (lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED))); - if (iip->ili_flags & (XFS_ILI_HOLD | XFS_ILI_IOLOCKED_ANY)) { - iip->ili_flags &= ~(XFS_ILI_HOLD | XFS_ILI_IOLOCKED_ANY); - } - - /* - * Unlike xfs_brelse() the inode log item cannot be - * freed, because it is embedded within the inode. - * All we have to do is release the inode. - */ - xfs_iput(ip, lock_flags); - return; -} - - -/* * Add the locked inode to the transaction. * The inode must be locked, and it cannot be associated with any * transaction. The caller must specify the locks already held diff -Nru a/fs/xfs/xfs_types.h b/fs/xfs/xfs_types.h --- a/fs/xfs/xfs_types.h Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/xfs_types.h Sun Oct 5 00:33:07 2003 @@ -83,7 +83,7 @@ * XFS_BIG_INUMS needs the VFS inode number to be 64 bits, as well * as requiring XFS_BIG_BLKNOS to be set. */ -#if defined(CONFIG_LBD) || (defined(HAVE_SECTOR_T) && (BITS_PER_LONG == 64)) +#if defined(CONFIG_LBD) || (BITS_PER_LONG == 64) # define XFS_BIG_BLKNOS 1 # if BITS_PER_LONG == 64 # define XFS_BIG_INUMS 1 diff -Nru a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c --- a/fs/xfs/xfs_vfsops.c Sun Oct 5 00:33:07 2003 +++ b/fs/xfs/xfs_vfsops.c Sun Oct 5 00:33:07 2003 @@ -1776,7 +1776,6 @@ }; struct proc_xfs_info *xfs_infop; struct xfs_mount *mp = XFS_BHVTOM(bhv); - char b[BDEVNAME_SIZE]; for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { if (mp->m_flags & xfs_infop->flag) @@ -1792,14 +1791,13 @@ if (mp->m_logbsize > 0) seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize); - if (mp->m_ddev_targp->pbr_dev != mp->m_logdev_targp->pbr_dev) + if (mp->m_ddev_targp != mp->m_logdev_targp) seq_printf(m, "," MNTOPT_LOGDEV "=%s", - bdevname(mp->m_logdev_targp->pbr_bdev, b)); + XFS_BUFTARG_NAME(mp->m_logdev_targp)); - if (mp->m_rtdev_targp && - mp->m_ddev_targp->pbr_dev != mp->m_rtdev_targp->pbr_dev) + if (mp->m_rtdev_targp && mp->m_ddev_targp != mp->m_rtdev_targp) seq_printf(m, "," MNTOPT_RTDEV "=%s", - bdevname(mp->m_rtdev_targp->pbr_bdev, b)); + XFS_BUFTARG_NAME(mp->m_rtdev_targp)); if (mp->m_dalign > 0) seq_printf(m, "," MNTOPT_SUNIT "=%d", diff -Nru a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c --- a/fs/xfs/xfs_vnodeops.c Sun Oct 5 00:33:10 2003 +++ b/fs/xfs/xfs_vnodeops.c Sun Oct 5 00:33:10 2003 @@ -144,14 +144,11 @@ xfs_ilock(ip, XFS_ILOCK_SHARED); vap->va_size = ip->i_d.di_size; - if (vap->va_mask == XFS_AT_SIZE) { - if (!(flags & ATTR_LAZY)) - xfs_iunlock(ip, XFS_ILOCK_SHARED); - return 0; - } + if (vap->va_mask == XFS_AT_SIZE) + goto all_done; + vap->va_nblocks = XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks); - vap->va_fsid = mp->m_dev; vap->va_nodeid = ip->i_ino; #if XFS_BIG_INUMS vap->va_nodeid += mp->m_inoadd; @@ -163,11 +160,8 @@ */ if ((vap->va_mask & ~(XFS_AT_SIZE|XFS_AT_FSID|XFS_AT_NODEID| - XFS_AT_NLINK|XFS_AT_BLKSIZE)) == 0) { - if (!(flags & ATTR_LAZY)) - xfs_iunlock(ip, XFS_ILOCK_SHARED); - return 0; - } + XFS_AT_NLINK|XFS_AT_BLKSIZE)) == 0) + goto all_done; /* * Copy from in-core inode. @@ -194,7 +188,7 @@ * stripe size through is not a good * idea for now. */ - vap->va_blksize = mp->m_swidth ? + vap->va_blocksize = mp->m_swidth ? /* * If the underlying volume is a stripe, then * return the stripe width in bytes as the @@ -211,7 +205,7 @@ mp->m_writeio_log)); #else - vap->va_blksize = + vap->va_blocksize = /* * Return the largest of the preferred buffer * sizes since doing small I/Os into larger @@ -229,13 +223,13 @@ * realtime extent size or the realtime volume's * extent size. */ - vap->va_blksize = ip->i_d.di_extsize ? + vap->va_blocksize = ip->i_d.di_extsize ? (ip->i_d.di_extsize << mp->m_sb.sb_blocklog) : (mp->m_sb.sb_rextsize << mp->m_sb.sb_blocklog); } } else { vap->va_rdev = ip->i_df.if_u2.if_rdev; - vap->va_blksize = BLKDEV_IOSIZE; + vap->va_blocksize = BLKDEV_IOSIZE; } vap->va_atime.tv_sec = ip->i_d.di_atime.t_sec; @@ -251,46 +245,53 @@ */ if ((vap->va_mask & (XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS| - XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0) { - if (!(flags & ATTR_LAZY)) - xfs_iunlock(ip, XFS_ILOCK_SHARED); - return 0; - } + XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0) + goto all_done; + /* * convert di_flags to xflags */ - vap->va_xflags = - ((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? - XFS_XFLAG_REALTIME : 0) | - ((ip->i_d.di_flags & XFS_DIFLAG_PREALLOC) ? - XFS_XFLAG_PREALLOC : 0) | - ((ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) ? - XFS_XFLAG_IMMUTABLE : 0) | - ((ip->i_d.di_flags & XFS_DIFLAG_APPEND) ? - XFS_XFLAG_APPEND : 0) | - ((ip->i_d.di_flags & XFS_DIFLAG_SYNC) ? - XFS_XFLAG_SYNC : 0) | - ((ip->i_d.di_flags & XFS_DIFLAG_NOATIME) ? - XFS_XFLAG_NOATIME : 0) | - ((ip->i_d.di_flags & XFS_DIFLAG_NODUMP) ? - XFS_XFLAG_NODUMP: 0) | - (XFS_IFORK_Q(ip) ? - XFS_XFLAG_HASATTR : 0); + vap->va_xflags = 0; + if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) + vap->va_xflags |= XFS_XFLAG_REALTIME; + if (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC) + vap->va_xflags |= XFS_XFLAG_PREALLOC; + if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) + vap->va_xflags |= XFS_XFLAG_IMMUTABLE; + if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) + vap->va_xflags |= XFS_XFLAG_APPEND; + if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) + vap->va_xflags |= XFS_XFLAG_SYNC; + if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) + vap->va_xflags |= XFS_XFLAG_NOATIME; + if (ip->i_d.di_flags & XFS_DIFLAG_NODUMP) + vap->va_xflags |= XFS_XFLAG_NODUMP; + if (XFS_IFORK_Q(ip)) + vap->va_xflags |= XFS_XFLAG_HASATTR; + /* + * Exit for inode revalidate. See if any of the rest of + * the fields to be filled in are needed. + */ + if ((vap->va_mask & + (XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS| + XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0) + goto all_done; + vap->va_extsize = ip->i_d.di_extsize << mp->m_sb.sb_blocklog; vap->va_nextents = (ip->i_df.if_flags & XFS_IFEXTENTS) ? ip->i_df.if_bytes / sizeof(xfs_bmbt_rec_t) : ip->i_d.di_nextents; - if (ip->i_afp != NULL) + if (ip->i_afp) vap->va_anextents = (ip->i_afp->if_flags & XFS_IFEXTENTS) ? ip->i_afp->if_bytes / sizeof(xfs_bmbt_rec_t) : ip->i_d.di_anextents; else vap->va_anextents = 0; - vap->va_gencount = ip->i_d.di_gen; - vap->va_vcode = 0L; + vap->va_gen = ip->i_d.di_gen; + all_done: if (!(flags & ATTR_LAZY)) xfs_iunlock(ip, XFS_ILOCK_SHARED); return 0; @@ -415,7 +416,7 @@ } else { if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) && !(flags & ATTR_DMI)) { - code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, bdp, + code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp, vap->va_size, 0, AT_DELAY_FLAG(flags), NULL); if (code) { lock_flags = 0; @@ -1042,7 +1043,7 @@ pathlen = (int)ip->i_d.di_size; if (ip->i_df.if_flags & XFS_IFINLINE) { - error = uiomove(ip->i_df.if_u1.if_data, pathlen, UIO_READ, uiop); + error = uio_read(ip->i_df.if_u1.if_data, pathlen, uiop); } else { /* @@ -1073,8 +1074,7 @@ byte_cnt = pathlen; pathlen -= byte_cnt; - error = uiomove(XFS_BUF_PTR(bp), byte_cnt, - UIO_READ, uiop); + error = uio_read(XFS_BUF_PTR(bp), byte_cnt, uiop); xfs_buf_relse (bp); } @@ -1729,7 +1729,7 @@ if (ip->i_d.di_nlink == 0 && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_DESTROY)) { - (void) XFS_SEND_DESTROY(mp, bdp, DM_RIGHT_NULL); + (void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL); } error = 0; @@ -4163,7 +4163,7 @@ end_dmi_offset = offset+len; if (end_dmi_offset > ip->i_d.di_size) end_dmi_offset = ip->i_d.di_size; - error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOBHV(ip), + error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip), offset, end_dmi_offset - offset, 0, NULL); if (error) @@ -4410,7 +4410,7 @@ DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { if (end_dmi_offset > ip->i_d.di_size) end_dmi_offset = ip->i_d.di_size; - error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOBHV(ip), + error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip), offset, end_dmi_offset - offset, AT_DELAY_FLAG(attr_flags), NULL); if (error) diff -Nru a/fs/xfs/xfsidbg.c b/fs/xfs/xfsidbg.c --- a/fs/xfs/xfsidbg.c Sun Oct 5 00:33:09 2003 +++ b/fs/xfs/xfsidbg.c Sun Oct 5 00:33:09 2003 @@ -3739,9 +3739,9 @@ kdb_printf(" %d:0x%p", i, dabuf->bps[i]); kdb_printf("\n"); #ifdef XFS_DABUF_DEBUG - kdb_printf(" ra 0x%x prev 0x%x next 0x%x dev %u:%u blkno 0x%x\n", + kdb_printf(" ra 0x%x prev 0x%x next 0x%x dev %s blkno 0x%x\n", dabuf->ra, dabuf->prev, dabuf->next, - MAJOR(dabuf->dev), MINOR(dabuf->dev), dabuf->blkno); + XFS_BUFTARG_NAME(dabuf->dev), dabuf->blkno); #endif } @@ -4269,9 +4269,8 @@ xfsidbg_get_cstate(log->l_covered_state)); kdb_printf("flags: "); printflags(log->l_flags, t_flags,"log"); - kdb_printf(" dev: %u:%u logBBstart: %lld logsize: %d logBBsize: %d\n", - MAJOR(log->l_dev), MINOR(log->l_dev), - (long long) log->l_logBBstart, + kdb_printf(" dev: %s logBBstart: %lld logsize: %d logBBsize: %d\n", + XFS_BUFTARG_NAME(log->l_targ), (long long) log->l_logBBstart, log->l_logsize,log->l_logBBsize); kdb_printf("curr_cycle: %d prev_cycle: %d curr_block: %d prev_block: %d\n", log->l_curr_cycle, log->l_prev_cycle, log->l_curr_block, @@ -4646,14 +4645,14 @@ XFS_MTOVFS(mp), mp->m_tid, &mp->m_ail_lock, &mp->m_ail); kdb_printf("ail_gen 0x%x &sb 0x%p\n", mp->m_ail_gen, &mp->m_sb); - kdb_printf("sb_lock 0x%p sb_bp 0x%p dev %u:%u logdev %u:%u rtdev %u:%u\n", + kdb_printf("sb_lock 0x%p sb_bp 0x%p dev %s logdev %s rtdev %s\n", &mp->m_sb_lock, mp->m_sb_bp, - mp->m_ddev_targp ? MAJOR(mp->m_ddev_targp->pbr_dev) : 0, - mp->m_ddev_targp ? MINOR(mp->m_ddev_targp->pbr_dev) : 0, - mp->m_logdev_targp ? MAJOR(mp->m_logdev_targp->pbr_dev) : 0, - mp->m_logdev_targp ? MINOR(mp->m_logdev_targp->pbr_dev) : 0, - mp->m_rtdev_targp ? MAJOR(mp->m_rtdev_targp->pbr_dev) : 0, - mp->m_rtdev_targp ? MINOR(mp->m_rtdev_targp->pbr_dev) : 0); + mp->m_ddev_targp ? + XFS_BUFTARG_NAME(mp->m_ddev_targp) : "none", + mp->m_logdev_targp ? + XFS_BUFTARG_NAME(mp->m_logdev_targp) : "none", + mp->m_rtdev_targp ? + XFS_BUFTARG_NAME(mp->m_rtdev_targp) : "none"); kdb_printf("bsize %d agfrotor %d agirotor %d ihash 0x%p ihsize %d\n", mp->m_bsize, mp->m_agfrotor, mp->m_agirotor, mp->m_ihash, mp->m_ihsize); @@ -4824,9 +4823,8 @@ ip->i_mnext, ip->i_mprev, XFS_ITOV_NULL(ip)); - kdb_printf("dev %u:%u ino %s\n", - MAJOR(ip->i_mount->m_dev), - MINOR(ip->i_mount->m_dev), + kdb_printf("dev %s ino %s\n", + XFS_BUFTARG_NAME(ip->i_mount->m_ddev_targp), xfs_fmtino(ip->i_ino, ip->i_mount)); kdb_printf("blkno 0x%llx len 0x%x boffset 0x%x\n", (long long) ip->i_blkno, diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h --- a/include/acpi/acconfig.h Sun Oct 5 00:33:09 2003 +++ b/include/acpi/acconfig.h Sun Oct 5 00:33:09 2003 @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20030813 +#define ACPI_CA_VERSION 0x20030918 /* Maximum objects in the various object caches */ diff -Nru a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h --- a/include/acpi/acdisasm.h Sun Oct 5 00:33:08 2003 +++ b/include/acpi/acdisasm.h Sun Oct 5 00:33:08 2003 @@ -152,10 +152,6 @@ acpi_dm_decode_internal_object ( union acpi_operand_object *obj_desc); -void -acpi_dm_decode_node ( - struct acpi_namespace_node *node); - u32 acpi_dm_block_type ( union acpi_parse_object *op); diff -Nru a/include/acpi/acstruct.h b/include/acpi/acstruct.h --- a/include/acpi/acstruct.h Sun Oct 5 00:33:06 2003 +++ b/include/acpi/acstruct.h Sun Oct 5 00:33:06 2003 @@ -91,11 +91,12 @@ struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ union acpi_operand_object **caller_return_desc; union acpi_generic_state *control_state; /* List of control states (nested IFs) */ + struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ struct acpi_namespace_node *method_call_node; /* Called method Node*/ union acpi_parse_object *method_call_op; /* method_call Op if running a method */ union acpi_operand_object *method_desc; /* Method descriptor if running a method */ - struct acpi_namespace_node *method_node; /* Method Node if running a method */ + struct acpi_namespace_node *method_node; /* Method node if running a method. */ union acpi_parse_object *op; /* Current parser op */ union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ const struct acpi_opcode_info *op_info; /* Info on current opcode */ diff -Nru a/include/asm-alpha/cacheflush.h b/include/asm-alpha/cacheflush.h --- a/include/asm-alpha/cacheflush.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-alpha/cacheflush.h Sun Oct 5 00:33:09 2003 @@ -10,6 +10,8 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_dcache_page(page) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) /* Note that the following two definitions are _highly_ dependent on the contexts in which they are used in the kernel. I personally @@ -59,5 +61,12 @@ /* This is used only in do_no_page and do_swap_page. */ #define flush_icache_page(vma, page) \ flush_icache_user_range((vma), (page), 0, 0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) #endif /* _ALPHA_CACHEFLUSH_H */ diff -Nru a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h --- a/include/asm-alpha/pgtable.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-alpha/pgtable.h Sun Oct 5 00:33:07 2003 @@ -49,7 +49,6 @@ #else #define VMALLOC_START (-2*PGDIR_SIZE) #endif -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (-PGDIR_SIZE) /* diff -Nru a/include/asm-arm/arch-adifcc/vmalloc.h b/include/asm-arm/arch-adifcc/vmalloc.h --- a/include/asm-arm/arch-adifcc/vmalloc.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-arm/arch-adifcc/vmalloc.h Sun Oct 5 00:33:06 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (0xe8000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-anakin/vmalloc.h b/include/asm-arm/arch-anakin/vmalloc.h --- a/include/asm-arm/arch-anakin/vmalloc.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-arm/arch-anakin/vmalloc.h Sun Oct 5 00:33:07 2003 @@ -19,8 +19,7 @@ * linux/arch/arm/kernel/traps.c) */ #define VMALLOC_ARCH_OFFSET (8 * 1024 * 1024) -#define VMALLOC_VMADDR(a) ((unsigned int) (a)) -#define VMALLOC_START ((VMALLOC_VMADDR(high_memory) + VMALLOC_ARCH_OFFSET) & ~(VMALLOC_ARCH_OFFSET - 1)) +#define VMALLOC_START (((unsigned long) (high_memory) + VMALLOC_ARCH_OFFSET) & ~(VMALLOC_ARCH_OFFSET - 1)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-cl7500/vmalloc.h b/include/asm-arm/arch-cl7500/vmalloc.h --- a/include/asm-arm/arch-cl7500/vmalloc.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-arm/arch-cl7500/vmalloc.h Sun Oct 5 00:33:10 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x1c000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-clps711x/vmalloc.h b/include/asm-arm/arch-clps711x/vmalloc.h --- a/include/asm-arm/arch-clps711x/vmalloc.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-arm/arch-clps711x/vmalloc.h Sun Oct 5 00:33:05 2003 @@ -28,7 +28,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-ebsa110/vmalloc.h b/include/asm-arm/arch-ebsa110/vmalloc.h --- a/include/asm-arm/arch-ebsa110/vmalloc.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-arm/arch-ebsa110/vmalloc.h Sun Oct 5 00:33:08 2003 @@ -18,7 +18,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x1f000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-ebsa285/vmalloc.h b/include/asm-arm/arch-ebsa285/vmalloc.h --- a/include/asm-arm/arch-ebsa285/vmalloc.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-arm/arch-ebsa285/vmalloc.h Sun Oct 5 00:33:08 2003 @@ -18,7 +18,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #ifdef CONFIG_ARCH_FOOTBRIDGE #define VMALLOC_END (PAGE_OFFSET + 0x30000000) diff -Nru a/include/asm-arm/arch-epxa10db/vmalloc.h b/include/asm-arm/arch-epxa10db/vmalloc.h --- a/include/asm-arm/arch-epxa10db/vmalloc.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-arm/arch-epxa10db/vmalloc.h Sun Oct 5 00:33:06 2003 @@ -28,7 +28,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-integrator/irqs.h b/include/asm-arm/arch-integrator/irqs.h --- a/include/asm-arm/arch-integrator/irqs.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-arm/arch-integrator/irqs.h Sun Oct 5 00:33:05 2003 @@ -19,116 +19,39 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Use the integrator definitions */ -#include - -/* - * IRQ interrupts definitions are the same the INT definitions - * held within platform.h - */ -#define IRQ_SOFTINT INT_SOFTINT -#define IRQ_UARTINT0 INT_UARTINT0 -#define IRQ_UARTINT1 INT_UARTINT1 -#define IRQ_KMIINT0 INT_KMIINT0 -#define IRQ_KMIINT1 INT_KMIINT1 -#define IRQ_TIMERINT0 INT_TIMERINT0 -#define IRQ_TIMERINT1 INT_TIMERINT1 -#define IRQ_TIMERINT2 INT_TIMERINT2 -#define IRQ_RTCINT INT_RTCINT -#define IRQ_EXPINT0 INT_EXPINT0 -#define IRQ_EXPINT1 INT_EXPINT1 -#define IRQ_EXPINT2 INT_EXPINT2 -#define IRQ_EXPINT3 INT_EXPINT3 -#define IRQ_PCIINT0 INT_PCIINT0 -#define IRQ_PCIINT1 INT_PCIINT1 -#define IRQ_PCIINT2 INT_PCIINT2 -#define IRQ_PCIINT3 INT_PCIINT3 -#define IRQ_V3INT INT_V3INT -#define IRQ_CPINT0 INT_CPINT0 -#define IRQ_CPINT1 INT_CPINT1 -#define IRQ_LBUSTIMEOUT INT_LBUSTIMEOUT -#define IRQ_APCINT INT_APCINT - -#define IRQMASK_SOFTINT INTMASK_SOFTINT -#define IRQMASK_UARTINT0 INTMASK_UARTINT0 -#define IRQMASK_UARTINT1 INTMASK_UARTINT1 -#define IRQMASK_KMIINT0 INTMASK_KMIINT0 -#define IRQMASK_KMIINT1 INTMASK_KMIINT1 -#define IRQMASK_TIMERINT0 INTMASK_TIMERINT0 -#define IRQMASK_TIMERINT1 INTMASK_TIMERINT1 -#define IRQMASK_TIMERINT2 INTMASK_TIMERINT2 -#define IRQMASK_RTCINT INTMASK_RTCINT -#define IRQMASK_EXPINT0 INTMASK_EXPINT0 -#define IRQMASK_EXPINT1 INTMASK_EXPINT1 -#define IRQMASK_EXPINT2 INTMASK_EXPINT2 -#define IRQMASK_EXPINT3 INTMASK_EXPINT3 -#define IRQMASK_PCIINT0 INTMASK_PCIINT0 -#define IRQMASK_PCIINT1 INTMASK_PCIINT1 -#define IRQMASK_PCIINT2 INTMASK_PCIINT2 -#define IRQMASK_PCIINT3 INTMASK_PCIINT3 -#define IRQMASK_V3INT INTMASK_V3INT -#define IRQMASK_CPINT0 INTMASK_CPINT0 -#define IRQMASK_CPINT1 INTMASK_CPINT1 -#define IRQMASK_LBUSTIMEOUT INTMASK_LBUSTIMEOUT -#define IRQMASK_APCINT INTMASK_APCINT - /* - * FIQ interrupts definitions are the same the INT definitions. + * Interrupt numbers */ -#define FIQ_SOFTINT INT_SOFTINT -#define FIQ_UARTINT0 INT_UARTINT0 -#define FIQ_UARTINT1 INT_UARTINT1 -#define FIQ_KMIINT0 INT_KMIINT0 -#define FIQ_KMIINT1 INT_KMIINT1 -#define FIQ_TIMERINT0 INT_TIMERINT0 -#define FIQ_TIMERINT1 INT_TIMERINT1 -#define FIQ_TIMERINT2 INT_TIMERINT2 -#define FIQ_RTCINT INT_RTCINT -#define FIQ_EXPINT0 INT_EXPINT0 -#define FIQ_EXPINT1 INT_EXPINT1 -#define FIQ_EXPINT2 INT_EXPINT2 -#define FIQ_EXPINT3 INT_EXPINT3 -#define FIQ_PCIINT0 INT_PCIINT0 -#define FIQ_PCIINT1 INT_PCIINT1 -#define FIQ_PCIINT2 INT_PCIINT2 -#define FIQ_PCIINT3 INT_PCIINT3 -#define FIQ_V3INT INT_V3INT -#define FIQ_CPINT0 INT_CPINT0 -#define FIQ_CPINT1 INT_CPINT1 -#define FIQ_LBUSTIMEOUT INT_LBUSTIMEOUT -#define FIQ_APCINT INT_APCINT - -#define FIQMASK_SOFTINT INTMASK_SOFTINT -#define FIQMASK_UARTINT0 INTMASK_UARTINT0 -#define FIQMASK_UARTINT1 INTMASK_UARTINT1 -#define FIQMASK_KMIINT0 INTMASK_KMIINT0 -#define FIQMASK_KMIINT1 INTMASK_KMIINT1 -#define FIQMASK_TIMERINT0 INTMASK_TIMERINT0 -#define FIQMASK_TIMERINT1 INTMASK_TIMERINT1 -#define FIQMASK_TIMERINT2 INTMASK_TIMERINT2 -#define FIQMASK_RTCINT INTMASK_RTCINT -#define FIQMASK_EXPINT0 INTMASK_EXPINT0 -#define FIQMASK_EXPINT1 INTMASK_EXPINT1 -#define FIQMASK_EXPINT2 INTMASK_EXPINT2 -#define FIQMASK_EXPINT3 INTMASK_EXPINT3 -#define FIQMASK_PCIINT0 INTMASK_PCIINT0 -#define FIQMASK_PCIINT1 INTMASK_PCIINT1 -#define FIQMASK_PCIINT2 INTMASK_PCIINT2 -#define FIQMASK_PCIINT3 INTMASK_PCIINT3 -#define FIQMASK_V3INT INTMASK_V3INT -#define FIQMASK_CPINT0 INTMASK_CPINT0 -#define FIQMASK_CPINT1 INTMASK_CPINT1 -#define FIQMASK_LBUSTIMEOUT INTMASK_LBUSTIMEOUT -#define FIQMASK_APCINT INTMASK_APCINT - -/* - * Misc. interrupt definitions - */ -#define IRQ_KEYBDINT INT_KMIINT0 -#define IRQ_MOUSEINT INT_KMIINT1 - -#define IRQMASK_KEYBDINT INTMASK_KMIINT0 -#define IRQMASK_MOUSEINT INTMASK_KMIINT1 +#define IRQ_PIC_START 0 +#define IRQ_SOFTINT 0 +#define IRQ_UARTINT0 1 +#define IRQ_UARTINT1 2 +#define IRQ_KMIINT0 3 +#define IRQ_KMIINT1 4 +#define IRQ_TIMERINT0 5 +#define IRQ_TIMERINT1 6 +#define IRQ_TIMERINT2 7 +#define IRQ_RTCINT 8 +#define IRQ_AP_EXPINT0 9 +#define IRQ_AP_EXPINT1 10 +#define IRQ_AP_EXPINT2 11 +#define IRQ_AP_EXPINT3 12 +#define IRQ_AP_PCIINT0 13 +#define IRQ_AP_PCIINT1 14 +#define IRQ_AP_PCIINT2 15 +#define IRQ_AP_PCIINT3 16 +#define IRQ_AP_V3INT 17 +#define IRQ_AP_CPINT0 18 +#define IRQ_AP_CPINT1 19 +#define IRQ_AP_LBUSTIMEOUT 20 +#define IRQ_AP_APCINT 21 +#define IRQ_PIC_END 31 + +#define IRQ_CIC_START 32 +#define IRQ_CM_SOFTINT 32 +#define IRQ_CM_COMMRX 33 +#define IRQ_CM_COMMTX 34 +#define IRQ_CIC_END 34 -#define NR_IRQS (MAXIRQNUM + 1) +#define NR_IRQS 47 diff -Nru a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h --- a/include/asm-arm/arch-integrator/platform.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-arm/arch-integrator/platform.h Sun Oct 5 00:33:08 2003 @@ -386,85 +386,6 @@ * */ -/* - * As the interrupt bit definitions for FIQ/IRQ there is a common - * set of definitions prefixed INT/INTMASK. The FIQ/IRQ definitions - * have been left to maintain backwards compatible. - * - */ - -/* - * Interrupt numbers - * - */ -#define INT_SOFTINT 0 -#define INT_UARTINT0 1 -#define INT_UARTINT1 2 -#define INT_KMIINT0 3 -#define INT_KMIINT1 4 -#define INT_TIMERINT0 5 -#define INT_TIMERINT1 6 -#define INT_TIMERINT2 7 -#define INT_RTCINT 8 -#define INT_EXPINT0 9 -#define INT_EXPINT1 10 -#define INT_EXPINT2 11 -#define INT_EXPINT3 12 -#define INT_PCIINT0 13 -#define INT_PCIINT1 14 -#define INT_PCIINT2 15 -#define INT_PCIINT3 16 -#define INT_V3INT 17 -#define INT_CPINT0 18 -#define INT_CPINT1 19 -#define INT_LBUSTIMEOUT 20 -#define INT_APCINT 21 -#define INT_CM_SOFTINT 24 -#define INT_CM_COMMRX 25 -#define INT_CM_COMMTX 26 - -/* - * Interrupt bit positions - * - */ -#define INTMASK_SOFTINT (1 << INT_SOFTINT) -#define INTMASK_UARTINT0 (1 << INT_UARTINT0) -#define INTMASK_UARTINT1 (1 << INT_UARTINT1) -#define INTMASK_KMIINT0 (1 << INT_KMIINT0) -#define INTMASK_KMIINT1 (1 << INT_KMIINT1) -#define INTMASK_TIMERINT0 (1 << INT_TIMERINT0) -#define INTMASK_TIMERINT1 (1 << INT_TIMERINT1) -#define INTMASK_TIMERINT2 (1 << INT_TIMERINT2) -#define INTMASK_RTCINT (1 << INT_RTCINT) -#define INTMASK_EXPINT0 (1 << INT_EXPINT0) -#define INTMASK_EXPINT1 (1 << INT_EXPINT1) -#define INTMASK_EXPINT2 (1 << INT_EXPINT2) -#define INTMASK_EXPINT3 (1 << INT_EXPINT3) -#define INTMASK_PCIINT0 (1 << INT_PCIINT0) -#define INTMASK_PCIINT1 (1 << INT_PCIINT1) -#define INTMASK_PCIINT2 (1 << INT_PCIINT2) -#define INTMASK_PCIINT3 (1 << INT_PCIINT3) -#define INTMASK_V3INT (1 << INT_V3INT) -#define INTMASK_CPINT0 (1 << INT_CPINT0) -#define INTMASK_CPINT1 (1 << INT_CPINT1) -#define INTMASK_LBUSTIMEOUT (1 << INT_LBUSTIMEOUT) -#define INTMASK_APCINT (1 << INT_APCINT) -#define INTMASK_CM_SOFTINT (1 << INT_CM_SOFTINT) -#define INTMASK_CM_COMMRX (1 << INT_CM_COMMRX) -#define INTMASK_CM_COMMTX (1 << INT_CM_COMMTX) - -/* - * INTEGRATOR_CM_INT0 - Interrupt number of first CM interrupt - * INTEGRATOR_SC_VALID_INT - Mask of valid system controller interrupts - * - */ -#define INTEGRATOR_CM_INT0 INT_CM_SOFTINT -#define INTEGRATOR_SC_VALID_INT 0x003FFFFF - -#define MAXIRQNUM 31 -#define MAXFIQNUM 31 -#define MAXSWINUM 31 - /* ------------------------------------------------------------------------ * LED's - The header LED is not accessible via the uHAL API * ------------------------------------------------------------------------ diff -Nru a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h --- a/include/asm-arm/arch-integrator/time.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-arm/arch-integrator/time.h Sun Oct 5 00:33:09 2003 @@ -86,7 +86,7 @@ /* * Interrupt pending? If so, we've reloaded once already. */ - if (status & IRQMASK_TIMERINT1) + if (status & (1 << IRQ_TIMERINT1)) ticks1 += TIMER_RELOAD; /* diff -Nru a/include/asm-arm/arch-integrator/vmalloc.h b/include/asm-arm/arch-integrator/vmalloc.h --- a/include/asm-arm/arch-integrator/vmalloc.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-arm/arch-integrator/vmalloc.h Sun Oct 5 00:33:06 2003 @@ -28,7 +28,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-iop3xx/vmalloc.h b/include/asm-arm/arch-iop3xx/vmalloc.h --- a/include/asm-arm/arch-iop3xx/vmalloc.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-arm/arch-iop3xx/vmalloc.h Sun Oct 5 00:33:09 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (0xe8000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-l7200/vmalloc.h b/include/asm-arm/arch-l7200/vmalloc.h --- a/include/asm-arm/arch-l7200/vmalloc.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-arm/arch-l7200/vmalloc.h Sun Oct 5 00:33:07 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-nexuspci/vmalloc.h b/include/asm-arm/arch-nexuspci/vmalloc.h --- a/include/asm-arm/arch-nexuspci/vmalloc.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-arm/arch-nexuspci/vmalloc.h Sun Oct 5 00:33:08 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x20000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h --- a/include/asm-arm/arch-pxa/irqs.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-arm/arch-pxa/irqs.h Sun Oct 5 00:33:06 2003 @@ -13,7 +13,7 @@ #include #define PXA_IRQ_SKIP 7 /* The first 7 IRQs are not yet used */ -#define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP) +#define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP) #define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error */ #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ @@ -47,7 +47,7 @@ #define IRQ_TO_GPIO_2_80(i) \ ((i) - PXA_IRQ(32) + 2) -#define IRQ_TO_GPIO(i) ((i) - (((i) > IRQ_GPIO1) ? IRQ_GPIO(2) : IRQ_GPIO(0))) +#define IRQ_TO_GPIO(i) ((i) - (((i) > IRQ_GPIO1) ? IRQ_GPIO(2) - 2 : IRQ_GPIO(0))) /* * The next 16 interrupts are for board specific purposes. Since @@ -131,8 +131,10 @@ #define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x)) #define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0) #define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1) -#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) +#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */ #define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3) #define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4) #define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5) +#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */ +#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6) diff -Nru a/include/asm-arm/arch-pxa/lubbock.h b/include/asm-arm/arch-pxa/lubbock.h --- a/include/asm-arm/arch-pxa/lubbock.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-arm/arch-pxa/lubbock.h Sun Oct 5 00:33:07 2003 @@ -12,7 +12,8 @@ #define LUBBOCK_FPGA_PHYS PXA_CS2_PHYS #define LUBBOCK_FPGA_VIRT (0xf0000000) /* phys 0x08000000 */ -#define LUBBOCK_ETH_BASE (0xf1000000) /* phys 0x0c000000 */ +#define LUBBOCK_ETH_PHYS PXA_CS3_PHYS +#define LUBBOCK_ETH_VIRT (0xf1000000) #define LUB_P2V(x) ((x) - LUBBOCK_FPGA_PHYS + LUBBOCK_FPGA_VIRT) #define LUB_V2P(x) ((x) - LUBBOCK_FPGA_VIRT + LUBBOCK_FPGA_PHYS) diff -Nru a/include/asm-arm/arch-pxa/vmalloc.h b/include/asm-arm/arch-pxa/vmalloc.h --- a/include/asm-arm/arch-pxa/vmalloc.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-arm/arch-pxa/vmalloc.h Sun Oct 5 00:33:08 2003 @@ -19,7 +19,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (0xe8000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-rpc/vmalloc.h b/include/asm-arm/arch-rpc/vmalloc.h --- a/include/asm-arm/arch-rpc/vmalloc.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-arm/arch-rpc/vmalloc.h Sun Oct 5 00:33:09 2003 @@ -18,7 +18,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x1c000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-sa1100/vmalloc.h b/include/asm-arm/arch-sa1100/vmalloc.h --- a/include/asm-arm/arch-sa1100/vmalloc.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-arm/arch-sa1100/vmalloc.h Sun Oct 5 00:33:10 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (0xe8000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-shark/vmalloc.h b/include/asm-arm/arch-shark/vmalloc.h --- a/include/asm-arm/arch-shark/vmalloc.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-arm/arch-shark/vmalloc.h Sun Oct 5 00:33:06 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/arch-tbox/vmalloc.h b/include/asm-arm/arch-tbox/vmalloc.h --- a/include/asm-arm/arch-tbox/vmalloc.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-arm/arch-tbox/vmalloc.h Sun Oct 5 00:33:05 2003 @@ -12,7 +12,6 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (PAGE_OFFSET + 0x10000000) #define MODULE_START (PAGE_OFFSET - 16*1048576) diff -Nru a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h --- a/include/asm-arm/cacheflush.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-arm/cacheflush.h Sun Oct 5 00:33:10 2003 @@ -207,6 +207,15 @@ extern void dmac_clean_range(unsigned long, unsigned long); extern void dmac_flush_range(unsigned long, unsigned long); +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) + #endif /* diff -Nru a/include/asm-arm/mach/flash.h b/include/asm-arm/mach/flash.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/asm-arm/mach/flash.h Sun Oct 5 00:33:10 2003 @@ -0,0 +1,19 @@ +/* + * linux/include/asm-arm/mach/flash.h + * + * Copyright (C) 2003 Russell King, All Rights Reserved. + */ +#ifndef ASMARM_MACH_FLASH_H +#define ASMAMR_MACH_FLASH_H + +struct mtd_partition; + +struct flash_platform_data { + const char *map_name; + int width; + int (*init)(void); + void (*exit)(void); + void (*set_vpp)(int on); +}; + +#endif diff -Nru a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h --- a/include/asm-arm/unistd.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-arm/unistd.h Sun Oct 5 00:33:10 2003 @@ -32,7 +32,7 @@ #define __NR_write (__NR_SYSCALL_BASE+ 4) #define __NR_open (__NR_SYSCALL_BASE+ 5) #define __NR_close (__NR_SYSCALL_BASE+ 6) -#define __NR_waitpid (__NR_SYSCALL_BASE+ 7) /* removed */ + /* 7 was sys_waitpid */ #define __NR_creat (__NR_SYSCALL_BASE+ 8) #define __NR_link (__NR_SYSCALL_BASE+ 9) #define __NR_unlink (__NR_SYSCALL_BASE+ 10) @@ -42,7 +42,7 @@ #define __NR_mknod (__NR_SYSCALL_BASE+ 14) #define __NR_chmod (__NR_SYSCALL_BASE+ 15) #define __NR_lchown (__NR_SYSCALL_BASE+ 16) -#define __NR_break (__NR_SYSCALL_BASE+ 17) /* removed */ + /* 17 was sys_break */ /* 18 was sys_stat */ #define __NR_lseek (__NR_SYSCALL_BASE+ 19) #define __NR_getpid (__NR_SYSCALL_BASE+ 20) @@ -53,14 +53,14 @@ #define __NR_stime (__NR_SYSCALL_BASE+ 25) #define __NR_ptrace (__NR_SYSCALL_BASE+ 26) #define __NR_alarm (__NR_SYSCALL_BASE+ 27) - + /* 28 was sys_fstat */ #define __NR_pause (__NR_SYSCALL_BASE+ 29) #define __NR_utime (__NR_SYSCALL_BASE+ 30) -#define __NR_stty (__NR_SYSCALL_BASE+ 31) /* removed */ -#define __NR_gtty (__NR_SYSCALL_BASE+ 32) /* removed */ + /* 31 was sys_stty */ + /* 32 was sys_gtty */ #define __NR_access (__NR_SYSCALL_BASE+ 33) #define __NR_nice (__NR_SYSCALL_BASE+ 34) -#define __NR_ftime (__NR_SYSCALL_BASE+ 35) /* removed */ + /* 35 was sys_ftime */ #define __NR_sync (__NR_SYSCALL_BASE+ 36) #define __NR_kill (__NR_SYSCALL_BASE+ 37) #define __NR_rename (__NR_SYSCALL_BASE+ 38) @@ -69,21 +69,21 @@ #define __NR_dup (__NR_SYSCALL_BASE+ 41) #define __NR_pipe (__NR_SYSCALL_BASE+ 42) #define __NR_times (__NR_SYSCALL_BASE+ 43) -#define __NR_prof (__NR_SYSCALL_BASE+ 44) /* removed */ + /* 44 was sys_prof */ #define __NR_brk (__NR_SYSCALL_BASE+ 45) #define __NR_setgid (__NR_SYSCALL_BASE+ 46) #define __NR_getgid (__NR_SYSCALL_BASE+ 47) -#define __NR_signal (__NR_SYSCALL_BASE+ 48) /* removed */ + /* 48 was sys_signal */ #define __NR_geteuid (__NR_SYSCALL_BASE+ 49) #define __NR_getegid (__NR_SYSCALL_BASE+ 50) #define __NR_acct (__NR_SYSCALL_BASE+ 51) #define __NR_umount2 (__NR_SYSCALL_BASE+ 52) -#define __NR_lock (__NR_SYSCALL_BASE+ 53) /* removed */ + /* 53 was sys_lock */ #define __NR_ioctl (__NR_SYSCALL_BASE+ 54) #define __NR_fcntl (__NR_SYSCALL_BASE+ 55) -#define __NR_mpx (__NR_SYSCALL_BASE+ 56) /* removed */ + /* 56 was sys_mpx */ #define __NR_setpgid (__NR_SYSCALL_BASE+ 57) -#define __NR_ulimit (__NR_SYSCALL_BASE+ 58) /* removed */ + /* 58 was sys_ulimit */ /* 59 was sys_olduname */ #define __NR_umask (__NR_SYSCALL_BASE+ 60) #define __NR_chroot (__NR_SYSCALL_BASE+ 61) @@ -93,8 +93,8 @@ #define __NR_getpgrp (__NR_SYSCALL_BASE+ 65) #define __NR_setsid (__NR_SYSCALL_BASE+ 66) #define __NR_sigaction (__NR_SYSCALL_BASE+ 67) -#define __NR_sgetmask (__NR_SYSCALL_BASE+ 68) /* removed */ -#define __NR_ssetmask (__NR_SYSCALL_BASE+ 69) /* removed */ + /* 68 was sys_sgetmask */ + /* 69 was sys_ssetmask */ #define __NR_setreuid (__NR_SYSCALL_BASE+ 70) #define __NR_setregid (__NR_SYSCALL_BASE+ 71) #define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72) @@ -123,10 +123,10 @@ #define __NR_fchown (__NR_SYSCALL_BASE+ 95) #define __NR_getpriority (__NR_SYSCALL_BASE+ 96) #define __NR_setpriority (__NR_SYSCALL_BASE+ 97) -#define __NR_profil (__NR_SYSCALL_BASE+ 98) /* removed */ + /* 98 was sys_profil */ #define __NR_statfs (__NR_SYSCALL_BASE+ 99) #define __NR_fstatfs (__NR_SYSCALL_BASE+100) -#define __NR_ioperm (__NR_SYSCALL_BASE+101) + /* 101 was sys_ioperm */ #define __NR_socketcall (__NR_SYSCALL_BASE+102) #define __NR_syslog (__NR_SYSCALL_BASE+103) #define __NR_setitimer (__NR_SYSCALL_BASE+104) @@ -137,7 +137,7 @@ /* 109 was sys_uname */ /* 110 was sys_iopl */ #define __NR_vhangup (__NR_SYSCALL_BASE+111) -#define __NR_idle (__NR_SYSCALL_BASE+112) + /* 112 was sys_idle */ #define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a syscall! */ #define __NR_wait4 (__NR_SYSCALL_BASE+114) #define __NR_swapoff (__NR_SYSCALL_BASE+115) @@ -148,21 +148,21 @@ #define __NR_clone (__NR_SYSCALL_BASE+120) #define __NR_setdomainname (__NR_SYSCALL_BASE+121) #define __NR_uname (__NR_SYSCALL_BASE+122) -#define __NR_modify_ldt (__NR_SYSCALL_BASE+123) + /* 123 was sys_modify_ldt */ #define __NR_adjtimex (__NR_SYSCALL_BASE+124) #define __NR_mprotect (__NR_SYSCALL_BASE+125) #define __NR_sigprocmask (__NR_SYSCALL_BASE+126) -#define __NR_create_module (__NR_SYSCALL_BASE+127) /* removed */ + /* 127 was sys_create_module */ #define __NR_init_module (__NR_SYSCALL_BASE+128) #define __NR_delete_module (__NR_SYSCALL_BASE+129) -#define __NR_get_kernel_syms (__NR_SYSCALL_BASE+130) /* removed */ + /* 130 was sys_get_kernel_syms */ #define __NR_quotactl (__NR_SYSCALL_BASE+131) #define __NR_getpgid (__NR_SYSCALL_BASE+132) #define __NR_fchdir (__NR_SYSCALL_BASE+133) #define __NR_bdflush (__NR_SYSCALL_BASE+134) #define __NR_sysfs (__NR_SYSCALL_BASE+135) #define __NR_personality (__NR_SYSCALL_BASE+136) -#define __NR_afs_syscall (__NR_SYSCALL_BASE+137) /* Syscall for Andrew File System */ + /* 137 was sys_afs_syscall */ #define __NR_setfsuid (__NR_SYSCALL_BASE+138) #define __NR_setfsgid (__NR_SYSCALL_BASE+139) #define __NR__llseek (__NR_SYSCALL_BASE+140) @@ -191,8 +191,8 @@ #define __NR_mremap (__NR_SYSCALL_BASE+163) #define __NR_setresuid (__NR_SYSCALL_BASE+164) #define __NR_getresuid (__NR_SYSCALL_BASE+165) -#define __NR_vm86 (__NR_SYSCALL_BASE+166) /* removed */ -#define __NR_query_module (__NR_SYSCALL_BASE+167) /* removed */ + /* 166 was sys_vm86 */ + /* 167 was sys_query_module */ #define __NR_poll (__NR_SYSCALL_BASE+168) #define __NR_nfsservctl (__NR_SYSCALL_BASE+169) #define __NR_setresgid (__NR_SYSCALL_BASE+170) diff -Nru a/include/asm-arm26/cacheflush.h b/include/asm-arm26/cacheflush.h --- a/include/asm-arm26/cacheflush.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-arm26/cacheflush.h Sun Oct 5 00:33:09 2003 @@ -25,6 +25,8 @@ #define flush_cache_range(vma,start,end) do { } while (0) #define flush_cache_page(vma,vmaddr) do { } while (0) #define flush_page_to_ram(page) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) #define invalidate_dcache_range(start,end) do { } while (0) #define clean_dcache_range(start,end) do { } while (0) @@ -36,6 +38,11 @@ #define flush_icache_user_range(start,end, bob, fred) do { } while (0) #define flush_icache_range(start,end) do { } while (0) #define flush_icache_page(vma,page) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) /* DAG: ARM3 will flush cache on MEMC updates anyway? so don't bother */ /* IM : Yes, it will, but only if setup to do so (we do this). */ diff -Nru a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h --- a/include/asm-arm26/pgtable.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-arm26/pgtable.h Sun Oct 5 00:33:06 2003 @@ -173,7 +173,6 @@ * area for the same reason. ;) FIXME: surely 1 page not 4k ? */ #define VMALLOC_START 0x01a00000 -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END 0x01c00000 /* Is pmd_page supposed to return a pointer to a page in some arches? ours seems to diff -Nru a/include/asm-cris/arch-v10/pgtable.h b/include/asm-cris/arch-v10/pgtable.h --- a/include/asm-cris/arch-v10/pgtable.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-cris/arch-v10/pgtable.h Sun Oct 5 00:33:10 2003 @@ -7,11 +7,9 @@ #ifdef CONFIG_CRIS_LOW_MAP #define VMALLOC_START KSEG_7 -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END KSEG_8 #else #define VMALLOC_START KSEG_D -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END KSEG_E #endif diff -Nru a/include/asm-cris/cacheflush.h b/include/asm-cris/cacheflush.h --- a/include/asm-cris/cacheflush.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-cris/cacheflush.h Sun Oct 5 00:33:05 2003 @@ -16,6 +16,13 @@ #define flush_icache_range(start, end) do { } while (0) #define flush_icache_page(vma,pg) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) void global_flush_tlb(void); int change_page_attr(struct page *page, int numpages, pgprot_t prot); diff -Nru a/include/asm-h8300/cacheflush.h b/include/asm-h8300/cacheflush.h --- a/include/asm-h8300/cacheflush.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-h8300/cacheflush.h Sun Oct 5 00:33:08 2003 @@ -11,7 +11,6 @@ */ #define flush_cache_all() -#define flush_cache_all() #define flush_cache_mm(mm) #define flush_cache_range(vma,a,b) #define flush_cache_page(vma,p) @@ -20,6 +19,8 @@ #define flush_icache() #define flush_icache_page(vma,page) #define flush_icache_range(start,len) +#define flush_cache_vmap(start, end) +#define flush_cache_vunmap(start, end) #define cache_push_v(vaddr,len) #define cache_push(paddr,len) #define cache_clear(paddr,len) @@ -27,5 +28,10 @@ #define flush_dcache_range(a,b) #define flush_icache_user_range(vma,page,addr,len) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) #endif /* _ASM_H8300_CACHEFLUSH_H */ diff -Nru a/include/asm-i386/cacheflush.h b/include/asm-i386/cacheflush.h --- a/include/asm-i386/cacheflush.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-i386/cacheflush.h Sun Oct 5 00:33:08 2003 @@ -13,6 +13,13 @@ #define flush_icache_range(start, end) do { } while (0) #define flush_icache_page(vma,pg) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) void global_flush_tlb(void); int change_page_attr(struct page *page, int numpages, pgprot_t prot); diff -Nru a/include/asm-i386/elf.h b/include/asm-i386/elf.h --- a/include/asm-i386/elf.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-i386/elf.h Sun Oct 5 00:33:09 2003 @@ -127,11 +127,6 @@ #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) -#ifdef CONFIG_SMP -extern void dump_smp_unlazy_fpu(void); -#define ELF_CORE_SYNC dump_smp_unlazy_fpu -#endif - #define VSYSCALL_BASE (__fix_to_virt(FIX_VSYSCALL)) #define VSYSCALL_EHDR ((const struct elfhdr *) VSYSCALL_BASE) #define VSYSCALL_ENTRY ((unsigned long) &__kernel_vsyscall) @@ -162,7 +157,10 @@ for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ struct elf_phdr phdr = vsyscall_phdrs[i]; \ if (phdr.p_type == PT_LOAD) { \ + BUG_ON(ofs != 0); \ ofs = phdr.p_offset = offset; \ + phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \ + phdr.p_filesz = phdr.p_memsz; \ offset += phdr.p_filesz; \ } \ else \ @@ -180,7 +178,7 @@ for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ if (vsyscall_phdrs[i].p_type == PT_LOAD) \ DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ - vsyscall_phdrs[i].p_filesz); \ + PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ } \ } while (0) diff -Nru a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h --- a/include/asm-i386/highmem.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-i386/highmem.h Sun Oct 5 00:33:06 2003 @@ -63,6 +63,8 @@ void kunmap_atomic(void *kvaddr, enum km_type type); struct page *kmap_atomic_to_page(void *ptr); +#define flush_cache_kmaps() do { } while (0) + #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */ diff -Nru a/include/asm-i386/mman.h b/include/asm-i386/mman.h --- a/include/asm-i386/mman.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-i386/mman.h Sun Oct 5 00:33:06 2003 @@ -8,8 +8,6 @@ #define PROT_NONE 0x0 /* page can not be accessed */ #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ -#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ -#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ #define MAP_SHARED 0x01 /* Share changes */ #define MAP_PRIVATE 0x02 /* Changes are private */ diff -Nru a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h --- a/include/asm-i386/pgtable.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-i386/pgtable.h Sun Oct 5 00:33:09 2003 @@ -85,7 +85,6 @@ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long) high_memory + 2*VMALLOC_OFFSET-1) & \ ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #ifdef CONFIG_HIGHMEM # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) #else diff -Nru a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h --- a/include/asm-i386/unistd.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-i386/unistd.h Sun Oct 5 00:33:09 2003 @@ -278,8 +278,9 @@ #define __NR_tgkill 270 #define __NR_utimes 271 #define __NR_fadvise64_64 272 +#define __NR_vserver 273 -#define NR_syscalls 273 +#define NR_syscalls 274 /* user-visible error numbers are in the range -1 - -124: see */ diff -Nru a/include/asm-ia64/cacheflush.h b/include/asm-ia64/cacheflush.h --- a/include/asm-ia64/cacheflush.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-ia64/cacheflush.h Sun Oct 5 00:33:07 2003 @@ -21,6 +21,8 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_icache_page(vma,page) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) #define flush_dcache_page(page) \ do { \ @@ -34,5 +36,12 @@ unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK); \ flush_icache_range(_addr, _addr + (len)); \ } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) #endif /* _ASM_IA64_CACHEFLUSH_H */ diff -Nru a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h --- a/include/asm-ia64/elf.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-ia64/elf.h Sun Oct 5 00:33:09 2003 @@ -206,42 +206,46 @@ NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR); \ } while (0) + /* - * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out extra segments - * containing the gate DSO contents. Dumping its contents makes post-mortem fully - * interpretable later without matching up the same kernel and hardware config to see what - * IP values meant. Dumping its extra ELF program headers includes all the other - * information a debugger needs to easily find how the gate DSO was being used. + * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out + * extra segments containing the gate DSO contents. Dumping its + * contents makes post-mortem fully interpretable later without matching up + * the same kernel and hardware config to see what PC values meant. + * Dumping its extra ELF program headers includes all the other information + * a debugger needs to easily find how the gate DSO was being used. */ #define ELF_CORE_EXTRA_PHDRS (GATE_EHDR->e_phnum) #define ELF_CORE_WRITE_EXTRA_PHDRS \ do { \ - const struct elf_phdr *const gate_phdrs = \ - (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \ + const struct elf_phdr *const vsyscall_phdrs = \ + (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \ int i; \ - Elf64_Off ofs = 0; \ + Elf32_Off ofs = 0; \ for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \ - struct elf_phdr phdr = gate_phdrs[i]; \ + struct elf_phdr phdr = vsyscall_phdrs[i]; \ if (phdr.p_type == PT_LOAD) { \ + BUG_ON(ofs != 0); \ ofs = phdr.p_offset = offset; \ + phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \ + phdr.p_filesz = phdr.p_memsz; \ offset += phdr.p_filesz; \ - } else \ + } \ + else \ phdr.p_offset += ofs; \ phdr.p_paddr = 0; /* match other core phdrs */ \ DUMP_WRITE(&phdr, sizeof(phdr)); \ } \ } while (0) - #define ELF_CORE_WRITE_EXTRA_DATA \ do { \ - const struct elf_phdr *const gate_phdrs = \ - (const struct elf_phdr *) (GATE_ADDR \ - + GATE_EHDR->e_phoff); \ + const struct elf_phdr *const vsyscall_phdrs = \ + (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \ int i; \ for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \ - if (gate_phdrs[i].p_type == PT_LOAD) \ - DUMP_WRITE((void *) gate_phdrs[i].p_vaddr, \ - gate_phdrs[i].p_filesz); \ + if (vsyscall_phdrs[i].p_type == PT_LOAD) \ + DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ + PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ } \ } while (0) diff -Nru a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h --- a/include/asm-ia64/pgtable.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-ia64/pgtable.h Sun Oct 5 00:33:07 2003 @@ -207,7 +207,6 @@ #define RGN_KERNEL 7 #define VMALLOC_START 0xa000000200000000 -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #ifdef CONFIG_VIRTUAL_MEM_MAP # define VMALLOC_END_INIT (0xa000000000000000 + (1UL << (4*PAGE_SHIFT - 9))) # define VMALLOC_END vmalloc_end diff -Nru a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h --- a/include/asm-m68k/bitops.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-m68k/bitops.h Sun Oct 5 00:33:10 2003 @@ -164,9 +164,10 @@ return ((1UL << (nr & 31)) & (((const volatile unsigned long *) vaddr)[nr >> 5])) != 0; } -extern __inline__ int find_first_zero_bit(unsigned long * vaddr, unsigned size) +extern __inline__ int find_first_zero_bit(const unsigned long *vaddr, + unsigned size) { - unsigned long *p = vaddr, *addr = vaddr; + const unsigned long *p = vaddr, *addr = vaddr; unsigned long allones = ~0UL; int res; unsigned long num; @@ -187,11 +188,11 @@ return ((p - addr) << 5) + (res ^ 31); } -extern __inline__ int find_next_zero_bit (unsigned long *vaddr, int size, +extern __inline__ int find_next_zero_bit (const unsigned long *vaddr, int size, int offset) { - unsigned long *addr = vaddr; - unsigned long *p = addr + (offset >> 5); + const unsigned long *addr = vaddr; + const unsigned long *p = addr + (offset >> 5); int set = 0, bit = offset & 31UL, res; if (offset >= size) @@ -263,7 +264,7 @@ * unlikely to be set. It's guaranteed that at least one of the 140 * bits is cleared. */ -static inline int sched_find_first_bit(unsigned long *b) +static inline int sched_find_first_bit(const unsigned long *b) { if (unlikely(b[0])) return __ffs(b[0]); diff -Nru a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h --- a/include/asm-m68k/cacheflush.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-m68k/cacheflush.h Sun Oct 5 00:33:09 2003 @@ -80,6 +80,9 @@ #define flush_cache_all() __flush_cache_all() +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() + extern inline void flush_cache_mm(struct mm_struct *mm) { if (mm == current->mm) @@ -127,6 +130,10 @@ #define flush_dcache_page(page) __flush_page_to_ram(page_address(page)) #define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page)) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) extern void flush_icache_range(unsigned long address, unsigned long endaddr); diff -Nru a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h --- a/include/asm-m68k/pci.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-m68k/pci.h Sun Oct 5 00:33:08 2003 @@ -7,6 +7,8 @@ * Written by Wout Klaren. */ +#include + struct pci_ops; /* diff -Nru a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h --- a/include/asm-m68k/pgtable.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-m68k/pgtable.h Sun Oct 5 00:33:10 2003 @@ -79,12 +79,10 @@ */ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END KMAP_START #else extern unsigned long vmalloc_end; #define VMALLOC_START 0x0f800000 -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END vmalloc_end #endif /* CONFIG_SUN3 */ diff -Nru a/include/asm-m68k/zorro.h b/include/asm-m68k/zorro.h --- a/include/asm-m68k/zorro.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-m68k/zorro.h Sun Oct 5 00:33:07 2003 @@ -42,4 +42,4 @@ #define z_iounmap iounmap #define z_ioremap z_remap_nocache_ser -#endif /* _ASM_ZORRO_H */ +#endif /* _ASM_M68K_ZORRO_H */ diff -Nru a/include/asm-m68knommu/cacheflush.h b/include/asm-m68knommu/cacheflush.h --- a/include/asm-m68knommu/cacheflush.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-m68knommu/cacheflush.h Sun Oct 5 00:33:10 2003 @@ -15,7 +15,13 @@ #define flush_icache_range(start,len) __flush_cache_all() #define flush_icache_page(vma,pg) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) extern inline void __flush_cache_all(void) { diff -Nru a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h --- a/include/asm-mips/cacheflush.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-mips/cacheflush.h Sun Oct 5 00:33:09 2003 @@ -43,7 +43,15 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end); #define flush_icache_user_range(vma, page, addr, len) \ flush_icache_page(vma, page) +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) extern void (*flush_cache_sigtramp)(unsigned long addr); extern void (*flush_icache_all)(void); diff -Nru a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h --- a/include/asm-mips/highmem.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-mips/highmem.h Sun Oct 5 00:33:09 2003 @@ -54,6 +54,8 @@ extern void kunmap_atomic(void *kvaddr, enum km_type type); extern struct page *kmap_atomic_to_page(void *ptr); +#define flush_cache_kmaps() flush_cache_all() + #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */ diff -Nru a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h --- a/include/asm-mips/pgtable-32.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-mips/pgtable-32.h Sun Oct 5 00:33:08 2003 @@ -79,7 +79,6 @@ #define FIRST_USER_PGD_NR 0 #define VMALLOC_START KSEG2 -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #if CONFIG_HIGHMEM # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) diff -Nru a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h --- a/include/asm-mips/pgtable-64.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-mips/pgtable-64.h Sun Oct 5 00:33:06 2003 @@ -64,7 +64,6 @@ #define FIRST_USER_PGD_NR 0 #define VMALLOC_START XKSEG -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END \ (VMALLOC_START + ((1 << PGD_ORDER) * PTRS_PER_PTE * PAGE_SIZE)) diff -Nru a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h --- a/include/asm-parisc/atomic.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-parisc/atomic.h Sun Oct 5 00:33:07 2003 @@ -129,8 +129,9 @@ /* It's possible to reduce all atomic operations to either - * __atomic_add_return, __atomic_set and __atomic_ret (the latter - * is there only for consistency). */ + * __atomic_add_return, atomic_set and atomic_read (the latter + * is there only for consistency). + */ static __inline__ int __atomic_add_return(int i, atomic_t *v) { @@ -144,7 +145,7 @@ return ret; } -static __inline__ void __atomic_set(atomic_t *v, int i) +static __inline__ void atomic_set(atomic_t *v, int i) { unsigned long flags; SPIN_LOCK_IRQSAVE(ATOMIC_HASH(v), flags); @@ -154,27 +155,24 @@ SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(v), flags); } -static __inline__ int __atomic_read(atomic_t *v) +static __inline__ int atomic_read(const atomic_t *v) { return v->counter; } /* exported interface */ -#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) -#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v)))) -#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) -#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) +#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v)))) +#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)i),(v)))) +#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) +#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) -#define atomic_add_return(i,v) (__atomic_add_return( (i),(v))) -#define atomic_sub_return(i,v) (__atomic_add_return(-(i),(v))) +#define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v))) +#define atomic_sub_return(i,v) (__atomic_add_return(-((int)i),(v))) #define atomic_inc_return(v) (__atomic_add_return( 1,(v))) #define atomic_dec_return(v) (__atomic_add_return( -1,(v))) #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) - -#define atomic_set(v,i) (__atomic_set((v),i)) -#define atomic_read(v) (__atomic_read(v)) #define ATOMIC_INIT(i) { (i) } diff -Nru a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h --- a/include/asm-parisc/bitops.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-parisc/bitops.h Sun Oct 5 00:33:05 2003 @@ -232,24 +232,24 @@ #if BITS_PER_LONG > 32 " ldi 63,%1\n" " extrd,u,*<> %0,63,32,%%r0\n" - " extrd,u,*TR %0,31,32,%0\n" + " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ " addi -32,%1,%1\n" #else " ldi 31,%1\n" #endif " extru,<> %0,31,16,%%r0\n" - " extru,TR %0,15,16,%0\n" + " extru,TR %0,15,16,%0\n" /* xxxx0000 -> 0000xxxx */ " addi -16,%1,%1\n" " extru,<> %0,31,8,%%r0\n" - " extru,TR %0,23,8,%0\n" + " extru,TR %0,23,8,%0\n" /* 0000xx00 -> 000000xx */ " addi -8,%1,%1\n" " extru,<> %0,31,4,%%r0\n" - " extru,TR %0,27,4,%0\n" + " extru,TR %0,27,4,%0\n" /* 000000x0 -> 0000000x */ " addi -4,%1,%1\n" " extru,<> %0,31,2,%%r0\n" - " extru,TR %0,29,2,%0\n" + " extru,TR %0,29,2,%0\n" /* 0000000y, 1100b -> 0011b */ " addi -2,%1,%1\n" - " extru,= %0,31,1,%%r0\n" + " extru,= %0,31,1,%%r0\n" /* check last bit */ " addi -1,%1,%1\n" : "+r" (x), "=r" (ret) ); return ret; @@ -291,7 +291,7 @@ " zdep,TR %0,27,28,%0\n" /* x0000000 */ " addi 4,%1,%1\n" " extru,<> %0,1,2,%%r0\n" - " zdep,TR %0,29,30,%0\n" /* y0000000 (y&3 = 0 */ + " zdep,TR %0,29,30,%0\n" /* y0000000 (y&3 = 0) */ " addi 2,%1,%1\n" " extru,= %0,0,1,%%r0\n" " addi 1,%1,%1\n" /* if y & 8, add 1 */ diff -Nru a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h --- a/include/asm-parisc/cacheflush.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-parisc/cacheflush.h Sun Oct 5 00:33:10 2003 @@ -30,6 +30,9 @@ on_each_cpu(cacheflush_h_tmp_function, NULL, 1, 1); } +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() + /* The following value needs to be tuned and probably scaled with the * cache size. */ @@ -81,6 +84,13 @@ #define flush_icache_user_range(vma, page, addr, len) do { \ flush_user_dcache_range(addr, addr + len); \ flush_user_icache_range(addr, addr + len); } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) static inline void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) diff -Nru a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h --- a/include/asm-parisc/dma-mapping.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-parisc/dma-mapping.h Sun Oct 5 00:33:08 2003 @@ -2,6 +2,7 @@ #define _PARISC_DMA_MAPPING_H #include +#include #include /* diff -Nru a/include/asm-parisc/elf.h b/include/asm-parisc/elf.h --- a/include/asm-parisc/elf.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-parisc/elf.h Sun Oct 5 00:33:09 2003 @@ -144,6 +144,30 @@ #define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */ #define R_PARISC_HIRESERVE 255 +#define PA_PLABEL_FDESC 0x02 /* bit set if PLABEL points to + * a function descriptor, not + * an address */ + +/* The following are PA function descriptors + * + * addr: the absolute address of the function + * gp: either the data pointer (r27) for non-PIC code or the + * the PLT pointer (r19) for PIC code */ + +/* Format for the Elf32 Function descriptor */ +typedef struct elf32_fdesc { + __u32 addr; + __u32 gp; +} Elf32_Fdesc; + +/* Format for the Elf64 Function descriptor */ +typedef struct elf64_fdesc { + __u64 dummy[2]; /* FIXME: nothing uses these, why waste + * the space */ + __u64 addr; + __u64 gp; +} Elf64_Fdesc; + /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ #define PT_HP_TLS (PT_LOOS + 0x0) @@ -215,7 +239,10 @@ #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) \ - current->personality = PER_LINUX + current->personality = PER_LINUX; \ + current->thread.map_base = DEFAULT_MAP_BASE; \ + current->thread.task_size = DEFAULT_TASK_SIZE \ + #endif /* diff -Nru a/include/asm-parisc/ioctl.h b/include/asm-parisc/ioctl.h --- a/include/asm-parisc/ioctl.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-parisc/ioctl.h Sun Oct 5 00:33:05 2003 @@ -44,11 +44,21 @@ ((nr) << _IOC_NRSHIFT) | \ ((size) << _IOC_SIZESHIFT)) +/* provoke compile error for invalid uses of size argument */ +extern int __invalid_size_argument_for_IOC; +#define _IOC_TYPECHECK(t) \ + ((sizeof(t) == sizeof(t[1]) && \ + sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ + sizeof(t) : __invalid_size_argument_for_IOC) + /* used to create numbers */ #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) -#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) -#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) +#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) +#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) +#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) +#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) +#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) +#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) /* used to decode ioctl numbers.. */ #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) diff -Nru a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h --- a/include/asm-parisc/irq.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-parisc/irq.h Sun Oct 5 00:33:08 2003 @@ -17,6 +17,7 @@ #include #include +#include #define CPU_IRQ_REGION 1 diff -Nru a/include/asm-parisc/keyboard.h b/include/asm-parisc/keyboard.h --- a/include/asm-parisc/keyboard.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-parisc/keyboard.h Sun Oct 5 00:33:07 2003 @@ -25,8 +25,6 @@ #ifndef _PARISC_KEYBOARD_H #define _PARISC_KEYBOARD_H -#include - #ifdef __KERNEL__ #include diff -Nru a/include/asm-parisc/page.h b/include/asm-parisc/page.h --- a/include/asm-parisc/page.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-parisc/page.h Sun Oct 5 00:33:07 2003 @@ -7,6 +7,7 @@ #define PAGE_MASK (~(PAGE_SIZE-1)) #ifdef __KERNEL__ +#include #ifndef __ASSEMBLY__ #include diff -Nru a/include/asm-parisc/param.h b/include/asm-parisc/param.h --- a/include/asm-parisc/param.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-parisc/param.h Sun Oct 5 00:33:08 2003 @@ -2,6 +2,7 @@ #define _ASMPARISC_PARAM_H #ifdef __KERNEL__ +#include # ifdef CONFIG_PA20 # define HZ 1000 /* Faster machines */ # else diff -Nru a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h --- a/include/asm-parisc/pci.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-parisc/pci.h Sun Oct 5 00:33:09 2003 @@ -1,6 +1,7 @@ #ifndef __ASM_PARISC_PCI_H #define __ASM_PARISC_PCI_H +#include #include /* diff -Nru a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h --- a/include/asm-parisc/pdc.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-parisc/pdc.h Sun Oct 5 00:33:05 2003 @@ -1,6 +1,8 @@ #ifndef _PARISC_PDC_H #define _PARISC_PDC_H +#include + /* * PDC return values ... * All PDC calls return a subset of these errors. @@ -191,8 +193,8 @@ #define PDC_IO 135 /* log error info, reset IO system */ #define PDC_IO_READ_AND_CLEAR_ERRORS 0 -#define PDC_IO_READ_AND_LOG_ERRORS 1 -#define PDC_IO_SUSPEND_USB 2 +#define PDC_IO_RESET 1 +#define PDC_IO_RESET_DEVICES 2 /* sets bits 6&7 (little endian) of the HcControl Register */ #define PDC_IO_USB_SUSPEND 0xC000000000000000 #define PDC_IO_EEPROM_IO_ERR_TABLE_FULL -5 /* return value */ @@ -951,7 +953,8 @@ int pdc_do_reset(void); int pdc_soft_power_info(unsigned long *power_reg); int pdc_soft_power_button(int sw_control); -void pdc_suspend_usb(void); +void pdc_io_reset(void); +void pdc_io_reset_devices(void); int pdc_iodc_getc(void); void pdc_iodc_putc(unsigned char c); void pdc_iodc_outc(unsigned char c); diff -Nru a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h --- a/include/asm-parisc/pgalloc.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-parisc/pgalloc.h Sun Oct 5 00:33:10 2003 @@ -1,7 +1,6 @@ #ifndef _ASM_PGALLOC_H #define _ASM_PGALLOC_H -#include #include #include #include diff -Nru a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h --- a/include/asm-parisc/pgtable.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-parisc/pgtable.h Sun Oct 5 00:33:10 2003 @@ -1,6 +1,7 @@ #ifndef _PARISC_PGTABLE_H #define _PARISC_PGTABLE_H +#include #include #ifndef __ASSEMBLY__ @@ -108,7 +109,6 @@ extern void *vmalloc_start; #define PCXL_DMA_MAP_SIZE (8*1024*1024) #define VMALLOC_START ((unsigned long)vmalloc_start) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) /* this is a fixmap remnant, see fixmap.h */ #define VMALLOC_END (TMPALIAS_MAP_START) #endif diff -Nru a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h --- a/include/asm-parisc/processor.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-parisc/processor.h Sun Oct 5 00:33:10 2003 @@ -36,10 +36,18 @@ #define current_text_addr() ({ void *pc; __asm__("\n\tblr 0,%0\n\tnop":"=r" (pc)); pc; }) #define TASK_SIZE (current->thread.task_size) -#define DEFAULT_TASK_SIZE (0xFFF00000UL) - #define TASK_UNMAPPED_BASE (current->thread.map_base) -#define DEFAULT_MAP_BASE (0x40000000UL) + +#define DEFAULT_TASK_SIZE32 (0xFFF00000UL) +#define DEFAULT_MAP_BASE32 (0x40000000UL) + +#ifdef __LP64__ +#define DEFAULT_TASK_SIZE (MAX_ADDRESS-0xf000000) +#define DEFAULT_MAP_BASE (0x200000000UL) +#else +#define DEFAULT_TASK_SIZE DEFAULT_TASK_SIZE32 +#define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32 +#endif #ifndef __ASSEMBLY__ @@ -247,8 +255,18 @@ * * Note that the S/390 people took the easy way out and hacked their * GCC to make the stack grow downwards. + * + * Final Note: For entry from syscall, the W (wide) bit of the PSW + * is stuffed into the lowest bit of the user sp (%r30), so we fill + * it in here from the current->personality */ +#ifdef __LP64__ +#define USER_WIDE_MODE (personality(current->personality) == PER_LINUX) +#else +#define USER_WIDE_MODE 0 +#endif + #define start_thread(regs, new_pc, new_sp) do { \ elf_addr_t *sp = (elf_addr_t *)new_sp; \ __u32 spaceid = (__u32)current->mm->context; \ @@ -266,12 +284,12 @@ regs->sr[5] = spaceid; \ regs->sr[6] = spaceid; \ regs->sr[7] = spaceid; \ - regs->gr[ 0] = USER_PSW; \ + regs->gr[ 0] = USER_PSW | (USER_WIDE_MODE ? PSW_W : 0); \ regs->fr[ 0] = 0LL; \ regs->fr[ 1] = 0LL; \ regs->fr[ 2] = 0LL; \ regs->fr[ 3] = 0LL; \ - regs->gr[30] = ((unsigned long)sp + 63) &~ 63; \ + regs->gr[30] = (((unsigned long)sp + 63) &~ 63) | (USER_WIDE_MODE ? 1 : 0); \ regs->gr[31] = pc; \ \ get_user(regs->gr[25], (argv - 1)); \ @@ -299,8 +317,6 @@ #define KSTK_EIP(tsk) ((tsk)->thread.regs.iaoq[0]) #define KSTK_ESP(tsk) ((tsk)->thread.regs.gr[30]) -#endif /* __ASSEMBLY__ */ - #ifdef CONFIG_PA20 #define ARCH_HAS_PREFETCH extern inline void prefetch(const void *addr) @@ -316,5 +332,7 @@ #endif #define cpu_relax() barrier() + +#endif /* __ASSEMBLY__ */ #endif /* __ASM_PARISC_PROCESSOR_H */ diff -Nru a/include/asm-parisc/rt_sigframe.h b/include/asm-parisc/rt_sigframe.h --- a/include/asm-parisc/rt_sigframe.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-parisc/rt_sigframe.h Sun Oct 5 00:33:08 2003 @@ -13,7 +13,20 @@ * which Linux/parisc uses is sp-20 for the saved return pointer...) * Then, the stack pointer must be rounded to a cache line (64 bytes). */ +#define SIGFRAME32 64 +#define FUNCTIONCALLFRAME32 48 +#define PARISC_RT_SIGFRAME_SIZE32 \ + (((sizeof(struct rt_sigframe) + FUNCTIONCALLFRAME32) + SIGFRAME32) & -SIGFRAME32) + +#ifdef __LP64__ +#define SIGFRAME 128 +#define FUNCTIONCALLFRAME 96 #define PARISC_RT_SIGFRAME_SIZE \ - (((sizeof(struct rt_sigframe) + 48) + 63) & -64) + (((sizeof(struct rt_sigframe) + FUNCTIONCALLFRAME) + SIGFRAME) & -SIGFRAME) +#else +#define SIGFRAME SIGFRAME32 +#define FUNCTIONCALLFRAME FUNCTIONCALLFRAME32 +#define PARISC_RT_SIGFRAME_SIZE PARISC_RT_SIGFRAME_SIZE32 +#endif #endif diff -Nru a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h --- a/include/asm-parisc/tlbflush.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-parisc/tlbflush.h Sun Oct 5 00:33:10 2003 @@ -3,6 +3,7 @@ /* TLB flushing routines.... */ +#include #include #include diff -Nru a/include/asm-ppc/cacheflush.h b/include/asm-ppc/cacheflush.h --- a/include/asm-ppc/cacheflush.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-ppc/cacheflush.h Sun Oct 5 00:33:09 2003 @@ -24,11 +24,20 @@ #define flush_cache_range(vma, a, b) do { } while (0) #define flush_cache_page(vma, p) do { } while (0) #define flush_icache_page(vma, page) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) extern void flush_dcache_page(struct page *page); extern void flush_icache_range(unsigned long, unsigned long); extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, unsigned long addr, int len); + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) extern void __flush_dcache_icache(void *page_va); extern void __flush_dcache_icache_phys(unsigned long physaddr); diff -Nru a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h --- a/include/asm-ppc/highmem.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-ppc/highmem.h Sun Oct 5 00:33:10 2003 @@ -132,6 +132,8 @@ return pte_page(kmap_pte[idx]); } +#define flush_cache_kmaps() flush_cache_all() + #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */ diff -Nru a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h --- a/include/asm-ppc/pgtable.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-ppc/pgtable.h Sun Oct 5 00:33:07 2003 @@ -129,7 +129,6 @@ #else #define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))) #endif -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END ioremap_bot /* diff -Nru a/include/asm-ppc/zorro.h b/include/asm-ppc/zorro.h --- a/include/asm-ppc/zorro.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-ppc/zorro.h Sun Oct 5 00:33:09 2003 @@ -27,4 +27,4 @@ #define z_ioremap ioremap #define z_iounmap iounmap -#endif /* _ASM_ZORRO_H */ +#endif /* _ASM_PPC_ZORRO_H */ diff -Nru a/include/asm-ppc64/cacheflush.h b/include/asm-ppc64/cacheflush.h --- a/include/asm-ppc64/cacheflush.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-ppc64/cacheflush.h Sun Oct 5 00:33:05 2003 @@ -14,12 +14,22 @@ #define flush_cache_range(vma, start, end) do { } while (0) #define flush_cache_page(vma, vmaddr) do { } while (0) #define flush_icache_page(vma, page) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) extern void flush_dcache_page(struct page *page); extern void flush_icache_range(unsigned long, unsigned long); extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, unsigned long addr, int len); + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) + extern void __flush_dcache_icache(void *page_va); #endif /* _PPC64_CACHEFLUSH_H */ diff -Nru a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h --- a/include/asm-ppc64/elf.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-ppc64/elf.h Sun Oct 5 00:33:09 2003 @@ -128,11 +128,6 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) -#ifdef CONFIG_SMP -extern void dump_smp_unlazy_fpu(void); -#define ELF_CORE_SYNC dump_smp_unlazy_fpu -#endif - #endif /* This yields a mask that user programs can use to figure out what diff -Nru a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h --- a/include/asm-ppc64/pgtable.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-ppc64/pgtable.h Sun Oct 5 00:33:10 2003 @@ -45,7 +45,6 @@ * Define the address range of the vmalloc VM area. */ #define VMALLOC_START (0xD000000000000000) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END (VMALLOC_START + VALID_EA_BITS) /* diff -Nru a/include/asm-s390/cacheflush.h b/include/asm-s390/cacheflush.h --- a/include/asm-s390/cacheflush.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-s390/cacheflush.h Sun Oct 5 00:33:10 2003 @@ -13,5 +13,12 @@ #define flush_icache_range(start, end) do { } while (0) #define flush_icache_page(vma,pg) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) #endif /* _S390_CACHEFLUSH_H */ diff -Nru a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h --- a/include/asm-s390/pgtable.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-s390/pgtable.h Sun Oct 5 00:33:09 2003 @@ -117,7 +117,6 @@ #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #ifndef __s390x__ # define VMALLOC_END (0x7fffffffL) #else /* __s390x__ */ diff -Nru a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h --- a/include/asm-sh/cacheflush.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-sh/cacheflush.h Sun Oct 5 00:33:08 2003 @@ -10,4 +10,14 @@ /* Flush (invalidate only) a region (smaller than a page) */ extern void __flush_invalidate_region(void *start, int size); +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) + #endif /* __ASM_SH_CACHEFLUSH_H */ diff -Nru a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h --- a/include/asm-sh/pgtable.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-sh/pgtable.h Sun Oct 5 00:33:10 2003 @@ -51,7 +51,6 @@ * Currently only 4-enty (16kB) is used (see arch/sh/mm/cache.c) */ #define VMALLOC_START (P3SEG+0x00100000) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END P4SEG /* 0x001 WT-bit on SH-4, 0 on SH-3 */ diff -Nru a/include/asm-sparc/cacheflush.h b/include/asm-sparc/cacheflush.h --- a/include/asm-sparc/cacheflush.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-sparc/cacheflush.h Sun Oct 5 00:33:07 2003 @@ -56,6 +56,11 @@ #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) + BTFIXUPDEF_CALL(void, __flush_page_to_ram, unsigned long) BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long) @@ -65,5 +70,8 @@ extern void sparc_flush_page_to_ram(struct page *page); #define flush_dcache_page(page) sparc_flush_page_to_ram(page) + +#define flush_cache_vmap(start, end) flush_cache_all() +#define flush_cache_vunmap(start, end) flush_cache_all() #endif /* _SPARC_CACHEFLUSH_H */ diff -Nru a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h --- a/include/asm-sparc/highmem.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-sparc/highmem.h Sun Oct 5 00:33:10 2003 @@ -89,6 +89,8 @@ return pte_page(*pte); } +#define flush_cache_kmaps() flush_cache_all() + #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */ diff -Nru a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h --- a/include/asm-sparc/pgtable.h Sun Oct 5 00:33:08 2003 +++ b/include/asm-sparc/pgtable.h Sun Oct 5 00:33:08 2003 @@ -101,8 +101,6 @@ BTFIXUPDEF_SIMM13(ptrs_per_pgd) BTFIXUPDEF_SIMM13(user_ptrs_per_pgd) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) - #define pte_ERROR(e) __builtin_trap() #define pmd_ERROR(e) __builtin_trap() #define pgd_ERROR(e) __builtin_trap() diff -Nru a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h --- a/include/asm-sparc/unistd.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-sparc/unistd.h Sun Oct 5 00:33:06 2003 @@ -283,7 +283,8 @@ #define __NR_timer_getoverrun 264 #define __NR_timer_delete 265 #define __NR_timer_create 266 -/* WARNING: You MAY NOT add syscall numbers larger than 266, since +/* #define __NR_vserver 267 Reserved for VSERVER */ +/* WARNING: You MAY NOT add syscall numbers larger than 267, since * all of the syscall tables in the Sparc kernel are * sized to have 267 entries (starting at zero). Therefore * find a free slot in the 0-266 range. diff -Nru a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h --- a/include/asm-sparc64/cacheflush.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-sparc64/cacheflush.h Sun Oct 5 00:33:10 2003 @@ -33,21 +33,17 @@ extern void __flush_dcache_range(unsigned long start, unsigned long end); -extern void __flush_cache_all(void); - -#ifndef CONFIG_SMP - -#define flush_cache_all() __flush_cache_all() - -#else /* CONFIG_SMP */ - -extern void smp_flush_cache_all(void); - -#endif /* ! CONFIG_SMP */ - #define flush_icache_page(vma, pg) do { } while(0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) + extern void flush_dcache_page(struct page *page); + +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) #endif /* _SPARC64_CACHEFLUSH_H */ diff -Nru a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h --- a/include/asm-sparc64/pgtable.h Sun Oct 5 00:33:05 2003 +++ b/include/asm-sparc64/pgtable.h Sun Oct 5 00:33:05 2003 @@ -30,7 +30,6 @@ #define MODULES_LEN 0x000000007e000000 #define MODULES_END 0x0000000080000000 #define VMALLOC_START 0x0000000140000000 -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define VMALLOC_END 0x0000000200000000 #define LOW_OBP_ADDRESS 0x00000000f0000000 #define HI_OBP_ADDRESS 0x0000000100000000 diff -Nru a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h --- a/include/asm-sparc64/tlbflush.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-sparc64/tlbflush.h Sun Oct 5 00:33:09 2003 @@ -70,7 +70,6 @@ extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end); extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page); -#define flush_cache_all() smp_flush_cache_all() #define flush_tlb_all() smp_flush_tlb_all() #define flush_tlb_mm(mm) smp_flush_tlb_mm(mm) #define flush_tlb_range(vma, start, end) \ diff -Nru a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h --- a/include/asm-sparc64/unistd.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-sparc64/unistd.h Sun Oct 5 00:33:07 2003 @@ -285,7 +285,8 @@ #define __NR_timer_getoverrun 264 #define __NR_timer_delete 265 #define __NR_timer_create 266 -/* WARNING: You MAY NOT add syscall numbers larger than 266, since +/* #define __NR_vserver 267 Reserved for VSERVER */ +/* WARNING: You MAY NOT add syscall numbers larger than 267, since * all of the syscall tables in the Sparc kernel are * sized to have 267 entries (starting at zero). Therefore * find a free slot in the 0-266 range. diff -Nru a/include/asm-sparc64/visasm.h b/include/asm-sparc64/visasm.h --- a/include/asm-sparc64/visasm.h Sun Oct 5 00:33:06 2003 +++ b/include/asm-sparc64/visasm.h Sun Oct 5 00:33:06 2003 @@ -17,7 +17,8 @@ andcc %o5, (FPRS_FEF|FPRS_DU), %g0; \ be,pt %icc, 297f; \ sethi %hi(297f), %g7; \ - ba,pt %xcc, VISenter; \ + sethi %hi(VISenter), %g1; \ + jmpl %g1 + %lo(VISenter), %g0; \ or %g7, %lo(297f), %g7; \ 297: wr %g0, FPRS_FEF, %fprs; \ @@ -32,7 +33,8 @@ andcc %o5, FPRS_FEF, %g0; \ be,pt %icc, 297f; \ sethi %hi(298f), %g7; \ - ba,pt %xcc, VISenterhalf; \ + sethi %hi(VISenterhalf), %g1; \ + jmpl %g1 + %lo(VISenterhalf), %g0; \ or %g7, %lo(298f), %g7; \ clr %o5; \ 297: wr %o5, FPRS_FEF, %fprs; \ @@ -48,7 +50,8 @@ " andcc %%o5, %0, %%g0\n" " be,pt %%icc, 299f\n" " sethi %%hi(298f), %%g7\n" -" ba VISenter ! Note. This cannot be bp, as it may be too far from VISenter.\n" +" sethi %%hi(VISenter), %%g1\n" +" jmpl %%g1 + %%lo(VISenter), %%g0\n" " or %%g7, %%lo(298f), %%g7\n" " 298: wr %%g0, 0, %%fprs\n" " 299:\n" diff -Nru a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h --- a/include/asm-um/pgtable.h Sun Oct 5 00:33:10 2003 +++ b/include/asm-um/pgtable.h Sun Oct 5 00:33:10 2003 @@ -69,7 +69,6 @@ #define VMALLOC_OFFSET (__va_space) #define VMALLOC_START (((unsigned long) high_physmem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #ifdef CONFIG_HIGHMEM # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) diff -Nru a/include/asm-v850/cacheflush.h b/include/asm-v850/cacheflush.h --- a/include/asm-v850/cacheflush.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-v850/cacheflush.h Sun Oct 5 00:33:07 2003 @@ -27,6 +27,8 @@ #define flush_cache_range(vma, start, end) ((void)0) #define flush_cache_page(vma, vmaddr) ((void)0) #define flush_dcache_page(page) ((void)0) +#define flush_cache_vmap(start, end) ((void)0) +#define flush_cache_vunmap(start, end) ((void)0) #ifdef CONFIG_NO_CACHE @@ -55,5 +57,11 @@ #endif /* CONFIG_NO_CACHE */ +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ +do { memcpy(dst, src, len); \ + flush_icache_user_range(vma, page, vaddr, len); \ +} while (0) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) #endif /* __V850_CACHEFLUSH_H__ */ diff -Nru a/include/asm-x86_64/cacheflush.h b/include/asm-x86_64/cacheflush.h --- a/include/asm-x86_64/cacheflush.h Sun Oct 5 00:33:07 2003 +++ b/include/asm-x86_64/cacheflush.h Sun Oct 5 00:33:07 2003 @@ -13,6 +13,13 @@ #define flush_icache_range(start, end) do { } while (0) #define flush_icache_page(vma,pg) do { } while (0) #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) void global_flush_tlb(void); int change_page_attr(struct page *page, int numpages, pgprot_t prot); diff -Nru a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h --- a/include/asm-x86_64/elf.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-x86_64/elf.h Sun Oct 5 00:33:09 2003 @@ -150,11 +150,6 @@ #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) -#ifdef CONFIG_SMP -extern void dump_smp_unlazy_fpu(void); -#define ELF_CORE_SYNC dump_smp_unlazy_fpu -#endif - #endif #endif diff -Nru a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h --- a/include/asm-x86_64/pgtable.h Sun Oct 5 00:33:09 2003 +++ b/include/asm-x86_64/pgtable.h Sun Oct 5 00:33:09 2003 @@ -126,7 +126,6 @@ #ifndef __ASSEMBLY__ #define VMALLOC_START 0xffffff0000000000 #define VMALLOC_END 0xffffff7fffffffff -#define VMALLOC_VMADDR(x) ((unsigned long)(x)) #define MODULES_VADDR 0xffffffffa0000000 #define MODULES_END 0xffffffffafffffff #define MODULES_LEN (MODULES_END - MODULES_VADDR) diff -Nru a/include/linux/acpi.h b/include/linux/acpi.h --- a/include/linux/acpi.h Sun Oct 5 00:33:05 2003 +++ b/include/linux/acpi.h Sun Oct 5 00:33:05 2003 @@ -424,17 +424,17 @@ #endif /*CONFIG_ACPI_EC*/ -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_INTERPRETER int acpi_blacklisted(void); -#else +#else /*!CONFIG_ACPI_INTERPRETER*/ static inline int acpi_blacklisted(void) { return 0; } -#endif /*CONFIG_ACPI*/ +#endif /*!CONFIG_ACPI_INTERPRETER*/ #endif /*_LINUX_ACPI_H*/ diff -Nru a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h --- a/include/linux/compat_ioctl.h Sun Oct 5 00:33:10 2003 +++ b/include/linux/compat_ioctl.h Sun Oct 5 00:33:10 2003 @@ -68,7 +68,7 @@ COMPATIBLE_IOCTL(HDIO_DRIVE_CMD) COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE) COMPATIBLE_IOCTL(HDIO_SET_NICE) -#ifndef CONFIG_ARCH_S390 +#ifdef CONFIG_BLK_DEV_FD /* 0x02 -- Floppy ioctls */ COMPATIBLE_IOCTL(FDMSGON) COMPATIBLE_IOCTL(FDMSGOFF) diff -Nru a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h --- a/include/linux/dqblk_xfs.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/dqblk_xfs.h Sun Oct 5 00:33:09 2003 @@ -105,15 +105,6 @@ #define FS_DQ_TIMER_MASK (FS_DQ_BTIMER | FS_DQ_ITIMER | FS_DQ_RTBTIMER) /* - * The following constants define the default amount of time given a user - * before the soft limits are treated as hard limits (usually resulting - * in an allocation failure). These may be modified by the quotactl(2) - * system call with the Q_XSETQLIM command. - */ -#define DQ_FTIMELIMIT (7 * 24*60*60) /* 1 week */ -#define DQ_BTIMELIMIT (7 * 24*60*60) /* 1 week */ - -/* * Various flags related to quotactl(2). Only relevant to XFS filesystems. */ #define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */ diff -Nru a/include/linux/elf.h b/include/linux/elf.h --- a/include/linux/elf.h Sun Oct 5 00:33:06 2003 +++ b/include/linux/elf.h Sun Oct 5 00:33:06 2003 @@ -395,6 +395,7 @@ #define NT_PRFPREG 2 #define NT_PRPSINFO 3 #define NT_TASKSTRUCT 4 +#define NT_AUXV 6 #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ diff -Nru a/include/linux/ftape.h b/include/linux/ftape.h --- a/include/linux/ftape.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/ftape.h Sun Oct 5 00:33:09 2003 @@ -35,7 +35,6 @@ #include #endif #include -#include #include #include diff -Nru a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h --- a/include/linux/hdlcdrv.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/hdlcdrv.h Sun Oct 5 00:33:09 2003 @@ -359,11 +359,11 @@ void hdlcdrv_receiver(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_transmitter(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_arbitrate(struct net_device *, struct hdlcdrv_state *); -int hdlcdrv_register_hdlcdrv(struct net_device *dev, const struct hdlcdrv_ops *ops, - unsigned int privsize, char *ifname, - unsigned int baseaddr, unsigned int irq, - unsigned int dma); -int hdlcdrv_unregister_hdlcdrv(struct net_device *dev); +struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, + unsigned int privsize, const char *ifname, + unsigned int baseaddr, unsigned int irq, + unsigned int dma); +void hdlcdrv_unregister(struct net_device *dev); /* -------------------------------------------------------------------- */ diff -Nru a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h --- a/include/linux/hfs_fs.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/hfs_fs.h Sun Oct 5 00:33:09 2003 @@ -267,9 +267,9 @@ /* file.c */ extern hfs_s32 hfs_do_read(struct inode *, struct hfs_fork *, hfs_u32, - char *, hfs_u32); + char __user *, hfs_u32); extern hfs_s32 hfs_do_write(struct inode *, struct hfs_fork *, hfs_u32, - const char *, hfs_u32); + const char __user *, hfs_u32); extern void hfs_file_fix_mode(struct hfs_cat_entry *entry); extern struct inode_operations hfs_file_inode_operations; extern struct file_operations hfs_file_operations; diff -Nru a/include/linux/highuid.h b/include/linux/highuid.h --- a/include/linux/highuid.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/highuid.h Sun Oct 5 00:33:08 2003 @@ -56,6 +56,8 @@ #define SET_GID16(var, gid) var = high2lowgid(gid) #define NEW_TO_OLD_UID(uid) high2lowuid(uid) #define NEW_TO_OLD_GID(gid) high2lowgid(gid) +#define OLD_TO_NEW_UID(uid) low2highuid(uid) +#define OLD_TO_NEW_GID(gid) low2highgid(gid) /* specific to fs/stat.c */ #define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) @@ -69,6 +71,8 @@ #define SET_GID16(var, gid) do { ; } while (0) #define NEW_TO_OLD_UID(uid) (uid) #define NEW_TO_OLD_GID(gid) (gid) +#define OLD_TO_NEW_UID(uid) (uid) +#define OLD_TO_NEW_GID(gid) (gid) #define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = (uid) #define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = (gid) diff -Nru a/include/linux/istallion.h b/include/linux/istallion.h --- a/include/linux/istallion.h Sun Oct 5 00:33:07 2003 +++ b/include/linux/istallion.h Sun Oct 5 00:33:07 2003 @@ -21,6 +21,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + /*****************************************************************************/ #ifndef _ISTALLION_H #define _ISTALLION_H diff -Nru a/include/linux/list.h b/include/linux/list.h --- a/include/linux/list.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/list.h Sun Oct 5 00:33:08 2003 @@ -325,6 +325,19 @@ pos = list_entry(pos->member.prev, typeof(*pos), member), \ prefetch(pos->member.prev)) +/** + * list_for_each_entry_continue - iterate over list of given type + * continuing after existing point + * @pos: the type * to use as a loop counter. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_continue(pos, head, member) \ + for (pos = list_entry(pos->member.next, typeof(*pos), member), \ + prefetch(pos->member.next); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member), \ + prefetch(pos->member.next)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry diff -Nru a/include/linux/mca-legacy.h b/include/linux/mca-legacy.h --- a/include/linux/mca-legacy.h Sun Oct 5 00:33:10 2003 +++ b/include/linux/mca-legacy.h Sun Oct 5 00:33:10 2003 @@ -7,6 +7,8 @@ #ifndef _LINUX_MCA_LEGACY_H #define _LINUX_MCA_LEGACY_H +#include + #warning "MCA legacy - please move your driver to the new sysfs api" /* MCA_NOTFOUND is an error condition. The other two indicate diff -Nru a/include/linux/mca.h b/include/linux/mca.h --- a/include/linux/mca.h Sun Oct 5 00:33:07 2003 +++ b/include/linux/mca.h Sun Oct 5 00:33:07 2003 @@ -136,10 +136,6 @@ /* WARNING: only called by the boot time device setup */ extern int mca_register_device(int bus, struct mca_device *mca_dev); -#ifdef CONFIG_MCA_LEGACY -#include -#endif - #ifdef CONFIG_MCA_PROC_FS extern void mca_do_proc_init(void); extern void mca_set_adapter_procfn(int slot, MCA_ProcFn, void* dev); diff -Nru a/include/linux/mm.h b/include/linux/mm.h --- a/include/linux/mm.h Sun Oct 5 00:33:05 2003 +++ b/include/linux/mm.h Sun Oct 5 00:33:05 2003 @@ -196,7 +196,7 @@ #if defined(WANT_PAGE_VIRTUAL) void *virtual; /* Kernel virtual address (NULL if not kmapped, ie. highmem) */ -#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */ +#endif /* WANT_PAGE_VIRTUAL */ }; /* diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h --- a/include/linux/moduleparam.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/moduleparam.h Sun Oct 5 00:33:08 2003 @@ -3,6 +3,7 @@ /* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */ #include #include +#include /* You can override this manually, but generally this should match the module name. */ @@ -33,6 +34,17 @@ char *string; }; +/* Special one for arrays */ +struct kparam_array +{ + unsigned int max; + unsigned int *num; + param_set_fn set; + param_get_fn get; + unsigned int elemsize; + void *elem; +}; + /* This is the fundamental function for registering boot/module parameters. perm sets the visibility in driverfs: 000 means it's not there, read bits mean it's readable, write bits mean it's @@ -112,10 +124,16 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp); #define param_check_invbool(name, p) __param_check(name, p, int) -/* First two elements are the max and min array length (which don't change) */ -extern int param_set_intarray(const char *val, struct kernel_param *kp); -extern int param_get_intarray(char *buffer, struct kernel_param *kp); -#define param_check_intarray(name, p) __param_check(name, p, int *) +/* Comma-separated array: num is set to number they actually specified. */ +#define module_param_array(name, type, num, perm) \ + static struct kparam_array __param_arr_##name \ + = { ARRAY_SIZE(name), &num, param_set_##type, param_get_##type, \ + sizeof(name[0]), name }; \ + module_param_call(name, param_array_set, param_array_get, \ + &__param_arr_##name, perm) + +extern int param_array_set(const char *val, struct kernel_param *kp); +extern int param_array_get(char *buffer, struct kernel_param *kp); extern int param_set_copystring(const char *val, struct kernel_param *kp); @@ -123,5 +141,6 @@ const char *val, unsigned int min, unsigned int max, void *elem, int elemsize, - int (*set)(const char *, struct kernel_param *kp)); + int (*set)(const char *, struct kernel_param *kp), + int *num); #endif /* _LINUX_MODULE_PARAM_TYPES_H */ diff -Nru a/include/linux/netfilter_bridge/ebt_limit.h b/include/linux/netfilter_bridge/ebt_limit.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/linux/netfilter_bridge/ebt_limit.h Sun Oct 5 00:33:10 2003 @@ -0,0 +1,23 @@ +#ifndef __LINUX_BRIDGE_EBT_LIMIT_H +#define __LINUX_BRIDGE_EBT_LIMIT_H + +#define EBT_LIMIT_MATCH "limit" + +/* timings are in milliseconds. */ +#define EBT_LIMIT_SCALE 10000 + +/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 + seconds, or one every 59 hours. */ + +struct ebt_limit_info +{ + u_int32_t avg; /* Average secs between packets * scale */ + u_int32_t burst; /* Period multiplier for upper limit. */ + + /* Used internally by the kernel */ + unsigned long prev; + u_int32_t credit; + u_int32_t credit_cap, cost; +}; + +#endif diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h Sun Oct 5 00:33:09 2003 @@ -62,6 +62,14 @@ } dst; }; +/* This is optimized opposed to a memset of the whole structure. Everything we + * really care about is the source/destination unions */ +#define IP_CT_TUPLE_U_BLANK(tuple) \ + do { \ + (tuple)->src.u.all = 0; \ + (tuple)->dst.u.all = 0; \ + } while (0) + enum ip_conntrack_dir { IP_CT_DIR_ORIGINAL, diff -Nru a/include/linux/netfilter_ipv4/ip_nat_rule.h b/include/linux/netfilter_ipv4/ip_nat_rule.h --- a/include/linux/netfilter_ipv4/ip_nat_rule.h Sun Oct 5 00:33:10 2003 +++ b/include/linux/netfilter_ipv4/ip_nat_rule.h Sun Oct 5 00:33:10 2003 @@ -14,5 +14,10 @@ const struct net_device *out, struct ip_conntrack *ct, struct ip_nat_info *info); + +extern unsigned int +alloc_null_binding(struct ip_conntrack *conntrack, + struct ip_nat_info *info, + unsigned int hooknum); #endif #endif /* _IP_NAT_RULE_H */ diff -Nru a/include/linux/parser.h b/include/linux/parser.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/linux/parser.h Sun Oct 5 00:33:10 2003 @@ -0,0 +1,21 @@ +struct match_token { + int token; + char *pattern; +}; + +typedef struct match_token match_table_t[]; + +enum {MAX_OPT_ARGS = 3}; + +typedef struct { + char *from; + char *to; +} substring_t; + +int match_token(char *s, match_table_t table, substring_t args[]); + +int match_int(substring_t *, int *result); +int match_octal(substring_t *, int *result); +int match_hex(substring_t *, int *result); +void match_strcpy(char *, substring_t *); +char *match_strdup(substring_t *); diff -Nru a/include/linux/pci.h b/include/linux/pci.h --- a/include/linux/pci.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/pci.h Sun Oct 5 00:33:08 2003 @@ -515,7 +515,6 @@ const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ - int (*save_state) (struct pci_dev *dev, u32 state); /* Save Device Context */ int (*suspend) (struct pci_dev *dev, u32 state); /* Device suspended */ int (*resume) (struct pci_dev *dev); /* Device woken up */ int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */ diff -Nru a/include/linux/raw.h b/include/linux/raw.h --- a/include/linux/raw.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/raw.h Sun Oct 5 00:33:09 2003 @@ -13,4 +13,6 @@ __u64 block_minor; }; +#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS + #endif /* __LINUX_RAW_H */ diff -Nru a/include/linux/rcupdate.h b/include/linux/rcupdate.h --- a/include/linux/rcupdate.h Sun Oct 5 00:33:07 2003 +++ b/include/linux/rcupdate.h Sun Oct 5 00:33:07 2003 @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Copyright (c) IBM Corporation, 2001 + * Copyright (C) IBM Corporation, 2001 * * Author: Dipankar Sarma * diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h Sun Oct 5 00:33:06 2003 +++ b/include/linux/sched.h Sun Oct 5 00:33:06 2003 @@ -207,6 +207,8 @@ cpumask_t cpu_vm_mask; unsigned long swap_address; + unsigned long saved_auxv[40]; /* for /proc/PID/auxv */ + unsigned dumpable:1; #ifdef CONFIG_HUGETLB_PAGE int used_hugetlb; diff -Nru a/include/linux/sctp.h b/include/linux/sctp.h --- a/include/linux/sctp.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/sctp.h Sun Oct 5 00:33:09 2003 @@ -524,113 +524,4 @@ sctp_addiphdr_t addip_hdr; } sctp_addip_chunk_t __attribute__((packed)); -/* FIXME: Cleanup needs to continue below this line. */ - - -/* ADDIP Section 3.1.1 - * - * ASCONF-Request Correlation ID: 32 bits (unsigned integer) - * - * This is an opaque integer assigned by the sender to identify each - * request parameter. It is in host byte order and is only meaningful - * to the sender. The receiver of the ASCONF Chunk will copy this 32 - * bit value into the ASCONF Correlation ID field of the - * ASCONF-ACK. The sender of the ASCONF can use this same value in the - * ASCONF-ACK to find which request the response is for. - * - * ASCONF Parameter: TLV format - * - * Each Address configuration change is represented by a TLV parameter - * as defined in Section 3.2. One or more requests may be present in - * an ASCONF Chunk. - */ -typedef struct { - __u32 correlation; - sctp_paramhdr_t p; - __u8 payload[0]; -} sctpAsconfReq_t; - -/* ADDIP - * 3.1.1 Address/Stream Configuration Change Chunk (ASCONF) - * - * This chunk is used to communicate to the remote endpoint one of the - * configuration change requests that MUST be acknowledged. The - * information carried in the ASCONF Chunk uses the form of a - * Tag-Length-Value (TLV), as described in "3.2.1 - * Optional/Variable-length Parameter Format" in [RFC2960], for all - * variable parameters. - */ -typedef struct { - __u32 serial; - __u8 reserved[3]; - __u8 addr_type; - __u32 addr[4]; - sctpAsconfReq_t requests[0]; -} sctpAsconf_t; - -/* ADDIP - * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK) - * - * ASCONF-Request Correlation ID: 32 bits (unsigned integer) - * - * This value is copied from the ASCONF Correlation ID received in the - * ASCONF Chunk. It is used by the receiver of the ASCONF-ACK to identify - * which ASCONF parameter this response is associated with. - * - * ASCONF Parameter Response : TLV format - * - * The ASCONF Parameter Response is used in the ASCONF-ACK to report - * status of ASCONF processing. By default, if a responding endpoint - * does not include any Error Cause, a success is indicated. Thus a - * sender of an ASCONF-ACK MAY indicate complete success of all TLVs in - * an ASCONF by returning only the Chunk Type, Chunk Flags, Chunk Length - * (set to 8) and the Serial Number. - */ -typedef union { - struct { - __u32 correlation; - sctp_paramhdr_t header; /* success report */ - } success; - struct { - __u32 correlation; - sctp_paramhdr_t header; /* error cause indication */ - sctp_paramhdr_t errcause; - uint8_t request[0]; /* original request from ASCONF */ - } error; -#define __correlation success.correlation -#define __header success.header -#define __cause error.errcause -#define __request error.request -} sctpAsconfAckRsp_t; - -/* ADDIP - * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK) - * - * This chunk is used by the receiver of an ASCONF Chunk to - * acknowledge the reception. It carries zero or more results for any - * ASCONF Parameters that were processed by the receiver. - */ -typedef struct { - __u32 serial; - sctpAsconfAckRsp_t responses[0]; -} sctpAsconfAck_t; - -/********************************************************************* - * Internal structures - * - * These are data structures which never go out on the wire. - *********************************************************************/ - -/* What is this data structure for? The TLV isn't one--it is just a - * value. Perhaps this data structure ought to have a type--otherwise - * it is not unambigiously parseable. --piggy - */ -typedef struct { - struct list_head hook; - int length; /* length of the TLV */ - - /* the actually TLV to be copied into ASCONF_ACK */ - sctpAsconfAckRsp_t TLV; -} sctpAsconfAckRspNode_t; - #endif /* __LINUX_SCTP_H__ */ diff -Nru a/include/linux/security.h b/include/linux/security.h --- a/include/linux/security.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/security.h Sun Oct 5 00:33:09 2003 @@ -334,6 +334,7 @@ * called when the actual read/write operations are performed. * @inode contains the inode structure to check. * @mask contains the permission mask. + * @nd contains the nameidata (may be NULL). * Return 0 if permission is granted. * @inode_setattr: * Check permission before setting file attributes. Note that the kernel @@ -1055,7 +1056,7 @@ struct dentry *new_dentry); int (*inode_readlink) (struct dentry *dentry); int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); - int (*inode_permission) (struct inode *inode, int mask); + int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd); int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); void (*inode_delete) (struct inode *inode); @@ -1474,9 +1475,10 @@ return security_ops->inode_follow_link (dentry, nd); } -static inline int security_inode_permission (struct inode *inode, int mask) +static inline int security_inode_permission (struct inode *inode, int mask, + struct nameidata *nd) { - return security_ops->inode_permission (inode, mask); + return security_ops->inode_permission (inode, mask, nd); } static inline int security_inode_setattr (struct dentry *dentry, @@ -2110,7 +2112,8 @@ return 0; } -static inline int security_inode_permission (struct inode *inode, int mask) +static inline int security_inode_permission (struct inode *inode, int mask, + struct nameidata *nd) { return 0; } diff -Nru a/include/linux/serialP.h b/include/linux/serialP.h --- a/include/linux/serialP.h Sun Oct 5 00:33:06 2003 +++ b/include/linux/serialP.h Sun Oct 5 00:33:06 2003 @@ -19,6 +19,7 @@ * For definitions of the flags field, see tty.h */ +#include #include #include #include diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/skbuff.h Sun Oct 5 00:33:08 2003 @@ -885,7 +885,7 @@ */ static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) { - return (len > skb->len) ? NULL : __skb_pull(skb, len); + return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); } extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); @@ -901,7 +901,7 @@ static inline unsigned char *pskb_pull(struct sk_buff *skb, unsigned int len) { - return (len > skb->len) ? NULL : __pskb_pull(skb, len); + return unlikely(len > skb->len) ? NULL : __pskb_pull(skb, len); } static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) @@ -1052,7 +1052,7 @@ int gfp_mask) { struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); - if (skb) + if (likely(skb)) skb_reserve(skb, 16); return skb; } diff -Nru a/include/linux/stallion.h b/include/linux/stallion.h --- a/include/linux/stallion.h Sun Oct 5 00:33:09 2003 +++ b/include/linux/stallion.h Sun Oct 5 00:33:09 2003 @@ -21,6 +21,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + /*****************************************************************************/ #ifndef _STALLION_H #define _STALLION_H diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/sysctl.h Sun Oct 5 00:33:08 2003 @@ -244,6 +244,7 @@ NET_IPV4_NEIGH=17, NET_IPV4_ROUTE=18, NET_IPV4_FIB_HASH=19, + NET_IPV4_NETFILTER=20, NET_IPV4_TCP_TIMESTAMPS=33, NET_IPV4_TCP_WINDOW_SCALING=34, @@ -358,6 +359,24 @@ NET_IPV4_CONF_NOPOLICY=16, }; +/* /proc/sys/net/ipv4/netfilter */ +enum +{ + NET_IPV4_NF_CONNTRACK_MAX=1, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8, + NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9, + NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10, + NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11, + NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12, + NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13, +}; + /* /proc/sys/net/ipv6 */ enum { NET_IPV6_CONF=16, diff -Nru a/include/linux/toshiba.h b/include/linux/toshiba.h --- a/include/linux/toshiba.h Sun Oct 5 00:33:05 2003 +++ b/include/linux/toshiba.h Sun Oct 5 00:33:05 2003 @@ -33,4 +33,13 @@ unsigned int edi __attribute__ ((packed)); } SMMRegisters; +#ifdef CONFIG_PROC_FS +static int tosh_get_info(char *, char **, off_t, int); +#else /* !CONFIG_PROC_FS */ +inline int tosh_get_info(char *buffer, char **start, off_t fpos, int lenght) +{ + return 0; +} +#endif /* CONFIG_PROC_FS */ + #endif diff -Nru a/include/linux/usb.h b/include/linux/usb.h --- a/include/linux/usb.h Sun Oct 5 00:33:08 2003 +++ b/include/linux/usb.h Sun Oct 5 00:33:08 2003 @@ -1038,9 +1038,9 @@ #define dbg(format, arg...) do {} while (0) #endif -#define err(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" , ## arg) -#define info(format, arg...) printk(KERN_INFO __FILE__ ": " format "\n" , ## arg) -#define warn(format, arg...) printk(KERN_WARNING __FILE__ ": " format "\n" , ## arg) +#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) +#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) +#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) #endif /* __KERNEL__ */ diff -Nru a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h --- a/include/net/irda/irda_device.h Sun Oct 5 00:33:10 2003 +++ b/include/net/irda/irda_device.h Sun Oct 5 00:33:10 2003 @@ -128,6 +128,7 @@ void (*close)(dongle_t *dongle); int (*reset)(struct irda_task *task); int (*change_speed)(struct irda_task *task); + struct module *owner; }; /* @@ -223,6 +224,7 @@ int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts); int irda_device_change_speed(struct net_device *dev, __u32 speed); void irda_device_setup(struct net_device *dev); +struct net_device *alloc_irdadev(int sizeof_priv); /* Dongle interface */ void irda_device_unregister_dongle(struct dongle_reg *dongle); diff -Nru a/include/net/pkt_sched.h b/include/net/pkt_sched.h --- a/include/net/pkt_sched.h Sun Oct 5 00:33:07 2003 +++ b/include/net/pkt_sched.h Sun Oct 5 00:33:07 2003 @@ -8,6 +8,7 @@ #define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES #include +#include #include #include #include diff -Nru a/include/net/scm.h b/include/net/scm.h --- a/include/net/scm.h Sun Oct 5 00:33:08 2003 +++ b/include/net/scm.h Sun Oct 5 00:33:08 2003 @@ -39,7 +39,7 @@ memset(scm, 0, sizeof(*scm)); scm->creds.uid = current->uid; scm->creds.gid = current->gid; - scm->creds.pid = current->pid; + scm->creds.pid = current->tgid; if (msg->msg_controllen <= 0) return 0; return __scm_send(sock, msg, scm); diff -Nru a/include/net/sctp/command.h b/include/net/sctp/command.h --- a/include/net/sctp/command.h Sun Oct 5 00:33:10 2003 +++ b/include/net/sctp/command.h Sun Oct 5 00:33:10 2003 @@ -1,5 +1,6 @@ -/* SCTP kernel reference Implementation Copyright (C) 1999-2001 - * Cisco, Motorola, and IBM +/* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2003 + * Copyright (C) 1999-2001 Cisco, Motorola * * This file is part of the SCTP kernel reference Implementation * @@ -88,6 +89,7 @@ SCTP_CMD_PART_DELIVER, /* Partial data delivery considerations. */ SCTP_CMD_RENEGE, /* Renege data on an association. */ SCTP_CMD_SETUP_T4, /* ADDIP, setup T4 RTO timer parms. */ + SCTP_CMD_PROCESS_OPERR, /* Process an ERROR chunk. */ SCTP_CMD_LAST } sctp_verb_t; diff -Nru a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h --- a/include/net/sctp/sctp.h Sun Oct 5 00:33:07 2003 +++ b/include/net/sctp/sctp.h Sun Oct 5 00:33:07 2003 @@ -116,6 +116,9 @@ #define SCTP_STATIC static #endif +#define MSECS_TO_JIFFIES(msec) (msec * HZ / 1000) +#define JIFFIES_TO_MSECS(jiff) (jiff * 1000 / HZ) + /* * Function declarations. */ @@ -495,22 +498,19 @@ #define tv_lt(s, t) \ (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec)) -/* Stolen from net/profile.h. Using it from there is more grief than - * it is worth. - */ -static inline void tv_add(const struct timeval *entered, struct timeval *leaved) -{ - time_t usecs = leaved->tv_usec + entered->tv_usec; - time_t secs = leaved->tv_sec + entered->tv_sec; - - if (usecs >= 1000000) { - usecs -= 1000000; - secs++; - } - leaved->tv_sec = secs; - leaved->tv_usec = usecs; -} - +/* Add tv1 to tv2. */ +#define TIMEVAL_ADD(tv1, tv2) \ +({ \ + suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \ + time_t secs = (tv2).tv_sec + (tv1).tv_sec; \ +\ + if (usecs >= 1000000) { \ + usecs -= 1000000; \ + secs++; \ + } \ + (tv2).tv_sec = secs; \ + (tv2).tv_usec = usecs; \ +}) /* External references. */ diff -Nru a/include/net/sctp/sm.h b/include/net/sctp/sm.h --- a/include/net/sctp/sm.h Sun Oct 5 00:33:08 2003 +++ b/include/net/sctp/sm.h Sun Oct 5 00:33:08 2003 @@ -265,12 +265,18 @@ struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc, union sctp_addr *addr, int vparam_len); +struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, + union sctp_addr *, + struct sockaddr *, + int, int); +struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, + union sctp_addr *addr); +struct sctp_chunk *sctp_make_asconf_ack(struct sctp_association *asoc, + int serial, int vparam_len); + struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, struct sctp_chunk *asconf, int vparam_len); - -struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, - union sctp_addr *addr); void sctp_chunk_assign_tsn(struct sctp_chunk *); void sctp_chunk_assign_ssn(struct sctp_chunk *); diff -Nru a/include/net/sctp/structs.h b/include/net/sctp/structs.h --- a/include/net/sctp/structs.h Sun Oct 5 00:33:10 2003 +++ b/include/net/sctp/structs.h Sun Oct 5 00:33:10 2003 @@ -1085,6 +1085,10 @@ int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, struct sctp_opt *); +union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, + const union sctp_addr *addrs, + int addrcnt, + struct sctp_opt *opt); union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, int *addrs_len, int gfp); int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, @@ -1389,6 +1393,10 @@ __u8 ipv4_address; /* Peer understands IPv4 addresses? */ __u8 ipv6_address; /* Peer understands IPv6 addresses? */ __u8 hostname_address;/* Peer understands DNS addresses? */ + + /* Does peer support ADDIP? */ + __u8 asconf_capable; + struct sctp_inithdr i; int cookie_len; void *cookie; diff -Nru a/include/sound/sndmagic.h b/include/sound/sndmagic.h --- a/include/sound/sndmagic.h Sun Oct 5 00:33:07 2003 +++ b/include/sound/sndmagic.h Sun Oct 5 00:33:07 2003 @@ -198,6 +198,8 @@ #define vx_pipe_t_magic 0xa15a4112 #define azf3328_t_magic 0xa15a4200 +#define snd_card_harmony_t_magic 0xa15a4300 + #else #define snd_magic_kcalloc(type, extra, flags) (type *) snd_kcalloc(sizeof(type) + extra, flags) diff -Nru a/init/do_mounts.h b/init/do_mounts.h --- a/init/do_mounts.h Sun Oct 5 00:33:09 2003 +++ b/init/do_mounts.h Sun Oct 5 00:33:09 2003 @@ -104,4 +104,3 @@ static inline void md_run_setup(void) {} #endif - diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c --- a/kernel/ksyms.c Sun Oct 5 00:33:05 2003 +++ b/kernel/ksyms.c Sun Oct 5 00:33:05 2003 @@ -45,8 +45,6 @@ #include #include #include -#include -#include #include #include #include @@ -139,49 +137,12 @@ EXPORT_SYMBOL(get_user_pages); /* filesystem internal functions */ -EXPORT_SYMBOL(def_blk_fops); -EXPORT_SYMBOL(update_atime); EXPORT_SYMBOL(get_fs_type); -EXPORT_SYMBOL(user_get_super); -EXPORT_SYMBOL(get_super); -EXPORT_SYMBOL(drop_super); -EXPORT_SYMBOL(getname); -EXPORT_SYMBOL(names_cachep); EXPORT_SYMBOL(fput); EXPORT_SYMBOL(fget); -EXPORT_SYMBOL(igrab); -EXPORT_SYMBOL(iunique); -EXPORT_SYMBOL(iput); -EXPORT_SYMBOL(inode_init_once); -EXPORT_SYMBOL(follow_up); -EXPORT_SYMBOL(follow_down); EXPORT_SYMBOL(lookup_mnt); -EXPORT_SYMBOL(lookup_create); -EXPORT_SYMBOL(path_lookup); -EXPORT_SYMBOL(path_walk); -EXPORT_SYMBOL(path_release); -EXPORT_SYMBOL(__user_walk); -EXPORT_SYMBOL(lookup_one_len); -EXPORT_SYMBOL(lookup_hash); EXPORT_SYMBOL(sys_close); EXPORT_SYMBOL(dcache_lock); -EXPORT_SYMBOL(d_alloc_root); -EXPORT_SYMBOL(d_delete); -EXPORT_SYMBOL(dget_locked); -EXPORT_SYMBOL(d_validate); -EXPORT_SYMBOL(d_rehash); -EXPORT_SYMBOL(d_invalidate); /* May be it will be better in dcache.h? */ -EXPORT_SYMBOL(d_move); -EXPORT_SYMBOL(d_instantiate); -EXPORT_SYMBOL(d_alloc); -EXPORT_SYMBOL(d_alloc_anon); -EXPORT_SYMBOL(d_splice_alias); -EXPORT_SYMBOL(d_lookup); -EXPORT_SYMBOL(d_path); -EXPORT_SYMBOL(mark_buffer_dirty); -EXPORT_SYMBOL(end_buffer_read_sync); -EXPORT_SYMBOL(end_buffer_write_sync); -EXPORT_SYMBOL(end_buffer_async_write); EXPORT_SYMBOL(__mark_inode_dirty); EXPORT_SYMBOL(get_empty_filp); EXPORT_SYMBOL(open_private_file); @@ -190,79 +151,21 @@ EXPORT_SYMBOL(filp_close); EXPORT_SYMBOL(put_filp); EXPORT_SYMBOL(files_lock); -EXPORT_SYMBOL(check_disk_change); -EXPORT_SYMBOL(invalidate_bdev); -EXPORT_SYMBOL(invalidate_inodes); -EXPORT_SYMBOL(__invalidate_device); EXPORT_SYMBOL(invalidate_inode_pages); EXPORT_SYMBOL_GPL(invalidate_inode_pages2); EXPORT_SYMBOL(truncate_inode_pages); -EXPORT_SYMBOL(fsync_bdev); -EXPORT_SYMBOL(permission); -EXPORT_SYMBOL(vfs_permission); EXPORT_SYMBOL(inode_setattr); EXPORT_SYMBOL(inode_change_ok); EXPORT_SYMBOL(write_inode_now); EXPORT_SYMBOL(notify_change); -EXPORT_SYMBOL(set_blocksize); -EXPORT_SYMBOL(sb_set_blocksize); -EXPORT_SYMBOL(sb_min_blocksize); -EXPORT_SYMBOL(bdget); -EXPORT_SYMBOL(bdput); -EXPORT_SYMBOL(bd_claim); -EXPORT_SYMBOL(bd_release); -EXPORT_SYMBOL(open_bdev_excl); -EXPORT_SYMBOL(close_bdev_excl); -EXPORT_SYMBOL(open_by_devnum); -EXPORT_SYMBOL(__brelse); -EXPORT_SYMBOL(__bforget); -EXPORT_SYMBOL(ll_rw_block); -EXPORT_SYMBOL(sync_dirty_buffer); -EXPORT_SYMBOL(submit_bh); -EXPORT_SYMBOL(unlock_buffer); -EXPORT_SYMBOL(__wait_on_buffer); EXPORT_SYMBOL(blockdev_direct_IO); -EXPORT_SYMBOL(block_write_full_page); -EXPORT_SYMBOL(block_read_full_page); -EXPORT_SYMBOL(block_prepare_write); -EXPORT_SYMBOL(block_sync_page); -EXPORT_SYMBOL(generic_cont_expand); -EXPORT_SYMBOL(cont_prepare_write); -EXPORT_SYMBOL(generic_commit_write); -EXPORT_SYMBOL(block_commit_write); -EXPORT_SYMBOL(block_truncate_page); -EXPORT_SYMBOL(generic_block_bmap); -EXPORT_SYMBOL(generic_file_read); -EXPORT_SYMBOL(generic_file_sendfile); -EXPORT_SYMBOL(do_generic_mapping_read); EXPORT_SYMBOL(file_ra_state_init); -EXPORT_SYMBOL(generic_file_write); -EXPORT_SYMBOL(generic_file_write_nolock); -EXPORT_SYMBOL(generic_file_mmap); -EXPORT_SYMBOL(generic_file_readonly_mmap); EXPORT_SYMBOL(generic_ro_fops); -EXPORT_SYMBOL(dput); -EXPORT_SYMBOL(have_submounts); -EXPORT_SYMBOL(d_find_alias); -EXPORT_SYMBOL(d_prune_aliases); -EXPORT_SYMBOL(shrink_dcache_sb); -EXPORT_SYMBOL(shrink_dcache_parent); -EXPORT_SYMBOL(shrink_dcache_anon); -EXPORT_SYMBOL(find_inode_number); -EXPORT_SYMBOL(is_subdir); EXPORT_SYMBOL(get_unused_fd); EXPORT_SYMBOL(vfs_read); EXPORT_SYMBOL(vfs_readv); EXPORT_SYMBOL(vfs_write); EXPORT_SYMBOL(vfs_writev); -EXPORT_SYMBOL(vfs_create); -EXPORT_SYMBOL(vfs_mkdir); -EXPORT_SYMBOL(vfs_mknod); -EXPORT_SYMBOL(vfs_symlink); -EXPORT_SYMBOL(vfs_link); -EXPORT_SYMBOL(vfs_rmdir); -EXPORT_SYMBOL(vfs_unlink); -EXPORT_SYMBOL(vfs_rename); EXPORT_SYMBOL(vfs_statfs); EXPORT_SYMBOL(vfs_fstat); EXPORT_SYMBOL(vfs_stat); @@ -272,9 +175,6 @@ EXPORT_SYMBOL(inode_sub_bytes); EXPORT_SYMBOL(inode_get_bytes); EXPORT_SYMBOL(inode_set_bytes); -EXPORT_SYMBOL(lock_rename); -EXPORT_SYMBOL(unlock_rename); -EXPORT_SYMBOL(generic_read_dir); EXPORT_SYMBOL(generic_fillattr); EXPORT_SYMBOL(generic_file_llseek); EXPORT_SYMBOL(remote_llseek); @@ -282,70 +182,21 @@ EXPORT_SYMBOL(poll_initwait); EXPORT_SYMBOL(poll_freewait); EXPORT_SYMBOL(ROOT_DEV); -EXPORT_SYMBOL(find_get_page); -EXPORT_SYMBOL(find_lock_page); -EXPORT_SYMBOL(find_trylock_page); -EXPORT_SYMBOL(find_or_create_page); -EXPORT_SYMBOL(grab_cache_page_nowait); -EXPORT_SYMBOL(read_cache_page); EXPORT_SYMBOL(read_cache_pages); EXPORT_SYMBOL(mark_page_accessed); -EXPORT_SYMBOL(vfs_readlink); -EXPORT_SYMBOL(vfs_follow_link); -EXPORT_SYMBOL(page_readlink); -EXPORT_SYMBOL(page_follow_link); -EXPORT_SYMBOL(page_symlink_inode_operations); -EXPORT_SYMBOL(page_symlink); EXPORT_SYMBOL(vfs_readdir); EXPORT_SYMBOL(__break_lease); EXPORT_SYMBOL(lease_get_mtime); EXPORT_SYMBOL(lock_may_read); EXPORT_SYMBOL(lock_may_write); -EXPORT_SYMBOL(dcache_dir_open); -EXPORT_SYMBOL(dcache_dir_close); -EXPORT_SYMBOL(dcache_dir_lseek); -EXPORT_SYMBOL(dcache_readdir); -EXPORT_SYMBOL(simple_getattr); -EXPORT_SYMBOL(simple_statfs); -EXPORT_SYMBOL(simple_lookup); -EXPORT_SYMBOL(simple_dir_operations); -EXPORT_SYMBOL(simple_dir_inode_operations); -EXPORT_SYMBOL(simple_link); -EXPORT_SYMBOL(simple_unlink); -EXPORT_SYMBOL(simple_rmdir); -EXPORT_SYMBOL(simple_rename); -EXPORT_SYMBOL(simple_sync_file); -EXPORT_SYMBOL(simple_readpage); -EXPORT_SYMBOL(simple_prepare_write); -EXPORT_SYMBOL(simple_commit_write); -EXPORT_SYMBOL(simple_empty); -EXPORT_SYMBOL(simple_fill_super); -EXPORT_SYMBOL(simple_pin_fs); -EXPORT_SYMBOL(simple_release_fs); EXPORT_SYMBOL(fd_install); EXPORT_SYMBOL(put_unused_fd); -EXPORT_SYMBOL(get_sb_bdev); -EXPORT_SYMBOL(kill_block_super); -EXPORT_SYMBOL(get_sb_nodev); -EXPORT_SYMBOL(get_sb_single); -EXPORT_SYMBOL(kill_anon_super); -EXPORT_SYMBOL(kill_litter_super); -EXPORT_SYMBOL(generic_shutdown_super); -EXPORT_SYMBOL(deactivate_super); -EXPORT_SYMBOL(sget); -EXPORT_SYMBOL(set_anon_super); EXPORT_SYMBOL(do_select); /* for stackable file systems (lofs, wrapfs, cryptfs, etc.) */ EXPORT_SYMBOL(default_llseek); EXPORT_SYMBOL(dentry_open); -#ifdef CONFIG_MMU -EXPORT_SYMBOL(filemap_nopage); -#endif -EXPORT_SYMBOL(filemap_fdatawrite); -EXPORT_SYMBOL(filemap_fdatawait); EXPORT_SYMBOL(lock_page); -EXPORT_SYMBOL(unlock_page); /* device registration */ EXPORT_SYMBOL(register_blkdev); @@ -355,16 +206,7 @@ EXPORT_SYMBOL(tty_std_termios); /* block device driver support */ -EXPORT_SYMBOL(bmap); -EXPORT_SYMBOL(blkdev_open); -EXPORT_SYMBOL(blkdev_get); -EXPORT_SYMBOL(blkdev_put); -EXPORT_SYMBOL(ioctl_by_bdev); EXPORT_SYMBOL(read_dev_sector); -EXPORT_SYMBOL(init_buffer); -EXPORT_SYMBOL_GPL(generic_file_direct_IO); -EXPORT_SYMBOL(generic_file_readv); -EXPORT_SYMBOL(generic_file_writev); EXPORT_SYMBOL(iov_shorten); EXPORT_SYMBOL_GPL(default_backing_dev_info); @@ -375,32 +217,9 @@ /* filesystem registration */ EXPORT_SYMBOL(register_filesystem); EXPORT_SYMBOL(unregister_filesystem); -EXPORT_SYMBOL(kern_mount); EXPORT_SYMBOL(__mntput); EXPORT_SYMBOL(may_umount); -/* executable format registration */ -EXPORT_SYMBOL(register_binfmt); -EXPORT_SYMBOL(unregister_binfmt); -EXPORT_SYMBOL(search_binary_handler); -EXPORT_SYMBOL(prepare_binprm); -EXPORT_SYMBOL(compute_creds); -EXPORT_SYMBOL(remove_arg_zero); -EXPORT_SYMBOL(set_binfmt); - -/* sysctl table registration */ -EXPORT_SYMBOL(register_sysctl_table); -EXPORT_SYMBOL(unregister_sysctl_table); -EXPORT_SYMBOL(sysctl_string); -EXPORT_SYMBOL(sysctl_intvec); -EXPORT_SYMBOL(sysctl_jiffies); -EXPORT_SYMBOL(proc_dostring); -EXPORT_SYMBOL(proc_dointvec); -EXPORT_SYMBOL(proc_dointvec_jiffies); -EXPORT_SYMBOL(proc_dointvec_minmax); -EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); -EXPORT_SYMBOL(proc_doulongvec_minmax); - /* interrupt handling */ EXPORT_SYMBOL(request_irq); EXPORT_SYMBOL(free_irq); @@ -414,10 +233,6 @@ EXPORT_SYMBOL(finish_wait); EXPORT_SYMBOL(autoremove_wake_function); -/* completion handling */ -EXPORT_SYMBOL(wait_for_completion); -EXPORT_SYMBOL(complete); - /* The notion of irq probe/assignment is foreign to S/390 */ #if !defined(CONFIG_ARCH_S390) @@ -449,30 +264,11 @@ /* process management */ EXPORT_SYMBOL(complete_and_exit); -EXPORT_SYMBOL(default_wake_function); -EXPORT_SYMBOL(__wake_up); #ifdef CONFIG_SMP EXPORT_SYMBOL_GPL(__wake_up_sync); /* internal use only */ #endif -EXPORT_SYMBOL(wake_up_process); -EXPORT_SYMBOL(sleep_on); -EXPORT_SYMBOL(sleep_on_timeout); -EXPORT_SYMBOL(interruptible_sleep_on); -EXPORT_SYMBOL(interruptible_sleep_on_timeout); -EXPORT_SYMBOL(schedule); -#ifdef CONFIG_PREEMPT -EXPORT_SYMBOL(preempt_schedule); -#endif EXPORT_SYMBOL(schedule_timeout); -EXPORT_SYMBOL(yield); -EXPORT_SYMBOL(io_schedule); -EXPORT_SYMBOL(__cond_resched); -EXPORT_SYMBOL(set_user_nice); -EXPORT_SYMBOL(task_nice); EXPORT_SYMBOL_GPL(idle_cpu); -#ifdef CONFIG_SMP -EXPORT_SYMBOL_GPL(set_cpus_allowed); -#endif #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) EXPORT_SYMBOL(kernel_flag); #endif @@ -485,18 +281,10 @@ #if (BITS_PER_LONG < 64) EXPORT_SYMBOL(get_jiffies_64); #endif -#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP -EXPORT_SYMBOL(__might_sleep); -#endif -#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) -EXPORT_SYMBOL(__preempt_spin_lock); -EXPORT_SYMBOL(__preempt_write_lock); -#endif #if !defined(__ia64__) EXPORT_SYMBOL(loops_per_jiffy); #endif - /* misc */ EXPORT_SYMBOL(panic); EXPORT_SYMBOL(panic_notifier_list); @@ -524,45 +312,16 @@ EXPORT_SYMBOL(cap_bset); EXPORT_SYMBOL(daemonize); EXPORT_SYMBOL(csum_partial); /* for networking and md */ -EXPORT_SYMBOL(seq_escape); -EXPORT_SYMBOL(seq_printf); -EXPORT_SYMBOL(seq_path); -EXPORT_SYMBOL(seq_open); -EXPORT_SYMBOL(seq_release); -EXPORT_SYMBOL(seq_read); -EXPORT_SYMBOL(seq_lseek); -EXPORT_SYMBOL(single_open); -EXPORT_SYMBOL(single_release); -EXPORT_SYMBOL(seq_release_private); - -/* Program loader interfaces */ -#ifdef CONFIG_MMU -EXPORT_SYMBOL(setup_arg_pages); -#endif -EXPORT_SYMBOL(copy_strings_kernel); -EXPORT_SYMBOL(do_execve); -EXPORT_SYMBOL(flush_old_exec); -EXPORT_SYMBOL(kernel_read); -EXPORT_SYMBOL(open_exec); /* Miscellaneous access points */ EXPORT_SYMBOL(si_meminfo); /* Added to make file system as module */ EXPORT_SYMBOL(sys_tz); -EXPORT_SYMBOL(file_fsync); -EXPORT_SYMBOL(fsync_buffers_list); -EXPORT_SYMBOL(clear_inode); -EXPORT_SYMBOL(init_special_inode); -EXPORT_SYMBOL(new_inode); -EXPORT_SYMBOL(__insert_inode_hash); -EXPORT_SYMBOL(remove_inode_hash); -EXPORT_SYMBOL(buffer_insert_list); EXPORT_SYMBOL(make_bad_inode); EXPORT_SYMBOL(is_bad_inode); EXPORT_SYMBOL(__inode_dir_notify); EXPORT_SYMBOL(generic_osync_inode); -EXPORT_SYMBOL(remove_suid); #ifdef CONFIG_UID16 EXPORT_SYMBOL(overflowuid); @@ -574,9 +333,6 @@ /* all busmice */ EXPORT_SYMBOL(fasync_helper); EXPORT_SYMBOL(kill_fasync); - -/* binfmt_aout */ -EXPORT_SYMBOL(get_write_access); /* library functions */ EXPORT_SYMBOL(strnicmp); diff -Nru a/kernel/module.c b/kernel/module.c --- a/kernel/module.c Sun Oct 5 00:33:09 2003 +++ b/kernel/module.c Sun Oct 5 00:33:09 2003 @@ -844,6 +844,7 @@ { unsigned int min, max; unsigned int size, maxsize; + int dummy; char *endp; const char *p; struct obsolete_modparm *obsparm = kp->arg; @@ -866,19 +867,19 @@ switch (*endp) { case 'b': return param_array(kp->name, val, min, max, obsparm->addr, - 1, param_set_byte); + 1, param_set_byte, &dummy); case 'h': return param_array(kp->name, val, min, max, obsparm->addr, - sizeof(short), param_set_short); + sizeof(short), param_set_short, &dummy); case 'i': return param_array(kp->name, val, min, max, obsparm->addr, - sizeof(int), param_set_int); + sizeof(int), param_set_int, &dummy); case 'l': return param_array(kp->name, val, min, max, obsparm->addr, - sizeof(long), param_set_long); + sizeof(long), param_set_long, &dummy); case 's': return param_array(kp->name, val, min, max, obsparm->addr, - sizeof(char *), param_set_charp); + sizeof(char *), param_set_charp, &dummy); case 'c': /* Undocumented: 1-5c50 means 1-5 strings of up to 49 chars, @@ -895,7 +896,7 @@ if (size >= maxsize) goto oversize; return param_array(kp->name, val, min, max, obsparm->addr, - maxsize, obsparm_copy_string); + maxsize, obsparm_copy_string, &dummy); } printk(KERN_ERR "Unknown obsolete parameter type %s\n", obsparm->type); return -EINVAL; diff -Nru a/kernel/params.c b/kernel/params.c --- a/kernel/params.c Sun Oct 5 00:33:09 2003 +++ b/kernel/params.c Sun Oct 5 00:33:09 2003 @@ -242,10 +242,10 @@ const char *val, unsigned int min, unsigned int max, void *elem, int elemsize, - int (*set)(const char *, struct kernel_param *kp)) + int (*set)(const char *, struct kernel_param *kp), + int *num) { int ret; - unsigned int count = 0; struct kernel_param kp; char save; @@ -259,11 +259,12 @@ return -EINVAL; } + *num = 0; /* We expect a comma-separated list of values. */ do { int len; - if (count > max) { + if (*num == max) { printk(KERN_ERR "%s: can only take %i arguments\n", name, max); return -EINVAL; @@ -279,10 +280,10 @@ return ret; kp.arg += elemsize; val += len+1; - count++; + (*num)++; } while (save == ','); - if (count < min) { + if (*num < min) { printk(KERN_ERR "%s: needs at least %i arguments\n", name, min); return -EINVAL; @@ -290,29 +291,32 @@ return 0; } -/* First two elements are the max and min array length (which don't change) */ -int param_set_intarray(const char *val, struct kernel_param *kp) +int param_array_set(const char *val, struct kernel_param *kp) { - int *array; + struct kparam_array *arr = kp->arg; - /* Grab min and max as first two elements */ - array = kp->arg; - return param_array(kp->name, val, array[0], array[1], &array[2], - sizeof(int), param_set_int); + return param_array(kp->name, val, 1, arr->max, arr->elem, + arr->elemsize, arr->set, arr->num); } -int param_get_intarray(char *buffer, struct kernel_param *kp) +int param_array_get(char *buffer, struct kernel_param *kp) { - int max; - int *array; - unsigned int i; - - array = kp->arg; - max = array[1]; - - for (i = 2; i < max + 2; i++) - sprintf(buffer, "%s%i", i > 2 ? "," : "", array[i]); - return strlen(buffer); + int i, off, ret; + struct kparam_array *arr = kp->arg; + struct kernel_param p; + + p = *kp; + for (i = off = 0; i < *arr->num; i++) { + if (i) + buffer[off++] = ','; + p.arg = arr->elem + arr->elemsize * i; + ret = arr->get(buffer + off, &p); + if (ret < 0) + return ret; + off += ret; + } + buffer[off] = '\0'; + return off; } int param_set_copystring(const char *val, struct kernel_param *kp) @@ -346,6 +350,6 @@ EXPORT_SYMBOL(param_get_bool); EXPORT_SYMBOL(param_set_invbool); EXPORT_SYMBOL(param_get_invbool); -EXPORT_SYMBOL(param_set_intarray); -EXPORT_SYMBOL(param_get_intarray); +EXPORT_SYMBOL(param_array_set); +EXPORT_SYMBOL(param_array_get); EXPORT_SYMBOL(param_set_copystring); diff -Nru a/kernel/ptrace.c b/kernel/ptrace.c --- a/kernel/ptrace.c Sun Oct 5 00:33:10 2003 +++ b/kernel/ptrace.c Sun Oct 5 00:33:10 2003 @@ -179,19 +179,14 @@ flush_cache_page(vma, addr); - /* - * FIXME! We used to have flush_page_to_ram() in here, but - * that was wrong. davem says we need a new per-arch primitive - * to handle this correctly. - */ - maddr = kmap(page); if (write) { - memcpy(maddr + offset, buf, bytes); - flush_icache_user_range(vma, page, addr, bytes); + copy_to_user_page(vma, page, addr, + maddr + offset, buf, bytes); set_page_dirty_lock(page); } else { - memcpy(buf, maddr + offset, bytes); + copy_from_user_page(vma, page, addr, + buf, maddr + offset, bytes); } kunmap(page); page_cache_release(page); diff -Nru a/kernel/rcupdate.c b/kernel/rcupdate.c --- a/kernel/rcupdate.c Sun Oct 5 00:33:05 2003 +++ b/kernel/rcupdate.c Sun Oct 5 00:33:05 2003 @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Copyright (c) IBM Corporation, 2001 + * Copyright (C) IBM Corporation, 2001 * * Author: Dipankar Sarma * diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c Sun Oct 5 00:33:09 2003 +++ b/kernel/sched.c Sun Oct 5 00:33:09 2003 @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -642,6 +643,8 @@ return try_to_wake_up(p, TASK_STOPPED | TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 0, 0); } +EXPORT_SYMBOL(wake_up_process); + int wake_up_process_kick(task_t * p) { return try_to_wake_up(p, TASK_STOPPED | TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 0, 1); @@ -1585,6 +1588,8 @@ goto need_resched; } +EXPORT_SYMBOL(schedule); + #ifdef CONFIG_PREEMPT /* * this is is the entry point to schedule() from in-kernel preemption @@ -1612,6 +1617,8 @@ if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) goto need_resched; } + +EXPORT_SYMBOL(preempt_schedule); #endif /* CONFIG_PREEMPT */ int default_wake_function(wait_queue_t *curr, unsigned mode, int sync) @@ -1620,6 +1627,8 @@ return try_to_wake_up(p, mode, sync, 0); } +EXPORT_SYMBOL(default_wake_function); + /* * The core wakeup function. Non-exclusive wakeups (nr_exclusive == 0) just * wake everything up. If it's an exclusive wakeup (nr_exclusive == small +ve @@ -1660,6 +1669,8 @@ spin_unlock_irqrestore(&q->lock, flags); } +EXPORT_SYMBOL(__wake_up); + /* * Same as __wake_up but called with the spinlock in wait_queue_head_t held. */ @@ -1696,6 +1707,8 @@ spin_unlock_irqrestore(&q->lock, flags); } +EXPORT_SYMBOL(__wake_up_sync); + void complete(struct completion *x) { unsigned long flags; @@ -1706,6 +1719,8 @@ spin_unlock_irqrestore(&x->wait.lock, flags); } +EXPORT_SYMBOL(complete); + void complete_all(struct completion *x) { unsigned long flags; @@ -1737,6 +1752,8 @@ spin_unlock_irq(&x->wait.lock); } +EXPORT_SYMBOL(wait_for_completion); + #define SLEEP_ON_VAR \ unsigned long flags; \ wait_queue_t wait; \ @@ -1763,6 +1780,8 @@ SLEEP_ON_TAIL } +EXPORT_SYMBOL(interruptible_sleep_on); + long interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout) { SLEEP_ON_VAR @@ -1776,6 +1795,8 @@ return timeout; } +EXPORT_SYMBOL(interruptible_sleep_on_timeout); + void sleep_on(wait_queue_head_t *q) { SLEEP_ON_VAR @@ -1787,6 +1808,8 @@ SLEEP_ON_TAIL } +EXPORT_SYMBOL(sleep_on); + long sleep_on_timeout(wait_queue_head_t *q, long timeout) { SLEEP_ON_VAR @@ -1800,6 +1823,8 @@ return timeout; } +EXPORT_SYMBOL(sleep_on_timeout); + void scheduling_functions_end_here(void) { } void set_user_nice(task_t *p, long nice) @@ -1849,6 +1874,8 @@ task_rq_unlock(rq, &flags); } +EXPORT_SYMBOL(set_user_nice); + #ifndef __alpha__ /* @@ -1915,6 +1942,8 @@ return TASK_NICE(p); } +EXPORT_SYMBOL(task_nice); + /** * task_curr - is this task currently executing on a CPU? * @p: the task in question. @@ -1933,6 +1962,8 @@ return cpu_curr(cpu) == cpu_rq(cpu)->idle; } +EXPORT_SYMBOL(idle_cpu); + /** * find_process_by_pid - find a process with a matching PID value. * @pid: the pid in question. @@ -2260,6 +2291,8 @@ schedule(); } +EXPORT_SYMBOL(__cond_resched); + /** * yield - yield the current processor to other threads. * @@ -2272,6 +2305,8 @@ sys_sched_yield(); } +EXPORT_SYMBOL(yield); + /* * This task is about to go to sleep on IO. Increment rq->nr_iowait so * that process accounting knows that this is a task in IO wait state. @@ -2288,6 +2323,8 @@ atomic_dec(&rq->nr_iowait); } +EXPORT_SYMBOL(io_schedule); + long io_schedule_timeout(long timeout) { struct runqueue *rq = this_rq(); @@ -2574,6 +2611,8 @@ return 0; } +EXPORT_SYMBOL_GPL(set_cpus_allowed); + /* Move (not current) task off this cpu, onto dest cpu. */ static void move_task_away(struct task_struct *p, int dest_cpu) { @@ -2819,6 +2858,7 @@ } #endif } +EXPORT_SYMBOL(__might_sleep); #endif @@ -2847,6 +2887,8 @@ } while (!_raw_spin_trylock(lock)); } +EXPORT_SYMBOL(__preempt_spin_lock); + void __preempt_write_lock(rwlock_t *lock) { if (preempt_count() > 1) { @@ -2861,4 +2903,6 @@ preempt_disable(); } while (!_raw_write_trylock(lock)); } -#endif + +EXPORT_SYMBOL(__preempt_write_lock); +#endif /* defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) */ diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c Sun Oct 5 00:33:06 2003 +++ b/kernel/sysctl.c Sun Oct 5 00:33:06 2003 @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -136,17 +137,14 @@ static ssize_t proc_readsys(struct file *, char __user *, size_t, loff_t *); static ssize_t proc_writesys(struct file *, const char __user *, size_t, loff_t *); -static int proc_sys_permission(struct inode *, int, struct nameidata *); +static int proc_opensys(struct inode *, struct file *); struct file_operations proc_sys_file_operations = { + .open = proc_opensys, .read = proc_readsys, .write = proc_writesys, }; -static struct inode_operations proc_sys_inode_operations = { - .permission = proc_sys_permission, -}; - extern struct proc_dir_entry *proc_sys_root; static void register_proc_table(ctl_table *, struct proc_dir_entry *); @@ -1140,10 +1138,8 @@ if (!de) continue; de->data = (void *) table; - if (table->proc_handler) { + if (table->proc_handler) de->proc_fops = &proc_sys_file_operations; - de->proc_iops = &proc_sys_inode_operations; - } } table->de = de; if (de->mode & S_IFDIR) @@ -1212,6 +1208,20 @@ return res; } +static int proc_opensys(struct inode *inode, struct file *file) +{ + if (file->f_mode & FMODE_WRITE) { + /* + * sysctl entries that are not writable, + * are _NOT_ writable, capabilities or not. + */ + if (!(inode->i_mode & S_IWUSR)) + return -EPERM; + } + + return 0; +} + static ssize_t proc_readsys(struct file * file, char __user * buf, size_t count, loff_t *ppos) { @@ -1224,11 +1234,6 @@ return do_rw_proc(1, file, (char __user *) buf, count, ppos); } -static int proc_sys_permission(struct inode *inode, int op, struct nameidata *nd) -{ - return test_perm(inode->i_mode, op); -} - /** * proc_dostring - read a string sysctl * @table: the sysctl table @@ -1994,3 +1999,19 @@ } #endif /* CONFIG_SYSCTL */ + +/* + * No sense putting this after each symbol definition, twice, + * exception granted :-) + */ +EXPORT_SYMBOL(proc_dointvec); +EXPORT_SYMBOL(proc_dointvec_jiffies); +EXPORT_SYMBOL(proc_dointvec_minmax); +EXPORT_SYMBOL(proc_dostring); +EXPORT_SYMBOL(proc_doulongvec_minmax); +EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); +EXPORT_SYMBOL(register_sysctl_table); +EXPORT_SYMBOL(sysctl_intvec); +EXPORT_SYMBOL(sysctl_jiffies); +EXPORT_SYMBOL(sysctl_string); +EXPORT_SYMBOL(unregister_sysctl_table); diff -Nru a/lib/Makefile b/lib/Makefile --- a/lib/Makefile Sun Oct 5 00:33:05 2003 +++ b/lib/Makefile Sun Oct 5 00:33:05 2003 @@ -5,7 +5,7 @@ lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \ bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \ - kobject.o idr.o div64.o + kobject.o idr.o div64.o parser.o lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o diff -Nru a/lib/parser.c b/lib/parser.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/lib/parser.c Sun Oct 5 00:33:10 2003 @@ -0,0 +1,138 @@ +/* + * lib/parser.c - simple parser for mount, etc. options. + * + * This source code is licensed under the GNU General Public License, + * Version 2. See the file COPYING for more details. + */ + +#include +#include +#include +#include +#include + +static int match_one(char *s, char *p, substring_t args[]) +{ + char *meta; + int argc = 0; + + if (!p) + return 1; + + while(1) { + int len = -1; + meta = strchr(p, '%'); + if (!meta) + return strcmp(p, s) == 0; + + if (strncmp(p, s, meta-p)) + return 0; + + s += meta - p; + p = meta + 1; + + if (isdigit(*p)) + len = simple_strtoul(p, &p, 10); + else if (*p == '%') { + if (*s++ != '%') + return 0; + continue; + } + + if (argc >= MAX_OPT_ARGS) + return 0; + + args[argc].from = s; + switch (*p++) { + case 's': + if (len == -1 || len > strlen(s)) + len = strlen(s); + args[argc].to = s + len; + break; + case 'd': + simple_strtol(s, &args[argc].to, 0); + goto num; + case 'u': + simple_strtoul(s, &args[argc].to, 0); + goto num; + case 'o': + simple_strtoul(s, &args[argc].to, 8); + goto num; + case 'x': + simple_strtoul(s, &args[argc].to, 16); + num: + if (args[argc].to == args[argc].from) + return 0; + break; + default: + return 0; + } + s = args[argc].to; + argc++; + } +} + +int match_token(char *s, match_table_t table, substring_t args[]) +{ + struct match_token *p; + + for (p = table; !match_one(s, p->pattern, args) ; p++) + ; + + return p->token; +} + +static int match_number(substring_t *s, int *result, int base) +{ + char *endp; + char *buf; + int ret; + + buf = kmalloc(s->to - s->from + 1, GFP_KERNEL); + if (!buf) + return -ENOMEM; + memcpy(buf, s->from, s->to - s->from); + buf[s->to - s->from] = '\0'; + *result = simple_strtol(buf, &endp, base); + ret = 0; + if (endp == buf) + ret = -EINVAL; + kfree(buf); + return ret; +} + +int match_int(substring_t *s, int *result) +{ + return match_number(s, result, 0); +} + +int match_octal(substring_t *s, int *result) +{ + return match_number(s, result, 8); +} + +int match_hex(substring_t *s, int *result) +{ + return match_number(s, result, 16); +} + +void match_strcpy(char *to, substring_t *s) +{ + memcpy(to, s->from, s->to - s->from); + to[s->to - s->from] = '\0'; +} + +char *match_strdup(substring_t *s) +{ + char *p = kmalloc(s->to - s->from + 1, GFP_KERNEL); + if (p) + match_strcpy(p, s); + return p; +} + +EXPORT_SYMBOL(match_token); +EXPORT_SYMBOL(match_int); +EXPORT_SYMBOL(match_octal); +EXPORT_SYMBOL(match_hex); +EXPORT_SYMBOL(match_strcpy); +EXPORT_SYMBOL(match_strdup); diff -Nru a/mm/bootmem.c b/mm/bootmem.c --- a/mm/bootmem.c Sun Oct 5 00:33:07 2003 +++ b/mm/bootmem.c Sun Oct 5 00:33:07 2003 @@ -146,7 +146,7 @@ * We 'merge' subsequent allocations to save space. We might 'lose' * some fraction of a page if allocations cannot be satisfied due to * size constraints on boxes where there is physical RAM space - * fragmentation - in these cases * (mostly large memory boxes) this + * fragmentation - in these cases (mostly large memory boxes) this * is not a problem. * * On low memory boxes we get it right in 100% of the cases. diff -Nru a/mm/filemap.c b/mm/filemap.c --- a/mm/filemap.c Sun Oct 5 00:33:07 2003 +++ b/mm/filemap.c Sun Oct 5 00:33:07 2003 @@ -151,6 +151,8 @@ return __filemap_fdatawrite(mapping, WB_SYNC_ALL); } +EXPORT_SYMBOL(filemap_fdatawrite); + /* * This is a mostly non-blocking flush. Not suitable for data-integrity * purposes. @@ -216,6 +218,8 @@ return ret; } +EXPORT_SYMBOL(filemap_fdatawait); + /* * This adds a page to the page cache, starting out as locked, unreferenced, * not uptodate and with no errors. @@ -253,6 +257,7 @@ } return error; } + EXPORT_SYMBOL(add_to_page_cache); int add_to_page_cache_lru(struct page *page, struct address_space *mapping, @@ -295,6 +300,7 @@ } while (test_bit(bit_nr, &page->flags)); finish_wait(waitqueue, &wait); } + EXPORT_SYMBOL(wait_on_page_bit); /** @@ -323,6 +329,8 @@ wake_up_all(waitqueue); } +EXPORT_SYMBOL(unlock_page); + /* * End writeback against a page. */ @@ -339,6 +347,7 @@ if (waitqueue_active(waitqueue)) wake_up_all(waitqueue); } + EXPORT_SYMBOL(end_page_writeback); /* @@ -363,6 +372,7 @@ } finish_wait(wqh, &wait); } + EXPORT_SYMBOL(__lock_page); /* @@ -385,6 +395,8 @@ return page; } +EXPORT_SYMBOL(find_get_page); + /* * Same as above, but trylock it instead of incrementing the count. */ @@ -400,6 +412,8 @@ return page; } +EXPORT_SYMBOL(find_trylock_page); + /** * find_lock_page - locate, pin and lock a pagecache page * @@ -438,6 +452,8 @@ return page; } +EXPORT_SYMBOL(find_lock_page); + /** * find_or_create_page - locate or add a pagecache page * @@ -482,6 +498,8 @@ return page; } +EXPORT_SYMBOL(find_or_create_page); + /** * find_get_pages - gang pagecache lookup * @mapping: The address_space to search @@ -543,6 +561,8 @@ return page; } +EXPORT_SYMBOL(grab_cache_page_nowait); + /* * This is a generic file read routine, and uses the * inode->i_op->readpage() function for the actual low-level @@ -699,6 +719,8 @@ update_atime(inode); } +EXPORT_SYMBOL(do_generic_mapping_read); + int file_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset, unsigned long size) { @@ -816,6 +838,8 @@ return retval; } +EXPORT_SYMBOL(__generic_file_aio_read); + ssize_t generic_file_aio_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t pos) { @@ -824,8 +848,8 @@ BUG_ON(iocb->ki_pos != pos); return __generic_file_aio_read(iocb, &local_iov, 1, &iocb->ki_pos); } + EXPORT_SYMBOL(generic_file_aio_read); -EXPORT_SYMBOL(__generic_file_aio_read); ssize_t generic_file_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos) @@ -841,6 +865,8 @@ return ret; } +EXPORT_SYMBOL(generic_file_read); + int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size) { ssize_t written; @@ -880,6 +906,8 @@ return desc.error; } +EXPORT_SYMBOL(generic_file_sendfile); + static ssize_t do_readahead(struct address_space *mapping, struct file *filp, unsigned long index, unsigned long nr) @@ -1126,6 +1154,8 @@ return NULL; } +EXPORT_SYMBOL(filemap_nopage); + static struct page * filemap_getpage(struct file *file, unsigned long pgoff, int nonblock) { @@ -1330,6 +1360,9 @@ } #endif /* CONFIG_MMU */ +EXPORT_SYMBOL(generic_file_mmap); +EXPORT_SYMBOL(generic_file_readonly_mmap); + static inline struct page *__read_cache_page(struct address_space *mapping, unsigned long index, int (*filler)(void *,struct page*), @@ -1406,6 +1439,8 @@ return page; } +EXPORT_SYMBOL(read_cache_page); + /* * If the page was newly created, increment its refcount and add it to the * caller's lru-buffering pagevec. This function is specifically for @@ -1456,6 +1491,8 @@ } } +EXPORT_SYMBOL(remove_suid); + /* * Copy as much as we can into the page and return the number of bytes which * were sucessfully copied. If a fault is encountered then clear the page @@ -1638,6 +1675,7 @@ } return 0; } + EXPORT_SYMBOL(generic_write_checks); /* @@ -1832,6 +1870,8 @@ return err; } +EXPORT_SYMBOL(generic_file_aio_write_nolock); + ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos) @@ -1846,6 +1886,8 @@ return ret; } +EXPORT_SYMBOL(generic_file_write_nolock); + ssize_t generic_file_aio_write(struct kiocb *iocb, const char __user *buf, size_t count, loff_t pos) { @@ -1863,8 +1905,8 @@ return err; } + EXPORT_SYMBOL(generic_file_aio_write); -EXPORT_SYMBOL(generic_file_aio_write_nolock); ssize_t generic_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) @@ -1880,6 +1922,8 @@ return err; } +EXPORT_SYMBOL(generic_file_write); + ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, unsigned long nr_segs, loff_t *ppos) { @@ -1893,6 +1937,8 @@ return ret; } +EXPORT_SYMBOL(generic_file_readv); + ssize_t generic_file_writev(struct file *file, const struct iovec *iov, unsigned long nr_segs, loff_t * ppos) { @@ -1905,6 +1951,8 @@ return ret; } +EXPORT_SYMBOL(generic_file_writev); + ssize_t generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs) @@ -1927,3 +1975,5 @@ out: return retval; } + +EXPORT_SYMBOL_GPL(generic_file_direct_IO); diff -Nru a/mm/highmem.c b/mm/highmem.c --- a/mm/highmem.c Sun Oct 5 00:33:09 2003 +++ b/mm/highmem.c Sun Oct 5 00:33:09 2003 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -62,7 +63,7 @@ { int i; - flush_cache_all(); + flush_cache_kmaps(); for (i = 0; i < LAST_PKMAP; i++) { struct page *page; diff -Nru a/mm/vmalloc.c b/mm/vmalloc.c --- a/mm/vmalloc.c Sun Oct 5 00:33:08 2003 +++ b/mm/vmalloc.c Sun Oct 5 00:33:08 2003 @@ -135,23 +135,23 @@ void unmap_vm_area(struct vm_struct *area) { - unsigned long address = VMALLOC_VMADDR(area->addr); + unsigned long address = (unsigned long) area->addr; unsigned long end = (address + area->size); pgd_t *dir; dir = pgd_offset_k(address); - flush_cache_all(); + flush_cache_vunmap(address, end); do { unmap_area_pmd(dir, address, end - address); address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (address && (address < end)); - flush_tlb_kernel_range(VMALLOC_VMADDR(area->addr), end); + flush_tlb_kernel_range((unsigned long) area->addr, end); } int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages) { - unsigned long address = VMALLOC_VMADDR(area->addr); + unsigned long address = (unsigned long) area->addr; unsigned long end = address + (area->size-PAGE_SIZE); pgd_t *dir; int err = 0; @@ -174,7 +174,7 @@ } while (address && (address < end)); spin_unlock(&init_mm.page_table_lock); - flush_cache_all(); + flush_cache_vmap((unsigned long) area->addr, end); return err; } diff -Nru a/net/802/fddi.c b/net/802/fddi.c --- a/net/802/fddi.c Sun Oct 5 00:33:09 2003 +++ b/net/802/fddi.c Sun Oct 5 00:33:09 2003 @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -163,3 +164,5 @@ return(type); } + +EXPORT_SYMBOL(fddi_type_trans); diff -Nru a/net/802/hippi.c b/net/802/hippi.c --- a/net/802/hippi.c Sun Oct 5 00:33:08 2003 +++ b/net/802/hippi.c Sun Oct 5 00:33:08 2003 @@ -20,6 +20,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -151,3 +152,5 @@ return hip->snap.ethertype; } + +EXPORT_SYMBOL(hippi_type_trans); diff -Nru a/net/802/p8023.c b/net/802/p8023.c --- a/net/802/p8023.c Sun Oct 5 00:33:06 2003 +++ b/net/802/p8023.c Sun Oct 5 00:33:06 2003 @@ -12,22 +12,24 @@ * running raw 802.3 on different devices. Thankfully nobody else * has done anything like the old IPX. */ - + +#include +#include +#include #include #include + #include -#include -#include /* * Place an 802.3 header on a packet. The driver will do the mac * addresses, we just need to give it the buffer length. */ - -static int p8023_request(struct datalink_proto *dl, - struct sk_buff *skb, unsigned char *dest_node) +static int p8023_request(struct datalink_proto *dl, + struct sk_buff *skb, unsigned char *dest_node) { - struct net_device *dev = skb->dev; + struct net_device *dev = skb->dev; + dev->hard_header(skb, dev, ETH_P_802_3, dest_node, NULL, skb->len); return dev_queue_xmit(skb); } @@ -35,16 +37,13 @@ /* * Create an 802.3 client. Note there can be only one 802.3 client */ - struct datalink_proto *make_8023_client(void) { - struct datalink_proto *proto; + struct datalink_proto *proto = kmalloc(sizeof(*proto), GFP_ATOMIC); - proto = (struct datalink_proto *) kmalloc(sizeof(*proto), GFP_ATOMIC); - if (proto != NULL) - { + if (proto) { proto->header_length = 0; - proto->request = p8023_request; + proto->request = p8023_request; } return proto; } @@ -52,10 +51,11 @@ /* * Destroy the 802.3 client. */ - void destroy_8023_client(struct datalink_proto *dl) { if (dl) kfree(dl); } +EXPORT_SYMBOL(destroy_8023_client); +EXPORT_SYMBOL(make_8023_client); diff -Nru a/net/802/tr.c b/net/802/tr.c --- a/net/802/tr.c Sun Oct 5 00:33:06 2003 +++ b/net/802/tr.c Sun Oct 5 00:33:06 2003 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -600,3 +601,6 @@ } module_init(rif_init); + +EXPORT_SYMBOL(tr_source_route); +EXPORT_SYMBOL(tr_type_trans); diff -Nru a/net/Makefile b/net/Makefile --- a/net/Makefile Sun Oct 5 00:33:08 2003 +++ b/net/Makefile Sun Oct 5 00:33:08 2003 @@ -40,6 +40,5 @@ obj-$(CONFIG_IP_SCTP) += sctp/ ifeq ($(CONFIG_NET),y) -obj-$(CONFIG_MODULES) += netsyms.o obj-$(CONFIG_SYSCTL) += sysctl_net.o endif diff -Nru a/net/bridge/netfilter/Kconfig b/net/bridge/netfilter/Kconfig --- a/net/bridge/netfilter/Kconfig Sun Oct 5 00:33:07 2003 +++ b/net/bridge/netfilter/Kconfig Sun Oct 5 00:33:07 2003 @@ -73,6 +73,17 @@ To compile it as a module, choose M here. If unsure, say N. +config BRIDGE_EBT_LIMIT + tristate "ebt: limit match support" + depends on BRIDGE_NF_EBTABLES + help + This option adds the limit match, which allows you to control + the rate at which a rule can be matched. This match is the + equivalent of the iptables limit match. + + If you want to compile it as a module, say M here and read + . If unsure, say `N'. + config BRIDGE_EBT_MARK tristate "ebt: mark filter support" depends on BRIDGE_NF_EBTABLES diff -Nru a/net/bridge/netfilter/Makefile b/net/bridge/netfilter/Makefile --- a/net/bridge/netfilter/Makefile Sun Oct 5 00:33:09 2003 +++ b/net/bridge/netfilter/Makefile Sun Oct 5 00:33:09 2003 @@ -13,6 +13,7 @@ obj-$(CONFIG_BRIDGE_EBT_802_3) += ebt_802_3.o obj-$(CONFIG_BRIDGE_EBT_ARP) += ebt_arp.o obj-$(CONFIG_BRIDGE_EBT_IP) += ebt_ip.o +obj-$(CONFIG_BRIDGE_EBT_LIMIT) += ebt_limit.o obj-$(CONFIG_BRIDGE_EBT_MARK) += ebt_mark_m.o obj-$(CONFIG_BRIDGE_EBT_PKTTYPE) += ebt_pkttype.o obj-$(CONFIG_BRIDGE_EBT_STP) += ebt_stp.o diff -Nru a/net/bridge/netfilter/ebt_limit.c b/net/bridge/netfilter/ebt_limit.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/net/bridge/netfilter/ebt_limit.c Sun Oct 5 00:33:10 2003 @@ -0,0 +1,104 @@ +/* + * ebt_limit + * + * Authors: + * Tom Marshall + * + * Mostly copied from netfilter's ipt_limit.c, see that file for + * more explanation + * + * September, 2003 + * + */ + +#include +#include +#include + +#include +#include + +static spinlock_t limit_lock = SPIN_LOCK_UNLOCKED; + +#define CREDITS_PER_JIFFY 128 + +static int ebt_limit_match(const struct sk_buff *skb, + const struct net_device *in, const struct net_device *out, + const void *data, unsigned int datalen) +{ + struct ebt_limit_info *info = (struct ebt_limit_info *)data; + unsigned long now = jiffies; + + spin_lock_bh(&limit_lock); + info->credit += (now - xchg(&info->prev, now)) * CREDITS_PER_JIFFY; + if (info->credit > info->credit_cap) + info->credit = info->credit_cap; + + if (info->credit >= info->cost) { + /* We're not limited. */ + info->credit -= info->cost; + spin_unlock_bh(&limit_lock); + return EBT_MATCH; + } + + spin_unlock_bh(&limit_lock); + return EBT_NOMATCH; +} + +/* Precision saver. */ +static u_int32_t +user2credits(u_int32_t user) +{ + /* If multiplying would overflow... */ + if (user > 0xFFFFFFFF / (HZ*CREDITS_PER_JIFFY)) + /* Divide first. */ + return (user / EBT_LIMIT_SCALE) * HZ * CREDITS_PER_JIFFY; + + return (user * HZ * CREDITS_PER_JIFFY) / EBT_LIMIT_SCALE; +} + +static int ebt_limit_check(const char *tablename, unsigned int hookmask, + const struct ebt_entry *e, void *data, unsigned int datalen) +{ + struct ebt_limit_info *info = (struct ebt_limit_info *)data; + + if (datalen != EBT_ALIGN(sizeof(struct ebt_limit_info))) + return -EINVAL; + + /* Check for overflow. */ + if (info->burst == 0 || + user2credits(info->avg * info->burst) < user2credits(info->avg)) { + printk("Overflow in ebt_limit: %u/%u\n", + info->avg, info->burst); + return -EINVAL; + } + + /* User avg in seconds * EBT_LIMIT_SCALE: convert to jiffies * 128. */ + info->prev = jiffies; + info->credit = user2credits(info->avg * info->burst); + info->credit_cap = user2credits(info->avg * info->burst); + info->cost = user2credits(info->avg); + return 0; +} + +static struct ebt_match ebt_limit_reg = +{ + .name = EBT_LIMIT_MATCH, + .match = ebt_limit_match, + .check = ebt_limit_check, + .me = THIS_MODULE, +}; + +static int __init init(void) +{ + return ebt_register_match(&ebt_limit_reg); +} + +static void __exit fini(void) +{ + ebt_unregister_match(&ebt_limit_reg); +} + +module_init(init); +module_exit(fini); +MODULE_LICENSE("GPL"); diff -Nru a/net/bridge/netfilter/ebt_vlan.c b/net/bridge/netfilter/ebt_vlan.c --- a/net/bridge/netfilter/ebt_vlan.c Sun Oct 5 00:33:08 2003 +++ b/net/bridge/netfilter/ebt_vlan.c Sun Oct 5 00:33:08 2003 @@ -48,7 +48,7 @@ const void *data, unsigned int datalen) { struct ebt_vlan_info *info = (struct ebt_vlan_info *) data; - struct vlan_ethhdr frame; + struct vlan_hdr frame; unsigned short TCI; /* Whole TCI, given from parsed frame */ unsigned short id; /* VLAN ID, given from frame TCI */ diff -Nru a/net/core/datagram.c b/net/core/datagram.c --- a/net/core/datagram.c Sun Oct 5 00:33:09 2003 +++ b/net/core/datagram.c Sun Oct 5 00:33:09 2003 @@ -33,6 +33,7 @@ * */ +#include #include #include #include @@ -485,3 +486,10 @@ return mask; } + +EXPORT_SYMBOL(datagram_poll); +EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec); +EXPORT_SYMBOL(skb_copy_datagram); +EXPORT_SYMBOL(skb_copy_datagram_iovec); +EXPORT_SYMBOL(skb_free_datagram); +EXPORT_SYMBOL(skb_recv_datagram); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Sun Oct 5 00:33:08 2003 +++ b/net/core/dev.c Sun Oct 5 00:33:08 2003 @@ -1488,6 +1488,18 @@ } } +static __inline__ int deliver_skb(struct sk_buff *skb, + struct packet_type *pt_prev, int last) +{ + if (unlikely(!pt_prev->data)) + return deliver_to_old_ones(pt_prev, skb, last); + else { + atomic_inc(&skb->users); + return pt_prev->func(skb, skb->dev, pt_prev); + } +} + + #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) int (*br_handle_frame_hook)(struct sk_buff *skb); @@ -1495,15 +1507,8 @@ struct packet_type *pt_prev) { int ret = NET_RX_DROP; - - if (pt_prev) { - if (!pt_prev->data) - ret = deliver_to_old_ones(pt_prev, skb, 0); - else { - atomic_inc(&skb->users); - ret = pt_prev->func(skb, skb->dev, pt_prev); - } - } + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 0); return ret; } @@ -1551,16 +1556,8 @@ rcu_read_lock(); list_for_each_entry_rcu(ptype, &ptype_all, list) { if (!ptype->dev || ptype->dev == skb->dev) { - if (pt_prev) { - if (!pt_prev->data) { - ret = deliver_to_old_ones(pt_prev, - skb, 0); - } else { - atomic_inc(&skb->users); - ret = pt_prev->func(skb, skb->dev, - pt_prev); - } - } + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 0); pt_prev = ptype; } } @@ -1573,16 +1570,8 @@ list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type)&15], list) { if (ptype->type == type && (!ptype->dev || ptype->dev == skb->dev)) { - if (pt_prev) { - if (!pt_prev->data) { - ret = deliver_to_old_ones(pt_prev, - skb, 0); - } else { - atomic_inc(&skb->users); - ret = pt_prev->func(skb, skb->dev, - pt_prev); - } - } + if (pt_prev) + ret = deliver_skb(skb, pt_prev, 0); pt_prev = ptype; } } @@ -1637,8 +1626,8 @@ #ifdef CONFIG_NET_HW_FLOWCONTROL if (queue->throttle && queue->input_pkt_queue.qlen < no_cong_thresh ) { + queue->throttle = 0; if (atomic_dec_and_test(&netdev_dropping)) { - queue->throttle = 0; netdev_wakeup(); break; } @@ -3036,3 +3025,63 @@ } subsys_initcall(net_dev_init); + +EXPORT_SYMBOL(__dev_get); +EXPORT_SYMBOL(__dev_get_by_flags); +EXPORT_SYMBOL(__dev_get_by_index); +EXPORT_SYMBOL(__dev_get_by_name); +EXPORT_SYMBOL(__dev_remove_pack); +EXPORT_SYMBOL(__skb_linearize); +EXPORT_SYMBOL(call_netdevice_notifiers); +EXPORT_SYMBOL(dev_add_pack); +EXPORT_SYMBOL(dev_alloc); +EXPORT_SYMBOL(dev_alloc_name); +EXPORT_SYMBOL(dev_close); +EXPORT_SYMBOL(dev_get_by_flags); +EXPORT_SYMBOL(dev_get_by_index); +EXPORT_SYMBOL(dev_get_by_name); +EXPORT_SYMBOL(dev_getbyhwaddr); +EXPORT_SYMBOL(dev_ioctl); +EXPORT_SYMBOL(dev_new_index); +EXPORT_SYMBOL(dev_open); +EXPORT_SYMBOL(dev_queue_xmit); +EXPORT_SYMBOL(dev_queue_xmit_nit); +EXPORT_SYMBOL(dev_remove_pack); +EXPORT_SYMBOL(dev_set_allmulti); +EXPORT_SYMBOL(dev_set_promiscuity); +EXPORT_SYMBOL(free_netdev); +EXPORT_SYMBOL(netdev_boot_setup_check); +EXPORT_SYMBOL(netdev_set_master); +EXPORT_SYMBOL(netdev_state_change); +EXPORT_SYMBOL(netif_receive_skb); +EXPORT_SYMBOL(netif_rx); +EXPORT_SYMBOL(register_gifconf); +EXPORT_SYMBOL(register_netdevice); +EXPORT_SYMBOL(register_netdevice_notifier); +EXPORT_SYMBOL(skb_checksum_help); +EXPORT_SYMBOL(synchronize_net); +EXPORT_SYMBOL(unregister_netdevice); +EXPORT_SYMBOL(unregister_netdevice_notifier); + +#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) +EXPORT_SYMBOL(br_handle_frame_hook); +#endif +/* for 801q VLAN support */ +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +EXPORT_SYMBOL(dev_change_flags); +#endif +#ifdef CONFIG_KMOD +EXPORT_SYMBOL(dev_load); +#endif +#ifdef CONFIG_NET_HW_FLOWCONTROL +EXPORT_SYMBOL(netdev_dropping); +EXPORT_SYMBOL(netdev_fc_xoff); +EXPORT_SYMBOL(netdev_register_fc); +EXPORT_SYMBOL(netdev_unregister_fc); +#endif +#ifdef CONFIG_NET_FASTROUTE +EXPORT_SYMBOL(netdev_fastroute); +EXPORT_SYMBOL(netdev_fastroute_obstacles); +#endif + +EXPORT_PER_CPU_SYMBOL(softnet_data); diff -Nru a/net/core/dev_mcast.c b/net/core/dev_mcast.c --- a/net/core/dev_mcast.c Sun Oct 5 00:33:07 2003 +++ b/net/core/dev_mcast.c Sun Oct 5 00:33:07 2003 @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -273,3 +274,6 @@ #endif } +EXPORT_SYMBOL(dev_mc_add); +EXPORT_SYMBOL(dev_mc_delete); +EXPORT_SYMBOL(dev_mc_upload); diff -Nru a/net/core/dst.c b/net/core/dst.c --- a/net/core/dst.c Sun Oct 5 00:33:09 2003 +++ b/net/core/dst.c Sun Oct 5 00:33:09 2003 @@ -6,15 +6,16 @@ */ #include -#include +#include +#include #include -#include #include -#include -#include +#include #include +#include #include -#include +#include +#include #include @@ -257,3 +258,7 @@ { register_netdevice_notifier(&dst_dev_notifier); } + +EXPORT_SYMBOL(__dst_free); +EXPORT_SYMBOL(dst_alloc); +EXPORT_SYMBOL(dst_destroy); diff -Nru a/net/core/dv.c b/net/core/dv.c --- a/net/core/dv.c Sun Oct 5 00:33:08 2003 +++ b/net/core/dv.c Sun Oct 5 00:33:08 2003 @@ -10,6 +10,7 @@ * Dave Miller: improvement on the code (correctness, performance and source files) * */ +#include #include #include #include @@ -237,7 +238,7 @@ default: return -EINVAL; - }; + } break; @@ -281,7 +282,7 @@ default: return -EINVAL; - }; + } break; @@ -301,7 +302,7 @@ default: return -EINVAL; - }; + } break; @@ -321,7 +322,7 @@ default: return -EINVAL; - }; + } break; @@ -337,7 +338,7 @@ default: return -EINVAL; - }; + } break; @@ -353,7 +354,7 @@ default: return -EINVAL; - }; + } break; @@ -373,7 +374,7 @@ default: return -EINVAL; - }; + } break; @@ -389,7 +390,7 @@ default: return -EINVAL; - }; + } break; @@ -405,7 +406,7 @@ default: return -EINVAL; - }; + } break; @@ -425,19 +426,19 @@ default: return -EINVAL; - }; + } break; default: return -EINVAL; - }; + } break; default: return -EINVAL; - }; + } return 0; } @@ -550,8 +551,8 @@ } } break; - }; - - return; + } } +EXPORT_SYMBOL(alloc_divert_blk); +EXPORT_SYMBOL(free_divert_blk); diff -Nru a/net/core/ethtool.c b/net/core/ethtool.c --- a/net/core/ethtool.c Sun Oct 5 00:33:07 2003 +++ b/net/core/ethtool.c Sun Oct 5 00:33:07 2003 @@ -9,6 +9,7 @@ * It's GPL, stupid. */ +#include #include #include #include @@ -727,3 +728,11 @@ return dev->do_ioctl(dev, ifr, SIOCETHTOOL); return -EOPNOTSUPP; } + +EXPORT_SYMBOL(ethtool_op_get_link); +EXPORT_SYMBOL(ethtool_op_get_sg); +EXPORT_SYMBOL(ethtool_op_get_tso); +EXPORT_SYMBOL(ethtool_op_get_tx_csum); +EXPORT_SYMBOL(ethtool_op_set_sg); +EXPORT_SYMBOL(ethtool_op_set_tso); +EXPORT_SYMBOL(ethtool_op_set_tx_csum); diff -Nru a/net/core/filter.c b/net/core/filter.c --- a/net/core/filter.c Sun Oct 5 00:33:07 2003 +++ b/net/core/filter.c Sun Oct 5 00:33:07 2003 @@ -424,3 +424,6 @@ sk_filter_release(sk, fp); return err; } + +EXPORT_SYMBOL(sk_chk_filter); +EXPORT_SYMBOL(sk_run_filter); diff -Nru a/net/core/flow.c b/net/core/flow.c --- a/net/core/flow.c Sun Oct 5 00:33:05 2003 +++ b/net/core/flow.c Sun Oct 5 00:33:05 2003 @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -401,3 +402,6 @@ } module_init(flow_cache_init); + +EXPORT_SYMBOL(flow_cache_genid); +EXPORT_SYMBOL(flow_cache_lookup); diff -Nru a/net/core/iovec.c b/net/core/iovec.c --- a/net/core/iovec.c Sun Oct 5 00:33:10 2003 +++ b/net/core/iovec.c Sun Oct 5 00:33:10 2003 @@ -16,8 +16,8 @@ * Andi Kleen : Fix csum*fromiovecend for IPv6. */ - #include +#include #include #include #include @@ -254,3 +254,9 @@ err = -EFAULT; goto out; } + +EXPORT_SYMBOL(csum_partial_copy_fromiovecend); +EXPORT_SYMBOL(memcpy_fromiovec); +EXPORT_SYMBOL(memcpy_fromiovecend); +EXPORT_SYMBOL(memcpy_toiovec); +EXPORT_SYMBOL(memcpy_tokerneliovec); diff -Nru a/net/core/link_watch.c b/net/core/link_watch.c --- a/net/core/link_watch.c Sun Oct 5 00:33:05 2003 +++ b/net/core/link_watch.c Sun Oct 5 00:33:05 2003 @@ -1,5 +1,5 @@ /* - * Linux network device link state notifaction + * Linux network device link state notification * * Author: * Stefan Rompf @@ -12,6 +12,7 @@ */ #include +#include #include #include #include @@ -132,3 +133,4 @@ } } +EXPORT_SYMBOL(linkwatch_fire_event); diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c --- a/net/core/neighbour.c Sun Oct 5 00:33:05 2003 +++ b/net/core/neighbour.c Sun Oct 5 00:33:05 2003 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -1683,3 +1684,34 @@ } #endif /* CONFIG_SYSCTL */ + +EXPORT_SYMBOL(__neigh_event_send); +EXPORT_SYMBOL(neigh_add); +EXPORT_SYMBOL(neigh_changeaddr); +EXPORT_SYMBOL(neigh_compat_output); +EXPORT_SYMBOL(neigh_connected_output); +EXPORT_SYMBOL(neigh_create); +EXPORT_SYMBOL(neigh_delete); +EXPORT_SYMBOL(neigh_destroy); +EXPORT_SYMBOL(neigh_dump_info); +EXPORT_SYMBOL(neigh_event_ns); +EXPORT_SYMBOL(neigh_ifdown); +EXPORT_SYMBOL(neigh_lookup); +EXPORT_SYMBOL(neigh_parms_alloc); +EXPORT_SYMBOL(neigh_parms_release); +EXPORT_SYMBOL(neigh_rand_reach_time); +EXPORT_SYMBOL(neigh_resolve_output); +EXPORT_SYMBOL(neigh_table_clear); +EXPORT_SYMBOL(neigh_table_init); +EXPORT_SYMBOL(neigh_update); +EXPORT_SYMBOL(neigh_update_hhs); +EXPORT_SYMBOL(pneigh_enqueue); +EXPORT_SYMBOL(pneigh_lookup); + +#ifdef CONFIG_ARPD +EXPORT_SYMBOL(neigh_app_ns); +#endif +#ifdef CONFIG_SYSCTL +EXPORT_SYMBOL(neigh_sysctl_register); +EXPORT_SYMBOL(neigh_sysctl_unregister); +#endif diff -Nru a/net/core/netfilter.c b/net/core/netfilter.c --- a/net/core/netfilter.c Sun Oct 5 00:33:08 2003 +++ b/net/core/netfilter.c Sun Oct 5 00:33:08 2003 @@ -759,3 +759,17 @@ INIT_LIST_HEAD(&nf_hooks[i][h]); } } + +EXPORT_SYMBOL(ip_ct_attach); +EXPORT_SYMBOL(ip_route_me_harder); +EXPORT_SYMBOL(nf_getsockopt); +EXPORT_SYMBOL(nf_hook_slow); +EXPORT_SYMBOL(nf_hooks); +EXPORT_SYMBOL(nf_register_hook); +EXPORT_SYMBOL(nf_register_queue_handler); +EXPORT_SYMBOL(nf_register_sockopt); +EXPORT_SYMBOL(nf_reinject); +EXPORT_SYMBOL(nf_setsockopt); +EXPORT_SYMBOL(nf_unregister_hook); +EXPORT_SYMBOL(nf_unregister_queue_handler); +EXPORT_SYMBOL(nf_unregister_sockopt); diff -Nru a/net/core/rtnetlink.c b/net/core/rtnetlink.c --- a/net/core/rtnetlink.c Sun Oct 5 00:33:10 2003 +++ b/net/core/rtnetlink.c Sun Oct 5 00:33:10 2003 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -556,7 +557,6 @@ .notifier_call = rtnetlink_event, }; - void __init rtnetlink_init(void) { rtnl = netlink_kernel_create(NETLINK_ROUTE, rtnetlink_rcv); @@ -567,3 +567,13 @@ rtnetlink_links[PF_UNSPEC] = link_rtnetlink_table; rtnetlink_links[PF_PACKET] = link_rtnetlink_table; } + +EXPORT_SYMBOL(__rta_fill); +EXPORT_SYMBOL(rtattr_parse); +EXPORT_SYMBOL(rtnetlink_dump_ifinfo); +EXPORT_SYMBOL(rtnetlink_links); +EXPORT_SYMBOL(rtnetlink_put_metrics); +EXPORT_SYMBOL(rtnl); +EXPORT_SYMBOL(rtnl_lock); +EXPORT_SYMBOL(rtnl_sem); +EXPORT_SYMBOL(rtnl_unlock); diff -Nru a/net/core/scm.c b/net/core/scm.c --- a/net/core/scm.c Sun Oct 5 00:33:08 2003 +++ b/net/core/scm.c Sun Oct 5 00:33:08 2003 @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -282,3 +283,9 @@ } return new_fpl; } + +EXPORT_SYMBOL(__scm_destroy); +EXPORT_SYMBOL(__scm_send); +EXPORT_SYMBOL(put_cmsg); +EXPORT_SYMBOL(scm_detach_fds); +EXPORT_SYMBOL(scm_fp_dup); diff -Nru a/net/core/skbuff.c b/net/core/skbuff.c --- a/net/core/skbuff.c Sun Oct 5 00:33:09 2003 +++ b/net/core/skbuff.c Sun Oct 5 00:33:09 2003 @@ -39,6 +39,7 @@ */ #include +#include #include #include #include @@ -1103,3 +1104,22 @@ if (!skbuff_head_cache) panic("cannot create skbuff cache"); } + +EXPORT_SYMBOL(___pskb_trim); +EXPORT_SYMBOL(__kfree_skb); +EXPORT_SYMBOL(__pskb_pull_tail); +EXPORT_SYMBOL(alloc_skb); +EXPORT_SYMBOL(pskb_copy); +EXPORT_SYMBOL(pskb_expand_head); +EXPORT_SYMBOL(skb_checksum); +EXPORT_SYMBOL(skb_clone); +EXPORT_SYMBOL(skb_clone_fraglist); +EXPORT_SYMBOL(skb_copy); +EXPORT_SYMBOL(skb_copy_and_csum_bits); +EXPORT_SYMBOL(skb_copy_and_csum_dev); +EXPORT_SYMBOL(skb_copy_bits); +EXPORT_SYMBOL(skb_copy_expand); +EXPORT_SYMBOL(skb_over_panic); +EXPORT_SYMBOL(skb_pad); +EXPORT_SYMBOL(skb_realloc_headroom); +EXPORT_SYMBOL(skb_under_panic); diff -Nru a/net/core/sock.c b/net/core/sock.c --- a/net/core/sock.c Sun Oct 5 00:33:09 2003 +++ b/net/core/sock.c Sun Oct 5 00:33:09 2003 @@ -98,6 +98,7 @@ #include #include #include +#include #include #include #include @@ -1111,3 +1112,40 @@ atomic_set(&sk->sk_refcnt, 1); } + +EXPORT_SYMBOL(__lock_sock); +EXPORT_SYMBOL(__release_sock); +EXPORT_SYMBOL(sk_alloc); +EXPORT_SYMBOL(sk_free); +EXPORT_SYMBOL(sk_send_sigurg); +EXPORT_SYMBOL(sock_alloc_send_pskb); +EXPORT_SYMBOL(sock_alloc_send_skb); +EXPORT_SYMBOL(sock_getsockopt); +EXPORT_SYMBOL(sock_init_data); +EXPORT_SYMBOL(sock_kfree_s); +EXPORT_SYMBOL(sock_kmalloc); +EXPORT_SYMBOL(sock_no_accept); +EXPORT_SYMBOL(sock_no_bind); +EXPORT_SYMBOL(sock_no_connect); +EXPORT_SYMBOL(sock_no_getname); +EXPORT_SYMBOL(sock_no_getsockopt); +EXPORT_SYMBOL(sock_no_ioctl); +EXPORT_SYMBOL(sock_no_listen); +EXPORT_SYMBOL(sock_no_mmap); +EXPORT_SYMBOL(sock_no_poll); +EXPORT_SYMBOL(sock_no_recvmsg); +EXPORT_SYMBOL(sock_no_release); +EXPORT_SYMBOL(sock_no_sendmsg); +EXPORT_SYMBOL(sock_no_sendpage); +EXPORT_SYMBOL(sock_no_setsockopt); +EXPORT_SYMBOL(sock_no_shutdown); +EXPORT_SYMBOL(sock_no_socketpair); +EXPORT_SYMBOL(sock_rfree); +EXPORT_SYMBOL(sock_rmalloc); +EXPORT_SYMBOL(sock_setsockopt); +EXPORT_SYMBOL(sock_wfree); +EXPORT_SYMBOL(sock_wmalloc); +#ifdef CONFIG_SYSCTL +EXPORT_SYMBOL(sysctl_rmem_max); +EXPORT_SYMBOL(sysctl_wmem_max); +#endif diff -Nru a/net/core/utils.c b/net/core/utils.c --- a/net/core/utils.c Sun Oct 5 00:33:05 2003 +++ b/net/core/utils.c Sun Oct 5 00:33:05 2003 @@ -13,13 +13,15 @@ * 2 of the License, or (at your option) any later version. */ -#include -#include -#include -#include +#include #include -#include +#include #include +#include +#include + +#include +#include static unsigned long net_rand_seed = 152L; @@ -71,3 +73,7 @@ spin_unlock_irqrestore(&ratelimit_lock, flags); return 0; } + +EXPORT_SYMBOL(net_random); +EXPORT_SYMBOL(net_ratelimit); +EXPORT_SYMBOL(net_srandom); diff -Nru a/net/core/wireless.c b/net/core/wireless.c --- a/net/core/wireless.c Sun Oct 5 00:33:09 2003 +++ b/net/core/wireless.c Sun Oct 5 00:33:09 2003 @@ -1365,3 +1365,10 @@ #endif /* IW_WIRELESS_THRSPY */ #endif /* IW_WIRELESS_SPY */ } + +EXPORT_SYMBOL(iw_handler_get_spy); +EXPORT_SYMBOL(iw_handler_get_thrspy); +EXPORT_SYMBOL(iw_handler_set_spy); +EXPORT_SYMBOL(iw_handler_set_thrspy); +EXPORT_SYMBOL(wireless_send_event); +EXPORT_SYMBOL(wireless_spy_update); diff -Nru a/net/ethernet/eth.c b/net/ethernet/eth.c --- a/net/ethernet/eth.c Sun Oct 5 00:33:08 2003 +++ b/net/ethernet/eth.c Sun Oct 5 00:33:08 2003 @@ -37,6 +37,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -241,3 +242,5 @@ memcpy(((u8*)hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)), haddr, dev->addr_len); } + +EXPORT_SYMBOL(eth_type_trans); diff -Nru a/net/ethernet/pe2.c b/net/ethernet/pe2.c --- a/net/ethernet/pe2.c Sun Oct 5 00:33:10 2003 +++ b/net/ethernet/pe2.c Sun Oct 5 00:33:10 2003 @@ -1,27 +1,28 @@ +#include +#include +#include #include #include + #include -#include -#include -static int pEII_request(struct datalink_proto *dl, - struct sk_buff *skb, unsigned char *dest_node) +static int pEII_request(struct datalink_proto *dl, + struct sk_buff *skb, unsigned char *dest_node) { - struct net_device *dev = skb->dev; + struct net_device *dev = skb->dev; - skb->protocol = htons (ETH_P_IPX); - if(dev->hard_header) - dev->hard_header(skb, dev, ETH_P_IPX, dest_node, NULL, skb->len); + skb->protocol = htons(ETH_P_IPX); + if (dev->hard_header) + dev->hard_header(skb, dev, ETH_P_IPX, + dest_node, NULL, skb->len); return dev_queue_xmit(skb); } -struct datalink_proto * -make_EII_client(void) +struct datalink_proto *make_EII_client(void) { - struct datalink_proto *proto; + struct datalink_proto *proto = kmalloc(sizeof(*proto), GFP_ATOMIC); - proto = (struct datalink_proto *) kmalloc(sizeof(*proto), GFP_ATOMIC); - if (proto != NULL) { + if (proto) { proto->header_length = 0; proto->request = pEII_request; } @@ -34,3 +35,6 @@ if (dl) kfree(dl); } + +EXPORT_SYMBOL(destroy_EII_client); +EXPORT_SYMBOL(make_EII_client); diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c --- a/net/ipv4/af_inet.c Sun Oct 5 00:33:06 2003 +++ b/net/ipv4/af_inet.c Sun Oct 5 00:33:06 2003 @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include @@ -1246,4 +1247,33 @@ return 0; } #endif /* CONFIG_PROC_FS */ + MODULE_ALIAS_NETPROTO(PF_INET); + +EXPORT_SYMBOL(inet_accept); +EXPORT_SYMBOL(inet_bind); +EXPORT_SYMBOL(inet_dgram_connect); +EXPORT_SYMBOL(inet_dgram_ops); +EXPORT_SYMBOL(inet_family_ops); +EXPORT_SYMBOL(inet_getname); +EXPORT_SYMBOL(inet_getsockopt); +EXPORT_SYMBOL(inet_ioctl); +EXPORT_SYMBOL(inet_listen); +EXPORT_SYMBOL(inet_recvmsg); +EXPORT_SYMBOL(inet_register_protosw); +EXPORT_SYMBOL(inet_release); +EXPORT_SYMBOL(inet_sendmsg); +EXPORT_SYMBOL(inet_setsockopt); +EXPORT_SYMBOL(inet_shutdown); +EXPORT_SYMBOL(inet_sock_destruct); +EXPORT_SYMBOL(inet_sock_release); +EXPORT_SYMBOL(inet_stream_connect); +EXPORT_SYMBOL(inet_stream_ops); +EXPORT_SYMBOL(inet_unregister_protosw); +EXPORT_SYMBOL(net_statistics); +EXPORT_SYMBOL(tcp_protocol); +EXPORT_SYMBOL(udp_protocol); + +#ifdef INET_REFCNT_DEBUG +EXPORT_SYMBOL(inet_sock_nr); +#endif diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c --- a/net/ipv4/arp.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/arp.c Sun Oct 5 00:33:09 2003 @@ -69,6 +69,7 @@ * Arnaldo C. Melo : convert /proc/net/arp to seq_file */ +#include #include #include #include @@ -630,12 +631,6 @@ if (in_dev == NULL) goto out; - /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ - if (!pskb_may_pull(skb, (sizeof(struct arphdr) + - (2 * dev->addr_len) + - (2 * sizeof(u32))))) - goto out; - arp = skb->nh.arph; switch (dev_type) { @@ -835,8 +830,15 @@ int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) { - struct arphdr *arp = skb->nh.arph; + struct arphdr *arp; + + /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ + if (!pskb_may_pull(skb, (sizeof(struct arphdr) + + (2 * dev->addr_len) + + (2 * sizeof(u32))))) + goto freeskb; + arp = skb->nh.arph; if (arp->ar_hln != dev->addr_len || dev->flags & IFF_NOARP || skb->pkt_type == PACKET_OTHERHOST || @@ -1429,3 +1431,13 @@ } #endif /* CONFIG_PROC_FS */ + +EXPORT_SYMBOL(arp_broken_ops); +EXPORT_SYMBOL(arp_find); +EXPORT_SYMBOL(arp_rcv); +EXPORT_SYMBOL(arp_send); +EXPORT_SYMBOL(arp_tbl); + +#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) +EXPORT_SYMBOL(clip_tbl_hook); +#endif diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c --- a/net/ipv4/devinet.c Sun Oct 5 00:33:07 2003 +++ b/net/ipv4/devinet.c Sun Oct 5 00:33:07 2003 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -1354,3 +1355,11 @@ devinet_sysctl_register(NULL, &ipv4_devconf_dflt); #endif } + +EXPORT_SYMBOL(devinet_ioctl); +EXPORT_SYMBOL(in_dev_finish_destroy); +EXPORT_SYMBOL(inet_select_addr); +EXPORT_SYMBOL(inetdev_by_index); +EXPORT_SYMBOL(inetdev_lock); +EXPORT_SYMBOL(register_inetaddr_notifier); +EXPORT_SYMBOL(unregister_inetaddr_notifier); diff -Nru a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c --- a/net/ipv4/fib_frontend.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/fib_frontend.c Sun Oct 5 00:33:10 2003 @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -605,3 +606,6 @@ register_inetaddr_notifier(&fib_inetaddr_notifier); } +EXPORT_SYMBOL(inet_addr_type); +EXPORT_SYMBOL(ip_dev_find); +EXPORT_SYMBOL(ip_rt_ioctl); diff -Nru a/net/ipv4/icmp.c b/net/ipv4/icmp.c --- a/net/ipv4/icmp.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/icmp.c Sun Oct 5 00:33:10 2003 @@ -65,6 +65,7 @@ */ #include +#include #include #include #include @@ -1126,3 +1127,8 @@ per_cpu(__icmp_socket, i)->sk->sk_prot->unhash(per_cpu(__icmp_socket, i)->sk); } } + +EXPORT_SYMBOL(icmp_err_convert); +EXPORT_SYMBOL(icmp_send); +EXPORT_SYMBOL(icmp_statistics); +EXPORT_SYMBOL(xrlim_allow); diff -Nru a/net/ipv4/igmp.c b/net/ipv4/igmp.c --- a/net/ipv4/igmp.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/igmp.c Sun Oct 5 00:33:10 2003 @@ -72,8 +72,8 @@ * Vinay Kulkarni */ - #include +#include #include #include #include @@ -2438,3 +2438,6 @@ } #endif +EXPORT_SYMBOL(ip_mc_dec_group); +EXPORT_SYMBOL(ip_mc_inc_group); +EXPORT_SYMBOL(ip_mc_join_group); diff -Nru a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c --- a/net/ipv4/inetpeer.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/inetpeer.c Sun Oct 5 00:33:10 2003 @@ -8,6 +8,7 @@ * Authors: Andrey V. Savochkin */ +#include #include #include #include @@ -452,3 +453,5 @@ peer_total / inet_peer_threshold * HZ; add_timer(&peer_periodic_timer); } + +EXPORT_SYMBOL(inet_peer_idlock); diff -Nru a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c --- a/net/ipv4/ip_fragment.c Sun Oct 5 00:33:07 2003 +++ b/net/ipv4/ip_fragment.c Sun Oct 5 00:33:07 2003 @@ -23,6 +23,7 @@ */ #include +#include #include #include #include @@ -675,3 +676,5 @@ ipfrag_secret_timer.expires = jiffies + sysctl_ipfrag_secret_interval; add_timer(&ipfrag_secret_timer); } + +EXPORT_SYMBOL(ip_defrag); diff -Nru a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c --- a/net/ipv4/ip_input.c Sun Oct 5 00:33:05 2003 +++ b/net/ipv4/ip_input.c Sun Oct 5 00:33:05 2003 @@ -116,6 +116,7 @@ */ #include +#include #include #include #include @@ -432,3 +433,5 @@ return NET_RX_DROP; } +EXPORT_SYMBOL(ip_rcv); +EXPORT_SYMBOL(ip_statistics); diff -Nru a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c --- a/net/ipv4/ip_options.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/ip_options.c Sun Oct 5 00:33:09 2003 @@ -11,6 +11,7 @@ * */ +#include #include #include #include @@ -617,3 +618,6 @@ } return 0; } + +EXPORT_SYMBOL(ip_options_compile); +EXPORT_SYMBOL(ip_options_undo); diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/ip_output.c Sun Oct 5 00:33:10 2003 @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -1317,3 +1318,13 @@ igmp_mc_proc_init(); #endif } + +EXPORT_SYMBOL(ip_finish_output); +EXPORT_SYMBOL(ip_fragment); +EXPORT_SYMBOL(ip_generic_getfrag); +EXPORT_SYMBOL(ip_queue_xmit); +EXPORT_SYMBOL(ip_send_check); + +#ifdef CONFIG_SYSCTL +EXPORT_SYMBOL(sysctl_ip_default_ttl); +#endif diff -Nru a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c --- a/net/ipv4/ip_sockglue.c Sun Oct 5 00:33:07 2003 +++ b/net/ipv4/ip_sockglue.c Sun Oct 5 00:33:07 2003 @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -1055,3 +1056,10 @@ } return 0; } + +EXPORT_SYMBOL(ip_cmsg_recv); + +#ifdef CONFIG_IP_SCTP_MODULE +EXPORT_SYMBOL(ip_getsockopt); +EXPORT_SYMBOL(ip_setsockopt); +#endif diff -Nru a/net/ipv4/ipip.c b/net/ipv4/ipip.c --- a/net/ipv4/ipip.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/ipip.c Sun Oct 5 00:33:10 2003 @@ -483,6 +483,11 @@ read_lock(&ipip_lock); if ((tunnel = ipip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { + kfree_skb(skb); + return 0; + } + tunnel->stat.rx_packets++; tunnel->stat.rx_bytes += skb->len; skb->dev = tunnel->dev; diff -Nru a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c --- a/net/ipv4/ipvs/ip_vs_lblc.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/ipvs/ip_vs_lblc.c Sun Oct 5 00:33:10 2003 @@ -458,10 +458,11 @@ * The server with weight=0 is quiesced and will not receive any * new connection. */ - list_for_each_entry(least, &svc->destinations, n_list) { - if (least->flags & IP_VS_DEST_F_OVERLOAD) + list_for_each_entry(dest, &svc->destinations, n_list) { + if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; - if (atomic_read(&least->weight) > 0) { + if (atomic_read(&dest->weight) > 0) { + least = dest; loh = atomic_read(&least->activeconns) * 50 + atomic_read(&least->inactconns); goto nextstage; @@ -473,7 +474,7 @@ * Find the destination with the least load. */ nextstage: - list_for_each_entry(dest, &svc->destinations, n_list) { + list_for_each_entry_continue(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c --- a/net/ipv4/ipvs/ip_vs_lblcr.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/ipvs/ip_vs_lblcr.c Sun Oct 5 00:33:09 2003 @@ -711,11 +711,12 @@ * The server with weight=0 is quiesced and will not receive any * new connection. */ - list_for_each_entry(least, &svc->destinations, n_list) { - if (least->flags & IP_VS_DEST_F_OVERLOAD) + list_for_each_entry(dest, &svc->destinations, n_list) { + if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; - if (atomic_read(&least->weight) > 0) { + if (atomic_read(&dest->weight) > 0) { + least = dest; loh = atomic_read(&least->activeconns) * 50 + atomic_read(&least->inactconns); goto nextstage; @@ -727,7 +728,7 @@ * Find the destination with the least load. */ nextstage: - list_for_each_entry(dest, &svc->destinations, n_list) { + list_for_each_entry_continue(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; diff -Nru a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c --- a/net/ipv4/ipvs/ip_vs_lc.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/ipvs/ip_vs_lc.c Sun Oct 5 00:33:10 2003 @@ -65,8 +65,8 @@ static struct ip_vs_dest * ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - struct ip_vs_dest *dest, *least; - unsigned int loh, doh; + struct ip_vs_dest *dest, *least = NULL; + unsigned int loh = 0, doh; IP_VS_DBG(6, "ip_vs_lc_schedule(): Scheduling...\n"); @@ -79,31 +79,18 @@ * served, but no new connection is assigned to the server. */ - list_for_each_entry(least, &svc->destinations, n_list) { - if (least->flags & IP_VS_DEST_F_OVERLOAD) - continue; - if (atomic_read(&least->weight) > 0) { - loh = ip_vs_lc_dest_overhead(least); - goto nextstage; - } - } - return NULL; - - /* - * Find the destination with the least load. - */ - nextstage: list_for_each_entry(dest, &svc->destinations, n_list) { if ((dest->flags & IP_VS_DEST_F_OVERLOAD) || atomic_read(&dest->weight) == 0) continue; doh = ip_vs_lc_dest_overhead(dest); - if (doh < loh) { + if (!least || doh < loh) { least = dest; loh = doh; } } + if (least) IP_VS_DBG(6, "LC: server %u.%u.%u.%u:%u activeconns %d inactconns %d\n", NIPQUAD(least->addr), ntohs(least->port), atomic_read(&least->activeconns), diff -Nru a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c --- a/net/ipv4/ipvs/ip_vs_nq.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/ipvs/ip_vs_nq.c Sun Oct 5 00:33:10 2003 @@ -81,8 +81,8 @@ static struct ip_vs_dest * ip_vs_nq_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - struct ip_vs_dest *dest, *least; - unsigned int loh, doh; + struct ip_vs_dest *dest, *least = NULL; + unsigned int loh = 0, doh; IP_VS_DBG(6, "ip_vs_nq_schedule(): Scheduling...\n"); @@ -99,27 +99,10 @@ * new connections. */ - list_for_each_entry(least, &svc->destinations, n_list) { - if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && - atomic_read(&least->weight) > 0) { - loh = ip_vs_nq_dest_overhead(least); - - /* return the server directly if it is idle */ - if (atomic_read(&least->activeconns) == 0) - goto out; - - goto nextstage; - } - } - return NULL; - - /* - * Find the destination with the least load. - */ - nextstage: list_for_each_entry(dest, &svc->destinations, n_list) { - if (dest->flags & IP_VS_DEST_F_OVERLOAD) + if (dest->flags & IP_VS_DEST_F_OVERLOAD || + !atomic_read(&dest->weight)) continue; doh = ip_vs_nq_dest_overhead(dest); @@ -127,15 +110,20 @@ /* return the server directly if it is idle */ if (atomic_read(&dest->activeconns) == 0) { least = dest; + loh = doh; goto out; } - if (loh * atomic_read(&dest->weight) > - doh * atomic_read(&least->weight)) { + if (!least || + (loh * atomic_read(&dest->weight) > + doh * atomic_read(&least->weight))) { least = dest; loh = doh; } } + + if (!least) + return NULL; out: IP_VS_DBG(6, "NQ: server %u.%u.%u.%u:%u " diff -Nru a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c --- a/net/ipv4/ipvs/ip_vs_sed.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/ipvs/ip_vs_sed.c Sun Oct 5 00:33:10 2003 @@ -103,9 +103,10 @@ * new connections. */ - list_for_each_entry(least, &svc->destinations, n_list) { - if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && - atomic_read(&least->weight) > 0) { + list_for_each_entry(dest, &svc->destinations, n_list) { + if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) && + atomic_read(&dest->weight) > 0) { + least = dest; loh = ip_vs_sed_dest_overhead(least); goto nextstage; } @@ -116,7 +117,7 @@ * Find the destination with the least load. */ nextstage: - list_for_each_entry(dest, &svc->destinations, n_list) { + list_for_each_entry_continue(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; doh = ip_vs_sed_dest_overhead(dest); diff -Nru a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c --- a/net/ipv4/ipvs/ip_vs_wlc.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/ipvs/ip_vs_wlc.c Sun Oct 5 00:33:09 2003 @@ -91,9 +91,10 @@ * new connections. */ - list_for_each_entry(least, &svc->destinations, n_list) { - if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && - atomic_read(&least->weight) > 0) { + list_for_each_entry(dest, &svc->destinations, n_list) { + if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) && + atomic_read(&dest->weight) > 0) { + least = dest; loh = ip_vs_wlc_dest_overhead(least); goto nextstage; } @@ -104,7 +105,7 @@ * Find the destination with the least load. */ nextstage: - list_for_each_entry(dest, &svc->destinations, n_list) { + list_for_each_entry_continue(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; doh = ip_vs_wlc_dest_overhead(dest); diff -Nru a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c --- a/net/ipv4/ipvs/ip_vs_wrr.c Sun Oct 5 00:33:05 2003 +++ b/net/ipv4/ipvs/ip_vs_wrr.c Sun Oct 5 00:33:05 2003 @@ -58,26 +58,18 @@ { struct ip_vs_dest *dest; int weight; - int g = 1; + int g = 0; list_for_each_entry(dest, &svc->destinations, n_list) { weight = atomic_read(&dest->weight); if (weight > 0) { - g = weight; - goto search_gcd; + if (g > 0) + g = gcd(weight, g); + else + g = weight; } } - - return g; - - search_gcd: - list_for_each_entry(dest, &svc->destinations, n_list) { - weight = atomic_read(&dest->weight); - if (weight > 0) - g = gcd(weight, g); - } - - return g; + return g ? g : 1; } diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c --- a/net/ipv4/netfilter/ip_conntrack_core.c Sun Oct 5 00:33:05 2003 +++ b/net/ipv4/netfilter/ip_conntrack_core.c Sun Oct 5 00:33:05 2003 @@ -59,7 +59,7 @@ LIST_HEAD(protocol_list); static LIST_HEAD(helpers); unsigned int ip_conntrack_htable_size = 0; -static int ip_conntrack_max; +int ip_conntrack_max; static atomic_t ip_conntrack_count = ATOMIC_INIT(0); struct list_head *ip_conntrack_hash; static kmem_cache_t *ip_conntrack_cachep; @@ -301,7 +301,7 @@ static void destroy_conntrack(struct nf_conntrack *nfct) { - struct ip_conntrack *ct = (struct ip_conntrack *)nfct; + struct ip_conntrack *ct = (struct ip_conntrack *)nfct, *master = NULL; struct ip_conntrack_protocol *proto; DEBUGP("destroy_conntrack(%p)\n", ct); @@ -328,12 +328,15 @@ /* can't call __unexpect_related here, * since it would screw up expect_list */ list_del(&ct->master->expected_list); - ip_conntrack_put(ct->master->expectant); + master = ct->master->expectant; } kfree(ct->master); } WRITE_UNLOCK(&ip_conntrack_lock); + if (master) + ip_conntrack_put(master); + DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct); kmem_cache_free(ip_conntrack_cachep, ct); atomic_dec(&ip_conntrack_count); @@ -1276,11 +1279,14 @@ { struct inet_opt *inet = inet_sk(sk); struct ip_conntrack_tuple_hash *h; - struct ip_conntrack_tuple tuple = { { inet->rcv_saddr, - { .tcp = { inet->sport } } }, - { inet->daddr, - { .tcp = { inet->dport } }, - IPPROTO_TCP } }; + struct ip_conntrack_tuple tuple; + + IP_CT_TUPLE_U_BLANK(&tuple); + tuple.src.ip = inet->rcv_saddr; + tuple.src.u.tcp.port = inet->sport; + tuple.dst.ip = inet->daddr; + tuple.dst.u.tcp.port = inet->dport; + tuple.dst.protonum = IPPROTO_TCP; /* We only do TCP at the moment: is there a better way? */ if (strcmp(sk->sk_prot->name, "TCP")) { @@ -1325,45 +1331,6 @@ .get = &getorigdst, }; -#define NET_IP_CONNTRACK_MAX 2089 -#define NET_IP_CONNTRACK_MAX_NAME "ip_conntrack_max" - -#ifdef CONFIG_SYSCTL -static struct ctl_table_header *ip_conntrack_sysctl_header; - -static ctl_table ip_conntrack_table[] = { - { - .ctl_name = NET_IP_CONNTRACK_MAX, - .procname = NET_IP_CONNTRACK_MAX_NAME, - .data = &ip_conntrack_max, - .maxlen = sizeof(ip_conntrack_max), - .mode = 0644, - .proc_handler = proc_dointvec - }, - { .ctl_name = 0 } -}; - -static ctl_table ip_conntrack_dir_table[] = { - { - .ctl_name = NET_IPV4, - .procname = "ipv4", - .mode = 0555, - .child = ip_conntrack_table - }, - { .ctl_name = 0 } -}; - -static ctl_table ip_conntrack_root_table[] = { - { - .ctl_name = CTL_NET, - .procname = "net", - .mode = 0555, - .child = ip_conntrack_dir_table - }, - { .ctl_name = 0 } -}; -#endif /*CONFIG_SYSCTL*/ - static int kill_all(const struct ip_conntrack *i, void *data) { return 1; @@ -1373,9 +1340,6 @@ supposed to kill the mall. */ void ip_conntrack_cleanup(void) { -#ifdef CONFIG_SYSCTL - unregister_sysctl_table(ip_conntrack_sysctl_header); -#endif ip_ct_attach = NULL; /* This makes sure all current packets have passed through netfilter framework. Roll on, two-stage module @@ -1453,25 +1417,10 @@ for (i = 0; i < ip_conntrack_htable_size; i++) INIT_LIST_HEAD(&ip_conntrack_hash[i]); -/* This is fucking braindead. There is NO WAY of doing this without - the CONFIG_SYSCTL unless you don't want to detect errors. - Grrr... --RR */ -#ifdef CONFIG_SYSCTL - ip_conntrack_sysctl_header - = register_sysctl_table(ip_conntrack_root_table, 0); - if (ip_conntrack_sysctl_header == NULL) { - goto err_free_ct_cachep; - } -#endif /*CONFIG_SYSCTL*/ - /* For use by ipt_REJECT */ ip_ct_attach = ip_conntrack_attach; return ret; -#ifdef CONFIG_SYSCTL -err_free_ct_cachep: - kmem_cache_destroy(ip_conntrack_cachep); -#endif /*CONFIG_SYSCTL*/ err_free_hash: vfree(ip_conntrack_hash); err_unreg_sockopt: diff -Nru a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c --- a/net/ipv4/netfilter/ip_conntrack_irc.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/netfilter/ip_conntrack_irc.c Sun Oct 5 00:33:09 2003 @@ -177,7 +177,10 @@ DEBUGP("DCC bound ip/port: %u.%u.%u.%u:%u\n", HIPQUAD(dcc_ip), dcc_port); - if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip)) { + /* dcc_ip can be the internal OR external (NAT'ed) IP + * Tiago Sousa */ + if (ct->tuplehash[dir].tuple.src.ip != htonl(dcc_ip) + && ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip != htonl(dcc_ip)) { if (net_ratelimit()) printk(KERN_WARNING "Forged DCC command from " @@ -201,7 +204,7 @@ exp->tuple = ((struct ip_conntrack_tuple) { { 0, { 0 } }, - { htonl(dcc_ip), { .tcp = { htons(dcc_port) } }, + { ct->tuplehash[dir].tuple.src.ip, { .tcp = { htons(dcc_port) } }, IPPROTO_TCP }}); exp->mask = ((struct ip_conntrack_tuple) { { 0, { 0 } }, diff -Nru a/net/ipv4/netfilter/ip_conntrack_proto_generic.c b/net/ipv4/netfilter/ip_conntrack_proto_generic.c --- a/net/ipv4/netfilter/ip_conntrack_proto_generic.c Sun Oct 5 00:33:07 2003 +++ b/net/ipv4/netfilter/ip_conntrack_proto_generic.c Sun Oct 5 00:33:07 2003 @@ -4,7 +4,7 @@ #include #include -#define GENERIC_TIMEOUT (600*HZ) +unsigned long ip_ct_generic_timeout = 600*HZ; static int generic_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, @@ -44,7 +44,7 @@ const struct sk_buff *skb, enum ip_conntrack_info conntrackinfo) { - ip_ct_refresh(conntrack, GENERIC_TIMEOUT); + ip_ct_refresh(conntrack, ip_ct_generic_timeout); return NF_ACCEPT; } diff -Nru a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c --- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c Sun Oct 5 00:33:05 2003 +++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c Sun Oct 5 00:33:05 2003 @@ -6,7 +6,7 @@ #include #include -#define ICMP_TIMEOUT (30*HZ) +unsigned long ip_ct_icmp_timeout = 30*HZ; #if 0 #define DEBUGP printk @@ -86,7 +86,7 @@ ct->timeout.function((unsigned long)ct); } else { atomic_inc(&ct->proto.icmp.count); - ip_ct_refresh(ct, ICMP_TIMEOUT); + ip_ct_refresh(ct, ip_ct_icmp_timeout); } return NF_ACCEPT; diff -Nru a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c --- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c Sun Oct 5 00:33:10 2003 @@ -49,20 +49,28 @@ #define HOURS * 60 MINS #define DAYS * 24 HOURS - -static unsigned long tcp_timeouts[] -= { 30 MINS, /* TCP_CONNTRACK_NONE, */ - 5 DAYS, /* TCP_CONNTRACK_ESTABLISHED, */ - 2 MINS, /* TCP_CONNTRACK_SYN_SENT, */ - 60 SECS, /* TCP_CONNTRACK_SYN_RECV, */ - 2 MINS, /* TCP_CONNTRACK_FIN_WAIT, */ - 2 MINS, /* TCP_CONNTRACK_TIME_WAIT, */ - 10 SECS, /* TCP_CONNTRACK_CLOSE, */ - 60 SECS, /* TCP_CONNTRACK_CLOSE_WAIT, */ - 30 SECS, /* TCP_CONNTRACK_LAST_ACK, */ - 2 MINS, /* TCP_CONNTRACK_LISTEN, */ -}; - +unsigned long ip_ct_tcp_timeout_syn_sent = 2 MINS; +unsigned long ip_ct_tcp_timeout_syn_recv = 60 SECS; +unsigned long ip_ct_tcp_timeout_established = 5 DAYS; +unsigned long ip_ct_tcp_timeout_fin_wait = 2 MINS; +unsigned long ip_ct_tcp_timeout_close_wait = 3 DAYS; +unsigned long ip_ct_tcp_timeout_last_ack = 30 SECS; +unsigned long ip_ct_tcp_timeout_time_wait = 2 MINS; +unsigned long ip_ct_tcp_timeout_close = 10 SECS; + +static unsigned long * tcp_timeouts[] += { 0, /* TCP_CONNTRACK_NONE */ + &ip_ct_tcp_timeout_established, /* TCP_CONNTRACK_ESTABLISHED, */ + &ip_ct_tcp_timeout_syn_sent, /* TCP_CONNTRACK_SYN_SENT, */ + &ip_ct_tcp_timeout_syn_recv, /* TCP_CONNTRACK_SYN_RECV, */ + &ip_ct_tcp_timeout_fin_wait, /* TCP_CONNTRACK_FIN_WAIT, */ + &ip_ct_tcp_timeout_time_wait, /* TCP_CONNTRACK_TIME_WAIT, */ + &ip_ct_tcp_timeout_close, /* TCP_CONNTRACK_CLOSE, */ + &ip_ct_tcp_timeout_close_wait, /* TCP_CONNTRACK_CLOSE_WAIT, */ + &ip_ct_tcp_timeout_last_ack, /* TCP_CONNTRACK_LAST_ACK, */ + 0, /* TCP_CONNTRACK_LISTEN */ + }; + #define sNO TCP_CONNTRACK_NONE #define sES TCP_CONNTRACK_ESTABLISHED #define sSS TCP_CONNTRACK_SYN_SENT @@ -204,7 +212,7 @@ set_bit(IPS_ASSURED_BIT, &conntrack->status); WRITE_UNLOCK(&tcp_lock); - ip_ct_refresh(conntrack, tcp_timeouts[newconntrack]); + ip_ct_refresh(conntrack, *tcp_timeouts[newconntrack]); } return NF_ACCEPT; diff -Nru a/net/ipv4/netfilter/ip_conntrack_proto_udp.c b/net/ipv4/netfilter/ip_conntrack_proto_udp.c --- a/net/ipv4/netfilter/ip_conntrack_proto_udp.c Sun Oct 5 00:33:05 2003 +++ b/net/ipv4/netfilter/ip_conntrack_proto_udp.c Sun Oct 5 00:33:05 2003 @@ -6,8 +6,8 @@ #include #include -#define UDP_TIMEOUT (30*HZ) -#define UDP_STREAM_TIMEOUT (180*HZ) +unsigned long ip_ct_udp_timeout = 30*HZ; +unsigned long ip_ct_udp_timeout_stream = 180*HZ; static int udp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, @@ -57,11 +57,11 @@ /* If we've seen traffic both ways, this is some kind of UDP stream. Extend timeout. */ if (test_bit(IPS_SEEN_REPLY_BIT, &conntrack->status)) { - ip_ct_refresh(conntrack, UDP_STREAM_TIMEOUT); + ip_ct_refresh(conntrack, ip_ct_udp_timeout_stream); /* Also, more likely to be important, and not a probe */ set_bit(IPS_ASSURED_BIT, &conntrack->status); } else - ip_ct_refresh(conntrack, UDP_TIMEOUT); + ip_ct_refresh(conntrack, ip_ct_udp_timeout); return NF_ACCEPT; } diff -Nru a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c --- a/net/ipv4/netfilter/ip_conntrack_standalone.c Sun Oct 5 00:33:08 2003 +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c Sun Oct 5 00:33:08 2003 @@ -7,6 +7,7 @@ /* (c) 1999 Paul `Rusty' Russell. Licenced under the GNU General Public Licence. */ +#include #include #include #include @@ -14,6 +15,9 @@ #include #include #include +#ifdef CONFIG_SYSCTL +#include +#endif #include #define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_conntrack_lock) @@ -256,6 +260,98 @@ .priority = NF_IP_PRI_LAST-1, }; +/* Sysctl support */ + +#ifdef CONFIG_SYSCTL + +/* From ip_conntrack_core.c */ +extern int ip_conntrack_max; + +/* From ip_conntrack_proto_tcp.c */ +extern unsigned long ip_ct_tcp_timeout_syn_sent; +extern unsigned long ip_ct_tcp_timeout_syn_recv; +extern unsigned long ip_ct_tcp_timeout_established; +extern unsigned long ip_ct_tcp_timeout_fin_wait; +extern unsigned long ip_ct_tcp_timeout_close_wait; +extern unsigned long ip_ct_tcp_timeout_last_ack; +extern unsigned long ip_ct_tcp_timeout_time_wait; +extern unsigned long ip_ct_tcp_timeout_close; + +/* From ip_conntrack_proto_udp.c */ +extern unsigned long ip_ct_udp_timeout; +extern unsigned long ip_ct_udp_timeout_stream; + +/* From ip_conntrack_proto_icmp.c */ +extern unsigned long ip_ct_icmp_timeout; + +/* From ip_conntrack_proto_icmp.c */ +extern unsigned long ip_ct_generic_timeout; + +static struct ctl_table_header *ip_ct_sysctl_header; + +static ctl_table ip_ct_sysctl_table[] = { + {NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max", + &ip_conntrack_max, sizeof(int), 0644, NULL, + &proc_dointvec}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "ip_conntrack_tcp_timeout_syn_sent", + &ip_ct_tcp_timeout_syn_sent, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "ip_conntrack_tcp_timeout_syn_recv", + &ip_ct_tcp_timeout_syn_recv, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "ip_conntrack_tcp_timeout_established", + &ip_ct_tcp_timeout_established, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "ip_conntrack_tcp_timeout_fin_wait", + &ip_ct_tcp_timeout_fin_wait, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "ip_conntrack_tcp_timeout_close_wait", + &ip_ct_tcp_timeout_close_wait, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "ip_conntrack_tcp_timeout_last_ack", + &ip_ct_tcp_timeout_last_ack, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "ip_conntrack_tcp_timeout_time_wait", + &ip_ct_tcp_timeout_time_wait, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "ip_conntrack_tcp_timeout_close", + &ip_ct_tcp_timeout_close, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT, "ip_conntrack_udp_timeout", + &ip_ct_udp_timeout, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "ip_conntrack_udp_timeout_stream", + &ip_ct_udp_timeout_stream, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT, "ip_conntrack_icmp_timeout", + &ip_ct_icmp_timeout, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT, "ip_conntrack_generic_timeout", + &ip_ct_generic_timeout, sizeof(unsigned int), 0644, NULL, + &proc_dointvec_jiffies}, + {0} +}; + +#define NET_IP_CONNTRACK_MAX 2089 + +static ctl_table ip_ct_netfilter_table[] = { + {NET_IPV4_NETFILTER, "netfilter", NULL, 0, 0555, ip_ct_sysctl_table, 0, 0, 0, 0, 0}, + {NET_IP_CONNTRACK_MAX, "ip_conntrack_max", + &ip_conntrack_max, sizeof(int), 0644, NULL, + &proc_dointvec}, + {0} +}; + +static ctl_table ip_ct_ipv4_table[] = { + {NET_IPV4, "ipv4", NULL, 0, 0555, ip_ct_netfilter_table, 0, 0, 0, 0, 0}, + {0} +}; + +static ctl_table ip_ct_net_table[] = { + {CTL_NET, "net", NULL, 0, 0555, ip_ct_ipv4_table, 0, 0, 0, 0, 0}, + {0} +}; +#endif static int init_or_cleanup(int init) { struct proc_dir_entry *proc; @@ -291,10 +387,20 @@ printk("ip_conntrack: can't register local in hook.\n"); goto cleanup_inoutandlocalops; } +#ifdef CONFIG_SYSCTL + ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0); + if (ip_ct_sysctl_header == NULL) { + printk("ip_conntrack: can't register to sysctl.\n"); + goto cleanup; + } +#endif return ret; cleanup: +#ifdef CONFIG_SYSCTL + unregister_sysctl_table(ip_ct_sysctl_header); +#endif nf_unregister_hook(&ip_conntrack_local_in_ops); cleanup_inoutandlocalops: nf_unregister_hook(&ip_conntrack_out_ops); diff -Nru a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c --- a/net/ipv4/netfilter/ip_nat_core.c Sun Oct 5 00:33:06 2003 +++ b/net/ipv4/netfilter/ip_nat_core.c Sun Oct 5 00:33:06 2003 @@ -516,12 +516,14 @@ struct ip_conntrack_tuple new_tuple, inv_tuple, reply; struct ip_conntrack_tuple orig_tp; struct ip_nat_info *info = &conntrack->nat.info; + int in_hashes = info->initialized; MUST_BE_WRITE_LOCKED(&ip_nat_lock); IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING || hooknum == NF_IP_POST_ROUTING || hooknum == NF_IP_LOCAL_OUT); IP_NF_ASSERT(info->num_manips < IP_NAT_MAX_MANIPS); + IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum)))); /* What we've got will look like inverse of reply. Normally this is what is in the conntrack, except for prior @@ -638,6 +640,14 @@ /* It's done. */ info->initialized |= (1 << HOOK2MANIP(hooknum)); + + if (in_hashes) { + IP_NF_ASSERT(info->bysource.conntrack); + replace_in_hashes(conntrack, info); + } else { + place_in_hashes(conntrack, info); + } + return NF_ACCEPT; } @@ -760,11 +770,6 @@ struct ip_nat_helper *helper; enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); int proto = (*pskb)->nh.iph->protocol; - - /* Skip everything and don't call helpers if there are no - * manips for this connection */ - if (info->num_manips == 0) - return NF_ACCEPT; /* Need nat lock to protect against modification, but neither conntrack (referenced) and helper (deleted with diff -Nru a/net/ipv4/netfilter/ip_nat_helper.c b/net/ipv4/netfilter/ip_nat_helper.c --- a/net/ipv4/netfilter/ip_nat_helper.c Sun Oct 5 00:33:06 2003 +++ b/net/ipv4/netfilter/ip_nat_helper.c Sun Oct 5 00:33:06 2003 @@ -122,7 +122,6 @@ /* fix IP hdr checksum information */ skb->nh.iph->tot_len = htons(skb->len); ip_send_check(skb->nh.iph); - skb->csum = csum_partial(data, skb->len - dataoff, 0); } /* Unusual, but possible case. */ @@ -167,6 +166,7 @@ { struct iphdr *iph; struct tcphdr *tcph; + int datalen; if (!skb_ip_make_writable(pskb, (*pskb)->len)) return 0; @@ -184,11 +184,11 @@ mangle_contents(*pskb, iph->ihl*4 + tcph->doff*4, match_offset, match_len, rep_buffer, rep_len); + datalen = (*pskb)->len - iph->ihl*4; tcph->check = 0; - tcph->check = tcp_v4_check(tcph, (*pskb)->len - iph->ihl*4, - iph->saddr, iph->daddr, - csum_partial((char *)tcph, tcph->doff*4, - (*pskb)->csum)); + tcph->check = tcp_v4_check(tcph, datalen, iph->saddr, iph->daddr, + csum_partial((char *)tcph, datalen, 0)); + adjust_tcp_sequence(ntohl(tcph->seq), (int)rep_len - (int)match_len, ct, ctinfo); @@ -216,7 +216,12 @@ { struct iphdr *iph; struct udphdr *udph; - int need_csum = ((*pskb)->csum != 0); + + /* UDP helpers might accidentally mangle the wrong packet */ + iph = (*pskb)->nh.iph; + if ((*pskb)->len < iph->ihl*4 + sizeof(*udph) + + match_offset + match_len) + return 0; if (!skb_ip_make_writable(pskb, (*pskb)->len)) return 0; @@ -235,17 +240,15 @@ udph->len = htons((*pskb)->len - iph->ihl*4); /* fix udp checksum if udp checksum was previously calculated */ - if (need_csum) { + if (udph->check) { + int datalen = (*pskb)->len - iph->ihl * 4; udph->check = 0; - udph->check - = csum_tcpudp_magic(iph->saddr, iph->daddr, - (*pskb)->len - iph->ihl*4, - IPPROTO_UDP, - csum_partial((char *)udph, - sizeof(struct udphdr), - (*pskb)->csum)); - } else - (*pskb)->csum = 0; + udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, + datalen, IPPROTO_UDP, + csum_partial((char *)udph, + datalen, 0)); + } + return 1; } diff -Nru a/net/ipv4/netfilter/ip_nat_rule.c b/net/ipv4/netfilter/ip_nat_rule.c --- a/net/ipv4/netfilter/ip_nat_rule.c Sun Oct 5 00:33:08 2003 +++ b/net/ipv4/netfilter/ip_nat_rule.c Sun Oct 5 00:33:08 2003 @@ -233,7 +233,7 @@ return 1; } -static inline unsigned int +inline unsigned int alloc_null_binding(struct ip_conntrack *conntrack, struct ip_nat_info *info, unsigned int hooknum) diff -Nru a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c --- a/net/ipv4/netfilter/ip_nat_standalone.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/netfilter/ip_nat_standalone.c Sun Oct 5 00:33:09 2003 @@ -119,7 +119,6 @@ /* Seen it before? This can happen for loopback, retrans, or local packets.. */ if (!(info->initialized & (1 << maniptype))) { - int in_hashes = info->initialized; unsigned int ret; if (ct->master @@ -130,9 +129,10 @@ } else { #ifdef CONFIG_IP_NF_NAT_LOCAL /* LOCAL_IN hook doesn't have a chain! */ - if (hooknum == NF_IP_LOCAL_IN) { - ret = NF_ACCEPT; - } else + if (hooknum == NF_IP_LOCAL_IN) + ret = alloc_null_binding(ct, info, + hooknum); + else #endif ret = ip_nat_rule_find(pskb, hooknum, in, out, ct, info); @@ -142,13 +142,6 @@ WRITE_UNLOCK(&ip_nat_lock); return ret; } - - if (in_hashes) { - IP_NF_ASSERT(info->bysource.conntrack); - replace_in_hashes(ct, info); - } else { - place_in_hashes(ct, info); - } } else DEBUGP("Already setup manip %s for ct %p\n", maniptype == IP_NAT_MANIP_SRC ? "SRC" : "DST", @@ -199,6 +192,7 @@ return ip_nat_fn(hooknum, pskb, in, out, okfn); } +#ifdef CONFIG_IP_NF_NAT_LOCAL static unsigned int ip_nat_local_fn(unsigned int hooknum, struct sk_buff **pskb, @@ -224,6 +218,7 @@ return ip_route_me_harder(pskb) == 0 ? ret : NF_DROP; return ret; } +#endif /* We must be after connection tracking and before packet filtering. */ @@ -245,6 +240,7 @@ .priority = NF_IP_PRI_NAT_SRC, }; +#ifdef CONFIG_IP_NF_NAT_LOCAL /* Before packet filtering, change destination */ static struct nf_hook_ops ip_nat_local_out_ops = { .hook = ip_nat_local_fn, @@ -254,7 +250,7 @@ .priority = NF_IP_PRI_NAT_DST, }; -#ifdef CONFIG_IP_NF_NAT_LOCAL +/* After packet filtering, change source for reply packets of LOCAL_OUT DNAT */ static struct nf_hook_ops ip_nat_local_in_ops = { .hook = ip_nat_fn, .owner = THIS_MODULE, @@ -324,12 +320,12 @@ printk("ip_nat_init: can't register out hook.\n"); goto cleanup_inops; } +#ifdef CONFIG_IP_NF_NAT_LOCAL ret = nf_register_hook(&ip_nat_local_out_ops); if (ret < 0) { printk("ip_nat_init: can't register local out hook.\n"); goto cleanup_outops; } -#ifdef CONFIG_IP_NF_NAT_LOCAL ret = nf_register_hook(&ip_nat_local_in_ops); if (ret < 0) { printk("ip_nat_init: can't register local in hook.\n"); @@ -342,9 +338,9 @@ #ifdef CONFIG_IP_NF_NAT_LOCAL nf_unregister_hook(&ip_nat_local_in_ops); cleanup_localoutops: -#endif nf_unregister_hook(&ip_nat_local_out_ops); cleanup_outops: +#endif nf_unregister_hook(&ip_nat_out_ops); cleanup_inops: nf_unregister_hook(&ip_nat_in_ops); diff -Nru a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c --- a/net/ipv4/netfilter/ipt_REJECT.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/netfilter/ipt_REJECT.c Sun Oct 5 00:33:09 2003 @@ -40,16 +40,17 @@ } } -static inline struct rtable *route_reverse(struct sk_buff *skb, int local) +static inline struct rtable *route_reverse(struct sk_buff *skb, int hook) { struct iphdr *iph = skb->nh.iph; struct dst_entry *odst; struct flowi fl = {}; struct rtable *rt; - if (local) { + if (hook != NF_IP_FORWARD) { fl.nl_u.ip4_u.daddr = iph->saddr; - fl.nl_u.ip4_u.saddr = iph->daddr; + if (hook == NF_IP_LOCAL_IN) + fl.nl_u.ip4_u.saddr = iph->daddr; fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); if (ip_route_output_key(&rt, &fl) != 0) @@ -81,7 +82,7 @@ } /* Send RST reply */ -static void send_reset(struct sk_buff *oldskb, int local) +static void send_reset(struct sk_buff *oldskb, int hook) { struct sk_buff *nskb; struct tcphdr otcph, *tcph; @@ -104,7 +105,7 @@ return; /* FIXME: Check checksum --RR */ - if ((rt = route_reverse(oldskb, local)) == NULL) + if ((rt = route_reverse(oldskb, hook)) == NULL) return; hh_len = (rt->u.dst.dev->hard_header_len + 15)&~15; @@ -390,7 +391,7 @@ send_unreach(*pskb, ICMP_PKT_FILTERED); break; case IPT_TCP_RESET: - send_reset(*pskb, hooknum == NF_IP_LOCAL_IN); + send_reset(*pskb, hooknum); case IPT_ICMP_ECHOREPLY: /* Doesn't happen. */ break; diff -Nru a/net/ipv4/protocol.c b/net/ipv4/protocol.c --- a/net/ipv4/protocol.c Sun Oct 5 00:33:06 2003 +++ b/net/ipv4/protocol.c Sun Oct 5 00:33:06 2003 @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -95,3 +96,6 @@ return ret; } + +EXPORT_SYMBOL(inet_add_protocol); +EXPORT_SYMBOL(inet_del_protocol); diff -Nru a/net/ipv4/route.c b/net/ipv4/route.c --- a/net/ipv4/route.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/route.c Sun Oct 5 00:33:10 2003 @@ -62,6 +62,7 @@ */ #include +#include #include #include #include @@ -2823,3 +2824,7 @@ rc = -ENOMEM; goto out; } + +EXPORT_SYMBOL(__ip_select_ident); +EXPORT_SYMBOL(ip_route_input); +EXPORT_SYMBOL(ip_route_output_key); diff -Nru a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c --- a/net/ipv4/sysctl_net_ipv4.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/sysctl_net_ipv4.c Sun Oct 5 00:33:09 2003 @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -587,3 +588,5 @@ }; #endif /* CONFIG_SYSCTL */ + +EXPORT_SYMBOL(ipv4_config); diff -Nru a/net/ipv4/tcp.c b/net/ipv4/tcp.c --- a/net/ipv4/tcp.c Sun Oct 5 00:33:07 2003 +++ b/net/ipv4/tcp.c Sun Oct 5 00:33:07 2003 @@ -248,6 +248,7 @@ */ #include +#include #include #include #include @@ -2682,3 +2683,26 @@ tcpdiag_init(); } + +EXPORT_SYMBOL(__tcp_mem_reclaim); +EXPORT_SYMBOL(sysctl_tcp_rmem); +EXPORT_SYMBOL(sysctl_tcp_wmem); +EXPORT_SYMBOL(tcp_accept); +EXPORT_SYMBOL(tcp_close); +EXPORT_SYMBOL(tcp_close_state); +EXPORT_SYMBOL(tcp_destroy_sock); +EXPORT_SYMBOL(tcp_disconnect); +EXPORT_SYMBOL(tcp_getsockopt); +EXPORT_SYMBOL(tcp_ioctl); +EXPORT_SYMBOL(tcp_openreq_cachep); +EXPORT_SYMBOL(tcp_poll); +EXPORT_SYMBOL(tcp_read_sock); +EXPORT_SYMBOL(tcp_recvmsg); +EXPORT_SYMBOL(tcp_sendmsg); +EXPORT_SYMBOL(tcp_sendpage); +EXPORT_SYMBOL(tcp_setsockopt); +EXPORT_SYMBOL(tcp_shutdown); +EXPORT_SYMBOL(tcp_sockets_allocated); +EXPORT_SYMBOL(tcp_statistics); +EXPORT_SYMBOL(tcp_timewait_cachep); +EXPORT_SYMBOL(tcp_write_space); diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/tcp_input.c Sun Oct 5 00:33:09 2003 @@ -65,6 +65,7 @@ #include #include +#include #include #include #include @@ -4089,3 +4090,10 @@ } return 0; } + +EXPORT_SYMBOL(sysctl_tcp_ecn); +EXPORT_SYMBOL(sysctl_tcp_reordering); +EXPORT_SYMBOL(tcp_cwnd_application_limited); +EXPORT_SYMBOL(tcp_parse_options); +EXPORT_SYMBOL(tcp_rcv_established); +EXPORT_SYMBOL(tcp_rcv_state_process); diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c --- a/net/ipv4/tcp_ipv4.c Sun Oct 5 00:33:07 2003 +++ b/net/ipv4/tcp_ipv4.c Sun Oct 5 00:33:07 2003 @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -2644,3 +2645,32 @@ */ tcp_socket->sk->sk_prot->unhash(tcp_socket->sk); } + +EXPORT_SYMBOL(ipv4_specific); +EXPORT_SYMBOL(tcp_bind_hash); +EXPORT_SYMBOL(tcp_bucket_create); +EXPORT_SYMBOL(tcp_hashinfo); +EXPORT_SYMBOL(tcp_inherit_port); +EXPORT_SYMBOL(tcp_listen_wlock); +EXPORT_SYMBOL(tcp_port_rover); +EXPORT_SYMBOL(tcp_prot); +EXPORT_SYMBOL(tcp_put_port); +EXPORT_SYMBOL(tcp_unhash); +EXPORT_SYMBOL(tcp_v4_conn_request); +EXPORT_SYMBOL(tcp_v4_connect); +EXPORT_SYMBOL(tcp_v4_do_rcv); +EXPORT_SYMBOL(tcp_v4_lookup_listener); +EXPORT_SYMBOL(tcp_v4_rebuild_header); +EXPORT_SYMBOL(tcp_v4_remember_stamp); +EXPORT_SYMBOL(tcp_v4_send_check); +EXPORT_SYMBOL(tcp_v4_syn_recv_sock); + +#ifdef CONFIG_PROC_FS +EXPORT_SYMBOL(tcp_proc_register); +EXPORT_SYMBOL(tcp_proc_unregister); +#endif +#ifdef CONFIG_SYSCTL +EXPORT_SYMBOL(sysctl_local_port_range); +EXPORT_SYMBOL(sysctl_max_syn_backlog); +EXPORT_SYMBOL(sysctl_tcp_low_latency); +#endif diff -Nru a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c --- a/net/ipv4/tcp_minisocks.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/tcp_minisocks.c Sun Oct 5 00:33:09 2003 @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -1053,3 +1054,13 @@ sock_put(child); return ret; } + +EXPORT_SYMBOL(tcp_check_req); +EXPORT_SYMBOL(tcp_child_process); +EXPORT_SYMBOL(tcp_create_openreq_child); +EXPORT_SYMBOL(tcp_timewait_state_process); +EXPORT_SYMBOL(tcp_tw_deschedule); + +#ifdef CONFIG_SYSCTL +EXPORT_SYMBOL(sysctl_tcp_tw_recycle); +#endif diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c Sun Oct 5 00:33:09 2003 +++ b/net/ipv4/tcp_output.c Sun Oct 5 00:33:09 2003 @@ -39,6 +39,7 @@ #include #include +#include #include /* People can turn this off for buggy TCP's found in printers etc. */ @@ -1542,3 +1543,14 @@ min(tp->rto << tp->backoff, TCP_RESOURCE_PROBE_INTERVAL)); } } + +EXPORT_SYMBOL(tcp_acceptable_seq); +EXPORT_SYMBOL(tcp_connect); +EXPORT_SYMBOL(tcp_connect_init); +EXPORT_SYMBOL(tcp_make_synack); +EXPORT_SYMBOL(tcp_send_synack); +EXPORT_SYMBOL(tcp_simple_retransmit); +EXPORT_SYMBOL(tcp_sync_mss); +EXPORT_SYMBOL(tcp_transmit_skb); +EXPORT_SYMBOL(tcp_write_wakeup); +EXPORT_SYMBOL(tcp_write_xmit); diff -Nru a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c --- a/net/ipv4/tcp_timer.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv4/tcp_timer.c Sun Oct 5 00:33:10 2003 @@ -20,6 +20,7 @@ * Jorge Cwik, */ +#include #include int sysctl_tcp_syn_retries = TCP_SYN_RETRIES; @@ -656,3 +657,8 @@ bh_unlock_sock(sk); sock_put(sk); } + +EXPORT_SYMBOL(tcp_clear_xmit_timers); +EXPORT_SYMBOL(tcp_delete_keepalive_timer); +EXPORT_SYMBOL(tcp_init_xmit_timers); +EXPORT_SYMBOL(tcp_reset_keepalive_timer); diff -Nru a/net/ipv4/udp.c b/net/ipv4/udp.c --- a/net/ipv4/udp.c Sun Oct 5 00:33:06 2003 +++ b/net/ipv4/udp.c Sun Oct 5 00:33:07 2003 @@ -83,6 +83,7 @@ #include #include #include +#include #include #include #include @@ -1532,3 +1533,17 @@ udp_proc_unregister(&udp4_seq_afinfo); } #endif /* CONFIG_PROC_FS */ + +EXPORT_SYMBOL(udp_connect); +EXPORT_SYMBOL(udp_disconnect); +EXPORT_SYMBOL(udp_hash); +EXPORT_SYMBOL(udp_hash_lock); +EXPORT_SYMBOL(udp_ioctl); +EXPORT_SYMBOL(udp_port_rover); +EXPORT_SYMBOL(udp_prot); +EXPORT_SYMBOL(udp_sendmsg); + +#ifdef CONFIG_PROC_FS +EXPORT_SYMBOL(udp_proc_register); +EXPORT_SYMBOL(udp_proc_unregister); +#endif diff -Nru a/net/ipv4/utils.c b/net/ipv4/utils.c --- a/net/ipv4/utils.c Sun Oct 5 00:33:08 2003 +++ b/net/ipv4/utils.c Sun Oct 5 00:33:08 2003 @@ -21,6 +21,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include @@ -55,3 +56,4 @@ return(htonl(l)); } +EXPORT_SYMBOL(in_aton); diff -Nru a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c --- a/net/ipv4/xfrm4_tunnel.c Sun Oct 5 00:33:06 2003 +++ b/net/ipv4/xfrm4_tunnel.c Sun Oct 5 00:33:06 2003 @@ -169,6 +169,7 @@ static struct inet_protocol ipip_protocol = { .handler = ipip_rcv, .err_handler = ipip_err, + .no_policy = 1, }; static int __init ipip_init(void) diff -Nru a/net/ipv6/netfilter/ip6t_ipv6header.c b/net/ipv6/netfilter/ip6t_ipv6header.c --- a/net/ipv6/netfilter/ip6t_ipv6header.c Sun Oct 5 00:33:10 2003 +++ b/net/ipv6/netfilter/ip6t_ipv6header.c Sun Oct 5 00:33:10 2003 @@ -126,18 +126,11 @@ return 1; } -static void -ipv6header_destroy(void *matchinfo, - unsigned int matchinfosize) -{ - return; -} - static struct ip6t_match ip6t_ipv6header_match = { .name = "ipv6header", .match = &ipv6header_match, .checkentry = &ipv6header_checkentry, - .destroy = &ipv6header_destroy, + .destroy = NULL, .me = THIS_MODULE, }; diff -Nru a/net/irda/irda_device.c b/net/irda/irda_device.c --- a/net/irda/irda_device.c Sun Oct 5 00:33:08 2003 +++ b/net/irda/irda_device.c Sun Oct 5 00:33:08 2003 @@ -85,7 +85,7 @@ int __init irda_device_init( void) { - dongles = hashbin_new(HB_LOCK); + dongles = hashbin_new(HB_NOLOCK); if (dongles == NULL) { printk(KERN_WARNING "IrDA: Can't allocate dongles hashbin!\n"); return -ENOMEM; @@ -109,7 +109,9 @@ IRDA_DEBUG(4, "%s()\n", __FUNCTION__); hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete); + spin_lock(&dongles->hb_spinlock); hashbin_delete(dongles, NULL); + spin_unlock(&dongles->hb_spinlock); } /* @@ -378,8 +380,6 @@ dev->hard_header_len = 0; dev->addr_len = 0; - dev->destructor = free_netdev; - dev->type = ARPHRD_IRDA; dev->tx_queue_len = 8; /* Window size + 1 s-frame */ @@ -390,6 +390,17 @@ } /* + * Funciton alloc_irdadev + * Allocates and sets up an IRDA device in a manner similar to + * alloc_etherdev. + */ +struct net_device *alloc_irdadev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup); +} + + +/* * Function irda_device_txqueue_empty (dev) * * Check if there is still some frames in the transmit queue for this @@ -415,25 +426,34 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type) { struct dongle_reg *reg; - dongle_t *dongle; + dongle_t *dongle = NULL; + + might_sleep(); - ASSERT(dev != NULL, return NULL;); + spin_lock(&dongles->hb_spinlock); + reg = hashbin_find(dongles, type, NULL); #ifdef CONFIG_KMOD - ASSERT(!in_interrupt(), return NULL;); /* Try to load the module needed */ - request_module("irda-dongle-%d", type); + if (!reg && capable(CAP_SYS_MODULE)) { + spin_unlock(&dongles->hb_spinlock); + + request_module("irda-dongle-%d", type); + + spin_lock(&dongles->hb_spinlock); + reg = hashbin_find(dongles, type, NULL); + } #endif - if (!(reg = hashbin_lock_find(dongles, type, NULL))) { - ERROR("IrDA: Unable to find requested dongle\n"); - return NULL; + if (!reg || !try_module_get(reg->owner) ) { + ERROR("IrDA: Unable to find requested dongle type %x\n", type); + goto out; } /* Allocate dongle info for this instance */ dongle = kmalloc(sizeof(dongle_t), GFP_KERNEL); if (!dongle) - return NULL; + goto out; memset(dongle, 0, sizeof(dongle_t)); @@ -441,6 +461,8 @@ dongle->issue = reg; dongle->dev = dev; + out: + spin_unlock(&dongles->hb_spinlock); return dongle; } @@ -452,7 +474,7 @@ ASSERT(dongle != NULL, return -1;); dongle->issue->close(dongle); - + module_put(dongle->issue->owner); kfree(dongle); return 0; @@ -463,14 +485,16 @@ */ int irda_device_register_dongle(struct dongle_reg *new) { + spin_lock(&dongles->hb_spinlock); /* Check if this dongle has been registered before */ - if (hashbin_lock_find(dongles, new->type, NULL)) { - MESSAGE("%s: Dongle already registered\n", __FUNCTION__); - return 0; - } - - /* Insert IrDA dongle into hashbin */ - hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL); + if (hashbin_find(dongles, new->type, NULL)) { + MESSAGE("%s: Dongle type %x already registered\n", + __FUNCTION__, new->type); + } else { + /* Insert IrDA dongle into hashbin */ + hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL); + } + spin_unlock(&dongles->hb_spinlock); return 0; } @@ -485,11 +509,11 @@ { struct dongle *node; + spin_lock(&dongles->hb_spinlock); node = hashbin_remove(dongles, dongle->type, NULL); - if (!node) { + if (!node) ERROR("%s: dongle not found!\n", __FUNCTION__); - return; - } + spin_unlock(&dongles->hb_spinlock); } /* diff -Nru a/net/irda/irsyms.c b/net/irda/irsyms.c --- a/net/irda/irsyms.c Sun Oct 5 00:33:10 2003 +++ b/net/irda/irsyms.c Sun Oct 5 00:33:10 2003 @@ -150,6 +150,7 @@ EXPORT_SYMBOL(irda_init_max_qos_capabilies); EXPORT_SYMBOL(irda_qos_bits_to_value); EXPORT_SYMBOL(irda_device_setup); +EXPORT_SYMBOL(alloc_irdadev); EXPORT_SYMBOL(irda_device_set_media_busy); EXPORT_SYMBOL(irda_device_txqueue_empty); diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c --- a/net/netlink/af_netlink.c Sun Oct 5 00:33:08 2003 +++ b/net/netlink/af_netlink.c Sun Oct 5 00:33:08 2003 @@ -1133,4 +1133,22 @@ module_exit(netlink_proto_exit); MODULE_LICENSE("GPL"); + MODULE_ALIAS_NETPROTO(PF_NETLINK); + +EXPORT_SYMBOL(netlink_ack); +EXPORT_SYMBOL(netlink_broadcast); +EXPORT_SYMBOL(netlink_broadcast_deliver); +EXPORT_SYMBOL(netlink_dump_start); +EXPORT_SYMBOL(netlink_kernel_create); +EXPORT_SYMBOL(netlink_register_notifier); +EXPORT_SYMBOL(netlink_set_err); +EXPORT_SYMBOL(netlink_set_nonroot); +EXPORT_SYMBOL(netlink_unicast); +EXPORT_SYMBOL(netlink_unregister_notifier); + +#if defined(CONFIG_NETLINK_DEV) || defined(CONFIG_NETLINK_DEV_MODULE) +EXPORT_SYMBOL(netlink_attach); +EXPORT_SYMBOL(netlink_detach); +EXPORT_SYMBOL(netlink_post); +#endif diff -Nru a/net/netsyms.c b/net/netsyms.c --- a/net/netsyms.c Sun Oct 5 00:33:08 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,640 +0,0 @@ -/* - * linux/net/netsyms.c - * - * Symbol table for the linux networking subsystem. Moved here to - * make life simpler in ksyms.c. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_HIPPI -#include -#endif -#include -#include -#include -#include -#include -#ifdef CONFIG_NET_DIVERT -#include -#endif /* CONFIG_NET_DIVERT */ - -#ifdef CONFIG_NET -extern __u32 sysctl_wmem_max; -extern __u32 sysctl_rmem_max; -#endif - -#ifdef CONFIG_INET -#include -#include -#include -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE) -#include -#endif -#if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE) -#include -#endif - -extern struct net_proto_family inet_family_ops; - -#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) \ - || defined (CONFIG_IP_SCTP_MODULE) -#include -#include -#include -#include -#include -#include - -extern int sysctl_local_port_range[2]; -extern int tcp_port_rover; -extern int udp_port_rover; -#endif - -#endif - -#include - -#ifdef CONFIG_IPX_MODULE -extern struct datalink_proto *make_EII_client(void); -extern struct datalink_proto *make_8023_client(void); -extern void destroy_EII_client(struct datalink_proto *); -extern void destroy_8023_client(struct datalink_proto *); -#endif - -#ifdef CONFIG_ATALK_MODULE -#include -#endif - -#ifdef CONFIG_SYSCTL -extern int sysctl_max_syn_backlog; -#endif - -/* Skbuff symbols. */ -EXPORT_SYMBOL(skb_over_panic); -EXPORT_SYMBOL(skb_under_panic); - -/* Socket layer registration */ -EXPORT_SYMBOL(sock_register); -EXPORT_SYMBOL(sock_unregister); - -/* Socket locking */ -EXPORT_SYMBOL(__lock_sock); -EXPORT_SYMBOL(__release_sock); - -/* Socket layer support routines */ -EXPORT_SYMBOL(memcpy_fromiovec); -EXPORT_SYMBOL(memcpy_tokerneliovec); -EXPORT_SYMBOL(sock_create); -EXPORT_SYMBOL(sock_alloc); -EXPORT_SYMBOL(sock_release); -EXPORT_SYMBOL(sock_setsockopt); -EXPORT_SYMBOL(sock_getsockopt); -EXPORT_SYMBOL(sock_sendmsg); -EXPORT_SYMBOL(sock_recvmsg); -EXPORT_SYMBOL(sk_alloc); -EXPORT_SYMBOL(sk_free); -EXPORT_SYMBOL(sk_send_sigurg); -EXPORT_SYMBOL(sock_wake_async); -EXPORT_SYMBOL(sock_alloc_send_skb); -EXPORT_SYMBOL(sock_alloc_send_pskb); -EXPORT_SYMBOL(sock_init_data); -EXPORT_SYMBOL(sock_no_release); -EXPORT_SYMBOL(sock_no_bind); -EXPORT_SYMBOL(sock_no_connect); -EXPORT_SYMBOL(sock_no_socketpair); -EXPORT_SYMBOL(sock_no_accept); -EXPORT_SYMBOL(sock_no_getname); -EXPORT_SYMBOL(sock_no_poll); -EXPORT_SYMBOL(sock_no_ioctl); -EXPORT_SYMBOL(sock_no_listen); -EXPORT_SYMBOL(sock_no_shutdown); -EXPORT_SYMBOL(sock_no_getsockopt); -EXPORT_SYMBOL(sock_no_setsockopt); -EXPORT_SYMBOL(sock_no_sendmsg); -EXPORT_SYMBOL(sock_no_recvmsg); -EXPORT_SYMBOL(sock_no_mmap); -EXPORT_SYMBOL(sock_no_sendpage); -EXPORT_SYMBOL(sock_rfree); -EXPORT_SYMBOL(sock_wfree); -EXPORT_SYMBOL(sock_wmalloc); -EXPORT_SYMBOL(sock_rmalloc); -EXPORT_SYMBOL(__skb_linearize); -EXPORT_SYMBOL(skb_checksum); -EXPORT_SYMBOL(skb_checksum_help); -EXPORT_SYMBOL(skb_recv_datagram); -EXPORT_SYMBOL(skb_free_datagram); -EXPORT_SYMBOL(skb_copy_datagram); -EXPORT_SYMBOL(skb_copy_datagram_iovec); -EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec); -EXPORT_SYMBOL(skb_copy_bits); -EXPORT_SYMBOL(skb_copy_and_csum_bits); -EXPORT_SYMBOL(skb_copy_and_csum_dev); -EXPORT_SYMBOL(skb_copy_expand); -EXPORT_SYMBOL(___pskb_trim); -EXPORT_SYMBOL(__pskb_pull_tail); -EXPORT_SYMBOL(pskb_expand_head); -EXPORT_SYMBOL(pskb_copy); -EXPORT_SYMBOL(skb_realloc_headroom); -EXPORT_SYMBOL(datagram_poll); -EXPORT_SYMBOL(put_cmsg); -EXPORT_SYMBOL(sock_kmalloc); -EXPORT_SYMBOL(sock_kfree_s); -EXPORT_SYMBOL(sock_map_fd); -EXPORT_SYMBOL(sockfd_lookup); - -EXPORT_SYMBOL(sk_run_filter); -EXPORT_SYMBOL(sk_chk_filter); - -EXPORT_SYMBOL(neigh_table_init); -EXPORT_SYMBOL(neigh_table_clear); -EXPORT_SYMBOL(neigh_resolve_output); -EXPORT_SYMBOL(neigh_connected_output); -EXPORT_SYMBOL(neigh_update); -EXPORT_SYMBOL(neigh_create); -EXPORT_SYMBOL(neigh_lookup); -EXPORT_SYMBOL(__neigh_event_send); -EXPORT_SYMBOL(neigh_event_ns); -EXPORT_SYMBOL(neigh_ifdown); -#ifdef CONFIG_ARPD -EXPORT_SYMBOL(neigh_app_ns); -#endif -#ifdef CONFIG_SYSCTL -EXPORT_SYMBOL(neigh_sysctl_register); -EXPORT_SYMBOL(neigh_sysctl_unregister); -#endif -EXPORT_SYMBOL(pneigh_lookup); -EXPORT_SYMBOL(pneigh_enqueue); -EXPORT_SYMBOL(neigh_destroy); -EXPORT_SYMBOL(neigh_parms_alloc); -EXPORT_SYMBOL(neigh_parms_release); -EXPORT_SYMBOL(neigh_rand_reach_time); -EXPORT_SYMBOL(neigh_compat_output); -EXPORT_SYMBOL(neigh_changeaddr); - -/* dst_entry */ -EXPORT_SYMBOL(dst_alloc); -EXPORT_SYMBOL(__dst_free); -EXPORT_SYMBOL(dst_destroy); - -/* misc. support routines */ -EXPORT_SYMBOL(net_ratelimit); -EXPORT_SYMBOL(net_random); -EXPORT_SYMBOL(net_srandom); - -/* Needed by smbfs.o */ -EXPORT_SYMBOL(__scm_destroy); -EXPORT_SYMBOL(__scm_send); - -/* Needed by unix.o */ -EXPORT_SYMBOL(scm_fp_dup); -EXPORT_SYMBOL(files_stat); -EXPORT_SYMBOL(memcpy_toiovec); - -#ifdef CONFIG_IPX_MODULE -EXPORT_SYMBOL(make_8023_client); -EXPORT_SYMBOL(destroy_8023_client); -EXPORT_SYMBOL(make_EII_client); -EXPORT_SYMBOL(destroy_EII_client); -#endif - -/* for 801q VLAN support */ -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) -EXPORT_SYMBOL(dev_change_flags); -#endif - -EXPORT_SYMBOL(scm_detach_fds); - -#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) -EXPORT_SYMBOL(br_handle_frame_hook); -#endif - -#ifdef CONFIG_NET_DIVERT -EXPORT_SYMBOL(alloc_divert_blk); -EXPORT_SYMBOL(free_divert_blk); -#endif /* CONFIG_NET_DIVERT */ - -#ifdef CONFIG_INET -/* Internet layer registration */ -EXPORT_SYMBOL(inetdev_lock); -EXPORT_SYMBOL(inet_add_protocol); -EXPORT_SYMBOL(inet_del_protocol); -EXPORT_SYMBOL(inet_register_protosw); -EXPORT_SYMBOL(inet_unregister_protosw); -EXPORT_SYMBOL(ip_route_output_key); -EXPORT_SYMBOL(ip_route_input); -EXPORT_SYMBOL(icmp_send); -EXPORT_SYMBOL(icmp_statistics); -EXPORT_SYMBOL(icmp_err_convert); -EXPORT_SYMBOL(ip_options_compile); -EXPORT_SYMBOL(ip_options_undo); -EXPORT_SYMBOL(arp_send); -EXPORT_SYMBOL(arp_broken_ops); -EXPORT_SYMBOL(__ip_select_ident); -EXPORT_SYMBOL(ip_send_check); -EXPORT_SYMBOL(ip_fragment); -EXPORT_SYMBOL(inet_family_ops); -EXPORT_SYMBOL(in_aton); -EXPORT_SYMBOL(ip_mc_inc_group); -EXPORT_SYMBOL(ip_mc_dec_group); -EXPORT_SYMBOL(ip_mc_join_group); -EXPORT_SYMBOL(ip_finish_output); -EXPORT_SYMBOL(inet_stream_ops); -EXPORT_SYMBOL(inet_dgram_ops); -EXPORT_SYMBOL(ip_cmsg_recv); -EXPORT_SYMBOL(inet_addr_type); -EXPORT_SYMBOL(inet_select_addr); -EXPORT_SYMBOL(ip_dev_find); -EXPORT_SYMBOL(inetdev_by_index); -EXPORT_SYMBOL(in_dev_finish_destroy); -EXPORT_SYMBOL(ip_defrag); -EXPORT_SYMBOL(inet_peer_idlock); - -/* Route manipulation */ -EXPORT_SYMBOL(ip_rt_ioctl); -EXPORT_SYMBOL(devinet_ioctl); -EXPORT_SYMBOL(register_inetaddr_notifier); -EXPORT_SYMBOL(unregister_inetaddr_notifier); - -/* proc */ -#ifdef CONFIG_PROC_FS -EXPORT_SYMBOL(udp_proc_register); -EXPORT_SYMBOL(udp_proc_unregister); -EXPORT_SYMBOL(tcp_proc_register); -EXPORT_SYMBOL(tcp_proc_unregister); -#endif - -/* needed for ip_gre -cw */ -EXPORT_SYMBOL(ip_statistics); -#if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE) -EXPORT_SYMBOL_GPL(skb_cow_data); -EXPORT_SYMBOL_GPL(pskb_put); -EXPORT_SYMBOL_GPL(skb_to_sgvec); -#endif - -EXPORT_SYMBOL(flow_cache_lookup); -EXPORT_SYMBOL(flow_cache_genid); - -#if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_IP_SCTP_MODULE) -/* inet functions common to v4 and v6 */ -EXPORT_SYMBOL(inet_release); -EXPORT_SYMBOL(inet_stream_connect); -EXPORT_SYMBOL(inet_dgram_connect); -EXPORT_SYMBOL(inet_accept); -EXPORT_SYMBOL(inet_listen); -EXPORT_SYMBOL(inet_shutdown); -EXPORT_SYMBOL(inet_setsockopt); -EXPORT_SYMBOL(inet_getsockopt); -EXPORT_SYMBOL(inet_sendmsg); -EXPORT_SYMBOL(inet_recvmsg); -#ifdef INET_REFCNT_DEBUG -EXPORT_SYMBOL(inet_sock_nr); -#endif -EXPORT_SYMBOL(inet_sock_destruct); -EXPORT_SYMBOL(inet_sock_release); - -/* Socket demultiplexing. */ -EXPORT_SYMBOL(tcp_hashinfo); -EXPORT_SYMBOL(tcp_listen_wlock); -EXPORT_SYMBOL(udp_hash); -EXPORT_SYMBOL(udp_hash_lock); - -EXPORT_SYMBOL(tcp_destroy_sock); -EXPORT_SYMBOL(ip_queue_xmit); -EXPORT_SYMBOL(memcpy_fromiovecend); -EXPORT_SYMBOL(csum_partial_copy_fromiovecend); -EXPORT_SYMBOL(tcp_v4_lookup_listener); -/* UDP/TCP exported functions for TCPv6 */ -EXPORT_SYMBOL(udp_ioctl); -EXPORT_SYMBOL(udp_connect); -EXPORT_SYMBOL(udp_disconnect); -EXPORT_SYMBOL(udp_sendmsg); -EXPORT_SYMBOL(tcp_bind_hash); -EXPORT_SYMBOL(tcp_close); -EXPORT_SYMBOL(tcp_disconnect); -EXPORT_SYMBOL(tcp_accept); -EXPORT_SYMBOL(tcp_write_wakeup); -EXPORT_SYMBOL(tcp_write_space); -EXPORT_SYMBOL(tcp_poll); -EXPORT_SYMBOL(tcp_ioctl); -EXPORT_SYMBOL(tcp_shutdown); -EXPORT_SYMBOL(tcp_setsockopt); -EXPORT_SYMBOL(tcp_getsockopt); -EXPORT_SYMBOL(tcp_recvmsg); -EXPORT_SYMBOL(tcp_send_synack); -EXPORT_SYMBOL(tcp_check_req); -EXPORT_SYMBOL(tcp_child_process); -EXPORT_SYMBOL(tcp_parse_options); -EXPORT_SYMBOL(tcp_rcv_established); -EXPORT_SYMBOL(tcp_init_xmit_timers); -EXPORT_SYMBOL(tcp_clear_xmit_timers); -EXPORT_SYMBOL(tcp_statistics); -EXPORT_SYMBOL(tcp_rcv_state_process); -EXPORT_SYMBOL(tcp_timewait_state_process); -EXPORT_SYMBOL(tcp_timewait_cachep); -EXPORT_SYMBOL(tcp_sendmsg); -EXPORT_SYMBOL(tcp_v4_rebuild_header); -EXPORT_SYMBOL(tcp_v4_send_check); -EXPORT_SYMBOL(tcp_v4_conn_request); -EXPORT_SYMBOL(tcp_create_openreq_child); -EXPORT_SYMBOL(tcp_bucket_create); -EXPORT_SYMBOL(tcp_put_port); -EXPORT_SYMBOL(tcp_inherit_port); -EXPORT_SYMBOL(tcp_v4_syn_recv_sock); -EXPORT_SYMBOL(tcp_v4_do_rcv); -EXPORT_SYMBOL(tcp_v4_connect); -EXPORT_SYMBOL(tcp_unhash); -EXPORT_SYMBOL(udp_prot); -EXPORT_SYMBOL(tcp_prot); -EXPORT_SYMBOL(tcp_openreq_cachep); -EXPORT_SYMBOL(ipv4_specific); -EXPORT_SYMBOL(tcp_simple_retransmit); -EXPORT_SYMBOL(tcp_transmit_skb); -EXPORT_SYMBOL(tcp_connect); -EXPORT_SYMBOL(tcp_make_synack); -EXPORT_SYMBOL(tcp_tw_deschedule); -EXPORT_SYMBOL(tcp_delete_keepalive_timer); -EXPORT_SYMBOL(tcp_reset_keepalive_timer); -EXPORT_SYMBOL(sysctl_local_port_range); -EXPORT_SYMBOL(tcp_port_rover); -EXPORT_SYMBOL(udp_port_rover); -EXPORT_SYMBOL(tcp_sync_mss); -EXPORT_SYMBOL(net_statistics); -EXPORT_SYMBOL(__tcp_mem_reclaim); -EXPORT_SYMBOL(tcp_sockets_allocated); -EXPORT_SYMBOL(sysctl_tcp_reordering); -EXPORT_SYMBOL(sysctl_tcp_rmem); -EXPORT_SYMBOL(sysctl_tcp_wmem); -EXPORT_SYMBOL(sysctl_tcp_ecn); -EXPORT_SYMBOL(tcp_cwnd_application_limited); -EXPORT_SYMBOL(tcp_sendpage); -EXPORT_SYMBOL(sysctl_tcp_low_latency); - -EXPORT_SYMBOL(tcp_write_xmit); - -EXPORT_SYMBOL(tcp_v4_remember_stamp); - -extern int sysctl_tcp_tw_recycle; - -#ifdef CONFIG_SYSCTL -EXPORT_SYMBOL(sysctl_tcp_tw_recycle); -EXPORT_SYMBOL(sysctl_max_syn_backlog); -#endif - -EXPORT_SYMBOL(ip_generic_getfrag); - -#endif - -EXPORT_SYMBOL(tcp_read_sock); - -#ifdef CONFIG_IP_SCTP_MODULE -EXPORT_SYMBOL(ip_setsockopt); -EXPORT_SYMBOL(ip_getsockopt); -EXPORT_SYMBOL(inet_ioctl); -EXPORT_SYMBOL(inet_bind); -EXPORT_SYMBOL(inet_getname); -#endif /* CONFIG_IP_SCTP_MODULE */ - -EXPORT_SYMBOL(netlink_set_err); -EXPORT_SYMBOL(netlink_broadcast); -EXPORT_SYMBOL(netlink_unicast); -EXPORT_SYMBOL(netlink_kernel_create); -EXPORT_SYMBOL(netlink_dump_start); -EXPORT_SYMBOL(netlink_ack); -EXPORT_SYMBOL(netlink_set_nonroot); -EXPORT_SYMBOL(netlink_register_notifier); -EXPORT_SYMBOL(netlink_unregister_notifier); -#if defined(CONFIG_NETLINK_DEV) || defined(CONFIG_NETLINK_DEV_MODULE) -EXPORT_SYMBOL(netlink_attach); -EXPORT_SYMBOL(netlink_detach); -EXPORT_SYMBOL(netlink_post); -#endif - -EXPORT_SYMBOL(rtattr_parse); -EXPORT_SYMBOL(__rta_fill); -EXPORT_SYMBOL(neigh_delete); -EXPORT_SYMBOL(neigh_add); -EXPORT_SYMBOL(neigh_dump_info); - - -/* ABI emulation layers need this */ -EXPORT_SYMBOL(move_addr_to_kernel); -EXPORT_SYMBOL(move_addr_to_user); - -/* Used by at least ipip.c. */ -EXPORT_SYMBOL(ipv4_config); - -/* Used by other modules */ -EXPORT_SYMBOL(xrlim_allow); - -EXPORT_SYMBOL(ip_rcv); -EXPORT_SYMBOL(arp_rcv); -EXPORT_SYMBOL(arp_tbl); -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -EXPORT_SYMBOL(clip_tbl_hook); -#endif -EXPORT_SYMBOL(arp_find); - -#endif /* CONFIG_INET */ - -#ifdef CONFIG_TR -EXPORT_SYMBOL(tr_source_route); -EXPORT_SYMBOL(tr_type_trans); -#endif - -/* Device callback registration */ -EXPORT_SYMBOL(register_netdevice_notifier); -EXPORT_SYMBOL(unregister_netdevice_notifier); -EXPORT_SYMBOL(call_netdevice_notifiers); - -/* support for loadable net drivers */ -#ifdef CONFIG_NET -EXPORT_SYMBOL(loopback_dev); -EXPORT_SYMBOL(register_netdevice); -EXPORT_SYMBOL(unregister_netdevice); -EXPORT_SYMBOL(free_netdev); -EXPORT_SYMBOL(synchronize_net); -EXPORT_SYMBOL(netdev_state_change); -EXPORT_SYMBOL(netdev_boot_setup_check); -EXPORT_SYMBOL(dev_new_index); -EXPORT_SYMBOL(dev_get_by_flags); -EXPORT_SYMBOL(__dev_get_by_flags); -EXPORT_SYMBOL(dev_get_by_index); -EXPORT_SYMBOL(__dev_get_by_index); -EXPORT_SYMBOL(dev_get_by_name); -EXPORT_SYMBOL(__dev_get_by_name); -EXPORT_SYMBOL(dev_getbyhwaddr); -EXPORT_SYMBOL(netdev_set_master); -EXPORT_SYMBOL(eth_type_trans); -#ifdef CONFIG_FDDI -EXPORT_SYMBOL(fddi_type_trans); -#endif /* CONFIG_FDDI */ -#if 0 -EXPORT_SYMBOL(eth_copy_and_sum); -#endif -EXPORT_SYMBOL(alloc_skb); -EXPORT_SYMBOL(__kfree_skb); -EXPORT_SYMBOL(skb_clone); -EXPORT_SYMBOL(skb_copy); -EXPORT_SYMBOL(skb_pad); -EXPORT_SYMBOL(netif_rx); -EXPORT_SYMBOL(netif_receive_skb); -EXPORT_SYMBOL(dev_add_pack); -EXPORT_SYMBOL(dev_remove_pack); -EXPORT_SYMBOL(__dev_remove_pack); -EXPORT_SYMBOL(__dev_get); -EXPORT_SYMBOL(dev_alloc); -EXPORT_SYMBOL(dev_alloc_name); -EXPORT_SYMBOL(__netdev_watchdog_up); -#ifdef CONFIG_KMOD -EXPORT_SYMBOL(dev_load); -#endif -EXPORT_SYMBOL(dev_ioctl); -EXPORT_SYMBOL(dev_queue_xmit); -#ifdef CONFIG_NET_HW_FLOWCONTROL -EXPORT_SYMBOL(netdev_dropping); -EXPORT_SYMBOL(netdev_register_fc); -EXPORT_SYMBOL(netdev_unregister_fc); -EXPORT_SYMBOL(netdev_fc_xoff); -#endif -EXPORT_SYMBOL(dev_base); -EXPORT_SYMBOL(dev_base_lock); -EXPORT_SYMBOL(dev_open); -EXPORT_SYMBOL(dev_close); -EXPORT_SYMBOL(dev_mc_add); -EXPORT_SYMBOL(dev_mc_delete); -EXPORT_SYMBOL(dev_mc_upload); -EXPORT_SYMBOL(dev_set_allmulti); -EXPORT_SYMBOL(dev_set_promiscuity); -EXPORT_SYMBOL(__kill_fasync); - -EXPORT_SYMBOL(rtnl); -EXPORT_SYMBOL(rtnetlink_links); -EXPORT_SYMBOL(rtnetlink_dump_ifinfo); -EXPORT_SYMBOL(rtnetlink_put_metrics); -EXPORT_SYMBOL(rtnl_sem); -EXPORT_SYMBOL(rtnl_lock); -EXPORT_SYMBOL(rtnl_unlock); - -#ifdef CONFIG_HIPPI -EXPORT_SYMBOL(hippi_type_trans); -#endif - -#ifdef CONFIG_NET_FASTROUTE -EXPORT_SYMBOL(netdev_fastroute); -#endif - -#ifdef CONFIG_SYSCTL -EXPORT_SYMBOL(sysctl_wmem_max); -EXPORT_SYMBOL(sysctl_rmem_max); -#ifdef CONFIG_INET -EXPORT_SYMBOL(sysctl_ip_default_ttl); -#endif -#endif - -/* Packet scheduler modules want these. */ -EXPORT_SYMBOL(qdisc_destroy); -EXPORT_SYMBOL(qdisc_reset); -EXPORT_SYMBOL(qdisc_restart); -EXPORT_SYMBOL(qdisc_create_dflt); -EXPORT_SYMBOL(noop_qdisc); -EXPORT_SYMBOL(qdisc_tree_lock); -#ifdef CONFIG_NET_SCHED -PSCHED_EXPORTLIST; -EXPORT_SYMBOL(pfifo_qdisc_ops); -EXPORT_SYMBOL(bfifo_qdisc_ops); -EXPORT_SYMBOL(register_qdisc); -EXPORT_SYMBOL(unregister_qdisc); -EXPORT_SYMBOL(qdisc_get_rtab); -EXPORT_SYMBOL(qdisc_put_rtab); -EXPORT_SYMBOL(qdisc_copy_stats); -#ifdef CONFIG_NET_ESTIMATOR -EXPORT_SYMBOL(qdisc_new_estimator); -EXPORT_SYMBOL(qdisc_kill_estimator); -#endif -#ifdef CONFIG_NET_CLS_POLICE -EXPORT_SYMBOL(tcf_police); -EXPORT_SYMBOL(tcf_police_locate); -EXPORT_SYMBOL(tcf_police_destroy); -EXPORT_SYMBOL(tcf_police_dump); -#endif -#endif -#ifdef CONFIG_NET_CLS -EXPORT_SYMBOL(register_tcf_proto_ops); -EXPORT_SYMBOL(unregister_tcf_proto_ops); -#endif -#ifdef CONFIG_NETFILTER -#include -EXPORT_SYMBOL(nf_register_hook); -EXPORT_SYMBOL(nf_unregister_hook); -EXPORT_SYMBOL(nf_register_sockopt); -EXPORT_SYMBOL(nf_unregister_sockopt); -EXPORT_SYMBOL(nf_reinject); -EXPORT_SYMBOL(nf_register_queue_handler); -EXPORT_SYMBOL(nf_unregister_queue_handler); -EXPORT_SYMBOL(nf_hook_slow); -EXPORT_SYMBOL(nf_hooks); -EXPORT_SYMBOL(nf_setsockopt); -EXPORT_SYMBOL(nf_getsockopt); -EXPORT_SYMBOL(ip_ct_attach); -#ifdef CONFIG_INET -#include -EXPORT_SYMBOL(ip_route_me_harder); -#endif -#endif - -EXPORT_SYMBOL(register_gifconf); - -EXPORT_PER_CPU_SYMBOL(softnet_data); - -#ifdef CONFIG_NET_RADIO -#include /* Wireless Extensions driver API */ -EXPORT_SYMBOL(wireless_send_event); -EXPORT_SYMBOL(iw_handler_set_spy); -EXPORT_SYMBOL(iw_handler_get_spy); -EXPORT_SYMBOL(iw_handler_set_thrspy); -EXPORT_SYMBOL(iw_handler_get_thrspy); -EXPORT_SYMBOL(wireless_spy_update); -#endif /* CONFIG_NET_RADIO */ - -EXPORT_SYMBOL(linkwatch_fire_event); - -/* ethtool.c */ -EXPORT_SYMBOL(ethtool_op_get_link); -EXPORT_SYMBOL(ethtool_op_get_tx_csum); -EXPORT_SYMBOL(ethtool_op_set_tx_csum); -EXPORT_SYMBOL(ethtool_op_get_sg); -EXPORT_SYMBOL(ethtool_op_set_sg); -EXPORT_SYMBOL(ethtool_op_get_tso); -EXPORT_SYMBOL(ethtool_op_set_tso); - -#endif /* CONFIG_NET */ diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c Sun Oct 5 00:33:07 2003 +++ b/net/sched/cls_api.c Sun Oct 5 00:33:07 2003 @@ -467,3 +467,6 @@ #endif return 0; } + +EXPORT_SYMBOL(register_tcf_proto_ops); +EXPORT_SYMBOL(unregister_tcf_proto_ops); diff -Nru a/net/sched/estimator.c b/net/sched/estimator.c --- a/net/sched/estimator.c Sun Oct 5 00:33:06 2003 +++ b/net/sched/estimator.c Sun Oct 5 00:33:06 2003 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -194,3 +195,5 @@ } } +EXPORT_SYMBOL(qdisc_kill_estimator); +EXPORT_SYMBOL(qdisc_new_estimator); diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c Sun Oct 5 00:33:10 2003 +++ b/net/sched/police.c Sun Oct 5 00:33:10 2003 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -248,3 +249,12 @@ skb_trim(skb, b - skb->data); return -1; } + +EXPORT_SYMBOL(tcf_police); +EXPORT_SYMBOL(tcf_police_destroy); +EXPORT_SYMBOL(tcf_police_dump); +EXPORT_SYMBOL(tcf_police_hash); +EXPORT_SYMBOL(tcf_police_ht); +EXPORT_SYMBOL(tcf_police_locate); +EXPORT_SYMBOL(tcf_police_lookup); +EXPORT_SYMBOL(tcf_police_new_index); diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c Sun Oct 5 00:33:08 2003 +++ b/net/sched/sch_api.c Sun Oct 5 00:33:08 2003 @@ -1255,3 +1255,10 @@ return 0; } + +EXPORT_SYMBOL(qdisc_copy_stats); +EXPORT_SYMBOL(qdisc_get_rtab); +EXPORT_SYMBOL(qdisc_put_rtab); +EXPORT_SYMBOL(register_qdisc); +EXPORT_SYMBOL(unregister_qdisc); +PSCHED_EXPORTLIST; diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c --- a/net/sched/sch_fifo.c Sun Oct 5 00:33:07 2003 +++ b/net/sched/sch_fifo.c Sun Oct 5 00:33:07 2003 @@ -203,3 +203,6 @@ .dump = fifo_dump, .owner = THIS_MODULE, }; + +EXPORT_SYMBOL(bfifo_qdisc_ops); +EXPORT_SYMBOL(pfifo_qdisc_ops); diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c Sun Oct 5 00:33:05 2003 +++ b/net/sched/sch_generic.c Sun Oct 5 00:33:05 2003 @@ -531,3 +531,12 @@ spin_unlock_bh(&dev->queue_lock); write_unlock(&qdisc_tree_lock); } + +EXPORT_SYMBOL(__netdev_watchdog_up); +EXPORT_SYMBOL(noop_qdisc); +EXPORT_SYMBOL(noop_qdisc_ops); +EXPORT_SYMBOL(qdisc_create_dflt); +EXPORT_SYMBOL(qdisc_destroy); +EXPORT_SYMBOL(qdisc_reset); +EXPORT_SYMBOL(qdisc_restart); +EXPORT_SYMBOL(qdisc_tree_lock); diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c --- a/net/sctp/associola.c Sun Oct 5 00:33:05 2003 +++ b/net/sctp/associola.c Sun Oct 5 00:33:05 2003 @@ -141,9 +141,9 @@ * socket values. */ asoc->max_retrans = sp->assocparams.sasoc_asocmaxrxt; - asoc->rto_initial = sp->rtoinfo.srto_initial * HZ / 1000; - asoc->rto_max = sp->rtoinfo.srto_max * HZ / 1000; - asoc->rto_min = sp->rtoinfo.srto_min * HZ / 1000; + asoc->rto_initial = MSECS_TO_JIFFIES(sp->rtoinfo.srto_initial); + asoc->rto_max = MSECS_TO_JIFFIES(sp->rtoinfo.srto_max); + asoc->rto_min = MSECS_TO_JIFFIES(sp->rtoinfo.srto_min); asoc->overall_error_count = 0; @@ -168,7 +168,8 @@ asoc->c.sinit_num_ostreams = sp->initmsg.sinit_num_ostreams; asoc->max_init_attempts = sp->initmsg.sinit_max_attempts; - asoc->max_init_timeo = sp->initmsg.sinit_max_init_timeo * HZ / 1000; + asoc->max_init_timeo = + MSECS_TO_JIFFIES(sp->initmsg.sinit_max_init_timeo); /* Allocate storage for the ssnmap after the inbound and outbound * streams have been negotiated during Init. @@ -246,6 +247,11 @@ */ asoc->peer.sack_needed = 1; + /* Assume that the peer recongizes ASCONF until reported otherwise + * via an ERROR chunk. + */ + asoc->peer.asconf_capable = 1; + /* Create an input queue. */ sctp_inq_init(&asoc->base.inqueue); sctp_inq_set_th_handler(&asoc->base.inqueue, @@ -495,7 +501,7 @@ /* Initialize the peer's heartbeat interval based on the * sock configured value. */ - peer->hb_interval = sp->paddrparam.spp_hbinterval * HZ; + peer->hb_interval = MSECS_TO_JIFFIES(sp->paddrparam.spp_hbinterval); /* Set the path max_retrans. */ peer->max_retrans = asoc->max_retrans; diff -Nru a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c --- a/net/sctp/bind_addr.c Sun Oct 5 00:33:09 2003 +++ b/net/sctp/bind_addr.c Sun Oct 5 00:33:09 2003 @@ -324,6 +324,43 @@ return 0; } +/* Find the first address in the bind address list that is not present in + * the addrs packed array. + */ +union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, + const union sctp_addr *addrs, + int addrcnt, + struct sctp_opt *opt) +{ + struct sctp_sockaddr_entry *laddr; + union sctp_addr *addr; + void *addr_buf; + struct sctp_af *af; + struct list_head *pos; + int i; + + list_for_each(pos, &bp->address_list) { + laddr = list_entry(pos, struct sctp_sockaddr_entry, list); + + addr_buf = (union sctp_addr *)addrs; + for (i = 0; i < addrcnt; i++) { + addr = (union sctp_addr *)addr_buf; + af = sctp_get_af_specific(addr->v4.sin_family); + if (!af) + return NULL; + + if (opt->pf->cmp_addr(&laddr->a, addr, opt)) + break; + + addr_buf += af->sockaddr_len; + } + if (i == addrcnt) + return &laddr->a; + } + + return NULL; +} + /* Copy out addresses from the global local address list. */ static int sctp_copy_one_addr(struct sctp_bind_addr *dest, union sctp_addr *addr, diff -Nru a/net/sctp/endpointola.c b/net/sctp/endpointola.c --- a/net/sctp/endpointola.c Sun Oct 5 00:33:06 2003 +++ b/net/sctp/endpointola.c Sun Oct 5 00:33:06 2003 @@ -129,7 +129,7 @@ ep->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT] = SCTP_DEFAULT_TIMEOUT_T1_INIT; ep->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = - sp->rtoinfo.srto_initial * HZ / 1000; + MSECS_TO_JIFFIES(sp->rtoinfo.srto_initial); ep->timeouts[SCTP_EVENT_TIMEOUT_T3_RTX] = 0; ep->timeouts[SCTP_EVENT_TIMEOUT_T4_RTO] = 0; @@ -138,7 +138,7 @@ * recommended value of 5 times 'RTO.Max'. */ ep->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD] - = 5 * (sp->rtoinfo.srto_max * HZ / 1000); + = 5 * MSECS_TO_JIFFIES(sp->rtoinfo.srto_max); ep->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = SCTP_DEFAULT_TIMEOUT_HEARTBEAT; diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c --- a/net/sctp/sm_make_chunk.c Sun Oct 5 00:33:06 2003 +++ b/net/sctp/sm_make_chunk.c Sun Oct 5 00:33:06 2003 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * Copyright (C) IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2003 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001-2002 Intel Corp. @@ -1288,7 +1288,7 @@ /* Set an expiration time for the cookie. */ do_gettimeofday(&cookie->c.expiration); - tv_add(&asoc->cookie_life, &cookie->c.expiration); + TIMEVAL_ADD(asoc->cookie_life, cookie->c.expiration); /* Copy the peer's init packet. */ memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr, @@ -2021,11 +2021,11 @@ sctp_addiphdr_t asconf; struct sctp_chunk *retval; int length = sizeof(asconf) + vparam_len; - union sctp_params addrparam; + union sctp_addr_param addrparam; int addrlen; struct sctp_af *af = sctp_get_af_specific(addr->v4.sin_family); - addrlen = af->to_addr_param(addr, (union sctp_addr_param *)&addrparam); + addrlen = af->to_addr_param(addr, &addrparam); if (!addrlen) return NULL; length += addrlen; @@ -2046,6 +2046,83 @@ } /* ADDIP + * 3.2.1 Add IP Address + * 0 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Type = 0xC001 | Length = Variable | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ASCONF-Request Correlation ID | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Address Parameter | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * 3.2.2 Delete IP Address + * 0 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Type = 0xC002 | Length = Variable | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ASCONF-Request Correlation ID | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Address Parameter | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + */ +struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, + union sctp_addr *laddr, + struct sockaddr *addrs, + int addrcnt, + int flags) +{ + sctp_addip_param_t param; + struct sctp_chunk *retval; + union sctp_addr_param addr_param; + union sctp_addr *addr; + void *addr_buf; + struct sctp_af *af; + int paramlen = sizeof(param); + int addr_param_len = 0; + int totallen = 0; + int i; + + /* Get total length of all the address parameters. */ + addr_buf = addrs; + for (i = 0; i < addrcnt; i++) { + addr = (union sctp_addr *)addr_buf; + af = sctp_get_af_specific(addr->v4.sin_family); + addr_param_len = af->to_addr_param(addr, &addr_param); + + totallen += paramlen; + totallen += addr_param_len; + + addr_buf += af->sockaddr_len; + } + + /* Create an asconf chunk with the required length. */ + retval = sctp_make_asconf(asoc, laddr, totallen); + if (!retval) + return NULL; + + /* Add the address parameters to the asconf chunk. */ + addr_buf = addrs; + for (i = 0; i < addrcnt; i++) { + addr = (union sctp_addr *)addr_buf; + af = sctp_get_af_specific(addr->v4.sin_family); + addr_param_len = af->to_addr_param(addr, &addr_param); + param.param_hdr.type = flags; + param.param_hdr.length = htons(paramlen + addr_param_len); + param.crr_id = htonl(i); + + sctp_addto_chunk(retval, paramlen, ¶m); + sctp_addto_chunk(retval, addr_param_len, &addr_param); + + addr_buf += af->sockaddr_len; + } + return retval; +} + +/* ADDIP * 3.2.4 Set Primary IP Address * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -2065,11 +2142,11 @@ sctp_addip_param_t param; struct sctp_chunk *retval; int len = sizeof(param); - union sctp_params addrparam; + union sctp_addr_param addrparam; int addrlen; struct sctp_af *af = sctp_get_af_specific(addr->v4.sin_family); - addrlen = af->to_addr_param(addr, (union sctp_addr_param *)&addrparam); + addrlen = af->to_addr_param(addr, &addrparam); if (!addrlen) return NULL; len += addrlen; @@ -2089,11 +2166,7 @@ return retval; } -/* - * Unpack the parameters in an ASCONF chunk into an association and - * generate ASCONF-ACK chunk. - * - * ADDIP 3.1.2 Address Configuration Acknowledgement Chunk (ASCONF-ACK) +/* ADDIP 3.1.2 Address Configuration Acknowledgement Chunk (ASCONF-ACK) * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ @@ -2110,8 +2183,28 @@ * | ASCONF Parameter Response#N | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - * All the parameter respoinces will be added in this function. + * Create an ASCONF_ACK chunk with enough space for the parameter responses. */ +struct sctp_chunk *sctp_make_asconf_ack(struct sctp_association *asoc, + int serial, int vparam_len) +{ + sctp_addiphdr_t asconf; + struct sctp_chunk *retval; + int length = sizeof(asconf) + vparam_len; + + /* Create the chunk. */ + retval = sctp_make_chunk(asoc, SCTP_CID_ASCONF_ACK, 0, length); + if (!retval) + return NULL; + + asconf.serial = serial; + + retval->subh.addip_hdr = + sctp_addto_chunk(retval, sizeof(asconf), &asconf); + + return retval; +} + struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, struct sctp_chunk *asconf, int vparam_len) diff -Nru a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c --- a/net/sctp/sm_sideeffect.c Sun Oct 5 00:33:09 2003 +++ b/net/sctp/sm_sideeffect.c Sun Oct 5 00:33:09 2003 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2003 * Copyright (c) 1999 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2002 International Business Machines Corp. * * This file is part of the SCTP kernel reference Implementation * @@ -690,6 +690,44 @@ chunk->transport = t; } +/* Process an incoming Operation Error Chunk. */ +static void sctp_cmd_process_operr(sctp_cmd_seq_t *cmds, + struct sctp_association *asoc, + struct sctp_chunk *chunk) +{ + struct sctp_operr_chunk *operr_chunk; + struct sctp_errhdr *err_hdr; + + operr_chunk = (struct sctp_operr_chunk *)chunk->chunk_hdr; + err_hdr = &operr_chunk->err_hdr; + + switch (err_hdr->cause) { + case SCTP_ERROR_UNKNOWN_CHUNK: + { + struct sctp_chunkhdr *unk_chunk_hdr; + + unk_chunk_hdr = (struct sctp_chunkhdr *)err_hdr->variable; + switch (unk_chunk_hdr->type) { + /* ADDIP 4.1 A9) If the peer responds to an ASCONF with an + * ERROR chunk reporting that it did not recognized the ASCONF + * chunk type, the sender of the ASCONF MUST NOT send any + * further ASCONF chunks and MUST stop its T-4 timer. + */ + case SCTP_CID_ASCONF: + asoc->peer.asconf_capable = 0; + sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP, + SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); + break; + default: + break; + } + break; + } + default: + break; + } +} + /* These three macros allow us to pull the debugging code out of the * main flow of sctp_do_sm() to keep attention focused on the real * functionality there. @@ -1205,6 +1243,9 @@ sctp_cmd_setup_t4(commands, asoc, cmd->obj.ptr); break; + case SCTP_CMD_PROCESS_OPERR: + sctp_cmd_process_operr(commands, asoc, chunk); + break; default: printk(KERN_WARNING "Impossible command: %u, %p\n", cmd->verb, cmd->obj.ptr); diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c --- a/net/sctp/sm_statefuns.c Sun Oct 5 00:33:05 2003 +++ b/net/sctp/sm_statefuns.c Sun Oct 5 00:33:05 2003 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2003 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2002 International Business Machines, Corp. * Copyright (c) 2001-2002 Intel Corp. * Copyright (c) 2002 Nokia Corp. * @@ -2864,6 +2864,9 @@ sctp_ulpevent_free(ev); goto nomem; } + + sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, + SCTP_CHUNK(chunk)); } return SCTP_DISPOSITION_CONSUME; diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c Sun Oct 5 00:33:10 2003 +++ b/net/sctp/socket.c Sun Oct 5 00:33:10 2003 @@ -97,6 +97,8 @@ static inline int sctp_verify_addr(struct sock *, union sctp_addr *, int); static int sctp_bindx_add(struct sock *, struct sockaddr *, int); static int sctp_bindx_rem(struct sock *, struct sockaddr *, int); +static int sctp_send_asconf_add_ip(struct sock *, struct sockaddr *, int); +static int sctp_send_asconf_del_ip(struct sock *, struct sockaddr *, int); static int sctp_do_bind(struct sock *, union sctp_addr *, int); static int sctp_autobind(struct sock *sk); static void sctp_sock_migrate(struct sock *, struct sock *, @@ -349,6 +351,106 @@ return retval; } +/* Send an ASCONF chunk with Add IP address parameters to all the peers of the + * associations that are part of the endpoint indicating that a list of local + * addresses are added to the endpoint. + * + * If any of the addresses is already in the bind address list of the + * association, we do not send the chunk for that association. But it will not + * affect other associations. + * + * Only sctp_setsockopt_bindx() is supposed to call this function. + */ +static int sctp_send_asconf_add_ip(struct sock *sk, + struct sockaddr *addrs, + int addrcnt) +{ + struct sctp_opt *sp; + struct sctp_endpoint *ep; + struct sctp_association *asoc; + struct sctp_bind_addr *bp; + struct sctp_chunk *chunk; + struct sctp_sockaddr_entry *laddr; + union sctp_addr *addr; + void *addr_buf; + struct sctp_af *af; + struct list_head *pos; + struct list_head *p; + int i; + int retval = 0; + + sp = sctp_sk(sk); + ep = sp->ep; + + SCTP_DEBUG_PRINTK("%s: (sk: %p, addrs: %p, addrcnt: %d)\n", + __FUNCTION__, sk, addrs, addrcnt); + + list_for_each(pos, &ep->asocs) { + asoc = list_entry(pos, struct sctp_association, asocs); + + if (!sctp_state(asoc, ESTABLISHED)) + continue; + + if (!asoc->peer.asconf_capable) + continue; + + /* Check if any address in the packed array of addresses is + * in the bind address list of the association. If so, + * do not send the asconf chunk to its peer, but continue with + * other associations. + */ + addr_buf = addrs; + for (i = 0; i < addrcnt; i++) { + addr = (union sctp_addr *)addr_buf; + af = sctp_get_af_specific(addr->v4.sin_family); + if (!af) { + retval = -EINVAL; + goto out; + } + + if (sctp_assoc_lookup_laddr(asoc, addr)) + break; + + addr_buf += af->sockaddr_len; + } + if (i < addrcnt) + continue; + + /* Use the first address in bind addr list of association as + * Address Parameter of ASCONF CHUNK. + */ + sctp_read_lock(&asoc->base.addr_lock); + bp = &asoc->base.bind_addr; + p = bp->address_list.next; + laddr = list_entry(p, struct sctp_sockaddr_entry, list); + sctp_read_unlock(&asoc->base.addr_lock); + + chunk = sctp_make_asconf_update_ip(asoc, &laddr->a, addrs, + addrcnt, SCTP_PARAM_ADD_IP); + if (!chunk) { + retval = -ENOMEM; + goto out; + } + + retval = sctp_primitive_ASCONF(asoc, chunk); + if (retval) { + sctp_chunk_free(chunk); + goto out; + } + + /* FIXME: After sending the add address ASCONF chunk, we + * cannot append the address to the association's binding + * address list, because the new address may be used as the + * source of a message sent to the peer before the ASCONF + * chunk is received by the peer. So we should wait until + * ASCONF_ACK is received. + */ + } + +out: + return retval; +} + /* Remove a list of addresses from bind addresses list. Do not remove the * last address. * @@ -436,6 +538,106 @@ return retval; } +/* Send an ASCONF chunk with Delete IP address parameters to all the peers of + * the associations that are part of the endpoint indicating that a list of + * local addresses are removed from the endpoint. + * + * If any of the addresses is already in the bind address list of the + * association, we do not send the chunk for that association. But it will not + * affect other associations. + * + * Only sctp_setsockopt_bindx() is supposed to call this function. + */ +static int sctp_send_asconf_del_ip(struct sock *sk, + struct sockaddr *addrs, + int addrcnt) +{ + struct sctp_opt *sp; + struct sctp_endpoint *ep; + struct sctp_association *asoc; + struct sctp_bind_addr *bp; + struct sctp_chunk *chunk; + union sctp_addr *laddr; + void *addr_buf; + struct sctp_af *af; + struct list_head *pos; + int i; + int retval = 0; + + sp = sctp_sk(sk); + ep = sp->ep; + + SCTP_DEBUG_PRINTK("%s: (sk: %p, addrs: %p, addrcnt: %d)\n", + __FUNCTION__, sk, addrs, addrcnt); + + list_for_each(pos, &ep->asocs) { + asoc = list_entry(pos, struct sctp_association, asocs); + + if (!sctp_state(asoc, ESTABLISHED)) + continue; + + if (!asoc->peer.asconf_capable) + continue; + + /* Check if any address in the packed array of addresses is + * not present in the bind address list of the association. + * If so, do not send the asconf chunk to its peer, but + * continue with other associations. + */ + addr_buf = addrs; + for (i = 0; i < addrcnt; i++) { + laddr = (union sctp_addr *)addr_buf; + af = sctp_get_af_specific(laddr->v4.sin_family); + if (!af) { + retval = -EINVAL; + goto out; + } + + if (!sctp_assoc_lookup_laddr(asoc, laddr)) + break; + + addr_buf += af->sockaddr_len; + } + if (i < addrcnt) + continue; + + /* Find one address in the association's bind address list + * that is not in the packed array of addresses. This is to + * make sure that we do not delete all the addresses in the + * association. + */ + sctp_read_lock(&asoc->base.addr_lock); + bp = &asoc->base.bind_addr; + laddr = sctp_find_unmatch_addr(bp, (union sctp_addr *)addrs, + addrcnt, sp); + sctp_read_unlock(&asoc->base.addr_lock); + if (!laddr) + continue; + + chunk = sctp_make_asconf_update_ip(asoc, laddr, addrs, addrcnt, + SCTP_PARAM_DEL_IP); + if (!chunk) { + retval = -ENOMEM; + goto out; + } + + retval = sctp_primitive_ASCONF(asoc, chunk); + if (retval) { + sctp_chunk_free(chunk); + goto out; + } + + /* FIXME: After sending the delete address ASCONF chunk, we + * cannot remove the addresses from the association's bind + * address list, because there maybe some packet send to + * the delete addresses, so we should wait until ASCONF_ACK + * packet is received. + */ + } +out: + return retval; +} + /* Helper for tunneling sctp_bindx() requests through sctp_setsockopt() * * API 8.1 @@ -564,10 +766,16 @@ switch (op) { case SCTP_BINDX_ADD_ADDR: err = sctp_bindx_add(sk, kaddrs, addrcnt); + if (err) + goto out; + err = sctp_send_asconf_add_ip(sk, kaddrs, addrcnt); break; case SCTP_BINDX_REM_ADDR: err = sctp_bindx_rem(sk, kaddrs, addrcnt); + if (err) + goto out; + err = sctp_send_asconf_del_ip(sk, kaddrs, addrcnt); break; default: @@ -575,6 +783,7 @@ break; }; +out: kfree(kaddrs); return err; @@ -962,8 +1171,8 @@ = sinit->sinit_max_attempts; } if (sinit->sinit_max_init_timeo) { - asoc->max_init_timeo - = sinit->sinit_max_init_timeo * HZ; + asoc->max_init_timeo = + MSECS_TO_JIFFIES(sinit->sinit_max_init_timeo); } } @@ -1401,7 +1610,8 @@ */ if (params.spp_hbinterval) { trans->hb_allowed = 1; - trans->hb_interval = params.spp_hbinterval * HZ / 1000; + trans->hb_interval = + MSECS_TO_JIFFIES(params.spp_hbinterval); } else trans->hb_allowed = 0; } @@ -1560,11 +1770,12 @@ if (asoc) { if (rtoinfo.srto_initial != 0) - asoc->rto_initial = rtoinfo.srto_initial * HZ / 1000; + asoc->rto_initial = + MSECS_TO_JIFFIES(rtoinfo.srto_initial); if (rtoinfo.srto_max != 0) - asoc->rto_max = rtoinfo.srto_max * HZ / 1000; + asoc->rto_max = MSECS_TO_JIFFIES(rtoinfo.srto_max); if (rtoinfo.srto_min != 0) - asoc->rto_min = rtoinfo.srto_min * HZ / 1000; + asoc->rto_min = MSECS_TO_JIFFIES(rtoinfo.srto_min); } else { /* If there is no association or the association-id = 0 * set the values to the endpoint. @@ -2088,14 +2299,14 @@ sp->initmsg.sinit_num_ostreams = sctp_max_outstreams; sp->initmsg.sinit_max_instreams = sctp_max_instreams; sp->initmsg.sinit_max_attempts = sctp_max_retrans_init; - sp->initmsg.sinit_max_init_timeo = (sctp_rto_max / HZ) * 1000; + sp->initmsg.sinit_max_init_timeo = JIFFIES_TO_MSECS(sctp_rto_max); /* Initialize default RTO related parameters. These parameters can * be modified for with the SCTP_RTOINFO socket option. */ - sp->rtoinfo.srto_initial = (sctp_rto_initial / HZ) * 1000; - sp->rtoinfo.srto_max = (sctp_rto_max / HZ) * 1000; - sp->rtoinfo.srto_min = (sctp_rto_min / HZ) * 1000; + sp->rtoinfo.srto_initial = JIFFIES_TO_MSECS(sctp_rto_initial); + sp->rtoinfo.srto_max = JIFFIES_TO_MSECS(sctp_rto_max); + sp->rtoinfo.srto_min = JIFFIES_TO_MSECS(sctp_rto_min); /* Initialize default association related parameters. These parameters * can be modified with the SCTP_ASSOCINFO socket option. @@ -2104,8 +2315,8 @@ sp->assocparams.sasoc_number_peer_destinations = 0; sp->assocparams.sasoc_peer_rwnd = 0; sp->assocparams.sasoc_local_rwnd = 0; - sp->assocparams.sasoc_cookie_life = (sctp_valid_cookie_life / HZ) - * 1000; + sp->assocparams.sasoc_cookie_life = + JIFFIES_TO_MSECS(sctp_valid_cookie_life); /* Initialize default event subscriptions. By default, all the * options are off. @@ -2115,7 +2326,7 @@ /* Default Peer Address Parameters. These defaults can * be modified via SCTP_PEER_ADDR_PARAMS */ - sp->paddrparam.spp_hbinterval = (sctp_hb_interval / HZ) * 1000; + sp->paddrparam.spp_hbinterval = JIFFIES_TO_MSECS(sctp_hb_interval); sp->paddrparam.spp_pathmaxrxt = sctp_max_retrans_path; /* If enabled no SCTP message fragmentation will be performed. @@ -2265,7 +2476,7 @@ status.sstat_primary.spinfo_state = transport->active; status.sstat_primary.spinfo_cwnd = transport->cwnd; status.sstat_primary.spinfo_srtt = transport->srtt; - status.sstat_primary.spinfo_rto = (transport->rto / HZ) * 1000; + status.sstat_primary.spinfo_rto = JIFFIES_TO_MSECS(transport->rto); status.sstat_primary.spinfo_mtu = transport->pmtu; if (put_user(len, optlen)) { @@ -2320,7 +2531,7 @@ pinfo.spinfo_state = transport->active; pinfo.spinfo_cwnd = transport->cwnd; pinfo.spinfo_srtt = transport->srtt; - pinfo.spinfo_rto = (transport->rto / HZ) * 1000; + pinfo.spinfo_rto = JIFFIES_TO_MSECS(transport->rto); pinfo.spinfo_mtu = transport->pmtu; if (put_user(len, optlen)) { @@ -2524,7 +2735,7 @@ if (!trans->hb_allowed) params.spp_hbinterval = 0; else - params.spp_hbinterval = trans->hb_interval * 1000 / HZ; + params.spp_hbinterval = JIFFIES_TO_MSECS(trans->hb_interval); /* spp_pathmaxrxt contains the maximum number of retransmissions * before this address shall be considered unreachable. @@ -2582,10 +2793,8 @@ list_for_each(pos, &asoc->peer.transport_addr_list) { cnt ++; } - if (copy_to_user(optval, &cnt, sizeof(int))) - return -EFAULT; - return 0; + return cnt; } static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, @@ -2666,10 +2875,8 @@ list_for_each(pos, &bp->address_list) { cnt ++; } - if (copy_to_user(optval, &cnt, sizeof(int))) - return -EFAULT; - return 0; + return cnt; } static int sctp_getsockopt_local_addrs(struct sock *sk, int len, @@ -2879,9 +3086,9 @@ /* Values corresponding to the specific association. */ if (asoc) { - rtoinfo.srto_initial = (asoc->rto_initial / HZ) * 1000; - rtoinfo.srto_max = (asoc->rto_max / HZ) * 1000; - rtoinfo.srto_min = (asoc->rto_min / HZ) * 1000; + rtoinfo.srto_initial = JIFFIES_TO_MSECS(asoc->rto_initial); + rtoinfo.srto_max = JIFFIES_TO_MSECS(asoc->rto_max); + rtoinfo.srto_min = JIFFIES_TO_MSECS(asoc->rto_min); } else { /* Values corresponding to the endpoint. */ struct sctp_opt *sp = sctp_sk(sk); diff -Nru a/net/sctp/sysctl.c b/net/sctp/sysctl.c --- a/net/sctp/sysctl.c Sun Oct 5 00:33:08 2003 +++ b/net/sctp/sysctl.c Sun Oct 5 00:33:08 2003 @@ -44,7 +44,7 @@ #include static ctl_handler sctp_sysctl_jiffies_ms; -static long rto_timer_min = 0; +static long rto_timer_min = 1; static long rto_timer_max = 86400000; /* One day */ static ctl_table sctp_table[] = { diff -Nru a/net/socket.c b/net/socket.c --- a/net/socket.c Sun Oct 5 00:33:08 2003 +++ b/net/socket.c Sun Oct 5 00:33:08 2003 @@ -1989,3 +1989,18 @@ seq_printf(seq, "sockets: used %d\n", counter); } #endif /* CONFIG_PROC_FS */ + +/* ABI emulation layers need these two */ +EXPORT_SYMBOL(move_addr_to_kernel); +EXPORT_SYMBOL(move_addr_to_user); +EXPORT_SYMBOL(sock_alloc); +EXPORT_SYMBOL(sock_alloc_inode); +EXPORT_SYMBOL(sock_create); +EXPORT_SYMBOL(sock_map_fd); +EXPORT_SYMBOL(sock_recvmsg); +EXPORT_SYMBOL(sock_register); +EXPORT_SYMBOL(sock_release); +EXPORT_SYMBOL(sock_sendmsg); +EXPORT_SYMBOL(sock_unregister); +EXPORT_SYMBOL(sock_wake_async); +EXPORT_SYMBOL(sockfd_lookup); diff -Nru a/net/unix/af_unix.c b/net/unix/af_unix.c --- a/net/unix/af_unix.c Sun Oct 5 00:33:09 2003 +++ b/net/unix/af_unix.c Sun Oct 5 00:33:09 2003 @@ -448,7 +448,7 @@ sk->sk_max_ack_backlog = backlog; sk->sk_state = TCP_LISTEN; /* set credentials so connect can copy them */ - sk->sk_peercred.pid = current->pid; + sk->sk_peercred.pid = current->tgid; sk->sk_peercred.uid = current->euid; sk->sk_peercred.gid = current->egid; err = 0; @@ -983,7 +983,7 @@ unix_peer(newsk) = sk; newsk->sk_state = TCP_ESTABLISHED; newsk->sk_type = SOCK_STREAM; - newsk->sk_peercred.pid = current->pid; + newsk->sk_peercred.pid = current->tgid; newsk->sk_peercred.uid = current->euid; newsk->sk_peercred.gid = current->egid; newu = unix_sk(newsk); @@ -1045,7 +1045,7 @@ sock_hold(skb); unix_peer(ska)=skb; unix_peer(skb)=ska; - ska->sk_peercred.pid = skb->sk_peercred.pid = current->pid; + ska->sk_peercred.pid = skb->sk_peercred.pid = current->tgid; ska->sk_peercred.uid = skb->sk_peercred.uid = current->euid; ska->sk_peercred.gid = skb->sk_peercred.gid = current->egid; diff -Nru a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c --- a/net/xfrm/xfrm_algo.c Sun Oct 5 00:33:08 2003 +++ b/net/xfrm/xfrm_algo.c Sun Oct 5 00:33:08 2003 @@ -8,7 +8,9 @@ * Software Foundation; either version 2 of the License, or (at your option) * any later version. */ + #include +#include #include #include #include @@ -617,6 +619,7 @@ BUG(); return elt; } +EXPORT_SYMBOL_GPL(skb_to_sgvec); /* Check that skb data bits are writable. If they are not, copy data * to newly created private area. If "tailbits" is given, make sure that @@ -717,6 +720,7 @@ return elt; } +EXPORT_SYMBOL_GPL(skb_cow_data); void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len) { @@ -726,4 +730,5 @@ } return skb_put(tail, len); } +EXPORT_SYMBOL_GPL(pskb_put); #endif diff -Nru a/scripts/bin2c.c b/scripts/bin2c.c --- a/scripts/bin2c.c Sun Oct 5 00:33:09 2003 +++ b/scripts/bin2c.c Sun Oct 5 00:33:09 2003 @@ -1,3 +1,12 @@ +/* + * Unloved program to convert a binary on stdin to a C include on stdout + * + * Jan 1999 Matt Mackall + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + #include int main(int argc, char *argv[]) diff -Nru a/scripts/pnmtologo.c b/scripts/pnmtologo.c --- a/scripts/pnmtologo.c Sun Oct 5 00:33:05 2003 +++ b/scripts/pnmtologo.c Sun Oct 5 00:33:05 2003 @@ -119,7 +119,8 @@ static void read_image(void) { FILE *fp; - int i, j, magic; + unsigned int i, j; + int magic; unsigned int maxval; /* open image file */ @@ -274,7 +275,7 @@ static void write_logo_mono(void) { - int i, j; + unsigned int i, j; unsigned char val, bit; /* validate image */ @@ -302,7 +303,7 @@ static void write_logo_vga16(void) { - int i, j, k; + unsigned int i, j, k; unsigned char val; /* validate image */ @@ -342,7 +343,7 @@ static void write_logo_clut224(void) { - int i, j, k; + unsigned int i, j, k; /* validate image */ for (i = 0; i < logo_height; i++) @@ -388,7 +389,7 @@ static void write_logo_gray256(void) { - int i, j; + unsigned int i, j; /* validate image */ for (i = 0; i < logo_height; i++) diff -Nru a/security/dummy.c b/security/dummy.c --- a/security/dummy.c Sun Oct 5 00:33:07 2003 +++ b/security/dummy.c Sun Oct 5 00:33:07 2003 @@ -364,7 +364,7 @@ return 0; } -static int dummy_inode_permission (struct inode *inode, int mask) +static int dummy_inode_permission (struct inode *inode, int mask, struct nameidata *nd) { return 0; } diff -Nru a/security/selinux/hooks.c b/security/selinux/hooks.c --- a/security/selinux/hooks.c Sun Oct 5 00:33:10 2003 +++ b/security/selinux/hooks.c Sun Oct 5 00:33:10 2003 @@ -1730,12 +1730,17 @@ return dentry_has_perm(current, NULL, dentry, FILE__READ); } -static int selinux_inode_permission(struct inode *inode, int mask) +static int selinux_inode_permission(struct inode *inode, int mask, + struct nameidata *nd) { if (!mask) { /* No permission to check. Existence test. */ return 0; } + + if (nd && nd->dentry) + return dentry_has_perm(current, nd->mnt, nd->dentry, + file_mask_to_av(inode->i_mode, mask)); return inode_has_perm(current, inode, file_mask_to_av(inode->i_mode, mask), NULL, NULL); diff -Nru a/security/selinux/ss/services.c b/security/selinux/ss/services.c --- a/security/selinux/ss/services.c Sun Oct 5 00:33:10 2003 +++ b/security/selinux/ss/services.c Sun Oct 5 00:33:10 2003 @@ -896,13 +896,15 @@ struct user_datum *usrdatum; char *s; u32 len; - int rc = -EINVAL; + int rc; args = p; rc = context_cpy(&oldc, c); if (rc) goto out; + + rc = -EINVAL; /* Convert the user. */ usrdatum = hashtab_search(args->newp->p_users.table, diff -Nru a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c --- a/sound/oss/ac97_codec.c Sun Oct 5 00:33:06 2003 +++ b/sound/oss/ac97_codec.c Sun Oct 5 00:33:06 2003 @@ -46,7 +46,6 @@ * Isolated from trident.c to support multiple ac97 codec */ #include -#include #include #include #include diff -Nru a/sound/oss/ali5455.c b/sound/oss/ali5455.c --- a/sound/oss/ali5455.c Sun Oct 5 00:33:09 2003 +++ b/sound/oss/ali5455.c Sun Oct 5 00:33:09 2003 @@ -47,7 +47,6 @@ */ #include -#include #include #include #include diff -Nru a/sound/oss/au1000.c b/sound/oss/au1000.c --- a/sound/oss/au1000.c Sun Oct 5 00:33:09 2003 +++ b/sound/oss/au1000.c Sun Oct 5 00:33:09 2003 @@ -50,7 +50,6 @@ * channels [stevel]. * */ -#include #include #include #include @@ -2223,8 +2222,9 @@ if (!options || !*options) return 0; - for(this_opt=strtok(options, ","); - this_opt; this_opt=strtok(NULL, ",")) { + while (this_opt = strsep(&options, ",")) { + if (!*this_opt) + continue; if (!strncmp(this_opt, "vra", 3)) { vra = 1; } diff -Nru a/sound/oss/btaudio.c b/sound/oss/btaudio.c --- a/sound/oss/btaudio.c Sun Oct 5 00:33:07 2003 +++ b/sound/oss/btaudio.c Sun Oct 5 00:33:07 2003 @@ -177,8 +177,11 @@ bta->risc_size = PAGE_SIZE; bta->risc_cpu = pci_alloc_consistent (bta->pci, bta->risc_size, &bta->risc_dma); - if (NULL == bta->risc_cpu) + if (NULL == bta->risc_cpu) { + pci_free_consistent(bta->pci, bta->buf_size, bta->buf_cpu, bta->buf_dma); + bta->buf_cpu = NULL; return -ENOMEM; + } } return 0; } diff -Nru a/sound/oss/dmasound/Kconfig b/sound/oss/dmasound/Kconfig --- a/sound/oss/dmasound/Kconfig Sun Oct 5 00:33:08 2003 +++ b/sound/oss/dmasound/Kconfig Sun Oct 5 00:33:08 2003 @@ -1,7 +1,7 @@ -# drivers/sound/dmasound/Config.in config DMASOUND_ATARI tristate "Atari DMA sound support" depends on ATARI && SOUND + select DMASOUND help If you want to use the internal audio of your Atari in Linux, answer Y to this question. This will provide a Sun-like /dev/audio, @@ -15,6 +15,7 @@ config DMASOUND_PMAC tristate "PowerMac DMA sound support" depends on PPC_PMAC && SOUND && I2C + select DMASOUND help If you want to use the internal audio of your PowerMac in Linux, answer Y to this question. This will provide a Sun-like /dev/audio, @@ -28,6 +29,7 @@ config DMASOUND_PAULA tristate "Amiga DMA sound support" depends on (AMIGA || APUS) && SOUND + select DMASOUND help If you want to use the internal audio of your Amiga in Linux, answer Y to this question. This will provide a Sun-like /dev/audio, @@ -41,6 +43,7 @@ config DMASOUND_Q40 tristate "Q40 sound support" depends on Q40 && SOUND + select DMASOUND help If you want to use the internal audio of your Q40 in Linux, answer Y to this question. This will provide a Sun-like /dev/audio, @@ -53,13 +56,3 @@ config DMASOUND tristate - depends on SOUND!=n - default m if DMASOUND_ATARI!=y && DMASOUND_AWACS!=y && DMASOUND_PAULA!=y && DMASOUND_Q40!=y && (DMASOUND_ATARI=m || DMASOUND_AWACS=m || DMASOUND_PAULA=m || DMASOUND_Q40=m) - default y if DMASOUND_ATARI=y || DMASOUND_AWACS=y || DMASOUND_PAULA=y || DMASOUND_Q40=y - help - Support built-in audio chips accessible by DMA on various machines - that have them. Note that this symbol does not affect the kernel - directly; rather, it controls whether configuration questions - enabling DMA sound drivers for various specific machine - architectures will be used. - diff -Nru a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c --- a/sound/oss/dmasound/dac3550a.c Sun Oct 5 00:33:07 2003 +++ b/sound/oss/dmasound/dac3550a.c Sun Oct 5 00:33:07 2003 @@ -7,7 +7,6 @@ * for more details. */ -#include #include #include #include diff -Nru a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c --- a/sound/oss/dmasound/tas3001c.c Sun Oct 5 00:33:06 2003 +++ b/sound/oss/dmasound/tas3001c.c Sun Oct 5 00:33:06 2003 @@ -15,7 +15,6 @@ * */ -#include #include #include #include diff -Nru a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c --- a/sound/oss/dmasound/tas3004.c Sun Oct 5 00:33:09 2003 +++ b/sound/oss/dmasound/tas3004.c Sun Oct 5 00:33:09 2003 @@ -13,7 +13,6 @@ * */ -#include #include #include #include diff -Nru a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c --- a/sound/oss/dmasound/tas_common.c Sun Oct 5 00:33:08 2003 +++ b/sound/oss/dmasound/tas_common.c Sun Oct 5 00:33:08 2003 @@ -1,4 +1,3 @@ -#include #include #include #include diff -Nru a/sound/oss/harmony.c b/sound/oss/harmony.c --- a/sound/oss/harmony.c Sun Oct 5 00:33:09 2003 +++ b/sound/oss/harmony.c Sun Oct 5 00:33:09 2003 @@ -28,14 +28,14 @@ #include #include #include +#include #include #include #include #include -#include +#include #include -#include #include "sound_config.h" diff -Nru a/sound/oss/ite8172.c b/sound/oss/ite8172.c --- a/sound/oss/ite8172.c Sun Oct 5 00:33:07 2003 +++ b/sound/oss/ite8172.c Sun Oct 5 00:33:07 2003 @@ -54,7 +54,6 @@ * 07.30.2003 Removed initialisation to zero for static variables * (spdif[NR_DEVICE], i2s_fmt[NR_DEVICE], and devindex) */ -#include #include #include #include @@ -2238,8 +2237,9 @@ if (!options || !*options) return 0; - for(this_opt=strtok(options, ","); - this_opt; this_opt=strtok(NULL, ",")) { + while (this_opt = strsep(&options, ",")) { + if (!*this_opt) + continue; if (!strncmp(this_opt, "spdif", 5)) { spdif[nr_dev] = 1; } else if (!strncmp(this_opt, "i2s:", 4)) { diff -Nru a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c --- a/sound/oss/opl3sa2.c Sun Oct 5 00:33:05 2003 +++ b/sound/oss/opl3sa2.c Sun Oct 5 00:33:05 2003 @@ -324,15 +324,6 @@ } -static void opl3sa3_set_wide(opl3sa2_state_t* devc, int left, int right) -{ - unsigned char wide; - - wide = left ? ((unsigned char) (8 * left / 101)) : 0; - wide |= (right ? ((unsigned char) (8 * right / 101)) : 0) << 4; - - opl3sa2_write(devc->cfg_port, OPL3SA3_WIDE, wide); -} static void opl3sa2_mixer_reset(opl3sa2_state_t* devc) @@ -401,7 +392,7 @@ static int opl3sa2_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg) { - int cmdf = cmd & 0xff; + int retval, value, cmdf = cmd & 0xff; opl3sa2_state_t* devc = &opl3sa2_state[dev]; @@ -422,23 +413,31 @@ if (((cmd >> 8) & 0xff) != 'M') return -EINVAL; + retval = 0; if (_SIOC_DIR (cmd) & _SIOC_WRITE) { switch (cmdf) { case SOUND_MIXER_VOLUME: - arg_to_vol_stereo(*(unsigned int*)arg, - &devc->volume_l, &devc->volume_r); + retval = get_user(value, (unsigned int *) arg); + if (retval) + break; + arg_to_vol_stereo(value, &devc->volume_l, &devc->volume_r); opl3sa2_set_volume(devc, devc->volume_l, devc->volume_r); - *(int*)arg = ret_vol_stereo(devc->volume_l, devc->volume_r); - return 0; + value = ret_vol_stereo(devc->volume_l, devc->volume_r); + retval = put_user(value, (int *) arg); + break; case SOUND_MIXER_MIC: - arg_to_vol_mono(*(unsigned int*)arg, &devc->mic); + retval = get_user(value, (unsigned int *) arg); + if (retval) + break; + arg_to_vol_mono(value, &devc->mic); opl3sa2_set_mic(devc, devc->mic); - *(int*)arg = ret_vol_mono(devc->mic); - return 0; + value = ret_vol_mono(devc->mic); + retval = put_user(value, (int *) arg); + break; default: - return -EINVAL; + retval = -EINVAL; } } else { @@ -447,122 +446,72 @@ */ switch (cmdf) { case SOUND_MIXER_DEVMASK: - *(int*)arg = (SOUND_MASK_VOLUME | SOUND_MASK_MIC); - return 0; + retval = put_user(SOUND_MASK_VOLUME | SOUND_MASK_MIC, (int *) arg); + break; case SOUND_MIXER_STEREODEVS: - *(int*)arg = SOUND_MASK_VOLUME; - return 0; + retval = put_user(SOUND_MASK_VOLUME, (int *) arg); + break; case SOUND_MIXER_RECMASK: /* No recording devices */ - return (*(int*)arg = 0); + retval = put_user(0, (int *) arg); + break; case SOUND_MIXER_CAPS: - *(int*)arg = SOUND_CAP_EXCL_INPUT; - return 0; + retval = put_user(SOUND_CAP_EXCL_INPUT, (int *) arg); + break; case SOUND_MIXER_RECSRC: /* No recording source */ - return (*(int*)arg = 0); + retval = put_user(0, (int *) arg); + break; case SOUND_MIXER_VOLUME: - *(int*)arg = ret_vol_stereo(devc->volume_l, devc->volume_r); - return 0; + value = ret_vol_stereo(devc->volume_l, devc->volume_r); + retval = put_user(value, (int *) arg); + break; case SOUND_MIXER_MIC: - *(int*)arg = ret_vol_mono(devc->mic); - return 0; + value = ret_vol_mono(devc->mic); + put_user(value, (int *) arg); + break; default: - return -EINVAL; + retval = -EINVAL; } } + return retval; } /* opl3sa2_mixer_ioctl end */ static int opl3sa3_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg) { - int cmdf = cmd & 0xff; + int value, retval, cmdf = cmd & 0xff; opl3sa2_state_t* devc = &opl3sa2_state[dev]; switch (cmdf) { - case SOUND_MIXER_BASS: - case SOUND_MIXER_TREBLE: - case SOUND_MIXER_DIGITAL1: - case SOUND_MIXER_DEVMASK: - case SOUND_MIXER_STEREODEVS: - break; - - default: - return opl3sa2_mixer_ioctl(dev, cmd, arg); - } - - if (((cmd >> 8) & 0xff) != 'M') - return -EINVAL; + case SOUND_MIXER_BASS: + value = ret_vol_stereo(devc->bass_l, devc->bass_r); + retval = put_user(value, (int *) arg); + break; - if (_SIOC_DIR (cmd) & _SIOC_WRITE) { - switch (cmdf) { - case SOUND_MIXER_BASS: - arg_to_vol_stereo(*(unsigned int*)arg, - &devc->bass_l, &devc->bass_r); - opl3sa3_set_bass(devc, devc->bass_l, devc->bass_r); - *(int*)arg = ret_vol_stereo(devc->bass_l, devc->bass_r); - return 0; - - case SOUND_MIXER_TREBLE: - arg_to_vol_stereo(*(unsigned int*)arg, - &devc->treble_l, &devc->treble_r); - opl3sa3_set_treble(devc, devc->treble_l, devc->treble_r); - *(int*)arg = ret_vol_stereo(devc->treble_l, devc->treble_r); - return 0; - - case SOUND_MIXER_DIGITAL1: - arg_to_vol_stereo(*(unsigned int*)arg, - &devc->wide_l, &devc->wide_r); - opl3sa3_set_wide(devc, devc->wide_l, devc->wide_r); - *(int*)arg = ret_vol_stereo(devc->wide_l, devc->wide_r); - return 0; + case SOUND_MIXER_TREBLE: + value = ret_vol_stereo(devc->treble_l, devc->treble_r); + retval = put_user(value, (int *) arg); + break; + + case SOUND_MIXER_DIGITAL1: + value = ret_vol_stereo(devc->wide_l, devc->wide_r); + retval = put_user(value, (int *) arg); + break; - default: - return -EINVAL; - } - } - else - { - /* - * Return parameters - */ - switch (cmdf) { - case SOUND_MIXER_DEVMASK: - *(int*)arg = (SOUND_MASK_VOLUME | SOUND_MASK_MIC | - SOUND_MASK_BASS | SOUND_MASK_TREBLE | - SOUND_MASK_DIGITAL1); - return 0; - - case SOUND_MIXER_STEREODEVS: - *(int*)arg = (SOUND_MASK_VOLUME | SOUND_MASK_BASS | - SOUND_MASK_TREBLE | SOUND_MASK_DIGITAL1); - return 0; - - case SOUND_MIXER_BASS: - *(int*)arg = ret_vol_stereo(devc->bass_l, devc->bass_r); - return 0; - - case SOUND_MIXER_TREBLE: - *(int*)arg = ret_vol_stereo(devc->treble_l, devc->treble_r); - return 0; - - case SOUND_MIXER_DIGITAL1: - *(int*)arg = ret_vol_stereo(devc->wide_l, devc->wide_r); - return 0; - - default: - return -EINVAL; - } + default: + retval = -EINVAL; } + return retval; } /* opl3sa3_mixer_ioctl end */ diff -Nru a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c --- a/sound/oss/swarm_cs4297a.c Sun Oct 5 00:33:08 2003 +++ b/sound/oss/swarm_cs4297a.c Sun Oct 5 00:33:08 2003 @@ -59,7 +59,6 @@ *******************************************************************************/ #include -#include #include #include #include diff -Nru a/sound/parisc/harmony.c b/sound/parisc/harmony.c --- a/sound/parisc/harmony.c Sun Oct 5 00:33:08 2003 +++ b/sound/parisc/harmony.c Sun Oct 5 00:33:08 2003 @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -77,8 +78,8 @@ #include #include #include -#include #include +#include MODULE_AUTHOR("Laurent Canet "); MODULE_DESCRIPTION("ALSA Harmony sound driver"); @@ -709,8 +710,8 @@ * harmony is not "real" pci, but we need a pci_dev * to alloc PCI DMA pages */ - substream->dma_private = harmony->fake_pci_dev; - substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI; + substream->runtime->dma_private = harmony->fake_pci_dev; +// substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI; harmony->playback_substream = substream; runtime->hw = snd_card_harmony_playback; @@ -733,8 +734,8 @@ * harmony is not "real" pci, but we need a pci_dev * to alloc PCI DMA pages */ - substream->dma_private = harmony->fake_pci_dev; - substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI; + substream->runtime->dma_private = harmony->fake_pci_dev; +// substream->dma_type = SNDRV_PCM_DMA_TYPE_PCI; harmony->capture_substream = substream; runtime->hw = snd_card_harmony_capture; diff -Nru a/sound/pci/cmipci.c b/sound/pci/cmipci.c --- a/sound/pci/cmipci.c Sun Oct 5 00:33:09 2003 +++ b/sound/pci/cmipci.c Sun Oct 5 00:33:09 2003 @@ -2791,6 +2791,7 @@ * proc interface */ +#ifdef CONFIG_PROC_FS static void snd_cmipci_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) { @@ -2817,6 +2818,9 @@ if (! snd_card_proc_new(cm->card, "cmipci", &entry)) snd_info_set_text_ops(entry, cm, snd_cmipci_proc_read); } +#else /* !CONFIG_PROC_FS */ +static inline void snd_cmipci_proc_init(cmipci_t *cm) {} +#endif static struct pci_device_id snd_cmipci_ids[] = {