summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2003-04-29 22:56:05 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2003-04-29 22:56:05 -0700
commit7d5ab07dc7972ef5eb257864c422430c8b3df0bc (patch)
treea0d36078e981cef69e789aac045b94fffd13174f
parent25da53aa4497ccf38d2f17c9c28ca02583ddbe37 (diff)
parent4ede0350ba7bc8682ceae0d256d8d8d5d244aecf (diff)
Merge kroah.com:/home/linux/linux/BK/bleed-2.5
into kroah.com:/home/linux/linux/BK/gregkh-2.5
-rw-r--r--Documentation/filesystems/ntfs.txt13
-rw-r--r--arch/i386/Kconfig77
-rw-r--r--arch/i386/kernel/apm.c10
-rw-r--r--arch/i386/kernel/cpu/amd.c9
-rw-r--r--arch/i386/kernel/cpu/intel.c5
-rw-r--r--arch/i386/kernel/microcode.c19
-rw-r--r--arch/i386/kernel/setup.c88
-rw-r--r--arch/i386/kernel/timers/timer_cyclone.c12
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c9
-rw-r--r--arch/i386/vmlinux.lds.S1
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/ia32/ia32_ioctl.c218
-rw-r--r--arch/mips64/kernel/ioctl32.c67
-rw-r--r--arch/mips64/kernel/scall_o32.S2
-rw-r--r--arch/parisc/kernel/ioctl32.c849
-rw-r--r--arch/parisc/kernel/syscall.S3
-rw-r--r--arch/ppc/4xx_io/serial_sicc.c20
-rw-r--r--arch/ppc/8260_io/enet.c6
-rw-r--r--arch/ppc/8260_io/fcc_enet.c9
-rw-r--r--arch/ppc/8260_io/uart.c3
-rw-r--r--arch/ppc/amiga/amiints.c4
-rw-r--r--arch/ppc/amiga/config.c6
-rw-r--r--arch/ppc/kernel/cpu_setup_6xx.S20
-rw-r--r--arch/ppc/kernel/cputable.c34
-rw-r--r--arch/ppc/kernel/head.S24
-rw-r--r--arch/ppc/kernel/irq.c22
-rw-r--r--arch/ppc/kernel/l2cr.S142
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c2
-rw-r--r--arch/ppc/kernel/setup.c4
-rw-r--r--arch/ppc/kernel/smp.c1
-rw-r--r--arch/ppc/kernel/traps.c10
-rw-r--r--arch/ppc/platforms/4xx/redwood.h2
-rw-r--r--arch/ppc/platforms/4xx/redwood5.h4
-rwxr-xr-xarch/ppc/platforms/4xx/redwood6.h2
-rw-r--r--arch/ppc/platforms/chrp_setup.c9
-rw-r--r--arch/ppc/platforms/pmac_cpufreq.c12
-rw-r--r--arch/ppc/platforms/pmac_feature.c18
-rw-r--r--arch/ppc/platforms/pmac_pic.c25
-rw-r--r--arch/ppc/platforms/pmac_sleep.S81
-rw-r--r--arch/ppc/platforms/pmac_smp.c31
-rw-r--r--arch/ppc/platforms/prep_setup.c3
-rw-r--r--arch/ppc/syslib/m8xx_setup.c1
-rw-r--r--arch/ppc/syslib/open_pic.c3
-rw-r--r--arch/ppc/syslib/ppc8xx_pic.c3
-rw-r--r--arch/ppc/xmon/nonstdio.h1
-rw-r--r--arch/ppc/xmon/start.c1
-rw-r--r--arch/ppc/xmon/xmon.c161
-rw-r--r--arch/ppc64/kernel/ioctl32.c1616
-rw-r--r--arch/ppc64/kernel/misc.S4
-rw-r--r--arch/s390/kernel/compat_ioctl.c110
-rw-r--r--arch/sparc/kernel/ioport.c200
-rw-r--r--arch/sparc/lib/Makefile2
-rw-r--r--arch/sparc/lib/bitext.c114
-rw-r--r--arch/sparc/mm/init.c2
-rw-r--r--arch/sparc/mm/io-unit.c10
-rw-r--r--arch/sparc/mm/iommu.c338
-rw-r--r--arch/sparc/mm/loadmmu.c2
-rw-r--r--arch/sparc/mm/srmmu.c149
-rw-r--r--arch/sparc/mm/sun4c.c40
-rw-r--r--arch/sparc64/defconfig100
-rw-r--r--arch/sparc64/kernel/ioctl32.c737
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c4
-rw-r--r--arch/sparc64/kernel/sunos_ioctl32.c52
-rw-r--r--arch/sparc64/kernel/systbls.S2
-rw-r--r--arch/sparc64/solaris/ioctl.c47
-rw-r--r--arch/sparc64/solaris/timod.c2
-rw-r--r--arch/x86_64/ia32/ia32_ioctl.c850
-rw-r--r--arch/x86_64/ia32/ia32entry.S2
-rw-r--r--drivers/block/DAC960.c307
-rw-r--r--drivers/block/DAC960.h5
-rw-r--r--drivers/block/xd.c16
-rw-r--r--drivers/bluetooth/bluecard_cs.c13
-rw-r--r--drivers/bluetooth/bt3c_cs.c13
-rw-r--r--drivers/bluetooth/btuart_cs.c13
-rw-r--r--drivers/bluetooth/dtl1_cs.c13
-rw-r--r--drivers/char/misc.c13
-rw-r--r--drivers/char/mwave/mwavedd.c14
-rw-r--r--drivers/char/mwave/mwavedd.h2
-rw-r--r--drivers/char/pcmcia/synclink_cs.c6
-rw-r--r--drivers/i2c/i2c-elektor.c3
-rw-r--r--drivers/ide/ide-disk.c12
-rw-r--r--drivers/ide/ide-iops.c4
-rw-r--r--drivers/ide/ide-taskfile.c184
-rw-r--r--drivers/ide/ide.c11
-rw-r--r--drivers/ide/legacy/ide-cs.c8
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c8
-rw-r--r--drivers/isdn/hisax/avma1_cs.c8
-rw-r--r--drivers/isdn/hisax/elsa_cs.c8
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c8
-rw-r--r--drivers/mca/Kconfig3
-rw-r--r--drivers/md/dm-ioctl.c14
-rw-r--r--drivers/media/radio/miropcm20-rds.c16
-rw-r--r--drivers/media/video/bttv-driver.c12
-rw-r--r--drivers/mtd/maps/pcmciamtd.c9
-rw-r--r--drivers/net/irda/ali-ircc.c9
-rw-r--r--drivers/net/irda/donauboe.c7
-rw-r--r--drivers/net/irda/nsc-ircc.c7
-rw-r--r--drivers/net/irda/smc-ircc.c4
-rw-r--r--drivers/net/irda/toshoboe.c9
-rw-r--r--drivers/net/irda/vlsi_ir.c8
-rw-r--r--drivers/net/irda/w83977af_ir.c8
-rw-r--r--drivers/net/pcmcia/3c574_cs.c10
-rw-r--r--drivers/net/pcmcia/3c589_cs.c8
-rw-r--r--drivers/net/pcmcia/axnet_cs.c8
-rw-r--r--drivers/net/pcmcia/com20020_cs.c8
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c10
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c8
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c11
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c8
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c8
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c7
-rw-r--r--drivers/net/wan/Kconfig8
-rw-r--r--drivers/net/wan/c101.c9
-rw-r--r--drivers/net/wan/n2.c10
-rw-r--r--drivers/net/wireless/airo_cs.c8
-rw-r--r--drivers/net/wireless/netwave_cs.c8
-rw-r--r--drivers/net/wireless/orinoco_cs.c8
-rw-r--r--drivers/net/wireless/ray_cs.c6
-rw-r--r--drivers/net/wireless/wavelan_cs.c10
-rw-r--r--drivers/parport/parport_cs.c8
-rw-r--r--drivers/pcmcia/ds.c7
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c10
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c10
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c7
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c10
-rw-r--r--drivers/serial/8250_cs.c9
-rw-r--r--drivers/serial/8250_pci.c2
-rw-r--r--drivers/telephony/ixj_pcmcia.c9
-rw-r--r--fs/Kconfig2
-rw-r--r--fs/block_dev.c11
-rw-r--r--fs/buffer.c3
-rw-r--r--fs/compat.c224
-rw-r--r--fs/ext3/super.c12
-rw-r--r--fs/filesystems.c12
-rw-r--r--fs/ntfs/ChangeLog25
-rw-r--r--fs/ntfs/Makefile2
-rw-r--r--fs/ntfs/aops.c33
-rw-r--r--fs/ntfs/attrib.c52
-rw-r--r--fs/ntfs/attrib.h8
-rw-r--r--fs/ntfs/compress.c96
-rw-r--r--fs/ntfs/dir.c146
-rw-r--r--fs/ntfs/inode.c240
-rw-r--r--fs/ntfs/inode.h38
-rw-r--r--fs/ntfs/layout.h182
-rw-r--r--fs/ntfs/mft.c28
-rw-r--r--fs/ntfs/namei.c10
-rw-r--r--fs/ntfs/super.c189
-rw-r--r--fs/ntfs/unistr.c8
-rw-r--r--fs/ntfs/upcase.c10
-rw-r--r--fs/partitions/check.c21
-rw-r--r--fs/partitions/check.h2
-rw-r--r--fs/proc/generic.c4
-rw-r--r--include/asm-i386/cpufeature.h5
-rw-r--r--include/asm-i386/processor.h88
-rw-r--r--include/asm-i386/system.h40
-rw-r--r--include/asm-ppc/bug.h2
-rw-r--r--include/asm-ppc/cputable.h1
-rw-r--r--include/asm-ppc/delay.h2
-rw-r--r--include/asm-ppc/processor.h33
-rw-r--r--include/asm-ppc/system.h2
-rw-r--r--include/asm-ppc/xmon.h17
-rw-r--r--include/asm-sparc/bitext.h24
-rw-r--r--include/asm-sparc/iommu.h9
-rw-r--r--include/asm-sparc/pgtable.h28
-rw-r--r--include/asm-sparc/sbus.h2
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/initrd.h2
-rw-r--r--include/linux/ioctl32.h7
-rw-r--r--include/linux/list.h4
-rw-r--r--include/linux/module.h63
-rw-r--r--include/linux/percpu_counter.h2
-rw-r--r--include/linux/slab.h7
-rw-r--r--include/net/irda/irport.h2
-rw-r--r--include/pcmcia/ds.h16
-rw-r--r--kernel/fork.c10
-rw-r--r--kernel/ksyms.c1
-rw-r--r--kernel/module.c90
-rw-r--r--lib/percpu_counter.c1
-rw-r--r--mm/oom_kill.c26
-rw-r--r--mm/vmscan.c20
-rw-r--r--net/802/psnap.c32
-rw-r--r--net/bridge/br_fdb.c113
-rw-r--r--net/bridge/br_private.h5
-rw-r--r--net/core/netfilter.c9
-rw-r--r--net/core/skbuff.c75
-rw-r--r--net/core/sysctl_net_core.c9
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/ipip.c4
-rw-r--r--net/llc/af_llc.c141
-rw-r--r--net/llc/llc_actn.c2
-rw-r--r--net/llc/llc_c_ac.c55
-rw-r--r--net/llc/llc_c_ev.c56
-rw-r--r--net/llc/llc_c_st.c2
-rw-r--r--net/llc/llc_conn.c27
-rw-r--r--net/llc/llc_evnt.c2
-rw-r--r--net/llc/llc_if.c2
-rw-r--r--net/llc/llc_mac.c67
-rw-r--r--net/llc/llc_main.c4
-rw-r--r--net/llc/llc_pdu.c72
-rw-r--r--net/llc/llc_proc.c2
-rw-r--r--net/llc/llc_s_ac.c2
-rw-r--r--net/llc/llc_s_ev.c2
-rw-r--r--net/llc/llc_s_st.c2
-rw-r--r--net/llc/llc_sap.c2
-rw-r--r--net/llc/llc_stat.c2
-rw-r--r--net/sched/cls_api.c34
-rw-r--r--net/sched/cls_fw.c3
-rw-r--r--net/sched/cls_u32.c10
-rw-r--r--net/sched/sch_api.c16
-rw-r--r--net/sched/sch_ingress.c18
-rw-r--r--scripts/modpost.c4
213 files changed, 3835 insertions, 6244 deletions
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
index 4483b90a31d3..850354876aa6 100644
--- a/Documentation/filesystems/ntfs.txt
+++ b/Documentation/filesystems/ntfs.txt
@@ -247,6 +247,19 @@ ChangeLog
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
+2.1.4:
+ - Minor update allowing compilation with all gcc versions (well, the
+ ones the kernel can be compiled with anyway).
+2.1.3:
+ - Major bug fixes for reading files and volumes in corner cases which
+ were being hit by Windows 2k/XP users.
+2.1.2:
+ - Major bug fixes aleviating the hangs in statfs experienced by some
+ users.
+2.1.1:
+ - Update handling of compressed files so people no longer get the
+ frequently reported warning messages about initialized_size !=
+ data_size.
2.1.0:
- Add configuration option for developmental write support.
- Initial implementation of file overwriting. (Writes to resident files
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 234e92cbf4ba..e8db108b8194 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -273,6 +273,13 @@ config MVIAC3_2
endchoice
+config X86_GENERIC
+ bool "Generic x86 support"
+ help
+ Including some tuning for non selected x86 CPUs too.
+ when it has moderate overhead. This is intended for generic
+ distributions kernels.
+
#
# Define implied options from the CPU selection here
#
@@ -288,10 +295,10 @@ config X86_XADD
config X86_L1_CACHE_SHIFT
int
+ default "7" if MPENTIUM4 || X86_GENERIC
default "4" if MELAN || M486 || M386
default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2
default "6" if MK7 || MK8
- default "7" if MPENTIUM4
config RWSEM_GENERIC_SPINLOCK
bool
@@ -363,16 +370,6 @@ config X86_OOSTORE
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6
default y
-config X86_PREFETCH
- bool
- depends on MPENTIUMIII || MPENTIUM4 || MVIAC3_2
- default y
-
-config X86_SSE2
- bool
- depends on MK8 || MPENTIUM4
- default y
-
config HUGETLB_PAGE
bool "Huge TLB Page Support"
help
@@ -413,6 +410,18 @@ config SMP
If you don't know what to do here, say N.
+config NR_CPUS
+ int "Maximum number of CPUs (2-32)"
+ depends on SMP
+ default "32"
+ help
+ This allows you to specify the maximum number of CPUs which this
+ kernel will support. The maximum supported value is 32 and the
+ minimum value which makes sense is 2.
+
+ This is purely to save memory - each supported CPU adds
+ approximately eight kilobytes to the kernel image.
+
config PREEMPT
bool "Preemptible Kernel"
help
@@ -465,18 +474,6 @@ config X86_IO_APIC
depends on !SMP && X86_UP_IOAPIC
default y
-config NR_CPUS
- int "Maximum number of CPUs (2-32)"
- depends on SMP
- default "32"
- help
- This allows you to specify the maximum number of CPUs which this
- kernel will support. The maximum supported value is 32 and the
- minimum value which makes sense is 2.
-
- This is purely to save memory - each supported CPU adds
- approximately eight kilobytes to the kernel image.
-
config X86_TSC
bool
depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ
@@ -989,6 +986,11 @@ config X86_LOCAL_APIC
depends on (X86_VISWS || SMP) && !X86_VOYAGER
default y
+config X86_IO_APIC
+ bool
+ depends on SMP && !(X86_VISWS || X86_VOYAGER)
+ default y
+
config PCI
bool "PCI support" if !X86_VISWS
depends on !X86_VOYAGER
@@ -1004,11 +1006,6 @@ config PCI
information about which PCI hardware does work under Linux and which
doesn't.
-config X86_IO_APIC
- bool
- depends on SMP && !(X86_VISWS || X86_VOYAGER)
- default y
-
choice
prompt "PCI access mode"
depends on PCI && !X86_VISWS
@@ -1048,18 +1045,6 @@ config PCI_DIRECT
depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
default y
-config SCx200
- tristate "NatSemi SCx200 support"
- depends on !X86_VOYAGER
- help
- This provides basic support for the National Semiconductor SCx200
- processor. Right now this is just a driver for the GPIO pins.
-
- If you don't know what to do here, say N.
-
- This support is also available as a module. If compiled as a
- module, it will be called scx200.
-
source "drivers/pci/Kconfig"
config ISA
@@ -1105,6 +1090,18 @@ config MCA
source "drivers/mca/Kconfig"
+config SCx200
+ tristate "NatSemi SCx200 support"
+ depends on !X86_VOYAGER
+ help
+ This provides basic support for the National Semiconductor SCx200
+ processor. Right now this is just a driver for the GPIO pins.
+
+ If you don't know what to do here, say N.
+
+ This support is also available as a module. If compiled as a
+ module, it will be called scx200.
+
config HOTPLUG
bool "Support for hot-pluggable devices"
---help---
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 14287677cfb9..db98751f2cdf 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -1205,7 +1205,17 @@ static int suspend(int vetoable)
spin_lock(&i8253_lock);
get_time_diff();
+ /*
+ * Irq spinlock must be dropped around set_system_power_state.
+ * We'll undo any timer changes due to interrupts below.
+ */
+ spin_unlock(&i8253_lock);
+ write_sequnlock_irq(&xtime_lock);
+
err = set_system_power_state(APM_STATE_SUSPEND);
+
+ write_seqlock_irq(&xtime_lock);
+ spin_lock(&i8253_lock);
reinit_timer();
set_time();
ignore_normal_resume = 1;
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index ff810509b8fe..091b98ae93b6 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -178,6 +178,15 @@ static void __init init_amd(struct cpuinfo_x86 *c)
break;
}
+ switch (c->x86) {
+ case 15:
+ set_bit(X86_FEATURE_K8, c->x86_capability);
+ break;
+ case 6:
+ set_bit(X86_FEATURE_K7, c->x86_capability);
+ break;
+ }
+
display_cacheinfo(c);
}
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/i386/kernel/cpu/intel.c
index 69aa8304f797..1736d1a2115b 100644
--- a/arch/i386/kernel/cpu/intel.c
+++ b/arch/i386/kernel/cpu/intel.c
@@ -353,6 +353,11 @@ too_many_siblings:
break;
}
#endif
+
+ if (c->x86 == 15)
+ set_bit(X86_FEATURE_P4, c->x86_capability);
+ if (c->x86 == 6)
+ set_bit(X86_FEATURE_P3, c->x86_capability);
}
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index 0371e43806e8..0bdee784f11e 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -65,7 +65,6 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/miscdevice.h>
-#include <linux/devfs_fs_kernel.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
@@ -116,9 +115,10 @@ static struct file_operations microcode_fops = {
};
static struct miscdevice microcode_dev = {
- .minor = MICROCODE_MINOR,
- .name = "microcode",
- .fops = &microcode_fops,
+ .minor = MICROCODE_MINOR,
+ .name = "microcode",
+ .devfs_name = "cpu/microcode",
+ .fops = &microcode_fops,
};
static int __init microcode_init(void)
@@ -127,26 +127,17 @@ static int __init microcode_init(void)
error = misc_register(&microcode_dev);
if (error)
- goto fail;
- error = devfs_mk_symlink("cpu/microcode", "../misc/microcode");
- if (error)
- goto fail_deregister;
+ return error;
printk(KERN_INFO
"IA-32 Microcode Update Driver: v%s <tigran@veritas.com>\n",
MICROCODE_VERSION);
return 0;
-
-fail_deregister:
- misc_deregister(&microcode_dev);
-fail:
- return error;
}
static void __exit microcode_exit(void)
{
misc_deregister(&microcode_dev);
- devfs_remove("cpu/microcode");
kfree(mc_applied);
printk(KERN_INFO "IA-32 Microcode Update Driver v%s unregistered\n",
MICROCODE_VERSION);
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 9c20d88208ae..26efeeb167c2 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -795,41 +795,91 @@ static void __init register_memory(unsigned long max_low_pfn)
pci_mem_start = low_mem_size;
}
+/* Use inline assembly to define this because the nops are defined
+ as inline assembly strings in the include files and we cannot
+ get them easily into strings. */
+asm("intelnops: "
+ GENERIC_NOP1 GENERIC_NOP2 GENERIC_NOP3 GENERIC_NOP4 GENERIC_NOP5 GENERIC_NOP6
+ GENERIC_NOP7 GENERIC_NOP8);
+asm("k8nops: "
+ K8_NOP1 K8_NOP2 K8_NOP3 K8_NOP4 K8_NOP5 K8_NOP6
+ K8_NOP7 K8_NOP8);
+asm("k7nops: "
+ K7_NOP1 K7_NOP2 K7_NOP3 K7_NOP4 K7_NOP5 K7_NOP6
+ K7_NOP7 K7_NOP8);
+
+extern unsigned char intelnops[], k8nops[], k7nops[];
+static unsigned char *intel_nops[ASM_NOP_MAX+1] = {
+ NULL,
+ intelnops,
+ intelnops + 1,
+ intelnops + 1 + 2,
+ intelnops + 1 + 2 + 3,
+ intelnops + 1 + 2 + 3 + 4,
+ intelnops + 1 + 2 + 3 + 4 + 5,
+ intelnops + 1 + 2 + 3 + 4 + 5 + 6,
+ intelnops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
+};
+static unsigned char *k8_nops[ASM_NOP_MAX+1] = {
+ NULL,
+ k8nops,
+ k8nops + 1,
+ k8nops + 1 + 2,
+ k8nops + 1 + 2 + 3,
+ k8nops + 1 + 2 + 3 + 4,
+ k8nops + 1 + 2 + 3 + 4 + 5,
+ k8nops + 1 + 2 + 3 + 4 + 5 + 6,
+ k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
+};
+static unsigned char *k7_nops[ASM_NOP_MAX+1] = {
+ NULL,
+ k7nops,
+ k7nops + 1,
+ k7nops + 1 + 2,
+ k7nops + 1 + 2 + 3,
+ k7nops + 1 + 2 + 3 + 4,
+ k7nops + 1 + 2 + 3 + 4 + 5,
+ k7nops + 1 + 2 + 3 + 4 + 5 + 6,
+ k7nops + 1 + 2 + 3 + 4 + 5 + 6 + 7,
+};
+static struct nop {
+ int cpuid;
+ unsigned char **noptable;
+} noptypes[] = {
+ { X86_FEATURE_K8, k8_nops },
+ { X86_FEATURE_K7, k7_nops },
+ { -1, 0 }
+};
+
/* Replace instructions with better alternatives for this CPU type.
This runs before SMP is initialized to avoid SMP problems with
self modifying code. This implies that assymetric systems where
APs have less capabilities than the boot processor are not handled.
-
In this case boot with "noreplacement". */
void apply_alternatives(void *start, void *end)
{
struct alt_instr *a;
int diff, i, k;
-
- for (a = start; a < (struct alt_instr *)end;
- a = (void *)ALIGN((unsigned long)(a + 1) + a->instrlen, 4)) {
+ unsigned char **noptable = intel_nops;
+ for (i = 0; noptypes[i].cpuid >= 0; i++) {
+ if (boot_cpu_has(noptypes[i].cpuid)) {
+ noptable = noptypes[i].noptable;
+ break;
+ }
+ }
+ for (a = start; (void *)a < end; a++) {
if (!boot_cpu_has(a->cpuid))
continue;
BUG_ON(a->replacementlen > a->instrlen);
memcpy(a->instr, a->replacement, a->replacementlen);
diff = a->instrlen - a->replacementlen;
+ /* Pad the rest with nops */
for (i = a->replacementlen; diff > 0; diff -= k, i += k) {
- static const char *nops[] = {
- 0,
- "\x90",
-#if CONFIG_MK7 || CONFIG_MK8
- "\x66\x90",
- "\x66\x66\x90",
- "\x66\x66\x66\x90",
-#else
- "\x89\xf6",
- "\x8d\x76\x00",
- "\x8d\x74\x26\x00",
-#endif
- };
- k = min_t(int, diff, ARRAY_SIZE(nops));
- memcpy(a->instr + i, nops[k], k);
+ k = diff;
+ if (k > ASM_NOP_MAX)
+ k = ASM_NOP_MAX;
+ memcpy(a->instr + i, noptable[k], k);
}
}
}
diff --git a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c
index 7cdf4d7bca6f..0d2c2baf2a64 100644
--- a/arch/i386/kernel/timers/timer_cyclone.c
+++ b/arch/i386/kernel/timers/timer_cyclone.c
@@ -67,11 +67,11 @@ static void mark_offset_cyclone(void)
/* lost tick compensation */
delta = last_cyclone_low - delta;
- delta /=(CYCLONE_TIMER_FREQ/1000000);
+ delta /= (CYCLONE_TIMER_FREQ/1000000);
delta += delay_at_last_interrupt;
lost = delta/(1000000/HZ);
delay = delta%(1000000/HZ);
- if(lost >= 2)
+ if (lost >= 2)
jiffies += lost-1;
/* update the monotonic base value */
@@ -83,10 +83,12 @@ static void mark_offset_cyclone(void)
count = ((LATCH-1) - count) * TICK_SIZE;
delay_at_last_interrupt = (count + LATCH/2) / LATCH;
- /* catch corner case where tick rollover
- * occured between cyclone and pit reads
+
+ /* catch corner case where tick rollover occured
+ * between cyclone and pit reads (as noted when
+ * usec delta is > 90% # of usecs/tick)
*/
- if(abs(delay - delay_at_last_interrupt) > 900)
+ if (abs(delay - delay_at_last_interrupt) > (900000/HZ))
jiffies++;
}
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index e7c126d30e42..02de71f68d9e 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -178,7 +178,7 @@ static void mark_offset_tsc(void)
delta += delay_at_last_interrupt;
lost = delta/(1000000/HZ);
delay = delta%(1000000/HZ);
- if(lost >= 2)
+ if (lost >= 2)
jiffies += lost-1;
/* update the monotonic base value */
@@ -190,10 +190,11 @@ static void mark_offset_tsc(void)
count = ((LATCH-1) - count) * TICK_SIZE;
delay_at_last_interrupt = (count + LATCH/2) / LATCH;
- /* catch corner case where tick rollover
- * occured between tsc and pit reads
+ /* catch corner case where tick rollover occured
+ * between tsc and pit reads (as noted when
+ * usec delta is > 90% # of usecs/tick)
*/
- if(abs(delay - delay_at_last_interrupt) > 900)
+ if (abs(delay - delay_at_last_interrupt) > (900000/HZ))
jiffies++;
}
diff --git a/arch/i386/vmlinux.lds.S b/arch/i386/vmlinux.lds.S
index b6a3f2de1bcf..56401363b4f6 100644
--- a/arch/i386/vmlinux.lds.S
+++ b/arch/i386/vmlinux.lds.S
@@ -85,6 +85,7 @@ SECTIONS
__alt_instructions = .;
.altinstructions : { *(.altinstructions) }
__alt_instructions_end = .;
+ .altinstr_replacement : { *(.altinstr_replacement) }
. = ALIGN(4096);
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index a13ffb194ddf..3d271ebeb60d 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -252,7 +252,7 @@ ia32_syscall_table:
data8 sys_acct
data8 sys_umount /* recycled never used phys( */
data8 sys32_ni_syscall /* old lock syscall holder */
- data8 sys32_ioctl
+ data8 compat_sys_ioctl
data8 compat_sys_fcntl /* 55 */
data8 sys32_ni_syscall /* old mpx syscall holder */
data8 sys_setpgid
diff --git a/arch/ia64/ia32/ia32_ioctl.c b/arch/ia64/ia32/ia32_ioctl.c
index c130c6bb699a..0ead044117f4 100644
--- a/arch/ia64/ia32/ia32_ioctl.c
+++ b/arch/ia64/ia32/ia32_ioctl.c
@@ -293,221 +293,3 @@ out:
}
return err;
}
-
-asmlinkage long
-sys32_ioctl (unsigned int fd, unsigned int cmd, unsigned int arg)
-{
- long ret;
-
- switch (IOCTL_NR(cmd)) {
- case IOCTL_NR(VFAT_IOCTL_READDIR_SHORT):
- case IOCTL_NR(VFAT_IOCTL_READDIR_BOTH): {
- struct linux32_dirent *d32 = P(arg);
- struct dirent d[2];
-
- ret = DO_IOCTL(fd, _IOR('r', _IOC_NR(cmd),
- struct dirent [2]),
- (unsigned long) d);
- if (ret < 0)
- return ret;
-
- if (put_dirent32(d, d32) || put_dirent32(d + 1, d32 + 1))
- return -EFAULT;
-
- return ret;
- }
- case IOCTL_NR(SIOCGIFCONF):
- {
- struct ifconf32 {
- int ifc_len;
- unsigned int ifc_ptr;
- } ifconf32;
- struct ifconf ifconf;
- int i, n;
- char *p32, *p64;
- char buf[32]; /* sizeof IA32 ifreq structure */
-
- if (copy_from_user(&ifconf32, P(arg), sizeof(ifconf32)))
- return -EFAULT;
- ifconf.ifc_len = ifconf32.ifc_len;
- ifconf.ifc_req = P(ifconf32.ifc_ptr);
- ret = DO_IOCTL(fd, SIOCGIFCONF, &ifconf);
- ifconf32.ifc_len = ifconf.ifc_len;
- if (copy_to_user(P(arg), &ifconf32, sizeof(ifconf32)))
- return -EFAULT;
- n = ifconf.ifc_len / sizeof(struct ifreq);
- p32 = P(ifconf32.ifc_ptr);
- p64 = P(ifconf32.ifc_ptr);
- for (i = 0; i < n; i++) {
- if (copy_from_user(buf, p64, sizeof(struct ifreq)))
- return -EFAULT;
- if (copy_to_user(p32, buf, sizeof(buf)))
- return -EFAULT;
- p32 += sizeof(buf);
- p64 += sizeof(struct ifreq);
- }
- return ret;
- }
-
- case IOCTL_NR(DRM_IOCTL_VERSION):
- {
- drm_version_t ver;
- struct {
- int version_major;
- int version_minor;
- int version_patchlevel;
- unsigned int name_len;
- unsigned int name; /* pointer */
- unsigned int date_len;
- unsigned int date; /* pointer */
- unsigned int desc_len;
- unsigned int desc; /* pointer */
- } ver32;
-
- if (copy_from_user(&ver32, P(arg), sizeof(ver32)))
- return -EFAULT;
- ver.name_len = ver32.name_len;
- ver.name = P(ver32.name);
- ver.date_len = ver32.date_len;
- ver.date = P(ver32.date);
- ver.desc_len = ver32.desc_len;
- ver.desc = P(ver32.desc);
- ret = DO_IOCTL(fd, DRM_IOCTL_VERSION, &ver);
- if (ret >= 0) {
- ver32.version_major = ver.version_major;
- ver32.version_minor = ver.version_minor;
- ver32.version_patchlevel = ver.version_patchlevel;
- ver32.name_len = ver.name_len;
- ver32.date_len = ver.date_len;
- ver32.desc_len = ver.desc_len;
- if (copy_to_user(P(arg), &ver32, sizeof(ver32)))
- return -EFAULT;
- }
- return ret;
- }
-
- case IOCTL_NR(DRM_IOCTL_GET_UNIQUE):
- {
- drm_unique_t un;
- struct {
- unsigned int unique_len;
- unsigned int unique;
- } un32;
-
- if (copy_from_user(&un32, P(arg), sizeof(un32)))
- return -EFAULT;
- un.unique_len = un32.unique_len;
- un.unique = P(un32.unique);
- ret = DO_IOCTL(fd, DRM_IOCTL_GET_UNIQUE, &un);
- if (ret >= 0) {
- un32.unique_len = un.unique_len;
- if (copy_to_user(P(arg), &un32, sizeof(un32)))
- return -EFAULT;
- }
- return ret;
- }
- case IOCTL_NR(DRM_IOCTL_SET_UNIQUE):
- case IOCTL_NR(DRM_IOCTL_ADD_MAP):
- case IOCTL_NR(DRM_IOCTL_ADD_BUFS):
- case IOCTL_NR(DRM_IOCTL_MARK_BUFS):
- case IOCTL_NR(DRM_IOCTL_INFO_BUFS):
- case IOCTL_NR(DRM_IOCTL_MAP_BUFS):
- case IOCTL_NR(DRM_IOCTL_FREE_BUFS):
- case IOCTL_NR(DRM_IOCTL_ADD_CTX):
- case IOCTL_NR(DRM_IOCTL_RM_CTX):
- case IOCTL_NR(DRM_IOCTL_MOD_CTX):
- case IOCTL_NR(DRM_IOCTL_GET_CTX):
- case IOCTL_NR(DRM_IOCTL_SWITCH_CTX):
- case IOCTL_NR(DRM_IOCTL_NEW_CTX):
- case IOCTL_NR(DRM_IOCTL_RES_CTX):
-
- case IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE):
- case IOCTL_NR(DRM_IOCTL_AGP_RELEASE):
- case IOCTL_NR(DRM_IOCTL_AGP_ENABLE):
- case IOCTL_NR(DRM_IOCTL_AGP_INFO):
- case IOCTL_NR(DRM_IOCTL_AGP_ALLOC):
- case IOCTL_NR(DRM_IOCTL_AGP_FREE):
- case IOCTL_NR(DRM_IOCTL_AGP_BIND):
- case IOCTL_NR(DRM_IOCTL_AGP_UNBIND):
-
- /* Mga specific ioctls */
-
- case IOCTL_NR(DRM_IOCTL_MGA_INIT):
-
- /* I810 specific ioctls */
-
- case IOCTL_NR(DRM_IOCTL_I810_GETBUF):
- case IOCTL_NR(DRM_IOCTL_I810_COPY):
-
- case IOCTL_NR(MTIOCGET):
- case IOCTL_NR(MTIOCPOS):
- case IOCTL_NR(MTIOCGETCONFIG):
- case IOCTL_NR(MTIOCSETCONFIG):
- case IOCTL_NR(PPPIOCSCOMPRESS):
- case IOCTL_NR(PPPIOCGIDLE):
- case IOCTL_NR(NCP_IOC_GET_FS_INFO_V2):
- case IOCTL_NR(NCP_IOC_GETOBJECTNAME):
- case IOCTL_NR(NCP_IOC_SETOBJECTNAME):
- case IOCTL_NR(NCP_IOC_GETPRIVATEDATA):
- case IOCTL_NR(NCP_IOC_SETPRIVATEDATA):
- case IOCTL_NR(NCP_IOC_GETMOUNTUID2):
- case IOCTL_NR(CAPI_MANUFACTURER_CMD):
- case IOCTL_NR(VIDIOCGTUNER):
- case IOCTL_NR(VIDIOCSTUNER):
- case IOCTL_NR(VIDIOCGWIN):
- case IOCTL_NR(VIDIOCSWIN):
- case IOCTL_NR(VIDIOCGFBUF):
- case IOCTL_NR(VIDIOCSFBUF):
- case IOCTL_NR(MGSL_IOCSPARAMS):
- case IOCTL_NR(MGSL_IOCGPARAMS):
- case IOCTL_NR(ATM_GETNAMES):
- case IOCTL_NR(ATM_GETLINKRATE):
- case IOCTL_NR(ATM_GETTYPE):
- case IOCTL_NR(ATM_GETESI):
- case IOCTL_NR(ATM_GETADDR):
- case IOCTL_NR(ATM_RSTADDR):
- case IOCTL_NR(ATM_ADDADDR):
- case IOCTL_NR(ATM_DELADDR):
- case IOCTL_NR(ATM_GETCIRANGE):
- case IOCTL_NR(ATM_SETCIRANGE):
- case IOCTL_NR(ATM_SETESI):
- case IOCTL_NR(ATM_SETESIF):
- case IOCTL_NR(ATM_GETSTAT):
- case IOCTL_NR(ATM_GETSTATZ):
- case IOCTL_NR(ATM_GETLOOP):
- case IOCTL_NR(ATM_SETLOOP):
- case IOCTL_NR(ATM_QUERYLOOP):
- case IOCTL_NR(ENI_SETMULT):
- case IOCTL_NR(NS_GETPSTAT):
- /* case IOCTL_NR(NS_SETBUFLEV): This is a duplicate case with ZATM_GETPOOLZ */
- case IOCTL_NR(ZATM_GETPOOLZ):
- case IOCTL_NR(ZATM_GETPOOL):
- case IOCTL_NR(ZATM_SETPOOL):
- case IOCTL_NR(ZATM_GETTHIST):
- case IOCTL_NR(IDT77105_GETSTAT):
- case IOCTL_NR(IDT77105_GETSTATZ):
- case IOCTL_NR(IXJCTL_TONE_CADENCE):
- case IOCTL_NR(IXJCTL_FRAMES_READ):
- case IOCTL_NR(IXJCTL_FRAMES_WRITTEN):
- case IOCTL_NR(IXJCTL_READ_WAIT):
- case IOCTL_NR(IXJCTL_WRITE_WAIT):
- case IOCTL_NR(IXJCTL_DRYBUFFER_READ):
- case IOCTL_NR(I2OHRTGET):
- case IOCTL_NR(I2OLCTGET):
- case IOCTL_NR(I2OPARMSET):
- case IOCTL_NR(I2OPARMGET):
- case IOCTL_NR(I2OSWDL):
- case IOCTL_NR(I2OSWUL):
- case IOCTL_NR(I2OSWDEL):
- case IOCTL_NR(I2OHTML):
- break;
- default:
- return sys_ioctl(fd, cmd, (unsigned long)arg);
-
- case IOCTL_NR(SG_IO):
- return(sg_ioctl_trans(fd, cmd, arg));
-
- }
- printk(KERN_ERR "%x:unimplemented IA32 ioctl system call\n", cmd);
- return -EINVAL;
-}
diff --git a/arch/mips64/kernel/ioctl32.c b/arch/mips64/kernel/ioctl32.c
index 1636b8c70a30..6ce59843a856 100644
--- a/arch/mips64/kernel/ioctl32.c
+++ b/arch/mips64/kernel/ioctl32.c
@@ -822,70 +822,3 @@ static struct ioctl32_list ioctl32_handler_table[] = {
#define NR_IOCTL32_HANDLERS (sizeof(ioctl32_handler_table) / \
sizeof(ioctl32_handler_table[0]))
-
-static struct ioctl32_list *ioctl32_hash_table[1024];
-
-static inline int ioctl32_hash(unsigned int cmd)
-{
- return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
-}
-
-int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned int arg)
-{
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- struct file *filp;
- struct ioctl32_list *l;
- int error;
-
- l = ioctl32_hash_table[ioctl32_hash(cmd)];
-
- error = -EBADF;
-
- filp = fget(fd);
- if (!filp)
- return error;
-
- if (!filp->f_op || !filp->f_op->ioctl) {
- error = sys_ioctl (fd, cmd, arg);
- goto out;
- }
-
- while (l && l->handler.cmd != cmd)
- l = l->next;
-
- if (l) {
- handler = (void *)l->handler.function;
- error = handler(fd, cmd, arg, filp);
- } else {
- error = -EINVAL;
- printk("unknown ioctl: %08x\n", cmd);
- }
-out:
- fput(filp);
- return error;
-}
-
-static void ioctl32_insert(struct ioctl32_list *entry)
-{
- int hash = ioctl32_hash(entry->handler.cmd);
- if (!ioctl32_hash_table[hash])
- ioctl32_hash_table[hash] = entry;
- else {
- struct ioctl32_list *l;
- l = ioctl32_hash_table[hash];
- while (l->next)
- l = l->next;
- l->next = entry;
- entry->next = 0;
- }
-}
-
-static int __init init_ioctl32(void)
-{
- int i;
- for (i = 0; i < NR_IOCTL32_HANDLERS; i++)
- ioctl32_insert(&ioctl32_handler_table[i]);
- return 0;
-}
-
-__initcall(init_ioctl32);
diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S
index 7b44d49b0b18..249b45018b47 100644
--- a/arch/mips64/kernel/scall_o32.S
+++ b/arch/mips64/kernel/scall_o32.S
@@ -287,7 +287,7 @@ illegal_syscall:
sys sys_acct 0
sys sys_umount 2
sys sys_ni_syscall 0
- sys sys32_ioctl 3
+ sys compat_sys_ioctl 3
sys sys32_fcntl 3 /* 4055 */
sys sys_ni_syscall 2
sys sys_setpgid 2
diff --git a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c
index 62054b4efaa8..a82392ff058e 100644
--- a/arch/parisc/kernel/ioctl32.c
+++ b/arch/parisc/kernel/ioctl32.c
@@ -9,9 +9,9 @@
*/
#include <linux/config.h>
-#include <linux/types.h>
-#include "sys32.h"
#include <linux/compat.h>
+#include <linux/ioctl.h>
+#include <linux/ioctl32.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp.h>
@@ -52,12 +52,7 @@
#include <linux/rtc.h>
#include <linux/pci.h>
#include <linux/serial.h>
-#if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
-/* Ugh. This header really is not clean */
-/* #define min min
-#define max max */
-#include <linux/lvm.h>
-#endif /* LVM */
+#include <linux/watchdog.h>
#include <scsi/scsi.h>
/* Ugly hack. */
@@ -97,7 +92,7 @@
#include <linux/nbd.h>
#include <linux/random.h>
-#include <asm/module.h> /* get #define module_map() */
+#include <asm/ioctls.h>
/* Use this to get at 32-bit user passed pointers.
See sys_sparc32.c for description about these. */
@@ -111,8 +106,6 @@
#define EXT2_IOC32_GETVERSION _IOR('v', 1, int)
#define EXT2_IOC32_SETVERSION _IOW('v', 2, int)
-extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-
static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg)
{
mm_segment_t old_fs = get_fs();
@@ -143,17 +136,6 @@ static int rw_long(unsigned int fd, unsigned int cmd, unsigned long arg)
return err;
}
-static int siocprivate(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- int err = sys_ioctl(fd, cmd, arg);
- if ((unsigned) err > -4095)
- printk(KERN_WARNING
- "ioctl(%d, 0x%x, %p) -- SIOCDEVPRIVATE-based ioctls aren't really\n"
- "supported, though some will work by accident.\n",
- fd, cmd, (void *)arg);
- return err;
-}
-
static int do_ext2_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
/* These are just misnamed, they actually get/put from/to user an int */
@@ -2900,669 +2882,31 @@ static int do_tiocgserial(unsigned int fd, unsigned int cmd, unsigned long arg)
return ret;
}
+int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ int err = sys_ioctl(fd, cmd, arg);
+ if ((unsigned) err > -4095)
+ printk(KERN_WARNING
+ "ioctl(%d, 0x%x, %p) -- SIOCDEVPRIVATE-based ioctls aren't really\n"
+ "supported, though some will work by accident.\n",
+ fd, cmd, (void *)arg);
+ return err;
+}
-struct ioctl_trans {
- unsigned long handler;
- unsigned int cmd;
- unsigned int next;
-};
-#define HANDLE_IOCTL(cmd, handler) asm volatile(".dword %1\n.word %0, 0" : : "i" (cmd), "i" (handler));
-
+#define HANDLE_IOCTL(cmd, handler) { cmd, (ioctl_trans_handler_t)handler, 0 },
#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl)
-
-#define IOCTL_TABLE_START void ioctl32_foo(void) { asm volatile(".data\nioctl_translations:");
-#define IOCTL_TABLE_END asm volatile("\nioctl_translations_end:\n\t.previous"); }
+#define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = {
+#define IOCTL_TABLE_END }; struct ioctl_trans ioctl_end[0];
IOCTL_TABLE_START
-/* List here exlicitly which ioctl's are known to have
- * compatible types passed or none at all...
- */
-/* Big T */
-COMPATIBLE_IOCTL(TCGETA)
-COMPATIBLE_IOCTL(TCSETA)
-COMPATIBLE_IOCTL(TCSETAW)
-COMPATIBLE_IOCTL(TCSETAF)
-COMPATIBLE_IOCTL(TCSBRK)
-COMPATIBLE_IOCTL(TCXONC)
-COMPATIBLE_IOCTL(TCFLSH)
-COMPATIBLE_IOCTL(TCGETS)
-COMPATIBLE_IOCTL(TCSETS)
-COMPATIBLE_IOCTL(TCSETSW)
-COMPATIBLE_IOCTL(TCSETSF)
-COMPATIBLE_IOCTL(TIOCLINUX)
-COMPATIBLE_IOCTL(TIOCSTART)
-COMPATIBLE_IOCTL(TIOCSTOP)
-/* Little t */
-COMPATIBLE_IOCTL(TIOCGETD)
-COMPATIBLE_IOCTL(TIOCSETD)
-COMPATIBLE_IOCTL(TIOCEXCL)
-COMPATIBLE_IOCTL(TIOCNXCL)
-COMPATIBLE_IOCTL(TIOCCONS)
-COMPATIBLE_IOCTL(TIOCGSOFTCAR)
-COMPATIBLE_IOCTL(TIOCSSOFTCAR)
-COMPATIBLE_IOCTL(TIOCSWINSZ)
-COMPATIBLE_IOCTL(TIOCGWINSZ)
-COMPATIBLE_IOCTL(TIOCMGET)
-COMPATIBLE_IOCTL(TIOCMBIC)
-COMPATIBLE_IOCTL(TIOCMBIS)
-COMPATIBLE_IOCTL(TIOCMSET)
-COMPATIBLE_IOCTL(TIOCPKT)
-COMPATIBLE_IOCTL(TIOCNOTTY)
-COMPATIBLE_IOCTL(TIOCSTI)
-COMPATIBLE_IOCTL(TIOCOUTQ)
-COMPATIBLE_IOCTL(TIOCSPGRP)
-COMPATIBLE_IOCTL(TIOCGPGRP)
-COMPATIBLE_IOCTL(TIOCSCTTY)
-COMPATIBLE_IOCTL(TIOCGPTN)
-COMPATIBLE_IOCTL(TIOCSPTLCK)
-COMPATIBLE_IOCTL(TIOCSSERIAL)
-COMPATIBLE_IOCTL(TIOCSERGETLSR)
-COMPATIBLE_IOCTL(TIOCSLTC)
-/* Big F */
-#if 0
-COMPATIBLE_IOCTL(FBIOGTYPE)
-COMPATIBLE_IOCTL(FBIOSATTR)
-COMPATIBLE_IOCTL(FBIOGATTR)
-COMPATIBLE_IOCTL(FBIOSVIDEO)
-COMPATIBLE_IOCTL(FBIOGVIDEO)
-COMPATIBLE_IOCTL(FBIOGCURSOR32) /* This is not implemented yet. Later it should be converted... */
-COMPATIBLE_IOCTL(FBIOSCURPOS)
-COMPATIBLE_IOCTL(FBIOGCURPOS)
-COMPATIBLE_IOCTL(FBIOGCURMAX)
-#endif
-COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
-COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
-
-COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
-COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
-COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
-/* Little f */
-COMPATIBLE_IOCTL(FIOCLEX)
-COMPATIBLE_IOCTL(FIONCLEX)
-COMPATIBLE_IOCTL(FIOASYNC)
-COMPATIBLE_IOCTL(FIONBIO)
-COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
-/* 0x00 */
-COMPATIBLE_IOCTL(FIBMAP)
-COMPATIBLE_IOCTL(FIGETBSZ)
-/* 0x03 -- HD/IDE ioctl's used by hdparm and friends.
- * Some need translations, these do not.
- */
-COMPATIBLE_IOCTL(HDIO_GET_IDENTITY)
-COMPATIBLE_IOCTL(HDIO_SET_DMA)
-COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR)
-COMPATIBLE_IOCTL(HDIO_SET_NOWERR)
-COMPATIBLE_IOCTL(HDIO_SET_32BIT)
-COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT)
-COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
-COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
-COMPATIBLE_IOCTL(HDIO_SET_NICE)
-/* 0x02 -- Floppy ioctls */
-COMPATIBLE_IOCTL(FDMSGON)
-COMPATIBLE_IOCTL(FDMSGOFF)
-COMPATIBLE_IOCTL(FDSETEMSGTRESH)
-COMPATIBLE_IOCTL(FDFLUSH)
-COMPATIBLE_IOCTL(FDWERRORCLR)
-COMPATIBLE_IOCTL(FDSETMAXERRS)
-COMPATIBLE_IOCTL(FDGETMAXERRS)
-COMPATIBLE_IOCTL(FDGETDRVTYP)
-COMPATIBLE_IOCTL(FDEJECT)
-COMPATIBLE_IOCTL(FDCLRPRM)
-COMPATIBLE_IOCTL(FDFMTBEG)
-COMPATIBLE_IOCTL(FDFMTEND)
-COMPATIBLE_IOCTL(FDRESET)
-COMPATIBLE_IOCTL(FDTWADDLE)
-COMPATIBLE_IOCTL(FDFMTTRK)
-COMPATIBLE_IOCTL(FDRAWCMD)
-/* 0x12 */
-COMPATIBLE_IOCTL(BLKROSET)
-COMPATIBLE_IOCTL(BLKROGET)
-COMPATIBLE_IOCTL(BLKRRPART)
-COMPATIBLE_IOCTL(BLKFLSBUF)
-COMPATIBLE_IOCTL(BLKSECTSET)
-
-/* RAID */
-COMPATIBLE_IOCTL(RAID_VERSION)
-COMPATIBLE_IOCTL(GET_ARRAY_INFO)
-COMPATIBLE_IOCTL(GET_DISK_INFO)
-COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
-COMPATIBLE_IOCTL(RAID_AUTORUN)
-COMPATIBLE_IOCTL(CLEAR_ARRAY)
-COMPATIBLE_IOCTL(ADD_NEW_DISK)
-COMPATIBLE_IOCTL(HOT_REMOVE_DISK)
-COMPATIBLE_IOCTL(SET_ARRAY_INFO)
-COMPATIBLE_IOCTL(SET_DISK_INFO)
-COMPATIBLE_IOCTL(WRITE_RAID_INFO)
-COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
-COMPATIBLE_IOCTL(PROTECT_ARRAY)
-COMPATIBLE_IOCTL(HOT_ADD_DISK)
-COMPATIBLE_IOCTL(SET_DISK_FAULTY)
-COMPATIBLE_IOCTL(HOT_GENERATE_ERROR)
-COMPATIBLE_IOCTL(RUN_ARRAY)
-COMPATIBLE_IOCTL(START_ARRAY)
-COMPATIBLE_IOCTL(STOP_ARRAY)
-COMPATIBLE_IOCTL(STOP_ARRAY_RO)
-COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
-
-/* DM */
-COMPATIBLE_IOCTL(DM_VERSION)
-COMPATIBLE_IOCTL(DM_REMOVE_ALL)
-COMPATIBLE_IOCTL(DM_DEV_CREATE)
-COMPATIBLE_IOCTL(DM_DEV_REMOVE)
-COMPATIBLE_IOCTL(DM_DEV_RELOAD)
-COMPATIBLE_IOCTL(DM_DEV_SUSPEND)
-COMPATIBLE_IOCTL(DM_DEV_RENAME)
-COMPATIBLE_IOCTL(DM_DEV_DEPS)
-COMPATIBLE_IOCTL(DM_DEV_STATUS)
-COMPATIBLE_IOCTL(DM_TARGET_STATUS)
-COMPATIBLE_IOCTL(DM_TARGET_WAIT)
-
-/* Big K */
-COMPATIBLE_IOCTL(PIO_FONT)
-COMPATIBLE_IOCTL(GIO_FONT)
-COMPATIBLE_IOCTL(KDSIGACCEPT)
-COMPATIBLE_IOCTL(KDGETKEYCODE)
-COMPATIBLE_IOCTL(KDSETKEYCODE)
-COMPATIBLE_IOCTL(KIOCSOUND)
-COMPATIBLE_IOCTL(KDMKTONE)
-COMPATIBLE_IOCTL(KDGKBTYPE)
-COMPATIBLE_IOCTL(KDSETMODE)
-COMPATIBLE_IOCTL(KDGETMODE)
-COMPATIBLE_IOCTL(KDSKBMODE)
-COMPATIBLE_IOCTL(KDGKBMODE)
-COMPATIBLE_IOCTL(KDSKBMETA)
-COMPATIBLE_IOCTL(KDGKBMETA)
-COMPATIBLE_IOCTL(KDGKBENT)
-COMPATIBLE_IOCTL(KDSKBENT)
-COMPATIBLE_IOCTL(KDGKBSENT)
-COMPATIBLE_IOCTL(KDSKBSENT)
-COMPATIBLE_IOCTL(KDGKBDIACR)
-COMPATIBLE_IOCTL(KDSKBDIACR)
-COMPATIBLE_IOCTL(KDGKBLED)
-COMPATIBLE_IOCTL(KDSKBLED)
-COMPATIBLE_IOCTL(KDGETLED)
-COMPATIBLE_IOCTL(KDSETLED)
-COMPATIBLE_IOCTL(GIO_SCRNMAP)
-COMPATIBLE_IOCTL(PIO_SCRNMAP)
-COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
-COMPATIBLE_IOCTL(PIO_UNISCRNMAP)
-COMPATIBLE_IOCTL(PIO_FONTRESET)
-COMPATIBLE_IOCTL(PIO_UNIMAPCLR)
-/* Little k */
-#if 0
-COMPATIBLE_IOCTL(KIOCTYPE)
-COMPATIBLE_IOCTL(KIOCLAYOUT)
-COMPATIBLE_IOCTL(KIOCGTRANS)
-COMPATIBLE_IOCTL(KIOCTRANS)
-COMPATIBLE_IOCTL(KIOCCMD)
-COMPATIBLE_IOCTL(KIOCSDIRECT)
-COMPATIBLE_IOCTL(KIOCSLED)
-COMPATIBLE_IOCTL(KIOCGLED)
-COMPATIBLE_IOCTL(KIOCSRATE)
-COMPATIBLE_IOCTL(KIOCGRATE)
-#endif
-/* Big S */
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
-COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK)
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_ENABLE)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE)
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER)
-COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
-/* Big T */
-COMPATIBLE_IOCTL(TUNSETNOCSUM)
-COMPATIBLE_IOCTL(TUNSETDEBUG)
-COMPATIBLE_IOCTL(TUNSETIFF)
-COMPATIBLE_IOCTL(TUNSETPERSIST)
-COMPATIBLE_IOCTL(TUNSETOWNER)
-/* Big V */
-COMPATIBLE_IOCTL(VT_SETMODE)
-COMPATIBLE_IOCTL(VT_GETMODE)
-COMPATIBLE_IOCTL(VT_GETSTATE)
-COMPATIBLE_IOCTL(VT_OPENQRY)
-COMPATIBLE_IOCTL(VT_ACTIVATE)
-COMPATIBLE_IOCTL(VT_WAITACTIVE)
-COMPATIBLE_IOCTL(VT_RELDISP)
-COMPATIBLE_IOCTL(VT_DISALLOCATE)
-COMPATIBLE_IOCTL(VT_RESIZE)
-COMPATIBLE_IOCTL(VT_RESIZEX)
-COMPATIBLE_IOCTL(VT_LOCKSWITCH)
-COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
-/* Little v, the video4linux ioctls */
-COMPATIBLE_IOCTL(VIDIOCGCAP)
-COMPATIBLE_IOCTL(VIDIOCGCHAN)
-COMPATIBLE_IOCTL(VIDIOCSCHAN)
-COMPATIBLE_IOCTL(VIDIOCGPICT)
-COMPATIBLE_IOCTL(VIDIOCSPICT)
-COMPATIBLE_IOCTL(VIDIOCCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCKEY)
-COMPATIBLE_IOCTL(VIDIOCGAUDIO)
-COMPATIBLE_IOCTL(VIDIOCSAUDIO)
-COMPATIBLE_IOCTL(VIDIOCSYNC)
-COMPATIBLE_IOCTL(VIDIOCMCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCGMBUF)
-COMPATIBLE_IOCTL(VIDIOCGUNIT)
-COMPATIBLE_IOCTL(VIDIOCGCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCSCAPTURE)
-/* BTTV specific... */
-COMPATIBLE_IOCTL(_IOW('v', BASE_VIDIOCPRIVATE+0, char [256]))
-COMPATIBLE_IOCTL(_IOR('v', BASE_VIDIOCPRIVATE+1, char [256]))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int))
-COMPATIBLE_IOCTL(_IOW('v' , BASE_VIDIOCPRIVATE+3, char [16])) /* struct bttv_pll_info */
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+4, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int))
-/* Little m */
-COMPATIBLE_IOCTL(MTIOCTOP)
-/* Socket level stuff */
-COMPATIBLE_IOCTL(FIOSETOWN)
-COMPATIBLE_IOCTL(SIOCSPGRP)
-COMPATIBLE_IOCTL(FIOGETOWN)
-COMPATIBLE_IOCTL(SIOCGPGRP)
-COMPATIBLE_IOCTL(SIOCATMARK)
-COMPATIBLE_IOCTL(SIOCSIFLINK)
-COMPATIBLE_IOCTL(SIOCSIFENCAP)
-COMPATIBLE_IOCTL(SIOCGIFENCAP)
-COMPATIBLE_IOCTL(SIOCSIFBR)
-COMPATIBLE_IOCTL(SIOCGIFBR)
-COMPATIBLE_IOCTL(SIOCSARP)
-COMPATIBLE_IOCTL(SIOCGARP)
-COMPATIBLE_IOCTL(SIOCDARP)
-COMPATIBLE_IOCTL(SIOCSRARP)
-COMPATIBLE_IOCTL(SIOCGRARP)
-COMPATIBLE_IOCTL(SIOCDRARP)
-COMPATIBLE_IOCTL(SIOCADDDLCI)
-COMPATIBLE_IOCTL(SIOCDELDLCI)
-COMPATIBLE_IOCTL(SIOCGMIIPHY)
-COMPATIBLE_IOCTL(SIOCGMIIREG)
-COMPATIBLE_IOCTL(SIOCSMIIREG)
-COMPATIBLE_IOCTL(SIOCGIFVLAN)
-COMPATIBLE_IOCTL(SIOCSIFVLAN)
-COMPATIBLE_IOCTL(SIOCDELDLCI)
-/* SG stuff */
-COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_EMULATED_HOST)
-COMPATIBLE_IOCTL(SG_SET_TRANSFORM)
-COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
-COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)
-COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE)
-COMPATIBLE_IOCTL(SG_GET_SCSI_ID)
-COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA)
-COMPATIBLE_IOCTL(SG_GET_LOW_DMA)
-COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID)
-COMPATIBLE_IOCTL(SG_GET_PACK_ID)
-COMPATIBLE_IOCTL(SG_GET_NUM_WAITING)
-COMPATIBLE_IOCTL(SG_SET_DEBUG)
-COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE)
-COMPATIBLE_IOCTL(SG_GET_COMMAND_Q)
-COMPATIBLE_IOCTL(SG_SET_COMMAND_Q)
-COMPATIBLE_IOCTL(SG_GET_VERSION_NUM)
-COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN)
-COMPATIBLE_IOCTL(SG_SCSI_RESET)
-COMPATIBLE_IOCTL(SG_IO)
-COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
-COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
-COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
-/* PPP stuff */
-COMPATIBLE_IOCTL(PPPIOCGFLAGS)
-COMPATIBLE_IOCTL(PPPIOCSFLAGS)
-COMPATIBLE_IOCTL(PPPIOCGASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCGUNIT)
-COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCGMRU)
-COMPATIBLE_IOCTL(PPPIOCSMRU)
-COMPATIBLE_IOCTL(PPPIOCSMAXCID)
-COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP)
-COMPATIBLE_IOCTL(LPGETSTATUS)
-COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCXFERUNIT)
-COMPATIBLE_IOCTL(PPPIOCGNPMODE)
-COMPATIBLE_IOCTL(PPPIOCSNPMODE)
-COMPATIBLE_IOCTL(PPPIOCGDEBUG)
-COMPATIBLE_IOCTL(PPPIOCSDEBUG)
-COMPATIBLE_IOCTL(PPPIOCNEWUNIT)
-COMPATIBLE_IOCTL(PPPIOCATTACH)
-COMPATIBLE_IOCTL(PPPIOCDETACH)
-COMPATIBLE_IOCTL(PPPIOCSMRRU)
-COMPATIBLE_IOCTL(PPPIOCCONNECT)
-COMPATIBLE_IOCTL(PPPIOCDISCONN)
-COMPATIBLE_IOCTL(PPPIOCATTCHAN)
-/* PPPOX */
-COMPATIBLE_IOCTL(PPPOEIOCSFWD)
-COMPATIBLE_IOCTL(PPPOEIOCDFWD)
-/* CDROM stuff */
-COMPATIBLE_IOCTL(CDROMPAUSE)
-COMPATIBLE_IOCTL(CDROMRESUME)
-COMPATIBLE_IOCTL(CDROMPLAYMSF)
-COMPATIBLE_IOCTL(CDROMPLAYTRKIND)
-COMPATIBLE_IOCTL(CDROMREADTOCHDR)
-COMPATIBLE_IOCTL(CDROMREADTOCENTRY)
-COMPATIBLE_IOCTL(CDROMSTOP)
-COMPATIBLE_IOCTL(CDROMSTART)
-COMPATIBLE_IOCTL(CDROMEJECT)
-COMPATIBLE_IOCTL(CDROMVOLCTRL)
-COMPATIBLE_IOCTL(CDROMSUBCHNL)
-COMPATIBLE_IOCTL(CDROMEJECT_SW)
-COMPATIBLE_IOCTL(CDROMMULTISESSION)
-COMPATIBLE_IOCTL(CDROM_GET_MCN)
-COMPATIBLE_IOCTL(CDROMRESET)
-COMPATIBLE_IOCTL(CDROMVOLREAD)
-COMPATIBLE_IOCTL(CDROMSEEK)
-COMPATIBLE_IOCTL(CDROMPLAYBLK)
-COMPATIBLE_IOCTL(CDROMCLOSETRAY)
-COMPATIBLE_IOCTL(CDROM_SET_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_CLEAR_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_SELECT_SPEED)
-COMPATIBLE_IOCTL(CDROM_SELECT_DISC)
-COMPATIBLE_IOCTL(CDROM_MEDIA_CHANGED)
-COMPATIBLE_IOCTL(CDROM_DRIVE_STATUS)
-COMPATIBLE_IOCTL(CDROM_DISC_STATUS)
-COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS)
-COMPATIBLE_IOCTL(CDROM_LOCKDOOR)
-COMPATIBLE_IOCTL(CDROM_DEBUG)
-COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY)
-/* Big L */
-COMPATIBLE_IOCTL(LOOP_SET_FD)
-COMPATIBLE_IOCTL(LOOP_CLR_FD)
-/* Big Q for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE)
-COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL)
-COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE)
-/* Big T for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_START)
-COMPATIBLE_IOCTL(SNDCTL_TMR_STOP)
-COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO)
-COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME)
-COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT)
-/* Little m for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD)
-/* Big P for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_DSP_RESET)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED)
-COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS)
-COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_POST)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR)
-/* SNDCTL_DSP_MAPINBUF, XXX needs translation */
-/* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY)
-COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER)
-/* Big C for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_COPR_RESET)
-COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE)
-COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA)
-COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RUN)
-COMPATIBLE_IOCTL(SNDCTL_COPR_HALT)
-COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG)
-/* Big M for sound/OSS */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3)
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR))
-COMPATIBLE_IOCTL(SOUND_MIXER_MUTE)
-/* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
-/* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3)
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR))
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE)
-/* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
-/* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC)
-COMPATIBLE_IOCTL(SOUND_MIXER_INFO)
-COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO)
-COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS)
-COMPATIBLE_IOCTL(SOUND_MIXER_AGC)
-COMPATIBLE_IOCTL(SOUND_MIXER_3DSE)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
-COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
-COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
-COMPATIBLE_IOCTL(OSS_GETVERSION)
-/* AUTOFS */
-COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
-COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
-COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
-COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
-COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
-/* DEVFS */
-COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
-COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
-/* Raw devices */
-COMPATIBLE_IOCTL(RAW_SETBIND)
-COMPATIBLE_IOCTL(RAW_GETBIND)
-/* SMB ioctls which do not need any translations */
-COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
-/* Little a */
-COMPATIBLE_IOCTL(ATMSIGD_CTRL)
-COMPATIBLE_IOCTL(ATMARPD_CTRL)
-COMPATIBLE_IOCTL(ATMLEC_CTRL)
-COMPATIBLE_IOCTL(ATMLEC_MCAST)
-COMPATIBLE_IOCTL(ATMLEC_DATA)
-COMPATIBLE_IOCTL(ATM_SETSC)
-COMPATIBLE_IOCTL(SIOCSIFATMTCP)
-COMPATIBLE_IOCTL(SIOCMKCLIP)
-COMPATIBLE_IOCTL(ATMARP_MKIP)
-COMPATIBLE_IOCTL(ATMARP_SETENTRY)
-COMPATIBLE_IOCTL(ATMARP_ENCAP)
-COMPATIBLE_IOCTL(ATMTCP_CREATE)
-COMPATIBLE_IOCTL(ATMTCP_REMOVE)
-COMPATIBLE_IOCTL(ATMMPC_CTRL)
-COMPATIBLE_IOCTL(ATMMPC_DATA)
-#if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
-/* 0xfe - lvm */
-COMPATIBLE_IOCTL(VG_SET_EXTENDABLE)
-COMPATIBLE_IOCTL(VG_STATUS_GET_COUNT)
-COMPATIBLE_IOCTL(VG_STATUS_GET_NAMELIST)
-COMPATIBLE_IOCTL(VG_REMOVE)
-COMPATIBLE_IOCTL(VG_RENAME)
-COMPATIBLE_IOCTL(VG_REDUCE)
-COMPATIBLE_IOCTL(PE_LOCK_UNLOCK)
-COMPATIBLE_IOCTL(PV_FLUSH)
-COMPATIBLE_IOCTL(LVM_LOCK_LVM)
-COMPATIBLE_IOCTL(LVM_GET_IOP_VERSION)
-#ifdef LVM_TOTAL_RESET
-COMPATIBLE_IOCTL(LVM_RESET)
-#endif
-COMPATIBLE_IOCTL(LV_SET_ACCESS)
-COMPATIBLE_IOCTL(LV_SET_STATUS)
-COMPATIBLE_IOCTL(LV_SET_ALLOCATION)
-COMPATIBLE_IOCTL(LE_REMAP)
-COMPATIBLE_IOCTL(LV_BMAP)
-COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE)
-#endif /* LVM */
-#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
-COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
-COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
-COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC)
-COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK)
-COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK)
-COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL)
-COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS)
-COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS)
-COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX)
-COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX)
-COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX)
-COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX)
-COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX)
-COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX)
-COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW)
-COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW)
-COMPATIBLE_IOCTL(DRM_IOCTL_LOCK)
-COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK)
-COMPATIBLE_IOCTL(DRM_IOCTL_FINISH)
-#endif /* DRM */
-/* Big R */
-COMPATIBLE_IOCTL(RNDGETENTCNT)
-COMPATIBLE_IOCTL(RNDADDTOENTCNT)
-COMPATIBLE_IOCTL(RNDGETPOOL)
-COMPATIBLE_IOCTL(RNDADDENTROPY)
-COMPATIBLE_IOCTL(RNDZAPENTCNT)
-COMPATIBLE_IOCTL(RNDCLEARPOOL)
-/* Bluetooth ioctls */
-COMPATIBLE_IOCTL(HCIDEVUP)
-COMPATIBLE_IOCTL(HCIDEVDOWN)
-COMPATIBLE_IOCTL(HCIDEVRESET)
-COMPATIBLE_IOCTL(HCIDEVRESTAT)
-COMPATIBLE_IOCTL(HCIGETDEVLIST)
-COMPATIBLE_IOCTL(HCIGETDEVINFO)
-COMPATIBLE_IOCTL(HCIGETCONNLIST)
-COMPATIBLE_IOCTL(HCIGETCONNINFO)
-COMPATIBLE_IOCTL(HCISETRAW)
-COMPATIBLE_IOCTL(HCISETSCAN)
-COMPATIBLE_IOCTL(HCISETAUTH)
-COMPATIBLE_IOCTL(HCISETENCRYPT)
-COMPATIBLE_IOCTL(HCISETPTYPE)
-COMPATIBLE_IOCTL(HCISETLINKPOL)
-COMPATIBLE_IOCTL(HCISETLINKMODE)
-COMPATIBLE_IOCTL(HCISETACLMTU)
-COMPATIBLE_IOCTL(HCISETSCOMTU)
-COMPATIBLE_IOCTL(HCIINQUIRY)
-/* Misc. */
-COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */
-COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */
-COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
-COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
-/* USB */
-COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
-COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
-COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
-COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
-COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
-COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
-COMPATIBLE_IOCTL(USBDEVFS_RESET)
-COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
-/* MTD */
-COMPATIBLE_IOCTL(MEMGETINFO)
-COMPATIBLE_IOCTL(MEMERASE)
-COMPATIBLE_IOCTL(MEMLOCK)
-COMPATIBLE_IOCTL(MEMUNLOCK)
-COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
-COMPATIBLE_IOCTL(MEMGETREGIONINFO)
-/* NBD */
-COMPATIBLE_IOCTL(NBD_SET_SOCK)
-COMPATIBLE_IOCTL(NBD_SET_BLKSIZE)
-COMPATIBLE_IOCTL(NBD_SET_SIZE)
-COMPATIBLE_IOCTL(NBD_DO_IT)
-COMPATIBLE_IOCTL(NBD_CLEAR_SOCK)
-COMPATIBLE_IOCTL(NBD_CLEAR_QUE)
-COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
-COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS)
-COMPATIBLE_IOCTL(NBD_DISCONNECT)
+#include <linux/compat_ioctl.h>
+
+/* PA-specific ioctls */
+COMPATIBLE_IOCTL(PA_PERF_ON)
+COMPATIBLE_IOCTL(PA_PERF_OFF)
+COMPATIBLE_IOCTL(PA_PERF_VERSION)
+
/* And these ioctls need translation */
HANDLE_IOCTL(TIOCGSERIAL, do_tiocgserial)
HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32)
@@ -3735,150 +3079,5 @@ HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs);
HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma);
HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx);
#endif /* DRM */
-COMPATIBLE_IOCTL(PA_PERF_ON)
-COMPATIBLE_IOCTL(PA_PERF_OFF)
-COMPATIBLE_IOCTL(PA_PERF_VERSION)
IOCTL_TABLE_END
-unsigned int ioctl32_hash_table[1024];
-
-extern inline unsigned long ioctl32_hash(unsigned long cmd)
-{
- return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
-}
-
-static void ioctl32_insert_translation(struct ioctl_trans *trans)
-{
- unsigned long hash;
- struct ioctl_trans *t;
-
- hash = ioctl32_hash (trans->cmd);
- if (!ioctl32_hash_table[hash])
- ioctl32_hash_table[hash] = (u32)(long)trans;
- else {
- t = (struct ioctl_trans *)(long)ioctl32_hash_table[hash];
- while (t->next)
- t = (struct ioctl_trans *)(long)t->next;
- trans->next = 0;
- t->next = (u32)(long)trans;
- }
-}
-
-static int __init init_sys32_ioctl(void)
-{
- int i;
- extern struct ioctl_trans ioctl_translations[], ioctl_translations_end[];
-
- for (i = 0; &ioctl_translations[i] < &ioctl_translations_end[0]; i++)
- ioctl32_insert_translation(&ioctl_translations[i]);
- return 0;
-}
-
-__initcall(init_sys32_ioctl);
-
-static struct ioctl_trans *additional_ioctls;
-
-/* Always call these with kernel lock held! */
-
-int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *))
-{
- int i;
-
-panic("register_ioctl32_conversion() is B0RKEN! Called by %p\n", __builtin_return_address(0));
-
- if (!additional_ioctls) {
- additional_ioctls = module_map(PAGE_SIZE);
- if (!additional_ioctls)
- return -ENOMEM;
- memset(additional_ioctls, 0, PAGE_SIZE);
- }
- for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++)
- if (!additional_ioctls[i].cmd)
- break;
- if (i == PAGE_SIZE/sizeof(struct ioctl_trans))
- return -ENOMEM;
- additional_ioctls[i].cmd = cmd;
- if (!handler)
- additional_ioctls[i].handler = (u32)(long)sys_ioctl;
- else
- additional_ioctls[i].handler = (u32)(long)handler;
- ioctl32_insert_translation(&additional_ioctls[i]);
- return 0;
-}
-
-int unregister_ioctl32_conversion(unsigned int cmd)
-{
- unsigned long hash = ioctl32_hash(cmd);
- struct ioctl_trans *t, *t1;
-
- t = (struct ioctl_trans *)(long)ioctl32_hash_table[hash];
- if (!t) return -EINVAL;
- if (t->cmd == cmd && t >= additional_ioctls &&
- (unsigned long)t < ((unsigned long)additional_ioctls) + PAGE_SIZE) {
- ioctl32_hash_table[hash] = t->next;
- t->cmd = 0;
- return 0;
- } else while (t->next) {
- t1 = (struct ioctl_trans *)(long)t->next;
- if (t1->cmd == cmd && t1 >= additional_ioctls &&
- (unsigned long)t1 < ((unsigned long)additional_ioctls) + PAGE_SIZE) {
- t1->cmd = 0;
- t->next = t1->next;
- return 0;
- }
- t = t1;
- }
- return -EINVAL;
-}
-
-asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- struct file * filp;
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- unsigned long pafnptr[4];
- extern char __gp;
- struct ioctl_trans *t;
- int error = -EBADF;
-
- filp = fget(fd);
- if(!filp)
- goto out2;
-
- if (!filp->f_op || !filp->f_op->ioctl) {
- error = sys_ioctl (fd, cmd, arg);
- goto out;
- }
-
- /* intercept private networking ioctl() calls here since it is
- * an onerous task to figure out which ones of the HANDLE_IOCTL
- * list map to these values.
- */
- if (cmd >= SIOCDEVPRIVATE && cmd <= SIOCDEVPRIVATE + 0xf) {
- error = siocprivate(fd, cmd, arg);
- goto out;
- }
-
- t = (struct ioctl_trans *)(long)ioctl32_hash_table [ioctl32_hash (cmd)];
-
- while (t && t->cmd != cmd)
- t = (struct ioctl_trans *)(long)t->next;
- if (t) {
- handler = (void *) pafnptr;
- pafnptr[0] = pafnptr[1] = 0UL;
- pafnptr[2] = (unsigned long) t->handler;
- pafnptr[3] = A(&__gp);
- error = handler(fd, cmd, arg, filp);
- } else {
- static int count = 0;
- if (++count <= 20)
- printk(KERN_WARNING
- "sys32_ioctl: Unknown cmd fd(%d) "
- "cmd(%08x) arg(%08x)\n",
- (int)fd, (unsigned int)cmd, (unsigned int)arg);
- error = -EINVAL;
- }
-out:
- fput(filp);
-out2:
- return error;
-}
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index f1b08ceafe80..daa166eb06df 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -407,8 +407,7 @@ sys_call_table:
ENTRY_SAME(umount)
/* struct sockaddr... */
ENTRY_SAME(getpeername)
- /* This one's a huge ugly mess */
- ENTRY_DIFF(ioctl)
+ ENTRY_COMP(ioctl)
ENTRY_COMP(fcntl) /* 55 */
ENTRY_SAME(socketpair)
ENTRY_SAME(setpgid)
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c
index f7b7044ecfe1..da44468c5c47 100644
--- a/arch/ppc/4xx_io/serial_sicc.c
+++ b/arch/ppc/4xx_io/serial_sicc.c
@@ -431,11 +431,7 @@ static void siccuart_event(struct SICC_info *info, int event)
}
static void
-#ifdef SUPPORT_SYSRQ
siccuart_rx_chars(struct SICC_info *info, struct pt_regs *regs)
-#else
-siccuart_rx_chars(struct SICC_info *info)
-#endif
{
struct tty_struct *tty = info->tty;
unsigned int status, ch, rsr, flg, ignored = 0;
@@ -574,25 +570,19 @@ static void siccuart_tx_chars(struct SICC_info *info)
}
-static void siccuart_int_rx(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t siccuart_int_rx(int irq, void *dev_id, struct pt_regs *regs)
{
struct SICC_info *info = dev_id;
-
-#ifdef SUPPORT_SYSRQ
- siccuart_rx_chars(info, regs);
-#else
- siccuart_rx_chars(info);
-#endif
-
- //powerpcClearUicsrBits(0x00000400);
+ siccuart_rx_chars(info, regs);
+ return IRQ_HANDLED;
}
-static void siccuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t siccuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
{
struct SICC_info *info = dev_id;
siccuart_tx_chars(info);
-
+ return IRQ_HANDLED;
}
static void siccuart_tasklet_action(unsigned long data)
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
index 5e06697c88e7..7a24273167aa 100644
--- a/arch/ppc/8260_io/enet.c
+++ b/arch/ppc/8260_io/enet.c
@@ -122,7 +122,7 @@ struct scc_enet_private {
static int scc_enet_open(struct net_device *dev);
static int scc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int scc_enet_rx(struct net_device *dev);
-static void scc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs);
+static irqreturn_t scc_enet_interrupt(int irq, void *dev_id, struct pt_regs *);
static int scc_enet_close(struct net_device *dev);
static struct net_device_stats *scc_enet_get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
@@ -272,7 +272,7 @@ scc_enet_timeout(struct net_device *dev)
/* The interrupt handler.
* This is called from the CPM handler, not the MPC core interrupt.
*/
-static void
+static irqreturn_t
scc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{
struct net_device *dev = dev_id;
@@ -403,7 +403,7 @@ scc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
printk("SCC ENET: BSY can't happen.\n");
}
- return;
+ return IRQ_HANDLED;
}
/* During a receive, the cur_rx points to the current incoming buffer.
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c
index 041b2b65de61..85274b8ac41e 100644
--- a/arch/ppc/8260_io/fcc_enet.c
+++ b/arch/ppc/8260_io/fcc_enet.c
@@ -126,7 +126,7 @@ typedef struct {
static int fcc_enet_open(struct net_device *dev);
static int fcc_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
static int fcc_enet_rx(struct net_device *dev);
-static void fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs);
+static irqreturn_t fcc_enet_interrupt(int irq, void *dev_id, struct pt_regs *);
static int fcc_enet_close(struct net_device *dev);
static struct net_device_stats *fcc_enet_get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
@@ -452,7 +452,7 @@ fcc_enet_timeout(struct net_device *dev)
}
/* The interrupt handler. */
-static void
+static irqreturn_t
fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{
struct net_device *dev = dev_id;
@@ -583,7 +583,7 @@ fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
if (int_events & FCC_ENET_BSY) {
cep->stats.rx_dropped++;
}
- return;
+ return IRQ_HANDLED;
}
/* During a receive, the cur_rx points to the current incoming buffer.
@@ -1203,7 +1203,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
}
/* This interrupt occurs when the PHY detects a link change. */
-static void
+static irqreturn_t
mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{
struct net_device *dev = dev_id;
@@ -1211,6 +1211,7 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
mii_do_cmd(dev, fep->phy->ack_int);
mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */
+ return IRQ_HANDLED;
}
#endif /* CONFIG_USE_MDIO */
diff --git a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c
index 3393e85b05e9..f0aa4cce2f58 100644
--- a/arch/ppc/8260_io/uart.c
+++ b/arch/ppc/8260_io/uart.c
@@ -570,7 +570,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
/*
* This is the serial driver's interrupt routine for a single port
*/
-static void rs_8xx_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+static irqreturn_t rs_8xx_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{
u_char events;
int idx;
@@ -610,6 +610,7 @@ static void rs_8xx_interrupt(int irq, void * dev_id, struct pt_regs * regs)
#ifdef SERIAL_DEBUG_INTR
printk("end.\n");
#endif
+ return IRQ_HANDLED;
}
diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c
index a12e2f8f5e0f..91195e2ce38d 100644
--- a/arch/ppc/amiga/amiints.c
+++ b/arch/ppc/amiga/amiints.c
@@ -55,10 +55,6 @@
#include <asm/amigappc.h>
#endif
-extern int cia_request_irq(int irq,
- void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, const char *devname, void *dev_id);
-extern void cia_free_irq(unsigned int irq, void *dev_id);
extern void cia_init_IRQ(struct ciabase *base);
unsigned short ami_intena_vals[AMI_STD_IRQS] = {
diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c
index 5404b69042ff..11a2592e7d38 100644
--- a/arch/ppc/amiga/config.c
+++ b/arch/ppc/amiga/config.c
@@ -71,7 +71,7 @@ static char amiga_model_name[13] = "Amiga ";
extern char m68k_debug_device[];
-static void amiga_sched_init(void (*handler)(int, void *, struct pt_regs *));
+static void amiga_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
/* amiga specific irq functions */
extern void amiga_init_IRQ (void);
extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
@@ -478,8 +478,8 @@ void __init config_amiga(void)
static unsigned short jiffy_ticks;
-static void __init amiga_sched_init(void (*timer_routine)(int, void *,
- struct pt_regs *))
+static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *,
+ struct pt_regs *))
{
static struct resource sched_res = {
"timer", 0x00bfd400, 0x00bfd5ff,
diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/ppc/kernel/cpu_setup_6xx.S
index cb0701cb24d0..be11b8010276 100644
--- a/arch/ppc/kernel/cpu_setup_6xx.S
+++ b/arch/ppc/kernel/cpu_setup_6xx.S
@@ -16,6 +16,7 @@
#include <asm/cputable.h>
#include <asm/ppc_asm.h>
#include <asm/offsets.h>
+#include <asm/cache.h>
_GLOBAL(__setup_cpu_601)
blr
@@ -63,13 +64,7 @@ _GLOBAL(__setup_cpu_7410)
mtspr SPRN_L2CR2,r3
mtlr r4
blr
-_GLOBAL(__setup_cpu_7450)
- mflr r4
- bl setup_common_caches
- bl setup_745x_specifics
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_7455)
+_GLOBAL(__setup_cpu_745x)
mflr r4
bl setup_common_caches
bl setup_745x_specifics
@@ -265,9 +260,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
#define CS_SIZE 28
.data
- .balign 4
+ .balign L1_CACHE_LINE_SIZE
cpu_state_storage:
.space CS_SIZE
+ .balign L1_CACHE_LINE_SIZE,0
.text
/* Called in normal context to backup CPU 0 state. This
@@ -277,6 +273,9 @@ cpu_state_storage:
* like HID0, HID1, MSSCR0, etc...
*/
_GLOBAL(__save_cpu_setup)
+ /* Some CR fields are volatile, we back it up all */
+ mfcr r7
+
/* Get storage ptr */
lis r5,cpu_state_storage@h
ori r5,r5,cpu_state_storage@l
@@ -322,6 +321,7 @@ _GLOBAL(__save_cpu_setup)
mfspr r4,SPRN_HID1
stw r4,CS_HID1(r5)
1:
+ mtcr r7
blr
/* Called with no MMU context (typically MSR:IR/DR off) to
@@ -329,6 +329,9 @@ _GLOBAL(__save_cpu_setup)
* function. This does not include cache setting
*/
_GLOBAL(__restore_cpu_setup)
+ /* Some CR fields are volatile, we back it up all */
+ mfcr r7
+
/* Get storage ptr */
lis r5,(cpu_state_storage-KERNELBASE)@h
ori r5,r5,cpu_state_storage@l
@@ -411,5 +414,6 @@ _GLOBAL(__restore_cpu_setup)
/* Setup final PLL */
mtspr SPRN_HID1,r4
1:
+ mtcr r7
blr
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 3bc08629ccf1..c2f5e7e8dee7 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -26,8 +26,7 @@ extern void __setup_cpu_750cx(unsigned long offset, int cpu_nr, struct cpu_spec*
extern void __setup_cpu_750fx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_7400(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_7410(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
-extern void __setup_cpu_7450(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
-extern void __setup_cpu_7455(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
+extern void __setup_cpu_745x(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_power3(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_8xx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
@@ -168,7 +167,7 @@ struct cpu_spec cpu_specs[] = {
0xffff0000, 0x70000000, "750FX",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP |
- CPU_FTR_DUAL_PLL_750FX,
+ CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC,
32, 32,
__setup_cpu_750fx
@@ -216,7 +215,7 @@ struct cpu_spec cpu_specs[] = {
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7450 2.1 */
0xffffffff, 0x80000201, "7450",
@@ -226,7 +225,7 @@ struct cpu_spec cpu_specs[] = {
CPU_FTR_L3_DISABLE_NAP,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7450 2.3 and newer */
0xffff0000, 0x80000000, "7450",
@@ -235,35 +234,46 @@ struct cpu_spec cpu_specs[] = {
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7455 rev 1.x */
0xffffff00, 0x80010100, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 7455 rev 2.0 */
0xffffffff, 0x80010200, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
- CPU_FTR_L3_DISABLE_NAP,
+ CPU_FTR_L3_DISABLE_NAP | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 7455 others */
0xffff0000, 0x80010000, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+ CPU_FTR_HAS_HIGH_BATS,
+ COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+ 32, 32,
+ __setup_cpu_745x
+ },
+ { /* 7457 */
+ 0xffff0000, 0x80020000, "7457",
+ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
+ CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+ CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 82xx (8240, 8245, 8260 are all 603e cores) */
0x7fff0000, 0x00810000, "82xx",
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 68b4f262db4d..ca2584c93e26 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -1451,6 +1451,30 @@ clear_bats:
mtspr IBAT2L,r10
mtspr IBAT3U,r10
mtspr IBAT3L,r10
+BEGIN_FTR_SECTION
+ /* Here's a tweak: at this point, CPU setup have
+ * not been called yet, so HIGH_BAT_EN may not be
+ * set in HID0 for the 745x processors. However, it
+ * seems that doesn't affect our ability to actually
+ * write to these SPRs.
+ */
+ mtspr SPRN_DBAT4U,r20
+ mtspr SPRN_DBAT4L,r20
+ mtspr SPRN_DBAT5U,r20
+ mtspr SPRN_DBAT5L,r20
+ mtspr SPRN_DBAT6U,r20
+ mtspr SPRN_DBAT6L,r20
+ mtspr SPRN_DBAT7U,r20
+ mtspr SPRN_DBAT7L,r20
+ mtspr SPRN_IBAT4U,r20
+ mtspr SPRN_IBAT4L,r20
+ mtspr SPRN_IBAT5U,r20
+ mtspr SPRN_IBAT5L,r20
+ mtspr SPRN_IBAT6U,r20
+ mtspr SPRN_IBAT6L,r20
+ mtspr SPRN_IBAT7U,r20
+ mtspr SPRN_IBAT7L,r20
+END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
blr
flush_tlbs:
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index 24965586025c..37e3e054b787 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -210,7 +210,8 @@ void free_irq(unsigned int irq, void* dev_id)
return;
}
-int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+int request_irq(unsigned int irq,
+ irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags, const char * devname, void *dev_id)
{
struct irqaction *action;
@@ -218,16 +219,9 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
if (irq >= NR_IRQS)
return -EINVAL;
- if (!handler)
- {
- /*
- * free_irq() used to be implemented as a call to
- * request_irq() with handler being NULL. Now we have
- * a real free_irq() but need to allow the old behavior
- * for old code that hasn't caught up yet.
- * -- Cort <cort@fsmlabs.com>
- */
- free_irq(irq, dev_id);
+ if (!handler) {
+ printk(KERN_ERR "request_irq called with NULL handler!\n");
+ dump_stack();
return 0;
}
@@ -246,8 +240,7 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
action->next = NULL;
retval = setup_irq(irq, action);
- if (retval)
- {
+ if (retval) {
kfree(action);
return retval;
}
@@ -732,6 +725,7 @@ void init_irq_proc (void)
}
}
-void no_action(int irq, void *dev, struct pt_regs *regs)
+irqreturn_t no_action(int irq, void *dev, struct pt_regs *regs)
{
+ return IRQ_NONE;
}
diff --git a/arch/ppc/kernel/l2cr.S b/arch/ppc/kernel/l2cr.S
index 6a94c425a537..c1fbb0c5cb0b 100644
--- a/arch/ppc/kernel/l2cr.S
+++ b/arch/ppc/kernel/l2cr.S
@@ -40,9 +40,11 @@
Author: Terry Greeniaus (tgree@phys.ualberta.ca)
Please e-mail updates to this file to me, thanks!
*/
+#include <linux/config.h>
#include <asm/processor.h>
#include <asm/cputable.h>
#include <asm/ppc_asm.h>
+#include <asm/cache.h>
/* Usage:
@@ -101,6 +103,8 @@ BEGIN_FTR_SECTION
blr
END_FTR_SECTION_IFCLR(CPU_FTR_L2CR)
+ mflr r9
+
/* Stop DST streams */
BEGIN_FTR_SECTION
DSSALL
@@ -115,6 +119,22 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
mtmsr r4
isync
+ /* Before we perform the global invalidation, we must disable dynamic
+ * power management via HID0[DPM] to work around a processor bug where
+ * DPM can possibly interfere with the state machine in the processor
+ * that invalidates the L2 cache tags.
+ */
+ mfspr r8,HID0 /* Save HID0 in r8 */
+ rlwinm r4,r8,0,12,10 /* Turn off HID0[DPM] */
+ sync
+ mtspr HID0,r4 /* Disable DPM */
+ sync
+
+ /* Flush & disable L1 */
+ mr r5,r3
+ bl __flush_disable_L1
+ mr r3,r5
+
/* Get the current enable bit of the L2CR into r4 */
mfspr r4,L2CR
@@ -136,27 +156,28 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
/**** Might be a good idea to set L2DO here - to prevent instructions
from getting into the cache. But since we invalidate
the next time we enable the cache it doesn't really matter.
- Don't do this unless you accommodate all processor variations.
+ Don't do this unless you accomodate all processor variations.
The bit moved on the 7450.....
****/
/* TODO: use HW flush assist when available */
- lis r4,0x0004
+ lis r4,0x0002
mtctr r4
li r4,0
1:
lwzx r0,r0,r4
addi r4,r4,32 /* Go to start of next cache line */
bdnz 1b
+ isync
/* Now, flush the first 4MB of memory */
- lis r4,0x0004
+ lis r4,0x0002
mtctr r4
li r4,0
sync
1:
- dcbf r0,r4
+ dcbf 0,r4
addi r4,r4,32 /* Go to start of next cache line */
bdnz 1b
@@ -166,25 +187,19 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
* L1 icache
*/
b 20f
-21:
+ .balign L1_CACHE_LINE_SIZE
+22:
sync
mtspr L2CR,r3
sync
- b 22f
+ b 23f
20:
- b 21b
-22:
- /* Before we perform the global invalidation, we must disable dynamic
- * power management via HID0[DPM] to work around a processor bug where
- * DPM can possibly interfere with the state machine in the processor
- * that invalidates the L2 cache tags.
- */
- mfspr r8,HID0 /* Save HID0 in r8 */
- rlwinm r4,r8,0,12,10 /* Turn off HID0[DPM] */
- sync
- mtspr HID0,r4 /* Disable DPM */
- sync
-
+ b 21f
+21: sync
+ isync
+ b 22b
+
+23:
/* Perform a global invalidation */
oris r3,r3,0x0020
sync
@@ -211,11 +226,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
mtspr L2CR,r3
sync
- /* Restore HID0[DPM] to whatever it was before */
- sync
- mtspr 1008,r8
- sync
-
/* See if we need to enable the cache */
cmplwi r5,0
beq 4f
@@ -225,10 +235,20 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPEC7450)
mtspr L2CR,r3
sync
+4:
+ bl __inval_enable_L1
+
+ /* Restore HID0[DPM] to whatever it was before */
+ sync
+ mtspr 1008,r8
+ sync
+
/* Restore MSR (restores EE and DR bits to original state) */
-4: SYNC
+ SYNC
mtmsr r7
isync
+
+ mtlr r9
blr
_GLOBAL(_get_L2CR)
@@ -286,7 +306,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_L3CR)
li r4,0
1:
lwzx r0,r0,r4
- dcbf r0,r4
+ dcbf 0,r4
addi r4,r4,32 /* Go to start of next cache line */
bdnz 1b
@@ -360,3 +380,73 @@ END_FTR_SECTION_IFSET(CPU_FTR_L3CR)
/* --- End of PowerLogix code ---
*/
+
+
+/* flush_disable_L1() - Flush and disable L1 cache
+ *
+ * clobbers r0, r3, ctr, cr0
+ *
+ */
+ .globl __flush_disable_L1
+ __flush_disable_L1:
+
+ /* Stop pending alitvec streams and memory accesses */
+BEGIN_FTR_SECTION
+ DSSALL
+END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
+ sync
+
+ /* Load counter to 0x1000 cache lines (128k) and
+ * load cache with datas
+ */
+ lis r3,0x0002
+// li r3,0x1000 /* 128kB / 32B */
+ mtctr r3
+ li r3, 0
+1:
+ lwz r0,0(r3)
+ addi r3,r3,0x0020 /* Go to start of next cache line */
+ bdnz 1b
+ isync
+ sync
+
+ /* Now flush those cache lines */
+ lis r3,0x0002
+// li r3,0x1000 /* 128kB / 32B */
+ mtctr r3
+ li r3, 0
+1:
+ dcbf 0,r3
+ addi r3,r3,0x0020 /* Go to start of next cache line */
+ bdnz 1b
+ sync
+
+ /* We can now disable the L1 cache (HID0:DCE, HID0:ICE) */
+ mfspr r3,SPRN_HID0
+ rlwinm r3,r3,0,18,15
+ mtspr SPRN_HID0,r3
+ sync
+ isync
+ blr
+
+/* inval_enable_L1 - Invalidate and enable L1 cache
+ *
+ * Assumes L1 is already disabled and MSR:EE is off
+ *
+ * clobbers r3
+ */
+ .globl __inval_enable_L1
+ __inval_enable_L1:
+ /* Enable and then Flash inval the instruction & data cache */
+ mfspr r3,SPRN_HID0
+ ori r3,r3, HID0_ICE|HID0_ICFI|HID0_DCE|HID0_DCI
+ sync
+ isync
+ mtspr SPRN_HID0,r3
+ xori r3,r3, HID0_ICFI|HID0_DCI
+ mtspr SPRN_HID0,r3
+ sync
+
+ blr
+
+
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 52bce07df930..93fd6fa14227 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -46,6 +46,7 @@
#include <asm/cputable.h>
#include <asm/btext.h>
#include <asm/div64.h>
+#include <asm/xmon.h>
#ifdef CONFIG_8xx
#include <asm/commproc.h>
@@ -306,7 +307,6 @@ EXPORT_SYMBOL(tb_ticks_per_jiffy);
EXPORT_SYMBOL(get_wchan);
EXPORT_SYMBOL(console_drivers);
#ifdef CONFIG_XMON
-extern void xmon_printf(char *fmt, ...);
EXPORT_SYMBOL(xmon);
EXPORT_SYMBOL(xmon_printf);
#endif
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 5408bc98bded..1b3689526e10 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -34,6 +34,7 @@
#include <asm/system.h>
#include <asm/pmac_feature.h>
#include <asm/sections.h>
+#include <asm/xmon.h>
#if defined CONFIG_KGDB
#include <asm/kgdb.h>
@@ -46,9 +47,6 @@ extern void identify_cpu(unsigned long offset, unsigned long cpu);
extern void do_cpu_ftr_fixups(unsigned long offset);
extern void reloc_got2(unsigned long offset);
-#ifdef CONFIG_XMON
-extern void xmon_map_scc(void);
-#endif
#ifdef CONFIG_KGDB
extern void kgdb_map_scc(void);
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index 21a23f743738..ca8a71bcca3b 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -35,6 +35,7 @@
#include <asm/time.h>
#include <asm/thread_info.h>
#include <asm/tlbflush.h>
+#include <asm/xmon.h>
int smp_threads_ready;
volatile int smp_commenced;
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index 91afc431e045..1d27a53642be 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -36,6 +36,7 @@
#include <asm/system.h>
#include <asm/io.h>
#include <asm/processor.h>
+#include <asm/xmon.h>
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
#endif
@@ -44,15 +45,6 @@ extern int fix_alignment(struct pt_regs *);
extern void bad_page_fault(struct pt_regs *, unsigned long, int sig);
#ifdef CONFIG_XMON
-extern void xmon(struct pt_regs *regs);
-extern int xmon_bpt(struct pt_regs *regs);
-extern int xmon_sstep(struct pt_regs *regs);
-extern int xmon_iabr_match(struct pt_regs *regs);
-extern int xmon_dabr_match(struct pt_regs *regs);
-extern void (*xmon_fault_handler)(struct pt_regs *regs);
-#endif
-
-#ifdef CONFIG_XMON
void (*debugger)(struct pt_regs *regs) = xmon;
int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
diff --git a/arch/ppc/platforms/4xx/redwood.h b/arch/ppc/platforms/4xx/redwood.h
index da544898e6ae..f52bc147ca63 100644
--- a/arch/ppc/platforms/4xx/redwood.h
+++ b/arch/ppc/platforms/4xx/redwood.h
@@ -49,7 +49,7 @@ typedef struct board_info {
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
-#define BASE_BAUD 1312500
+#define BASE_BAUD (378000000 / 18 / 16)
#define PPC4xx_MACHINE_NAME "IBM Redwood"
diff --git a/arch/ppc/platforms/4xx/redwood5.h b/arch/ppc/platforms/4xx/redwood5.h
index 42bc41ac8a24..91b761635166 100644
--- a/arch/ppc/platforms/4xx/redwood5.h
+++ b/arch/ppc/platforms/4xx/redwood5.h
@@ -45,9 +45,7 @@ typedef struct board_info {
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
-/* serail defines moved from ppc4xx_serial.h *
- */
-#define BASE_BAUD 1267200
+#define BASE_BAUD (378000000 / 18 / 16)
#define PPC4xx_MACHINE_NAME "IBM Redwood5"
diff --git a/arch/ppc/platforms/4xx/redwood6.h b/arch/ppc/platforms/4xx/redwood6.h
index 84dfef719222..bbb61122497d 100755
--- a/arch/ppc/platforms/4xx/redwood6.h
+++ b/arch/ppc/platforms/4xx/redwood6.h
@@ -46,7 +46,7 @@ typedef struct board_info {
#define _ISA_MEM_BASE 0
#define PCI_DRAM_OFFSET 0
-#define BASE_BAUD 1267200
+#define BASE_BAUD (378000000 / 18 / 16)
#define PPC4xx_MACHINE_NAME "IBM Redwood6"
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
index 7e9c03c8a09f..bffc87e059e4 100644
--- a/arch/ppc/platforms/chrp_setup.c
+++ b/arch/ppc/platforms/chrp_setup.c
@@ -36,6 +36,7 @@
#include <linux/console.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
+#include <linux/initrd.h>
#include <asm/processor.h>
#include <asm/io.h>
@@ -52,6 +53,7 @@
#include <asm/btext.h>
#include <asm/i8259.h>
#include <asm/open_pic.h>
+#include <asm/xmon.h>
unsigned long chrp_get_rtc_time(void);
int chrp_set_rtc_time(unsigned long nowtime);
@@ -67,6 +69,13 @@ void btext_progress(char *, unsigned short);
extern unsigned long pmac_find_end_of_memory(void);
extern int of_show_percpuinfo(struct seq_file *, int);
+/*
+ * XXX this should be in xmon.h, but putting it there means xmon.h
+ * has to include <linux/interrupt.h> (to get irqreturn_t), which
+ * causes all sorts of problems. -- paulus
+ */
+extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
+
extern dev_t boot_dev;
extern PTE *Hash, *Hash_end;
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
index 26dc16846cc9..6dd2e104fe8e 100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -262,13 +262,19 @@ pmac_cpufreq_setup(void)
goto out;
cur_freq = (*value) / 1000;
- /* Check for tibook 800Mhz or 1Ghz */
- if (machine_is_compatible("PowerBook3,4") || machine_is_compatible("PowerBook3,5")) {
+ /* Check for newer machines */
+ if (machine_is_compatible("PowerBook3,4") ||
+ machine_is_compatible("PowerBook3,5") ||
+ machine_is_compatible("MacRISC3")) {
value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
if (!value)
goto out;
low_freq = (*value) / 1000;
-
+ /* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree
+ * here */
+ if (low_freq < 100000)
+ low_freq *= 10;
+
value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL);
if (!value)
goto out;
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
index 518650988ed4..5c4ae1fe1526 100644
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -52,8 +52,8 @@
#endif
/* Exported from arch/ppc/kernel/idle.c */
-extern int powersave_nap;
extern int powersave_lowspeed;
+extern int powersave_nap;
/*
* We use a single global lock to protect accesses. Each driver has
@@ -1894,10 +1894,22 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
PMAC_TYPE_RACKMAC, rackmac_features,
0,
},
+ { "RackMac1,2", "XServe rev. 2",
+ PMAC_TYPE_RACKMAC, rackmac_features,
+ 0,
+ },
{ "PowerMac3,6", "PowerMac G4 Windtunnel",
PMAC_TYPE_WINDTUNNEL, rackmac_features,
0,
},
+ { "PowerBook5,1", "PowerBook G4 17\"",
+ PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
+ PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+ },
+ { "PowerBook6,1", "PowerBook G4 12\"",
+ PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
+ PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+ },
};
/*
@@ -1994,8 +2006,8 @@ probe_motherboard(void)
pmac_mb.features = pangea_features;
break;
case macio_intrepid:
- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_PANGEA;
- pmac_mb.model_name = "Unknown Pangea-based";
+ pmac_mb.model_id = PMAC_TYPE_UNKNOWN_INTREPID;
+ pmac_mb.model_name = "Unknown Intrepid-based";
pmac_mb.features = intrepid_features;
break;
default:
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
index 5fd3c4caa43d..6df70bfb4d87 100644
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -30,9 +30,17 @@
#include <asm/pci-bridge.h>
#include <asm/time.h>
#include <asm/open_pic.h>
+#include <asm/xmon.h>
#include "pmac_pic.h"
+/*
+ * XXX this should be in xmon.h, but putting it there means xmon.h
+ * has to include <linux/interrupt.h> (to get irqreturn_t), which
+ * causes all sorts of problems. -- paulus
+ */
+extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);
+
struct pmac_irq_hw {
unsigned int event;
unsigned int enable;
@@ -177,7 +185,7 @@ struct hw_interrupt_type gatwick_pic = {
NULL
};
-static void gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
+static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
{
int irq, bits;
@@ -190,16 +198,11 @@ static void gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
if (bits == 0)
continue;
irq += __ilog2(bits);
- break;
+ ppc_irq_dispatch_handler(regs, irq);
+ return IRQ_HANDLED;
}
- /* The previous version of this code allowed for this case, we
- * don't. Put this here to check for it.
- * -- Cort
- */
- if ( irq_desc[irq].handler != &gatwick_pic )
- printk("gatwick irq not from gatwick pic\n");
- else
- ppc_irq_dispatch_handler( regs, irq );
+ printk("gatwick irq not from gatwick pic\n");
+ return IRQ_NONE;
}
int
@@ -393,7 +396,7 @@ pmac_pic_init(void)
nmi_irq = pswitch->intrs[0].line;
openpic_init_nmi_irq(nmi_irq);
request_irq(nmi_irq, xmon_irq, 0,
- "NMI - XMON", 0);
+ "NMI - XMON", 0);
}
}
#endif /* CONFIG_XMON */
diff --git a/arch/ppc/platforms/pmac_sleep.S b/arch/ppc/platforms/pmac_sleep.S
index 4daebad932e7..9f8956c6067e 100644
--- a/arch/ppc/platforms/pmac_sleep.S
+++ b/arch/ppc/platforms/pmac_sleep.S
@@ -15,6 +15,7 @@
#include <asm/page.h>
#include <asm/ppc_asm.h>
#include <asm/cputable.h>
+#include <asm/cache.h>
#include <asm/thread_info.h>
#include <asm/offsets.h>
@@ -157,33 +158,22 @@ _GLOBAL(low_sleep_handler)
addi r3,r3,sleep_storage@l
stw r5,0(r3)
-BEGIN_FTR_SECTION
- DSSALL
+ /* Disable DPM during cache flush */
+ mfspr r3, SPRN_HID0
+ rlwinm r3,r3,0,12,10
sync
-END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
-
-/*
- * Flush the L1 data cache by reading the first 128kB of RAM
- * and then flushing the same area with the dcbf instruction.
- * The L2 cache has already been disabled.
- */
- li r4,0x1000 /* 128kB / 32B */
- mtctr r4
- lis r4,KERNELBASE@h
-1:
- lwz r0,0(r4)
- addi r4,r4,0x0020 /* Go to start of next cache line */
- bdnz 1b
+ mtspr SPRN_HID0,r3
sync
- li r4,0x1000 /* 128kB / 32B */
- mtctr r4
- lis r4,KERNELBASE@h
-1:
- dcbf r0,r4
- addi r4,r4,0x0020 /* Go to start of next cache line */
- bdnz 1b
+ /* Turn off data relocation. */
+ mfmsr r3 /* Save MSR in r7 */
+ rlwinm r3,r3,0,28,26 /* Turn off DR bit */
sync
+ mtmsr r3
+ isync
+
+ /* Flush & disable L1 cache */
+ bl __flush_disable_L1
/*
* Set the HID0 and MSR for sleep.
@@ -192,6 +182,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
rlwinm r2,r2,0,10,7 /* clear doze, nap */
oris r2,r2,HID0_SLEEP@h
sync
+ isync
mtspr HID0,r2
sync
@@ -252,16 +243,11 @@ _GLOBAL(core99_wake_up)
*/
grackle_wake_up:
- /* Enable and then Flash inval the instruction & data cache */
- mfspr r3,HID0
- ori r3,r3, HID0_ICE|HID0_ICFI|HID0_DCE|HID0_DCI
- sync
- isync
- mtspr HID0,r3
- xori r3,r3, HID0_ICFI|HID0_DCI
- mtspr HID0,r3
- sync
-
+ /* Invalidate & enable L1 cache, we don't care about
+ * whatever the ROM may have tried to write to memory
+ */
+ bl __inval_enable_L1
+
/* Restore the kernel's segment registers before
* we do any r1 memory access as we are not sure they
* are in a sane state above the first 256Mb region
@@ -274,6 +260,8 @@ grackle_wake_up:
addi r3,r3,0x111 /* increment VSID */
addis r4,r4,0x1000 /* address of next segment */
bdnz 3b
+ sync
+ isync
subi r1,r1,SL_PC
@@ -325,6 +313,26 @@ grackle_wake_up:
lwz r4,SL_IBAT3+4(r1)
mtibatl 3,r4
+BEGIN_FTR_SECTION
+ li r4,0
+ mtspr SPRN_DBAT4U,r4
+ mtspr SPRN_DBAT4L,r4
+ mtspr SPRN_DBAT5U,r4
+ mtspr SPRN_DBAT5L,r4
+ mtspr SPRN_DBAT6U,r4
+ mtspr SPRN_DBAT6L,r4
+ mtspr SPRN_DBAT7U,r4
+ mtspr SPRN_DBAT7L,r4
+ mtspr SPRN_IBAT4U,r4
+ mtspr SPRN_IBAT4L,r4
+ mtspr SPRN_IBAT5U,r4
+ mtspr SPRN_IBAT5L,r4
+ mtspr SPRN_IBAT6U,r4
+ mtspr SPRN_IBAT6L,r4
+ mtspr SPRN_IBAT7U,r4
+ mtspr SPRN_IBAT7L,r4
+END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
+
/* Flush all TLBs */
lis r4,0x1000
1: addic. r4,r4,-0x1000
@@ -368,8 +376,9 @@ turn_on_mmu:
#endif /* defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_CPU_FREQ) */
-
- .data
- .globl sleep_storage
+ .section .data
+ .balign L1_CACHE_LINE_SIZE
sleep_storage:
.long 0
+ .balign L1_CACHE_LINE_SIZE, 0
+ .section .text
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
index f558e977e242..0cf23794f1a8 100644
--- a/arch/ppc/platforms/pmac_smp.c
+++ b/arch/ppc/platforms/pmac_smp.c
@@ -3,6 +3,12 @@
*
* We support both the old "powersurge" SMP architecture
* and the current Core99 (G4 PowerMac) machines.
+ *
+ * Note that we don't support the very first rev. of
+ * Apple/DayStar 2 CPUs board, the one with the funky
+ * watchdog. Hopefully, none of these should be there except
+ * maybe internally to Apple. I should probably still add some
+ * code to detect this card though and disable SMP. --BenH.
*
* Support Macintosh G4 SMP by Troy Benjegerdes (hozer@drgw.net)
* and Ben Herrenschmidt <benh@kernel.crashing.org>.
@@ -92,25 +98,22 @@ static volatile u32 *psurge_pri_intr;
static volatile u8 *psurge_sec_intr;
static volatile u32 *psurge_start;
-/* what sort of powersurge board we have */
-static int psurge_type;
-
/* values for psurge_type */
+#define PSURGE_NONE -1
#define PSURGE_DUAL 0
#define PSURGE_QUAD_OKEE 1
#define PSURGE_QUAD_COTTON 2
#define PSURGE_QUAD_ICEGRASS 3
+/* what sort of powersurge board we have */
+static int psurge_type = PSURGE_NONE;
+
volatile static long int core99_l2_cache;
volatile static long int core99_l3_cache;
static void __init
core99_init_caches(int cpu)
{
- /* Check cache presence on cpu 0, we assume all CPUs have
- * same features here. We also assume that if we don't have
- * L2CR, we don't have L3CR neither
- */
if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
return;
@@ -143,6 +146,8 @@ core99_init_caches(int cpu)
*/
static inline void psurge_set_ipi(int cpu)
{
+ if (psurge_type == PSURGE_NONE)
+ return;
if (cpu == 0)
in_be32(psurge_pri_intr);
else if (psurge_type == PSURGE_DUAL)
@@ -154,10 +159,14 @@ static inline void psurge_set_ipi(int cpu)
static inline void psurge_clr_ipi(int cpu)
{
if (cpu > 0) {
- if (psurge_type == PSURGE_DUAL)
+ switch(psurge_type) {
+ case PSURGE_DUAL:
out_8(psurge_sec_intr, ~0);
- else
+ case PSURGE_NONE:
+ break;
+ default:
PSURGE_QUAD_OUT(PSURGE_QUAD_IRQ_CLR, 1 << cpu);
+ }
}
}
@@ -189,10 +198,11 @@ psurge_smp_message_recv(struct pt_regs *regs)
smp_message_recv(msg, regs);
}
-void __pmac
+irqreturn_t __pmac
psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
{
psurge_smp_message_recv(regs);
+ return IRQ_HANDLED;
}
static void __pmac
@@ -311,6 +321,7 @@ static int __init smp_psurge_probe(void)
if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) {
/* not a dual-cpu card */
iounmap((void *) hhead_base);
+ psurge_type = PSURGE_NONE;
return 1;
}
ncpus = 2;
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
index 574bf95601c9..b43033e67319 100644
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -850,7 +850,7 @@ prep_res_calibrate_decr(void)
static volatile int calibrate_steps __initdata = 3;
static unsigned tbstamp __initdata = 0;
-static void __init
+static irqreturn_t __init
prep_calibrate_decr_handler(int irq, void *dev, struct pt_regs *regs)
{
unsigned long t, freq;
@@ -866,6 +866,7 @@ prep_calibrate_decr_handler(int irq, void *dev, struct pt_regs *regs)
tb_ticks_per_jiffy = freq / HZ;
tb_to_us = mulhwu_scale_factor(freq, 1000000);
}
+ return IRQ_HANDLED;
}
static void __init
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c
index 4834ee8bd77e..f39336e84ddb 100644
--- a/arch/ppc/syslib/m8xx_setup.c
+++ b/arch/ppc/syslib/m8xx_setup.c
@@ -44,6 +44,7 @@
#include <asm/machdep.h>
#include <asm/bootinfo.h>
#include <asm/time.h>
+#include <asm/xmon.h>
#include "ppc8xx_pic.h"
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 33798a25a470..f91d2c4f3bb0 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -821,9 +821,10 @@ static void openpic_end_ipi(unsigned int irq_nr)
{
}
-static void openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs)
+static irqreturn_t openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs)
{
smp_message_recv(cpl-OPENPIC_VEC_IPI-open_pic_irq_offset, regs);
+ return IRQ_HANDLED;
}
#endif /* CONFIG_SMP */
diff --git a/arch/ppc/syslib/ppc8xx_pic.c b/arch/ppc/syslib/ppc8xx_pic.c
index a0e94c9e382c..73ae3c04dc26 100644
--- a/arch/ppc/syslib/ppc8xx_pic.c
+++ b/arch/ppc/syslib/ppc8xx_pic.c
@@ -168,7 +168,8 @@ void mbx_i8259_action(int cpl, void *dev_id, struct pt_regs *regs)
* drivers that may mess up the internal interrupt controllers, and also
* allow them to run without modification on the MBX.
*/
-int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+int request_irq(unsigned int irq,
+ irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags, const char * devname, void *dev_id)
{
diff --git a/arch/ppc/xmon/nonstdio.h b/arch/ppc/xmon/nonstdio.h
index 40fe416add76..0240bc573c96 100644
--- a/arch/ppc/xmon/nonstdio.h
+++ b/arch/ppc/xmon/nonstdio.h
@@ -15,7 +15,6 @@ extern FILE *xmon_stdin, *xmon_stdout;
#define fflush(f) do {} while (0)
#define fclose(f) do {} while (0)
extern char *fgets(char *, int, void *);
-extern void xmon_printf(const char *, ...);
extern void xmon_fprintf(void *, const char *, ...);
extern void xmon_sprintf(char *, const char *, ...);
extern void xmon_puts(char*);
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index 96637c34a6f9..15f55126c5ad 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -26,7 +26,6 @@
static volatile unsigned char *sccc, *sccd;
unsigned int TXRDY, RXRDY, DLAB;
-extern void xmon_printf(const char *fmt, ...);
static int xmon_expect(const char *str, unsigned int timeout);
static int use_serial;
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index c1a0b08ccd96..725c295e43b3 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -7,12 +7,14 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/smp.h>
+#include <linux/interrupt.h>
#include <asm/ptrace.h>
#include <asm/string.h>
#include <asm/prom.h>
#include <asm/bitops.h>
#include <asm/bootx.h>
#include <asm/machdep.h>
+#include <asm/xmon.h>
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
#endif
@@ -103,7 +105,12 @@ static void cpu_cmd(void);
#endif /* CONFIG_SMP */
static int pretty_print_addr(unsigned long addr);
static void csum(void);
+#ifdef CONFIG_BOOTX_TEXT
+static void vidcmds(void);
+#endif
static void bootcmds(void);
+static void proccall(void);
+static void printtime(void);
extern int print_insn_big_powerpc(FILE *, unsigned long, unsigned);
extern void printf(const char *fmt, ...);
@@ -116,6 +123,9 @@ extern void xmon_leave(void);
extern char* xmon_find_symbol(unsigned long addr, unsigned long* saddr);
extern unsigned long xmon_symbol_to_addr(char* symbol);
+static unsigned start_tb[NR_CPUS][2];
+static unsigned stop_tb[NR_CPUS][2];
+
#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
@@ -165,6 +175,20 @@ extern inline void __delay(unsigned int loops)
"r" (loops) : "ctr");
}
+static void get_tb(unsigned *p)
+{
+ unsigned hi, lo, hiagain;
+
+ if ((get_pvr() >> 16) == 1)
+ return;
+
+ do {
+ asm volatile("mftbu %0; mftb %1; mftbu %2"
+ : "=r" (hi), "=r" (lo), "=r" (hiagain));
+ } while (hi != hiagain);
+ p[0] = hi;
+ p[1] = lo;
+}
void
xmon(struct pt_regs *excp)
@@ -172,6 +196,7 @@ xmon(struct pt_regs *excp)
struct pt_regs regs;
int msr, cmd;
+ get_tb(stop_tb[smp_processor_id()]);
if (excp == NULL) {
asm volatile ("stw 0,0(%0)\n\
lwz 0,0(1)\n\
@@ -234,17 +259,18 @@ xmon(struct pt_regs *excp)
clear_bit(smp_processor_id(), &cpus_in_xmon);
#endif /* CONFIG_SMP */
set_msr(msr); /* restore interrupt enable */
+ get_tb(start_tb[smp_processor_id()]);
}
-void
+irqreturn_t
xmon_irq(int irq, void *d, struct pt_regs *regs)
{
unsigned long flags;
- local_save_flags(flags);
- local_irq_disable();
+ local_irq_save(flags);
printf("Keyboard interrupt\n");
xmon(regs);
local_irq_restore(flags);
+ return IRQ_HANDLED;
}
int
@@ -481,13 +507,39 @@ cmds(struct pt_regs *excp)
cpu_cmd();
break;
#endif /* CONFIG_SMP */
+#ifdef CONFIG_BOOTX_TEXT
+ case 'v':
+ vidcmds();
+ break;
+#endif
case 'z':
bootcmds();
break;
+ case 'p':
+ proccall();
+ break;
+ case 'T':
+ printtime();
+ break;
}
}
}
+extern unsigned tb_to_us;
+
+#define mulhwu(x,y) \
+({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})
+
+static void printtime(void)
+{
+ unsigned int delta;
+
+ delta = stop_tb[smp_processor_id()][1]
+ - start_tb[smp_processor_id()][1];
+ delta = mulhwu(tb_to_us, delta);
+ printf("%u.%06u seconds\n", delta / 1000000, delta % 1000000);
+}
+
static void bootcmds(void)
{
int cmd;
@@ -551,6 +603,44 @@ static void cpu_cmd(void)
}
#endif /* CONFIG_SMP */
+#ifdef CONFIG_BOOTX_TEXT
+extern boot_infos_t disp_bi;
+
+static void vidcmds(void)
+{
+ int c = inchar();
+ unsigned int val, w;
+ extern int boot_text_mapped;
+
+ if (!boot_text_mapped)
+ return;
+ if (c != '\n' && scanhex(&val)) {
+ switch (c) {
+ case 'd':
+ w = disp_bi.dispDeviceRowBytes
+ / (disp_bi.dispDeviceDepth >> 3);
+ disp_bi.dispDeviceDepth = val;
+ disp_bi.dispDeviceRowBytes = w * (val >> 3);
+ return;
+ case 'p':
+ disp_bi.dispDeviceRowBytes = val;
+ return;
+ case 'w':
+ disp_bi.dispDeviceRect[2] = val;
+ return;
+ case 'h':
+ disp_bi.dispDeviceRect[3] = val;
+ return;
+ }
+ }
+ printf("W = %d (0x%x) H = %d (0x%x) D = %d (0x%x) P = %d (0x%x)\n",
+ disp_bi.dispDeviceRect[2], disp_bi.dispDeviceRect[2],
+ disp_bi.dispDeviceRect[3], disp_bi.dispDeviceRect[3],
+ disp_bi.dispDeviceDepth, disp_bi.dispDeviceDepth,
+ disp_bi.dispDeviceRowBytes, disp_bi.dispDeviceRowBytes);
+}
+#endif /* CONFIG_BOOTX_TEXT */
+
static unsigned short fcstab[256] = {
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
@@ -927,34 +1017,6 @@ super_regs()
scannl();
}
-#if 0
-static void
-openforth()
-{
- int c;
- char *p;
- char cmd[1024];
- int args[5];
- extern int (*prom_entry)(int *);
-
- p = cmd;
- c = skipbl();
- while (c != '\n') {
- *p++ = c;
- c = inchar();
- }
- *p = 0;
- args[0] = (int) "interpret";
- args[1] = 1;
- args[2] = 1;
- args[3] = (int) cmd;
- (*prom_entry)(args);
- printf("\n");
- if (args[4] != 0)
- printf("error %x\n", args[4]);
-}
-#endif
-
#ifndef CONFIG_PPC_STD_MMU
static void
dump_hash_table()
@@ -1176,11 +1238,13 @@ mwrite(unsigned adrs, void *buf, int size)
}
static int fault_type;
+static int fault_except;
static char *fault_chars[] = { "--", "**", "##" };
static void
handle_fault(struct pt_regs *regs)
{
+ fault_except = TRAP(regs);
fault_type = TRAP(regs) == 0x200? 0: TRAP(regs) == 0x300? 1: 2;
longjmp(bus_error_jmp, 1);
}
@@ -1578,6 +1642,41 @@ memzcan()
printf("%.8x\n", a - mskip);
}
+void proccall(void)
+{
+ unsigned int args[8];
+ unsigned int ret;
+ int i;
+ typedef unsigned int (*callfunc_t)(unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int);
+ callfunc_t func;
+
+ scanhex(&adrs);
+ if (termch != '\n')
+ termch = 0;
+ for (i = 0; i < 8; ++i)
+ args[i] = 0;
+ for (i = 0; i < 8; ++i) {
+ if (!scanhex(&args[i]) || termch == '\n')
+ break;
+ termch = 0;
+ }
+ func = (callfunc_t) adrs;
+ ret = 0;
+ if (setjmp(bus_error_jmp) == 0) {
+ debugger_fault_handler = handle_fault;
+ sync();
+ ret = func(args[0], args[1], args[2], args[3],
+ args[4], args[5], args[6], args[7]);
+ sync();
+ printf("return value is %x\n", ret);
+ } else {
+ printf("*** %x exception occurred\n", fault_except);
+ }
+ debugger_fault_handler = 0;
+}
+
/* Input scanning routines */
int
skipbl()
diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
index beb42d722696..91cb0d7bdb01 100644
--- a/arch/ppc64/kernel/ioctl32.c
+++ b/arch/ppc64/kernel/ioctl32.c
@@ -3649,9 +3649,9 @@ struct ioctl_trans {
unsigned long next;
};
-#define COMPATIBLE_IOCTL(cmd) { cmd, (unsigned long)sys_ioctl, 0 }
+#define COMPATIBLE_IOCTL(cmd) { cmd, (unsigned long)sys_ioctl, 0 },
-#define HANDLE_IOCTL(cmd,handler) { cmd, (unsigned long)handler, 0 }
+#define HANDLE_IOCTL(cmd,handler) { cmd, (unsigned long)handler, 0 },
#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int)
#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
@@ -3661,942 +3661,816 @@ static struct ioctl_trans ioctl_translations[] = {
* all others default to calling sys_ioctl().
*/
/* Big T */
-COMPATIBLE_IOCTL(TCGETA),
-COMPATIBLE_IOCTL(TCSETA),
-COMPATIBLE_IOCTL(TCSETAW),
-COMPATIBLE_IOCTL(TCSETAF),
-COMPATIBLE_IOCTL(TCSBRK),
-COMPATIBLE_IOCTL(TCSBRKP),
-COMPATIBLE_IOCTL(TCXONC),
-COMPATIBLE_IOCTL(TCFLSH),
-COMPATIBLE_IOCTL(TCGETS),
-COMPATIBLE_IOCTL(TCSETS),
-COMPATIBLE_IOCTL(TCSETSW),
-COMPATIBLE_IOCTL(TCSETSF),
-COMPATIBLE_IOCTL(TIOCLINUX),
-COMPATIBLE_IOCTL(TIOCSTART),
-COMPATIBLE_IOCTL(TIOCSTOP),
+COMPATIBLE_IOCTL(TCGETA)
+COMPATIBLE_IOCTL(TCSETA)
+COMPATIBLE_IOCTL(TCSETAW)
+COMPATIBLE_IOCTL(TCSETAF)
+COMPATIBLE_IOCTL(TCSBRK)
+COMPATIBLE_IOCTL(TCSBRKP)
+COMPATIBLE_IOCTL(TCXONC)
+COMPATIBLE_IOCTL(TCFLSH)
+COMPATIBLE_IOCTL(TCGETS)
+COMPATIBLE_IOCTL(TCSETS)
+COMPATIBLE_IOCTL(TCSETSW)
+COMPATIBLE_IOCTL(TCSETSF)
+COMPATIBLE_IOCTL(TIOCLINUX)
+COMPATIBLE_IOCTL(TIOCSTART)
+COMPATIBLE_IOCTL(TIOCSTOP)
/* Little t */
-COMPATIBLE_IOCTL(TIOCGETD),
-COMPATIBLE_IOCTL(TIOCSETD),
-COMPATIBLE_IOCTL(TIOCEXCL),
-COMPATIBLE_IOCTL(TIOCNXCL),
-COMPATIBLE_IOCTL(TIOCCONS),
-COMPATIBLE_IOCTL(TIOCGSOFTCAR),
-COMPATIBLE_IOCTL(TIOCSSOFTCAR),
-COMPATIBLE_IOCTL(TIOCSWINSZ),
-COMPATIBLE_IOCTL(TIOCGWINSZ),
-COMPATIBLE_IOCTL(TIOCMGET),
-COMPATIBLE_IOCTL(TIOCMBIC),
-COMPATIBLE_IOCTL(TIOCMBIS),
-COMPATIBLE_IOCTL(TIOCMSET),
-COMPATIBLE_IOCTL(TIOCPKT),
-COMPATIBLE_IOCTL(TIOCNOTTY),
-COMPATIBLE_IOCTL(TIOCSTI),
-COMPATIBLE_IOCTL(TIOCOUTQ),
-COMPATIBLE_IOCTL(TIOCSPGRP),
-COMPATIBLE_IOCTL(TIOCGPGRP),
-COMPATIBLE_IOCTL(TIOCSCTTY),
-COMPATIBLE_IOCTL(TIOCGPTN),
-COMPATIBLE_IOCTL(TIOCSPTLCK),
-COMPATIBLE_IOCTL(TIOCGSERIAL),
-COMPATIBLE_IOCTL(TIOCSSERIAL),
-COMPATIBLE_IOCTL(TIOCSERGETLSR),
-COMPATIBLE_IOCTL(TIOCSLTC),
+COMPATIBLE_IOCTL(TIOCGETD)
+COMPATIBLE_IOCTL(TIOCSETD)
+COMPATIBLE_IOCTL(TIOCEXCL)
+COMPATIBLE_IOCTL(TIOCNXCL)
+COMPATIBLE_IOCTL(TIOCCONS)
+COMPATIBLE_IOCTL(TIOCGSOFTCAR)
+COMPATIBLE_IOCTL(TIOCSSOFTCAR)
+COMPATIBLE_IOCTL(TIOCSWINSZ)
+COMPATIBLE_IOCTL(TIOCGWINSZ)
+COMPATIBLE_IOCTL(TIOCMGET)
+COMPATIBLE_IOCTL(TIOCMBIC)
+COMPATIBLE_IOCTL(TIOCMBIS)
+COMPATIBLE_IOCTL(TIOCMSET)
+COMPATIBLE_IOCTL(TIOCPKT)
+COMPATIBLE_IOCTL(TIOCNOTTY)
+COMPATIBLE_IOCTL(TIOCSTI)
+COMPATIBLE_IOCTL(TIOCOUTQ)
+COMPATIBLE_IOCTL(TIOCSPGRP)
+COMPATIBLE_IOCTL(TIOCGPGRP)
+COMPATIBLE_IOCTL(TIOCSCTTY)
+COMPATIBLE_IOCTL(TIOCGPTN)
+COMPATIBLE_IOCTL(TIOCSPTLCK)
+COMPATIBLE_IOCTL(TIOCGSERIAL)
+COMPATIBLE_IOCTL(TIOCSSERIAL)
+COMPATIBLE_IOCTL(TIOCSERGETLSR)
+COMPATIBLE_IOCTL(TIOCSLTC)
/* Big F */
-COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO),
-COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO),
-COMPATIBLE_IOCTL(FBIOPAN_DISPLAY),
-COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP),
-COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP),
+COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
+COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
+COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
+COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
+COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
#if 0
-COMPATIBLE_IOCTL(FBIOBLANK),
+COMPATIBLE_IOCTL(FBIOBLANK)
#endif
/* Little f */
-COMPATIBLE_IOCTL(FIOCLEX),
-COMPATIBLE_IOCTL(FIONCLEX),
-COMPATIBLE_IOCTL(FIOASYNC),
-COMPATIBLE_IOCTL(FIONBIO),
-COMPATIBLE_IOCTL(FIONREAD), /* This is also TIOCINQ */
+COMPATIBLE_IOCTL(FIOCLEX)
+COMPATIBLE_IOCTL(FIONCLEX)
+COMPATIBLE_IOCTL(FIOASYNC)
+COMPATIBLE_IOCTL(FIONBIO)
+COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
/* 0x00 */
-COMPATIBLE_IOCTL(FIBMAP),
-COMPATIBLE_IOCTL(FIGETBSZ),
+COMPATIBLE_IOCTL(FIBMAP)
+COMPATIBLE_IOCTL(FIGETBSZ)
/* 0x03 -- HD/IDE ioctl's used by hdparm and friends.
* Some need translations, these do not.
*/
-COMPATIBLE_IOCTL(HDIO_GET_IDENTITY),
-COMPATIBLE_IOCTL(HDIO_SET_DMA),
-COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR),
-COMPATIBLE_IOCTL(HDIO_SET_NOWERR),
-COMPATIBLE_IOCTL(HDIO_SET_32BIT),
-COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT),
-COMPATIBLE_IOCTL(HDIO_DRIVE_CMD),
-COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE),
-COMPATIBLE_IOCTL(HDIO_SET_NICE),
+COMPATIBLE_IOCTL(HDIO_GET_IDENTITY)
+COMPATIBLE_IOCTL(HDIO_SET_DMA)
+COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR)
+COMPATIBLE_IOCTL(HDIO_SET_NOWERR)
+COMPATIBLE_IOCTL(HDIO_SET_32BIT)
+COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT)
+COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
+COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
+COMPATIBLE_IOCTL(HDIO_SET_NICE)
/* 0x02 -- Floppy ioctls */
-COMPATIBLE_IOCTL(FDMSGON),
-COMPATIBLE_IOCTL(FDMSGOFF),
-COMPATIBLE_IOCTL(FDSETEMSGTRESH),
-COMPATIBLE_IOCTL(FDFLUSH),
-COMPATIBLE_IOCTL(FDWERRORCLR),
-COMPATIBLE_IOCTL(FDSETMAXERRS),
-COMPATIBLE_IOCTL(FDGETMAXERRS),
-COMPATIBLE_IOCTL(FDGETDRVTYP),
-COMPATIBLE_IOCTL(FDEJECT),
-COMPATIBLE_IOCTL(FDCLRPRM),
-COMPATIBLE_IOCTL(FDFMTBEG),
-COMPATIBLE_IOCTL(FDFMTEND),
-COMPATIBLE_IOCTL(FDRESET),
-COMPATIBLE_IOCTL(FDTWADDLE),
-COMPATIBLE_IOCTL(FDFMTTRK),
-COMPATIBLE_IOCTL(FDRAWCMD),
+COMPATIBLE_IOCTL(FDMSGON)
+COMPATIBLE_IOCTL(FDMSGOFF)
+COMPATIBLE_IOCTL(FDSETEMSGTRESH)
+COMPATIBLE_IOCTL(FDFLUSH)
+COMPATIBLE_IOCTL(FDWERRORCLR)
+COMPATIBLE_IOCTL(FDSETMAXERRS)
+COMPATIBLE_IOCTL(FDGETMAXERRS)
+COMPATIBLE_IOCTL(FDGETDRVTYP)
+COMPATIBLE_IOCTL(FDEJECT)
+COMPATIBLE_IOCTL(FDCLRPRM)
+COMPATIBLE_IOCTL(FDFMTBEG)
+COMPATIBLE_IOCTL(FDFMTEND)
+COMPATIBLE_IOCTL(FDRESET)
+COMPATIBLE_IOCTL(FDTWADDLE)
+COMPATIBLE_IOCTL(FDFMTTRK)
+COMPATIBLE_IOCTL(FDRAWCMD)
/* 0x12 */
-COMPATIBLE_IOCTL(BLKROSET),
-COMPATIBLE_IOCTL(BLKROGET),
-COMPATIBLE_IOCTL(BLKRRPART),
-COMPATIBLE_IOCTL(BLKFLSBUF),
-COMPATIBLE_IOCTL(BLKSECTSET),
-COMPATIBLE_IOCTL(BLKSSZGET),
-COMPATIBLE_IOCTL(BLKRASET),
-COMPATIBLE_IOCTL(BLKFRASET),
+COMPATIBLE_IOCTL(BLKROSET)
+COMPATIBLE_IOCTL(BLKROGET)
+COMPATIBLE_IOCTL(BLKRRPART)
+COMPATIBLE_IOCTL(BLKFLSBUF)
+COMPATIBLE_IOCTL(BLKSECTSET)
+COMPATIBLE_IOCTL(BLKSSZGET)
+COMPATIBLE_IOCTL(BLKRASET)
+COMPATIBLE_IOCTL(BLKFRASET)
/* RAID */
-COMPATIBLE_IOCTL(RAID_VERSION),
-COMPATIBLE_IOCTL(GET_ARRAY_INFO),
-COMPATIBLE_IOCTL(GET_DISK_INFO),
-COMPATIBLE_IOCTL(PRINT_RAID_DEBUG),
-COMPATIBLE_IOCTL(CLEAR_ARRAY),
-COMPATIBLE_IOCTL(ADD_NEW_DISK),
-COMPATIBLE_IOCTL(HOT_REMOVE_DISK),
-COMPATIBLE_IOCTL(SET_ARRAY_INFO),
-COMPATIBLE_IOCTL(SET_DISK_INFO),
-COMPATIBLE_IOCTL(WRITE_RAID_INFO),
-COMPATIBLE_IOCTL(UNPROTECT_ARRAY),
-COMPATIBLE_IOCTL(PROTECT_ARRAY),
-COMPATIBLE_IOCTL(HOT_ADD_DISK),
-COMPATIBLE_IOCTL(SET_DISK_FAULTY),
-COMPATIBLE_IOCTL(RUN_ARRAY),
-COMPATIBLE_IOCTL(START_ARRAY),
-COMPATIBLE_IOCTL(STOP_ARRAY),
-COMPATIBLE_IOCTL(STOP_ARRAY_RO),
-COMPATIBLE_IOCTL(RESTART_ARRAY_RW),
+COMPATIBLE_IOCTL(RAID_VERSION)
+COMPATIBLE_IOCTL(GET_ARRAY_INFO)
+COMPATIBLE_IOCTL(GET_DISK_INFO)
+COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
+COMPATIBLE_IOCTL(CLEAR_ARRAY)
+COMPATIBLE_IOCTL(ADD_NEW_DISK)
+COMPATIBLE_IOCTL(HOT_REMOVE_DISK)
+COMPATIBLE_IOCTL(SET_ARRAY_INFO)
+COMPATIBLE_IOCTL(SET_DISK_INFO)
+COMPATIBLE_IOCTL(WRITE_RAID_INFO)
+COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
+COMPATIBLE_IOCTL(PROTECT_ARRAY)
+COMPATIBLE_IOCTL(HOT_ADD_DISK)
+COMPATIBLE_IOCTL(SET_DISK_FAULTY)
+COMPATIBLE_IOCTL(RUN_ARRAY)
+COMPATIBLE_IOCTL(START_ARRAY)
+COMPATIBLE_IOCTL(STOP_ARRAY)
+COMPATIBLE_IOCTL(STOP_ARRAY_RO)
+COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
/* Big K */
-COMPATIBLE_IOCTL(PIO_FONT),
-COMPATIBLE_IOCTL(GIO_FONT),
-COMPATIBLE_IOCTL(KDSIGACCEPT),
-COMPATIBLE_IOCTL(KDGETKEYCODE),
-COMPATIBLE_IOCTL(KDSETKEYCODE),
-COMPATIBLE_IOCTL(KIOCSOUND),
-COMPATIBLE_IOCTL(KDMKTONE),
-COMPATIBLE_IOCTL(KDGKBTYPE),
-COMPATIBLE_IOCTL(KDSETMODE),
-COMPATIBLE_IOCTL(KDGETMODE),
-COMPATIBLE_IOCTL(KDSKBMODE),
-COMPATIBLE_IOCTL(KDGKBMODE),
-COMPATIBLE_IOCTL(KDSKBMETA),
-COMPATIBLE_IOCTL(KDGKBMETA),
-COMPATIBLE_IOCTL(KDGKBENT),
-COMPATIBLE_IOCTL(KDSKBENT),
-COMPATIBLE_IOCTL(KDGKBSENT),
-COMPATIBLE_IOCTL(KDSKBSENT),
-COMPATIBLE_IOCTL(KDGKBDIACR),
-COMPATIBLE_IOCTL(KDKBDREP),
-COMPATIBLE_IOCTL(KDSKBDIACR),
-COMPATIBLE_IOCTL(KDGKBLED),
-COMPATIBLE_IOCTL(KDSKBLED),
-COMPATIBLE_IOCTL(KDGETLED),
-COMPATIBLE_IOCTL(KDSETLED),
-COMPATIBLE_IOCTL(GIO_SCRNMAP),
-COMPATIBLE_IOCTL(PIO_SCRNMAP),
-COMPATIBLE_IOCTL(GIO_UNISCRNMAP),
-COMPATIBLE_IOCTL(PIO_UNISCRNMAP),
-COMPATIBLE_IOCTL(PIO_FONTRESET),
-COMPATIBLE_IOCTL(PIO_UNIMAPCLR),
+COMPATIBLE_IOCTL(PIO_FONT)
+COMPATIBLE_IOCTL(GIO_FONT)
+COMPATIBLE_IOCTL(KDSIGACCEPT)
+COMPATIBLE_IOCTL(KDGETKEYCODE)
+COMPATIBLE_IOCTL(KDSETKEYCODE)
+COMPATIBLE_IOCTL(KIOCSOUND)
+COMPATIBLE_IOCTL(KDMKTONE)
+COMPATIBLE_IOCTL(KDGKBTYPE)
+COMPATIBLE_IOCTL(KDSETMODE)
+COMPATIBLE_IOCTL(KDGETMODE)
+COMPATIBLE_IOCTL(KDSKBMODE)
+COMPATIBLE_IOCTL(KDGKBMODE)
+COMPATIBLE_IOCTL(KDSKBMETA)
+COMPATIBLE_IOCTL(KDGKBMETA)
+COMPATIBLE_IOCTL(KDGKBENT)
+COMPATIBLE_IOCTL(KDSKBENT)
+COMPATIBLE_IOCTL(KDGKBSENT)
+COMPATIBLE_IOCTL(KDSKBSENT)
+COMPATIBLE_IOCTL(KDGKBDIACR)
+COMPATIBLE_IOCTL(KDKBDREP)
+COMPATIBLE_IOCTL(KDSKBDIACR)
+COMPATIBLE_IOCTL(KDGKBLED)
+COMPATIBLE_IOCTL(KDSKBLED)
+COMPATIBLE_IOCTL(KDGETLED)
+COMPATIBLE_IOCTL(KDSETLED)
+COMPATIBLE_IOCTL(GIO_SCRNMAP)
+COMPATIBLE_IOCTL(PIO_SCRNMAP)
+COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
+COMPATIBLE_IOCTL(PIO_UNISCRNMAP)
+COMPATIBLE_IOCTL(PIO_FONTRESET)
+COMPATIBLE_IOCTL(PIO_UNIMAPCLR)
/* Big S */
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN),
-COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST),
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI),
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK),
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK),
-COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY),
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_ENABLE),
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE),
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER),
-COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND),
+COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
+COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
+COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
+COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK)
+COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK)
+COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY)
+COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_ENABLE)
+COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE)
+COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER)
+COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
/* Big T */
-COMPATIBLE_IOCTL(TUNSETNOCSUM),
-COMPATIBLE_IOCTL(TUNSETDEBUG),
-COMPATIBLE_IOCTL(TUNSETIFF),
-COMPATIBLE_IOCTL(TUNSETPERSIST),
-COMPATIBLE_IOCTL(TUNSETOWNER),
+COMPATIBLE_IOCTL(TUNSETNOCSUM)
+COMPATIBLE_IOCTL(TUNSETDEBUG)
+COMPATIBLE_IOCTL(TUNSETIFF)
+COMPATIBLE_IOCTL(TUNSETPERSIST)
+COMPATIBLE_IOCTL(TUNSETOWNER)
/* Big V */
-COMPATIBLE_IOCTL(VT_SETMODE),
-COMPATIBLE_IOCTL(VT_GETMODE),
-COMPATIBLE_IOCTL(VT_GETSTATE),
-COMPATIBLE_IOCTL(VT_OPENQRY),
-COMPATIBLE_IOCTL(VT_ACTIVATE),
-COMPATIBLE_IOCTL(VT_WAITACTIVE),
-COMPATIBLE_IOCTL(VT_RELDISP),
-COMPATIBLE_IOCTL(VT_DISALLOCATE),
-COMPATIBLE_IOCTL(VT_RESIZE),
-COMPATIBLE_IOCTL(VT_RESIZEX),
-COMPATIBLE_IOCTL(VT_LOCKSWITCH),
-COMPATIBLE_IOCTL(VT_UNLOCKSWITCH),
+COMPATIBLE_IOCTL(VT_SETMODE)
+COMPATIBLE_IOCTL(VT_GETMODE)
+COMPATIBLE_IOCTL(VT_GETSTATE)
+COMPATIBLE_IOCTL(VT_OPENQRY)
+COMPATIBLE_IOCTL(VT_ACTIVATE)
+COMPATIBLE_IOCTL(VT_WAITACTIVE)
+COMPATIBLE_IOCTL(VT_RELDISP)
+COMPATIBLE_IOCTL(VT_DISALLOCATE)
+COMPATIBLE_IOCTL(VT_RESIZE)
+COMPATIBLE_IOCTL(VT_RESIZEX)
+COMPATIBLE_IOCTL(VT_LOCKSWITCH)
+COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
/* Little v, the video4linux ioctls */
-COMPATIBLE_IOCTL(VIDIOCGCAP),
-COMPATIBLE_IOCTL(VIDIOCGCHAN),
-COMPATIBLE_IOCTL(VIDIOCSCHAN),
-COMPATIBLE_IOCTL(VIDIOCGPICT),
-COMPATIBLE_IOCTL(VIDIOCSPICT),
-COMPATIBLE_IOCTL(VIDIOCCAPTURE),
-COMPATIBLE_IOCTL(VIDIOCKEY),
-COMPATIBLE_IOCTL(VIDIOCGAUDIO),
-COMPATIBLE_IOCTL(VIDIOCSAUDIO),
-COMPATIBLE_IOCTL(VIDIOCSYNC),
-COMPATIBLE_IOCTL(VIDIOCMCAPTURE),
-COMPATIBLE_IOCTL(VIDIOCGMBUF),
-COMPATIBLE_IOCTL(VIDIOCGUNIT),
-COMPATIBLE_IOCTL(VIDIOCGCAPTURE),
-COMPATIBLE_IOCTL(VIDIOCSCAPTURE),
+COMPATIBLE_IOCTL(VIDIOCGCAP)
+COMPATIBLE_IOCTL(VIDIOCGCHAN)
+COMPATIBLE_IOCTL(VIDIOCSCHAN)
+COMPATIBLE_IOCTL(VIDIOCGPICT)
+COMPATIBLE_IOCTL(VIDIOCSPICT)
+COMPATIBLE_IOCTL(VIDIOCCAPTURE)
+COMPATIBLE_IOCTL(VIDIOCKEY)
+COMPATIBLE_IOCTL(VIDIOCGAUDIO)
+COMPATIBLE_IOCTL(VIDIOCSAUDIO)
+COMPATIBLE_IOCTL(VIDIOCSYNC)
+COMPATIBLE_IOCTL(VIDIOCMCAPTURE)
+COMPATIBLE_IOCTL(VIDIOCGMBUF)
+COMPATIBLE_IOCTL(VIDIOCGUNIT)
+COMPATIBLE_IOCTL(VIDIOCGCAPTURE)
+COMPATIBLE_IOCTL(VIDIOCSCAPTURE)
/* BTTV specific... */
-COMPATIBLE_IOCTL(_IOW('v', BASE_VIDIOCPRIVATE+0, char [256])),
-COMPATIBLE_IOCTL(_IOR('v', BASE_VIDIOCPRIVATE+1, char [256])),
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int)),
-COMPATIBLE_IOCTL(_IOW('v' , BASE_VIDIOCPRIVATE+3, char [16])), /* struct bttv_pll_info */
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+4, int)),
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int)),
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int)),
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int)),
+COMPATIBLE_IOCTL(_IOW('v', BASE_VIDIOCPRIVATE+0, char [256]))
+COMPATIBLE_IOCTL(_IOR('v', BASE_VIDIOCPRIVATE+1, char [256]))
+COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int))
+COMPATIBLE_IOCTL(_IOW('v' , BASE_VIDIOCPRIVATE+3, char [16])) /* struct bttv_pll_info */
+COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+4, int))
+COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int))
+COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int))
+COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int))
/* Little p (/dev/rtc, /dev/envctrl, etc.) */
-COMPATIBLE_IOCTL(_IOR('p', 20, int[7])), /* RTCGET */
-COMPATIBLE_IOCTL(_IOW('p', 21, int[7])), /* RTCSET */
-COMPATIBLE_IOCTL(RTC_AIE_ON),
-COMPATIBLE_IOCTL(RTC_AIE_OFF),
-COMPATIBLE_IOCTL(RTC_UIE_ON),
-COMPATIBLE_IOCTL(RTC_UIE_OFF),
-COMPATIBLE_IOCTL(RTC_PIE_ON),
-COMPATIBLE_IOCTL(RTC_PIE_OFF),
-COMPATIBLE_IOCTL(RTC_WIE_ON),
-COMPATIBLE_IOCTL(RTC_WIE_OFF),
-COMPATIBLE_IOCTL(RTC_ALM_SET),
-COMPATIBLE_IOCTL(RTC_ALM_READ),
-COMPATIBLE_IOCTL(RTC_RD_TIME),
-COMPATIBLE_IOCTL(RTC_SET_TIME),
-COMPATIBLE_IOCTL(RTC_WKALM_SET),
-COMPATIBLE_IOCTL(RTC_WKALM_RD),
+COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
+COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
+COMPATIBLE_IOCTL(RTC_AIE_ON)
+COMPATIBLE_IOCTL(RTC_AIE_OFF)
+COMPATIBLE_IOCTL(RTC_UIE_ON)
+COMPATIBLE_IOCTL(RTC_UIE_OFF)
+COMPATIBLE_IOCTL(RTC_PIE_ON)
+COMPATIBLE_IOCTL(RTC_PIE_OFF)
+COMPATIBLE_IOCTL(RTC_WIE_ON)
+COMPATIBLE_IOCTL(RTC_WIE_OFF)
+COMPATIBLE_IOCTL(RTC_ALM_SET)
+COMPATIBLE_IOCTL(RTC_ALM_READ)
+COMPATIBLE_IOCTL(RTC_RD_TIME)
+COMPATIBLE_IOCTL(RTC_SET_TIME)
+COMPATIBLE_IOCTL(RTC_WKALM_SET)
+COMPATIBLE_IOCTL(RTC_WKALM_RD)
/* Little m */
-COMPATIBLE_IOCTL(MTIOCTOP),
+COMPATIBLE_IOCTL(MTIOCTOP)
/* Socket level stuff */
-COMPATIBLE_IOCTL(FIOSETOWN),
-COMPATIBLE_IOCTL(SIOCSPGRP),
-COMPATIBLE_IOCTL(FIOGETOWN),
-COMPATIBLE_IOCTL(SIOCGPGRP),
-COMPATIBLE_IOCTL(SIOCATMARK),
-COMPATIBLE_IOCTL(SIOCSIFLINK),
-COMPATIBLE_IOCTL(SIOCSIFENCAP),
-COMPATIBLE_IOCTL(SIOCGIFENCAP),
-COMPATIBLE_IOCTL(SIOCSIFBR),
-COMPATIBLE_IOCTL(SIOCGIFBR),
-COMPATIBLE_IOCTL(SIOCSARP),
-COMPATIBLE_IOCTL(SIOCGARP),
-COMPATIBLE_IOCTL(SIOCDARP),
-COMPATIBLE_IOCTL(SIOCSRARP),
-COMPATIBLE_IOCTL(SIOCGRARP),
-COMPATIBLE_IOCTL(SIOCDRARP),
-COMPATIBLE_IOCTL(SIOCADDDLCI),
-COMPATIBLE_IOCTL(SIOCDELDLCI),
-COMPATIBLE_IOCTL(SIOCGMIIPHY),
-COMPATIBLE_IOCTL(SIOCGMIIREG),
-COMPATIBLE_IOCTL(SIOCSMIIREG),
-COMPATIBLE_IOCTL(SIOCGIFVLAN),
-COMPATIBLE_IOCTL(SIOCSIFVLAN),
+COMPATIBLE_IOCTL(FIOSETOWN)
+COMPATIBLE_IOCTL(SIOCSPGRP)
+COMPATIBLE_IOCTL(FIOGETOWN)
+COMPATIBLE_IOCTL(SIOCGPGRP)
+COMPATIBLE_IOCTL(SIOCATMARK)
+COMPATIBLE_IOCTL(SIOCSIFLINK)
+COMPATIBLE_IOCTL(SIOCSIFENCAP)
+COMPATIBLE_IOCTL(SIOCGIFENCAP)
+COMPATIBLE_IOCTL(SIOCSIFBR)
+COMPATIBLE_IOCTL(SIOCGIFBR)
+COMPATIBLE_IOCTL(SIOCSARP)
+COMPATIBLE_IOCTL(SIOCGARP)
+COMPATIBLE_IOCTL(SIOCDARP)
+COMPATIBLE_IOCTL(SIOCSRARP)
+COMPATIBLE_IOCTL(SIOCGRARP)
+COMPATIBLE_IOCTL(SIOCDRARP)
+COMPATIBLE_IOCTL(SIOCADDDLCI)
+COMPATIBLE_IOCTL(SIOCDELDLCI)
+COMPATIBLE_IOCTL(SIOCGMIIPHY)
+COMPATIBLE_IOCTL(SIOCGMIIREG)
+COMPATIBLE_IOCTL(SIOCSMIIREG)
+COMPATIBLE_IOCTL(SIOCGIFVLAN)
+COMPATIBLE_IOCTL(SIOCSIFVLAN)
/* SG stuff */
-COMPATIBLE_IOCTL(SG_SET_TIMEOUT),
-COMPATIBLE_IOCTL(SG_GET_TIMEOUT),
-COMPATIBLE_IOCTL(SG_EMULATED_HOST),
-COMPATIBLE_IOCTL(SG_SET_TRANSFORM),
-COMPATIBLE_IOCTL(SG_GET_TRANSFORM),
-COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE),
-COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE),
-COMPATIBLE_IOCTL(SG_GET_SCSI_ID),
-COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA),
-COMPATIBLE_IOCTL(SG_GET_LOW_DMA),
-COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID),
-COMPATIBLE_IOCTL(SG_GET_PACK_ID),
-COMPATIBLE_IOCTL(SG_GET_NUM_WAITING),
-COMPATIBLE_IOCTL(SG_SET_DEBUG),
-COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE),
-COMPATIBLE_IOCTL(SG_GET_COMMAND_Q),
-COMPATIBLE_IOCTL(SG_SET_COMMAND_Q),
-COMPATIBLE_IOCTL(SG_GET_VERSION_NUM),
-COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN),
-COMPATIBLE_IOCTL(SG_SCSI_RESET),
-COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE),
-COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN),
-COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN),
+COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
+COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
+COMPATIBLE_IOCTL(SG_EMULATED_HOST)
+COMPATIBLE_IOCTL(SG_SET_TRANSFORM)
+COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
+COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)
+COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE)
+COMPATIBLE_IOCTL(SG_GET_SCSI_ID)
+COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA)
+COMPATIBLE_IOCTL(SG_GET_LOW_DMA)
+COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID)
+COMPATIBLE_IOCTL(SG_GET_PACK_ID)
+COMPATIBLE_IOCTL(SG_GET_NUM_WAITING)
+COMPATIBLE_IOCTL(SG_SET_DEBUG)
+COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE)
+COMPATIBLE_IOCTL(SG_GET_COMMAND_Q)
+COMPATIBLE_IOCTL(SG_SET_COMMAND_Q)
+COMPATIBLE_IOCTL(SG_GET_VERSION_NUM)
+COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN)
+COMPATIBLE_IOCTL(SG_SCSI_RESET)
+COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
+COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
+COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
/* PPP stuff */
-COMPATIBLE_IOCTL(PPPIOCGFLAGS),
-COMPATIBLE_IOCTL(PPPIOCSFLAGS),
-COMPATIBLE_IOCTL(PPPIOCGASYNCMAP),
-COMPATIBLE_IOCTL(PPPIOCSASYNCMAP),
-COMPATIBLE_IOCTL(PPPIOCGUNIT),
-COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP),
-COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP),
-COMPATIBLE_IOCTL(PPPIOCGMRU),
-COMPATIBLE_IOCTL(PPPIOCSMRU),
-COMPATIBLE_IOCTL(PPPIOCSMAXCID),
-COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP),
-COMPATIBLE_IOCTL(LPGETSTATUS),
-COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP),
-COMPATIBLE_IOCTL(PPPIOCXFERUNIT),
-COMPATIBLE_IOCTL(PPPIOCGNPMODE),
-COMPATIBLE_IOCTL(PPPIOCSNPMODE),
-COMPATIBLE_IOCTL(PPPIOCGDEBUG),
-COMPATIBLE_IOCTL(PPPIOCSDEBUG),
-COMPATIBLE_IOCTL(PPPIOCNEWUNIT),
-COMPATIBLE_IOCTL(PPPIOCATTACH),
-COMPATIBLE_IOCTL(PPPIOCDETACH),
-COMPATIBLE_IOCTL(PPPIOCSMRRU),
-COMPATIBLE_IOCTL(PPPIOCCONNECT),
-COMPATIBLE_IOCTL(PPPIOCDISCONN),
-COMPATIBLE_IOCTL(PPPIOCATTCHAN),
-COMPATIBLE_IOCTL(PPPIOCGCHAN),
+COMPATIBLE_IOCTL(PPPIOCGFLAGS)
+COMPATIBLE_IOCTL(PPPIOCSFLAGS)
+COMPATIBLE_IOCTL(PPPIOCGASYNCMAP)
+COMPATIBLE_IOCTL(PPPIOCSASYNCMAP)
+COMPATIBLE_IOCTL(PPPIOCGUNIT)
+COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP)
+COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP)
+COMPATIBLE_IOCTL(PPPIOCGMRU)
+COMPATIBLE_IOCTL(PPPIOCSMRU)
+COMPATIBLE_IOCTL(PPPIOCSMAXCID)
+COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP)
+COMPATIBLE_IOCTL(LPGETSTATUS)
+COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP)
+COMPATIBLE_IOCTL(PPPIOCXFERUNIT)
+COMPATIBLE_IOCTL(PPPIOCGNPMODE)
+COMPATIBLE_IOCTL(PPPIOCSNPMODE)
+COMPATIBLE_IOCTL(PPPIOCGDEBUG)
+COMPATIBLE_IOCTL(PPPIOCSDEBUG)
+COMPATIBLE_IOCTL(PPPIOCNEWUNIT)
+COMPATIBLE_IOCTL(PPPIOCATTACH)
+COMPATIBLE_IOCTL(PPPIOCDETACH)
+COMPATIBLE_IOCTL(PPPIOCSMRRU)
+COMPATIBLE_IOCTL(PPPIOCCONNECT)
+COMPATIBLE_IOCTL(PPPIOCDISCONN)
+COMPATIBLE_IOCTL(PPPIOCATTCHAN)
+COMPATIBLE_IOCTL(PPPIOCGCHAN)
/* PPPOX */
-COMPATIBLE_IOCTL(PPPOEIOCSFWD),
-COMPATIBLE_IOCTL(PPPOEIOCDFWD),
+COMPATIBLE_IOCTL(PPPOEIOCSFWD)
+COMPATIBLE_IOCTL(PPPOEIOCDFWD)
/* CDROM stuff */
-COMPATIBLE_IOCTL(CDROMPAUSE),
-COMPATIBLE_IOCTL(CDROMRESUME),
-COMPATIBLE_IOCTL(CDROMPLAYMSF),
-COMPATIBLE_IOCTL(CDROMPLAYTRKIND),
-COMPATIBLE_IOCTL(CDROMREADTOCHDR),
-COMPATIBLE_IOCTL(CDROMREADTOCENTRY),
-COMPATIBLE_IOCTL(CDROMSTOP),
-COMPATIBLE_IOCTL(CDROMSTART),
-COMPATIBLE_IOCTL(CDROMEJECT),
-COMPATIBLE_IOCTL(CDROMVOLCTRL),
-COMPATIBLE_IOCTL(CDROMSUBCHNL),
-COMPATIBLE_IOCTL(CDROMEJECT_SW),
-COMPATIBLE_IOCTL(CDROMMULTISESSION),
-COMPATIBLE_IOCTL(CDROM_GET_MCN),
-COMPATIBLE_IOCTL(CDROMRESET),
-COMPATIBLE_IOCTL(CDROMVOLREAD),
-COMPATIBLE_IOCTL(CDROMSEEK),
-COMPATIBLE_IOCTL(CDROMPLAYBLK),
-COMPATIBLE_IOCTL(CDROMCLOSETRAY),
-COMPATIBLE_IOCTL(CDROM_SET_OPTIONS),
-COMPATIBLE_IOCTL(CDROM_CLEAR_OPTIONS),
-COMPATIBLE_IOCTL(CDROM_SELECT_SPEED),
-COMPATIBLE_IOCTL(CDROM_SELECT_DISC),
-COMPATIBLE_IOCTL(CDROM_MEDIA_CHANGED),
-COMPATIBLE_IOCTL(CDROM_DRIVE_STATUS),
-COMPATIBLE_IOCTL(CDROM_DISC_STATUS),
-COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS),
-COMPATIBLE_IOCTL(CDROM_LOCKDOOR),
-COMPATIBLE_IOCTL(CDROM_DEBUG),
-COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY),
+COMPATIBLE_IOCTL(CDROMPAUSE)
+COMPATIBLE_IOCTL(CDROMRESUME)
+COMPATIBLE_IOCTL(CDROMPLAYMSF)
+COMPATIBLE_IOCTL(CDROMPLAYTRKIND)
+COMPATIBLE_IOCTL(CDROMREADTOCHDR)
+COMPATIBLE_IOCTL(CDROMREADTOCENTRY)
+COMPATIBLE_IOCTL(CDROMSTOP)
+COMPATIBLE_IOCTL(CDROMSTART)
+COMPATIBLE_IOCTL(CDROMEJECT)
+COMPATIBLE_IOCTL(CDROMVOLCTRL)
+COMPATIBLE_IOCTL(CDROMSUBCHNL)
+COMPATIBLE_IOCTL(CDROMEJECT_SW)
+COMPATIBLE_IOCTL(CDROMMULTISESSION)
+COMPATIBLE_IOCTL(CDROM_GET_MCN)
+COMPATIBLE_IOCTL(CDROMRESET)
+COMPATIBLE_IOCTL(CDROMVOLREAD)
+COMPATIBLE_IOCTL(CDROMSEEK)
+COMPATIBLE_IOCTL(CDROMPLAYBLK)
+COMPATIBLE_IOCTL(CDROMCLOSETRAY)
+COMPATIBLE_IOCTL(CDROM_SET_OPTIONS)
+COMPATIBLE_IOCTL(CDROM_CLEAR_OPTIONS)
+COMPATIBLE_IOCTL(CDROM_SELECT_SPEED)
+COMPATIBLE_IOCTL(CDROM_SELECT_DISC)
+COMPATIBLE_IOCTL(CDROM_MEDIA_CHANGED)
+COMPATIBLE_IOCTL(CDROM_DRIVE_STATUS)
+COMPATIBLE_IOCTL(CDROM_DISC_STATUS)
+COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS)
+COMPATIBLE_IOCTL(CDROM_LOCKDOOR)
+COMPATIBLE_IOCTL(CDROM_DEBUG)
+COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY)
/* DVD ioctls */
-COMPATIBLE_IOCTL(DVD_READ_STRUCT),
-COMPATIBLE_IOCTL(DVD_WRITE_STRUCT),
-COMPATIBLE_IOCTL(DVD_AUTH),
+COMPATIBLE_IOCTL(DVD_READ_STRUCT)
+COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
+COMPATIBLE_IOCTL(DVD_AUTH)
/* Big L */
-COMPATIBLE_IOCTL(LOOP_SET_FD),
-COMPATIBLE_IOCTL(LOOP_CLR_FD),
+COMPATIBLE_IOCTL(LOOP_SET_FD)
+COMPATIBLE_IOCTL(LOOP_CLR_FD)
/* Big Q for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC),
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE),
-COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS),
-COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD),
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL),
-COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND),
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME),
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID),
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL),
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE),
+COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC)
+COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE)
+COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS)
+COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD)
+COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL)
+COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND)
+COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME)
+COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID)
+COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL)
+COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE)
/* Big T for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE),
-COMPATIBLE_IOCTL(SNDCTL_TMR_START),
-COMPATIBLE_IOCTL(SNDCTL_TMR_STOP),
-COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE),
-COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO),
-COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE),
-COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME),
-COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT),
+COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE)
+COMPATIBLE_IOCTL(SNDCTL_TMR_START)
+COMPATIBLE_IOCTL(SNDCTL_TMR_STOP)
+COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE)
+COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO)
+COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE)
+COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME)
+COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT)
/* Little m for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME),
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE),
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD),
+COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME)
+COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE)
+COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD)
/* Big P for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_DSP_RESET),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED),
-COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE),
-COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS),
-COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER),
-COMPATIBLE_IOCTL(SNDCTL_DSP_POST),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE),
-COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR),
+COMPATIBLE_IOCTL(SNDCTL_DSP_RESET)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED)
+COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE)
+COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS)
+COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER)
+COMPATIBLE_IOCTL(SNDCTL_DSP_POST)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE)
+COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR)
/* SNDCTL_DSP_MAPINBUF, XXX needs translation */
/* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO),
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX),
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY),
-COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE),
-COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE),
-COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS),
-COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS),
-COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER),
+COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO)
+COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX)
+COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY)
+COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE)
+COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE)
+COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS)
+COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS)
+COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER)
/* Big C for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_COPR_RESET),
-COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD),
-COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA),
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE),
-COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA),
-COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE),
-COMPATIBLE_IOCTL(SNDCTL_COPR_RUN),
-COMPATIBLE_IOCTL(SNDCTL_COPR_HALT),
-COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG),
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG),
+COMPATIBLE_IOCTL(SNDCTL_COPR_RESET)
+COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD)
+COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA)
+COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE)
+COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA)
+COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE)
+COMPATIBLE_IOCTL(SNDCTL_COPR_RUN)
+COMPATIBLE_IOCTL(SNDCTL_COPR_HALT)
+COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG)
+COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG)
/* Big M for sound/OSS */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO)),
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR)),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE),
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3)
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO))
+COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR))
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE)
/* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
/* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS),
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO)),
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR)),
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE),
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS)
+COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2)
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3)
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO))
+COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR))
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE)
/* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
/* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC),
-COMPATIBLE_IOCTL(SOUND_MIXER_INFO),
-COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO),
-COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS),
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1),
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2),
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3),
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4),
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5),
-COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS),
-COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS),
-COMPATIBLE_IOCTL(OSS_GETVERSION),
+COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC)
+COMPATIBLE_IOCTL(SOUND_MIXER_INFO)
+COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO)
+COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS)
+COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1)
+COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2)
+COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3)
+COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4)
+COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
+COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
+COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
+COMPATIBLE_IOCTL(OSS_GETVERSION)
/* AUTOFS */
-COMPATIBLE_IOCTL(AUTOFS_IOC_READY),
-COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL),
-COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC),
-COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER),
-COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE),
+COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
+COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
+COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
+COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
+COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
/* DEVFS */
-COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV),
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK),
-COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE),
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK),
+COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
+COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
+COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
+COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
/* Raw devices */
-COMPATIBLE_IOCTL(RAW_SETBIND),
-COMPATIBLE_IOCTL(RAW_GETBIND),
+COMPATIBLE_IOCTL(RAW_SETBIND)
+COMPATIBLE_IOCTL(RAW_GETBIND)
/* SMB ioctls which do not need any translations */
-COMPATIBLE_IOCTL(SMB_IOC_NEWCONN),
+COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
/* NCP ioctls which do not need any translations */
-COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN),
-COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT),
-COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED),
-COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED),
-COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK),
-COMPATIBLE_IOCTL(NCP_IOC_GETROOT),
-COMPATIBLE_IOCTL(NCP_IOC_SETROOT),
-COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS),
-COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS),
-COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL),
-COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL),
+COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN)
+COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT)
+COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED)
+COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED)
+COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK)
+COMPATIBLE_IOCTL(NCP_IOC_GETROOT)
+COMPATIBLE_IOCTL(NCP_IOC_SETROOT)
+COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS)
+COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
+COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
+COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
/* Little a */
-COMPATIBLE_IOCTL(ATMSIGD_CTRL),
-COMPATIBLE_IOCTL(ATMARPD_CTRL),
-COMPATIBLE_IOCTL(ATMLEC_CTRL),
-COMPATIBLE_IOCTL(ATMLEC_MCAST),
-COMPATIBLE_IOCTL(ATMLEC_DATA),
-COMPATIBLE_IOCTL(ATM_SETSC),
-COMPATIBLE_IOCTL(SIOCSIFATMTCP),
-COMPATIBLE_IOCTL(SIOCMKCLIP),
-COMPATIBLE_IOCTL(ATMARP_MKIP),
-COMPATIBLE_IOCTL(ATMARP_SETENTRY),
-COMPATIBLE_IOCTL(ATMARP_ENCAP),
-COMPATIBLE_IOCTL(ATMTCP_CREATE),
-COMPATIBLE_IOCTL(ATMTCP_REMOVE),
-COMPATIBLE_IOCTL(ATMMPC_CTRL),
-COMPATIBLE_IOCTL(ATMMPC_DATA),
+COMPATIBLE_IOCTL(ATMSIGD_CTRL)
+COMPATIBLE_IOCTL(ATMARPD_CTRL)
+COMPATIBLE_IOCTL(ATMLEC_CTRL)
+COMPATIBLE_IOCTL(ATMLEC_MCAST)
+COMPATIBLE_IOCTL(ATMLEC_DATA)
+COMPATIBLE_IOCTL(ATM_SETSC)
+COMPATIBLE_IOCTL(SIOCSIFATMTCP)
+COMPATIBLE_IOCTL(SIOCMKCLIP)
+COMPATIBLE_IOCTL(ATMARP_MKIP)
+COMPATIBLE_IOCTL(ATMARP_SETENTRY)
+COMPATIBLE_IOCTL(ATMARP_ENCAP)
+COMPATIBLE_IOCTL(ATMTCP_CREATE)
+COMPATIBLE_IOCTL(ATMTCP_REMOVE)
+COMPATIBLE_IOCTL(ATMMPC_CTRL)
+COMPATIBLE_IOCTL(ATMMPC_DATA)
#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
-COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC),
-COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID),
-COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC),
-COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK),
-COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK),
-COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL),
-COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS),
-COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS),
-COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX),
-COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX),
-COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX),
-COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX),
-COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX),
-COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX),
-COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW),
-COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW),
-COMPATIBLE_IOCTL(DRM_IOCTL_LOCK),
-COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK),
-COMPATIBLE_IOCTL(DRM_IOCTL_FINISH),
+COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
+COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
+COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC)
+COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK)
+COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK)
+COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL)
+COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS)
+COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS)
+COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX)
+COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX)
+COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX)
+COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX)
+COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX)
+COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX)
+COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW)
+COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW)
+COMPATIBLE_IOCTL(DRM_IOCTL_LOCK)
+COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK)
+COMPATIBLE_IOCTL(DRM_IOCTL_FINISH)
#endif /* DRM */
/* Big W */
/* WIOC_GETSUPPORT not yet implemented -E */
-COMPATIBLE_IOCTL(WDIOC_GETSTATUS),
-COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS),
-COMPATIBLE_IOCTL(WDIOC_GETTEMP),
-COMPATIBLE_IOCTL(WDIOC_SETOPTIONS),
-COMPATIBLE_IOCTL(WDIOC_KEEPALIVE),
+COMPATIBLE_IOCTL(WDIOC_GETSTATUS)
+COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS)
+COMPATIBLE_IOCTL(WDIOC_GETTEMP)
+COMPATIBLE_IOCTL(WDIOC_SETOPTIONS)
+COMPATIBLE_IOCTL(WDIOC_KEEPALIVE)
/* Big R */
-COMPATIBLE_IOCTL(RNDGETENTCNT),
-COMPATIBLE_IOCTL(RNDADDTOENTCNT),
-COMPATIBLE_IOCTL(RNDGETPOOL),
-COMPATIBLE_IOCTL(RNDADDENTROPY),
-COMPATIBLE_IOCTL(RNDZAPENTCNT),
-COMPATIBLE_IOCTL(RNDCLEARPOOL),
+COMPATIBLE_IOCTL(RNDGETENTCNT)
+COMPATIBLE_IOCTL(RNDADDTOENTCNT)
+COMPATIBLE_IOCTL(RNDGETPOOL)
+COMPATIBLE_IOCTL(RNDADDENTROPY)
+COMPATIBLE_IOCTL(RNDZAPENTCNT)
+COMPATIBLE_IOCTL(RNDCLEARPOOL)
/* Bluetooth ioctls */
-COMPATIBLE_IOCTL(HCIDEVUP),
-COMPATIBLE_IOCTL(HCIDEVDOWN),
-COMPATIBLE_IOCTL(HCIDEVRESET),
-COMPATIBLE_IOCTL(HCIDEVRESTAT),
-COMPATIBLE_IOCTL(HCIGETDEVLIST),
-COMPATIBLE_IOCTL(HCIGETDEVINFO),
-COMPATIBLE_IOCTL(HCIGETCONNLIST),
-COMPATIBLE_IOCTL(HCIGETCONNINFO),
-COMPATIBLE_IOCTL(HCISETRAW),
-COMPATIBLE_IOCTL(HCISETSCAN),
-COMPATIBLE_IOCTL(HCISETAUTH),
-COMPATIBLE_IOCTL(HCISETENCRYPT),
-COMPATIBLE_IOCTL(HCISETPTYPE),
-COMPATIBLE_IOCTL(HCISETLINKPOL),
-COMPATIBLE_IOCTL(HCISETLINKMODE),
-COMPATIBLE_IOCTL(HCISETACLMTU),
-COMPATIBLE_IOCTL(HCISETSCOMTU),
-COMPATIBLE_IOCTL(HCIINQUIRY),
-COMPATIBLE_IOCTL(HCIUARTSETPROTO),
-COMPATIBLE_IOCTL(HCIUARTGETPROTO),
-COMPATIBLE_IOCTL(RFCOMMCREATEDEV),
-COMPATIBLE_IOCTL(RFCOMMRELEASEDEV),
-COMPATIBLE_IOCTL(RFCOMMGETDEVLIST),
-COMPATIBLE_IOCTL(RFCOMMGETDEVINFO),
-COMPATIBLE_IOCTL(RFCOMMSTEALDLC),
-COMPATIBLE_IOCTL(BNEPCONNADD),
-COMPATIBLE_IOCTL(BNEPCONNDEL),
-COMPATIBLE_IOCTL(BNEPGETCONNLIST),
-COMPATIBLE_IOCTL(BNEPGETCONNINFO),
-COMPATIBLE_IOCTL(PCIIOC_CONTROLLER),
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO),
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM),
-COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE),
+COMPATIBLE_IOCTL(HCIDEVUP)
+COMPATIBLE_IOCTL(HCIDEVDOWN)
+COMPATIBLE_IOCTL(HCIDEVRESET)
+COMPATIBLE_IOCTL(HCIDEVRESTAT)
+COMPATIBLE_IOCTL(HCIGETDEVLIST)
+COMPATIBLE_IOCTL(HCIGETDEVINFO)
+COMPATIBLE_IOCTL(HCIGETCONNLIST)
+COMPATIBLE_IOCTL(HCIGETCONNINFO)
+COMPATIBLE_IOCTL(HCISETRAW)
+COMPATIBLE_IOCTL(HCISETSCAN)
+COMPATIBLE_IOCTL(HCISETAUTH)
+COMPATIBLE_IOCTL(HCISETENCRYPT)
+COMPATIBLE_IOCTL(HCISETPTYPE)
+COMPATIBLE_IOCTL(HCISETLINKPOL)
+COMPATIBLE_IOCTL(HCISETLINKMODE)
+COMPATIBLE_IOCTL(HCISETACLMTU)
+COMPATIBLE_IOCTL(HCISETSCOMTU)
+COMPATIBLE_IOCTL(HCIINQUIRY)
+COMPATIBLE_IOCTL(HCIUARTSETPROTO)
+COMPATIBLE_IOCTL(HCIUARTGETPROTO)
+COMPATIBLE_IOCTL(RFCOMMCREATEDEV)
+COMPATIBLE_IOCTL(RFCOMMRELEASEDEV)
+COMPATIBLE_IOCTL(RFCOMMGETDEVLIST)
+COMPATIBLE_IOCTL(RFCOMMGETDEVINFO)
+COMPATIBLE_IOCTL(RFCOMMSTEALDLC)
+COMPATIBLE_IOCTL(BNEPCONNADD)
+COMPATIBLE_IOCTL(BNEPCONNDEL)
+COMPATIBLE_IOCTL(BNEPGETCONNLIST)
+COMPATIBLE_IOCTL(BNEPGETCONNINFO)
+COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
+COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
+COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
+COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
/* USB */
-COMPATIBLE_IOCTL(USBDEVFS_RESETEP),
-COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE),
-COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION),
-COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER),
-COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB),
-COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE),
-COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE),
-COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO),
-COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO),
-COMPATIBLE_IOCTL(USBDEVFS_RESET),
-COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT),
+COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
+COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
+COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
+COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
+COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
+COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
+COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
+COMPATIBLE_IOCTL(USBDEVFS_RESET)
+COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
/* MTD */
-COMPATIBLE_IOCTL(MEMGETINFO),
-COMPATIBLE_IOCTL(MEMERASE),
-COMPATIBLE_IOCTL(MEMLOCK),
-COMPATIBLE_IOCTL(MEMUNLOCK),
-COMPATIBLE_IOCTL(MEMGETREGIONCOUNT),
-COMPATIBLE_IOCTL(MEMGETREGIONINFO),
+COMPATIBLE_IOCTL(MEMGETINFO)
+COMPATIBLE_IOCTL(MEMERASE)
+COMPATIBLE_IOCTL(MEMLOCK)
+COMPATIBLE_IOCTL(MEMUNLOCK)
+COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
+COMPATIBLE_IOCTL(MEMGETREGIONINFO)
/* NBD */
-COMPATIBLE_IOCTL(NBD_SET_SOCK),
-COMPATIBLE_IOCTL(NBD_SET_BLKSIZE),
-COMPATIBLE_IOCTL(NBD_SET_SIZE),
-COMPATIBLE_IOCTL(NBD_DO_IT),
-COMPATIBLE_IOCTL(NBD_CLEAR_SOCK),
-COMPATIBLE_IOCTL(NBD_CLEAR_QUE),
-COMPATIBLE_IOCTL(NBD_PRINT_DEBUG),
-COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS),
-COMPATIBLE_IOCTL(NBD_DISCONNECT),
+COMPATIBLE_IOCTL(NBD_SET_SOCK)
+COMPATIBLE_IOCTL(NBD_SET_BLKSIZE)
+COMPATIBLE_IOCTL(NBD_SET_SIZE)
+COMPATIBLE_IOCTL(NBD_DO_IT)
+COMPATIBLE_IOCTL(NBD_CLEAR_SOCK)
+COMPATIBLE_IOCTL(NBD_CLEAR_QUE)
+COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
+COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS)
+COMPATIBLE_IOCTL(NBD_DISCONNECT)
/* device-mapper */
-COMPATIBLE_IOCTL(DM_VERSION),
-COMPATIBLE_IOCTL(DM_REMOVE_ALL),
-COMPATIBLE_IOCTL(DM_DEV_CREATE),
-COMPATIBLE_IOCTL(DM_DEV_REMOVE),
-COMPATIBLE_IOCTL(DM_DEV_RELOAD),
-COMPATIBLE_IOCTL(DM_DEV_SUSPEND),
-COMPATIBLE_IOCTL(DM_DEV_RENAME),
-COMPATIBLE_IOCTL(DM_DEV_DEPS),
-COMPATIBLE_IOCTL(DM_DEV_STATUS),
-COMPATIBLE_IOCTL(DM_TARGET_STATUS),
-COMPATIBLE_IOCTL(DM_TARGET_WAIT),
+COMPATIBLE_IOCTL(DM_VERSION)
+COMPATIBLE_IOCTL(DM_REMOVE_ALL)
+COMPATIBLE_IOCTL(DM_DEV_CREATE)
+COMPATIBLE_IOCTL(DM_DEV_REMOVE)
+COMPATIBLE_IOCTL(DM_DEV_RELOAD)
+COMPATIBLE_IOCTL(DM_DEV_SUSPEND)
+COMPATIBLE_IOCTL(DM_DEV_RENAME)
+COMPATIBLE_IOCTL(DM_DEV_DEPS)
+COMPATIBLE_IOCTL(DM_DEV_STATUS)
+COMPATIBLE_IOCTL(DM_TARGET_STATUS)
+COMPATIBLE_IOCTL(DM_TARGET_WAIT)
/* And these ioctls need translation */
-HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob),
-HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob),
+HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob)
+HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob)
#ifdef CONFIG_NET
-HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32),
+HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32)
#endif
-HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf),
-HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFFLAGS, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFMETRIC, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFMETRIC, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFMTU, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFMTU, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFMEM, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFMEM, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFHWADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFHWADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCADDMULTI, dev_ifsioc),
-HANDLE_IOCTL(SIOCDELMULTI, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFINDEX, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFMAP, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFMAP, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFBRDADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFBRDADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFDSTADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFDSTADDR, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFNETMASK, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFNETMASK, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFPFLAGS, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc),
-HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc),
-HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc),
-HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl),
-HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl),
-HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl),
-HANDLE_IOCTL(SIOCBONDSETHWADDR, bond_ioctl),
-HANDLE_IOCTL(SIOCBONDSLAVEINFOQUERY, bond_ioctl),
-HANDLE_IOCTL(SIOCBONDINFOQUERY, bond_ioctl),
-HANDLE_IOCTL(SIOCBONDCHANGEACTIVE, bond_ioctl),
-HANDLE_IOCTL(SIOCADDRT, routing_ioctl),
-HANDLE_IOCTL(SIOCDELRT, routing_ioctl),
+HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf)
+HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFFLAGS, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFMETRIC, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFMETRIC, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFMTU, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFMTU, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFMEM, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFMEM, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFHWADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFHWADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCADDMULTI, dev_ifsioc)
+HANDLE_IOCTL(SIOCDELMULTI, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFINDEX, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFMAP, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFMAP, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFBRDADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFBRDADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFDSTADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFDSTADDR, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFNETMASK, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFNETMASK, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFPFLAGS, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc)
+HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
+HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
+HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl)
+HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl)
+HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl)
+HANDLE_IOCTL(SIOCBONDSETHWADDR, bond_ioctl)
+HANDLE_IOCTL(SIOCBONDSLAVEINFOQUERY, bond_ioctl)
+HANDLE_IOCTL(SIOCBONDINFOQUERY, bond_ioctl)
+HANDLE_IOCTL(SIOCBONDCHANGEACTIVE, bond_ioctl)
+HANDLE_IOCTL(SIOCADDRT, routing_ioctl)
+HANDLE_IOCTL(SIOCDELRT, routing_ioctl)
/* Note SIOCRTMSG is no longer, so this is safe and
* the user would have seen just an -EINVAL anyways. */
-HANDLE_IOCTL(SIOCRTMSG, ret_einval),
-HANDLE_IOCTL(SIOCGSTAMP, do_siocgstamp),
-HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo),
-HANDLE_IOCTL(HDIO_GETGEO_BIG_RAW, hdio_getgeo_big),
-HANDLE_IOCTL(BLKGETSIZE, w_long),
-HANDLE_IOCTL(BLKRAGET, w_long),
-HANDLE_IOCTL(BLKFRAGET, w_long),
-HANDLE_IOCTL(0x1260, broken_blkgetsize),
-HANDLE_IOCTL(BLKSECTGET, w_long),
-HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_MULTCOUNT, hdio_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_NOWERR, hdio_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_NICE, hdio_ioctl_trans),
-HANDLE_IOCTL(FDSETPRM32, fd_ioctl_trans),
-HANDLE_IOCTL(FDDEFPRM32, fd_ioctl_trans),
-HANDLE_IOCTL(FDGETPRM32, fd_ioctl_trans),
-HANDLE_IOCTL(FDSETDRVPRM32, fd_ioctl_trans),
-HANDLE_IOCTL(FDGETDRVPRM32, fd_ioctl_trans),
-HANDLE_IOCTL(FDGETDRVSTAT32, fd_ioctl_trans),
-HANDLE_IOCTL(FDPOLLDRVSTAT32, fd_ioctl_trans),
-HANDLE_IOCTL(FDGETFDCSTAT32, fd_ioctl_trans),
-HANDLE_IOCTL(FDWERRORGET32, fd_ioctl_trans),
-HANDLE_IOCTL(SG_IO,sg_ioctl_trans),
-HANDLE_IOCTL(PPPIOCGIDLE32, ppp_ioctl_trans),
-HANDLE_IOCTL(PPPIOCSCOMPRESS32, ppp_ioctl_trans),
-HANDLE_IOCTL(MTIOCGET32, mt_ioctl_trans),
-HANDLE_IOCTL(MTIOCPOS32, mt_ioctl_trans),
-HANDLE_IOCTL(MTIOCGETCONFIG32, mt_ioctl_trans),
-HANDLE_IOCTL(MTIOCSETCONFIG32, mt_ioctl_trans),
-HANDLE_IOCTL(CDROMREADMODE2, cdrom_ioctl_trans),
-HANDLE_IOCTL(CDROMREADMODE1, cdrom_ioctl_trans),
-HANDLE_IOCTL(CDROMREADRAW, cdrom_ioctl_trans),
-HANDLE_IOCTL(CDROMREADCOOKED, cdrom_ioctl_trans),
-HANDLE_IOCTL(CDROMREADAUDIO, cdrom_ioctl_trans),
-HANDLE_IOCTL(CDROMREADALL, cdrom_ioctl_trans),
-HANDLE_IOCTL(CDROM_SEND_PACKET, cdrom_ioctl_trans),
-HANDLE_IOCTL(LOOP_SET_STATUS, loop_status),
-HANDLE_IOCTL(LOOP_GET_STATUS, loop_status),
-HANDLE_IOCTL(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout),
+HANDLE_IOCTL(SIOCRTMSG, ret_einval)
+HANDLE_IOCTL(SIOCGSTAMP, do_siocgstamp)
+HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo)
+HANDLE_IOCTL(HDIO_GETGEO_BIG_RAW, hdio_getgeo_big)
+HANDLE_IOCTL(BLKGETSIZE, w_long)
+HANDLE_IOCTL(BLKRAGET, w_long)
+HANDLE_IOCTL(BLKFRAGET, w_long)
+HANDLE_IOCTL(0x1260, broken_blkgetsize)
+HANDLE_IOCTL(BLKSECTGET, w_long)
+HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans)
+HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans)
+HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans)
+HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans)
+HANDLE_IOCTL(HDIO_GET_MULTCOUNT, hdio_ioctl_trans)
+HANDLE_IOCTL(HDIO_GET_NOWERR, hdio_ioctl_trans)
+HANDLE_IOCTL(HDIO_GET_NICE, hdio_ioctl_trans)
+HANDLE_IOCTL(FDSETPRM32, fd_ioctl_trans)
+HANDLE_IOCTL(FDDEFPRM32, fd_ioctl_trans)
+HANDLE_IOCTL(FDGETPRM32, fd_ioctl_trans)
+HANDLE_IOCTL(FDSETDRVPRM32, fd_ioctl_trans)
+HANDLE_IOCTL(FDGETDRVPRM32, fd_ioctl_trans)
+HANDLE_IOCTL(FDGETDRVSTAT32, fd_ioctl_trans)
+HANDLE_IOCTL(FDPOLLDRVSTAT32, fd_ioctl_trans)
+HANDLE_IOCTL(FDGETFDCSTAT32, fd_ioctl_trans)
+HANDLE_IOCTL(FDWERRORGET32, fd_ioctl_trans)
+HANDLE_IOCTL(SG_IO,sg_ioctl_trans)
+HANDLE_IOCTL(PPPIOCGIDLE32, ppp_ioctl_trans)
+HANDLE_IOCTL(PPPIOCSCOMPRESS32, ppp_ioctl_trans)
+HANDLE_IOCTL(MTIOCGET32, mt_ioctl_trans)
+HANDLE_IOCTL(MTIOCPOS32, mt_ioctl_trans)
+HANDLE_IOCTL(MTIOCGETCONFIG32, mt_ioctl_trans)
+HANDLE_IOCTL(MTIOCSETCONFIG32, mt_ioctl_trans)
+HANDLE_IOCTL(CDROMREADMODE2, cdrom_ioctl_trans)
+HANDLE_IOCTL(CDROMREADMODE1, cdrom_ioctl_trans)
+HANDLE_IOCTL(CDROMREADRAW, cdrom_ioctl_trans)
+HANDLE_IOCTL(CDROMREADCOOKED, cdrom_ioctl_trans)
+HANDLE_IOCTL(CDROMREADAUDIO, cdrom_ioctl_trans)
+HANDLE_IOCTL(CDROMREADALL, cdrom_ioctl_trans)
+HANDLE_IOCTL(CDROM_SEND_PACKET, cdrom_ioctl_trans)
+HANDLE_IOCTL(LOOP_SET_STATUS, loop_status)
+HANDLE_IOCTL(LOOP_GET_STATUS, loop_status)
+HANDLE_IOCTL(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout)
#ifdef CONFIG_VT
-HANDLE_IOCTL(PIO_FONTX, do_fontx_ioctl),
-HANDLE_IOCTL(GIO_FONTX, do_fontx_ioctl),
-HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl),
-HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl),
-HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl),
-HANDLE_IOCTL(FBIOGET_FSCREENINFO, do_fbioget_fscreeninfo_ioctl),
-HANDLE_IOCTL(FBIOGETCMAP, do_fbiogetcmap_ioctl),
-HANDLE_IOCTL(FBIOPUTCMAP, do_fbioputcmap_ioctl),
+HANDLE_IOCTL(PIO_FONTX, do_fontx_ioctl)
+HANDLE_IOCTL(GIO_FONTX, do_fontx_ioctl)
+HANDLE_IOCTL(PIO_UNIMAP, do_unimap_ioctl)
+HANDLE_IOCTL(GIO_UNIMAP, do_unimap_ioctl)
+HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl)
+HANDLE_IOCTL(FBIOGET_FSCREENINFO, do_fbioget_fscreeninfo_ioctl)
+HANDLE_IOCTL(FBIOGETCMAP, do_fbiogetcmap_ioctl)
+HANDLE_IOCTL(FBIOPUTCMAP, do_fbioputcmap_ioctl)
#endif
-HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl),
-HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl),
-HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl),
-HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl),
-HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCSWIN32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCGFBUF32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl),
-HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl),
+HANDLE_IOCTL(EXT2_IOC32_GETFLAGS, do_ext2_ioctl)
+HANDLE_IOCTL(EXT2_IOC32_SETFLAGS, do_ext2_ioctl)
+HANDLE_IOCTL(EXT2_IOC32_GETVERSION, do_ext2_ioctl)
+HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl)
+HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCSWIN32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCGFBUF32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl)
/* One SMB ioctl needs translations. */
-HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid),
+HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid)
/* NCPFS */
-HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest),
-HANDLE_IOCTL(NCP_IOC_GETMOUNTUID2_32, do_ncp_getmountuid2),
-HANDLE_IOCTL(NCP_IOC_GET_FS_INFO_V2_32, do_ncp_getfsinfo2),
-HANDLE_IOCTL(NCP_IOC_GETOBJECTNAME_32, do_ncp_getobjectname),
-HANDLE_IOCTL(NCP_IOC_SETOBJECTNAME_32, do_ncp_setobjectname),
-HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata),
-HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata),
-HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETTYPE32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETESI32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETADDR32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_RSTADDR32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_ADDADDR32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_DELADDR32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETCIRANGE32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_SETCIRANGE32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_SETESI32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_SETESIF32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETSTAT32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETSTATZ32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_GETLOOP32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_SETLOOP32, do_atm_ioctl),
-HANDLE_IOCTL(ATM_QUERYLOOP32, do_atm_ioctl),
-HANDLE_IOCTL(SONET_GETSTAT, do_atm_ioctl),
-HANDLE_IOCTL(SONET_GETSTATZ, do_atm_ioctl),
-HANDLE_IOCTL(SONET_GETDIAG, do_atm_ioctl),
-HANDLE_IOCTL(SONET_SETDIAG, do_atm_ioctl),
-HANDLE_IOCTL(SONET_CLRDIAG, do_atm_ioctl),
-HANDLE_IOCTL(SONET_SETFRAMING, do_atm_ioctl),
-HANDLE_IOCTL(SONET_GETFRAMING, do_atm_ioctl),
-HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl),
+HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest)
+HANDLE_IOCTL(NCP_IOC_GETMOUNTUID2_32, do_ncp_getmountuid2)
+HANDLE_IOCTL(NCP_IOC_GET_FS_INFO_V2_32, do_ncp_getfsinfo2)
+HANDLE_IOCTL(NCP_IOC_GETOBJECTNAME_32, do_ncp_getobjectname)
+HANDLE_IOCTL(NCP_IOC_SETOBJECTNAME_32, do_ncp_setobjectname)
+HANDLE_IOCTL(NCP_IOC_GETPRIVATEDATA_32, do_ncp_getprivatedata)
+HANDLE_IOCTL(NCP_IOC_SETPRIVATEDATA_32, do_ncp_setprivatedata)
+HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETTYPE32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETESI32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETADDR32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_RSTADDR32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_ADDADDR32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_DELADDR32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETCIRANGE32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_SETCIRANGE32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_SETESI32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_SETESIF32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETSTAT32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETSTATZ32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_GETLOOP32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_SETLOOP32, do_atm_ioctl)
+HANDLE_IOCTL(ATM_QUERYLOOP32, do_atm_ioctl)
+HANDLE_IOCTL(SONET_GETSTAT, do_atm_ioctl)
+HANDLE_IOCTL(SONET_GETSTATZ, do_atm_ioctl)
+HANDLE_IOCTL(SONET_GETDIAG, do_atm_ioctl)
+HANDLE_IOCTL(SONET_SETDIAG, do_atm_ioctl)
+HANDLE_IOCTL(SONET_CLRDIAG, do_atm_ioctl)
+HANDLE_IOCTL(SONET_SETFRAMING, do_atm_ioctl)
+HANDLE_IOCTL(SONET_GETFRAMING, do_atm_ioctl)
+HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl)
#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
-HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version),
-HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique),
-HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique),
-HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap),
-HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs),
-HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs),
-HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs),
-HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma),
-HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx),
+HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version)
+HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique)
+HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique)
+HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap)
+HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs)
+HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs)
+HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs)
+HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma)
+HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx)
#endif /* DRM */
-HANDLE_IOCTL(USBDEVFS_CONTROL32, do_usbdevfs_control),
-HANDLE_IOCTL(USBDEVFS_BULK32, do_usbdevfs_bulk),
+HANDLE_IOCTL(USBDEVFS_CONTROL32, do_usbdevfs_control)
+HANDLE_IOCTL(USBDEVFS_BULK32, do_usbdevfs_bulk)
/*HANDLE_IOCTL(USBDEVFS_SUBMITURB32, do_usbdevfs_urb)*/
-HANDLE_IOCTL(USBDEVFS_REAPURB32, do_usbdevfs_reapurb),
-HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb),
-HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal),
+HANDLE_IOCTL(USBDEVFS_REAPURB32, do_usbdevfs_reapurb)
+HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb)
+HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal)
/* take care of sizeof(sizeof()) breakage */
/* block stuff */
-HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget),
-HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset),
-HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64),
+HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget)
+HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset)
+HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64)
};
-
-unsigned long ioctl32_hash_table[1024];
-
-static inline unsigned long ioctl32_hash(unsigned long cmd)
-{
- return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
-}
-
-static void ioctl32_insert_translation(struct ioctl_trans *trans)
-{
- unsigned long hash;
- struct ioctl_trans *t;
-
- hash = ioctl32_hash (trans->cmd);
- if (!ioctl32_hash_table[hash])
- ioctl32_hash_table[hash] = (long)trans;
- else {
- t = (struct ioctl_trans *)ioctl32_hash_table[hash];
- while (t->next)
- t = (struct ioctl_trans *)(long)t->next;
- trans->next = 0;
- t->next = (long)trans;
- }
-}
-
-static int __init init_sys32_ioctl(void)
-{
- int i, size = sizeof(ioctl_translations) / sizeof(struct ioctl_trans);
- for (i=0; i < size ;i++)
- ioctl32_insert_translation(&ioctl_translations[i]);
- return 0;
-}
-
-__initcall(init_sys32_ioctl);
-
-static struct ioctl_trans *additional_ioctls;
-
-/* Always call these with kernel lock held! */
-
-int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *))
-{
- int i;
- if (!additional_ioctls) {
- additional_ioctls = (struct ioctl_trans *)get_zeroed_page(GFP_KERNEL);
- if (!additional_ioctls)
- return -ENOMEM;
- }
- for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++) {
- if (!additional_ioctls[i].cmd)
- break;
- if (additional_ioctls[i].cmd == cmd)
- printk("duplicate ioctl found: %x\n", cmd);
- }
- if (i == PAGE_SIZE/sizeof(struct ioctl_trans))
- return -ENOMEM;
- additional_ioctls[i].cmd = cmd;
- if (!handler)
- additional_ioctls[i].handler = (long)sys_ioctl;
- else
- additional_ioctls[i].handler = (long)handler;
- ioctl32_insert_translation(&additional_ioctls[i]);
- return 0;
-}
-
-int unregister_ioctl32_conversion(unsigned int cmd)
-{
- unsigned long hash = ioctl32_hash(cmd);
- struct ioctl_trans *t, *t1;
-
- t = (struct ioctl_trans *)ioctl32_hash_table[hash];
- if (!t) return -EINVAL;
- if (t->cmd == cmd && t >= additional_ioctls &&
- (unsigned long)t < ((unsigned long)additional_ioctls) + PAGE_SIZE) {
- ioctl32_hash_table[hash] = t->next;
- t->cmd = 0;
- return 0;
- } else while (t->next) {
- t1 = (struct ioctl_trans *)t->next;
- if (t1->cmd == cmd && t1 >= additional_ioctls &&
- (unsigned long)t1 < ((unsigned long)additional_ioctls) + PAGE_SIZE) {
- t1->cmd = 0;
- t->next = t1->next;
- return 0;
- }
- t = t1;
- }
- return -EINVAL;
-}
-
-asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- struct file * filp;
- int error = -EBADF;
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- struct ioctl_trans *t;
-
- filp = fget(fd);
- if (!filp)
- goto out2;
-
- if (!filp->f_op || !filp->f_op->ioctl) {
- error = sys_ioctl (fd, cmd, arg);
- goto out;
- }
-
- t = (struct ioctl_trans *)ioctl32_hash_table [ioctl32_hash (cmd)];
-
- while (t && t->cmd != cmd)
- t = (struct ioctl_trans *)t->next;
- if (t) {
- handler = (void *)t->handler;
- error = handler(fd, cmd, arg, filp);
- } else {
- static int count = 0;
- if (++count <= 20)
- printk("sys32_ioctl(%s:%d): Unknown cmd fd(%d) "
- "cmd(%08x) arg(%08x)\n",
- current->comm, current->pid,
- (int)fd, (unsigned int)cmd, (unsigned int)arg);
- error = -EINVAL;
- }
-out:
- fput(filp);
-out2:
- return error;
-}
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index b13facd777aa..5c405d6cb370 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -556,8 +556,8 @@ _GLOBAL(sys_call_table32)
.llong .sys_acct
.llong .sys32_umount
.llong .sys_ni_syscall /* old lock syscall */
- .llong .sys32_ioctl
- .llong .compat_sys_fcntl /* 55 */
+ .llong .compat_sys_ioctl
+ .llong .compat_sys_fcntl /* 55 */
.llong .sys_ni_syscall /* old mpx syscall */
.llong .sys32_setpgid
.llong .sys_ni_syscall /* old ulimit syscall */
diff --git a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
index dc8673b01185..6dd5abf18f45 100644
--- a/arch/s390/kernel/compat_ioctl.c
+++ b/arch/s390/kernel/compat_ioctl.c
@@ -972,113 +972,3 @@ static struct ioctl32_list ioctl32_handler_table[] = {
#define NR_IOCTL32_HANDLERS (sizeof(ioctl32_handler_table) / \
sizeof(ioctl32_handler_table[0]))
-
-static struct ioctl32_list *ioctl32_hash_table[1024];
-
-static inline int ioctl32_hash(unsigned int cmd)
-{
- return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
-}
-
-int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- struct file *filp;
- struct ioctl32_list *l;
- int error;
-
- l = ioctl32_hash_table[ioctl32_hash(cmd)];
-
- error = -EBADF;
-
- filp = fget(fd);
- if (!filp)
- return error;
-
- if (!filp->f_op || !filp->f_op->ioctl) {
- error = sys_ioctl (fd, cmd, arg);
- goto out;
- }
-
- while (l && l->handler.cmd != cmd)
- l = l->next;
-
- if (l) {
- handler = (void *)l->handler.function;
- error = handler(fd, cmd, arg, filp);
- } else {
- error = -EINVAL;
- printk("unknown ioctl: %08x\n", cmd);
- }
-out:
- fput(filp);
- return error;
-}
-
-static void ioctl32_insert(struct ioctl32_list *entry)
-{
- int hash = ioctl32_hash(entry->handler.cmd);
-
- entry->next = 0;
- if (!ioctl32_hash_table[hash])
- ioctl32_hash_table[hash] = entry;
- else {
- struct ioctl32_list *l;
- l = ioctl32_hash_table[hash];
- while (l->next)
- l = l->next;
- l->next = entry;
- }
-}
-
-int register_ioctl32_conversion(unsigned int cmd,
- int (*handler)(unsigned int, unsigned int,
- unsigned long, struct file *))
-{
- struct ioctl32_list *l, *new;
- int hash;
-
- hash = ioctl32_hash(cmd);
- for (l = ioctl32_hash_table[hash]; l != NULL; l = l->next)
- if (l->handler.cmd == cmd)
- return -EBUSY;
- new = kmalloc(sizeof(struct ioctl32_list), GFP_KERNEL);
- if (new == NULL)
- return -ENOMEM;
- new->handler.cmd = cmd;
- new->handler.function = (void *) handler;
- ioctl32_insert(new);
- return 0;
-}
-
-int unregister_ioctl32_conversion(unsigned int cmd)
-{
- struct ioctl32_list *p, *l;
- int hash;
-
- hash = ioctl32_hash(cmd);
- p = NULL;
- for (l = ioctl32_hash_table[hash]; l != NULL; l = l->next) {
- if (l->handler.cmd == cmd)
- break;
- p = l;
- }
- if (l == NULL)
- return -ENOENT;
- if (p == NULL)
- ioctl32_hash_table[hash] = l->next;
- else
- p->next = l->next;
- kfree(l);
- return 0;
-}
-
-static int __init init_ioctl32(void)
-{
- int i;
- for (i = 0; i < NR_IOCTL32_HANDLERS; i++)
- ioctl32_insert(&ioctl32_handler_table[i]);
- return 0;
-}
-
-__initcall(init_ioctl32);
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 3066f0cbc83b..cf4c996c71d2 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -62,13 +62,6 @@ static struct resource _sparc_dvma = {
};
/*
- * BTFIXUP would do as well but it seems overkill for the case.
- */
-static void (*_sparc_mapioaddr)(unsigned long pa, unsigned long va,
- int bus, int ro);
-static void (*_sparc_unmapioaddr)(unsigned long va);
-
-/*
* Our mini-allocator...
* Boy this is gross! We need it because we must map I/O for
* timers and interrupt controller before the kmalloc is available.
@@ -201,8 +194,6 @@ static void *
_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz)
{
unsigned long offset = ((unsigned long) pa) & (~PAGE_MASK);
- unsigned long va;
- unsigned int psz;
if (allocate_resource(&sparc_iomap, res,
(offset + sz + PAGE_SIZE-1) & PAGE_MASK,
@@ -213,27 +204,10 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz)
prom_halt();
}
- va = res->start;
pa &= PAGE_MASK;
- for (psz = res->end - res->start + 1; psz != 0; psz -= PAGE_SIZE) {
- (*_sparc_mapioaddr)(pa, va, bus, 0);
- va += PAGE_SIZE;
- pa += PAGE_SIZE;
- }
+ sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1);
- /*
- * XXX Playing with implementation details here.
- * On sparc64 Ebus has resources with precise boundaries.
- * We share drivers with sparc64. Too clever drivers use
- * start of a resource instead of a base address.
- *
- * XXX-2 This may be not valid anymore, clean when
- * interface to sbus_ioremap() is resolved.
- */
- res->start += offset;
- res->end = res->start + sz - 1; /* not strictly necessary.. */
-
- return (void *) res->start;
+ return (void *) (res->start + offset);
}
/*
@@ -244,12 +218,8 @@ static void _sparc_free_io(struct resource *res)
unsigned long plen;
plen = res->end - res->start + 1;
- plen = (plen + PAGE_SIZE-1) & PAGE_MASK;
- while (plen != 0) {
- plen -= PAGE_SIZE;
- (*_sparc_unmapioaddr)(res->start + plen);
- }
-
+ if ((plen & (PAGE_SIZE-1)) != 0) BUG();
+ sparc_unmapiorange(res->start, plen);
release_resource(res);
}
@@ -283,40 +253,44 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp)
}
order = get_order(len_total);
- va = __get_free_pages(GFP_KERNEL, order);
- if (va == 0) {
- /*
- * printk here may be flooding... Consider removal XXX.
- */
- printk("sbus_alloc_consistent: no %ld pages\n", len_total>>PAGE_SHIFT);
- return NULL;
- }
+ if ((va = __get_free_pages(GFP_KERNEL, order)) == 0)
+ goto err_nopages;
- if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) {
- free_pages(va, order);
- printk("sbus_alloc_consistent: no core\n");
- return NULL;
- }
+ if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL)
+ goto err_nomem;
memset((char*)res, 0, sizeof(struct resource));
if (allocate_resource(&_sparc_dvma, res, len_total,
_sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) {
printk("sbus_alloc_consistent: cannot occupy 0x%lx", len_total);
- free_pages(va, order);
- kfree(res);
- return NULL;
+ goto err_nova;
}
+ mmu_inval_dma_area(va, len_total);
+ // XXX The mmu_map_dma_area does this for us below, see comments.
+ // sparc_mapiorange(0, virt_to_phys(va), res->start, len_total);
+ /*
+ * XXX That's where sdev would be used. Currently we load
+ * all iommu tables with the same translations.
+ */
+ if (mmu_map_dma_area(dma_addrp, va, res->start, len_total) != 0)
+ goto err_noiommu;
- mmu_map_dma_area(va, res->start, len_total);
-
- *dma_addrp = res->start;
return (void *)res->start;
+
+err_noiommu:
+ release_resource(res);
+err_nova:
+ free_pages(va, order);
+err_nomem:
+ kfree(res);
+err_nopages:
+ return NULL;
}
void sbus_free_consistent(struct sbus_dev *sdev, long n, void *p, u32 ba)
{
struct resource *res;
- unsigned long pgp;
+ struct page *pgv;
if ((res = _sparc_find_resource(&_sparc_dvma,
(unsigned long)p)) == NULL) {
@@ -340,10 +314,10 @@ void sbus_free_consistent(struct sbus_dev *sdev, long n, void *p, u32 ba)
kfree(res);
/* mmu_inval_dma_area(va, n); */ /* it's consistent, isn't it */
- pgp = (unsigned long) phys_to_virt(mmu_translate_dvma(ba));
+ pgv = mmu_translate_dvma(ba);
mmu_unmap_dma_area(ba, n);
- free_pages(pgp, get_order(n));
+ __free_pages(pgv, get_order(n));
}
/*
@@ -353,39 +327,6 @@ void sbus_free_consistent(struct sbus_dev *sdev, long n, void *p, u32 ba)
*/
dma_addr_t sbus_map_single(struct sbus_dev *sdev, void *va, size_t len, int direction)
{
-#if 0 /* This is the version that abuses consistent space */
- unsigned long len_total = (len + PAGE_SIZE-1) & PAGE_MASK;
- struct resource *res;
-
- /* XXX why are some lenghts signed, others unsigned? */
- if (len <= 0) {
- return 0;
- }
- /* XXX So what is maxphys for us and how do drivers know it? */
- if (len > 256*1024) { /* __get_free_pages() limit */
- return 0;
- }
-
- if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) {
- printk("sbus_map_single: no core\n");
- return 0;
- }
- memset((char*)res, 0, sizeof(struct resource));
- res->name = va; /* XXX */
-
- if (allocate_resource(&_sparc_dvma, res, len_total,
- _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE) != 0) {
- printk("sbus_map_single: cannot occupy 0x%lx", len);
- kfree(res);
- return 0;
- }
-
- mmu_map_dma_area(va, res->start, len_total);
- mmu_flush_dma_area((unsigned long)va, len_total); /* in all contexts? */
-
- return res->start;
-#endif
-#if 1 /* "trampoline" version */
/* XXX why are some lenghts signed, others unsigned? */
if (len <= 0) {
return 0;
@@ -395,36 +336,11 @@ dma_addr_t sbus_map_single(struct sbus_dev *sdev, void *va, size_t len, int dire
return 0;
}
return mmu_get_scsi_one(va, len, sdev->bus);
-#endif
}
void sbus_unmap_single(struct sbus_dev *sdev, dma_addr_t ba, size_t n, int direction)
{
-#if 0 /* This is the version that abuses consistent space */
- struct resource *res;
- unsigned long va;
-
- if ((res = _sparc_find_resource(&_sparc_dvma, ba)) == NULL) {
- printk("sbus_unmap_single: cannot find %08x\n", (unsigned)ba);
- return;
- }
-
- n = (n + PAGE_SIZE-1) & PAGE_MASK;
- if ((res->end-res->start)+1 != n) {
- printk("sbus_unmap_single: region 0x%lx asked 0x%lx\n",
- (long)((res->end-res->start)+1), n);
- return;
- }
-
- va = (unsigned long) res->name; /* XXX Ouch */
- mmu_inval_dma_area(va, n); /* in all contexts, mm's?... */
- mmu_unmap_dma_area(ba, n); /* iounit cache flush is here */
- release_resource(res);
- kfree(res);
-#endif
-#if 1 /* "trampoline" version */
mmu_release_scsi_one(ba, n, sdev->bus);
-#endif
}
int sbus_map_sg(struct sbus_dev *sdev, struct scatterlist *sg, int n, int direction)
@@ -456,7 +372,7 @@ void sbus_dma_sync_single(struct sbus_dev *sdev, dma_addr_t ba, size_t size, int
if (res == NULL)
panic("sbus_dma_sync_single: 0x%x\n", ba);
- va = (unsigned long) phys_to_virt(mmu_translate_dvma(ba));
+ va = page_address(mmu_translate_dvma(ba)); /* XXX higmem */
/*
* XXX This bogosity will be fixed with the iommu rewrite coming soon
* to a kernel near you. - Anton
@@ -511,24 +427,12 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t len, dma_addr_t *pba)
kfree(res);
return NULL;
}
-
mmu_inval_dma_area(va, len_total);
-
#if 0
-/* P3 */ printk("pci_alloc_consistent: kva %lx uncva %lx phys %lx size %x\n",
+/* P3 */ printk("pci_alloc_consistent: kva %lx uncva %lx phys %lx size %lx\n",
(long)va, (long)res->start, (long)virt_to_phys(va), len_total);
#endif
- {
- unsigned long xva, xpa;
- xva = res->start;
- xpa = virt_to_phys(va);
- while (len_total != 0) {
- len_total -= PAGE_SIZE;
- (*_sparc_mapioaddr)(xpa, xva, 0, 0);
- xva += PAGE_SIZE;
- xpa += PAGE_SIZE;
- }
- }
+ sparc_mapiorange(0, virt_to_phys(va), res->start, len_total);
*pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */
return (void *) res->start;
@@ -567,12 +471,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba)
pgp = (unsigned long) phys_to_virt(ba); /* bus_to_virt actually */
mmu_inval_dma_area(pgp, n);
- {
- int x;
- for (x = 0; x < n; x += PAGE_SIZE) {
- (*_sparc_unmapioaddr)((unsigned long)p + n);
- }
- }
+ sparc_unmapiorange((unsigned long)p, n);
release_resource(res);
kfree(res);
@@ -751,37 +650,6 @@ _sparc_find_resource(struct resource *root, unsigned long hit)
return NULL;
}
-/*
- * Necessary boot time initializations.
- */
-
-void ioport_init(void)
-{
- extern void sun4c_mapioaddr(unsigned long, unsigned long, int, int);
- extern void srmmu_mapioaddr(unsigned long, unsigned long, int, int);
- extern void sun4c_unmapioaddr(unsigned long);
- extern void srmmu_unmapioaddr(unsigned long);
-
- switch(sparc_cpu_model) {
- case sun4c:
- case sun4:
- case sun4e:
- _sparc_mapioaddr = sun4c_mapioaddr;
- _sparc_unmapioaddr = sun4c_unmapioaddr;
- break;
- case sun4m:
- case sun4d:
- _sparc_mapioaddr = srmmu_mapioaddr;
- _sparc_unmapioaddr = srmmu_unmapioaddr;
- break;
- default:
- printk("ioport_init: cpu type %d is unknown.\n",
- sparc_cpu_model);
- prom_halt();
- };
-
-}
-
void register_proc_sparc_ioport(void)
{
#ifdef CONFIG_PROC_FS
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index f228a921b9f1..aefdebcd363c 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -10,4 +10,4 @@ obj-y := mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \
strlen.o checksum.o blockops.o memscan.o memcmp.o strncmp.o \
strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \
copy_user.o locks.o atomic.o bitops.o debuglocks.o lshrdi3.o \
- ashldi3.o rwsem.o muldi3.o
+ ashldi3.o rwsem.o muldi3.o bitext.o
diff --git a/arch/sparc/lib/bitext.c b/arch/sparc/lib/bitext.c
new file mode 100644
index 000000000000..9f9553b7ea8c
--- /dev/null
+++ b/arch/sparc/lib/bitext.c
@@ -0,0 +1,114 @@
+/*
+ * bitext.c: kernel little helper (of bit shuffling variety).
+ *
+ * Copyright (C) 2002 Pete Zaitcev <zaitcev@yahoo.com>
+ *
+ * The algorithm to search a zero bit string is geared towards its application.
+ * We expect a couple of fixed sizes of requests, so a rotating counter, reset
+ * by align size, should provide fast enough search while maintaining low
+ * fragmentation.
+ */
+
+#include <linux/smp_lock.h>
+
+#include <asm/bitext.h>
+#include <asm/bitops.h>
+
+/**
+ * bit_map_string_get - find and set a bit string in bit map.
+ * @t: the bit map.
+ * @len: requested string length
+ * @align: requested alignment
+ *
+ * Returns offset in the map or -1 if out of space.
+ *
+ * Not safe to call from an interrupt (uses spin_lock).
+ */
+int bit_map_string_get(struct bit_map *t, int len, int align)
+{
+ int offset, count; /* siamese twins */
+ int off_new;
+ int align1;
+ int i;
+
+ if (align == 0)
+ align = 1;
+ align1 = align - 1;
+ if ((align & align1) != 0)
+ BUG();
+ if (align < 0 || align >= t->size)
+ BUG();
+ if (len <= 0 || len > t->size)
+ BUG();
+
+ spin_lock(&t->lock);
+ offset = t->last_off & ~align1;
+ count = 0;
+ for (;;) {
+ off_new = find_next_zero_bit(t->map, t->size, offset);
+ off_new = (off_new + align1) & ~align1;
+ count += off_new - offset;
+ offset = off_new;
+ if (offset >= t->size)
+ offset = 0;
+ if (count + len > t->size) {
+ spin_unlock(&t->lock);
+/* P3 */ printk(KERN_ERR
+ "bitmap out: size %d used %d off %d len %d align %d count %d\n",
+ t->size, t->used, offset, len, align, count);
+ return -1;
+ }
+
+ if (offset + len > t->size) {
+ offset = 0;
+ count += t->size - offset;
+ continue;
+ }
+
+ i = 0;
+ while (test_bit(offset + i, t->map) == 0) {
+ i++;
+ if (i == len) {
+ for (i = 0; i < len; i++)
+ __set_bit(offset + i, t->map);
+ if ((t->last_off = offset + len) >= t->size)
+ t->last_off = 0;
+ t->used += len;
+ spin_unlock(&t->lock);
+ return offset;
+ }
+ }
+ count += i + 1;
+ if ((offset += i + 1) >= t->size)
+ offset = 0;
+ }
+}
+
+void bit_map_clear(struct bit_map *t, int offset, int len)
+{
+ int i;
+
+ if (t->used < len)
+ BUG(); /* Much too late to do any good, but alas... */
+ spin_lock(&t->lock);
+ for (i = 0; i < len; i++) {
+ if (test_bit(offset + i, t->map) == 0)
+ BUG();
+ __clear_bit(offset + i, t->map);
+ }
+ t->used -= len;
+ spin_unlock(&t->lock);
+}
+
+void bit_map_init(struct bit_map *t, unsigned long *map, int size)
+{
+
+ if ((size & 07) != 0)
+ BUG();
+ memset(map, 0, size>>3);
+
+ memset(t, 0, sizeof *t);
+ spin_lock_init(&t->lock);
+ t->map = map;
+ t->size = size;
+}
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index b1692c1a21da..3274b90e4906 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -88,8 +88,6 @@ void show_mem(void)
#endif
}
-extern pgprot_t protection_map[16];
-
void __init sparc_context_init(int numctx)
{
int ctx;
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index f00e22b0087f..86ee494b7af4 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -176,13 +176,15 @@ static void iounit_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_
}
#ifdef CONFIG_SBUS
-static void iounit_map_dma_area(unsigned long va, __u32 addr, int len)
+static int iounit_map_dma_area(dma_addr_t *pba, unsigned long va, __u32 addr, int len)
{
unsigned long page, end;
pgprot_t dvma_prot;
iopte_t *iopte;
struct sbus_bus *sbus;
+ *pba = addr;
+
dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV);
end = PAGE_ALIGN((addr + len));
while(addr < end) {
@@ -213,6 +215,8 @@ static void iounit_map_dma_area(unsigned long va, __u32 addr, int len)
}
flush_cache_all();
flush_tlb_all();
+
+ return 0;
}
static void iounit_unmap_dma_area(unsigned long addr, int len)
@@ -221,7 +225,7 @@ static void iounit_unmap_dma_area(unsigned long addr, int len)
}
/* XXX We do not pass sbus device here, bad. */
-static unsigned long iounit_translate_dvma(unsigned long addr)
+static struct page *iounit_translate_dvma(unsigned long addr)
{
struct sbus_bus *sbus = sbus_root; /* They are all the same */
struct iounit_struct *iounit = (struct iounit_struct *)sbus->iommu;
@@ -230,7 +234,7 @@ static unsigned long iounit_translate_dvma(unsigned long addr)
i = ((addr - IOUNIT_DMA_BASE) >> PAGE_SHIFT);
iopte = (iopte_t *)(iounit->page_table + i);
- return (iopte_val(*iopte) & 0xFFFFFFF0) << 4; /* XXX sun4d guru, help */
+ return pfn_to_page(iopte_val(*iopte) >> (PAGE_SHIFT-4)); /* XXX sun4d guru, help */
}
#endif
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
index ebcef957e453..487daf560f4e 100644
--- a/arch/sparc/mm/iommu.c
+++ b/arch/sparc/mm/iommu.c
@@ -23,6 +23,18 @@
#include <asm/mbus.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
+#include <asm/bitext.h>
+#include <asm/iommu.h>
+
+/*
+ * This can be sized dynamically, but we will do this
+ * only when we have a guidance about actual I/O pressures.
+ */
+#define IOMMU_RNGE IOMMU_RNGE_256MB
+#define IOMMU_START 0xF0000000
+#define IOMMU_WINSIZE (256*1024*1024U)
+#define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 265KB */
+#define IOMMU_ORDER 6 /* 4096 * (1<<6) */
/* srmmu.c */
extern int viking_mxcc_present;
@@ -34,34 +46,30 @@ static int viking_flush;
extern void viking_flush_page(unsigned long page);
extern void viking_mxcc_flush_page(unsigned long page);
-#define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID)
-#define MKIOPTE(phys) (((((phys)>>4) & IOPTE_PAGE) | IOPERM) & ~IOPTE_WAZ)
-
-static inline void iommu_map_dvma_pages_for_iommu(struct iommu_struct *iommu)
-{
- unsigned long kern_end = (unsigned long) high_memory;
- unsigned long first = PAGE_OFFSET;
- unsigned long last = kern_end;
- iopte_t *iopte = iommu->page_table;
+/*
+ * Values precomputed according to CPU type.
+ */
+static unsigned int ioperm_noc; /* Consistent mapping iopte flags */
+static pgprot_t dvma_prot; /* Consistent mapping pte flags */
- iopte += ((first - iommu->start) >> PAGE_SHIFT);
- while(first <= last) {
- *iopte++ = __iopte(MKIOPTE(__pa(first)));
- first += PAGE_SIZE;
- }
-}
+#define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID)
+#define MKIOPTE(pfn, perm) (((((pfn)<<8) & IOPTE_PAGE) | (perm)) & ~IOPTE_WAZ)
void __init
iommu_init(int iommund, struct sbus_bus *sbus)
{
- unsigned int impl, vers, ptsize;
+ unsigned int impl, vers;
unsigned long tmp;
struct iommu_struct *iommu;
struct linux_prom_registers iommu_promregs[PROMREG_MAX];
struct resource r;
- int i;
+ unsigned long *bitmap;
iommu = kmalloc(sizeof(struct iommu_struct), GFP_ATOMIC);
+ if (!iommu) {
+ prom_printf("Unable to allocate iommu structure\n");
+ prom_halt();
+ }
prom_getproperty(iommund, "reg", (void *) iommu_promregs,
sizeof(iommu_promregs));
memset(&r, 0, sizeof(r));
@@ -69,93 +77,129 @@ iommu_init(int iommund, struct sbus_bus *sbus)
r.start = iommu_promregs[0].phys_addr;
iommu->regs = (struct iommu_regs *)
sbus_ioremap(&r, 0, PAGE_SIZE * 3, "iommu_regs");
- if(!iommu->regs)
- panic("Cannot map IOMMU registers.");
+ if(!iommu->regs) {
+ prom_printf("Cannot map IOMMU registers\n");
+ prom_halt();
+ }
impl = (iommu->regs->control & IOMMU_CTRL_IMPL) >> 28;
vers = (iommu->regs->control & IOMMU_CTRL_VERS) >> 24;
tmp = iommu->regs->control;
tmp &= ~(IOMMU_CTRL_RNGE);
- switch(PAGE_OFFSET & 0xf0000000) {
- case 0xf0000000:
- tmp |= (IOMMU_RNGE_256MB | IOMMU_CTRL_ENAB);
- iommu->plow = iommu->start = 0xf0000000;
- break;
- case 0xe0000000:
- tmp |= (IOMMU_RNGE_512MB | IOMMU_CTRL_ENAB);
- iommu->plow = iommu->start = 0xe0000000;
- break;
- case 0xd0000000:
- case 0xc0000000:
- tmp |= (IOMMU_RNGE_1GB | IOMMU_CTRL_ENAB);
- iommu->plow = iommu->start = 0xc0000000;
- break;
- case 0xb0000000:
- case 0xa0000000:
- case 0x90000000:
- case 0x80000000:
- tmp |= (IOMMU_RNGE_2GB | IOMMU_CTRL_ENAB);
- iommu->plow = iommu->start = 0x80000000;
- break;
- }
+ tmp |= (IOMMU_RNGE_256MB | IOMMU_CTRL_ENAB);
iommu->regs->control = tmp;
iommu_invalidate(iommu->regs);
+ iommu->start = IOMMU_START;
iommu->end = 0xffffffff;
/* Allocate IOMMU page table */
- ptsize = iommu->end - iommu->start + 1;
- ptsize = (ptsize >> PAGE_SHIFT) * sizeof(iopte_t);
-
/* Stupid alignment constraints give me a headache.
We need 256K or 512K or 1M or 2M area aligned to
its size and current gfp will fortunately give
it to us. */
- for (i = 6; i < 9; i++)
- if ((1 << (i + PAGE_SHIFT)) == ptsize)
- break;
- tmp = __get_free_pages(GFP_KERNEL, i);
+ tmp = __get_free_pages(GFP_KERNEL, IOMMU_ORDER);
if (!tmp) {
- prom_printf("Could not allocate iopte of size 0x%08x\n", ptsize);
+ prom_printf("Unable to allocate iommu table [0x%08x]\n",
+ IOMMU_NPTES*sizeof(iopte_t));
prom_halt();
}
- iommu->lowest = iommu->page_table = (iopte_t *)tmp;
+ iommu->page_table = (iopte_t *)tmp;
/* Initialize new table. */
+ memset(iommu->page_table, 0, IOMMU_NPTES*sizeof(iopte_t));
flush_cache_all();
- memset(iommu->page_table, 0, ptsize);
- iommu_map_dvma_pages_for_iommu(iommu);
- if(viking_mxcc_present) {
- unsigned long start = (unsigned long) iommu->page_table;
- unsigned long end = (start + ptsize);
+ flush_tlb_all();
+ iommu->regs->base = __pa((unsigned long) iommu->page_table) >> 4;
+ iommu_invalidate(iommu->regs);
+
+ bitmap = kmalloc(IOMMU_NPTES>>3, GFP_KERNEL);
+ if (!bitmap) {
+ prom_printf("Unable to allocate iommu bitmap [%d]\n",
+ (int)(IOMMU_NPTES>>3));
+ prom_halt();
+ }
+ bit_map_init(&iommu->usemap, bitmap, IOMMU_NPTES);
+
+ printk("IOMMU: impl %d vers %d table 0x%p[%d B] map [%d b]\n",
+ impl, vers, iommu->page_table,
+ (int)(IOMMU_NPTES*sizeof(iopte_t)), (int)IOMMU_NPTES);
+
+ sbus->iommu = iommu;
+}
+
+/* This begs to be btfixup-ed by srmmu. */
+static void iommu_viking_flush_iotlb(iopte_t *iopte, unsigned int niopte)
+{
+ unsigned long start;
+ unsigned long end;
+
+ start = (unsigned long)iopte & PAGE_MASK;
+ end = PAGE_ALIGN(start + niopte*sizeof(iopte_t));
+ if (viking_mxcc_present) {
while(start < end) {
viking_mxcc_flush_page(start);
start += PAGE_SIZE;
}
} else if (viking_flush) {
- unsigned long start = (unsigned long) iommu->page_table;
- unsigned long end = (start + ptsize);
while(start < end) {
viking_flush_page(start);
start += PAGE_SIZE;
}
}
- flush_tlb_all();
- iommu->regs->base = __pa((unsigned long) iommu->page_table) >> 4;
- iommu_invalidate(iommu->regs);
+}
- sbus->iommu = iommu;
- printk("IOMMU: impl %d vers %d page table at %p of size %d bytes\n",
- impl, vers, iommu->page_table, ptsize);
+static u32 iommu_get_one(struct page *page, int npages, struct sbus_bus *sbus)
+{
+ struct iommu_struct *iommu = sbus->iommu;
+ int ioptex;
+ iopte_t *iopte, *iopte0;
+ unsigned int busa, busa0;
+ int i;
+
+ ioptex = bit_map_string_get(&iommu->usemap, npages, 1);
+ if (ioptex < 0)
+ panic("iommu out");
+ busa0 = iommu->start + (ioptex << PAGE_SHIFT);
+ iopte0 = &iommu->page_table[ioptex];
+
+ busa = busa0;
+ iopte = iopte0;
+ for (i = 0; i < npages; i++) {
+ iopte_val(*iopte) = MKIOPTE(page_to_pfn(page), IOPERM);
+ iommu_invalidate_page(iommu->regs, busa);
+ busa += PAGE_SIZE;
+ iopte++;
+ page++;
+ }
+
+ iommu_viking_flush_iotlb(iopte0, npages);
+
+ return busa0;
+}
+
+static u32 iommu_get_scsi_one(char *vaddr, unsigned int len,
+ struct sbus_bus *sbus)
+{
+ unsigned long off;
+ int npages;
+ struct page *page;
+ u32 busa;
+
+ off = (unsigned long)vaddr & ~PAGE_MASK;
+ npages = (off + len + PAGE_SIZE-1) >> PAGE_SHIFT;
+ page = virt_to_page((unsigned long)vaddr & PAGE_MASK);
+ busa = iommu_get_one(page, npages, sbus);
+ return busa + off;
}
static __u32 iommu_get_scsi_one_noflush(char *vaddr, unsigned long len, struct sbus_bus *sbus)
{
- return (__u32)vaddr;
+ return iommu_get_scsi_one(vaddr, len, sbus);
}
static __u32 iommu_get_scsi_one_gflush(char *vaddr, unsigned long len, struct sbus_bus *sbus)
{
flush_page_for_dma(0);
- return (__u32)vaddr;
+ return iommu_get_scsi_one(vaddr, len, sbus);
}
static __u32 iommu_get_scsi_one_pflush(char *vaddr, unsigned long len, struct sbus_bus *sbus)
@@ -166,75 +210,129 @@ static __u32 iommu_get_scsi_one_pflush(char *vaddr, unsigned long len, struct sb
flush_page_for_dma(page);
page += PAGE_SIZE;
}
- return (__u32)vaddr;
+ return iommu_get_scsi_one(vaddr, len, sbus);
}
static void iommu_get_scsi_sgl_noflush(struct scatterlist *sg, int sz, struct sbus_bus *sbus)
{
+ int n;
+
while (sz != 0) {
--sz;
- sg[sz].dvma_address = (__u32) (page_address(sg[sz].page) + sg[sz].offset);
- sg[sz].dvma_length = (__u32) (sg[sz].length);
+ n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
+ sg->dvma_address = iommu_get_one(sg->page, n, sbus) + sg->offset;
+ sg->dvma_length = (__u32) sg->length;
+ sg++;
}
}
static void iommu_get_scsi_sgl_gflush(struct scatterlist *sg, int sz, struct sbus_bus *sbus)
{
+ int n;
+
flush_page_for_dma(0);
while (sz != 0) {
--sz;
- sg[sz].dvma_address = (__u32) (page_address(sg[sz].page) + sg[sz].offset);
- sg[sz].dvma_length = (__u32) (sg[sz].length);
+ n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
+ sg->dvma_address = iommu_get_one(sg->page, n, sbus) + sg->offset;
+ sg->dvma_length = (__u32) sg->length;
+ sg++;
}
}
static void iommu_get_scsi_sgl_pflush(struct scatterlist *sg, int sz, struct sbus_bus *sbus)
{
unsigned long page, oldpage = 0;
+ int n, i;
while(sz != 0) {
--sz;
- page = (unsigned long) page_address(sg[sz].page);
- if (oldpage == page)
- page += PAGE_SIZE; /* We flushed that page already */
- while(page < (unsigned long)(page_address(sg[sz].page) + sg[sz].offset + sg[sz].length)) {
- flush_page_for_dma(page);
- page += PAGE_SIZE;
+
+ n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
+
+ /*
+ * We expect unmapped highmem pages to be not in the cache.
+ * XXX Is this a good assumption?
+ * XXX What if someone else unmaps it here and races us?
+ */
+ if ((page = (unsigned long) page_address(sg->page)) != 0) {
+ for (i = 0; i < n; i++) {
+ if (page != oldpage) { /* Already flushed? */
+ flush_page_for_dma(page);
+ oldpage = page;
+ }
+ page += PAGE_SIZE;
+ }
}
- sg[sz].dvma_address = (__u32) (page_address(sg[sz].page) + sg[sz].offset);
- sg[sz].dvma_length = (__u32) (sg[sz].length);
- oldpage = page - PAGE_SIZE;
+
+ sg->dvma_address = iommu_get_one(sg->page, n, sbus) + sg->offset;
+ sg->dvma_length = (__u32) sg->length;
+ sg++;
}
}
+static void iommu_release_one(u32 busa, int npages, struct sbus_bus *sbus)
+{
+ struct iommu_struct *iommu = sbus->iommu;
+ int ioptex;
+ int i;
+
+ if (busa < iommu->start)
+ BUG();
+ ioptex = (busa - iommu->start) >> PAGE_SHIFT;
+ for (i = 0; i < npages; i++) {
+ iopte_val(iommu->page_table[ioptex + i]) = 0;
+ iommu_invalidate_page(iommu->regs, busa);
+ busa += PAGE_SIZE;
+ }
+ bit_map_clear(&iommu->usemap, ioptex, npages);
+}
+
static void iommu_release_scsi_one(__u32 vaddr, unsigned long len, struct sbus_bus *sbus)
{
+ unsigned long off;
+ int npages;
+
+ off = vaddr & ~PAGE_MASK;
+ npages = (off + len + PAGE_SIZE-1) >> PAGE_SHIFT;
+ iommu_release_one(vaddr & PAGE_MASK, npages, sbus);
}
static void iommu_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus *sbus)
{
+ int n;
+
+ while(sz != 0) {
+ --sz;
+
+ n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
+ iommu_release_one(sg->dvma_address & PAGE_MASK, n, sbus);
+ sg->dvma_address = 0x21212121;
+ sg++;
+ }
}
#ifdef CONFIG_SBUS
-static void iommu_map_dma_area(unsigned long va, __u32 addr, int len)
+static int iommu_map_dma_area(dma_addr_t *pba, unsigned long va,
+ unsigned long addr, int len)
{
- unsigned long page, end, ipte_cache;
- pgprot_t dvma_prot;
+ unsigned long page, end;
struct iommu_struct *iommu = sbus_root->iommu;
iopte_t *iopte = iommu->page_table;
iopte_t *first;
+ int ioptex;
- if(viking_mxcc_present || srmmu_modtype == HyperSparc) {
- dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV);
- ipte_cache = 1;
- } else {
- dvma_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV);
- ipte_cache = 0;
- }
+ if ((va & ~PAGE_MASK) != 0) BUG();
+ if ((addr & ~PAGE_MASK) != 0) BUG();
+ if ((len & ~PAGE_MASK) != 0) BUG();
+
+ ioptex = bit_map_string_get(&iommu->usemap, len >> PAGE_SHIFT, 1);
+ if (ioptex < 0)
+ panic("iommu out");
- iopte += ((addr - iommu->start) >> PAGE_SHIFT);
+ iopte += ioptex;
first = iopte;
- end = PAGE_ALIGN((addr + len));
+ end = addr + len;
while(addr < end) {
page = va;
{
@@ -252,16 +350,11 @@ static void iommu_map_dma_area(unsigned long va, __u32 addr, int len)
pgdp = pgd_offset(&init_mm, addr);
pmdp = pmd_offset(pgdp, addr);
ptep = pte_offset_map(pmdp, addr);
- /* XXX What if we run out of atomic maps above */
set_pte(ptep, mk_pte(virt_to_page(page), dvma_prot));
- if (ipte_cache != 0) {
- iopte_val(*iopte++) = MKIOPTE(__pa(page));
- } else {
- iopte_val(*iopte++) =
- MKIOPTE(__pa(page)) & ~IOPTE_CACHE;
- }
}
+ iopte_val(*iopte++) =
+ MKIOPTE(page_to_pfn(virt_to_page(page)), ioperm_noc);
addr += PAGE_SIZE;
va += PAGE_SIZE;
}
@@ -277,23 +370,12 @@ static void iommu_map_dma_area(unsigned long va, __u32 addr, int len)
* to handle the latter case as well.
*/
flush_cache_all();
- if(viking_mxcc_present) {
- unsigned long start = ((unsigned long) first) & PAGE_MASK;
- unsigned long end = PAGE_ALIGN(((unsigned long) iopte));
- while(start < end) {
- viking_mxcc_flush_page(start);
- start += PAGE_SIZE;
- }
- } else if(viking_flush) {
- unsigned long start = ((unsigned long) first) & PAGE_MASK;
- unsigned long end = PAGE_ALIGN(((unsigned long) iopte));
- while(start < end) {
- viking_flush_page(start);
- start += PAGE_SIZE;
- }
- }
+ iommu_viking_flush_iotlb(first, len >> PAGE_SHIFT);
flush_tlb_all();
iommu_invalidate(iommu->regs);
+
+ *pba = iommu->start + (ioptex << PAGE_SHIFT);
+ return 0;
}
static void iommu_unmap_dma_area(unsigned long busa, int len)
@@ -301,27 +383,29 @@ static void iommu_unmap_dma_area(unsigned long busa, int len)
struct iommu_struct *iommu = sbus_root->iommu;
iopte_t *iopte = iommu->page_table;
unsigned long end;
+ int ioptex = (busa - iommu->start) >> PAGE_SHIFT;
- iopte += ((busa - iommu->start) >> PAGE_SHIFT);
- end = PAGE_ALIGN((busa + len));
+ if ((busa & ~PAGE_MASK) != 0) BUG();
+ if ((len & ~PAGE_MASK) != 0) BUG();
+
+ iopte += ioptex;
+ end = busa + len;
while (busa < end) {
iopte_val(*iopte++) = 0;
busa += PAGE_SIZE;
}
- flush_tlb_all(); /* P3: Hmm... it would not hurt. */
+ flush_tlb_all();
iommu_invalidate(iommu->regs);
+ bit_map_clear(&iommu->usemap, ioptex, len >> PAGE_SHIFT);
}
-static unsigned long iommu_translate_dvma(unsigned long busa)
+static struct page *iommu_translate_dvma(unsigned long busa)
{
struct iommu_struct *iommu = sbus_root->iommu;
iopte_t *iopte = iommu->page_table;
- unsigned long pa;
iopte += ((busa - iommu->start) >> PAGE_SHIFT);
- pa = pte_val(*iopte);
- pa = (pa & 0xFFFFFFF0) << 4; /* Loose higher bits of 36 */
- return pa + PAGE_OFFSET;
+ return pfn_to_page((pte_val(*iopte) & IOPTE_PAGE) >> (PAGE_SHIFT-4));
}
#endif
@@ -352,12 +436,20 @@ void __init ld_mmu_iommu(void)
BTFIXUPSET_CALL(mmu_get_scsi_one, iommu_get_scsi_one_pflush, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(mmu_get_scsi_sgl, iommu_get_scsi_sgl_pflush, BTFIXUPCALL_NORM);
}
- BTFIXUPSET_CALL(mmu_release_scsi_one, iommu_release_scsi_one, BTFIXUPCALL_NOP);
- BTFIXUPSET_CALL(mmu_release_scsi_sgl, iommu_release_scsi_sgl, BTFIXUPCALL_NOP);
+ BTFIXUPSET_CALL(mmu_release_scsi_one, iommu_release_scsi_one, BTFIXUPCALL_NORM);
+ BTFIXUPSET_CALL(mmu_release_scsi_sgl, iommu_release_scsi_sgl, BTFIXUPCALL_NORM);
#ifdef CONFIG_SBUS
BTFIXUPSET_CALL(mmu_map_dma_area, iommu_map_dma_area, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(mmu_unmap_dma_area, iommu_unmap_dma_area, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(mmu_translate_dvma, iommu_translate_dvma, BTFIXUPCALL_NORM);
#endif
+
+ if (viking_mxcc_present || srmmu_modtype == HyperSparc) {
+ dvma_prot = __pgprot(SRMMU_CACHE | SRMMU_ET_PTE | SRMMU_PRIV);
+ ioperm_noc = IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID;
+ } else {
+ dvma_prot = __pgprot(SRMMU_ET_PTE | SRMMU_PRIV);
+ ioperm_noc = IOPTE_WRITE | IOPTE_VALID;
+ }
}
diff --git a/arch/sparc/mm/loadmmu.c b/arch/sparc/mm/loadmmu.c
index e388c31f55d9..e9f9571601ba 100644
--- a/arch/sparc/mm/loadmmu.c
+++ b/arch/sparc/mm/loadmmu.c
@@ -26,7 +26,6 @@ unsigned int pg_iobits;
extern void ld_mmu_sun4c(void);
extern void ld_mmu_srmmu(void);
-extern void ioport_init(void);
void __init load_mmu(void)
{
@@ -44,5 +43,4 @@ void __init load_mmu(void)
prom_halt();
}
btfixup();
- ioport_init();
}
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index ee0ae591e311..30ec1351efe3 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -21,6 +21,7 @@
#include <linux/fs.h>
#include <linux/seq_file.h>
+#include <asm/bitext.h>
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
@@ -137,29 +138,26 @@ static inline int srmmu_device_memory(unsigned long x)
int srmmu_cache_pagetables;
/* these will be initialized in srmmu_nocache_calcsize() */
-int srmmu_nocache_npages;
unsigned long srmmu_nocache_size;
unsigned long srmmu_nocache_end;
unsigned long pkmap_base;
unsigned long pkmap_base_end;
-unsigned long srmmu_nocache_bitmap_size;
extern unsigned long fix_kmap_begin;
extern unsigned long fix_kmap_end;
+/* 1 bit <=> 256 bytes of nocache <=> 64 PTEs */
#define SRMMU_NOCACHE_BITMAP_SHIFT (PAGE_SHIFT - 4)
void *srmmu_nocache_pool;
void *srmmu_nocache_bitmap;
-int srmmu_nocache_low;
-int srmmu_nocache_used;
-static spinlock_t srmmu_nocache_spinlock = SPIN_LOCK_UNLOCKED;
+static struct bit_map srmmu_nocache_map;
/* This makes sense. Honest it does - Anton */
#define __nocache_pa(VADDR) (((unsigned long)VADDR) - SRMMU_NOCACHE_VADDR + __pa((unsigned long)srmmu_nocache_pool))
#define __nocache_va(PADDR) (__va((unsigned long)PADDR) - (unsigned long)srmmu_nocache_pool + SRMMU_NOCACHE_VADDR)
#define __nocache_fix(VADDR) __va(__nocache_pa(VADDR))
-static inline unsigned long srmmu_pte_pfn(pte_t pte)
+static unsigned long srmmu_pte_pfn(pte_t pte)
{
if (srmmu_device_memory(pte_val(pte))) {
/* XXX Anton obviously had something in mind when he did this.
@@ -219,15 +217,6 @@ static inline int srmmu_pgd_present(pgd_t pgd)
static inline void srmmu_pgd_clear(pgd_t * pgdp)
{ srmmu_set_pte((pte_t *)pgdp, __pte(0)); }
-static inline int srmmu_pte_write(pte_t pte)
-{ return pte_val(pte) & SRMMU_WRITE; }
-
-static inline int srmmu_pte_dirty(pte_t pte)
-{ return pte_val(pte) & SRMMU_DIRTY; }
-
-static inline int srmmu_pte_young(pte_t pte)
-{ return pte_val(pte) & SRMMU_REF; }
-
static inline pte_t srmmu_pte_wrprotect(pte_t pte)
{ return __pte(pte_val(pte) & ~SRMMU_WRITE);}
@@ -321,10 +310,7 @@ static inline pte_t *srmmu_pte_offset(pmd_t * dir, unsigned long address)
*/
static unsigned long __srmmu_get_nocache(int size, int align)
{
- int offset = srmmu_nocache_low;
- int i;
- unsigned long va_tmp, phys_tmp;
- int lowest_failed = 0;
+ int offset;
if (size < SRMMU_NOCACHE_BITMAP_SHIFT) {
printk("Size 0x%x too small for nocache request\n", size);
@@ -334,49 +320,20 @@ static unsigned long __srmmu_get_nocache(int size, int align)
printk("Size 0x%x unaligned int nocache request\n", size);
size += SRMMU_NOCACHE_BITMAP_SHIFT-1;
}
- size = size >> SRMMU_NOCACHE_BITMAP_SHIFT;
-
- spin_lock(&srmmu_nocache_spinlock);
-
-repeat:
- offset = find_next_zero_bit(srmmu_nocache_bitmap, srmmu_nocache_bitmap_size, offset);
-
- /* we align on physical address */
- if (align) {
- va_tmp = (SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT));
- phys_tmp = (__nocache_pa(va_tmp) + align - 1) & ~(align - 1);
- va_tmp = (unsigned long)__nocache_va(phys_tmp);
- offset = (va_tmp - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT;
- }
- if ((srmmu_nocache_bitmap_size - offset) < size) {
- printk("Run out of nocached RAM!\n");
- spin_unlock(&srmmu_nocache_spinlock);
+ offset = bit_map_string_get(&srmmu_nocache_map,
+ size >> SRMMU_NOCACHE_BITMAP_SHIFT,
+ align >> SRMMU_NOCACHE_BITMAP_SHIFT);
+/* P3 */ /* printk("srmmu: get size %d align %d, got %d (0x%x)\n",
+ size >> SRMMU_NOCACHE_BITMAP_SHIFT, align >> SRMMU_NOCACHE_BITMAP_SHIFT,
+ offset, offset); */
+ if (offset == -1) {
+ printk("srmmu: out of nocache %d: %d/%d\n",
+ size, (int) srmmu_nocache_size,
+ srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT);
return 0;
}
- i = 0;
- while(i < size) {
- if (test_bit(offset + i, srmmu_nocache_bitmap)) {
- lowest_failed = 1;
- offset = offset + i + 1;
- goto repeat;
- }
- i++;
- }
-
- i = 0;
- while(i < size) {
- set_bit(offset + i, srmmu_nocache_bitmap);
- i++;
- srmmu_nocache_used++;
- }
-
- if (!lowest_failed && ((align >> SRMMU_NOCACHE_BITMAP_SHIFT) <= 1) && (offset > srmmu_nocache_low))
- srmmu_nocache_low = offset;
-
- spin_unlock(&srmmu_nocache_spinlock);
-
return (SRMMU_NOCACHE_VADDR + (offset << SRMMU_NOCACHE_BITMAP_SHIFT));
}
@@ -422,63 +379,57 @@ void srmmu_free_nocache(unsigned long vaddr, int size)
offset = (vaddr - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT;
size = size >> SRMMU_NOCACHE_BITMAP_SHIFT;
- spin_lock(&srmmu_nocache_spinlock);
-
- while(size--) {
- clear_bit(offset + size, srmmu_nocache_bitmap);
- srmmu_nocache_used--;
- }
-
- if (offset < srmmu_nocache_low)
- srmmu_nocache_low = offset;
-
- spin_unlock(&srmmu_nocache_spinlock);
+/* P3 */ /* printk("srmmu: free off %d (0x%x) size %d\n", offset, offset, size); */
+ bit_map_clear(&srmmu_nocache_map, offset, size);
}
void srmmu_early_allocate_ptable_skeleton(unsigned long start, unsigned long end);
extern unsigned long probe_memory(void); /* in fault.c */
-/* Reserve nocache dynamically proportionally to the amount of
+/*
+ * Reserve nocache dynamically proportionally to the amount of
* system RAM. -- Tomas Szepe <szepe@pinerecords.com>, June 2002
*/
void srmmu_nocache_calcsize(void)
{
unsigned long sysmemavail = probe_memory() / 1024;
+ int srmmu_nocache_npages;
srmmu_nocache_npages =
sysmemavail / SRMMU_NOCACHE_ALCRATIO / 1024 * 256;
- if (sysmemavail % (SRMMU_NOCACHE_ALCRATIO * 1024))
- srmmu_nocache_npages += 256;
+
+ /* P3 XXX The 4x overuse: corroborated by /proc/meminfo. */
+ // if (srmmu_nocache_npages < 256) srmmu_nocache_npages = 256;
+ if (srmmu_nocache_npages < 550) srmmu_nocache_npages = 550;
/* anything above 1280 blows up */
if (srmmu_nocache_npages > 1280) srmmu_nocache_npages = 1280;
srmmu_nocache_size = srmmu_nocache_npages * PAGE_SIZE;
- srmmu_nocache_bitmap_size = srmmu_nocache_npages * 16;
srmmu_nocache_end = SRMMU_NOCACHE_VADDR + srmmu_nocache_size;
fix_kmap_begin = srmmu_nocache_end;
fix_kmap_end = fix_kmap_begin + (KM_TYPE_NR * NR_CPUS - 1) * PAGE_SIZE;
pkmap_base = SRMMU_NOCACHE_VADDR + srmmu_nocache_size + 0x40000;
pkmap_base_end = pkmap_base + LAST_PKMAP * PAGE_SIZE;
-
- /* printk("system memory available = %luk\nnocache ram size = %luk\n",
- sysmemavail, srmmu_nocache_size / 1024); */
}
void srmmu_nocache_init(void)
{
+ unsigned int bitmap_bits;
pgd_t *pgd;
pmd_t *pmd;
pte_t *pte;
unsigned long paddr, vaddr;
unsigned long pteval;
+ bitmap_bits = srmmu_nocache_size >> SRMMU_NOCACHE_BITMAP_SHIFT;
+
srmmu_nocache_pool = __alloc_bootmem(srmmu_nocache_size, PAGE_SIZE, 0UL);
memset(srmmu_nocache_pool, 0, srmmu_nocache_size);
- srmmu_nocache_bitmap = __alloc_bootmem(srmmu_nocache_bitmap_size, SMP_CACHE_BYTES, 0UL);
- memset(srmmu_nocache_bitmap, 0, srmmu_nocache_bitmap_size);
+ srmmu_nocache_bitmap = __alloc_bootmem(bitmap_bits >> 3, SMP_CACHE_BYTES, 0UL);
+ bit_map_init(&srmmu_nocache_map, srmmu_nocache_bitmap, bitmap_bits);
srmmu_swapper_pg_dir = (pgd_t *)__srmmu_get_nocache(SRMMU_PGD_TABLE_SIZE, SRMMU_PGD_TABLE_SIZE);
memset(__nocache_fix(srmmu_swapper_pg_dir), 0, SRMMU_PGD_TABLE_SIZE);
@@ -486,11 +437,12 @@ void srmmu_nocache_init(void)
srmmu_early_allocate_ptable_skeleton(SRMMU_NOCACHE_VADDR, srmmu_nocache_end);
- spin_lock_init(&srmmu_nocache_spinlock);
-
paddr = __pa((unsigned long)srmmu_nocache_pool);
vaddr = SRMMU_NOCACHE_VADDR;
+/* P3 */ printk("srmmu: pool 0x%x vaddr 0x%x bitmap 0x%x bits %d (0x%x)\n",
+ (int)srmmu_nocache_pool, vaddr, srmmu_nocache_bitmap, bitmap_bits, bitmap_bits);
+
while (vaddr < srmmu_nocache_end) {
pgd = pgd_offset_k(vaddr);
pmd = srmmu_pmd_offset(__nocache_fix(pgd), vaddr);
@@ -637,7 +589,8 @@ static void srmmu_switch_mm(struct mm_struct *old_mm, struct mm_struct *mm,
}
/* Low level IO area allocation on the SRMMU. */
-void srmmu_mapioaddr(unsigned long physaddr, unsigned long virt_addr, int bus_type, int rdonly)
+static inline void srmmu_mapioaddr(unsigned long physaddr,
+ unsigned long virt_addr, int bus_type)
{
pgd_t *pgdp;
pmd_t *pmdp;
@@ -656,16 +609,24 @@ void srmmu_mapioaddr(unsigned long physaddr, unsigned long virt_addr, int bus_ty
* 36-bit physical address on the I/O space lines...
*/
tmp |= (bus_type << 28);
- if(rdonly)
- tmp |= SRMMU_PRIV_RDONLY;
- else
- tmp |= SRMMU_PRIV;
+ tmp |= SRMMU_PRIV;
__flush_page_to_ram(virt_addr);
srmmu_set_pte(ptep, __pte(tmp));
+}
+
+static void srmmu_mapiorange(unsigned int bus, unsigned long xpa,
+ unsigned long xva, unsigned int len)
+{
+ while (len != 0) {
+ len -= PAGE_SIZE;
+ srmmu_mapioaddr(xpa, xva, bus);
+ xva += PAGE_SIZE;
+ xpa += PAGE_SIZE;
+ }
flush_tlb_all();
}
-void srmmu_unmapioaddr(unsigned long virt_addr)
+static inline void srmmu_unmapioaddr(unsigned long virt_addr)
{
pgd_t *pgdp;
pmd_t *pmdp;
@@ -677,6 +638,15 @@ void srmmu_unmapioaddr(unsigned long virt_addr)
/* No need to flush uncacheable page. */
srmmu_pte_clear(ptep);
+}
+
+static void srmmu_unmapiorange(unsigned long virt_addr, unsigned int len)
+{
+ while (len != 0) {
+ len -= PAGE_SIZE;
+ srmmu_unmapioaddr(virt_addr);
+ virt_addr += PAGE_SIZE;
+ }
flush_tlb_all();
}
@@ -1398,7 +1368,7 @@ static void srmmu_mmu_info(struct seq_file *m)
srmmu_name,
num_contexts,
srmmu_nocache_size,
- (srmmu_nocache_used << SRMMU_NOCACHE_BITMAP_SHIFT));
+ srmmu_nocache_map.used << SRMMU_NOCACHE_BITMAP_SHIFT);
}
static void srmmu_update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte)
@@ -2258,7 +2228,10 @@ void __init ld_mmu_srmmu(void)
BTFIXUPSET_CALL(pte_mkyoung, srmmu_pte_mkyoung, BTFIXUPCALL_ORINT(SRMMU_REF));
BTFIXUPSET_CALL(update_mmu_cache, srmmu_update_mmu_cache, BTFIXUPCALL_NOP);
BTFIXUPSET_CALL(destroy_context, srmmu_destroy_context, BTFIXUPCALL_NORM);
-
+
+ BTFIXUPSET_CALL(sparc_mapiorange, srmmu_mapiorange, BTFIXUPCALL_NORM);
+ BTFIXUPSET_CALL(sparc_unmapiorange, srmmu_unmapiorange, BTFIXUPCALL_NORM);
+
BTFIXUPSET_CALL(mmu_info, srmmu_mmu_info, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(alloc_thread_info, srmmu_alloc_thread_info, BTFIXUPCALL_NORM);
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index 2f28f983c86e..289a3f425831 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -534,10 +534,13 @@ static inline void sun4c_init_ss2_cache_bug(void)
}
/* Addr is always aligned on a page boundary for us already. */
-static void sun4c_map_dma_area(unsigned long va, u32 addr, int len)
+static int sun4c_map_dma_area(dma_addr_t *pba, unsigned long va,
+ unsigned long addr, int len)
{
unsigned long page, end;
+ *pba = addr;
+
end = PAGE_ALIGN((addr + len));
while (addr < end) {
page = va;
@@ -550,13 +553,15 @@ static void sun4c_map_dma_area(unsigned long va, u32 addr, int len)
addr += PAGE_SIZE;
va += PAGE_SIZE;
}
+
+ return 0;
}
-static unsigned long sun4c_translate_dvma(unsigned long busa)
+static struct page *sun4c_translate_dvma(unsigned long busa)
{
/* Fortunately for us, bus_addr == uncached_virt in sun4c. */
unsigned long pte = sun4c_get_pte(busa);
- return (pte << PAGE_SHIFT) + PAGE_OFFSET;
+ return pfn_to_page(pte & SUN4C_PFN_MASK);
}
static void sun4c_unmap_dma_area(unsigned long busa, int len)
@@ -1578,21 +1583,33 @@ static void sun4c_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
}
}
-void sun4c_mapioaddr(unsigned long physaddr, unsigned long virt_addr,
- int bus_type, int rdonly)
+static inline void sun4c_mapioaddr(unsigned long physaddr, unsigned long virt_addr)
{
unsigned long page_entry;
page_entry = ((physaddr >> PAGE_SHIFT) & SUN4C_PFN_MASK);
page_entry |= ((pg_iobits | _SUN4C_PAGE_PRIV) & ~(_SUN4C_PAGE_PRESENT));
- if (rdonly)
- page_entry &= ~_SUN4C_WRITEABLE;
sun4c_put_pte(virt_addr, page_entry);
}
-void sun4c_unmapioaddr(unsigned long virt_addr)
+static void sun4c_mapiorange(unsigned int bus, unsigned long xpa,
+ unsigned long xva, unsigned int len)
{
- sun4c_put_pte(virt_addr, 0);
+ while (len != 0) {
+ len -= PAGE_SIZE;
+ sun4c_mapioaddr(xpa, xva);
+ xva += PAGE_SIZE;
+ xpa += PAGE_SIZE;
+ }
+}
+
+static void sun4c_unmapiorange(unsigned long virt_addr, unsigned int len)
+{
+ while (len != 0) {
+ len -= PAGE_SIZE;
+ sun4c_put_pte(virt_addr, 0);
+ virt_addr += PAGE_SIZE;
+ }
}
static void sun4c_alloc_context(struct mm_struct *old_mm, struct mm_struct *mm)
@@ -1783,7 +1800,7 @@ static pte_t sun4c_pte_mkyoung(pte_t pte)
*/
static pte_t sun4c_mk_pte(struct page *page, pgprot_t pgprot)
{
- return __pte((page - mem_map) | pgprot_val(pgprot));
+ return __pte(page_to_pfn(page) | pgprot_val(pgprot));
}
static pte_t sun4c_mk_pte_phys(unsigned long phys_page, pgprot_t pgprot)
@@ -2225,6 +2242,9 @@ void __init ld_mmu_sun4c(void)
BTFIXUPSET_CALL(mmu_unmap_dma_area, sun4c_unmap_dma_area, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(mmu_translate_dvma, sun4c_translate_dvma, BTFIXUPCALL_NORM);
+ BTFIXUPSET_CALL(sparc_mapiorange, sun4c_mapiorange, BTFIXUPCALL_NORM);
+ BTFIXUPSET_CALL(sparc_unmapiorange, sun4c_unmapiorange, BTFIXUPCALL_NORM);
+
BTFIXUPSET_CALL(alloc_thread_info, sun4c_alloc_thread_info, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(free_thread_info, sun4c_free_thread_info, BTFIXUPCALL_NORM);
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 5721ed1a761a..2bee8d6047f8 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -370,25 +370,103 @@ CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_NETLINK_DEV=y
-# CONFIG_NETFILTER is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
CONFIG_UNIX=y
CONFIG_NET_KEY=m
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
CONFIG_ARPD=y
CONFIG_INET_ECN=y
# CONFIG_SYN_COOKIES is not set
CONFIG_INET_AH=y
CONFIG_INET_ESP=y
CONFIG_INET_IPCOMP=y
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_LIMIT=m
+CONFIG_IP_NF_MATCH_MAC=m
+CONFIG_IP_NF_MATCH_PKTTYPE=m
+CONFIG_IP_NF_MATCH_MARK=m
+CONFIG_IP_NF_MATCH_MULTIPORT=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_DSCP=m
+CONFIG_IP_NF_MATCH_AH_ESP=m
+CONFIG_IP_NF_MATCH_LENGTH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_TCPMSS=m
+CONFIG_IP_NF_MATCH_HELPER=m
+CONFIG_IP_NF_MATCH_STATE=m
+CONFIG_IP_NF_MATCH_CONNTRACK=m
+CONFIG_IP_NF_MATCH_UNCLEAN=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_PHYSDEV=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_MIRROR=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_NAT_LOCAL=y
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_DSCP=m
+CONFIG_IP_NF_TARGET_MARK=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_COMPAT_IPCHAINS=m
+CONFIG_IP_NF_COMPAT_IPFWADM=m
CONFIG_IPV6=m
CONFIG_IPV6_PRIVACY=y
CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_LIMIT=m
+CONFIG_IP6_NF_MATCH_MAC=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_MULTIPORT=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_MARK=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AHESP=m
+CONFIG_IP6_NF_MATCH_LENGTH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_MARK=m
CONFIG_XFRM_USER=m
#
@@ -410,7 +488,20 @@ CONFIG_ATALK=m
CONFIG_DECNET=m
CONFIG_DECNET_SIOCGIFCONF=y
# CONFIG_DECNET_ROUTER is not set
-# CONFIG_BRIDGE is not set
+CONFIG_BRIDGE=m
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_IPF=m
+CONFIG_BRIDGE_EBT_ARPF=m
+CONFIG_BRIDGE_EBT_VLANF=m
+CONFIG_BRIDGE_EBT_MARKF=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
@@ -433,6 +524,7 @@ CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_QOS=y
CONFIG_NET_ESTIMATOR=y
CONFIG_NET_CLS=y
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index 97ded6599201..c348b1b4b2ee 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -11,6 +11,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/compat.h>
+#include <linux/ioctl32.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp.h>
@@ -670,7 +671,7 @@ static __inline__ void *alloc_user_space(long len)
return (void *) (usp - len);
}
-static int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct ifreq *u_ifreq64;
struct ifreq32 *u_ifreq32 = (struct ifreq32 *) arg;
@@ -3832,65 +3833,23 @@ static int do_blkgetsize64(unsigned int fd, unsigned int cmd,
#define BNEPGETCONNLIST _IOR('B', 210, int)
#define BNEPGETCONNINFO _IOR('B', 211, int)
-struct ioctl_trans {
- unsigned int cmd;
- unsigned int handler;
- unsigned int next;
-};
+typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
-#define COMPATIBLE_IOCTL(cmd) asm volatile(".word %0, sys_ioctl, 0" : : "i" (cmd));
-#define HANDLE_IOCTL(cmd,handler) asm volatile(".word %0, %1, 0" : : "i" (cmd), "i" (handler));
-#define IOCTL_TABLE_START void ioctl32_foo(void) { asm volatile(".data\nioctl_translations:");
-#define IOCTL_TABLE_END asm volatile("\nioctl_translations_end:\n\t.previous"); }
+#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
+#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL },
+#define IOCTL_TABLE_START \
+ struct ioctl_trans ioctl_start[] = {
+#define IOCTL_TABLE_END \
+ }; struct ioctl_trans ioctl_end[0];
IOCTL_TABLE_START
-/* List here exlicitly which ioctl's are known to have
- * compatible types passed or none at all...
- */
-/* Big T */
-COMPATIBLE_IOCTL(TCGETA)
-COMPATIBLE_IOCTL(TCSETA)
-COMPATIBLE_IOCTL(TCSETAW)
-COMPATIBLE_IOCTL(TCSETAF)
-COMPATIBLE_IOCTL(TCSBRK)
+#include <linux/compat_ioctl.h>
COMPATIBLE_IOCTL(TCSBRKP)
-COMPATIBLE_IOCTL(TCXONC)
-COMPATIBLE_IOCTL(TCFLSH)
-COMPATIBLE_IOCTL(TCGETS)
-COMPATIBLE_IOCTL(TCSETS)
-COMPATIBLE_IOCTL(TCSETSW)
-COMPATIBLE_IOCTL(TCSETSF)
-COMPATIBLE_IOCTL(TIOCLINUX)
COMPATIBLE_IOCTL(TIOCSTART)
COMPATIBLE_IOCTL(TIOCSTOP)
-/* Little t */
-COMPATIBLE_IOCTL(TIOCGETD)
-COMPATIBLE_IOCTL(TIOCSETD)
-COMPATIBLE_IOCTL(TIOCEXCL)
-COMPATIBLE_IOCTL(TIOCNXCL)
-COMPATIBLE_IOCTL(TIOCCONS)
-COMPATIBLE_IOCTL(TIOCGSOFTCAR)
-COMPATIBLE_IOCTL(TIOCSSOFTCAR)
-COMPATIBLE_IOCTL(TIOCSWINSZ)
-COMPATIBLE_IOCTL(TIOCGWINSZ)
-COMPATIBLE_IOCTL(TIOCMGET)
-COMPATIBLE_IOCTL(TIOCMBIC)
-COMPATIBLE_IOCTL(TIOCMBIS)
-COMPATIBLE_IOCTL(TIOCMSET)
-COMPATIBLE_IOCTL(TIOCPKT)
-COMPATIBLE_IOCTL(TIOCNOTTY)
-COMPATIBLE_IOCTL(TIOCSTI)
-COMPATIBLE_IOCTL(TIOCOUTQ)
-COMPATIBLE_IOCTL(TIOCSPGRP)
-COMPATIBLE_IOCTL(TIOCGPGRP)
-COMPATIBLE_IOCTL(TIOCSCTTY)
-COMPATIBLE_IOCTL(TIOCGPTN)
-COMPATIBLE_IOCTL(TIOCSPTLCK)
COMPATIBLE_IOCTL(TIOCGSERIAL)
COMPATIBLE_IOCTL(TIOCSSERIAL)
-COMPATIBLE_IOCTL(TIOCSERGETLSR)
COMPATIBLE_IOCTL(TIOCSLTC)
-/* Big F */
COMPATIBLE_IOCTL(FBIOGTYPE)
COMPATIBLE_IOCTL(FBIOSATTR)
COMPATIBLE_IOCTL(FBIOGATTR)
@@ -3900,109 +3859,6 @@ COMPATIBLE_IOCTL(FBIOGCURSOR32) /* This is not implemented yet. Later it should
COMPATIBLE_IOCTL(FBIOSCURPOS)
COMPATIBLE_IOCTL(FBIOGCURPOS)
COMPATIBLE_IOCTL(FBIOGCURMAX)
-COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
-COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
-COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
-COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
-COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
-/* Little f */
-COMPATIBLE_IOCTL(FIOCLEX)
-COMPATIBLE_IOCTL(FIONCLEX)
-COMPATIBLE_IOCTL(FIOASYNC)
-COMPATIBLE_IOCTL(FIONBIO)
-COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
-/* 0x00 */
-COMPATIBLE_IOCTL(FIBMAP)
-COMPATIBLE_IOCTL(FIGETBSZ)
-/* 0x03 -- HD/IDE ioctl's used by hdparm and friends.
- * Some need translations, these do not.
- */
-COMPATIBLE_IOCTL(HDIO_GET_IDENTITY)
-COMPATIBLE_IOCTL(HDIO_SET_DMA)
-COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR)
-COMPATIBLE_IOCTL(HDIO_SET_NOWERR)
-COMPATIBLE_IOCTL(HDIO_SET_32BIT)
-COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT)
-COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
-COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
-COMPATIBLE_IOCTL(HDIO_SET_NICE)
-/* 0x02 -- Floppy ioctls */
-COMPATIBLE_IOCTL(FDMSGON)
-COMPATIBLE_IOCTL(FDMSGOFF)
-COMPATIBLE_IOCTL(FDSETEMSGTRESH)
-COMPATIBLE_IOCTL(FDFLUSH)
-COMPATIBLE_IOCTL(FDWERRORCLR)
-COMPATIBLE_IOCTL(FDSETMAXERRS)
-COMPATIBLE_IOCTL(FDGETMAXERRS)
-COMPATIBLE_IOCTL(FDGETDRVTYP)
-COMPATIBLE_IOCTL(FDEJECT)
-COMPATIBLE_IOCTL(FDCLRPRM)
-COMPATIBLE_IOCTL(FDFMTBEG)
-COMPATIBLE_IOCTL(FDFMTEND)
-COMPATIBLE_IOCTL(FDRESET)
-COMPATIBLE_IOCTL(FDTWADDLE)
-COMPATIBLE_IOCTL(FDFMTTRK)
-COMPATIBLE_IOCTL(FDRAWCMD)
-/* 0x12 */
-COMPATIBLE_IOCTL(BLKROSET)
-COMPATIBLE_IOCTL(BLKROGET)
-COMPATIBLE_IOCTL(BLKRRPART)
-COMPATIBLE_IOCTL(BLKFLSBUF)
-COMPATIBLE_IOCTL(BLKSECTSET)
-COMPATIBLE_IOCTL(BLKSSZGET)
-/* RAID */
-COMPATIBLE_IOCTL(RAID_VERSION)
-COMPATIBLE_IOCTL(GET_ARRAY_INFO)
-COMPATIBLE_IOCTL(GET_DISK_INFO)
-COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
-COMPATIBLE_IOCTL(CLEAR_ARRAY)
-COMPATIBLE_IOCTL(ADD_NEW_DISK)
-COMPATIBLE_IOCTL(HOT_REMOVE_DISK)
-COMPATIBLE_IOCTL(SET_ARRAY_INFO)
-COMPATIBLE_IOCTL(SET_DISK_INFO)
-COMPATIBLE_IOCTL(WRITE_RAID_INFO)
-COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
-COMPATIBLE_IOCTL(PROTECT_ARRAY)
-COMPATIBLE_IOCTL(HOT_ADD_DISK)
-COMPATIBLE_IOCTL(SET_DISK_FAULTY)
-COMPATIBLE_IOCTL(RUN_ARRAY)
-COMPATIBLE_IOCTL(START_ARRAY)
-COMPATIBLE_IOCTL(STOP_ARRAY)
-COMPATIBLE_IOCTL(STOP_ARRAY_RO)
-COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
-
-/* Big K */
-COMPATIBLE_IOCTL(PIO_FONT)
-COMPATIBLE_IOCTL(GIO_FONT)
-COMPATIBLE_IOCTL(KDSIGACCEPT)
-COMPATIBLE_IOCTL(KDGETKEYCODE)
-COMPATIBLE_IOCTL(KDSETKEYCODE)
-COMPATIBLE_IOCTL(KIOCSOUND)
-COMPATIBLE_IOCTL(KDMKTONE)
-COMPATIBLE_IOCTL(KDGKBTYPE)
-COMPATIBLE_IOCTL(KDSETMODE)
-COMPATIBLE_IOCTL(KDGETMODE)
-COMPATIBLE_IOCTL(KDSKBMODE)
-COMPATIBLE_IOCTL(KDGKBMODE)
-COMPATIBLE_IOCTL(KDSKBMETA)
-COMPATIBLE_IOCTL(KDGKBMETA)
-COMPATIBLE_IOCTL(KDGKBENT)
-COMPATIBLE_IOCTL(KDSKBENT)
-COMPATIBLE_IOCTL(KDGKBSENT)
-COMPATIBLE_IOCTL(KDSKBSENT)
-COMPATIBLE_IOCTL(KDGKBDIACR)
-COMPATIBLE_IOCTL(KDKBDREP)
-COMPATIBLE_IOCTL(KDSKBDIACR)
-COMPATIBLE_IOCTL(KDGKBLED)
-COMPATIBLE_IOCTL(KDSKBLED)
-COMPATIBLE_IOCTL(KDGETLED)
-COMPATIBLE_IOCTL(KDSETLED)
-COMPATIBLE_IOCTL(GIO_SCRNMAP)
-COMPATIBLE_IOCTL(PIO_SCRNMAP)
-COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
-COMPATIBLE_IOCTL(PIO_UNISCRNMAP)
-COMPATIBLE_IOCTL(PIO_FONTRESET)
-COMPATIBLE_IOCTL(PIO_UNIMAPCLR)
/* Little k */
COMPATIBLE_IOCTL(KIOCTYPE)
COMPATIBLE_IOCTL(KIOCLAYOUT)
@@ -4014,81 +3870,11 @@ COMPATIBLE_IOCTL(KIOCSLED)
COMPATIBLE_IOCTL(KIOCGLED)
COMPATIBLE_IOCTL(KIOCSRATE)
COMPATIBLE_IOCTL(KIOCGRATE)
-/* Big S */
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
-COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK)
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_ENABLE)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE)
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER)
-COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
-/* Big T */
-COMPATIBLE_IOCTL(TUNSETNOCSUM)
-COMPATIBLE_IOCTL(TUNSETDEBUG)
-COMPATIBLE_IOCTL(TUNSETIFF)
-COMPATIBLE_IOCTL(TUNSETPERSIST)
-COMPATIBLE_IOCTL(TUNSETOWNER)
-/* Big V */
-COMPATIBLE_IOCTL(VT_SETMODE)
-COMPATIBLE_IOCTL(VT_GETMODE)
-COMPATIBLE_IOCTL(VT_GETSTATE)
-COMPATIBLE_IOCTL(VT_OPENQRY)
-COMPATIBLE_IOCTL(VT_ACTIVATE)
-COMPATIBLE_IOCTL(VT_WAITACTIVE)
-COMPATIBLE_IOCTL(VT_RELDISP)
-COMPATIBLE_IOCTL(VT_DISALLOCATE)
-COMPATIBLE_IOCTL(VT_RESIZE)
-COMPATIBLE_IOCTL(VT_RESIZEX)
-COMPATIBLE_IOCTL(VT_LOCKSWITCH)
-COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
-/* Little v */
COMPATIBLE_IOCTL(VUIDSFORMAT)
COMPATIBLE_IOCTL(VUIDGFORMAT)
/* Little v, the video4linux ioctls */
-COMPATIBLE_IOCTL(VIDIOCGCAP)
-COMPATIBLE_IOCTL(VIDIOCGCHAN)
-COMPATIBLE_IOCTL(VIDIOCSCHAN)
-COMPATIBLE_IOCTL(VIDIOCGPICT)
-COMPATIBLE_IOCTL(VIDIOCSPICT)
-COMPATIBLE_IOCTL(VIDIOCCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCKEY)
-COMPATIBLE_IOCTL(VIDIOCGAUDIO)
-COMPATIBLE_IOCTL(VIDIOCSAUDIO)
-COMPATIBLE_IOCTL(VIDIOCSYNC)
-COMPATIBLE_IOCTL(VIDIOCMCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCGMBUF)
-COMPATIBLE_IOCTL(VIDIOCGUNIT)
-COMPATIBLE_IOCTL(VIDIOCGCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCSCAPTURE)
-/* BTTV specific... */
-COMPATIBLE_IOCTL(_IOW('v', BASE_VIDIOCPRIVATE+0, char [256]))
-COMPATIBLE_IOCTL(_IOR('v', BASE_VIDIOCPRIVATE+1, char [256]))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int))
-COMPATIBLE_IOCTL(_IOW('v' , BASE_VIDIOCPRIVATE+3, char [16])) /* struct bttv_pll_info */
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+4, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int))
-/* Little p (/dev/rtc, /dev/envctrl, etc.) */
COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
-COMPATIBLE_IOCTL(RTC_AIE_ON)
-COMPATIBLE_IOCTL(RTC_AIE_OFF)
-COMPATIBLE_IOCTL(RTC_UIE_ON)
-COMPATIBLE_IOCTL(RTC_UIE_OFF)
-COMPATIBLE_IOCTL(RTC_PIE_ON)
-COMPATIBLE_IOCTL(RTC_PIE_OFF)
-COMPATIBLE_IOCTL(RTC_WIE_ON)
-COMPATIBLE_IOCTL(RTC_WIE_OFF)
-COMPATIBLE_IOCTL(RTC_ALM_SET)
-COMPATIBLE_IOCTL(RTC_ALM_READ)
-COMPATIBLE_IOCTL(RTC_RD_TIME)
-COMPATIBLE_IOCTL(RTC_SET_TIME)
-COMPATIBLE_IOCTL(RTC_WKALM_SET)
-COMPATIBLE_IOCTL(RTC_WKALM_RD)
COMPATIBLE_IOCTL(ENVCTRL_RD_WARNING_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_SHUTDOWN_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_TEMPERATURE)
@@ -4102,8 +3888,6 @@ COMPATIBLE_IOCTL(ENVCTRL_RD_GLOBALADDRESS)
/* COMPATIBLE_IOCTL(D7SIOCRD) same value as ENVCTRL_RD_VOLTAGE_STATUS */
COMPATIBLE_IOCTL(D7SIOCWR)
COMPATIBLE_IOCTL(D7SIOCTM)
-/* Little m */
-COMPATIBLE_IOCTL(MTIOCTOP)
/* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have
* embedded pointers in the arg which we'd need to clean up...
*/
@@ -4122,127 +3906,7 @@ COMPATIBLE_IOCTL(OPROMGETBOOTARGS)
COMPATIBLE_IOCTL(OPROMSETCUR)
COMPATIBLE_IOCTL(OPROMPCI2NODE)
COMPATIBLE_IOCTL(OPROMPATH2NODE)
-/* Socket level stuff */
-COMPATIBLE_IOCTL(FIOSETOWN)
-COMPATIBLE_IOCTL(SIOCSPGRP)
-COMPATIBLE_IOCTL(FIOGETOWN)
-COMPATIBLE_IOCTL(SIOCGPGRP)
-COMPATIBLE_IOCTL(SIOCATMARK)
-COMPATIBLE_IOCTL(SIOCSIFLINK)
-COMPATIBLE_IOCTL(SIOCSIFENCAP)
-COMPATIBLE_IOCTL(SIOCGIFENCAP)
-COMPATIBLE_IOCTL(SIOCSIFBR)
-COMPATIBLE_IOCTL(SIOCGIFBR)
-COMPATIBLE_IOCTL(SIOCSARP)
-COMPATIBLE_IOCTL(SIOCGARP)
-COMPATIBLE_IOCTL(SIOCDARP)
-COMPATIBLE_IOCTL(SIOCSRARP)
-COMPATIBLE_IOCTL(SIOCGRARP)
-COMPATIBLE_IOCTL(SIOCDRARP)
-COMPATIBLE_IOCTL(SIOCADDDLCI)
-COMPATIBLE_IOCTL(SIOCDELDLCI)
-COMPATIBLE_IOCTL(SIOCGMIIPHY)
-COMPATIBLE_IOCTL(SIOCGMIIREG)
-COMPATIBLE_IOCTL(SIOCSMIIREG)
-COMPATIBLE_IOCTL(SIOCGIFVLAN)
-COMPATIBLE_IOCTL(SIOCSIFVLAN)
-/* SG stuff */
-COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_EMULATED_HOST)
-COMPATIBLE_IOCTL(SG_SET_TRANSFORM)
-COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
-COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)
-COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE)
-COMPATIBLE_IOCTL(SG_GET_SCSI_ID)
-COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA)
-COMPATIBLE_IOCTL(SG_GET_LOW_DMA)
-COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID)
-COMPATIBLE_IOCTL(SG_GET_PACK_ID)
-COMPATIBLE_IOCTL(SG_GET_NUM_WAITING)
-COMPATIBLE_IOCTL(SG_SET_DEBUG)
-COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE)
-COMPATIBLE_IOCTL(SG_GET_COMMAND_Q)
-COMPATIBLE_IOCTL(SG_SET_COMMAND_Q)
-COMPATIBLE_IOCTL(SG_GET_VERSION_NUM)
-COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN)
-COMPATIBLE_IOCTL(SG_SCSI_RESET)
-COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
-COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
-COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
-/* PPP stuff */
-COMPATIBLE_IOCTL(PPPIOCGFLAGS)
-COMPATIBLE_IOCTL(PPPIOCSFLAGS)
-COMPATIBLE_IOCTL(PPPIOCGASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCGUNIT)
-COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCGMRU)
-COMPATIBLE_IOCTL(PPPIOCSMRU)
-COMPATIBLE_IOCTL(PPPIOCSMAXCID)
-COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCXFERUNIT)
-/* PPPIOCSCOMPRESS is translated */
-COMPATIBLE_IOCTL(PPPIOCGNPMODE)
-COMPATIBLE_IOCTL(PPPIOCSNPMODE)
-/* PPPIOCSPASS is translated */
-/* PPPIOCSACTIVE is translated */
-COMPATIBLE_IOCTL(PPPIOCGDEBUG)
-COMPATIBLE_IOCTL(PPPIOCSDEBUG)
-/* PPPIOCGIDLE is translated */
-COMPATIBLE_IOCTL(PPPIOCNEWUNIT)
-COMPATIBLE_IOCTL(PPPIOCATTACH)
-COMPATIBLE_IOCTL(PPPIOCDETACH)
-COMPATIBLE_IOCTL(PPPIOCSMRRU)
-COMPATIBLE_IOCTL(PPPIOCCONNECT)
-COMPATIBLE_IOCTL(PPPIOCDISCONN)
-COMPATIBLE_IOCTL(PPPIOCATTCHAN)
-COMPATIBLE_IOCTL(PPPIOCGCHAN)
-/* LP */
-COMPATIBLE_IOCTL(LPGETSTATUS)
-/* PPPOX */
-COMPATIBLE_IOCTL(PPPOEIOCSFWD)
-COMPATIBLE_IOCTL(PPPOEIOCDFWD)
-/* CDROM stuff */
-COMPATIBLE_IOCTL(CDROMPAUSE)
-COMPATIBLE_IOCTL(CDROMRESUME)
-COMPATIBLE_IOCTL(CDROMPLAYMSF)
-COMPATIBLE_IOCTL(CDROMPLAYTRKIND)
-COMPATIBLE_IOCTL(CDROMREADTOCHDR)
-COMPATIBLE_IOCTL(CDROMREADTOCENTRY)
-COMPATIBLE_IOCTL(CDROMSTOP)
-COMPATIBLE_IOCTL(CDROMSTART)
-COMPATIBLE_IOCTL(CDROMEJECT)
-COMPATIBLE_IOCTL(CDROMVOLCTRL)
-COMPATIBLE_IOCTL(CDROMSUBCHNL)
-COMPATIBLE_IOCTL(CDROMEJECT_SW)
-COMPATIBLE_IOCTL(CDROMMULTISESSION)
-COMPATIBLE_IOCTL(CDROM_GET_MCN)
-COMPATIBLE_IOCTL(CDROMRESET)
-COMPATIBLE_IOCTL(CDROMVOLREAD)
-COMPATIBLE_IOCTL(CDROMSEEK)
-COMPATIBLE_IOCTL(CDROMPLAYBLK)
-COMPATIBLE_IOCTL(CDROMCLOSETRAY)
-COMPATIBLE_IOCTL(CDROM_SET_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_CLEAR_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_SELECT_SPEED)
-COMPATIBLE_IOCTL(CDROM_SELECT_DISC)
-COMPATIBLE_IOCTL(CDROM_MEDIA_CHANGED)
-COMPATIBLE_IOCTL(CDROM_DRIVE_STATUS)
-COMPATIBLE_IOCTL(CDROM_DISC_STATUS)
-COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS)
-COMPATIBLE_IOCTL(CDROM_LOCKDOOR)
-COMPATIBLE_IOCTL(CDROM_DEBUG)
-COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY)
-/* DVD ioctls */
-COMPATIBLE_IOCTL(DVD_READ_STRUCT)
-COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
-COMPATIBLE_IOCTL(DVD_AUTH)
/* Big L */
-COMPATIBLE_IOCTL(LOOP_SET_FD)
-COMPATIBLE_IOCTL(LOOP_CLR_FD)
COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
/* Big A */
@@ -4252,175 +3916,10 @@ COMPATIBLE_IOCTL(AUDIO_DRAIN)
COMPATIBLE_IOCTL(AUDIO_GETDEV)
COMPATIBLE_IOCTL(AUDIO_GETDEV_SUNOS)
COMPATIBLE_IOCTL(AUDIO_FLUSH)
-/* Big Q for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE)
-COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL)
-COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE)
-/* Big T for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_START)
-COMPATIBLE_IOCTL(SNDCTL_TMR_STOP)
-COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO)
-COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME)
-COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT)
-/* Little m for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD)
-/* Big P for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_DSP_RESET)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED)
-COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS)
-COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_POST)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR)
-/* SNDCTL_DSP_MAPINBUF, XXX needs translation */
-/* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY)
-COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER)
-/* Big C for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_COPR_RESET)
-COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE)
-COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA)
-COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RUN)
-COMPATIBLE_IOCTL(SNDCTL_COPR_HALT)
-COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG)
-/* Big M for sound/OSS */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3)
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR))
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE)
-/* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
-/* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3)
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR))
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE)
-/* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
-/* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC)
-COMPATIBLE_IOCTL(SOUND_MIXER_INFO)
-COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO)
-COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
-COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
-COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
-COMPATIBLE_IOCTL(OSS_GETVERSION)
-/* AUTOFS */
-COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
-COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
-COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
-COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
-COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
-/* DEVFS */
-COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
-COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
/* Raw devices */
COMPATIBLE_IOCTL(RAW_SETBIND)
COMPATIBLE_IOCTL(RAW_GETBIND)
-/* SMB ioctls which do not need any translations */
-COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
/* NCP ioctls which do not need any translations */
COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN)
COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT)
@@ -4433,22 +3932,6 @@ COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS)
COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
-/* Little a */
-COMPATIBLE_IOCTL(ATMSIGD_CTRL)
-COMPATIBLE_IOCTL(ATMARPD_CTRL)
-COMPATIBLE_IOCTL(ATMLEC_CTRL)
-COMPATIBLE_IOCTL(ATMLEC_MCAST)
-COMPATIBLE_IOCTL(ATMLEC_DATA)
-COMPATIBLE_IOCTL(ATM_SETSC)
-COMPATIBLE_IOCTL(SIOCSIFATMTCP)
-COMPATIBLE_IOCTL(SIOCMKCLIP)
-COMPATIBLE_IOCTL(ATMARP_MKIP)
-COMPATIBLE_IOCTL(ATMARP_SETENTRY)
-COMPATIBLE_IOCTL(ATMARP_ENCAP)
-COMPATIBLE_IOCTL(ATMTCP_CREATE)
-COMPATIBLE_IOCTL(ATMTCP_REMOVE)
-COMPATIBLE_IOCTL(ATMMPC_CTRL)
-COMPATIBLE_IOCTL(ATMMPC_DATA)
#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
@@ -4470,42 +3953,9 @@ COMPATIBLE_IOCTL(DRM_IOCTL_LOCK)
COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK)
COMPATIBLE_IOCTL(DRM_IOCTL_FINISH)
#endif /* DRM */
-/* Big W */
-/* WIOC_GETSUPPORT not yet implemented -E */
-COMPATIBLE_IOCTL(WDIOC_GETSTATUS)
-COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS)
-COMPATIBLE_IOCTL(WDIOC_GETTEMP)
-COMPATIBLE_IOCTL(WDIOC_SETOPTIONS)
-COMPATIBLE_IOCTL(WDIOC_KEEPALIVE)
COMPATIBLE_IOCTL(WIOCSTART)
COMPATIBLE_IOCTL(WIOCSTOP)
COMPATIBLE_IOCTL(WIOCGSTAT)
-/* Big R */
-COMPATIBLE_IOCTL(RNDGETENTCNT)
-COMPATIBLE_IOCTL(RNDADDTOENTCNT)
-COMPATIBLE_IOCTL(RNDGETPOOL)
-COMPATIBLE_IOCTL(RNDADDENTROPY)
-COMPATIBLE_IOCTL(RNDZAPENTCNT)
-COMPATIBLE_IOCTL(RNDCLEARPOOL)
-/* Bluetooth ioctls */
-COMPATIBLE_IOCTL(HCIDEVUP)
-COMPATIBLE_IOCTL(HCIDEVDOWN)
-COMPATIBLE_IOCTL(HCIDEVRESET)
-COMPATIBLE_IOCTL(HCIDEVRESTAT)
-COMPATIBLE_IOCTL(HCIGETDEVLIST)
-COMPATIBLE_IOCTL(HCIGETDEVINFO)
-COMPATIBLE_IOCTL(HCIGETCONNLIST)
-COMPATIBLE_IOCTL(HCIGETCONNINFO)
-COMPATIBLE_IOCTL(HCISETRAW)
-COMPATIBLE_IOCTL(HCISETSCAN)
-COMPATIBLE_IOCTL(HCISETAUTH)
-COMPATIBLE_IOCTL(HCISETENCRYPT)
-COMPATIBLE_IOCTL(HCISETPTYPE)
-COMPATIBLE_IOCTL(HCISETLINKPOL)
-COMPATIBLE_IOCTL(HCISETLINKMODE)
-COMPATIBLE_IOCTL(HCISETACLMTU)
-COMPATIBLE_IOCTL(HCISETSCOMTU)
-COMPATIBLE_IOCTL(HCIINQUIRY)
COMPATIBLE_IOCTL(HCIUARTSETPROTO)
COMPATIBLE_IOCTL(HCIUARTGETPROTO)
COMPATIBLE_IOCTL(RFCOMMCREATEDEV)
@@ -4517,42 +3967,6 @@ COMPATIBLE_IOCTL(BNEPCONNADD)
COMPATIBLE_IOCTL(BNEPCONNDEL)
COMPATIBLE_IOCTL(BNEPGETCONNLIST)
COMPATIBLE_IOCTL(BNEPGETCONNINFO)
-/* Misc. */
-COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */
-COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */
-COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
-COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
-/* USB */
-COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
-COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
-COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
-COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
-COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
-COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
-COMPATIBLE_IOCTL(USBDEVFS_RESET)
-COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
-/* MTD */
-COMPATIBLE_IOCTL(MEMGETINFO)
-COMPATIBLE_IOCTL(MEMERASE)
-COMPATIBLE_IOCTL(MEMLOCK)
-COMPATIBLE_IOCTL(MEMUNLOCK)
-COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
-COMPATIBLE_IOCTL(MEMGETREGIONINFO)
-/* NBD */
-COMPATIBLE_IOCTL(NBD_SET_SOCK)
-COMPATIBLE_IOCTL(NBD_SET_BLKSIZE)
-COMPATIBLE_IOCTL(NBD_SET_SIZE)
-COMPATIBLE_IOCTL(NBD_DO_IT)
-COMPATIBLE_IOCTL(NBD_CLEAR_SOCK)
-COMPATIBLE_IOCTL(NBD_CLEAR_QUE)
-COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
-COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS)
-COMPATIBLE_IOCTL(NBD_DISCONNECT)
/* device-mapper */
COMPATIBLE_IOCTL(DM_VERSION)
COMPATIBLE_IOCTL(DM_REMOVE_ALL)
@@ -4741,134 +4155,3 @@ HANDLE_IOCTL(BLKBSZGET_32, do_blkbszget)
HANDLE_IOCTL(BLKBSZSET_32, do_blkbszset)
HANDLE_IOCTL(BLKGETSIZE64_32, do_blkgetsize64)
IOCTL_TABLE_END
-
-unsigned int ioctl32_hash_table[1024];
-
-static inline unsigned long ioctl32_hash(unsigned long cmd)
-{
- return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
-}
-
-static void ioctl32_insert_translation(struct ioctl_trans *trans)
-{
- unsigned long hash;
- struct ioctl_trans *t;
-
- hash = ioctl32_hash (trans->cmd);
- if (!ioctl32_hash_table[hash])
- ioctl32_hash_table[hash] = (u32)(long)trans;
- else {
- t = (struct ioctl_trans *)(long)ioctl32_hash_table[hash];
- while (t->next)
- t = (struct ioctl_trans *)(long)t->next;
- trans->next = 0;
- t->next = (u32)(long)trans;
- }
-}
-
-static int __init init_sys32_ioctl(void)
-{
- int i;
- extern struct ioctl_trans ioctl_translations[], ioctl_translations_end[];
-
- for (i = 0; &ioctl_translations[i] < &ioctl_translations_end[0]; i++)
- ioctl32_insert_translation(&ioctl_translations[i]);
- return 0;
-}
-
-__initcall(init_sys32_ioctl);
-
-static struct ioctl_trans *additional_ioctls;
-
-/* Always call these with kernel lock held! */
-
-int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *))
-{
- int i;
- if (!additional_ioctls) {
- additional_ioctls = vmalloc(PAGE_SIZE);
- if (!additional_ioctls)
- return -ENOMEM;
- memset(additional_ioctls, 0, PAGE_SIZE);
- }
- for (i = 0; i < PAGE_SIZE/sizeof(struct ioctl_trans); i++)
- if (!additional_ioctls[i].cmd)
- break;
- if (i == PAGE_SIZE/sizeof(struct ioctl_trans))
- return -ENOMEM;
- additional_ioctls[i].cmd = cmd;
- if (!handler)
- additional_ioctls[i].handler = (u32)(long)sys_ioctl;
- else
- additional_ioctls[i].handler = (u32)(long)handler;
- ioctl32_insert_translation(&additional_ioctls[i]);
- return 0;
-}
-
-int unregister_ioctl32_conversion(unsigned int cmd)
-{
- unsigned long hash = ioctl32_hash(cmd);
- struct ioctl_trans *t, *t1;
-
- t = (struct ioctl_trans *)(long)ioctl32_hash_table[hash];
- if (!t) return -EINVAL;
- if (t->cmd == cmd && t >= additional_ioctls &&
- (unsigned long)t < ((unsigned long)additional_ioctls) + PAGE_SIZE) {
- ioctl32_hash_table[hash] = t->next;
- t->cmd = 0;
- t->next = 0;
- return 0;
- } else while (t->next) {
- t1 = (struct ioctl_trans *)(long)t->next;
- if (t1->cmd == cmd && t1 >= additional_ioctls &&
- (unsigned long)t1 < ((unsigned long)additional_ioctls) + PAGE_SIZE) {
- t->next = t1->next;
- t1->cmd = 0;
- t1->next = 0;
- return 0;
- }
- t = t1;
- }
- return -EINVAL;
-}
-
-asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- struct file * filp;
- int error = -EBADF;
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- struct ioctl_trans *t;
-
- filp = fget(fd);
- if(!filp)
- goto out2;
-
- if (!filp->f_op || !filp->f_op->ioctl) {
- error = sys_ioctl (fd, cmd, arg);
- goto out;
- }
-
- t = (struct ioctl_trans *)(long)ioctl32_hash_table [ioctl32_hash (cmd)];
-
- while (t && t->cmd != cmd)
- t = (struct ioctl_trans *)(long)t->next;
- if (t) {
- handler = (void *)(long)t->handler;
- error = handler(fd, cmd, arg, filp);
- } else if (cmd >= SIOCDEVPRIVATE &&
- cmd <= (SIOCDEVPRIVATE + 15)) {
- error = siocdevprivate_ioctl(fd, cmd, arg);
- } else {
- static int count;
- if (++count <= 20)
- printk("sys32_ioctl(%s:%d): Unknown cmd fd(%d) "
- "cmd(%08x) arg(%08x)\n",
- current->comm, current->pid,
- (int)fd, (unsigned int)cmd, (unsigned int)arg);
- error = -EINVAL;
- }
-out:
- fput(filp);
-out2:
- return error;
-}
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index bfadb6c43c0e..bcd0af5c9354 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -91,7 +91,7 @@ extern int sys_getgid(void);
extern int svr4_getcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
extern int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-extern int sys32_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
+extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
extern long sparc32_open(const char * filename, int flags, int mode);
extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *));
@@ -319,7 +319,7 @@ EXPORT_SYMBOL(svr4_getcontext);
EXPORT_SYMBOL(svr4_setcontext);
EXPORT_SYMBOL(prom_cpu_nodes);
EXPORT_SYMBOL(sys_ioctl);
-EXPORT_SYMBOL(sys32_ioctl);
+EXPORT_SYMBOL(compat_sys_ioctl);
EXPORT_SYMBOL(sparc32_open);
#endif
diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c
index bb011fa57e9b..c88c963b3985 100644
--- a/arch/sparc64/kernel/sunos_ioctl32.c
+++ b/arch/sparc64/kernel/sunos_ioctl32.c
@@ -92,7 +92,7 @@ struct ifconf32 {
extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
-extern asmlinkage int sys32_ioctl(unsigned int, unsigned int, u32);
+extern asmlinkage int compat_sys_ioctl(unsigned int, unsigned int, u32);
extern asmlinkage int sys_setsid(void);
asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
@@ -127,39 +127,39 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
}
switch(cmd) {
case _IOW('r', 10, struct rtentry32):
- ret = sys32_ioctl(fd, SIOCADDRT, arg);
+ ret = compat_sys_ioctl(fd, SIOCADDRT, arg);
goto out;
case _IOW('r', 11, struct rtentry32):
- ret = sys32_ioctl(fd, SIOCDELRT, arg);
+ ret = compat_sys_ioctl(fd, SIOCDELRT, arg);
goto out;
case _IOW('i', 12, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFADDR, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFADDR, arg);
goto out;
case _IOWR('i', 13, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFADDR, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFADDR, arg);
goto out;
case _IOW('i', 14, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFDSTADDR, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFDSTADDR, arg);
goto out;
case _IOWR('i', 15, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFDSTADDR, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFDSTADDR, arg);
goto out;
case _IOW('i', 16, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFFLAGS, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFFLAGS, arg);
goto out;
case _IOWR('i', 17, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFFLAGS, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFFLAGS, arg);
goto out;
case _IOW('i', 18, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFMEM, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFMEM, arg);
goto out;
case _IOWR('i', 19, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFMEM, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFMEM, arg);
goto out;
case _IOWR('i', 20, struct ifconf32):
- ret = sys32_ioctl(fd, SIOCGIFCONF, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFCONF, arg);
goto out;
case _IOW('i', 21, struct ifreq): /* SIOCSIFMTU */
@@ -170,32 +170,32 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
goto out;
case _IOWR('i', 23, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFBRDADDR, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFBRDADDR, arg);
goto out;
case _IOW('i', 24, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFBRDADDR, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFBRDADDR, arg);
goto out;
case _IOWR('i', 25, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFNETMASK, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFNETMASK, arg);
goto out;
case _IOW('i', 26, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFNETMASK, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFNETMASK, arg);
goto out;
case _IOWR('i', 27, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCGIFMETRIC, arg);
+ ret = compat_sys_ioctl(fd, SIOCGIFMETRIC, arg);
goto out;
case _IOW('i', 28, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCSIFMETRIC, arg);
+ ret = compat_sys_ioctl(fd, SIOCSIFMETRIC, arg);
goto out;
case _IOW('i', 30, struct arpreq):
- ret = sys32_ioctl(fd, SIOCSARP, arg);
+ ret = compat_sys_ioctl(fd, SIOCSARP, arg);
goto out;
case _IOWR('i', 31, struct arpreq):
- ret = sys32_ioctl(fd, SIOCGARP, arg);
+ ret = compat_sys_ioctl(fd, SIOCGARP, arg);
goto out;
case _IOW('i', 32, struct arpreq):
- ret = sys32_ioctl(fd, SIOCDARP, arg);
+ ret = compat_sys_ioctl(fd, SIOCDARP, arg);
goto out;
case _IOW('i', 40, struct ifreq32): /* SIOCUPPER */
@@ -209,10 +209,10 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
goto out;
case _IOW('i', 49, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCADDMULTI, arg);
+ ret = compat_sys_ioctl(fd, SIOCADDMULTI, arg);
goto out;
case _IOW('i', 50, struct ifreq32):
- ret = sys32_ioctl(fd, SIOCDELMULTI, arg);
+ ret = compat_sys_ioctl(fd, SIOCDELMULTI, arg);
goto out;
/* FDDI interface ioctls, unsupported. */
@@ -246,7 +246,7 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
ret = -EFAULT;
if(get_user(oldval, ptr))
goto out;
- ret = sys32_ioctl(fd, cmd, arg);
+ ret = compat_sys_ioctl(fd, cmd, arg);
__get_user(newval, ptr);
if(newval == -1) {
__put_user(oldval, ptr);
@@ -265,7 +265,7 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
ret = -EFAULT;
if(get_user(oldval, ptr))
goto out;
- ret = sys32_ioctl(fd, cmd, arg);
+ ret = compat_sys_ioctl(fd, cmd, arg);
__get_user(newval, ptr);
if(newval == -1) {
__put_user(oldval, ptr);
@@ -277,7 +277,7 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
}
};
- ret = sys32_ioctl(fd, cmd, arg);
+ ret = compat_sys_ioctl(fd, cmd, arg);
/* so stupid... */
ret = (ret == -EINVAL ? -EOPNOTSUPP : ret);
out:
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 7fe8cb31c997..703c5e219b97 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -29,7 +29,7 @@ sys_call_table32:
.word sys_chown, sys_sync, sys_kill, compat_sys_newstat, sys32_sendfile
/*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid
.word sys_umount, sys32_setgid16, sys32_getgid16, sys_signal, sys32_geteuid16
-/*50*/ .word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys32_ioctl
+/*50*/ .word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
.word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve
/*60*/ .word sys_umask, sys_chroot, compat_sys_newfstat, sys_fstat64, sys_getpagesize
.word sys_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
index 370c3d9bdf11..1d1356d3ff8e 100644
--- a/arch/sparc64/solaris/ioctl.c
+++ b/arch/sparc64/solaris/ioctl.c
@@ -23,6 +23,7 @@
#include <linux/netdevice.h>
#include <linux/mtio.h>
#include <linux/time.h>
+#include <linux/compat.h>
#include <net/sock.h>
@@ -35,7 +36,7 @@
extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
unsigned long arg);
-extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd,
+extern asmlinkage int compat_sys_ioctl(unsigned int fd, unsigned int cmd,
u32 arg);
asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
@@ -597,9 +598,9 @@ static inline int solaris_r(unsigned int fd, unsigned int cmd, u32 arg)
{
switch (cmd & 0xff) {
case 10: /* SIOCADDRT */
- return sys32_ioctl(fd, SIOCADDRT, arg);
+ return compat_sys_ioctl(fd, SIOCADDRT, arg);
case 11: /* SIOCDELRT */
- return sys32_ioctl(fd, SIOCDELRT, arg);
+ return compat_sys_ioctl(fd, SIOCDELRT, arg);
}
return -ENOSYS;
}
@@ -608,45 +609,45 @@ static inline int solaris_i(unsigned int fd, unsigned int cmd, u32 arg)
{
switch (cmd & 0xff) {
case 12: /* SIOCSIFADDR */
- return sys32_ioctl(fd, SIOCSIFADDR, arg);
+ return compat_sys_ioctl(fd, SIOCSIFADDR, arg);
case 13: /* SIOCGIFADDR */
- return sys32_ioctl(fd, SIOCGIFADDR, arg);
+ return compat_sys_ioctl(fd, SIOCGIFADDR, arg);
case 14: /* SIOCSIFDSTADDR */
- return sys32_ioctl(fd, SIOCSIFDSTADDR, arg);
+ return compat_sys_ioctl(fd, SIOCSIFDSTADDR, arg);
case 15: /* SIOCGIFDSTADDR */
- return sys32_ioctl(fd, SIOCGIFDSTADDR, arg);
+ return compat_sys_ioctl(fd, SIOCGIFDSTADDR, arg);
case 16: /* SIOCSIFFLAGS */
- return sys32_ioctl(fd, SIOCSIFFLAGS, arg);
+ return compat_sys_ioctl(fd, SIOCSIFFLAGS, arg);
case 17: /* SIOCGIFFLAGS */
- return sys32_ioctl(fd, SIOCGIFFLAGS, arg);
+ return compat_sys_ioctl(fd, SIOCGIFFLAGS, arg);
case 18: /* SIOCSIFMEM */
- return sys32_ioctl(fd, SIOCSIFMEM, arg);
+ return compat_sys_ioctl(fd, SIOCSIFMEM, arg);
case 19: /* SIOCGIFMEM */
- return sys32_ioctl(fd, SIOCGIFMEM, arg);
+ return compat_sys_ioctl(fd, SIOCGIFMEM, arg);
case 20: /* SIOCGIFCONF */
- return sys32_ioctl(fd, SIOCGIFCONF, arg);
+ return compat_sys_ioctl(fd, SIOCGIFCONF, arg);
case 21: /* SIOCSIFMTU */
- return sys32_ioctl(fd, SIOCSIFMTU, arg);
+ return compat_sys_ioctl(fd, SIOCSIFMTU, arg);
case 22: /* SIOCGIFMTU */
- return sys32_ioctl(fd, SIOCGIFMTU, arg);
+ return compat_sys_ioctl(fd, SIOCGIFMTU, arg);
case 23: /* SIOCGIFBRDADDR */
- return sys32_ioctl(fd, SIOCGIFBRDADDR, arg);
+ return compat_sys_ioctl(fd, SIOCGIFBRDADDR, arg);
case 24: /* SIOCSIFBRDADDR */
- return sys32_ioctl(fd, SIOCSIFBRDADDR, arg);
+ return compat_sys_ioctl(fd, SIOCSIFBRDADDR, arg);
case 25: /* SIOCGIFNETMASK */
- return sys32_ioctl(fd, SIOCGIFNETMASK, arg);
+ return compat_sys_ioctl(fd, SIOCGIFNETMASK, arg);
case 26: /* SIOCSIFNETMASK */
- return sys32_ioctl(fd, SIOCSIFNETMASK, arg);
+ return compat_sys_ioctl(fd, SIOCSIFNETMASK, arg);
case 27: /* SIOCGIFMETRIC */
- return sys32_ioctl(fd, SIOCGIFMETRIC, arg);
+ return compat_sys_ioctl(fd, SIOCGIFMETRIC, arg);
case 28: /* SIOCSIFMETRIC */
- return sys32_ioctl(fd, SIOCSIFMETRIC, arg);
+ return compat_sys_ioctl(fd, SIOCSIFMETRIC, arg);
case 30: /* SIOCSARP */
- return sys32_ioctl(fd, SIOCSARP, arg);
+ return compat_sys_ioctl(fd, SIOCSARP, arg);
case 31: /* SIOCGARP */
- return sys32_ioctl(fd, SIOCGARP, arg);
+ return compat_sys_ioctl(fd, SIOCGARP, arg);
case 32: /* SIOCDARP */
- return sys32_ioctl(fd, SIOCDARP, arg);
+ return compat_sys_ioctl(fd, SIOCDARP, arg);
case 52: /* SIOCGETNAME */
case 53: /* SIOCGETPEER */
{
diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
index cb6dbbe4baff..67c5e52aedf2 100644
--- a/arch/sparc64/solaris/timod.c
+++ b/arch/sparc64/solaris/timod.c
@@ -29,8 +29,6 @@
extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
unsigned long arg);
-extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd,
- u32 arg);
asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
static spinlock_t timod_pagelock = SPIN_LOCK_UNLOCKED;
diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
index 812f02c45edc..7c26e3706505 100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ b/arch/x86_64/ia32/ia32_ioctl.c
@@ -683,7 +683,7 @@ static __inline__ void *alloc_user_space(long len)
return (void *)regs->rsp - len;
}
-static int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct ifreq *u_ifreq64;
struct ifreq32 *u_ifreq32 = (struct ifreq32 *) arg;
@@ -3581,567 +3581,21 @@ static int mtrr_ioctl32(unsigned int fd, unsigned int cmd, unsigned long arg)
return err;
}
-struct ioctl_trans {
- unsigned long cmd;
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- struct ioctl_trans *next;
-};
-
#define REF_SYMBOL(handler) if (0) (void)handler;
#define HANDLE_IOCTL2(cmd,handler) REF_SYMBOL(handler); asm volatile(".quad %c0, " #handler ",0"::"i" (cmd));
#define HANDLE_IOCTL(cmd,handler) HANDLE_IOCTL2(cmd,handler)
#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
-#define IOCTL_TABLE_START void ioctl_dummy(void) { asm volatile("\nioctl_start:\n\t" );
-#define IOCTL_TABLE_END asm volatile("\nioctl_end:"); }
+#define IOCTL_TABLE_START void ioctl_dummy(void) { asm volatile("\n.global ioctl_start\nioctl_start:\n\t" );
+#define IOCTL_TABLE_END asm volatile("\n.global ioctl_end;\nioctl_end:\n"); }
IOCTL_TABLE_START
-/* List here explicitly which ioctl's are known to have
- * compatible types passed or none at all...
- */
-/* Big T */
-COMPATIBLE_IOCTL(TCGETA)
-COMPATIBLE_IOCTL(TCSETA)
-COMPATIBLE_IOCTL(TCSETAW)
-COMPATIBLE_IOCTL(TCSETAF)
-COMPATIBLE_IOCTL(TCSBRK)
-COMPATIBLE_IOCTL(TCXONC)
-COMPATIBLE_IOCTL(TCFLSH)
-COMPATIBLE_IOCTL(TCGETS)
-COMPATIBLE_IOCTL(TCSETS)
-COMPATIBLE_IOCTL(TCSETSW)
-COMPATIBLE_IOCTL(TCSETSF)
-COMPATIBLE_IOCTL(TIOCLINUX)
-/* Little t */
-COMPATIBLE_IOCTL(TIOCGETD)
-COMPATIBLE_IOCTL(TIOCSETD)
-COMPATIBLE_IOCTL(TIOCEXCL)
-COMPATIBLE_IOCTL(TIOCNXCL)
-COMPATIBLE_IOCTL(TIOCCONS)
-COMPATIBLE_IOCTL(TIOCGSOFTCAR)
-COMPATIBLE_IOCTL(TIOCSSOFTCAR)
-COMPATIBLE_IOCTL(TIOCSWINSZ)
-COMPATIBLE_IOCTL(TIOCGWINSZ)
-COMPATIBLE_IOCTL(TIOCMGET)
-COMPATIBLE_IOCTL(TIOCMBIC)
-COMPATIBLE_IOCTL(TIOCMBIS)
-COMPATIBLE_IOCTL(TIOCMSET)
-COMPATIBLE_IOCTL(TIOCPKT)
-COMPATIBLE_IOCTL(TIOCNOTTY)
-COMPATIBLE_IOCTL(TIOCSTI)
-COMPATIBLE_IOCTL(TIOCOUTQ)
-COMPATIBLE_IOCTL(TIOCSPGRP)
-COMPATIBLE_IOCTL(TIOCGPGRP)
-COMPATIBLE_IOCTL(TIOCSCTTY)
-COMPATIBLE_IOCTL(TIOCGPTN)
-COMPATIBLE_IOCTL(TIOCSPTLCK)
-COMPATIBLE_IOCTL(TIOCSERGETLSR)
-/* Big F */
-COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
-COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
-COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
-COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
-COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
-/* Little f */
-COMPATIBLE_IOCTL(FIOCLEX)
-COMPATIBLE_IOCTL(FIONCLEX)
-COMPATIBLE_IOCTL(FIOASYNC)
-COMPATIBLE_IOCTL(FIONBIO)
-COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
-/* 0x00 */
-COMPATIBLE_IOCTL(FIBMAP)
-COMPATIBLE_IOCTL(FIGETBSZ)
-/* 0x03 -- HD/IDE ioctl's used by hdparm and friends.
- * Some need translations, these do not.
- */
-COMPATIBLE_IOCTL(HDIO_GET_IDENTITY)
-COMPATIBLE_IOCTL(HDIO_SET_DMA)
+#include <linux/compat_ioctl.h>
COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
-COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR)
-COMPATIBLE_IOCTL(HDIO_SET_NOWERR)
-COMPATIBLE_IOCTL(HDIO_SET_32BIT)
-COMPATIBLE_IOCTL(HDIO_SET_MULTCOUNT)
-COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
-COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
-COMPATIBLE_IOCTL(HDIO_SET_NICE)
-/* 0x02 -- Floppy ioctls */
-COMPATIBLE_IOCTL(FDMSGON)
-COMPATIBLE_IOCTL(FDMSGOFF)
-COMPATIBLE_IOCTL(FDSETEMSGTRESH)
-COMPATIBLE_IOCTL(FDFLUSH)
-COMPATIBLE_IOCTL(FDWERRORCLR)
-COMPATIBLE_IOCTL(FDSETMAXERRS)
-COMPATIBLE_IOCTL(FDGETMAXERRS)
-COMPATIBLE_IOCTL(FDGETDRVTYP)
-COMPATIBLE_IOCTL(FDEJECT)
-COMPATIBLE_IOCTL(FDCLRPRM)
-COMPATIBLE_IOCTL(FDFMTBEG)
-COMPATIBLE_IOCTL(FDFMTEND)
-COMPATIBLE_IOCTL(FDRESET)
-COMPATIBLE_IOCTL(FDTWADDLE)
-COMPATIBLE_IOCTL(FDFMTTRK)
-COMPATIBLE_IOCTL(FDRAWCMD)
-/* 0x12 */
-COMPATIBLE_IOCTL(BLKROSET)
-COMPATIBLE_IOCTL(BLKROGET)
-COMPATIBLE_IOCTL(BLKRRPART)
-COMPATIBLE_IOCTL(BLKFLSBUF)
COMPATIBLE_IOCTL(BLKRASET)
COMPATIBLE_IOCTL(BLKFRASET)
-COMPATIBLE_IOCTL(BLKSECTSET)
-COMPATIBLE_IOCTL(BLKSSZGET)
-/* RAID */
-COMPATIBLE_IOCTL(RAID_VERSION)
-COMPATIBLE_IOCTL(GET_ARRAY_INFO)
-COMPATIBLE_IOCTL(GET_DISK_INFO)
-COMPATIBLE_IOCTL(PRINT_RAID_DEBUG)
-COMPATIBLE_IOCTL(CLEAR_ARRAY)
-COMPATIBLE_IOCTL(ADD_NEW_DISK)
-COMPATIBLE_IOCTL(HOT_REMOVE_DISK)
-COMPATIBLE_IOCTL(SET_ARRAY_INFO)
-COMPATIBLE_IOCTL(SET_DISK_INFO)
-COMPATIBLE_IOCTL(WRITE_RAID_INFO)
-COMPATIBLE_IOCTL(UNPROTECT_ARRAY)
-COMPATIBLE_IOCTL(PROTECT_ARRAY)
-COMPATIBLE_IOCTL(HOT_ADD_DISK)
-COMPATIBLE_IOCTL(SET_DISK_FAULTY)
-COMPATIBLE_IOCTL(RUN_ARRAY)
-COMPATIBLE_IOCTL(START_ARRAY)
-COMPATIBLE_IOCTL(STOP_ARRAY)
-COMPATIBLE_IOCTL(STOP_ARRAY_RO)
-COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
-/* Big K */
-COMPATIBLE_IOCTL(PIO_FONT)
-COMPATIBLE_IOCTL(GIO_FONT)
-COMPATIBLE_IOCTL(KDSIGACCEPT)
-COMPATIBLE_IOCTL(KDGETKEYCODE)
-COMPATIBLE_IOCTL(KDSETKEYCODE)
-COMPATIBLE_IOCTL(KIOCSOUND)
-COMPATIBLE_IOCTL(KDMKTONE)
-COMPATIBLE_IOCTL(KDGKBTYPE)
-COMPATIBLE_IOCTL(KDSETMODE)
-COMPATIBLE_IOCTL(KDGETMODE)
-COMPATIBLE_IOCTL(KDSKBMODE)
-COMPATIBLE_IOCTL(KDGKBMODE)
-COMPATIBLE_IOCTL(KDSKBMETA)
-COMPATIBLE_IOCTL(KDGKBMETA)
-COMPATIBLE_IOCTL(KDGKBENT)
-COMPATIBLE_IOCTL(KDSKBENT)
-COMPATIBLE_IOCTL(KDGKBSENT)
-COMPATIBLE_IOCTL(KDSKBSENT)
-COMPATIBLE_IOCTL(KDGKBDIACR)
-COMPATIBLE_IOCTL(KDSKBDIACR)
-COMPATIBLE_IOCTL(KDKBDREP)
-COMPATIBLE_IOCTL(KDGKBLED)
-COMPATIBLE_IOCTL(KDSKBLED)
-COMPATIBLE_IOCTL(KDGETLED)
-COMPATIBLE_IOCTL(KDSETLED)
-COMPATIBLE_IOCTL(GIO_SCRNMAP)
-COMPATIBLE_IOCTL(PIO_SCRNMAP)
-COMPATIBLE_IOCTL(GIO_UNISCRNMAP)
-COMPATIBLE_IOCTL(PIO_UNISCRNMAP)
-COMPATIBLE_IOCTL(PIO_FONTRESET)
-COMPATIBLE_IOCTL(PIO_UNIMAPCLR)
-/* Big S */
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK)
-COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_ENABLE)
-COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE)
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER)
-COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
-COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
-COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
-/* Big T */
-COMPATIBLE_IOCTL(TUNSETNOCSUM)
-COMPATIBLE_IOCTL(TUNSETDEBUG)
-COMPATIBLE_IOCTL(TUNSETIFF)
-COMPATIBLE_IOCTL(TUNSETPERSIST)
-COMPATIBLE_IOCTL(TUNSETOWNER)
-/* Big V */
-COMPATIBLE_IOCTL(VT_SETMODE)
-COMPATIBLE_IOCTL(VT_GETMODE)
-COMPATIBLE_IOCTL(VT_GETSTATE)
-COMPATIBLE_IOCTL(VT_OPENQRY)
-COMPATIBLE_IOCTL(VT_ACTIVATE)
-COMPATIBLE_IOCTL(VT_WAITACTIVE)
-COMPATIBLE_IOCTL(VT_RELDISP)
-COMPATIBLE_IOCTL(VT_DISALLOCATE)
-COMPATIBLE_IOCTL(VT_RESIZE)
-COMPATIBLE_IOCTL(VT_RESIZEX)
-COMPATIBLE_IOCTL(VT_LOCKSWITCH)
-COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
-/* Little v */
-/* Little v, the video4linux ioctls (conflict?) */
-COMPATIBLE_IOCTL(VIDIOCGCAP)
-COMPATIBLE_IOCTL(VIDIOCGCHAN)
-COMPATIBLE_IOCTL(VIDIOCSCHAN)
-COMPATIBLE_IOCTL(VIDIOCGPICT)
-COMPATIBLE_IOCTL(VIDIOCSPICT)
-COMPATIBLE_IOCTL(VIDIOCCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCKEY)
-COMPATIBLE_IOCTL(VIDIOCGAUDIO)
-COMPATIBLE_IOCTL(VIDIOCSAUDIO)
-COMPATIBLE_IOCTL(VIDIOCSYNC)
-COMPATIBLE_IOCTL(VIDIOCMCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCGMBUF)
-COMPATIBLE_IOCTL(VIDIOCGUNIT)
-COMPATIBLE_IOCTL(VIDIOCGCAPTURE)
-COMPATIBLE_IOCTL(VIDIOCSCAPTURE)
-/* BTTV specific... */
-COMPATIBLE_IOCTL(_IOW('v', BASE_VIDIOCPRIVATE+0, char [256]))
-COMPATIBLE_IOCTL(_IOR('v', BASE_VIDIOCPRIVATE+1, char [256]))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int))
-COMPATIBLE_IOCTL(_IOW('v' , BASE_VIDIOCPRIVATE+3, char [16])) /* struct bttv_pll_info */
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+4, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+5, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+6, int))
-COMPATIBLE_IOCTL(_IOR('v' , BASE_VIDIOCPRIVATE+7, int))
-/* Little p (/dev/rtc, /dev/envctrl, etc.) */
-COMPATIBLE_IOCTL(RTC_AIE_ON)
-COMPATIBLE_IOCTL(RTC_AIE_OFF)
-COMPATIBLE_IOCTL(RTC_UIE_ON)
-COMPATIBLE_IOCTL(RTC_UIE_OFF)
-COMPATIBLE_IOCTL(RTC_PIE_ON)
-COMPATIBLE_IOCTL(RTC_PIE_OFF)
-COMPATIBLE_IOCTL(RTC_WIE_ON)
-COMPATIBLE_IOCTL(RTC_WIE_OFF)
-COMPATIBLE_IOCTL(RTC_ALM_SET)
-COMPATIBLE_IOCTL(RTC_ALM_READ)
-COMPATIBLE_IOCTL(RTC_RD_TIME)
-COMPATIBLE_IOCTL(RTC_SET_TIME)
-COMPATIBLE_IOCTL(RTC_WKALM_SET)
-COMPATIBLE_IOCTL(RTC_WKALM_RD)
-/* Little m */
-COMPATIBLE_IOCTL(MTIOCTOP)
-/* Socket level stuff */
-COMPATIBLE_IOCTL(FIOSETOWN)
-COMPATIBLE_IOCTL(SIOCSPGRP)
-COMPATIBLE_IOCTL(FIOGETOWN)
-COMPATIBLE_IOCTL(SIOCGPGRP)
-COMPATIBLE_IOCTL(SIOCATMARK)
-COMPATIBLE_IOCTL(SIOCSIFLINK)
-COMPATIBLE_IOCTL(SIOCSIFENCAP)
-COMPATIBLE_IOCTL(SIOCGIFENCAP)
-COMPATIBLE_IOCTL(SIOCSIFBR)
-COMPATIBLE_IOCTL(SIOCGIFBR)
-COMPATIBLE_IOCTL(SIOCSARP)
-COMPATIBLE_IOCTL(SIOCGARP)
-COMPATIBLE_IOCTL(SIOCDARP)
-COMPATIBLE_IOCTL(SIOCSRARP)
-COMPATIBLE_IOCTL(SIOCGRARP)
-COMPATIBLE_IOCTL(SIOCDRARP)
-COMPATIBLE_IOCTL(SIOCADDDLCI)
-COMPATIBLE_IOCTL(SIOCDELDLCI)
-COMPATIBLE_IOCTL(SIOCGMIIPHY)
-COMPATIBLE_IOCTL(SIOCGMIIREG)
-COMPATIBLE_IOCTL(SIOCSMIIREG)
-COMPATIBLE_IOCTL(SIOCGIFVLAN)
-COMPATIBLE_IOCTL(SIOCSIFVLAN)
-/* SG stuff */
-COMPATIBLE_IOCTL(SG_SET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_GET_TIMEOUT)
-COMPATIBLE_IOCTL(SG_EMULATED_HOST)
-COMPATIBLE_IOCTL(SG_SET_TRANSFORM)
-COMPATIBLE_IOCTL(SG_GET_TRANSFORM)
-COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE)
-COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE)
-COMPATIBLE_IOCTL(SG_GET_SCSI_ID)
-COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA)
-COMPATIBLE_IOCTL(SG_GET_LOW_DMA)
-COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID)
-COMPATIBLE_IOCTL(SG_GET_PACK_ID)
-COMPATIBLE_IOCTL(SG_GET_NUM_WAITING)
-COMPATIBLE_IOCTL(SG_SET_DEBUG)
-COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE)
-COMPATIBLE_IOCTL(SG_GET_COMMAND_Q)
-COMPATIBLE_IOCTL(SG_SET_COMMAND_Q)
-COMPATIBLE_IOCTL(SG_GET_VERSION_NUM)
-COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN)
-COMPATIBLE_IOCTL(SG_SCSI_RESET)
-COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE)
-COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN)
-COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN)
-/* PPP stuff */
-COMPATIBLE_IOCTL(PPPIOCGFLAGS)
-COMPATIBLE_IOCTL(PPPIOCSFLAGS)
-COMPATIBLE_IOCTL(PPPIOCGASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCGUNIT)
-COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCGMRU)
-COMPATIBLE_IOCTL(PPPIOCSMRU)
-COMPATIBLE_IOCTL(PPPIOCSMAXCID)
-COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP)
-COMPATIBLE_IOCTL(PPPIOCXFERUNIT)
-/* PPPIOCSCOMPRESS is translated */
-COMPATIBLE_IOCTL(PPPIOCGNPMODE)
-COMPATIBLE_IOCTL(PPPIOCSNPMODE)
-COMPATIBLE_IOCTL(PPPIOCGDEBUG)
-COMPATIBLE_IOCTL(PPPIOCSDEBUG)
-/* PPPIOCSPASS is translated */
-/* PPPIOCSACTIVE is translated */
-/* PPPIOCGIDLE is translated */
-COMPATIBLE_IOCTL(PPPIOCNEWUNIT)
-COMPATIBLE_IOCTL(PPPIOCATTACH)
-COMPATIBLE_IOCTL(PPPIOCDETACH)
-COMPATIBLE_IOCTL(PPPIOCSMRRU)
-COMPATIBLE_IOCTL(PPPIOCCONNECT)
-COMPATIBLE_IOCTL(PPPIOCDISCONN)
-COMPATIBLE_IOCTL(PPPIOCATTCHAN)
-COMPATIBLE_IOCTL(PPPIOCGCHAN)
-/* PPPOX */
-COMPATIBLE_IOCTL(PPPOEIOCSFWD)
-COMPATIBLE_IOCTL(PPPOEIOCDFWD)
-/* LP */
-COMPATIBLE_IOCTL(LPGETSTATUS)
-/* CDROM stuff */
-COMPATIBLE_IOCTL(CDROMPAUSE)
-COMPATIBLE_IOCTL(CDROMRESUME)
-COMPATIBLE_IOCTL(CDROMPLAYMSF)
-COMPATIBLE_IOCTL(CDROMPLAYTRKIND)
-COMPATIBLE_IOCTL(CDROMREADTOCHDR)
-COMPATIBLE_IOCTL(CDROMREADTOCENTRY)
-COMPATIBLE_IOCTL(CDROMSTOP)
-COMPATIBLE_IOCTL(CDROMSTART)
-COMPATIBLE_IOCTL(CDROMEJECT)
-COMPATIBLE_IOCTL(CDROMVOLCTRL)
-COMPATIBLE_IOCTL(CDROMSUBCHNL)
-COMPATIBLE_IOCTL(CDROMEJECT_SW)
-COMPATIBLE_IOCTL(CDROMMULTISESSION)
-COMPATIBLE_IOCTL(CDROM_GET_MCN)
-COMPATIBLE_IOCTL(CDROMRESET)
-COMPATIBLE_IOCTL(CDROMVOLREAD)
-COMPATIBLE_IOCTL(CDROMSEEK)
-COMPATIBLE_IOCTL(CDROMPLAYBLK)
-COMPATIBLE_IOCTL(CDROMCLOSETRAY)
-COMPATIBLE_IOCTL(CDROM_SET_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_CLEAR_OPTIONS)
-COMPATIBLE_IOCTL(CDROM_SELECT_SPEED)
-COMPATIBLE_IOCTL(CDROM_SELECT_DISC)
-COMPATIBLE_IOCTL(CDROM_MEDIA_CHANGED)
-COMPATIBLE_IOCTL(CDROM_DRIVE_STATUS)
-COMPATIBLE_IOCTL(CDROM_DISC_STATUS)
-COMPATIBLE_IOCTL(CDROM_CHANGER_NSLOTS)
-COMPATIBLE_IOCTL(CDROM_LOCKDOOR)
-COMPATIBLE_IOCTL(CDROM_DEBUG)
-COMPATIBLE_IOCTL(CDROM_GET_CAPABILITY)
-/* DVD ioctls */
-COMPATIBLE_IOCTL(DVD_READ_STRUCT)
-COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
-COMPATIBLE_IOCTL(DVD_AUTH)
-/* Big L */
-COMPATIBLE_IOCTL(LOOP_SET_FD)
-COMPATIBLE_IOCTL(LOOP_CLR_FD)
-/* Big A */
-/* sparc only */
-/* Big Q for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE)
-COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL)
-COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND)
-COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL)
-COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE)
-/* Big T for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_START)
-COMPATIBLE_IOCTL(SNDCTL_TMR_STOP)
-COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO)
-COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE)
-COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME)
-COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT)
-/* Little m for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE)
-COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD)
-/* Big P for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_DSP_RESET)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED)
-COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS)
-COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_POST)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE)
-COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR)
-/* SNDCTL_DSP_MAPINBUF, XXX needs translation */
-/* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO)
-COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX)
-COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY)
-COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS)
-COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER)
-/* Big C for sound/OSS */
-COMPATIBLE_IOCTL(SNDCTL_COPR_RESET)
-COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE)
-COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA)
-COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RUN)
-COMPATIBLE_IOCTL(SNDCTL_COPR_HALT)
-COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG)
-COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG)
-/* Big M for sound/OSS */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3)
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO))
-COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR))
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE)
-/* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
-/* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS)
-COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3)
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO))
-COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR))
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE)
-/* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
-/* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
-COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC)
-COMPATIBLE_IOCTL(SOUND_MIXER_INFO)
-COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO)
-COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4)
-COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
-COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
-COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
-COMPATIBLE_IOCTL(OSS_GETVERSION)
-/* AUTOFS */
-COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
-COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
-COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
-COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
-COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
-COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
-/* DEVFS */
-COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
-COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
-COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
-/* SMB ioctls which do not need any translations */
-COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
-/* Little a */
-COMPATIBLE_IOCTL(ATMSIGD_CTRL)
-COMPATIBLE_IOCTL(ATMARPD_CTRL)
-COMPATIBLE_IOCTL(ATMLEC_CTRL)
-COMPATIBLE_IOCTL(ATMLEC_MCAST)
-COMPATIBLE_IOCTL(ATMLEC_DATA)
-COMPATIBLE_IOCTL(ATM_SETSC)
-COMPATIBLE_IOCTL(SIOCSIFATMTCP)
-COMPATIBLE_IOCTL(SIOCMKCLIP)
-COMPATIBLE_IOCTL(ATMARP_MKIP)
-COMPATIBLE_IOCTL(ATMARP_SETENTRY)
-COMPATIBLE_IOCTL(ATMARP_ENCAP)
-COMPATIBLE_IOCTL(ATMTCP_CREATE)
-COMPATIBLE_IOCTL(ATMTCP_REMOVE)
-COMPATIBLE_IOCTL(ATMMPC_CTRL)
-COMPATIBLE_IOCTL(ATMMPC_DATA)
-#if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
-/* 0xfe - lvm */
-COMPATIBLE_IOCTL(VG_SET_EXTENDABLE)
-COMPATIBLE_IOCTL(VG_STATUS_GET_COUNT)
-COMPATIBLE_IOCTL(VG_STATUS_GET_NAMELIST)
-COMPATIBLE_IOCTL(VG_REMOVE)
-COMPATIBLE_IOCTL(VG_RENAME)
-COMPATIBLE_IOCTL(VG_REDUCE)
-COMPATIBLE_IOCTL(PE_LOCK_UNLOCK)
-COMPATIBLE_IOCTL(PV_FLUSH)
-COMPATIBLE_IOCTL(LVM_LOCK_LVM)
-COMPATIBLE_IOCTL(LVM_GET_IOP_VERSION)
-#ifdef LVM_TOTAL_RESET
-COMPATIBLE_IOCTL(LVM_RESET)
-#endif
-COMPATIBLE_IOCTL(LV_SET_ACCESS)
-COMPATIBLE_IOCTL(LV_SET_STATUS)
-COMPATIBLE_IOCTL(LV_SET_ALLOCATION)
-COMPATIBLE_IOCTL(LE_REMAP)
-COMPATIBLE_IOCTL(LV_BMAP)
-COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE)
-#endif /* LVM */
+COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
+COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
#ifdef CONFIG_AUTOFS_FS
COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
@@ -4149,6 +3603,7 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
COMPATIBLE_IOCTL(AUTOFS_IOC_SETTIMEOUT)
COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
+COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
#endif
#ifdef CONFIG_RTC
COMPATIBLE_IOCTL(RTC_AIE_ON)
@@ -4166,44 +3621,6 @@ COMPATIBLE_IOCTL(RTC_SET_TIME)
COMPATIBLE_IOCTL(RTC_WKALM_SET)
COMPATIBLE_IOCTL(RTC_WKALM_RD)
#endif
-/* Big W */
-/* WIOC_GETSUPPORT not yet implemented -E */
-COMPATIBLE_IOCTL(WDIOC_GETSTATUS)
-COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS)
-COMPATIBLE_IOCTL(WDIOC_GETTEMP)
-COMPATIBLE_IOCTL(WDIOC_SETOPTIONS)
-COMPATIBLE_IOCTL(WDIOC_KEEPALIVE)
-#if 0 /* sparc only ? */
-COMPATIBLE_IOCTL(WIOCSTART)
-COMPATIBLE_IOCTL(WIOCSTOP)
-COMPATIBLE_IOCTL(WIOCGSTAT)
-#endif
-/* Big R */
-COMPATIBLE_IOCTL(RNDGETENTCNT)
-COMPATIBLE_IOCTL(RNDADDTOENTCNT)
-COMPATIBLE_IOCTL(RNDGETPOOL)
-COMPATIBLE_IOCTL(RNDADDENTROPY)
-COMPATIBLE_IOCTL(RNDZAPENTCNT)
-COMPATIBLE_IOCTL(RNDCLEARPOOL)
-/* Bluetooth ioctls */
-COMPATIBLE_IOCTL(HCIDEVUP)
-COMPATIBLE_IOCTL(HCIDEVDOWN)
-COMPATIBLE_IOCTL(HCIDEVRESET)
-COMPATIBLE_IOCTL(HCIDEVRESTAT)
-COMPATIBLE_IOCTL(HCIGETDEVLIST)
-COMPATIBLE_IOCTL(HCIGETDEVINFO)
-COMPATIBLE_IOCTL(HCIGETCONNLIST)
-COMPATIBLE_IOCTL(HCIGETCONNINFO)
-COMPATIBLE_IOCTL(HCISETRAW)
-COMPATIBLE_IOCTL(HCISETSCAN)
-COMPATIBLE_IOCTL(HCISETAUTH)
-COMPATIBLE_IOCTL(HCISETENCRYPT)
-COMPATIBLE_IOCTL(HCISETPTYPE)
-COMPATIBLE_IOCTL(HCISETLINKPOL)
-COMPATIBLE_IOCTL(HCISETLINKMODE)
-COMPATIBLE_IOCTL(HCISETACLMTU)
-COMPATIBLE_IOCTL(HCISETSCOMTU)
-COMPATIBLE_IOCTL(HCIINQUIRY)
COMPATIBLE_IOCTL(HCIUARTSETPROTO)
COMPATIBLE_IOCTL(HCIUARTGETPROTO)
COMPATIBLE_IOCTL(RFCOMMCREATEDEV)
@@ -4215,44 +3632,7 @@ COMPATIBLE_IOCTL(BNEPCONNADD)
COMPATIBLE_IOCTL(BNEPCONNDEL)
COMPATIBLE_IOCTL(BNEPGETCONNLIST)
COMPATIBLE_IOCTL(BNEPGETCONNINFO)
-/* Misc. */
-COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */
-COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */
-COMPATIBLE_IOCTL(PCIIOC_CONTROLLER)
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO)
-COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM)
-COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE)
-COMPATIBLE_IOCTL(0x4B50); /* KDGHWCLK - not in the kernel, but don't complain */
-COMPATIBLE_IOCTL(0x4B51); /* KDSHWCLK - not in the kernel, but don't complain */
-/* USB */
-COMPATIBLE_IOCTL(USBDEVFS_RESETEP)
-COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION)
-COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER)
-COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB)
-COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE)
-COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO)
-COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO)
-COMPATIBLE_IOCTL(USBDEVFS_RESET)
-COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT)
-/* MTD */
-COMPATIBLE_IOCTL(MEMGETINFO)
-COMPATIBLE_IOCTL(MEMERASE)
-COMPATIBLE_IOCTL(MEMLOCK)
-COMPATIBLE_IOCTL(MEMUNLOCK)
-COMPATIBLE_IOCTL(MEMGETREGIONCOUNT)
-COMPATIBLE_IOCTL(MEMGETREGIONINFO)
-/* NBD */
-COMPATIBLE_IOCTL(NBD_SET_SOCK)
-COMPATIBLE_IOCTL(NBD_SET_BLKSIZE)
-COMPATIBLE_IOCTL(NBD_SET_SIZE)
-COMPATIBLE_IOCTL(NBD_DO_IT)
-COMPATIBLE_IOCTL(NBD_CLEAR_SOCK)
-COMPATIBLE_IOCTL(NBD_CLEAR_QUE)
-COMPATIBLE_IOCTL(NBD_PRINT_DEBUG)
-COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS)
-COMPATIBLE_IOCTL(NBD_DISCONNECT)
+
/* And these ioctls need translation */
HANDLE_IOCTL(TIOCGDEV, tiocgdev)
HANDLE_IOCTL(TIOCGSERIAL, serial_struct_ioctl)
@@ -4447,217 +3827,3 @@ HANDLE_IOCTL(MTRRIOC32_GET_PAGE_ENTRY, mtrr_ioctl32)
HANDLE_IOCTL(MTRRIOC32_KILL_PAGE_ENTRY, mtrr_ioctl32)
IOCTL_TABLE_END
-#define IOCTL_HASHSIZE 256
-struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE];
-
-extern struct ioctl_trans ioctl_start[], ioctl_end[];
-
-extern struct ioctl_trans ioctl_start[], ioctl_end[];
-
-static inline unsigned long ioctl32_hash(unsigned long cmd)
-{
- return (((cmd >> 6) ^ (cmd >> 4) ^ cmd)) % IOCTL_HASHSIZE;
-}
-
-static void ioctl32_insert_translation(struct ioctl_trans *trans)
-{
- unsigned long hash;
- struct ioctl_trans *t;
-
- hash = ioctl32_hash (trans->cmd);
- if (!ioctl32_hash_table[hash])
- ioctl32_hash_table[hash] = trans;
- else {
- t = ioctl32_hash_table[hash];
- while (t->next)
- t = t->next;
- trans->next = 0;
- t->next = trans;
- }
-}
-
-static int __init init_sys32_ioctl(void)
-{
- int i;
-
- for (i = 0; &ioctl_start[i] < &ioctl_end[0]; i++) {
- if (ioctl_start[i].next != 0) {
- printk("ioctl translation %d bad\n",i);
- return -1;
- }
-
- ioctl32_insert_translation(&ioctl_start[i]);
- }
- return 0;
-}
-
-__initcall(init_sys32_ioctl);
-
-static struct ioctl_trans *ioctl_free_list;
-
-/* Never free them really. This avoids SMP races. With a Read-Copy-Update
- enabled kernel we could just use the RCU infrastructure for this. */
-static void free_ioctl(struct ioctl_trans *t)
-{
- t->cmd = 0;
- mb();
- t->next = ioctl_free_list;
- ioctl_free_list = t;
-}
-
-int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *))
-{
- struct ioctl_trans *t;
- unsigned long hash = ioctl32_hash(cmd);
-
- lock_kernel();
- for (t = (struct ioctl_trans *)ioctl32_hash_table[hash];
- t;
- t = t->next) {
- if (t->cmd == cmd) {
- printk("Trying to register duplicated ioctl32 handler %x\n", cmd);
- unlock_kernel();
- return -EINVAL;
- }
- }
-
- if (ioctl_free_list) {
- t = ioctl_free_list;
- ioctl_free_list = t->next;
- } else {
- t = kmalloc(sizeof(struct ioctl_trans), GFP_KERNEL);
- if (!t) {
- unlock_kernel();
- return -ENOMEM;
- }
- }
-
- t->next = NULL;
- t->cmd = cmd;
- t->handler = handler;
- ioctl32_insert_translation(t);
-
- unlock_kernel();
- return 0;
-}
-
-static inline int builtin_ioctl(struct ioctl_trans *t)
-{
- return t >= (struct ioctl_trans *)ioctl_start &&
- t < (struct ioctl_trans *)ioctl_end;
-}
-
-/* Problem:
- This function cannot unregister duplicate ioctls, because they are not
- unique.
- When they happen we need to extend the prototype to pass the handler too. */
-
-int unregister_ioctl32_conversion(unsigned int cmd)
-{
- unsigned long hash = ioctl32_hash(cmd);
- struct ioctl_trans *t, *t1;
-
- lock_kernel();
-
- t = (struct ioctl_trans *)ioctl32_hash_table[hash];
- if (!t) {
- unlock_kernel();
- return -EINVAL;
- }
-
- if (t->cmd == cmd) {
- if (builtin_ioctl(t)) {
- printk("%p tried to unregister builtin ioctl %x\n",
- __builtin_return_address(0), cmd);
- } else {
- ioctl32_hash_table[hash] = t->next;
- free_ioctl(t);
- unlock_kernel();
- return 0;
- }
- }
- while (t->next) {
- t1 = (struct ioctl_trans *)(long)t->next;
- if (t1->cmd == cmd) {
- if (builtin_ioctl(t1)) {
- printk("%p tried to unregister builtin ioctl %x\n",
- __builtin_return_address(0), cmd);
- goto out;
- } else {
- t->next = t1->next;
- free_ioctl(t1);
- unlock_kernel();
- return 0;
- }
- }
- t = t1;
- }
- printk(KERN_ERR "Trying to free unknown 32bit ioctl handler %x\n", cmd);
- out:
- unlock_kernel();
- return -EINVAL;
-}
-
-EXPORT_SYMBOL(register_ioctl32_conversion);
-EXPORT_SYMBOL(unregister_ioctl32_conversion);
-
-asmlinkage long sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- struct file * filp;
- int error = -EBADF;
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
- struct ioctl_trans *t;
-
- filp = fget(fd);
- if(!filp)
- goto out2;
-
- if (!filp->f_op || !filp->f_op->ioctl) {
- error = sys_ioctl (fd, cmd, arg);
- goto out;
- }
-
- t = (struct ioctl_trans *)ioctl32_hash_table [ioctl32_hash (cmd)];
-
- while (t && t->cmd != cmd)
- t = (struct ioctl_trans *)t->next;
- if (t) {
- handler = t->handler;
- error = handler(fd, cmd, arg, filp);
- } else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
- error = siocdevprivate_ioctl(fd, cmd, arg);
- } else {
- static int count;
- if (++count <= 50) {
- char buf[10];
- char *path = (char *)__get_free_page(GFP_KERNEL), *fn = "?";
-
- /* find the name of the device. */
- if (path) {
- struct file *f = fget(fd);
- if (f) {
- fn = d_path(f->f_dentry, f->f_vfsmnt,
- path, PAGE_SIZE);
- fput(f);
- }
- }
-
- sprintf(buf,"'%c'", (cmd>>24) & 0x3f);
- if (!isprint(buf[1]))
- sprintf(buf, "%02x", buf[1]);
- printk("ioctl32(%s:%d): Unknown cmd fd(%d) "
- "cmd(%08x){%s} arg(%08x) on %s\n",
- current->comm, current->pid,
- (int)fd, (unsigned int)cmd, buf, (unsigned int)arg,
- fn);
- if (path)
- free_page((unsigned long)path);
- }
- error = -EINVAL;
- }
-out:
- fput(filp);
-out2:
- return error;
-}
-
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index ae1196f23301..c7ab253afbfe 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -258,7 +258,7 @@ ia32_sys_call_table:
.quad sys_acct
.quad sys_umount /* new_umount */
.quad ni_syscall /* old lock syscall holder */
- .quad sys32_ioctl
+ .quad compat_sys_ioctl
.quad compat_sys_fcntl64 /* 55 */
.quad ni_syscall /* old mpx syscall holder */
.quad sys_setpgid
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 522b178379e8..6167d4006040 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -46,43 +46,126 @@
#include "DAC960.h"
-/*
- DAC960_ControllerCount is the number of DAC960 Controllers detected.
-*/
+static DAC960_Controller_T *DAC960_Controllers[DAC960_MaxControllers];
+static int DAC960_ControllerCount;
+static PROC_DirectoryEntry_T *DAC960_ProcDirectoryEntry;
-static int
- DAC960_ControllerCount = 0;
-/*
- DAC960_Controllers is an array of pointers to the DAC960 Controller
- structures.
-*/
+static long disk_size(DAC960_Controller_T *p, int drive_nr)
+{
+ if (p->FirmwareType == DAC960_V1_Controller) {
+ if (drive_nr >= p->LogicalDriveCount)
+ return 0;
+ return p->V1.LogicalDriveInformation[drive_nr].
+ LogicalDriveSize;
+ } else {
+ DAC960_V2_LogicalDeviceInfo_T *i =
+ p->V2.LogicalDeviceInformation[drive_nr];
+ if (i == NULL)
+ return 0;
+ return i->ConfigurableDeviceSize;
+ }
+}
-static DAC960_Controller_T
- *DAC960_Controllers[DAC960_MaxControllers] = { NULL };
+static int DAC960_open(struct inode *inode, struct file *file)
+{
+ struct gendisk *disk = inode->i_bdev->bd_disk;
+ DAC960_Controller_T *p = disk->queue->queuedata;
+ int drive_nr = (int)disk->private_data;
+ /* bad hack for the "user" ioctls */
+ if (!p->ControllerNumber && !drive_nr && (file->f_flags & O_NONBLOCK))
+ return 0;
-static int DAC960_revalidate(struct gendisk *);
-/*
- DAC960_BlockDeviceOperations is the Block Device Operations structure for
- DAC960 Logical Disk Devices.
-*/
+ if (p->FirmwareType == DAC960_V1_Controller) {
+ if (p->V1.LogicalDriveInformation[drive_nr].
+ LogicalDriveState == DAC960_V1_LogicalDrive_Offline)
+ return -ENXIO;
+ } else {
+ DAC960_V2_LogicalDeviceInfo_T *i =
+ p->V2.LogicalDeviceInformation[drive_nr];
+ if (i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline)
+ return -ENXIO;
+ }
-static struct block_device_operations DAC960_BlockDeviceOperations = {
- .owner =THIS_MODULE,
- .open =DAC960_Open,
- .release =DAC960_Release,
- .ioctl =DAC960_IOCTL,
- .revalidate_disk=DAC960_revalidate,
-};
+ check_disk_change(inode->i_bdev);
+ if (!get_capacity(p->disks[drive_nr]))
+ return -ENXIO;
+ return 0;
+}
-/*
- DAC960_ProcDirectoryEntry is the DAC960 /proc/rd directory entry.
-*/
+static int DAC960_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ struct gendisk *disk = inode->i_bdev->bd_disk;
+ DAC960_Controller_T *p = disk->queue->queuedata;
+ int drive_nr = (int)disk->private_data;
+ struct hd_geometry g, *loc = (struct hd_geometry *)arg;
-static PROC_DirectoryEntry_T
- *DAC960_ProcDirectoryEntry;
+ if (file->f_flags & O_NONBLOCK)
+ return DAC960_UserIOCTL(inode, file, cmd, arg);
+
+ if (cmd != HDIO_GETGEO || !loc)
+ return -EINVAL;
+
+ if (p->FirmwareType == DAC960_V1_Controller) {
+ g.heads = p->V1.GeometryTranslationHeads;
+ g.sectors = p->V1.GeometryTranslationSectors;
+ g.cylinders = p->V1.LogicalDriveInformation[drive_nr].
+ LogicalDriveSize / (g.heads * g.sectors);
+ } else {
+ DAC960_V2_LogicalDeviceInfo_T *i =
+ p->V2.LogicalDeviceInformation[drive_nr];
+ switch (i->DriveGeometry) {
+ case DAC960_V2_Geometry_128_32:
+ g.heads = 128;
+ g.sectors = 32;
+ break;
+ case DAC960_V2_Geometry_255_63:
+ g.heads = 255;
+ g.sectors = 63;
+ break;
+ default:
+ DAC960_Error("Illegal Logical Device Geometry %d\n",
+ p, i->DriveGeometry);
+ return -EINVAL;
+ }
+
+ g.cylinders = i->ConfigurableDeviceSize / (g.heads * g.sectors);
+ }
+
+ g.start = get_start_sect(inode->i_bdev);
+
+ return copy_to_user(loc, &g, sizeof g) ? -EFAULT : 0;
+}
+
+static int DAC960_media_changed(struct gendisk *disk)
+{
+ DAC960_Controller_T *p = disk->queue->queuedata;
+ int drive_nr = (int)disk->private_data;
+
+ if (!p->LogicalDriveInitiallyAccessible[drive_nr])
+ return 1;
+ return 0;
+}
+
+static int DAC960_revalidate_disk(struct gendisk *disk)
+{
+ DAC960_Controller_T *p = disk->queue->queuedata;
+ int unit = (int)disk->private_data;
+
+ set_capacity(disk, disk_size(p, unit));
+ return 0;
+}
+
+static struct block_device_operations DAC960_BlockDeviceOperations = {
+ .owner = THIS_MODULE,
+ .open = DAC960_open,
+ .ioctl = DAC960_ioctl,
+ .media_changed = DAC960_media_changed,
+ .revalidate_disk = DAC960_revalidate_disk,
+};
/*
@@ -2433,21 +2516,6 @@ static void DAC960_UnregisterBlockDevice(DAC960_Controller_T *Controller)
blk_cleanup_queue(&Controller->RequestQueue);
}
-static long disk_size(DAC960_Controller_T *Controller, int disk)
-{
- if (Controller->FirmwareType == DAC960_V1_Controller) {
- if (disk >= Controller->LogicalDriveCount)
- return 0;
- return Controller->V1.LogicalDriveInformation[disk].LogicalDriveSize;
- } else {
- DAC960_V2_LogicalDeviceInfo_T *LogicalDeviceInfo =
- Controller->V2.LogicalDeviceInformation[disk];
- if (LogicalDeviceInfo == NULL)
- return 0;
- return LogicalDeviceInfo->ConfigurableDeviceSize;
- }
-}
-
/*
DAC960_ComputeGenericDiskInfo computes the values for the Generic Disk
Information Partition Sector Counts and Block Sizes.
@@ -2460,14 +2528,6 @@ static void DAC960_ComputeGenericDiskInfo(DAC960_Controller_T *Controller)
set_capacity(Controller->disks[disk], disk_size(Controller, disk));
}
-static int DAC960_revalidate(struct gendisk *disk)
-{
- DAC960_Controller_T *p = disk->queue->queuedata;
- int unit = (int)disk->private_data;
- set_capacity(disk, disk_size(p, unit));
- return 0;
-}
-
/*
DAC960_ReportErrorStatus reports Controller BIOS Messages passed through
the Error Status Register when the driver performs the BIOS handshaking.
@@ -5575,151 +5635,6 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData)
}
}
-
-/*
- DAC960_Open is the Device Open Function for the DAC960 Driver.
-*/
-
-static int DAC960_Open(Inode_T *Inode, File_T *File)
-{
- int ControllerNumber = DAC960_ControllerNumber(Inode->i_rdev);
- int LogicalDriveNumber = DAC960_LogicalDriveNumber(Inode->i_rdev);
- DAC960_Controller_T *Controller;
- if (ControllerNumber == 0 && LogicalDriveNumber == 0 &&
- (File->f_flags & O_NONBLOCK))
- goto ModuleOnly;
- if (ControllerNumber < 0 || ControllerNumber > DAC960_ControllerCount - 1)
- return -ENXIO;
- Controller = DAC960_Controllers[ControllerNumber];
- if (Controller == NULL) return -ENXIO;
- if (Controller->FirmwareType == DAC960_V1_Controller)
- {
- if (LogicalDriveNumber > Controller->LogicalDriveCount - 1)
- return -ENXIO;
- if (Controller->V1.LogicalDriveInformation
- [LogicalDriveNumber].LogicalDriveState
- == DAC960_V1_LogicalDrive_Offline)
- return -ENXIO;
- }
- else
- {
- DAC960_V2_LogicalDeviceInfo_T *LogicalDeviceInfo =
- Controller->V2.LogicalDeviceInformation[LogicalDriveNumber];
- if (LogicalDeviceInfo == NULL ||
- LogicalDeviceInfo->LogicalDeviceState
- == DAC960_V2_LogicalDevice_Offline)
- return -ENXIO;
- }
- if (!Controller->LogicalDriveInitiallyAccessible[LogicalDriveNumber])
- {
- long size;
- Controller->LogicalDriveInitiallyAccessible[LogicalDriveNumber] = true;
- size = disk_size(Controller, LogicalDriveNumber);
- set_capacity(Controller->disks[LogicalDriveNumber], size);
- Inode->i_bdev->bd_invalidated = 1;
- }
- if (!get_capacity(Controller->disks[LogicalDriveNumber]))
- return -ENXIO;
- /*
- Increment Controller and Logical Drive Usage Counts.
- */
- Controller->ControllerUsageCount++;
- Controller->LogicalDriveUsageCount[LogicalDriveNumber]++;
- ModuleOnly:
- return 0;
-}
-
-
-/*
- DAC960_Release is the Device Release Function for the DAC960 Driver.
-*/
-
-static int DAC960_Release(Inode_T *Inode, File_T *File)
-{
- int ControllerNumber = DAC960_ControllerNumber(Inode->i_rdev);
- int LogicalDriveNumber = DAC960_LogicalDriveNumber(Inode->i_rdev);
- DAC960_Controller_T *Controller = DAC960_Controllers[ControllerNumber];
- if (ControllerNumber == 0 && LogicalDriveNumber == 0 &&
- File != NULL && (File->f_flags & O_NONBLOCK))
- goto ModuleOnly;
- /*
- Decrement the Logical Drive and Controller Usage Counts.
- */
- Controller->LogicalDriveUsageCount[LogicalDriveNumber]--;
- Controller->ControllerUsageCount--;
- ModuleOnly:
- return 0;
-}
-
-
-/*
- DAC960_IOCTL is the Device IOCTL Function for the DAC960 Driver.
-*/
-
-static int DAC960_IOCTL(Inode_T *Inode, File_T *File,
- unsigned int Request, unsigned long Argument)
-{
- int ControllerNumber = DAC960_ControllerNumber(Inode->i_rdev);
- int LogicalDriveNumber = DAC960_LogicalDriveNumber(Inode->i_rdev);
- DiskGeometry_T Geometry, *UserGeometry;
- DAC960_Controller_T *Controller;
-
- if (File != NULL && (File->f_flags & O_NONBLOCK))
- return DAC960_UserIOCTL(Inode, File, Request, Argument);
- if (ControllerNumber < 0 || ControllerNumber > DAC960_ControllerCount - 1)
- return -ENXIO;
- Controller = DAC960_Controllers[ControllerNumber];
- if (Controller == NULL) return -ENXIO;
- switch (Request)
- {
- case HDIO_GETGEO:
- /* Get BIOS Disk Geometry. */
- UserGeometry = (DiskGeometry_T *) Argument;
- if (UserGeometry == NULL) return -EINVAL;
- if (Controller->FirmwareType == DAC960_V1_Controller)
- {
- if (LogicalDriveNumber > Controller->LogicalDriveCount - 1)
- return -ENXIO;
- Geometry.heads = Controller->V1.GeometryTranslationHeads;
- Geometry.sectors = Controller->V1.GeometryTranslationSectors;
- Geometry.cylinders =
- Controller->V1.LogicalDriveInformation[LogicalDriveNumber]
- .LogicalDriveSize
- / (Geometry.heads * Geometry.sectors);
- }
- else
- {
- DAC960_V2_LogicalDeviceInfo_T *LogicalDeviceInfo =
- Controller->V2.LogicalDeviceInformation[LogicalDriveNumber];
- if (LogicalDeviceInfo == NULL)
- return -EINVAL;
- switch (LogicalDeviceInfo->DriveGeometry)
- {
- case DAC960_V2_Geometry_128_32:
- Geometry.heads = 128;
- Geometry.sectors = 32;
- break;
- case DAC960_V2_Geometry_255_63:
- Geometry.heads = 255;
- Geometry.sectors = 63;
- break;
- default:
- DAC960_Error("Illegal Logical Device Geometry %d\n",
- Controller, LogicalDeviceInfo->DriveGeometry);
- return -EINVAL;
- }
- Geometry.cylinders =
- LogicalDeviceInfo->ConfigurableDeviceSize
- / (Geometry.heads * Geometry.sectors);
- }
- Geometry.start = get_start_sect(Inode->i_bdev);
- return (copy_to_user(UserGeometry, &Geometry,
- sizeof(DiskGeometry_T)) ? -EFAULT : 0);
- }
- return -EINVAL;
-}
-
-
/*
DAC960_UserIOCTL is the User IOCTL Function for the DAC960 Driver.
*/
diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h
index b49dc4cacb94..960afc25fad7 100644
--- a/drivers/block/DAC960.h
+++ b/drivers/block/DAC960.h
@@ -2364,7 +2364,6 @@ typedef struct DAC960_Controller
unsigned short MaxBlocksPerCommand;
unsigned short ControllerScatterGatherLimit;
unsigned short DriverScatterGatherLimit;
- unsigned int ControllerUsageCount;
u64 BounceBufferLimit;
unsigned int CombinedStatusBufferLength;
unsigned int InitialStatusLength;
@@ -2397,7 +2396,6 @@ typedef struct DAC960_Controller
DAC960_Command_T InitialCommand;
DAC960_Command_T *Commands[DAC960_MaxDriverQueueDepth];
PROC_DirectoryEntry_T *ControllerProcEntry;
- unsigned int LogicalDriveUsageCount[DAC960_MaxLogicalDrives];
boolean LogicalDriveInitiallyAccessible[DAC960_MaxLogicalDrives];
void (*QueueCommand)(DAC960_Command_T *Command);
boolean (*ReadControllerConfiguration)(struct DAC960_Controller *);
@@ -4242,9 +4240,6 @@ static irqreturn_t DAC960_P_InterruptHandler(int, void *, Registers_T *);
static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *);
static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *);
static void DAC960_MonitoringTimerFunction(unsigned long);
-static int DAC960_Open(Inode_T *, File_T *);
-static int DAC960_Release(Inode_T *, File_T *);
-static int DAC960_IOCTL(Inode_T *, File_T *, unsigned int, unsigned long);
static int DAC960_UserIOCTL(Inode_T *, File_T *, unsigned int, unsigned long);
static void DAC960_Message(DAC960_MessageLevel_T, unsigned char *,
DAC960_Controller_T *, ...);
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index f455b4150121..a73dd5a71038 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -57,7 +57,9 @@
#include "xd.h"
static void __init do_xd_setup (int *integers);
+#ifdef MODULE
static int xd[5] = { -1,-1,-1,-1, };
+#endif
#define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using
"nodma" module option */
@@ -148,16 +150,18 @@ static struct request_queue xd_queue;
static int __init xd_init(void)
{
u_char i,controller;
- u_char count = 0;
unsigned int address;
int err;
#ifdef MODULE
- for (i = 4; i > 0; i--)
- if (((xd[i] = xd[i-1]) >= 0) && !count)
- count = i;
- if ((xd[0] = count))
- do_xd_setup(xd);
+ {
+ u_char count = 0;
+ for (i = 4; i > 0; i--)
+ if (((xd[i] = xd[i-1]) >= 0) && !count)
+ count = i;
+ if ((xd[0] = count))
+ do_xd_setup(xd);
+ }
#endif
init_timer (&xd_watchdog_int); xd_watchdog_int.function = xd_watchdog;
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 39e2cd68c48e..10dc1e6704b4 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -822,19 +822,6 @@ int bluecard_close(bluecard_info_t *info)
return 0;
}
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
-
- CardServices(ReportError, handle, &err);
-}
-
-
dev_link_t *bluecard_attach(void)
{
bluecard_info_t *info;
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index bf7c41a41e4d..fcf4c16ba2dc 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -569,19 +569,6 @@ int bt3c_close(bt3c_info_t *info)
return 0;
}
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
-
- CardServices(ReportError, handle, &err);
-}
-
-
dev_link_t *bt3c_attach(void)
{
bt3c_info_t *info;
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index b37ca4817005..3bdb0dc71d7f 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -576,19 +576,6 @@ int btuart_close(btuart_info_t *info)
return 0;
}
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
-
- CardServices(ReportError, handle, &err);
-}
-
-
dev_link_t *btuart_attach(void)
{
btuart_info_t *info;
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 766fcdd31a78..50240aac0e1d 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -555,19 +555,6 @@ int dtl1_close(dtl1_info_t *info)
return 0;
}
-
-
-/* ======================== Card services ======================== */
-
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
-
- CardServices(ReportError, handle, &err);
-}
-
-
dev_link_t *dtl1_attach(void)
{
dtl1_info_t *info;
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index e7144be4ef79..1e1126d91fe8 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -192,21 +192,12 @@ int misc_register(struct miscdevice * misc)
}
misc->minor = i;
}
+
if (misc->minor < DYNAMIC_MINORS)
misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
-
-
- /*
- * please use it if you want to do fancy things with your
- * name...
- */
if (misc->devfs_name[0] == '\0') {
- /* yuck, yet another stupid special-casing.
- whos actually using this? Please switch over
- to ->devfs_name ASAP */
snprintf(misc->devfs_name, sizeof(misc->devfs_name),
- strchr(misc->name, '/') ?
- "%s" : "misc/%s", misc->name);
+ "misc/%s", misc->name);
}
devfs_register(NULL, misc->devfs_name, 0, MISC_MAJOR, misc->minor,
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index 19cbd2931d68..e0c98936c233 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -502,8 +502,6 @@ static struct device_attribute * const mwave_dev_attrs[] = {
&dev_attr_uart_irq,
&dev_attr_uart_io,
};
-static int nr_registered_attrs;
-static int device_registered;
/*
* mwave_init is called on module load
@@ -518,13 +516,13 @@ static void mwave_exit(void)
PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit entry\n");
- for (i = 0; i < nr_registered_attrs; i++)
+ for (i = 0; i < pDrvData->nr_registered_attrs; i++)
device_remove_file(&mwave_device, mwave_dev_attrs[i]);
- nr_registered_attrs = 0;
+ pDrvData->nr_registered_attrs = 0;
- if (device_registered) {
+ if (pDrvData->device_registered) {
device_unregister(&mwave_device);
- device_registered = 0;
+ pDrvData->device_registered = FALSE;
}
if ( pDrvData->sLine >= 0 ) {
@@ -650,7 +648,7 @@ static int __init mwave_init(void)
if (device_register(&mwave_device))
goto cleanup_error;
- device_registered = 1;
+ pDrvData->device_registered = TRUE;
for (i = 0; i < ARRAY_SIZE(mwave_dev_attrs); i++) {
if(device_create_file(&mwave_device, mwave_dev_attrs[i])) {
PRINTK_ERROR(KERN_ERR_MWAVE
@@ -659,7 +657,7 @@ static int __init mwave_init(void)
mwave_dev_attrs[i]->attr.name);
goto cleanup_error;
}
- nr_registered_attrs++;
+ pDrvData->nr_registered_attrs++;
}
/* SUCCESS! */
diff --git a/drivers/char/mwave/mwavedd.h b/drivers/char/mwave/mwavedd.h
index feefe0840869..0412b176818f 100644
--- a/drivers/char/mwave/mwavedd.h
+++ b/drivers/char/mwave/mwavedd.h
@@ -140,6 +140,8 @@ typedef struct _MWAVE_DEVICE_DATA {
MWAVE_IPC IPCs[16];
BOOLEAN bMwaveDevRegistered;
short sLine;
+ int nr_registered_attrs;
+ int device_registered;
} MWAVE_DEVICE_DATA, *pMWAVE_DEVICE_DATA;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 931ea243e9e7..fd865b985f61 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -527,12 +527,6 @@ static void mgslpc_detach(dev_link_t *);
static dev_info_t dev_info = "synclink_cs";
static dev_link_t *dev_list = NULL;
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*
* 1st function defined in .text section. Calling this function in
* init_module() followed by a breakpoint allows a remote debugger
diff --git a/drivers/i2c/i2c-elektor.c b/drivers/i2c/i2c-elektor.c
index 63d6f4d944bd..c0fa569f598a 100644
--- a/drivers/i2c/i2c-elektor.c
+++ b/drivers/i2c/i2c-elektor.c
@@ -132,9 +132,10 @@ static void pcf_isa_waitforpin(void) {
}
-static void pcf_isa_handler(int this_irq, void *dev_id, struct pt_regs *regs) {
+static irqreturn_t pcf_isa_handler(int this_irq, void *dev_id, struct pt_regs *regs) {
pcf_pending = 1;
wake_up_interruptible(&pcf_wait);
+ return IRQ_HANDLED;
}
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 16cecbc6c4dd..67086a431c40 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -72,14 +72,6 @@
#include "legacy/pdc4030.h"
-static inline u32 idedisk_read_24 (ide_drive_t *drive)
-{
- u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
- u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
- u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG);
- return (hcyl<<16)|(lcyl<<8)|sect;
-}
-
/*
* lba_capacity_is_ok() performs a sanity check on the claimed "lba_capacity"
* value for this drive (from its reported identification information).
@@ -812,9 +804,9 @@ static u8 idedisk_dump_status (ide_drive_t *drive, const char *msg, u8 stat)
if (drive->addressing == 1) {
__u64 sectors = 0;
u32 low = 0, high = 0;
- low = idedisk_read_24(drive);
+ low = ide_read_24(drive);
hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
- high = idedisk_read_24(drive);
+ high = ide_read_24(drive);
sectors = ((__u64)high << 24) | low;
printk(", LBAsect=%llu, high=%d, low=%d",
(unsigned long long) sectors,
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 56f991a8d88b..72df917205ab 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -263,7 +263,7 @@ void default_hwif_transport (ide_hwif_t *hwif)
EXPORT_SYMBOL(default_hwif_transport);
-u32 read_24 (ide_drive_t *drive)
+u32 ide_read_24 (ide_drive_t *drive)
{
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
@@ -271,7 +271,7 @@ u32 read_24 (ide_drive_t *drive)
return (hcyl<<16)|(lcyl<<8)|sect;
}
-EXPORT_SYMBOL(read_24);
+EXPORT_SYMBOL(ide_read_24);
void SELECT_DRIVE (ide_drive_t *drive)
{
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 65969cd2fdfa..0f339a051ac2 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -61,15 +61,6 @@
#define task_map_rq(rq, flags) ide_map_buffer((rq), (flags))
#define task_unmap_rq(rq, buf, flags) ide_unmap_buffer((rq), (buf), (flags))
-inline u32 task_read_24 (ide_drive_t *drive)
-{
- return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) |
- (HWIF(drive)->INB(IDE_LCYL_REG)<<8) |
- HWIF(drive)->INB(IDE_SECTOR_REG);
-}
-
-EXPORT_SYMBOL(task_read_24);
-
static void ata_bswap_data (void *buffer, int wcount)
{
u16 *p = buffer;
@@ -216,88 +207,6 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
EXPORT_SYMBOL(do_rw_taskfile);
/*
- * Error reporting, in human readable form (luxurious, but a memory hog).
- */
-u8 taskfile_dump_status (ide_drive_t *drive, const char *msg, u8 stat)
-{
- ide_hwif_t *hwif = HWIF(drive);
- unsigned long flags;
- u8 err = 0;
-
- local_irq_set(flags);
- printk("%s: %s: status=0x%02x", drive->name, msg, stat);
-#if FANCY_STATUS_DUMPS
- printk(" { ");
- if (stat & BUSY_STAT) {
- printk("Busy ");
- } else {
- if (stat & READY_STAT) printk("DriveReady ");
- if (stat & WRERR_STAT) printk("DeviceFault ");
- if (stat & SEEK_STAT) printk("SeekComplete ");
- if (stat & DRQ_STAT) printk("DataRequest ");
- if (stat & ECC_STAT) printk("CorrectedError ");
- if (stat & INDEX_STAT) printk("Index ");
- if (stat & ERR_STAT) printk("Error ");
- }
- printk("}");
-#endif /* FANCY_STATUS_DUMPS */
- printk("\n");
- if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
- err = hwif->INB(IDE_ERROR_REG);
- printk("%s: %s: error=0x%02x", drive->name, msg, err);
-#if FANCY_STATUS_DUMPS
- if (drive->media == ide_disk)
- goto media_out;
-
- printk(" { ");
- if (err & ABRT_ERR) printk("DriveStatusError ");
- if (err & ICRC_ERR) printk("Bad%s", (err & ABRT_ERR) ? "CRC " : "Sector ");
- if (err & ECC_ERR) printk("UncorrectableError ");
- if (err & ID_ERR) printk("SectorIdNotFound ");
- if (err & TRK0_ERR) printk("TrackZeroNotFound ");
- if (err & MARK_ERR) printk("AddrMarkNotFound ");
- printk("}");
- if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR ||
- (err & (ECC_ERR|ID_ERR|MARK_ERR))) {
- if (drive->addressing == 1) {
- u64 sectors = 0;
- u32 high = 0;
- u32 low = task_read_24(drive);
- hwif->OUTB(0x80, IDE_CONTROL_REG);
- high = task_read_24(drive);
- sectors = ((u64)high << 24) | low;
- printk(", LBAsect=%lld", (long long) sectors);
- } else {
- u8 cur = hwif->INB(IDE_SELECT_REG);
- u8 low = hwif->INB(IDE_LCYL_REG);
- u8 high = hwif->INB(IDE_HCYL_REG);
- u8 sect = hwif->INB(IDE_SECTOR_REG);
- /* using LBA? */
- if (cur & 0x40) {
- printk(", LBAsect=%d", (u32)
- ((cur&0xf)<<24)|(high<<16)|
- (low<<8)|sect);
- } else {
- printk(", CHS=%d/%d/%d",
- ((high<<8) + low),
- (cur & 0xf), sect);
- }
- }
- if (HWGROUP(drive)->rq)
- printk(", sector=%llu",
- (unsigned long long)HWGROUP(drive)->rq->sector);
- }
-media_out:
-#endif /* FANCY_STATUS_DUMPS */
- printk("\n");
- }
- local_irq_restore(flags);
- return err;
-}
-
-EXPORT_SYMBOL(taskfile_dump_status);
-
-/*
* Clean up after success/failure of an explicit taskfile operation.
*/
void ide_end_taskfile (ide_drive_t *drive, u8 stat, u8 err)
@@ -358,99 +267,6 @@ void ide_end_taskfile (ide_drive_t *drive, u8 stat, u8 err)
EXPORT_SYMBOL(ide_end_taskfile);
/*
- * try_to_flush_leftover_data() is invoked in response to a drive
- * unexpectedly having its DRQ_STAT bit set. As an alternative to
- * resetting the drive, this routine tries to clear the condition
- * by read a sector's worth of data from the drive. Of course,
- * this may not help if the drive is *waiting* for data from *us*.
- */
-void task_try_to_flush_leftover_data (ide_drive_t *drive)
-{
- int i = (drive->mult_count ? drive->mult_count : 1) * SECTOR_WORDS;
-
- if (drive->media != ide_disk)
- return;
- while (i > 0) {
- u32 buffer[16];
- unsigned int wcount = (i > 16) ? 16 : i;
- i -= wcount;
- taskfile_input_data(drive, buffer, wcount);
- }
-}
-
-EXPORT_SYMBOL(task_try_to_flush_leftover_data);
-
-/*
- * taskfile_error() takes action based on the error returned by the drive.
- */
-ide_startstop_t taskfile_error (ide_drive_t *drive, const char *msg, u8 stat)
-{
- ide_hwif_t *hwif;
- struct request *rq;
- u8 err;
-
- err = taskfile_dump_status(drive, msg, stat);
- if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
- return ide_stopped;
-
- hwif = HWIF(drive);
- /* retry only "normal" I/O: */
- if (rq->flags & REQ_DRIVE_TASKFILE) {
- rq->errors = 1;
- ide_end_taskfile(drive, stat, err);
- return ide_stopped;
- }
- if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) {
- /* other bits are useless when BUSY */
- rq->errors |= ERROR_RESET;
- } else {
- if (drive->media != ide_disk)
- goto media_out;
- if (stat & ERR_STAT) {
- /* err has different meaning on cdrom and tape */
- if (err == ABRT_ERR) {
- if (drive->select.b.lba &&
- (hwif->INB(IDE_COMMAND_REG) == WIN_SPECIFY))
- /* some newer drives don't
- * support WIN_SPECIFY
- */
- return ide_stopped;
- } else if ((err & BAD_CRC) == BAD_CRC) {
- /* UDMA crc error -- just retry the operation */
- drive->crc_count++;
- } else if (err & (BBD_ERR | ECC_ERR)) {
- /* retries won't help these */
- rq->errors = ERROR_MAX;
- } else if (err & TRK0_ERR) {
- /* help it find track zero */
- rq->errors |= ERROR_RECAL;
- }
- }
-media_out:
- if ((stat & DRQ_STAT) && rq_data_dir(rq) != WRITE)
- task_try_to_flush_leftover_data(drive);
- }
- if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) {
- /* force an abort */
- hwif->OUTB(WIN_IDLEIMMEDIATE, IDE_COMMAND_REG);
- }
- if (rq->errors >= ERROR_MAX) {
- DRIVER(drive)->end_request(drive, 0, 0);
- } else {
- if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
- ++rq->errors;
- return ide_do_reset(drive);
- }
- if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
- drive->special.b.recalibrate = 1;
- ++rq->errors;
- }
- return ide_stopped;
-}
-
-EXPORT_SYMBOL(taskfile_error);
-
-/*
* set_multmode_intr() is invoked on completion of a WIN_SETMULT cmd.
*/
ide_startstop_t set_multmode_intr (ide_drive_t *drive)
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 474876725c59..5967fe433778 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -359,13 +359,6 @@ unsigned long current_capacity (ide_drive_t *drive)
EXPORT_SYMBOL(current_capacity);
-static inline u32 read_24 (ide_drive_t *drive)
-{
- return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) |
- (HWIF(drive)->INB(IDE_LCYL_REG)<<8) |
- HWIF(drive)->INB(IDE_SECTOR_REG);
-}
-
/*
* Error reporting, in human readable form (luxurious, but a memory hog).
*/
@@ -412,9 +405,9 @@ u8 ide_dump_status (ide_drive_t *drive, const char *msg, u8 stat)
(drive->addressing == 1)) {
u64 sectors = 0;
u32 high = 0;
- u32 low = read_24(drive);
+ u32 low = ide_read_24(drive);
hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG);
- high = read_24(drive);
+ high = ide_read_24(drive);
sectors = ((u64)high << 24) | low;
printk(", LBAsect=%llu, high=%d, low=%d",
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 1cce4d0e7a4f..64baff3aee87 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -103,14 +103,6 @@ static void ide_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
ide_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 6b0a5dfff279..15e0494ae517 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -118,14 +118,6 @@ typedef struct local_info_t {
dev_node_t node;
} local_info_t;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
avmcs_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 5b2a1a6ce269..a6b2907753f4 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -130,14 +130,6 @@ typedef struct local_info_t {
dev_node_t node;
} local_info_t;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
avma1cs_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 00afdc97de31..2db8723e1677 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -170,14 +170,6 @@ typedef struct local_info_t {
int busy;
} local_info_t;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret};
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
elsa_cs_attach() creates an "instance" of the driver, allocatingx
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 3ff07122b9fc..5f3be96e56d2 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -178,14 +178,6 @@ typedef struct local_info_t {
int stop;
} local_info_t;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
sedlbauer_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/mca/Kconfig b/drivers/mca/Kconfig
index b4e381eb2002..a7a0220ab4bd 100644
--- a/drivers/mca/Kconfig
+++ b/drivers/mca/Kconfig
@@ -1,6 +1,3 @@
-comment "Micro Channel Architecture Bus support"
- depends on MCA
-
config MCA_LEGACY
bool "Legacy MCA API Support"
depends on MCA
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index cb667cdf69d1..18b3ab5c5578 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1084,9 +1084,10 @@ static struct file_operations _ctl_fops = {
};
static struct miscdevice _dm_misc = {
- .minor = MISC_DYNAMIC_MINOR,
- .name = DM_NAME,
- .fops = &_ctl_fops
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DM_NAME,
+ .devfs_name = "mapper/control",
+ .fops = &_ctl_fops
};
/*
@@ -1107,18 +1108,12 @@ int __init dm_interface_init(void)
return r;
}
- r = devfs_mk_symlink(DM_DIR "/control", "../misc/" DM_NAME);
- if (r) {
- DMERR("devfs_mk_symlink failed for control device");
- goto failed;
- }
DMINFO("%d.%d.%d%s initialised: %s", DM_VERSION_MAJOR,
DM_VERSION_MINOR, DM_VERSION_PATCHLEVEL, DM_VERSION_EXTRA,
DM_DRIVER_EMAIL);
return 0;
failed:
- devfs_remove(DM_DIR "/control");
if (misc_deregister(&_dm_misc) < 0)
DMERR("misc_deregister failed for control device");
dm_hash_exit();
@@ -1127,7 +1122,6 @@ int __init dm_interface_init(void)
void dm_interface_exit(void)
{
- devfs_remove(DM_DIR "/control");
if (misc_deregister(&_dm_misc) < 0)
DMERR("misc_deregister failed for control device");
dm_hash_exit();
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c
index 6ca918cdc0a2..b43939311f1f 100644
--- a/drivers/media/radio/miropcm20-rds.c
+++ b/drivers/media/radio/miropcm20-rds.c
@@ -13,7 +13,6 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/miscdevice.h>
-#include <linux/devfs_fs_kernel.h>
#include <asm/uaccess.h>
#include "miropcm20-rds-core.h"
@@ -114,28 +113,17 @@ static struct file_operations rds_fops = {
static struct miscdevice rds_miscdev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "radiotext",
+ .devfs_name = "v4l/rds/radiotext",
.fops = &rds_fops,
};
static int __init miropcm20_rds_init(void)
{
- int error;
-
- error = misc_register(&rds_miscdev);
- if (error)
- return error;
-
- error = devfs_mk_symlink("v4l/rds/radiotext",
- "../misc/radiotext");
- if (error)
- misc_deregister(&rds_miscdev);
-
- return error;
+ return misc_register(&rds_miscdev);
}
static void __exit miropcm20_rds_cleanup(void)
{
- devfs_remove("v4l/rds/radiotext");
misc_deregister(&rds_miscdev);
}
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index ed8d3b0f03f6..f094a933b1dd 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -1279,7 +1279,7 @@ static int bttv_prepare_buffer(struct bttv *btv, struct bttv_buffer *buf,
}
static int
-buffer_setup(struct file *file, int *count, int *size)
+buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
{
struct bttv_fh *fh = file->private_data;
@@ -3156,22 +3156,23 @@ bttv_irq_switch_fields(struct bttv *btv)
spin_unlock(&btv->s_lock);
}
-static void bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
+static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
{
u32 stat,astat;
u32 dstat;
int count;
struct bttv *btv;
+ int handled = 0;
btv=(struct bttv *)dev_id;
count=0;
- while (1)
- {
+ while (1) {
/* get/clear interrupt status bits */
stat=btread(BT848_INT_STAT);
astat=stat&btread(BT848_INT_MASK);
if (!astat)
- return;
+ break;
+ handled = 1;
btwrite(stat,BT848_INT_STAT);
/* get device status bits */
@@ -3231,6 +3232,7 @@ static void bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
"bttv%d: IRQ lockup, cleared int mask\n", btv->nr);
}
}
+ return IRQ_RETVAL(handled);
}
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index 6259fe17c681..e13395177dc9 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -106,16 +106,7 @@ MODULE_PARM(mem_type, "i");
MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)");
-
-static inline void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-
/* read/write{8,16} copy_{from,to} routines with window remapping to access whole card */
-
static caddr_t remap_window(struct map_info *map, unsigned long to)
{
struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index ed5b6d3a293c..46223bbbb7c3 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -95,7 +95,6 @@ static int ali_ircc_net_close(struct net_device *dev);
static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int ali_ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data);
static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud);
-static void ali_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void ali_ircc_suspend(struct ali_ircc_cb *self);
static void ali_ircc_wakeup(struct ali_ircc_cb *self);
static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev);
@@ -632,7 +631,8 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info)
* An interrupt from the chip has arrived. Time to do some work
*
*/
-static void ali_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id,
+ struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_id;
struct ali_ircc_cb *self;
@@ -641,7 +641,7 @@ static void ali_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!dev) {
WARNING("%s: irq %d for unknown device.\n", driver_name, irq);
- return;
+ return IRQ_NONE;
}
self = (struct ali_ircc_cb *) dev->priv;
@@ -656,7 +656,8 @@ static void ali_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_unlock(&self->lock);
- IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__);
+ IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__);
+ return IRQ_HANDLED;
}
/*
* Function ali_ircc_fir_interrupt(irq, struct ali_ircc_cb *self, regs)
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index b90bd7c27460..185035d28b17 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -745,20 +745,20 @@ STATIC int toshoboe_invalid_dev(int irq)
return 1;
}
-STATIC void
+STATIC irqreturn_t
toshoboe_probeinterrupt (int irq, void *dev_id, struct pt_regs *regs)
{
struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id;
__u8 irqstat;
if (self == NULL && toshoboe_invalid_dev(irq))
- return;
+ return IRQ_NONE;
irqstat = INB (OBOE_ISR);
/* was it us */
if (!(irqstat & OBOE_INT_MASK))
- return;
+ return IRQ_NONE;
/* Ack all the interrupts */
OUTB (irqstat, OBOE_ISR);
@@ -791,6 +791,7 @@ toshoboe_probeinterrupt (int irq, void *dev_id, struct pt_regs *regs)
if (irqstat & OBOE_INT_SIP) {
self->int_sip++;
PROBE_DEBUG("I"); }
+ return IRQ_HANDLED;
}
STATIC int
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 850d08cfaff0..ada9a3feda69 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -131,7 +131,6 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev);
static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size);
static void nsc_ircc_dma_xmit(struct nsc_ircc_cb *self, int iobase);
static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 baud);
-static void nsc_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int nsc_ircc_is_receiving(struct nsc_ircc_cb *self);
static int nsc_ircc_read_dongle_id (int iobase);
static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id);
@@ -1781,7 +1780,8 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
* An interrupt from the chip has arrived. Time to do some work
*
*/
-static void nsc_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id,
+ struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_id;
struct nsc_ircc_cb *self;
@@ -1790,7 +1790,7 @@ static void nsc_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!dev) {
WARNING("%s: irq %d for unknown device.\n", driver_name, irq);
- return;
+ return IRQ_NONE;
}
self = (struct nsc_ircc_cb *) dev->priv;
@@ -1818,6 +1818,7 @@ static void nsc_ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outb(bsr, iobase+BSR); /* Restore bank register */
spin_unlock(&self->lock);
+ return IRQ_HANDLED;
}
/*
diff --git a/drivers/net/irda/smc-ircc.c b/drivers/net/irda/smc-ircc.c
index 570f66981f67..f802455b8ada 100644
--- a/drivers/net/irda/smc-ircc.c
+++ b/drivers/net/irda/smc-ircc.c
@@ -992,9 +992,9 @@ static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_NONE;
}
irport = (struct irport_cb *) dev->priv;
- ASSERT(irport != NULL, return;);
+ ASSERT(irport != NULL, return IRQ_NONE;);
self = (struct ircc_cb *) irport->priv;
- ASSERT(self != NULL, return;);
+ ASSERT(self != NULL, return IRQ_NONE;);
/* Check if we should use the SIR interrupt handler */
if (self->io->speed < 576000) {
diff --git a/drivers/net/irda/toshoboe.c b/drivers/net/irda/toshoboe.c
index 6acd04de8d4a..04b1ee08bea2 100644
--- a/drivers/net/irda/toshoboe.c
+++ b/drivers/net/irda/toshoboe.c
@@ -349,7 +349,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
}
/*interrupt handler */
-static void
+static irqreturn_t
toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
{
struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id;
@@ -360,7 +360,7 @@ toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
{
printk (KERN_WARNING "%s: irq %d for unknown device.\n",
driver_name, irq);
- return;
+ return IRQ_NONE;
}
IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
@@ -369,7 +369,7 @@ toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
/* woz it us */
if (!(irqstat & 0xf8))
- return;
+ return IRQ_NONE;
outb_p (irqstat, OBOE_ISR); /*Acknologede it */
@@ -456,8 +456,7 @@ toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
self->stats.rx_errors++;
}
-
-
+ return IRQ_HANDLED;
}
static int
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 73650d69ccd9..6624608c7195 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -1570,7 +1570,8 @@ static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
/********************************************************/
-static void vlsi_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
+static irqreturn_t vlsi_interrupt(int irq, void *dev_instance,
+ struct pt_regs *regs)
{
struct net_device *ndev = dev_instance;
vlsi_irda_dev_t *idev = ndev->priv;
@@ -1579,6 +1580,7 @@ static void vlsi_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
int boguscount = 32;
unsigned got_act;
unsigned long flags;
+ int handled = 0;
got_act = 0;
iobase = ndev->base_addr;
@@ -1591,7 +1593,7 @@ static void vlsi_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (!(irintr&=IRINTR_INT_MASK)) /* not our INT - probably shared */
break;
-
+ handled = 1;
if (irintr&IRINTR_RPKTINT)
vlsi_rx_interrupt(ndev);
@@ -1610,7 +1612,7 @@ static void vlsi_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (boguscount <= 0)
printk(KERN_WARNING "%s: too much work in interrupt!\n", __FUNCTION__);
-
+ return IRQ_RETVAL(handled);
}
/********************************************************/
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index 52df492072d8..3013e4e821ab 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -97,7 +97,6 @@ static int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev);
static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size);
static void w83977af_dma_write(struct w83977af_ir *self, int iobase);
static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed);
-static void w83977af_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int w83977af_is_receiving(struct w83977af_ir *self);
static int w83977af_net_init(struct net_device *dev);
@@ -1118,7 +1117,8 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr)
* An interrupt from the chip has arrived. Time to do some work
*
*/
-static void w83977af_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t w83977af_interrupt(int irq, void *dev_id,
+ struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_id;
struct w83977af_ir *self;
@@ -1128,7 +1128,7 @@ static void w83977af_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (!dev) {
printk(KERN_WARNING "%s: irq %d for unknown device.\n",
driver_name, irq);
- return;
+ return IRQ_NONE;
}
self = (struct w83977af_ir *) dev->priv;
@@ -1153,7 +1153,7 @@ static void w83977af_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outb(icr, iobase+ICR); /* Restore (new) interrupts */
outb(set, iobase+SSR); /* Restore bank register */
-
+ return IRQ_HANDLED;
}
/*
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 77bea7bbdc2d..8b92afe404d9 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -273,16 +273,6 @@ static void flush_stale_links(void)
}
}
-static void cs_error(client_handle_t handle, int func, int ret)
-{
-#if CS_RELEASE_CODE < 0x2911
- CardServices(ReportError, dev_info, (void *)func, (void *)ret);
-#else
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-#endif
-}
-
/*
tc574_attach() creates an "instance" of the driver, allocating
local data structures for one device. The device is registered
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 28534613cad4..222ed67f4663 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -193,14 +193,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
tc589_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index e4f5fbb2da46..994385526341 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -157,14 +157,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
We never need to do anything when a axnet device is "initialized"
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 7cfdc64cf3c4..8f9f75f56c78 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -163,14 +163,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
com20020_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 3fe4970a2426..1934b151751a 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -261,16 +261,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
static dev_link_t *fmvj18x_attach(void)
{
local_info_t *lp;
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index b21df476a8bf..90909618fb4d 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -157,14 +157,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
{
u32 ethcmd;
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 61fc93e36156..bc29dd21b1df 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -457,17 +457,6 @@ static void flush_stale_links(void)
}
/* ----------------------------------------------------------------------------
-cs_error
- Report a Card Services related error.
----------------------------------------------------------------------------- */
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-/* ----------------------------------------------------------------------------
nmclan_attach
Creates an "instance" of the driver, allocating local data
structures for one device. The device is registered with Card
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 543dacff82b3..41063863ad80 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -255,14 +255,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
We never need to do anything when a pcnet device is "initialized"
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index a51a1f8279d5..502951f0aaf1 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -324,14 +324,6 @@ static void flush_stale_links(void)
}
}
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
smc91c92_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index f9ced9587806..c87270efc696 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -403,13 +403,6 @@ flush_stale_links(void)
}
}
-static void
-cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
static int
get_tuple_data(int fn, client_handle_t handle, tuple_t *tuple)
{
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index 8a6e03628073..3bba268e0dd6 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -255,8 +255,8 @@ config HDLC
If you want to compile the driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
- say M here and read Documentation/modules.txt. The module
- will be called hdlc.o.
+ say M here and read <file:Documentation/modules.txt>. The module
+ will be called hdlc.
If unsure, say N here.
@@ -363,7 +363,7 @@ config N2
If you want to compile the driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read <file:Documentation/modules.txt>. The module
- will be called n2.o.
+ will be called n2.
If unsure, say N here.
@@ -378,7 +378,7 @@ config C101
If you want to compile the driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read <file:Documentation/modules.txt>. The module
- will be called c101.o.
+ will be called c101.
If unsure, say N here.
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 1061d32b70dc..0854ade71ca9 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -157,14 +157,9 @@ static int c101_open(struct net_device *dev)
port_t *port = hdlc_to_port(hdlc);
int result;
- if (!try_module_get(THIS_MODULE))
- return -EFAULT; /* rmmod in progress */
-
result = hdlc_open(hdlc);
- if (result) {
+ if (result)
return result;
- module_put(THIS_MODULE);
- }
writeb(1, port->win0base + C101_DTR);
sca_out(0, MSCI1_OFFSET + CTL, port); /* RTS uses ch#2 output */
@@ -183,7 +178,6 @@ static int c101_close(struct net_device *dev)
writeb(0, port->win0base + C101_DTR);
sca_out(CTL_NORTS, MSCI1_OFFSET + CTL, port);
hdlc_close(hdlc);
- module_put(THIS_MODULE);
return 0;
}
@@ -319,6 +313,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
dev = hdlc_to_dev(&card->hdlc);
spin_lock_init(&card->lock);
+ SET_MODULE_OWNER(dev);
dev->irq = irq;
dev->mem_start = winbase;
dev->mem_end = winbase + C101_MAPPED_RAM_SIZE - 1;
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index 12b5434c2d24..53e0701da0ff 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -218,15 +218,9 @@ static int n2_open(struct net_device *dev)
u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0);
int result;
-
- if (!try_module_get(THIS_MODULE))
- return -EFAULT; /* rmmod in progress */
-
result = hdlc_open(hdlc);
- if (result) {
+ if (result)
return result;
- module_put(THIS_MODULE);
- }
mcr &= port->phy_node ? ~DTR_PORT1 : ~DTR_PORT0; /* set DTR ON */
outb(mcr, io + N2_MCR);
@@ -251,7 +245,6 @@ static int n2_close(struct net_device *dev)
mcr |= port->phy_node ? DTR_PORT1 : DTR_PORT0; /* set DTR OFF */
outb(mcr, io + N2_MCR);
hdlc_close(hdlc);
- module_put(THIS_MODULE);
return 0;
}
@@ -451,6 +444,7 @@ static int __init n2_run(unsigned long io, unsigned long irq,
port->log_node = 1;
spin_lock_init(&port->lock);
+ SET_MODULE_OWNER(dev);
dev->irq = irq;
dev->mem_start = winbase;
dev->mem_end = winbase + USE_WINDOWSIZE-1;
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index 2f77536af306..b61e4349d8b5 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -161,14 +161,6 @@ typedef struct local_info_t {
struct net_device *eth_dev;
} local_info_t;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
This bit of code is used to avoid unregistering network devices
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index afc650181be4..2d68a8ffab69 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -353,14 +353,6 @@ static inline short get_int16(u_char* staddr)
return readw(staddr);
}
-/**************************************************************************/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*
* Wait until the WOC (Write Operation Complete) bit in the
* ASR (Adapter Status Register) is asserted.
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 2f9e10f574b3..6b21842a0dd2 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -144,14 +144,6 @@ orinoco_cs_hard_reset(struct orinoco_private *priv)
/* PCMCIA stuff */
/********************************************************************/
-static void
-cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-
/* Remove zombie instances (card removed, detach pending) */
static void
flush_stale_links(void)
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 2d9da068e1a8..83630b0e59b5 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -314,12 +314,6 @@ static char hop_pattern_length[] = { 1,
static char rcsid[] = "Raylink/WebGear wireless LAN - Corey <Thomas corey@world.std.com>";
-/*===========================================================================*/
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- pcmcia_report_error(handle, &err);
-}
/*======================================================================
This bit of code is used to avoid unregistering network devices
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index f44f09362126..808b5c69d34e 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -65,16 +65,6 @@
* (wavelan modem or i82593)
*/
-/*------------------------------------------------------------------*/
-/*
- * Wrapper for reporting error to cardservices
- */
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
#ifdef STRUCT_CHECK
/*------------------------------------------------------------------*/
/*
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index ed927a0734f7..28f0100be81e 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -103,14 +103,6 @@ static int parport_event(event_t event, int priority,
static dev_info_t dev_info = "parport_cs";
static dev_link_t *dev_list = NULL;
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
parport_attach() creates an "instance" of the driver, allocating
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 162eeadc7f92..c52d3a087016 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -130,11 +130,12 @@ extern struct proc_dir_entry *proc_pccard;
/*====================================================================*/
-static void cs_error(client_handle_t handle, int func, int ret)
+void cs_error(client_handle_t handle, int func, int ret)
{
- error_info_t err = { func, ret };
- pcmcia_report_error(handle, &err);
+ error_info_t err = { func, ret };
+ pcmcia_report_error(handle, &err);
}
+EXPORT_SYMBOL(cs_error);
/*======================================================================*/
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index bf026b619a1c..7f73b8b603dc 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -113,16 +113,6 @@ static void aha152x_detach(dev_link_t *);
static dev_link_t *dev_list;
static dev_info_t dev_info = "aha152x_cs";
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
static dev_link_t *aha152x_attach(void)
{
scsi_info_t *info;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index c08c59a11fd2..693c0c2c0bdc 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -103,16 +103,6 @@ static dev_link_t *dev_list = NULL;
static dev_info_t dev_info = "fdomain_cs";
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
static dev_link_t *fdomain_attach(void)
{
scsi_info_t *info;
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 523a0b54769e..8b42da5597fb 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1469,13 +1469,6 @@ static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt)
PCMCIA functions
**********************************************************************/
-/*====================================================================*/
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
nsp_cs_attach() creates an "instance" of the driver, allocating
local data structures for one device. The device is registered
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 40a1cb2c181c..37a0fc27e7ca 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -102,16 +102,6 @@ static dev_link_t *dev_list = NULL;
static dev_info_t dev_info = "qlogic_cs";
-/*====================================================================*/
-
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
-/*====================================================================*/
-
static dev_link_t *qlogic_attach(void)
{
scsi_info_t *info;
diff --git a/drivers/serial/8250_cs.c b/drivers/serial/8250_cs.c
index c78d5d801256..135699e8fad2 100644
--- a/drivers/serial/8250_cs.c
+++ b/drivers/serial/8250_cs.c
@@ -122,15 +122,6 @@ static void serial_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
-/*====================================================================*/
-
-static void
-cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- CardServices(ReportError, handle, &err);
-}
-
/*======================================================================
After a card is removed, do_serial_release() will unregister
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index f93ce1d43e43..bf5f7db8001d 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -127,7 +127,7 @@ setup_port(struct pci_dev *dev, struct serial_struct *req,
return -ENOMEM;
req->io_type = UPIO_MEM;
- req->iomap_base = port;
+ req->iomap_base = port + offset;
req->iomem_base = priv->remapped_bar[bar] + offset;
req->iomem_reg_shift = regshift;
} else {
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index 6fac0dc2e3f1..f255dd484e11 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -43,15 +43,6 @@ static int ixj_event(event_t event, int priority, event_callback_args_t * args);
static dev_info_t dev_info = "ixj_cs";
static dev_link_t *dev_list = NULL;
-static void cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err =
- {
- func, ret
- };
- CardServices(ReportError, handle, &err);
-}
-
static dev_link_t *ixj_attach(void)
{
client_reg_t client_reg;
diff --git a/fs/Kconfig b/fs/Kconfig
index 8cf5765f6ff8..7de0d9f56da7 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -135,7 +135,7 @@ config JBD
# CONFIG_JBD could be its own option (even modular), but until there are
# other users than ext3, we will simply make it be the same as CONFIG_EXT3_FS
# dep_tristate ' Journal Block Device support (JBD for ext3)' CONFIG_JBD $CONFIG_EXT3_FS
- bool
+ tristate
default EXT3_FS
help
This is a generic journaling layer for block devices. It is
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 7b53dd72cb26..aff85edae23f 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -689,6 +689,15 @@ static ssize_t blkdev_file_write(struct file *file, const char *buf,
return generic_file_write_nolock(file, &local_iov, 1, ppos);
}
+static ssize_t blkdev_file_aio_write(struct kiocb *iocb, const char *buf,
+ size_t count, loff_t pos)
+{
+ struct iovec local_iov = { .iov_base = (void *)buf, .iov_len = count };
+
+ return generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
+}
+
+
struct address_space_operations def_blk_aops = {
.readpage = blkdev_readpage,
.writepage = blkdev_writepage,
@@ -705,6 +714,8 @@ struct file_operations def_blk_fops = {
.llseek = block_llseek,
.read = generic_file_read,
.write = blkdev_file_write,
+ .aio_read = generic_file_aio_read,
+ .aio_write = blkdev_file_aio_write,
.mmap = generic_file_mmap,
.fsync = block_fsync,
.ioctl = blkdev_ioctl,
diff --git a/fs/buffer.c b/fs/buffer.c
index f57274d6b9c9..5ed6a8e2918f 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2019,7 +2019,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
struct inode *inode = page->mapping->host;
sector_t iblock, lblock;
struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];
- unsigned int blocksize, blocks;
+ unsigned int blocksize;
int nr, i;
int fully_mapped = 1;
@@ -2032,7 +2032,6 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
create_empty_buffers(page, blocksize, 0);
head = page_buffers(page);
- blocks = PAGE_CACHE_SIZE >> inode->i_blkbits;
iblock = (sector_t)page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits);
lblock = (inode->i_size+blocksize-1) >> inode->i_blkbits;
bh = head;
diff --git a/fs/compat.c b/fs/compat.c
index da8c6d8ae490..4a301f7dd9ba 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -4,7 +4,11 @@
* Kernel compatibililty routines for e.g. 32 bit syscall support
* on 64 bit kernels.
*
- * Copyright (C) 2002 Stephen Rothwell, IBM Corporation
+ * Copyright (C) 2002 Stephen Rothwell, IBM Corporation
+ * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
+ * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
+ * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs
+ * Copyright (C) 2003 Pavel Machek (pavel@suse.cz)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -20,6 +24,13 @@
#include <linux/namei.h>
#include <linux/file.h>
#include <linux/vfs.h>
+#include <linux/ioctl32.h>
+#include <linux/init.h>
+#include <linux/sockios.h> /* for SIOCDEVPRIVATE */
+#include <linux/fs.h>
+#include <linux/smp_lock.h>
+#include <linux/ctype.h>
+#include <linux/module.h>
#include <asm/uaccess.h>
@@ -130,6 +141,217 @@ out:
return error;
}
+
+/* ioctl32 stuff, used by sparc64, parisc, s390x, ppc64, x86_64 */
+
+#define IOCTL_HASHSIZE 256
+struct ioctl_trans *ioctl32_hash_table[IOCTL_HASHSIZE];
+
+extern struct ioctl_trans ioctl_start[], ioctl_end[];
+
+static inline unsigned long ioctl32_hash(unsigned long cmd)
+{
+ return (((cmd >> 6) ^ (cmd >> 4) ^ cmd)) % IOCTL_HASHSIZE;
+}
+
+static void ioctl32_insert_translation(struct ioctl_trans *trans)
+{
+ unsigned long hash;
+ struct ioctl_trans *t;
+
+ hash = ioctl32_hash (trans->cmd);
+ if (!ioctl32_hash_table[hash])
+ ioctl32_hash_table[hash] = trans;
+ else {
+ t = ioctl32_hash_table[hash];
+ while (t->next)
+ t = t->next;
+ trans->next = 0;
+ t->next = trans;
+ }
+}
+
+static int __init init_sys32_ioctl(void)
+{
+ int i;
+
+ for (i = 0; &ioctl_start[i] < &ioctl_end[0]; i++) {
+ if (ioctl_start[i].next != 0) {
+ printk("ioctl translation %d bad\n",i);
+ return -1;
+ }
+
+ ioctl32_insert_translation(&ioctl_start[i]);
+ }
+ return 0;
+}
+
+__initcall(init_sys32_ioctl);
+
+static struct ioctl_trans *ioctl_free_list;
+
+/* Never free them really. This avoids SMP races. With a Read-Copy-Update
+ enabled kernel we could just use the RCU infrastructure for this. */
+static void free_ioctl(struct ioctl_trans *t)
+{
+ t->cmd = 0;
+ mb();
+ t->next = ioctl_free_list;
+ ioctl_free_list = t;
+}
+
+int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int, unsigned int, unsigned long, struct file *))
+{
+ struct ioctl_trans *t;
+ unsigned long hash = ioctl32_hash(cmd);
+
+ lock_kernel();
+ for (t = (struct ioctl_trans *)ioctl32_hash_table[hash];
+ t;
+ t = t->next) {
+ if (t->cmd == cmd) {
+ printk("Trying to register duplicated ioctl32 handler %x\n", cmd);
+ unlock_kernel();
+ return -EINVAL;
+ }
+ }
+
+ if (ioctl_free_list) {
+ t = ioctl_free_list;
+ ioctl_free_list = t->next;
+ } else {
+ t = kmalloc(sizeof(struct ioctl_trans), GFP_KERNEL);
+ if (!t) {
+ unlock_kernel();
+ return -ENOMEM;
+ }
+ }
+
+ t->next = NULL;
+ t->cmd = cmd;
+ t->handler = handler;
+ ioctl32_insert_translation(t);
+
+ unlock_kernel();
+ return 0;
+}
+
+static inline int builtin_ioctl(struct ioctl_trans *t)
+{
+ return t >= (struct ioctl_trans *)ioctl_start &&
+ t < (struct ioctl_trans *)ioctl_end;
+}
+
+/* Problem:
+ This function cannot unregister duplicate ioctls, because they are not
+ unique.
+ When they happen we need to extend the prototype to pass the handler too. */
+
+int unregister_ioctl32_conversion(unsigned int cmd)
+{
+ unsigned long hash = ioctl32_hash(cmd);
+ struct ioctl_trans *t, *t1;
+
+ lock_kernel();
+
+ t = (struct ioctl_trans *)ioctl32_hash_table[hash];
+ if (!t) {
+ unlock_kernel();
+ return -EINVAL;
+ }
+
+ if (t->cmd == cmd) {
+ if (builtin_ioctl(t)) {
+ printk("%p tried to unregister builtin ioctl %x\n",
+ __builtin_return_address(0), cmd);
+ } else {
+ ioctl32_hash_table[hash] = t->next;
+ free_ioctl(t);
+ unlock_kernel();
+ return 0;
+ }
+ }
+ while (t->next) {
+ t1 = (struct ioctl_trans *)(long)t->next;
+ if (t1->cmd == cmd) {
+ if (builtin_ioctl(t1)) {
+ printk("%p tried to unregister builtin ioctl %x\n",
+ __builtin_return_address(0), cmd);
+ goto out;
+ } else {
+ t->next = t1->next;
+ free_ioctl(t1);
+ unlock_kernel();
+ return 0;
+ }
+ }
+ t = t1;
+ }
+ printk(KERN_ERR "Trying to free unknown 32bit ioctl handler %x\n", cmd);
+ out:
+ unlock_kernel();
+ return -EINVAL;
+}
+
+EXPORT_SYMBOL(register_ioctl32_conversion);
+EXPORT_SYMBOL(unregister_ioctl32_conversion);
+
+asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ struct file * filp;
+ int error = -EBADF;
+ int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
+ struct ioctl_trans *t;
+
+ filp = fget(fd);
+ if(!filp)
+ goto out2;
+
+ if (!filp->f_op || !filp->f_op->ioctl) {
+ error = sys_ioctl (fd, cmd, arg);
+ goto out;
+ }
+
+ t = (struct ioctl_trans *)ioctl32_hash_table [ioctl32_hash (cmd)];
+
+ while (t && t->cmd != cmd)
+ t = (struct ioctl_trans *)t->next;
+ if (t) {
+ handler = t->handler;
+ error = handler(fd, cmd, arg, filp);
+ } else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
+ error = siocdevprivate_ioctl(fd, cmd, arg);
+ } else {
+ static int count;
+ if (++count <= 50) {
+ char buf[10];
+ char *path = (char *)__get_free_page(GFP_KERNEL), *fn = "?";
+
+ /* find the name of the device. */
+ if (path) {
+ fn = d_path(filp->f_dentry, filp->f_vfsmnt,
+ path, PAGE_SIZE);
+ }
+
+ sprintf(buf,"'%c'", (cmd>>24) & 0x3f);
+ if (!isprint(buf[1]))
+ sprintf(buf, "%02x", buf[1]);
+ printk("ioctl32(%s:%d): Unknown cmd fd(%d) "
+ "cmd(%08x){%s} arg(%08x) on %s\n",
+ current->comm, current->pid,
+ (int)fd, (unsigned int)cmd, buf, (unsigned int)arg,
+ fn);
+ if (path)
+ free_page((unsigned long)path);
+ }
+ error = -EINVAL;
+ }
+out:
+ fput(filp);
+out2:
+ return error;
+}
+
static int get_compat_flock(struct flock *kfl, struct compat_flock *ufl)
{
if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index a4b37b8d9772..532c501e7396 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -978,12 +978,6 @@ static void ext3_orphan_cleanup (struct super_block * sb,
return;
}
- if (s_flags & MS_RDONLY) {
- printk(KERN_INFO "EXT3-fs: %s: orphan cleanup on readonly fs\n",
- sb->s_id);
- sb->s_flags &= ~MS_RDONLY;
- }
-
if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
if (es->s_last_orphan)
jbd_debug(1, "Errors on filesystem, "
@@ -993,6 +987,12 @@ static void ext3_orphan_cleanup (struct super_block * sb,
return;
}
+ if (s_flags & MS_RDONLY) {
+ printk(KERN_INFO "EXT3-fs: %s: orphan cleanup on readonly fs\n",
+ sb->s_id);
+ sb->s_flags &= ~MS_RDONLY;
+ }
+
while (es->s_last_orphan) {
struct inode *inode;
diff --git a/fs/filesystems.c b/fs/filesystems.c
index a87d637e168a..c4b467fb67dd 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -32,17 +32,7 @@ static rwlock_t file_systems_lock = RW_LOCK_UNLOCKED;
/* WARNING: This can be used only if we _already_ own a reference */
void get_filesystem(struct file_system_type *fs)
{
- if (!try_module_get(fs->owner)) {
-#ifdef CONFIG_MODULE_UNLOAD
- unsigned int cpu = get_cpu();
- local_inc(&fs->owner->ref[cpu].count);
- put_cpu();
-#else
- /* Getting filesystem while it's starting up? We're
- already supposed to have a reference. */
- BUG();
-#endif
- }
+ __module_get(fs->owner);
}
void put_filesystem(struct file_system_type *fs)
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index d547c1d957b9..27a8b478c356 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -20,6 +20,31 @@ ToDo:
sufficient for synchronisation here. We then just need to make sure
ntfs_readpage/writepage/truncate interoperate properly with us.
+2.1.4 - Reduce compiler requirements.
+
+ - Remove all uses of unnamed structs and unions in the driver to make
+ old and newer gcc versions happy. Makes it a bit uglier IMO but at
+ least people will stop hassling me about it.
+
+2.1.3 - Important bug fixes in corner cases.
+
+ - super.c::parse_ntfs_boot_sector(): Correct the check for 64-bit
+ clusters. (Philipp Thomas)
+ - attrib.c::load_attribute_list(): Fix bug when initialized_size is a
+ multiple of the block_size but not the cluster size. (Szabolcs
+ Szakacsits <szaka@sienet.hu>)
+
+2.1.2 - Important bug fixes aleviating the hangs in statfs.
+
+ - Fix buggy free cluster and free inode determination logic.
+
+2.1.1 - Minor updates.
+
+ - Add handling for initialized_size != data_size in compressed files.
+ - Reduce function local stack usage from 0x3d4 bytes to just noise in
+ fs/ntfs/upcase.c. (Randy Dunlap <rddunlap@osdl.ord>)
+ - Remove compiler warnings for newer gcc.
+
2.1.0 - First steps towards write support: implement file overwrite.
- Add configuration option for developmental write support with an
diff --git a/fs/ntfs/Makefile b/fs/ntfs/Makefile
index 7482eb2e777d..5e2a43f18188 100644
--- a/fs/ntfs/Makefile
+++ b/fs/ntfs/Makefile
@@ -5,7 +5,7 @@ obj-$(CONFIG_NTFS_FS) += ntfs.o
ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
mst.o namei.o super.o sysctl.o time.o unistr.o upcase.o
-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.0\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.4\"
ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index f69f5c599eb3..7f47bd418fdf 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -2,8 +2,8 @@
* aops.c - NTFS kernel address space operations and page cache handling.
* Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (c) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -111,7 +111,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
unsigned int i, recs, nr_err;
u32 rec_size;
- rec_size = ni->_IDM(index_block_size);
+ rec_size = ni->itype.index.block_size;
recs = PAGE_CACHE_SIZE / rec_size;
addr = kmap_atomic(page, KM_BIO_SRC_IRQ);
for (i = nr_err = 0; i < recs; i++) {
@@ -124,7 +124,7 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
ni->mft_no ? "index" : "mft",
(long long)(((s64)page->index <<
PAGE_CACHE_SHIFT >>
- ni->_IDM(index_block_size_bits)) + i));
+ ni->itype.index.block_size_bits) + i));
}
flush_dcache_page(page);
kunmap_atomic(addr, KM_BIO_SRC_IRQ);
@@ -383,7 +383,7 @@ int ntfs_readpage(struct file *file, struct page *page)
if (!NInoAttr(ni))
base_ni = ni;
else
- base_ni = ni->_INE(base_ntfs_ino);
+ base_ni = ni->ext.base_ntfs_ino;
/* Map, pin, and lock the mft record. */
mrec = map_mft_record(base_ni);
@@ -406,7 +406,7 @@ int ntfs_readpage(struct file *file, struct page *page)
attr_pos = page->index << PAGE_CACHE_SHIFT;
/* The total length of the attribute value. */
- attr_len = le32_to_cpu(ctx->attr->_ARA(value_length));
+ attr_len = le32_to_cpu(ctx->attr->data.resident.value_length);
addr = kmap(page);
/* Copy over in bounds data, zeroing the remainder of the page. */
@@ -418,8 +418,8 @@ int ntfs_readpage(struct file *file, struct page *page)
memset(addr + bytes, 0, PAGE_CACHE_SIZE - bytes);
/* Copy the data to the page. */
memcpy(addr, attr_pos + (char*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)),
- bytes);
+ le16_to_cpu(
+ ctx->attr->data.resident.value_offset), bytes);
} else
memset(addr, 0, PAGE_CACHE_SIZE);
flush_dcache_page(page);
@@ -892,7 +892,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
if (!NInoAttr(ni))
base_ni = ni;
else
- base_ni = ni->_INE(base_ntfs_ino);
+ base_ni = ni->ext.base_ntfs_ino;
/* Map, pin, and lock the mft record. */
m = map_mft_record(base_ni);
@@ -917,7 +917,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
attr_pos = page->index << PAGE_CACHE_SHIFT;
/* The total length of the attribute value. */
- attr_len = le32_to_cpu(ctx->attr->_ARA(value_length));
+ attr_len = le32_to_cpu(ctx->attr->data.resident.value_length);
if (unlikely(vi->i_size != attr_len)) {
ntfs_error(vi->i_sb, "BUG()! i_size (0x%Lx) doesn't match "
@@ -956,8 +956,9 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
kaddr = kmap_atomic(page, KM_USER0);
/* Copy the data from the page to the mft record. */
- memcpy((u8*)ctx->attr + le16_to_cpu(ctx->attr->_ARA(value_offset)) +
- attr_pos, kaddr, bytes);
+ memcpy((u8*)ctx->attr + le16_to_cpu(
+ ctx->attr->data.resident.value_offset) + attr_pos,
+ kaddr, bytes);
flush_dcache_mft_record_page(ctx->ntfs_ino);
#if 0
/* Zero out of bounds area. */
@@ -1656,7 +1657,7 @@ static int ntfs_commit_write(struct file *file, struct page *page,
if (!NInoAttr(ni))
base_ni = ni;
else
- base_ni = ni->_INE(base_ntfs_ino);
+ base_ni = ni->ext.base_ntfs_ino;
/* Map, pin, and lock the mft record. */
m = map_mft_record(base_ni);
@@ -1681,7 +1682,7 @@ static int ntfs_commit_write(struct file *file, struct page *page,
attr_pos = page->index << PAGE_CACHE_SHIFT;
/* The total length of the attribute value. */
- attr_len = le32_to_cpu(ctx->attr->_ARA(value_length));
+ attr_len = le32_to_cpu(ctx->attr->data.resident.value_length);
if (unlikely(vi->i_size != attr_len)) {
ntfs_error(vi->i_sb, "BUG()! i_size (0x%Lx) doesn't match "
@@ -1705,8 +1706,8 @@ static int ntfs_commit_write(struct file *file, struct page *page,
* Calculate the address of the attribute value corresponding to the
* beginning of the current data @page.
*/
- kattr = (u8*)ctx->attr + le16_to_cpu(ctx->attr->_ARA(value_offset)) +
- attr_pos;
+ kattr = (u8*)ctx->attr + le16_to_cpu(
+ ctx->attr->data.resident.value_offset) + attr_pos;
kaddr = kmap_atomic(page, KM_USER0);
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index f2e945da1db9..b47366fe9baa 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -1,8 +1,8 @@
/**
* attrib.c - NTFS attribute operations. Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (C) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -731,17 +731,18 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
#ifdef DEBUG
/* Make sure attr exists and is non-resident. */
- if (!attr || !attr->non_resident ||
- sle64_to_cpu(attr->_ANR(lowest_vcn)) < (VCN)0) {
+ if (!attr || !attr->non_resident || sle64_to_cpu(
+ attr->data.non_resident.lowest_vcn) < (VCN)0) {
ntfs_error(vol->sb, "Invalid arguments.");
return ERR_PTR(-EINVAL);
}
#endif
/* Start at vcn = lowest_vcn and lcn 0. */
- vcn = sle64_to_cpu(attr->_ANR(lowest_vcn));
+ vcn = sle64_to_cpu(attr->data.non_resident.lowest_vcn);
lcn = 0;
/* Get start of the mapping pairs array. */
- buf = (u8*)attr + le16_to_cpu(attr->_ANR(mapping_pairs_offset));
+ buf = (u8*)attr + le16_to_cpu(
+ attr->data.non_resident.mapping_pairs_offset);
attr_end = (u8*)attr + le32_to_cpu(attr->length);
if (unlikely(buf < (u8*)attr || buf > attr_end)) {
ntfs_error(vol->sb, "Corrupt attribute.");
@@ -867,7 +868,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
* If there is a highest_vcn specified, it must be equal to the final
* vcn in the run list - 1, or something has gone badly wrong.
*/
- deltaxcn = sle64_to_cpu(attr->_ANR(highest_vcn));
+ deltaxcn = sle64_to_cpu(attr->data.non_resident.highest_vcn);
if (unlikely(deltaxcn && vcn - 1 != deltaxcn)) {
mpa_err:
ntfs_error(vol->sb, "Corrupt mapping pairs array in "
@@ -875,10 +876,11 @@ mpa_err:
goto err_out;
}
/* Setup not mapped run list element if this is the base extent. */
- if (!attr->_ANR(lowest_vcn)) {
+ if (!attr->data.non_resident.lowest_vcn) {
VCN max_cluster;
- max_cluster = (sle64_to_cpu(attr->_ANR(allocated_size)) +
+ max_cluster = (sle64_to_cpu(
+ attr->data.non_resident.allocated_size) +
vol->cluster_size - 1) >>
vol->cluster_size_bits;
/*
@@ -951,7 +953,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
if (!NInoAttr(ni))
base_ni = ni;
else
- base_ni = ni->_INE(base_ntfs_ino);
+ base_ni = ni->ext.base_ntfs_ino;
mrec = map_mft_record(base_ni);
if (IS_ERR(mrec))
@@ -1180,19 +1182,23 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
return TRUE;
/* @val is present; compare values. */
else {
+ u32 vl;
register int rc;
-
+
+ vl = le32_to_cpu(a->data.resident.value_length);
+ if (vl > val_len)
+ vl = val_len;
+
rc = memcmp(val, (u8*)a + le16_to_cpu(
- a->_ARA(value_offset)),
- min_t(const u32, val_len,
- le32_to_cpu(a->_ARA(value_length))));
+ a->data.resident.value_offset), vl);
/*
* If @val collates before the current attribute's
* value, there is no matching attribute.
*/
if (!rc) {
register u32 avl;
- avl = le32_to_cpu(a->_ARA(value_length));
+ avl = le32_to_cpu(
+ a->data.resident.value_length);
if (val_len == avl)
return TRUE;
if (val_len < avl)
@@ -1235,11 +1241,9 @@ int load_attribute_list(ntfs_volume *vol, run_list *run_list, u8 *al,
unsigned char block_size_bits = sb->s_blocksize_bits;
ntfs_debug("Entering.");
-#ifdef DEBUG
if (!vol || !run_list || !al || size <= 0 || initialized_size < 0 ||
initialized_size > size)
return -EINVAL;
-#endif
if (!initialized_size) {
memset(al, 0, size);
return 0;
@@ -1270,8 +1274,8 @@ int load_attribute_list(ntfs_volume *vol, run_list *run_list, u8 *al,
"read attribute list.");
goto err_out;
}
- if (al + block_size > al_end)
- goto do_partial;
+ if (al + block_size >= al_end)
+ goto do_final;
memcpy(al, bh->b_data, block_size);
brelse(bh);
al += block_size;
@@ -1285,7 +1289,7 @@ initialize:
done:
up_read(&run_list->lock);
return err;
-do_partial:
+do_final:
if (al < al_end) {
/* Partial block. */
memcpy(al, bh->b_data, al_end - al);
@@ -1546,9 +1550,11 @@ do_next_attr_loop:
* If no @val specified or @val specified and it matches, we
* have found it!
*/
- if (!val || (!a->non_resident && le32_to_cpu(a->_ARA(value_length))
- == val_len && !memcmp((u8*)a +
- le16_to_cpu(a->_ARA(value_offset)), val, val_len))) {
+ if (!val || (!a->non_resident && le32_to_cpu(
+ a->data.resident.value_length) == val_len &&
+ !memcmp((u8*)a +
+ le16_to_cpu(a->data.resident.value_offset),
+ val, val_len))) {
ntfs_debug("Done, found.");
return TRUE;
}
diff --git a/fs/ntfs/attrib.h b/fs/ntfs/attrib.h
index 86f536bb1dd6..e7009a0703af 100644
--- a/fs/ntfs/attrib.h
+++ b/fs/ntfs/attrib.h
@@ -2,8 +2,8 @@
* attrib.h - Defines for attribute handling in NTFS Linux kernel driver.
* Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (C) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -93,8 +93,8 @@ extern int load_attribute_list(ntfs_volume *vol, run_list *rl, u8 *al,
static inline s64 attribute_value_length(const ATTR_RECORD *a)
{
if (!a->non_resident)
- return (s64)le32_to_cpu(a->_ARA(value_length));
- return sle64_to_cpu(a->_ANR(data_size));
+ return (s64)le32_to_cpu(a->data.resident.value_length);
+ return sle64_to_cpu(a->data.non_resident.data_size);
}
extern void reinit_attr_search_ctx(attr_search_context *ctx);
diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
index 292d069ddc0b..5568cc2a402f 100644
--- a/fs/ntfs/compress.c
+++ b/fs/ntfs/compress.c
@@ -2,8 +2,8 @@
* compress.c - NTFS kernel compressed attributes handling.
* Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (C) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -44,7 +44,7 @@ typedef enum {
* The maximum compression block size is by definition 16 * the cluster
* size, with the maximum supported cluster size being 4kiB. Thus the
* maximum compression buffer size is 64kiB, so we use this when
- * initializing the per-CPU buffers.
+ * initializing the compression buffer.
*/
NTFS_MAX_CB_SIZE = 64 * 1024,
} ntfs_compression_constants;
@@ -89,6 +89,40 @@ void free_compression_buffers(void)
}
/**
+ * zero_partial_compressed_page - zero out of bounds compressed page region
+ */
+static void zero_partial_compressed_page(ntfs_inode *ni, struct page *page)
+{
+ u8 *kp = page_address(page);
+ unsigned int kp_ofs;
+
+ ntfs_debug("Zeroing page region outside initialized size.");
+ if (((s64)page->index << PAGE_CACHE_SHIFT) >= ni->initialized_size) {
+ /*
+ * FIXME: Using clear_page() will become wrong when we get
+ * PAGE_CACHE_SIZE != PAGE_SIZE but for now there is no problem.
+ */
+ clear_page(kp);
+ return;
+ }
+ kp_ofs = ni->initialized_size & ~PAGE_CACHE_MASK;
+ memset(kp + kp_ofs, 0, PAGE_CACHE_SIZE - kp_ofs);
+ return;
+}
+
+/**
+ * handle_bounds_compressed_page - test for&handle out of bounds compressed page
+ */
+static inline void handle_bounds_compressed_page(ntfs_inode *ni,
+ struct page *page)
+{
+ if ((page->index >= (ni->initialized_size >> PAGE_CACHE_SHIFT)) &&
+ (ni->initialized_size < VFS_I(ni)->i_size))
+ zero_partial_compressed_page(ni, page);
+ return;
+}
+
+/**
* ntfs_decompress - decompress a compression block into an array of pages
* @dest_pages: destination array of pages
* @dest_index: current index into @dest_pages (IN/OUT)
@@ -164,7 +198,7 @@ do_next_sb:
cb - cb_start);
/* Have we reached the end of the compression block? */
- if (cb == cb_end || !le16_to_cpup(cb)) {
+ if (cb == cb_end || !le16_to_cpup((u16*)cb)) {
int i;
ntfs_debug("Completed. Returning success (0).");
@@ -173,19 +207,29 @@ return_error:
/* We can sleep from now on, so we drop lock. */
spin_unlock(&ntfs_cb_lock);
/* Second stage: finalize completed pages. */
- for (i = 0; i < nr_completed_pages; i++) {
- int di = completed_pages[i];
-
- dp = dest_pages[di];
- flush_dcache_page(dp);
- kunmap(dp);
- SetPageUptodate(dp);
- unlock_page(dp);
- if (di == xpage)
- *xpage_done = 1;
- else
- page_cache_release(dp);
- dest_pages[di] = NULL;
+ if (nr_completed_pages > 0) {
+ struct page *page = dest_pages[completed_pages[0]];
+ ntfs_inode *ni = NTFS_I(page->mapping->host);
+
+ for (i = 0; i < nr_completed_pages; i++) {
+ int di = completed_pages[i];
+
+ dp = dest_pages[di];
+ /*
+ * If we are outside the initialized size, zero
+ * the out of bounds page range.
+ */
+ handle_bounds_compressed_page(ni, dp);
+ flush_dcache_page(dp);
+ kunmap(dp);
+ SetPageUptodate(dp);
+ unlock_page(dp);
+ if (di == xpage)
+ *xpage_done = 1;
+ else
+ page_cache_release(dp);
+ dest_pages[di] = NULL;
+ }
}
return err;
}
@@ -204,7 +248,8 @@ return_error:
/* Setup the current sub-block source pointers and validate range. */
cb_sb_start = cb;
- cb_sb_end = cb_sb_start + (le16_to_cpup(cb) & NTFS_SB_SIZE_MASK) + 3;
+ cb_sb_end = cb_sb_start + (le16_to_cpup((u16*)cb) & NTFS_SB_SIZE_MASK)
+ + 3;
if (cb_sb_end > cb_end)
goto return_overflow;
@@ -225,7 +270,7 @@ return_error:
dp_addr = (u8*)page_address(dp) + do_sb_start;
/* Now, we are ready to process the current sub-block (sb). */
- if (!(le16_to_cpup(cb) & NTFS_SB_IS_COMPRESSED)) {
+ if (!(le16_to_cpup((u16*)cb) & NTFS_SB_IS_COMPRESSED)) {
ntfs_debug("Found uncompressed sub-block.");
/* This sb is not compressed, just copy it into destination. */
@@ -330,7 +375,7 @@ do_next_tag:
lg++;
/* Get the phrase token into i. */
- pt = le16_to_cpup(cb);
+ pt = le16_to_cpup((u16*)cb);
/*
* Calculate starting position of the byte sequence in
@@ -432,7 +477,7 @@ int ntfs_read_compressed_block(struct page *page)
u8 *cb, *cb_pos, *cb_end;
struct buffer_head **bhs;
unsigned long offset, index = page->index;
- u32 cb_size = ni->_ICF(compression_block_size);
+ u32 cb_size = ni->itype.compressed.block_size;
u64 cb_size_mask = cb_size - 1UL;
VCN vcn;
LCN lcn;
@@ -447,7 +492,7 @@ int ntfs_read_compressed_block(struct page *page)
& ~cb_size_mask) >> vol->cluster_size_bits;
/* Number of compression blocks (cbs) in the wanted vcn range. */
unsigned int nr_cbs = (end_vcn - start_vcn) << vol->cluster_size_bits
- >> ni->_ICF(compression_block_size_bits);
+ >> ni->itype.compressed.block_size_bits;
/*
* Number of pages required to store the uncompressed data from all
* compression blocks (cbs) overlapping @page. Due to alignment
@@ -528,7 +573,7 @@ int ntfs_read_compressed_block(struct page *page)
*/
cur_page = 0;
cur_ofs = 0;
- cb_clusters = ni->_ICF(compression_block_clusters);
+ cb_clusters = ni->itype.compressed.block_clusters;
do_next_cb:
nr_cbs--;
nr_bhs = 0;
@@ -763,6 +808,11 @@ lock_retry_remap:
for (; cur2_page < cb_max_page; cur2_page++) {
page = pages[cur2_page];
if (page) {
+ /*
+ * If we are outside the initialized size, zero
+ * the out of bounds page range.
+ */
+ handle_bounds_compressed_page(ni, page);
flush_dcache_page(page);
kunmap(page);
SetPageUptodate(page);
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 4f4dda5cf68e..30dee6372e46 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -1,8 +1,8 @@
/**
* dir.c - NTFS kernel directory operations. Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (c) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -105,7 +105,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
}
/* Get to the index root value (it's been verified in read_inode). */
ir = (INDEX_ROOT*)((u8*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)));
+ le16_to_cpu(ctx->attr->data.resident.value_offset));
index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
ie = (INDEX_ENTRY*)((u8*)&ir->index +
@@ -114,18 +114,18 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
* Loop until we exceed valid memory (corruption case) or until we
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->_IEH(length)))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds checks. */
if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (u8*)ie + le16_to_cpu(ie->_IEH(key_length)) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end)
goto dir_err_out;
/*
* The last entry cannot contain a name. It can however contain
* a pointer to a child node in the B+tree so we just break out.
*/
- if (ie->_IEH(flags) & INDEX_ENTRY_END)
+ if (ie->flags & INDEX_ENTRY_END)
break;
/*
* We perform a case sensitive comparison and if that matches
@@ -159,7 +159,7 @@ found_it:
}
}
name->mref = le64_to_cpu(
- ie->_IIF(indexed_file));
+ ie->data.dir.indexed_file);
name->type = FILE_NAME_DOS;
name->len = 0;
*res = name;
@@ -168,7 +168,7 @@ found_it:
kfree(name);
*res = NULL;
}
- mref = le64_to_cpu(ie->_IIF(indexed_file));
+ mref = le64_to_cpu(ie->data.dir.indexed_file);
put_attr_search_ctx(ctx);
unmap_mft_record(dir_ni);
return mref;
@@ -211,7 +211,7 @@ found_it:
err = -ENOMEM;
goto err_out;
}
- name->mref = le64_to_cpu(ie->_IIF(indexed_file));
+ name->mref = le64_to_cpu(ie->data.dir.indexed_file);
name->type = type;
if (type != FILE_NAME_DOS) {
name->len = len;
@@ -265,7 +265,7 @@ found_it:
* we have got a matching name cached in name in which case return the
* mft reference associated with it.
*/
- if (!(ie->_IEH(flags) & INDEX_ENTRY_NODE)) {
+ if (!(ie->flags & INDEX_ENTRY_NODE)) {
if (name) {
put_attr_search_ctx(ctx);
unmap_mft_record(dir_ni);
@@ -284,7 +284,7 @@ found_it:
goto err_out;
}
/* Get the starting vcn of the index_block holding the child node. */
- vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->_IEH(length)) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
ia_mapping = VFS_I(dir_ni)->i_mapping;
/*
* We are done with the index root and the mft record. Release them,
@@ -301,7 +301,7 @@ descend_into_child_node:
* disk if necessary.
*/
page = ntfs_map_page(ia_mapping, vcn <<
- dir_ni->_IDM(index_vcn_size_bits) >> PAGE_CACHE_SHIFT);
+ dir_ni->itype.index.vcn_size_bits >> PAGE_CACHE_SHIFT);
if (IS_ERR(page)) {
ntfs_error(sb, "Failed to map directory index page, error %ld.",
-PTR_ERR(page));
@@ -312,7 +312,7 @@ descend_into_child_node:
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
- dir_ni->_IDM(index_vcn_size_bits)) & ~PAGE_CACHE_MASK));
+ dir_ni->itype.index.vcn_size_bits) & ~PAGE_CACHE_MASK));
/* Bounds checks. */
if ((u8*)ia < kaddr || (u8*)ia > kaddr + PAGE_CACHE_SIZE) {
ntfs_error(sb, "Out of bounds check failed. Corrupt directory "
@@ -331,18 +331,18 @@ fast_descend_into_child_node:
goto unm_err_out;
}
if (le32_to_cpu(ia->index.allocated_size) + 0x18 !=
- dir_ni->_IDM(index_block_size)) {
+ dir_ni->itype.index.block_size) {
ntfs_error(sb, "Index buffer (VCN 0x%Lx) of directory inode "
"0x%lx has a size (%u) differing from the "
"directory specified size (%u). Directory "
"inode is corrupt or driver bug.",
(long long)vcn, dir_ni->mft_no,
le32_to_cpu(ia->index.allocated_size) + 0x18,
- dir_ni->_IDM(index_block_size));
+ dir_ni->itype.index.block_size);
err = -EIO;
goto unm_err_out;
}
- index_end = (u8*)ia + dir_ni->_IDM(index_block_size);
+ index_end = (u8*)ia + dir_ni->itype.index.block_size;
if (index_end > kaddr + PAGE_CACHE_SIZE) {
ntfs_error(sb, "Index buffer (VCN 0x%Lx) of directory inode "
"0x%lx crosses page boundary. Impossible! "
@@ -352,7 +352,7 @@ fast_descend_into_child_node:
goto unm_err_out;
}
index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
- if (index_end > (u8*)ia + dir_ni->_IDM(index_block_size)) {
+ if (index_end > (u8*)ia + dir_ni->itype.index.block_size) {
ntfs_error(sb, "Size of index buffer (VCN 0x%Lx) of directory "
"inode 0x%lx exceeds maximum size.",
(long long)vcn, dir_ni->mft_no);
@@ -367,11 +367,11 @@ fast_descend_into_child_node:
* loop until we exceed valid memory (corruption case) or until we
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->_IEH(length)))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds check. */
if ((u8*)ie < (u8*)ia || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (u8*)ie + le16_to_cpu(ie->_IEH(key_length)) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end) {
ntfs_error(sb, "Index entry out of bounds in "
"directory inode 0x%lx.",
@@ -383,7 +383,7 @@ fast_descend_into_child_node:
* The last entry cannot contain a name. It can however contain
* a pointer to a child node in the B+tree so we just break out.
*/
- if (ie->_IEH(flags) & INDEX_ENTRY_END)
+ if (ie->flags & INDEX_ENTRY_END)
break;
/*
* We perform a case sensitive comparison and if that matches
@@ -417,7 +417,7 @@ found_it2:
}
}
name->mref = le64_to_cpu(
- ie->_IIF(indexed_file));
+ ie->data.dir.indexed_file);
name->type = FILE_NAME_DOS;
name->len = 0;
*res = name;
@@ -426,7 +426,7 @@ found_it2:
kfree(name);
*res = NULL;
}
- mref = le64_to_cpu(ie->_IIF(indexed_file));
+ mref = le64_to_cpu(ie->data.dir.indexed_file);
ntfs_unmap_page(page);
return mref;
}
@@ -469,7 +469,7 @@ found_it2:
err = -ENOMEM;
goto unm_err_out;
}
- name->mref = le64_to_cpu(ie->_IIF(indexed_file));
+ name->mref = le64_to_cpu(ie->data.dir.indexed_file);
name->type = type;
if (type != FILE_NAME_DOS) {
name->len = len;
@@ -521,7 +521,7 @@ found_it2:
* We have finished with this index buffer without success. Check for
* the presence of a child node.
*/
- if (ie->_IEH(flags) & INDEX_ENTRY_NODE) {
+ if (ie->flags & INDEX_ENTRY_NODE) {
if ((ia->index.flags & NODE_MASK) == LEAF_NODE) {
ntfs_error(sb, "Index entry with child node found in "
"a leaf node in directory inode 0x%lx.",
@@ -531,8 +531,7 @@ found_it2:
}
/* Child node present, descend into it. */
old_vcn = vcn;
- vcn = sle64_to_cpup((u8*)ie +
- le16_to_cpu(ie->_IEH(length)) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
if (vcn >= 0) {
/* If vcn is in the same page cache page as old_vcn we
* recycle the mapped page. */
@@ -646,7 +645,7 @@ u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
}
/* Get to the index root value (it's been verified in read_inode). */
ir = (INDEX_ROOT*)((u8*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)));
+ le16_to_cpu(ctx->attr->data.resident.value_offset));
index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
ie = (INDEX_ENTRY*)((u8*)&ir->index +
@@ -655,18 +654,18 @@ u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
* Loop until we exceed valid memory (corruption case) or until we
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->_IEH(length)))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds checks. */
if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (u8*)ie + le16_to_cpu(ie->_IEH(key_length)) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end)
goto dir_err_out;
/*
* The last entry cannot contain a name. It can however contain
* a pointer to a child node in the B+tree so we just break out.
*/
- if (ie->_IEH(flags) & INDEX_ENTRY_END)
+ if (ie->flags & INDEX_ENTRY_END)
break;
/*
* If the current entry has a name type of POSIX, the name is
@@ -691,7 +690,7 @@ u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const uchar_t *uname,
ie->key.file_name.file_name_length, ic,
vol->upcase, vol->upcase_len)) {
found_it:
- mref = le64_to_cpu(ie->_IIF(indexed_file));
+ mref = le64_to_cpu(ie->data.dir.indexed_file);
put_attr_search_ctx(ctx);
unmap_mft_record(dir_ni);
return mref;
@@ -738,7 +737,7 @@ found_it:
* We have finished with this index without success. Check for the
* presence of a child node.
*/
- if (!(ie->_IEH(flags) & INDEX_ENTRY_NODE)) {
+ if (!(ie->flags & INDEX_ENTRY_NODE)) {
/* No child node, return -ENOENT. */
err = -ENOENT;
goto err_out;
@@ -752,7 +751,7 @@ found_it:
goto err_out;
}
/* Get the starting vcn of the index_block holding the child node. */
- vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->_IEH(length)) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
ia_mapping = VFS_I(dir_ni)->i_mapping;
/*
* We are done with the index root and the mft record. Release them,
@@ -769,7 +768,7 @@ descend_into_child_node:
* disk if necessary.
*/
page = ntfs_map_page(ia_mapping, vcn <<
- dir_ni->_IDM(index_vcn_size_bits) >> PAGE_CACHE_SHIFT);
+ dir_ni->itype.index.vcn_size_bits >> PAGE_CACHE_SHIFT);
if (IS_ERR(page)) {
ntfs_error(sb, "Failed to map directory index page, error %ld.",
-PTR_ERR(page));
@@ -780,7 +779,7 @@ descend_into_child_node:
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
- dir_ni->_IDM(index_vcn_size_bits)) & ~PAGE_CACHE_MASK));
+ dir_ni->itype.index.vcn_size_bits) & ~PAGE_CACHE_MASK));
/* Bounds checks. */
if ((u8*)ia < kaddr || (u8*)ia > kaddr + PAGE_CACHE_SIZE) {
ntfs_error(sb, "Out of bounds check failed. Corrupt directory "
@@ -799,18 +798,18 @@ fast_descend_into_child_node:
goto unm_err_out;
}
if (le32_to_cpu(ia->index.allocated_size) + 0x18 !=
- dir_ni->_IDM(index_block_size)) {
+ dir_ni->itype.index.block_size) {
ntfs_error(sb, "Index buffer (VCN 0x%Lx) of directory inode "
"0x%lx has a size (%u) differing from the "
"directory specified size (%u). Directory "
"inode is corrupt or driver bug.",
(long long)vcn, dir_ni->mft_no,
le32_to_cpu(ia->index.allocated_size) + 0x18,
- dir_ni->_IDM(index_block_size));
+ dir_ni->itype.index.block_size);
err = -EIO;
goto unm_err_out;
}
- index_end = (u8*)ia + dir_ni->_IDM(index_block_size);
+ index_end = (u8*)ia + dir_ni->itype.index.block_size;
if (index_end > kaddr + PAGE_CACHE_SIZE) {
ntfs_error(sb, "Index buffer (VCN 0x%Lx) of directory inode "
"0x%lx crosses page boundary. Impossible! "
@@ -820,7 +819,7 @@ fast_descend_into_child_node:
goto unm_err_out;
}
index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
- if (index_end > (u8*)ia + dir_ni->_IDM(index_block_size)) {
+ if (index_end > (u8*)ia + dir_ni->itype.index.block_size) {
ntfs_error(sb, "Size of index buffer (VCN 0x%Lx) of directory "
"inode 0x%lx exceeds maximum size.",
(long long)vcn, dir_ni->mft_no);
@@ -835,11 +834,11 @@ fast_descend_into_child_node:
* loop until we exceed valid memory (corruption case) or until we
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->_IEH(length)))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds check. */
if ((u8*)ie < (u8*)ia || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (u8*)ie + le16_to_cpu(ie->_IEH(key_length)) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end) {
ntfs_error(sb, "Index entry out of bounds in "
"directory inode 0x%lx.",
@@ -851,7 +850,7 @@ fast_descend_into_child_node:
* The last entry cannot contain a name. It can however contain
* a pointer to a child node in the B+tree so we just break out.
*/
- if (ie->_IEH(flags) & INDEX_ENTRY_END)
+ if (ie->flags & INDEX_ENTRY_END)
break;
/*
* If the current entry has a name type of POSIX, the name is
@@ -876,7 +875,7 @@ fast_descend_into_child_node:
ie->key.file_name.file_name_length, ic,
vol->upcase, vol->upcase_len)) {
found_it2:
- mref = le64_to_cpu(ie->_IIF(indexed_file));
+ mref = le64_to_cpu(ie->data.dir.indexed_file);
ntfs_unmap_page(page);
return mref;
}
@@ -922,7 +921,7 @@ found_it2:
* We have finished with this index buffer without success. Check for
* the presence of a child node.
*/
- if (ie->_IEH(flags) & INDEX_ENTRY_NODE) {
+ if (ie->flags & INDEX_ENTRY_NODE) {
if ((ia->index.flags & NODE_MASK) == LEAF_NODE) {
ntfs_error(sb, "Index entry with child node found in "
"a leaf node in directory inode 0x%lx.",
@@ -932,8 +931,7 @@ found_it2:
}
/* Child node present, descend into it. */
old_vcn = vcn;
- vcn = sle64_to_cpup((u8*)ie +
- le16_to_cpu(ie->_IEH(length)) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
if (vcn >= 0) {
/* If vcn is in the same page cache page as old_vcn we
* recycle the mapped page. */
@@ -1007,7 +1005,7 @@ static inline int ntfs_filldir(ntfs_volume *vol, loff_t *fpos,
if (index_type == INDEX_TYPE_ALLOCATION)
*fpos = (u8*)ie - (u8*)iu.ia +
(sle64_to_cpu(iu.ia->index_block_vcn) <<
- ndir->_IDM(index_vcn_size_bits)) +
+ ndir->itype.index.vcn_size_bits) +
vol->mft_record_size;
else /* if (index_type == INDEX_TYPE_ROOT) */
*fpos = (u8*)ie - (u8*)iu.ir;
@@ -1016,11 +1014,11 @@ static inline int ntfs_filldir(ntfs_volume *vol, loff_t *fpos,
ntfs_debug("Skipping DOS name space entry.");
return 0;
}
- if (MREF_LE(ie->_IIF(indexed_file)) == FILE_root) {
+ if (MREF_LE(ie->data.dir.indexed_file) == FILE_root) {
ntfs_debug("Skipping root directory self reference entry.");
return 0;
}
- if (MREF_LE(ie->_IIF(indexed_file)) < FILE_first_user &&
+ if (MREF_LE(ie->data.dir.indexed_file) < FILE_first_user &&
!NVolShowSystemFiles(vol)) {
ntfs_debug("Skipping system file.");
return 0;
@@ -1039,10 +1037,10 @@ static inline int ntfs_filldir(ntfs_volume *vol, loff_t *fpos,
dt_type = DT_REG;
ntfs_debug("Calling filldir for %s with len %i, fpos 0x%Lx, inode "
"0x%lx, DT_%s.", name, name_len, *fpos,
- MREF_LE(ie->_IIF(indexed_file)),
+ MREF_LE(ie->data.dir.indexed_file),
dt_type == DT_DIR ? "DIR" : "REG");
return filldir(dirent, name, name_len, *fpos,
- MREF_LE(ie->_IIF(indexed_file)), dt_type);
+ MREF_LE(ie->data.dir.indexed_file), dt_type);
}
/*
@@ -1139,7 +1137,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
}
/* Get to the index root value (it's been verified in read_inode). */
ir = (INDEX_ROOT*)((u8*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)));
+ le16_to_cpu(ctx->attr->data.resident.value_offset));
index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
ie = (INDEX_ENTRY*)((u8*)&ir->index +
@@ -1149,16 +1147,16 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
* reach the last entry or until filldir tells us it has had enough
* or signals an error (both covered by the rc test).
*/
- for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->_IEH(length)))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
ntfs_debug("In index root, offset 0x%x.", (u8*)ie - (u8*)ir);
/* Bounds checks. */
if (unlikely((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (u8*)ie + le16_to_cpu(ie->_IEH(key_length)) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end))
goto err_out;
/* The last entry cannot contain a name. */
- if (ie->_IEH(flags) & INDEX_ENTRY_END)
+ if (ie->flags & INDEX_ENTRY_END)
break;
/* Skip index root entry if continuing previous readdir. */
if (ir_pos > (u8*)ie - (u8*)ir)
@@ -1192,7 +1190,7 @@ skip_index_root:
/* Get the offset into the index allocation attribute. */
ia_pos = (s64)fpos - vol->mft_record_size;
ia_mapping = vdir->i_mapping;
- bmp_vi = ndir->_IDM(bmp_ino);
+ bmp_vi = ndir->itype.index.bmp_ino;
if (unlikely(!bmp_vi)) {
ntfs_debug("Inode %lu, regetting index bitmap.", vdir->i_ino);
bmp_vi = ntfs_attr_iget(vdir, AT_BITMAP, I30, 4);
@@ -1201,11 +1199,11 @@ skip_index_root:
err = PTR_ERR(bmp_vi);
goto err_out;
}
- ndir->_IDM(bmp_ino) = bmp_vi;
+ ndir->itype.index.bmp_ino = bmp_vi;
}
bmp_mapping = bmp_vi->i_mapping;
/* Get the starting bitmap bit position and sanity check it. */
- bmp_pos = ia_pos >> ndir->_IDM(index_block_size_bits);
+ bmp_pos = ia_pos >> ndir->itype.index.block_size_bits;
if (unlikely(bmp_pos >> 3 >= bmp_vi->i_size)) {
ntfs_error(sb, "Current index allocation position exceeds "
"index bitmap size.");
@@ -1245,7 +1243,7 @@ find_next_index_buffer:
if (unlikely(((bmp_pos + cur_bmp_pos) >> 3) >= vdir->i_size))
goto unm_EOD;
ia_pos = (bmp_pos + cur_bmp_pos) <<
- ndir->_IDM(index_block_size_bits);
+ ndir->itype.index.block_size_bits;
}
ntfs_debug("Handling index buffer 0x%Lx.",
(long long)bmp_pos + cur_bmp_pos);
@@ -1269,7 +1267,7 @@ find_next_index_buffer:
}
/* Get the current index buffer. */
ia = (INDEX_ALLOCATION*)(kaddr + (ia_pos & ~PAGE_CACHE_MASK &
- ~(s64)(ndir->_IDM(index_block_size) - 1)));
+ ~(s64)(ndir->itype.index.block_size - 1)));
/* Bounds checks. */
if (unlikely((u8*)ia < kaddr || (u8*)ia > kaddr + PAGE_CACHE_SIZE)) {
ntfs_error(sb, "Out of bounds check failed. Corrupt directory "
@@ -1277,45 +1275,45 @@ find_next_index_buffer:
goto err_out;
}
if (unlikely(sle64_to_cpu(ia->index_block_vcn) != (ia_pos &
- ~(s64)(ndir->_IDM(index_block_size) - 1)) >>
- ndir->_IDM(index_vcn_size_bits))) {
+ ~(s64)(ndir->itype.index.block_size - 1)) >>
+ ndir->itype.index.vcn_size_bits)) {
ntfs_error(sb, "Actual VCN (0x%Lx) of index buffer is "
"different from expected VCN (0x%Lx). "
"Directory inode 0x%lx is corrupt or driver "
"bug. ",
(long long)sle64_to_cpu(ia->index_block_vcn),
(long long)ia_pos >>
- ndir->_IDM(index_vcn_size_bits), vdir->i_ino);
+ ndir->itype.index.vcn_size_bits, vdir->i_ino);
goto err_out;
}
if (unlikely(le32_to_cpu(ia->index.allocated_size) + 0x18 !=
- ndir->_IDM(index_block_size))) {
+ ndir->itype.index.block_size)) {
ntfs_error(sb, "Index buffer (VCN 0x%Lx) of directory inode "
"0x%lx has a size (%u) differing from the "
"directory specified size (%u). Directory "
"inode is corrupt or driver bug.",
(long long)ia_pos >>
- ndir->_IDM(index_vcn_size_bits), vdir->i_ino,
+ ndir->itype.index.vcn_size_bits, vdir->i_ino,
le32_to_cpu(ia->index.allocated_size) + 0x18,
- ndir->_IDM(index_block_size));
+ ndir->itype.index.block_size);
goto err_out;
}
- index_end = (u8*)ia + ndir->_IDM(index_block_size);
+ index_end = (u8*)ia + ndir->itype.index.block_size;
if (unlikely(index_end > kaddr + PAGE_CACHE_SIZE)) {
ntfs_error(sb, "Index buffer (VCN 0x%Lx) of directory inode "
"0x%lx crosses page boundary. Impossible! "
"Cannot access! This is probably a bug in the "
"driver.", (long long)ia_pos >>
- ndir->_IDM(index_vcn_size_bits), vdir->i_ino);
+ ndir->itype.index.vcn_size_bits, vdir->i_ino);
goto err_out;
}
- ia_start = ia_pos & ~(s64)(ndir->_IDM(index_block_size) - 1);
+ ia_start = ia_pos & ~(s64)(ndir->itype.index.block_size - 1);
index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
- if (unlikely(index_end > (u8*)ia + ndir->_IDM(index_block_size))) {
+ if (unlikely(index_end > (u8*)ia + ndir->itype.index.block_size)) {
ntfs_error(sb, "Size of index buffer (VCN 0x%Lx) of directory "
"inode 0x%lx exceeds maximum size.",
(long long)ia_pos >>
- ndir->_IDM(index_vcn_size_bits), vdir->i_ino);
+ ndir->itype.index.vcn_size_bits, vdir->i_ino);
goto err_out;
}
/* The first index entry in this index buffer. */
@@ -1326,17 +1324,17 @@ find_next_index_buffer:
* reach the last entry or until filldir tells us it has had enough
* or signals an error (both covered by the rc test).
*/
- for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->_IEH(length)))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
ntfs_debug("In index allocation, offset 0x%Lx.",
(long long)ia_start + ((u8*)ie - (u8*)ia));
/* Bounds checks. */
if (unlikely((u8*)ie < (u8*)ia || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (u8*)ie + le16_to_cpu(ie->_IEH(key_length)) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end))
goto err_out;
/* The last entry cannot contain a name. */
- if (ie->_IEH(flags) & INDEX_ENTRY_END)
+ if (ie->flags & INDEX_ENTRY_END)
break;
/* Skip index block entry if continuing previous readdir. */
if (ia_pos - ia_start > (u8*)ie - (u8*)ia)
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index c821b2415528..cb4f82cfb522 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -1,7 +1,7 @@
/**
* inode.c - NTFS kernel inode handling. Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -336,14 +336,14 @@ static void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
ni->attr_list_size = 0;
ni->attr_list = NULL;
init_run_list(&ni->attr_list_rl);
- ni->_IDM(bmp_ino) = NULL;
- ni->_IDM(index_block_size) = 0;
- ni->_IDM(index_vcn_size) = 0;
- ni->_IDM(index_block_size_bits) = 0;
- ni->_IDM(index_vcn_size_bits) = 0;
+ ni->itype.index.bmp_ino = NULL;
+ ni->itype.index.block_size = 0;
+ ni->itype.index.vcn_size = 0;
+ ni->itype.index.block_size_bits = 0;
+ ni->itype.index.vcn_size_bits = 0;
init_MUTEX(&ni->extent_lock);
ni->nr_extents = 0;
- ni->_INE(base_ntfs_ino) = NULL;
+ ni->ext.base_ntfs_ino = NULL;
return;
}
@@ -426,14 +426,14 @@ err_corrupt_attr:
"chkdsk.");
return -EIO;
}
- if (!(attr->_ARA(resident_flags) & RESIDENT_ATTR_IS_INDEXED)) {
+ if (!(attr->data.resident.flags & RESIDENT_ATTR_IS_INDEXED)) {
ntfs_error(ctx->ntfs_ino->vol->sb, "Unindexed file "
"name. You should run chkdsk.");
return -EIO;
}
file_name_attr = (FILE_NAME_ATTR*)((u8*)attr +
- le16_to_cpu(attr->_ARA(value_offset)));
- p2 = (u8*)attr + le32_to_cpu(attr->_ARA(value_length));
+ le16_to_cpu(attr->data.resident.value_offset));
+ p2 = (u8*)attr + le32_to_cpu(attr->data.resident.value_length);
if (p2 < (u8*)attr || p2 > p)
goto err_corrupt_attr;
/* This attribute is ok, but is it in the $Extend directory? */
@@ -578,7 +578,7 @@ static int ntfs_read_locked_inode(struct inode *vi)
}
/* Get the standard information attribute value. */
si = (STANDARD_INFORMATION*)((char*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)));
+ le16_to_cpu(ctx->attr->data.resident.value_offset));
/* Transfer information from the standard information into vfs_ino. */
/*
@@ -633,7 +633,7 @@ static int ntfs_read_locked_inode(struct inode *vi)
}
if (ctx->attr->non_resident) {
NInoSetAttrListNonResident(ni);
- if (ctx->attr->_ANR(lowest_vcn)) {
+ if (ctx->attr->data.non_resident.lowest_vcn) {
ntfs_error(vi->i_sb, "Attribute list has non "
"zero lowest_vcn. Inode is "
"corrupt. You should run "
@@ -659,17 +659,17 @@ static int ntfs_read_locked_inode(struct inode *vi)
/* Now load the attribute list. */
if ((err = load_attribute_list(vol, &ni->attr_list_rl,
ni->attr_list, ni->attr_list_size,
- sle64_to_cpu(
- ctx->attr->_ANR(initialized_size))))) {
+ sle64_to_cpu(ctx->attr->data.
+ non_resident.initialized_size)))) {
ntfs_error(vi->i_sb, "Failed to load "
"attribute list attribute.");
goto unm_err_out;
}
} else /* if (!ctx.attr->non_resident) */ {
if ((u8*)ctx->attr + le16_to_cpu(
- ctx->attr->_ARA(value_offset)) +
+ ctx->attr->data.resident.value_offset) +
le32_to_cpu(
- ctx->attr->_ARA(value_length)) >
+ ctx->attr->data.resident.value_length) >
(u8*)ctx->mrec + vol->mft_record_size) {
ntfs_error(vi->i_sb, "Corrupt attribute list "
"in inode.");
@@ -677,9 +677,9 @@ static int ntfs_read_locked_inode(struct inode *vi)
}
/* Now copy the attribute list. */
memcpy(ni->attr_list, (u8*)ctx->attr + le16_to_cpu(
- ctx->attr->_ARA(value_offset)),
+ ctx->attr->data.resident.value_offset),
le32_to_cpu(
- ctx->attr->_ARA(value_length)));
+ ctx->attr->data.resident.value_length));
}
}
skip_attr_list_load:
@@ -728,9 +728,10 @@ skip_attr_list_load:
}
if (ctx->attr->flags & ATTR_IS_SPARSE)
NInoSetSparse(ni);
- ir = (INDEX_ROOT*)((char*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)));
- ir_end = (char*)ir + le32_to_cpu(ctx->attr->_ARA(value_length));
+ ir = (INDEX_ROOT*)((char*)ctx->attr + le16_to_cpu(
+ ctx->attr->data.resident.value_offset));
+ ir_end = (char*)ir + le32_to_cpu(
+ ctx->attr->data.resident.value_length);
if (ir_end > (char*)ctx->mrec + vol->mft_record_size) {
ntfs_error(vi->i_sb, "$INDEX_ROOT attribute is "
"corrupt.");
@@ -752,41 +753,41 @@ skip_attr_list_load:
"COLLATION_FILE_NAME. Not allowed.");
goto unm_err_out;
}
- ni->_IDM(index_block_size) = le32_to_cpu(ir->index_block_size);
- if (ni->_IDM(index_block_size) &
- (ni->_IDM(index_block_size) - 1)) {
+ ni->itype.index.block_size = le32_to_cpu(ir->index_block_size);
+ if (ni->itype.index.block_size &
+ (ni->itype.index.block_size - 1)) {
ntfs_error(vi->i_sb, "Index block size (%u) is not a "
"power of two.",
- ni->_IDM(index_block_size));
+ ni->itype.index.block_size);
goto unm_err_out;
}
- if (ni->_IDM(index_block_size) > PAGE_CACHE_SIZE) {
+ if (ni->itype.index.block_size > PAGE_CACHE_SIZE) {
ntfs_error(vi->i_sb, "Index block size (%u) > "
"PAGE_CACHE_SIZE (%ld) is not "
"supported. Sorry.",
- ni->_IDM(index_block_size),
+ ni->itype.index.block_size,
PAGE_CACHE_SIZE);
err = -EOPNOTSUPP;
goto unm_err_out;
}
- if (ni->_IDM(index_block_size) < NTFS_BLOCK_SIZE) {
+ if (ni->itype.index.block_size < NTFS_BLOCK_SIZE) {
ntfs_error(vi->i_sb, "Index block size (%u) < "
"NTFS_BLOCK_SIZE (%i) is not "
"supported. Sorry.",
- ni->_IDM(index_block_size),
+ ni->itype.index.block_size,
NTFS_BLOCK_SIZE);
err = -EOPNOTSUPP;
goto unm_err_out;
}
- ni->_IDM(index_block_size_bits) =
- ffs(ni->_IDM(index_block_size)) - 1;
+ ni->itype.index.block_size_bits =
+ ffs(ni->itype.index.block_size) - 1;
/* Determine the size of a vcn in the directory index. */
- if (vol->cluster_size <= ni->_IDM(index_block_size)) {
- ni->_IDM(index_vcn_size) = vol->cluster_size;
- ni->_IDM(index_vcn_size_bits) = vol->cluster_size_bits;
+ if (vol->cluster_size <= ni->itype.index.block_size) {
+ ni->itype.index.vcn_size = vol->cluster_size;
+ ni->itype.index.vcn_size_bits = vol->cluster_size_bits;
} else {
- ni->_IDM(index_vcn_size) = vol->sector_size;
- ni->_IDM(index_vcn_size_bits) = vol->sector_size_bits;
+ ni->itype.index.vcn_size = vol->sector_size;
+ ni->itype.index.vcn_size_bits = vol->sector_size_bits;
}
/* Setup the index allocation attribute, even if not present. */
@@ -836,18 +837,19 @@ skip_attr_list_load:
"is compressed.");
goto unm_err_out;
}
- if (ctx->attr->_ANR(lowest_vcn)) {
+ if (ctx->attr->data.non_resident.lowest_vcn) {
ntfs_error(vi->i_sb, "First extent of "
"$INDEX_ALLOCATION attribute has non "
"zero lowest_vcn. Inode is corrupt. "
"You should run chkdsk.");
goto unm_err_out;
}
- vi->i_size = sle64_to_cpu(ctx->attr->_ANR(data_size));
+ vi->i_size = sle64_to_cpu(
+ ctx->attr->data.non_resident.data_size);
ni->initialized_size = sle64_to_cpu(
- ctx->attr->_ANR(initialized_size));
+ ctx->attr->data.non_resident.initialized_size);
ni->allocated_size = sle64_to_cpu(
- ctx->attr->_ANR(allocated_size));
+ ctx->attr->data.non_resident.allocated_size);
/*
* We are done with the mft record, so we release it. Otherwise
* we would deadlock in ntfs_attr_iget().
@@ -863,7 +865,7 @@ skip_attr_list_load:
err = PTR_ERR(bvi);
goto unm_err_out;
}
- ni->_IDM(bmp_ino) = bvi;
+ ni->itype.index.bmp_ino = bvi;
bni = NTFS_I(bvi);
if (NInoCompressed(bni) || NInoEncrypted(bni) ||
NInoSparse(bni)) {
@@ -873,7 +875,7 @@ skip_attr_list_load:
}
/* Consistency check bitmap size vs. index allocation size. */
if ((bvi->i_size << 3) < (vi->i_size >>
- ni->_IDM(index_block_size_bits))) {
+ ni->itype.index.block_size_bits)) {
ntfs_error(vi->i_sb, "Index bitmap too small (0x%Lx) "
"for index allocation (0x%Lx).",
bvi->i_size << 3, vi->i_size);
@@ -950,25 +952,28 @@ skip_large_dir_stuff:
"corrupt file.");
goto unm_err_out;
}
- ni->_ICF(compression_block_clusters) = 1U <<
- ctx->attr->_ANR(compression_unit);
- if (ctx->attr->_ANR(compression_unit) != 4) {
+ ni->itype.compressed.block_clusters = 1U <<
+ ctx->attr->data.non_resident.
+ compression_unit;
+ if (ctx->attr->data.non_resident.
+ compression_unit != 4) {
ntfs_error(vi->i_sb, "Found "
"nonstandard compression unit "
"(%u instead of 4). Cannot "
"handle this. This might "
"indicate corruption so you "
"should run chkdsk.",
- ctx->attr->_ANR(compression_unit));
+ ctx->attr->data.non_resident.
+ compression_unit);
err = -EOPNOTSUPP;
goto unm_err_out;
}
- ni->_ICF(compression_block_size) = 1U << (
- ctx->attr->_ANR(
- compression_unit) +
+ ni->itype.compressed.block_size = 1U << (
+ ctx->attr->data.non_resident.
+ compression_unit +
vol->cluster_size_bits);
- ni->_ICF(compression_block_size_bits) = ffs(
- ni->_ICF(compression_block_size)) - 1;
+ ni->itype.compressed.block_size_bits = ffs(
+ ni->itype.compressed.block_size) - 1;
}
if (ctx->attr->flags & ATTR_IS_ENCRYPTED) {
if (ctx->attr->flags & ATTR_COMPRESSION_MASK) {
@@ -980,7 +985,7 @@ skip_large_dir_stuff:
}
if (ctx->attr->flags & ATTR_IS_SPARSE)
NInoSetSparse(ni);
- if (ctx->attr->_ANR(lowest_vcn)) {
+ if (ctx->attr->data.non_resident.lowest_vcn) {
ntfs_error(vi->i_sb, "First extent of $DATA "
"attribute has non zero "
"lowest_vcn. Inode is corrupt. "
@@ -988,24 +993,18 @@ skip_large_dir_stuff:
goto unm_err_out;
}
/* Setup all the sizes. */
- vi->i_size = sle64_to_cpu(ctx->attr->_ANR(data_size));
+ vi->i_size = sle64_to_cpu(
+ ctx->attr->data.non_resident.data_size);
ni->initialized_size = sle64_to_cpu(
- ctx->attr->_ANR(initialized_size));
+ ctx->attr->data.non_resident.
+ initialized_size);
ni->allocated_size = sle64_to_cpu(
- ctx->attr->_ANR(allocated_size));
+ ctx->attr->data.non_resident.
+ allocated_size);
if (NInoCompressed(ni)) {
- ni->_ICF(compressed_size) = sle64_to_cpu(
- ctx->attr->_ANR(compressed_size));
- if (vi->i_size != ni->initialized_size)
- ntfs_warning(vi->i_sb, "BUG: Found "
- "compressed file with "
- "data_size not equal to "
- "initialized_size. This will "
- "probably cause problems when "
- "trying to access the file. "
- "Please notify linux-ntfs-dev@"
- "lists.sf.net that you saw "
- "this message. Thanks!");
+ ni->itype.compressed.size = sle64_to_cpu(
+ ctx->attr->data.non_resident.
+ compressed_size);
}
} else { /* Resident attribute. */
/*
@@ -1015,7 +1014,8 @@ skip_large_dir_stuff:
* path. (Probably only affects truncate().)
*/
vi->i_size = ni->initialized_size = ni->allocated_size =
- le32_to_cpu(ctx->attr->_ARA(value_length));
+ le32_to_cpu(
+ ctx->attr->data.resident.value_length);
}
no_data_attr_special_case:
/* We are done with the mft record, so we release it. */
@@ -1049,7 +1049,7 @@ no_data_attr_special_case:
if (!NInoCompressed(ni))
vi->i_blocks = ni->allocated_size >> 9;
else
- vi->i_blocks = ni->_ICF(compressed_size) >> 9;
+ vi->i_blocks = ni->itype.compressed.size >> 9;
ntfs_debug("Done.");
return 0;
@@ -1146,7 +1146,7 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
* read code paths.
*/
vi->i_size = ni->initialized_size = ni->allocated_size =
- le32_to_cpu(ctx->attr->_ARA(value_length));
+ le32_to_cpu(ctx->attr->data.resident.value_length);
} else {
NInoSetNonResident(ni);
if (ctx->attr->flags & ATTR_COMPRESSION_MASK) {
@@ -1189,25 +1189,27 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
"corrupt file.");
goto unm_err_out;
}
- ni->_ICF(compression_block_clusters) = 1U <<
- ctx->attr->_ANR(compression_unit);
- if (ctx->attr->_ANR(compression_unit) != 4) {
+ ni->itype.compressed.block_clusters = 1U <<
+ ctx->attr->data.non_resident.
+ compression_unit;
+ if (ctx->attr->data.non_resident.compression_unit != 4) {
ntfs_error(vi->i_sb, "Found "
"nonstandard compression unit "
"(%u instead of 4). Cannot "
"handle this. This might "
"indicate corruption so you "
"should run chkdsk.",
- ctx->attr->_ANR(compression_unit));
+ ctx->attr->data.non_resident.
+ compression_unit);
err = -EOPNOTSUPP;
goto unm_err_out;
}
- ni->_ICF(compression_block_size) = 1U << (
- ctx->attr->_ANR(
- compression_unit) +
+ ni->itype.compressed.block_size = 1U << (
+ ctx->attr->data.non_resident.
+ compression_unit +
vol->cluster_size_bits);
- ni->_ICF(compression_block_size_bits) = ffs(
- ni->_ICF(compression_block_size)) - 1;
+ ni->itype.compressed.block_size_bits = ffs(
+ ni->itype.compressed.block_size) - 1;
}
if (ctx->attr->flags & ATTR_IS_ENCRYPTED) {
if (ctx->attr->flags & ATTR_COMPRESSION_MASK) {
@@ -1242,30 +1244,23 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
}
NInoSetSparse(ni);
}
- if (ctx->attr->_ANR(lowest_vcn)) {
+ if (ctx->attr->data.non_resident.lowest_vcn) {
ntfs_error(vi->i_sb, "First extent of attribute has "
"non-zero lowest_vcn. Inode is "
"corrupt. You should run chkdsk.");
goto unm_err_out;
}
/* Setup all the sizes. */
- vi->i_size = sle64_to_cpu(ctx->attr->_ANR(data_size));
+ vi->i_size = sle64_to_cpu(
+ ctx->attr->data.non_resident.data_size);
ni->initialized_size = sle64_to_cpu(
- ctx->attr->_ANR(initialized_size));
+ ctx->attr->data.non_resident.initialized_size);
ni->allocated_size = sle64_to_cpu(
- ctx->attr->_ANR(allocated_size));
+ ctx->attr->data.non_resident.allocated_size);
if (NInoCompressed(ni)) {
- ni->_ICF(compressed_size) = sle64_to_cpu(
- ctx->attr->_ANR(compressed_size));
- if (vi->i_size != ni->initialized_size)
- ntfs_warning(vi->i_sb, "Compressed attribute "
- "with data_size unequal to "
- "initialized size found. This "
- "will probably cause problems "
- "when trying to access the "
- "file. Please notify "
- "linux-ntfs-dev@lists.sf.net "
- "that you saw this message.");
+ ni->itype.compressed.size = sle64_to_cpu(
+ ctx->attr->data.non_resident.
+ compressed_size);
}
}
@@ -1277,14 +1272,14 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
if (!NInoCompressed(ni))
vi->i_blocks = ni->allocated_size >> 9;
else
- vi->i_blocks = ni->_ICF(compressed_size) >> 9;
+ vi->i_blocks = ni->itype.compressed.size >> 9;
/*
* Make sure the base inode doesn't go away and attach it to the
* attribute inode.
*/
igrab(base_vi);
- ni->_INE(base_ntfs_ino) = base_ni;
+ ni->ext.base_ntfs_ino = base_ni;
ni->nr_extents = -1;
put_attr_search_ctx(ctx);
@@ -1371,8 +1366,8 @@ void ntfs_read_inode_mount(struct inode *vi)
* This sets up our little cheat allowing us to reuse the async io
* completion handler for directories.
*/
- ni->_IDM(index_block_size) = vol->mft_record_size;
- ni->_IDM(index_block_size_bits) = vol->mft_record_size_bits;
+ ni->itype.index.block_size = vol->mft_record_size;
+ ni->itype.index.block_size_bits = vol->mft_record_size_bits;
/* Very important! Needed to be able to call map_mft_record*(). */
vol->mft_ino = vi;
@@ -1456,7 +1451,7 @@ void ntfs_read_inode_mount(struct inode *vi)
}
if (ctx->attr->non_resident) {
NInoSetAttrListNonResident(ni);
- if (ctx->attr->_ANR(lowest_vcn)) {
+ if (ctx->attr->data.non_resident.lowest_vcn) {
ntfs_error(sb, "Attribute list has non zero "
"lowest_vcn. $MFT is corrupt. "
"You should run chkdsk.");
@@ -1476,8 +1471,8 @@ void ntfs_read_inode_mount(struct inode *vi)
/* Now load the attribute list. */
if ((err = load_attribute_list(vol, &ni->attr_list_rl,
ni->attr_list, ni->attr_list_size,
- sle64_to_cpu(
- ctx->attr->_ANR(initialized_size))))) {
+ sle64_to_cpu(ctx->attr->data.
+ non_resident.initialized_size)))) {
ntfs_error(sb, "Failed to load attribute list "
"attribute with error code %i.",
-err);
@@ -1485,9 +1480,9 @@ void ntfs_read_inode_mount(struct inode *vi)
}
} else /* if (!ctx.attr->non_resident) */ {
if ((u8*)ctx->attr + le16_to_cpu(
- ctx->attr->_ARA(value_offset)) +
+ ctx->attr->data.resident.value_offset) +
le32_to_cpu(
- ctx->attr->_ARA(value_length)) >
+ ctx->attr->data.resident.value_length) >
(u8*)ctx->mrec + vol->mft_record_size) {
ntfs_error(sb, "Corrupt attribute list "
"attribute.");
@@ -1495,9 +1490,9 @@ void ntfs_read_inode_mount(struct inode *vi)
}
/* Now copy the attribute list. */
memcpy(ni->attr_list, (u8*)ctx->attr + le16_to_cpu(
- ctx->attr->_ARA(value_offset)),
+ ctx->attr->data.resident.value_offset),
le32_to_cpu(
- ctx->attr->_ARA(value_length)));
+ ctx->attr->data.resident.value_length));
}
/* The attribute list is now setup in memory. */
/*
@@ -1606,7 +1601,7 @@ void ntfs_read_inode_mount(struct inode *vi)
if (!next_vcn) {
u64 ll;
- if (attr->_ANR(lowest_vcn)) {
+ if (attr->data.non_resident.lowest_vcn) {
ntfs_error(sb, "First extent of $DATA "
"attribute has non zero "
"lowest_vcn. $MFT is corrupt. "
@@ -1614,14 +1609,16 @@ void ntfs_read_inode_mount(struct inode *vi)
goto put_err_out;
}
/* Get the last vcn in the $DATA attribute. */
- last_vcn = sle64_to_cpu(attr->_ANR(allocated_size)) >>
- vol->cluster_size_bits;
+ last_vcn = sle64_to_cpu(
+ attr->data.non_resident.allocated_size)
+ >> vol->cluster_size_bits;
/* Fill in the inode size. */
- vi->i_size = sle64_to_cpu(attr->_ANR(data_size));
- ni->initialized_size = sle64_to_cpu(
- attr->_ANR(initialized_size));
+ vi->i_size = sle64_to_cpu(
+ attr->data.non_resident.data_size);
+ ni->initialized_size = sle64_to_cpu(attr->data.
+ non_resident.initialized_size);
ni->allocated_size = sle64_to_cpu(
- attr->_ANR(allocated_size));
+ attr->data.non_resident.allocated_size);
/* Set the number of mft records. */
ll = vi->i_size >> vol->mft_record_size_bits;
/*
@@ -1687,7 +1684,7 @@ void ntfs_read_inode_mount(struct inode *vi)
}
/* Get the lowest vcn for the next extent. */
- highest_vcn = sle64_to_cpu(attr->_ANR(highest_vcn));
+ highest_vcn = sle64_to_cpu(attr->data.non_resident.highest_vcn);
next_vcn = highest_vcn + 1;
/* Only one extent or error, which we catch below. */
@@ -1695,7 +1692,8 @@ void ntfs_read_inode_mount(struct inode *vi)
break;
/* Avoid endless loops due to corruption. */
- if (next_vcn < sle64_to_cpu(attr->_ANR(lowest_vcn))) {
+ if (next_vcn < sle64_to_cpu(
+ attr->data.non_resident.lowest_vcn)) {
ntfs_error(sb, "$MFT has corrupt attribute list "
"attribute. Run chkdsk.");
goto put_err_out;
@@ -1796,9 +1794,9 @@ void ntfs_put_inode(struct inode *vi)
ntfs_inode *ni;
ni = NTFS_I(vi);
- if (NInoIndexAllocPresent(ni) && ni->_IDM(bmp_ino)) {
- iput(ni->_IDM(bmp_ino));
- ni->_IDM(bmp_ino) = NULL;
+ if (NInoIndexAllocPresent(ni) && ni->itype.index.bmp_ino) {
+ iput(ni->itype.index.bmp_ino);
+ ni->itype.index.bmp_ino = NULL;
}
}
return;
@@ -1831,8 +1829,8 @@ void __ntfs_clear_inode(ntfs_inode *ni)
// FIXME: Handle dirty case for each extent inode!
for (i = 0; i < ni->nr_extents; i++)
- ntfs_clear_extent_inode(ni->_INE(extent_ntfs_inos)[i]);
- kfree(ni->_INE(extent_ntfs_inos));
+ ntfs_clear_extent_inode(ni->ext.extent_ntfs_inos[i]);
+ kfree(ni->ext.extent_ntfs_inos);
}
/* Free all alocated memory. */
down_write(&ni->run_list.lock);
@@ -1888,9 +1886,9 @@ void ntfs_clear_big_inode(struct inode *vi)
if (NInoAttr(ni)) {
/* Release the base inode if we are holding it. */
if (ni->nr_extents == -1) {
- iput(VFS_I(ni->_INE(base_ntfs_ino)));
+ iput(VFS_I(ni->ext.base_ntfs_ino));
ni->nr_extents = 0;
- ni->_INE(base_ntfs_ino) = NULL;
+ ni->ext.base_ntfs_ino = NULL;
}
}
return;
diff --git a/fs/ntfs/inode.h b/fs/ntfs/inode.h
index 60ee56fe7174..82b3b22556a6 100644
--- a/fs/ntfs/inode.h
+++ b/fs/ntfs/inode.h
@@ -2,8 +2,8 @@
* inode.h - Defines for inode structures NTFS Linux kernel driver. Part of
* the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (c) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -93,23 +93,21 @@ struct _ntfs_inode {
struct { /* It is a directory or $MFT. */
struct inode *bmp_ino; /* Attribute inode for the
directory index $BITMAP. */
- u32 index_block_size; /* Size of an index block. */
- u32 index_vcn_size; /* Size of a vcn in this
+ u32 block_size; /* Size of an index block. */
+ u32 vcn_size; /* Size of a vcn in this
directory index. */
- u8 index_block_size_bits; /* Log2 of the above. */
- u8 index_vcn_size_bits; /* Log2 of the above. */
- } SN(idm);
+ u8 block_size_bits; /* Log2 of the above. */
+ u8 vcn_size_bits; /* Log2 of the above. */
+ } index;
struct { /* It is a compressed file or fake inode. */
- s64 compressed_size; /* Copy from $DATA. */
- u32 compression_block_size; /* Size of a compression
- block (cb). */
- u8 compression_block_size_bits; /* Log2 of the size of
- a cb. */
- u8 compression_block_clusters; /* Number of clusters
- per compression
- block. */
- } SN(icf);
- } SN(idc);
+ s64 size; /* Copy of compressed_size from
+ $DATA. */
+ u32 block_size; /* Size of a compression block
+ (cb). */
+ u8 block_size_bits; /* Log2 of the size of a cb. */
+ u8 block_clusters; /* Number of clusters per cb. */
+ } compressed;
+ } itype;
struct semaphore extent_lock; /* Lock for accessing/modifying the
below . */
s32 nr_extents; /* For a base mft record, the number of attached extent
@@ -126,13 +124,9 @@ struct _ntfs_inode {
record. For fake inodes, the
real (base) inode to which
the attribute belongs. */
- } SN(ine);
+ } ext;
};
-#define _IDM(X) SC(idc.idm,X)
-#define _ICF(X) SC(idc.icf,X)
-#define _INE(X) SC(ine,X)
-
/*
* Defined bits for the state field in the ntfs_inode structure.
* (f) = files only, (d) = directories only, (a) = attributes/fake inodes only
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h
index bccc0e9e00d4..19ce024c2bbc 100644
--- a/fs/ntfs/layout.h
+++ b/fs/ntfs/layout.h
@@ -2,8 +2,8 @@
* layout.h - All NTFS associated on-disk structures. Part of the Linux-NTFS
* project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (C) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -296,7 +296,11 @@ typedef u64 MFT_REF;
*/
typedef struct {
/*Ofs*/
-/* 0*/ NTFS_RECORD SN(mnr); /* Usually the magic is "FILE". */
+/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */
+ NTFS_RECORD_TYPES magic;/* Usually the magic is "FILE". */
+ u16 usa_ofs; /* See NTFS_RECORD definition above. */
+ u16 usa_count; /* See NTFS_RECORD definition above. */
+
/* 8*/ u64 lsn; /* $LogFile sequence number for this record.
Changed every time the record is modified. */
/* 16*/ u16 sequence_number; /* Number of times this mft record has been
@@ -360,8 +364,6 @@ typedef struct {
*/
} __attribute__ ((__packed__)) MFT_RECORD;
-#define _MNR(X) SC(mnr,X)
-
/*
* System defined attributes (32-bit). Each attribute type has a corresponding
* attribute name (Unicode string of maximum 64 character length) as described
@@ -612,10 +614,10 @@ typedef struct {
have a name present as this might
not have a length of a multiple
of 8-bytes. */
-/* 22 */ RESIDENT_ATTR_FLAGS resident_flags; /* See above. */
-/* 23 */ s8 reservedR; /* Reserved/alignment to 8-byte
+/* 22 */ RESIDENT_ATTR_FLAGS flags; /* See above. */
+/* 23 */ s8 reserved; /* Reserved/alignment to 8-byte
boundary. */
- } SN(ara) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) resident;
/* Non-resident attributes. */
struct {
/* 16*/ VCN lowest_vcn; /* Lowest valid virtual cluster number
@@ -641,7 +643,7 @@ typedef struct {
compressed. (This effectively limits the
compression unit size to be a power of two
clusters.) WinNT4 only uses a value of 4. */
-/* 35*/ u8 reserved1[5]; /* Align to 8-byte boundary. */
+/* 35*/ u8 reserved[5]; /* Align to 8-byte boundary. */
/* The sizes below are only used when lowest_vcn is zero, as otherwise it would
be difficult to keep them up-to-date.*/
/* 40*/ s64 allocated_size; /* Byte size of disk space
@@ -665,13 +667,10 @@ typedef struct {
cluster size. Represents the actual amount of
disk space being used on the disk. */
/* sizeof(compressed attr) = 72*/
- } SN(anr) __attribute__ ((__packed__));
- } SN(aua) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) non_resident;
+ } __attribute__ ((__packed__)) data;
} __attribute__ ((__packed__)) ATTR_RECORD;
-#define _ARA(X) SC(aua.ara,X)
-#define _ANR(X) SC(aua.anr,X)
-
typedef ATTR_RECORD ATTR_REC;
/*
@@ -763,11 +762,13 @@ typedef struct {
disabled altogether for speed. */
/* 32*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */
/* 36*/ union {
- /* NTFS 1.2 (and previous, presumably) */
-/* 36 */ u8 reserved12[12]; /* Reserved/alignment to 8-byte
- boundary. */
-/* sizeof() = 48 bytes */
- /* NTFS 3.0 */
+ /* NTFS 1.2 */
+ struct {
+ /* 36*/ u8 reserved12[12]; /* Reserved/alignment to 8-byte
+ boundary. */
+ } __attribute__ ((__packed__)) v1;
+ /* sizeof() = 48 bytes */
+ /* NTFS 3.x */
struct {
/*
* If a volume has been upgraded from a previous NTFS version, then these
@@ -777,12 +778,12 @@ typedef struct {
* the fields are present. Maybe just check like this:
* if (resident.ValueLength < sizeof(STANDARD_INFORMATION)) {
* Assume NTFS 1.2- format.
- * If (volume version is 3.0+)
- * Upgrade attribute to NTFS 3.0 format.
+ * If (volume version is 3.x)
+ * Upgrade attribute to NTFS 3.x format.
* else
* Use NTFS 1.2- format for access.
* } else
- * Use NTFS 3.0 format for access.
+ * Use NTFS 3.x format for access.
* Only problem is that it might be legal to set the length of the value to
* arbitrarily large values thus spoiling this check. - But chkdsk probably
* views that as a corruption, assuming that it behaves like this for all
@@ -818,13 +819,11 @@ typedef struct {
partition. This, in contrast to disabling the
journal is a very fast process, so the user
won't even notice it. */
- } SN(svs);
- } SN(sei);
-/* sizeof() = 72 bytes (NTFS 3.0) */
+ } __attribute__ ((__packed__)) v3;
+ /* sizeof() = 72 bytes (NTFS 3.x) */
+ } __attribute__ ((__packed__)) ver;
} __attribute__ ((__packed__)) STANDARD_INFORMATION;
-#define _SVS(X) SC(sei.svs,X)
-
/*
* Attribute: Attribute list (0x20).
*
@@ -956,21 +955,20 @@ typedef struct {
pack the extended attributes
(EAs), if such are present.*/
/* 3e*/ u16 reserved; /* Reserved for alignment. */
- } SN(fea) __attribute__ ((__packed__));
- /* 3c*/ u32 reparse_point_tag; /* Type of reparse point,
+ } __attribute__ ((__packed__)) ea;
+ /* 3c*/ struct {
+ /* 3c*/ u32 reparse_point_tag; /* Type of reparse point,
present only in reparse
points and only if there are
no EAs. */
- } SN(fer) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) rp;
+ } __attribute__ ((__packed__)) type;
/* 40*/ u8 file_name_length; /* Length of file name in
(Unicode) characters. */
/* 41*/ FILE_NAME_TYPE_FLAGS file_name_type; /* Namespace of the file name.*/
/* 42*/ uchar_t file_name[0]; /* File name in Unicode. */
} __attribute__ ((__packed__)) FILE_NAME_ATTR;
-#define _FEA(X) SC(fer.fea,X)
-#define _FER(X) SC(fer,X)
-
/*
* GUID structures store globally unique identifiers (GUID). A GUID is a
* 128-bit value consisting of one group of eight hexadecimal digits, followed
@@ -1008,9 +1006,9 @@ typedef struct {
GUID birth_volume_id;
GUID birth_object_id;
GUID domain_id;
- } SN(obv) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) origin;
u8 extended_info[48];
- } SN(oei) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) opt;
} __attribute__ ((__packed__)) OBJ_ID_INDEX_DATA;
/*
@@ -1032,13 +1030,11 @@ typedef struct {
GUID birth_object_id; /* Unique id of file when it was
first created. */
GUID domain_id; /* Reserved, zero. */
- } SN(obv) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) origin;
u8 extended_info[48];
- } SN(oei) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) opt;
} __attribute__ ((__packed__)) OBJECT_ID_ATTR;
-#define _OBV(X) SC(oei.obv,X)
-
/*
* The pre-defined IDENTIFIER_AUTHORITIES used as SID_IDENTIFIER_AUTHORITY in
* the SID structure (see below).
@@ -1174,14 +1170,12 @@ typedef enum { /* Identifier authority. */
*/
typedef union {
struct {
- u32 low_part; /* Low 32-bits. */
- u16 high_part; /* High 16-bits. */
- } SN(sia) __attribute__ ((__packed__));
+ u32 low; /* Low 32-bits. */
+ u16 high; /* High 16-bits. */
+ } __attribute__ ((__packed__)) parts;
u8 value[6]; /* Value as individual bytes. */
} __attribute__ ((__packed__)) SID_IDENTIFIER_AUTHORITY;
-#define _SIA(X) SC(sia,X)
-
/*
* The SID structure is a variable-length structure used to uniquely identify
* users or groups. SID stands for security identifier.
@@ -1287,9 +1281,10 @@ typedef enum {
* data depends on the ACE type.
*/
typedef struct {
- ACE_TYPES type; /* Type of the ACE. */
- ACE_FLAGS flags; /* Flags describing the ACE. */
- u16 size; /* Size in bytes of the ACE. */
+/*Ofs*/
+/* 0*/ ACE_TYPES type; /* Type of the ACE. */
+/* 1*/ ACE_FLAGS flags; /* Flags describing the ACE. */
+/* 2*/ u16 size; /* Size in bytes of the ACE. */
} __attribute__ ((__packed__)) ACE_HEADER;
/*
@@ -1446,12 +1441,15 @@ typedef struct {
* ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE, SYSTEM_AUDIT_ACE, SYSTEM_ALARM_ACE
*/
typedef struct {
- ACE_HEADER SN(aah); /* The ACE header. */
- ACCESS_MASK mask; /* Access mask associated with the ACE. */
- SID sid; /* The SID associated with the ACE. */
+/* 0 ACE_HEADER; -- Unfolded here as gcc doesn't like unnamed structs. */
+ ACE_TYPES type; /* Type of the ACE. */
+ ACE_FLAGS flags; /* Flags describing the ACE. */
+ u16 size; /* Size in bytes of the ACE. */
+/* 4*/ ACCESS_MASK mask; /* Access mask associated with the ACE. */
+
+/* 8*/ SID sid; /* The SID associated with the ACE. */
} __attribute__ ((__packed__)) ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE,
SYSTEM_AUDIT_ACE, SYSTEM_ALARM_ACE;
-#define _AAH(X) SC(aah,X)
/*
* The object ACE flags (32-bit).
@@ -1462,12 +1460,17 @@ typedef enum {
} OBJECT_ACE_FLAGS;
typedef struct {
- ACE_HEADER SN(aah); /* The ACE_HEADER. */
- ACCESS_MASK mask; /* Access mask associated with the ACE. */
- OBJECT_ACE_FLAGS flags; /* Flags describing the object ACE. */
- GUID object_type;
- GUID inherited_object_type;
- SID sid; /* The SID associated with the ACE. */
+/* 0 ACE_HEADER; -- Unfolded here as gcc doesn't like unnamed structs. */
+ ACE_TYPES type; /* Type of the ACE. */
+ ACE_FLAGS flags; /* Flags describing the ACE. */
+ u16 size; /* Size in bytes of the ACE. */
+/* 4*/ ACCESS_MASK mask; /* Access mask associated with the ACE. */
+
+/* 8*/ OBJECT_ACE_FLAGS object_flags; /* Flags describing the object ACE. */
+/* 12*/ GUID object_type;
+/* 28*/ GUID inherited_object_type;
+
+/* 44*/ SID sid; /* The SID associated with the ACE. */
} __attribute__ ((__packed__)) ACCESS_ALLOWED_OBJECT_ACE,
ACCESS_DENIED_OBJECT_ACE,
SYSTEM_AUDIT_OBJECT_ACE,
@@ -1711,13 +1714,17 @@ typedef struct {
* $SDS data stream and the second copy will be at offset 0x451d0.
*/
typedef struct {
- SECURITY_DESCRIPTOR_HEADER SN(sdh); /* The security descriptor header. */
- SECURITY_DESCRIPTOR_RELATIVE sid; /* The self-relative security
+/*Ofs*/
+/* 0 SECURITY_DESCRIPTOR_HEADER; -- Unfolded here as gcc doesn't like
+ unnamed structs. */
+ u32 hash; /* Hash of the security descriptor. */
+ u32 security_id; /* The security_id assigned to the descriptor. */
+ u64 offset; /* Byte offset of this entry in the $SDS stream. */
+ u32 length; /* Size in bytes of this entry in $SDS stream. */
+/* 20*/ SECURITY_DESCRIPTOR_RELATIVE sid; /* The self-relative security
descriptor. */
} __attribute__ ((__packed__)) SDS_ENTRY;
-#define _SDH(X) SC(sdh,X)
-
/*
* The index entry key used in the $SII index. The collation type is
* COLLATION_NTOFS_ULONG.
@@ -1888,7 +1895,11 @@ typedef struct {
* index entries (INDEX_ENTRY structures), as described by the INDEX_HEADER.
*/
typedef struct {
-/* 0*/ NTFS_RECORD SN(inr); /* Magic is "INDX". */
+/* 0 NTFS_RECORD; -- Unfolded here as gcc doesn't like unnamed structs. */
+ NTFS_RECORD_TYPES magic;/* Magic is "INDX". */
+ u16 usa_ofs; /* See NTFS_RECORD definition. */
+ u16 usa_count; /* See NTFS_RECORD definition. */
+
/* 8*/ s64 lsn; /* $LogFile sequence number of the last
modification of this index block. */
/* 16*/ VCN index_block_vcn; /* Virtual cluster number of the index block.
@@ -1909,8 +1920,6 @@ typedef struct {
*/
} __attribute__ ((__packed__)) INDEX_BLOCK;
-#define _INR(X) SC(inr,X)
-
typedef INDEX_BLOCK INDEX_ALLOCATION;
/*
@@ -2014,19 +2023,21 @@ typedef enum {
* This the index entry header (see below).
*/
typedef struct {
-/* 0*/ union { /* Only valid when INDEX_ENTRY_END is not set. */
- MFT_REF indexed_file; /* The mft reference of the file
+/* 0*/ union {
+ struct { /* Only valid when INDEX_ENTRY_END is not set. */
+ MFT_REF indexed_file; /* The mft reference of the file
described by this index
entry. Used for directory
indexes. */
+ } __attribute__ ((__packed__)) dir;
struct { /* Used for views/indexes to find the entry's data. */
u16 data_offset; /* Data byte offset from this
INDEX_ENTRY. Follows the
index key. */
u16 data_length; /* Data length in bytes. */
u32 reservedV; /* Reserved (zero). */
- } SN(iev) __attribute__ ((__packed__));
- } SN(iif) __attribute__ ((__packed__));
+ } __attribute__ ((__packed__)) vi;
+ } __attribute__ ((__packed__)) data;
/* 8*/ u16 length; /* Byte size of this index entry, multiple of
8-bytes. */
/* 10*/ u16 key_length; /* Byte size of the key value, which is in the
@@ -2037,9 +2048,6 @@ typedef struct {
/* sizeof() = 16 bytes */
} __attribute__ ((__packed__)) INDEX_ENTRY_HEADER;
-#define _IIF(X) SC(ieh.iif,X)
-#define _IEV(X) SC(iif.iev,X)
-
/*
* This is an index entry. A sequence of such entries follows each INDEX_HEADER
* structure. Together they make up a complete index. The index follows either
@@ -2048,7 +2056,31 @@ typedef struct {
* NOTE: Before NTFS 3.0 only filename attributes were indexed.
*/
typedef struct {
-/* 0*/ INDEX_ENTRY_HEADER SN(ieh); /* The index entry header (see above). */
+/*Ofs*/
+/* 0 INDEX_ENTRY_HEADER; -- Unfolded here as gcc dislikes unnamed structs. */
+ union {
+ struct { /* Only valid when INDEX_ENTRY_END is not set. */
+ MFT_REF indexed_file; /* The mft reference of the file
+ described by this index
+ entry. Used for directory
+ indexes. */
+ } __attribute__ ((__packed__)) dir;
+ struct { /* Used for views/indexes to find the entry's data. */
+ u16 data_offset; /* Data byte offset from this
+ INDEX_ENTRY. Follows the
+ index key. */
+ u16 data_length; /* Data length in bytes. */
+ u32 reservedV; /* Reserved (zero). */
+ } __attribute__ ((__packed__)) vi;
+ } __attribute__ ((__packed__)) data;
+ u16 length; /* Byte size of this index entry, multiple of
+ 8-bytes. */
+ u16 key_length; /* Byte size of the key value, which is in the
+ index entry. It follows field reserved. Not
+ multiple of 8-bytes. */
+ INDEX_ENTRY_FLAGS flags; /* Bit field of INDEX_ENTRY_* flags. */
+ u16 reserved; /* Reserved/align to 8-byte boundary. */
+
/* 16*/ union { /* The key of the indexed attribute. NOTE: Only present
if INDEX_ENTRY_END bit in flags is not set. NOTE: On
NTFS versions before 3.0 the only valid key is the
@@ -2060,7 +2092,8 @@ typedef struct {
GUID object_id; /* $O index in FILE_Extend/$ObjId: The
object_id of the mft record found in
the data part of the index. */
- REPARSE_INDEX_KEY SN(iri); /* $R index in FILE_Extend/$Reparse. */
+ REPARSE_INDEX_KEY reparse; /* $R index in
+ FILE_Extend/$Reparse. */
SID sid; /* $O index in FILE_Extend/$Quota:
SID of the owner of the user_id. */
u32 owner_id; /* $Q index in FILE_Extend/$Quota:
@@ -2083,9 +2116,6 @@ typedef struct {
// where sizeof(VCN) can be hardcoded as 8 if wanted. */
} __attribute__ ((__packed__)) INDEX_ENTRY;
-#define _IEH(X) SC(ieh,X)
-#define _IRI(X) SC(key.iri,X)
-
/*
* Attribute: Bitmap (0xb0).
*
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index 95f3cb04112f..ed793fbc5b3f 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -1,8 +1,8 @@
/**
* mft.c - NTFS kernel mft record operations. Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (c) 2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -39,18 +39,18 @@ static void __format_mft_record(MFT_RECORD *m, const int size,
ATTR_RECORD *a;
memset(m, 0, size);
- m->_MNR(magic) = magic_FILE;
+ m->magic = magic_FILE;
/* Aligned to 2-byte boundary. */
- m->_MNR(usa_ofs) = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1);
- m->_MNR(usa_count) = cpu_to_le16(size / NTFS_BLOCK_SIZE + 1);
+ m->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1);
+ m->usa_count = cpu_to_le16(size / NTFS_BLOCK_SIZE + 1);
/* Set the update sequence number to 1. */
*(u16*)((char*)m + ((sizeof(MFT_RECORD) + 1) & ~1)) = cpu_to_le16(1);
m->lsn = cpu_to_le64(0LL);
m->sequence_number = cpu_to_le16(1);
m->link_count = cpu_to_le16(0);
/* Aligned to 8-byte boundary. */
- m->attrs_offset = cpu_to_le16((le16_to_cpu(m->_MNR(usa_ofs)) +
- (le16_to_cpu(m->_MNR(usa_count)) << 1) + 7) & ~7);
+ m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) +
+ (le16_to_cpu(m->usa_count) << 1) + 7) & ~7);
m->flags = cpu_to_le16(0);
/*
* Using attrs_offset plus eight bytes (for the termination attribute),
@@ -329,7 +329,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
*/
down(&base_ni->extent_lock);
if (base_ni->nr_extents > 0) {
- extent_nis = base_ni->_INE(extent_ntfs_inos);
+ extent_nis = base_ni->ext.extent_ntfs_inos;
for (i = 0; i < base_ni->nr_extents; i++) {
if (mft_no != extent_nis[i]->mft_no)
continue;
@@ -374,7 +374,7 @@ map_err_out:
ni->vol = base_ni->vol;
ni->seq_no = seq_no;
ni->nr_extents = -1;
- ni->_INE(base_ntfs_ino) = base_ni;
+ ni->ext.base_ntfs_ino = base_ni;
/* Now map the record. */
m = map_mft_record(ni);
if (unlikely(IS_ERR(m))) {
@@ -404,14 +404,14 @@ map_err_out:
m = ERR_PTR(-ENOMEM);
goto unm_err_out;
}
- if (base_ni->_INE(extent_ntfs_inos)) {
- memcpy(tmp, base_ni->_INE(extent_ntfs_inos), new_size -
+ if (base_ni->ext.extent_ntfs_inos) {
+ memcpy(tmp, base_ni->ext.extent_ntfs_inos, new_size -
4 * sizeof(ntfs_inode *));
- kfree(base_ni->_INE(extent_ntfs_inos));
+ kfree(base_ni->ext.extent_ntfs_inos);
}
- base_ni->_INE(extent_ntfs_inos) = tmp;
+ base_ni->ext.extent_ntfs_inos = tmp;
}
- base_ni->_INE(extent_ntfs_inos)[base_ni->nr_extents++] = ni;
+ base_ni->ext.extent_ntfs_inos[base_ni->nr_extents++] = ni;
up(&base_ni->extent_lock);
atomic_dec(&base_ni->count);
ntfs_debug("Done 2.");
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index a08ab2c9da5a..84d43247ba6e 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -2,7 +2,7 @@
* namei.c - NTFS kernel directory inode operations. Part of the Linux-NTFS
* project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -210,12 +210,12 @@ handle_name:
a = ctx->attr;
if (a->non_resident || a->flags)
goto eio_err_out;
- val_len = le32_to_cpu(a->_ARA(value_length));
- if (le16_to_cpu(a->_ARA(value_offset)) + val_len >
- le32_to_cpu(a->length))
+ val_len = le32_to_cpu(a->data.resident.value_length);
+ if (le16_to_cpu(a->data.resident.value_offset) +
+ val_len > le32_to_cpu(a->length))
goto eio_err_out;
fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + le16_to_cpu(
- ctx->attr->_ARA(value_offset)));
+ ctx->attr->data.resident.value_offset));
if ((u32)(fn->file_name_length * sizeof(uchar_t) +
sizeof(FILE_NAME_ATTR)) > val_len)
goto eio_err_out;
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 5361198e1b80..cb3aeea03410 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -1,8 +1,8 @@
/*
* super.c - NTFS kernel super block handling. Part of the Linux-NTFS project.
*
- * Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (c) 2001,2002 Richard Russon.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
+ * Copyright (c) 2001,2002 Richard Russon
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -619,9 +619,8 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b)
* the same as it is much faster on 32-bit CPUs.
*/
ll = sle64_to_cpu(b->number_of_sectors) >> sectors_per_cluster_bits;
- if ((u64)ll >= 1ULL << (sizeof(unsigned long) * 8)) {
- ntfs_error(vol->sb, "Cannot handle %i-bit clusters. Sorry.",
- sizeof(unsigned long) * 4);
+ if ((u64)ll >= 1ULL << 32) {
+ ntfs_error(vol->sb, "Cannot handle 64-bit clusters. Sorry.");
return FALSE;
}
vol->nr_clusters = ll;
@@ -884,10 +883,10 @@ get_ctx_vol_failed:
goto iput_volume_failed;
}
vi = (VOLUME_INFORMATION*)((char*)ctx->attr +
- le16_to_cpu(ctx->attr->_ARA(value_offset)));
+ le16_to_cpu(ctx->attr->data.resident.value_offset));
/* Some bounds checks. */
if ((u8*)vi < (u8*)ctx->attr || (u8*)vi +
- le32_to_cpu(ctx->attr->_ARA(value_length)) >
+ le32_to_cpu(ctx->attr->data.resident.value_length) >
(u8*)ctx->attr + le32_to_cpu(ctx->attr->length))
goto err_put_vol;
/* Setup volume flags and version. */
@@ -1060,78 +1059,93 @@ static void ntfs_put_super(struct super_block *vfs_sb)
* get_nr_free_clusters - return the number of free clusters on a volume
* @vol: ntfs volume for which to obtain free cluster count
*
- * Calculate the number of free clusters on the mounted NTFS volume @vol.
+ * Calculate the number of free clusters on the mounted NTFS volume @vol. We
+ * actually calculate the number of clusters in use instead because this
+ * allows us to not care about partial pages as these will be just zero filled
+ * and hence not be counted as allocated clusters.
*
- * Errors are ignored and we just return the number of free clusters we have
- * found. This means we return an underestimate on error.
+ * The only particularity is that clusters beyond the end of the logical ntfs
+ * volume will be marked as allocated to prevent errors which means we have to
+ * discount those at the end. This is important as the cluster bitmap always
+ * has a size in multiples of 8 bytes, i.e. up to 63 clusters could be outside
+ * the logical volume and marked in use when they are not as they do not exist.
+ *
+ * If any pages cannot be read we assume all clusters in the erroring pages are
+ * in use. This means we return an underestimate on errors which is better than
+ * an overestimate.
*/
static s64 get_nr_free_clusters(ntfs_volume *vol)
{
+ s64 nr_free = vol->nr_clusters;
+ u32 *kaddr;
struct address_space *mapping = vol->lcnbmp_ino->i_mapping;
filler_t *readpage = (filler_t*)mapping->a_ops->readpage;
struct page *page;
unsigned long index, max_index;
- unsigned int max_size, i;
- s64 nr_free = 0LL;
- u32 *b;
+ unsigned int max_size;
ntfs_debug("Entering.");
/* Serialize accesses to the cluster bitmap. */
down_read(&vol->lcnbmp_lock);
/*
* Convert the number of bits into bytes rounded up, then convert into
- * multiples of PAGE_CACHE_SIZE.
+ * multiples of PAGE_CACHE_SIZE, rounding up so that if we have one
+ * full and one partial page max_index = 2.
*/
- max_index = (vol->nr_clusters + 7) >> (3 + PAGE_CACHE_SHIFT);
+ max_index = (((vol->nr_clusters + 7) >> 3) + PAGE_CACHE_SIZE - 1) >>
+ PAGE_CACHE_SHIFT;
/* Use multiples of 4 bytes. */
max_size = PAGE_CACHE_SIZE >> 2;
- ntfs_debug("Reading $BITMAP, max_index = 0x%lx, max_size = 0x%x.",
+ ntfs_debug("Reading $Bitmap, max_index = 0x%lx, max_size = 0x%x.",
max_index, max_size);
- for (index = 0UL; index < max_index;) {
-handle_partial_page:
+ for (index = 0UL; index < max_index; index++) {
+ unsigned int i;
/*
* Read the page from page cache, getting it from backing store
* if necessary, and increment the use count.
*/
- page = read_cache_page(mapping, index++, (filler_t*)readpage,
+ page = read_cache_page(mapping, index, (filler_t*)readpage,
NULL);
/* Ignore pages which errored synchronously. */
if (IS_ERR(page)) {
ntfs_debug("Sync read_cache_page() error. Skipping "
- "page (index 0x%lx).", index - 1);
+ "page (index 0x%lx).", index);
+ nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
wait_on_page_locked(page);
+ /* Ignore pages which errored asynchronously. */
if (!PageUptodate(page)) {
ntfs_debug("Async read_cache_page() error. Skipping "
- "page (index 0x%lx).", index - 1);
- /* Ignore pages which errored asynchronously. */
+ "page (index 0x%lx).", index);
page_cache_release(page);
+ nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
- b = (u32*)kmap(page);
- /* For each 4 bytes, add up the number zero bits. */
- for (i = 0; i < max_size; i++)
- nr_free += (s64)(32 - hweight32(b[i]));
- kunmap(page);
- page_cache_release(page);
- }
- if (max_size == PAGE_CACHE_SIZE >> 2) {
+ kaddr = (u32*)kmap_atomic(page, KM_USER0);
/*
- * Get the multiples of 4 bytes in use in the final partial
- * page.
+ * For each 4 bytes, subtract the number of set bits. If this
+ * is the last page and it is partial we don't really care as
+ * it just means we do a little extra work but it won't affect
+ * the result as all out of range bytes are set to zero by
+ * ntfs_readpage().
*/
- max_size = ((((vol->nr_clusters + 7) >> 3) & ~PAGE_CACHE_MASK)
- + 3) >> 2;
- /* If there is a partial page go back and do it. */
- if (max_size) {
- ntfs_debug("Handling partial page, max_size = 0x%x.",
- max_size);
- goto handle_partial_page;
- }
+ for (i = 0; i < max_size; i++)
+ nr_free -= (s64)hweight32(kaddr[i]);
+ kunmap_atomic(kaddr, KM_USER0);
+ page_cache_release(page);
}
- ntfs_debug("Finished reading $BITMAP, last index = 0x%lx", index - 1);
+ ntfs_debug("Finished reading $Bitmap, last index = 0x%lx.", index - 1);
+ /*
+ * Fixup for eventual bits outside logical ntfs volume (see function
+ * description above).
+ */
+ if (vol->nr_clusters & 63)
+ nr_free += 64 - (vol->nr_clusters & 63);
up_read(&vol->lcnbmp_lock);
+ /* If errors occured we may well have gone below zero, fix this. */
+ if (nr_free < 0)
+ nr_free = 0;
ntfs_debug("Exiting.");
return nr_free;
}
@@ -1141,64 +1155,81 @@ handle_partial_page:
* @vol: ntfs volume for which to obtain free inode count
*
* Calculate the number of free mft records (inodes) on the mounted NTFS
- * volume @vol.
+ * volume @vol. We actually calculate the number of mft records in use instead
+ * because this allows us to not care about partial pages as these will be just
+ * zero filled and hence not be counted as allocated mft record.
*
- * Errors are ignored and we just return the number of free inodes we have
- * found. This means we return an underestimate on error.
+ * If any pages cannot be read we assume all mft records in the erroring pages
+ * are in use. This means we return an underestimate on errors which is better
+ * than an overestimate.
*
* NOTE: Caller must hold mftbmp_lock rw_semaphore for reading or writing.
*/
static unsigned long __get_nr_free_mft_records(ntfs_volume *vol)
{
- struct address_space *mapping;
+ s64 nr_free = vol->nr_mft_records;
+ u32 *kaddr;
+ struct address_space *mapping = vol->mftbmp_ino->i_mapping;
+ filler_t *readpage = (filler_t*)mapping->a_ops->readpage;
struct page *page;
- unsigned long index, max_index, nr_free = 0;
- unsigned int max_size, i;
- u32 *b;
+ unsigned long index, max_index;
+ unsigned int max_size;
- mapping = vol->mftbmp_ino->i_mapping;
+ ntfs_debug("Entering.");
/*
- * Convert the number of bits into bytes rounded up to a multiple of 8
- * bytes, then convert into multiples of PAGE_CACHE_SIZE.
+ * Convert the number of bits into bytes rounded up, then convert into
+ * multiples of PAGE_CACHE_SIZE, rounding up so that if we have one
+ * full and one partial page max_index = 2.
*/
- max_index = (((vol->nr_mft_records + 7) >> 3) + 7) >> PAGE_CACHE_SHIFT;
+ max_index = (((vol->nr_mft_records + 7) >> 3) + PAGE_CACHE_SIZE - 1) >>
+ PAGE_CACHE_SHIFT;
/* Use multiples of 4 bytes. */
max_size = PAGE_CACHE_SIZE >> 2;
ntfs_debug("Reading $MFT/$BITMAP, max_index = 0x%lx, max_size = "
"0x%x.", max_index, max_size);
- for (index = 0UL; index < max_index;) {
-handle_partial_page:
- page = ntfs_map_page(mapping, index++);
+ for (index = 0UL; index < max_index; index++) {
+ unsigned int i;
+ /*
+ * Read the page from page cache, getting it from backing store
+ * if necessary, and increment the use count.
+ */
+ page = read_cache_page(mapping, index, (filler_t*)readpage,
+ NULL);
+ /* Ignore pages which errored synchronously. */
if (IS_ERR(page)) {
- ntfs_debug("ntfs_map_page() error. Skipping page "
- "(index 0x%lx).", index - 1);
+ ntfs_debug("Sync read_cache_page() error. Skipping "
+ "page (index 0x%lx).", index);
+ nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
- b = (u32*)page_address(page);
- /* For each 4 bytes, add up the number of zero bits. */
- for (i = 0; i < max_size; i++)
- nr_free += 32 - hweight32(b[i]);
- ntfs_unmap_page(page);
- }
- if (index == max_index) {
+ wait_on_page_locked(page);
+ /* Ignore pages which errored asynchronously. */
+ if (!PageUptodate(page)) {
+ ntfs_debug("Async read_cache_page() error. Skipping "
+ "page (index 0x%lx).", index);
+ page_cache_release(page);
+ nr_free -= PAGE_CACHE_SIZE * 8;
+ continue;
+ }
+ kaddr = (u32*)kmap_atomic(page, KM_USER0);
/*
- * Get the multiples of 4 bytes in use in the final partial
- * page.
+ * For each 4 bytes, subtract the number of set bits. If this
+ * is the last page and it is partial we don't really care as
+ * it just means we do a little extra work but it won't affect
+ * the result as all out of range bytes are set to zero by
+ * ntfs_readpage().
*/
- max_size = ((((((vol->nr_mft_records + 7) >> 3) + 7) & ~7) &
- ~PAGE_CACHE_MASK) + 3) >> 2;
- /* If there is a partial page go back and do it. */
- if (max_size) {
- /* Compensate for out of bounds zero bits. */
- if ((i = vol->nr_mft_records & 31))
- nr_free -= 32 - i;
- ntfs_debug("Handling partial page, max_size = 0x%x",
- max_size);
- goto handle_partial_page;
- }
+ for (i = 0; i < max_size; i++)
+ nr_free -= (s64)hweight32(kaddr[i]);
+ kunmap_atomic(kaddr, KM_USER0);
+ page_cache_release(page);
}
- ntfs_debug("Finished reading $MFT/$BITMAP, last index = 0x%lx",
+ ntfs_debug("Finished reading $MFT/$BITMAP, last index = 0x%lx.",
index - 1);
+ /* If errors occured we may well have gone below zero, fix this. */
+ if (nr_free < 0)
+ nr_free = 0;
+ ntfs_debug("Exiting.");
return nr_free;
}
@@ -1761,7 +1792,7 @@ static void __exit exit_ntfs_fs(void)
}
MODULE_AUTHOR("Anton Altaparmakov <aia21@cantab.net>");
-MODULE_DESCRIPTION("NTFS 1.2/3.x driver - Copyright (c) 2001-2002 Anton Altaparmakov");
+MODULE_DESCRIPTION("NTFS 1.2/3.x driver - Copyright (c) 2001-2003 Anton Altaparmakov");
MODULE_LICENSE("GPL");
#ifdef DEBUG
MODULE_PARM(debug_msgs, "i");
diff --git a/fs/ntfs/unistr.c b/fs/ntfs/unistr.c
index b6333efea6d5..ab999db047fe 100644
--- a/fs/ntfs/unistr.c
+++ b/fs/ntfs/unistr.c
@@ -1,7 +1,7 @@
/*
* unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project.
*
- * Copyright (c) 2001 Anton Altaparmakov.
+ * Copyright (c) 2001-2003 Anton Altaparmakov
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -96,10 +96,12 @@ int ntfs_collate_names(const uchar_t *name1, const u32 name1_len,
const int err_val, const IGNORE_CASE_BOOL ic,
const uchar_t *upcase, const u32 upcase_len)
{
- u32 cnt;
- const u32 min_len = min_t(const u32, name1_len, name2_len);
+ u32 cnt, min_len;
uchar_t c1, c2;
+ min_len = name1_len;
+ if (name1_len > name2_len)
+ min_len = name2_len;
for (cnt = 0; cnt < min_len; ++cnt) {
c1 = le16_to_cpu(*name1++);
c2 = le16_to_cpu(*name2++);
diff --git a/fs/ntfs/upcase.c b/fs/ntfs/upcase.c
index 17f4a64c70b7..44789837eede 100644
--- a/fs/ntfs/upcase.c
+++ b/fs/ntfs/upcase.c
@@ -2,8 +2,8 @@
* upcase.c - Generate the full NTFS Unicode upcase table in little endian.
* Part of the Linux-NTFS project.
*
- * Copyright (C) 2001 Richard Russon <ntfs@flatcap.org>
- * Copyright (c) 2001,2002 Anton Altaparmakov
+ * Copyright (c) 2001 Richard Russon <ntfs@flatcap.org>
+ * Copyright (c) 2001-2003 Anton Altaparmakov
*
* Modified for mkntfs inclusion 9 June 2001 by Anton Altaparmakov.
* Modified for kernel inclusion 10 September 2001 by Anton Altparmakov.
@@ -28,7 +28,7 @@
uchar_t *generate_default_upcase(void)
{
- const int uc_run_table[][3] = { /* Start, End, Add */
+ static const int uc_run_table[][3] = { /* Start, End, Add */
{0x0061, 0x007B, -32}, {0x0451, 0x045D, -80}, {0x1F70, 0x1F72, 74},
{0x00E0, 0x00F7, -32}, {0x045E, 0x0460, -80}, {0x1F72, 0x1F76, 86},
{0x00F8, 0x00FF, -32}, {0x0561, 0x0587, -48}, {0x1F76, 0x1F78, 100},
@@ -45,7 +45,7 @@ uchar_t *generate_default_upcase(void)
{0}
};
- const int uc_dup_table[][2] = { /* Start, End */
+ static const int uc_dup_table[][2] = { /* Start, End */
{0x0100, 0x012F}, {0x01A0, 0x01A6}, {0x03E2, 0x03EF}, {0x04CB, 0x04CC},
{0x0132, 0x0137}, {0x01B3, 0x01B7}, {0x0460, 0x0481}, {0x04D0, 0x04EB},
{0x0139, 0x0149}, {0x01CD, 0x01DD}, {0x0490, 0x04BF}, {0x04EE, 0x04F5},
@@ -55,7 +55,7 @@ uchar_t *generate_default_upcase(void)
{0}
};
- const int uc_word_table[][2] = { /* Offset, Value */
+ static const int uc_word_table[][2] = { /* Offset, Value */
{0x00FF, 0x0178}, {0x01AD, 0x01AC}, {0x01F3, 0x01F1}, {0x0269, 0x0196},
{0x0183, 0x0182}, {0x01B0, 0x01AF}, {0x0253, 0x0181}, {0x026F, 0x019C},
{0x0185, 0x0184}, {0x01B9, 0x01B8}, {0x0254, 0x0186}, {0x0272, 0x019D},
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index a8530c42211f..591123911467 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -99,25 +99,32 @@ char *disk_name(struct gendisk *hd, int part, char *buf)
#ifdef CONFIG_DEVFS_FS
if (hd->devfs_name[0] != '\0') {
if (part)
- sprintf(buf, "%s/part%d", hd->devfs_name, part);
+ snprintf(buf, BDEVNAME_SIZE, "%s/part%d",
+ hd->devfs_name, part);
else if (hd->minors != 1)
- sprintf(buf, "%s/disc", hd->devfs_name);
+ snprintf(buf, BDEVNAME_SIZE, "%s/disc", hd->devfs_name);
else
- sprintf(buf, "%s", hd->devfs_name);
+ snprintf(buf, BDEVNAME_SIZE, "%s", hd->devfs_name);
return buf;
}
#endif
if (!part)
- sprintf(buf, "%s", hd->disk_name);
+ snprintf(buf, BDEVNAME_SIZE, "%s", hd->disk_name);
else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
- sprintf(buf, "%sp%d", hd->disk_name, part);
+ snprintf(buf, BDEVNAME_SIZE, "%sp%d", hd->disk_name, part);
else
- sprintf(buf, "%s%d", hd->disk_name, part);
+ snprintf(buf, BDEVNAME_SIZE, "%s%d", hd->disk_name, part);
return buf;
}
+const char *bdevname(struct block_device *bdev, char *buf)
+{
+ int part = MINOR(bdev->bd_dev) - bdev->bd_disk->first_minor;
+ return disk_name(bdev->bd_disk, part, buf);
+}
+
static struct parsed_partitions *
check_partition(struct gendisk *hd, struct block_device *bdev)
{
@@ -417,7 +424,7 @@ void del_gendisk(struct gendisk *disk)
struct dev_name {
struct list_head list;
dev_t dev;
- char namebuf[64];
+ char namebuf[BDEVNAME_SIZE];
char *name;
};
diff --git a/fs/partitions/check.h b/fs/partitions/check.h
index 882980c55720..43adcc68e471 100644
--- a/fs/partitions/check.h
+++ b/fs/partitions/check.h
@@ -8,7 +8,7 @@
enum { MAX_PART = 256 };
struct parsed_partitions {
- char name[40];
+ char name[BDEVNAME_SIZE];
struct {
sector_t from;
sector_t size;
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 97b6eaf052b1..6f658ceafc3a 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -136,11 +136,11 @@ proc_file_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
"proc_file_read: Apparent buffer overflow!\n");
n = PAGE_SIZE;
}
- if (n > count)
- n = count;
n -= *ppos;
if (n <= 0)
break;
+ if (n > count)
+ n = count;
start = page + *ppos;
} else if (start < page) {
if (n > PAGE_SIZE) {
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index 46a85b395db8..040e1f66ea48 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -63,6 +63,11 @@
#define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */
#define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
#define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */
+/* cpu types for specific tunings: */
+#define X86_FEATURE_K8 (3*32+ 4) /* Opteron, Athlon64 */
+#define X86_FEATURE_K7 (3*32+ 5) /* Athlon */
+#define X86_FEATURE_P3 (3*32+ 6) /* P3 */
+#define X86_FEATURE_P4 (3*32+ 7) /* P4 */
/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index bc47e152108d..d69cc46d5866 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -15,6 +15,7 @@
#include <asm/sigcontext.h>
#include <asm/cpufeature.h>
#include <asm/msr.h>
+#include <asm/system.h>
#include <linux/cache.h>
#include <linux/config.h>
#include <linux/threads.h>
@@ -495,32 +496,93 @@ static inline void rep_nop(void)
#define cpu_relax() rep_nop()
-/* Prefetch instructions for Pentium III and AMD Athlon */
-#ifdef CONFIG_X86_PREFETCH
+/* generic versions from gas */
+#define GENERIC_NOP1 ".byte 0x90\n"
+#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
+#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
+#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
+#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
+#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
+#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
+#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
+
+/* Opteron nops */
+#define K8_NOP1 GENERIC_NOP1
+#define K8_NOP2 ".byte 0x66,0x90\n"
+#define K8_NOP3 ".byte 0x66,0x66,0x90\n"
+#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n"
+#define K8_NOP5 K8_NOP3 K8_NOP2
+#define K8_NOP6 K8_NOP3 K8_NOP3
+#define K8_NOP7 K8_NOP4 K8_NOP3
+#define K8_NOP8 K8_NOP4 K8_NOP4
+
+/* K7 nops */
+/* uses eax dependencies (arbitary choice) */
+#define K7_NOP1 GENERIC_NOP1
+#define K7_NOP2 ".byte 0x8b,0xc0\n"
+#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
+#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
+#define K7_NOP5 K7_NOP4 ASM_NOP1
+#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
+#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
+#define K7_NOP8 K7_NOP7 ASM_NOP1
+
+#ifdef CONFIG_MK8
+#define ASM_NOP1 K8_NOP1
+#define ASM_NOP2 K8_NOP2
+#define ASM_NOP3 K8_NOP3
+#define ASM_NOP4 K8_NOP4
+#define ASM_NOP5 K8_NOP5
+#define ASM_NOP6 K8_NOP6
+#define ASM_NOP7 K8_NOP7
+#define ASM_NOP8 K8_NOP8
+#elif CONFIG_MK7
+#define ASM_NOP1 K7_NOP1
+#define ASM_NOP2 K7_NOP2
+#define ASM_NOP3 K7_NOP3
+#define ASM_NOP4 K7_NOP4
+#define ASM_NOP5 K7_NOP5
+#define ASM_NOP6 K7_NOP6
+#define ASM_NOP7 K7_NOP7
+#define ASM_NOP8 K7_NOP8
+#else
+#define ASM_NOP1 GENERIC_NOP1
+#define ASM_NOP2 GENERIC_NOP2
+#define ASM_NOP3 GENERIC_NOP3
+#define ASM_NOP4 GENERIC_NOP4
+#define ASM_NOP5 GENERIC_NOP5
+#define ASM_NOP6 GENERIC_NOP6
+#define ASM_NOP7 GENERIC_NOP7
+#define ASM_NOP8 GENERIC_NOP8
+#endif
+#define ASM_NOP_MAX 8
+
+/* Prefetch instructions for Pentium III and AMD Athlon */
+/* It's not worth to care about 3dnow! prefetches for the K6
+ because they are microcoded there and very slow. */
#define ARCH_HAS_PREFETCH
extern inline void prefetch(const void *x)
{
- __asm__ __volatile__ ("prefetchnta (%0)" : : "r"(x));
+ alternative_input(ASM_NOP3,
+ "prefetchnta (%1)",
+ X86_FEATURE_XMM,
+ "r" (x));
}
-#elif defined CONFIG_X86_USE_3DNOW
-
#define ARCH_HAS_PREFETCH
#define ARCH_HAS_PREFETCHW
#define ARCH_HAS_SPINLOCK_PREFETCH
-extern inline void prefetch(const void *x)
-{
- __asm__ __volatile__ ("prefetch (%0)" : : "r"(x));
-}
-
+/* 3dnow! prefetch to get an exclusive cache line. Useful for
+ spinlocks to avoid one state transition in the cache coherency protocol. */
extern inline void prefetchw(const void *x)
{
- __asm__ __volatile__ ("prefetchw (%0)" : : "r"(x));
+ alternative_input(ASM_NOP3,
+ "prefetchw (%1)",
+ X86_FEATURE_3DNOW,
+ "r" (x));
}
#define spin_lock_prefetch(x) prefetchw(x)
-#endif
-
#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 5831f6d34ad7..71b9dd77ed04 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -277,13 +277,16 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
/* Compiling for a 386 proper. Is it worth implementing via cli/sti? */
#endif
+#ifdef __KERNEL__
struct alt_instr {
- u8 *instr; /* original instruction */
- u8 cpuid; /* cpuid bit set for replacement */
- u8 instrlen; /* length of original instruction */
- u8 replacementlen; /* length of new instruction, <= instrlen */
- u8 replacement[0]; /* new instruction */
+ __u8 *instr; /* original instruction */
+ __u8 *replacement;
+ __u8 cpuid; /* cpuid bit set for replacement */
+ __u8 instrlen; /* length of original instruction */
+ __u8 replacementlen; /* length of new instruction, <= instrlen */
+ __u8 pad;
};
+#endif
/*
* Alternative instructions for different CPU types or capabilities.
@@ -302,13 +305,40 @@ struct alt_instr {
".section .altinstructions,\"a\"\n" \
" .align 4\n" \
" .long 661b\n" /* label */ \
+ " .long 663f\n" /* new instruction */ \
" .byte %c0\n" /* feature bit */ \
" .byte 662b-661b\n" /* sourcelen */ \
" .byte 664f-663f\n" /* replacementlen */ \
+ ".previous\n" \
+ ".section .altinstr_replacement,\"ax\"\n" \
"663:\n\t" newinstr "\n664:\n" /* replacement */ \
".previous" :: "i" (feature) : "memory")
/*
+ * Alternative inline assembly with input.
+ *
+ * Pecularities:
+ * No memory clobber here.
+ * Argument numbers start with 1.
+ * Best is to use constraints that are fixed size (like (%1) ... "r")
+ * If you use variable sized constraints like "m" or "g" in the
+ * replacement maake sure to pad to the worst case length.
+ */
+#define alternative_input(oldinstr, newinstr, feature, input) \
+ asm volatile ("661:\n\t" oldinstr "\n662:\n" \
+ ".section .altinstructions,\"a\"\n" \
+ " .align 4\n" \
+ " .long 661b\n" /* label */ \
+ " .long 663f\n" /* new instruction */ \
+ " .byte %c0\n" /* feature bit */ \
+ " .byte 662b-661b\n" /* sourcelen */ \
+ " .byte 664f-663f\n" /* replacementlen */ \
+ ".previous\n" \
+ ".section .altinstr_replacement,\"ax\"\n" \
+ "663:\n\t" newinstr "\n664:\n" /* replacement */ \
+ ".previous" :: "i" (feature), input)
+
+/*
* Force strict CPU ordering.
* And yes, this is required on UP too when we're talking
* to devices.
diff --git a/include/asm-ppc/bug.h b/include/asm-ppc/bug.h
index 848c69a703b5..be916f56f9f2 100644
--- a/include/asm-ppc/bug.h
+++ b/include/asm-ppc/bug.h
@@ -2,7 +2,7 @@
#define _PPC_BUG_H
#include <linux/config.h>
-#include <asm/system.h> /* for xmon definition */
+#include <asm/xmon.h>
#ifdef CONFIG_XMON
extern void xmon(struct pt_regs *);
diff --git a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h
index 0818267600b1..4f82095103b9 100644
--- a/include/asm-ppc/cputable.h
+++ b/include/asm-ppc/cputable.h
@@ -74,6 +74,7 @@ extern struct cpu_spec *cur_cpu_spec[];
#define CPU_FTR_NAP_DISABLE_L2_PR 0x00002000
#define CPU_FTR_DUAL_PLL_750FX 0x00004000
#define CPU_FTR_NO_DPM 0x00008000
+#define CPU_FTR_HAS_HIGH_BATS 0x00010000
#ifdef __ASSEMBLY__
diff --git a/include/asm-ppc/delay.h b/include/asm-ppc/delay.h
index 8660a9b79361..dc3715bfeff8 100644
--- a/include/asm-ppc/delay.h
+++ b/include/asm-ppc/delay.h
@@ -31,7 +31,7 @@ extern void __delay(unsigned int loops);
* -- paulus
*/
#define __MAX_UDELAY (226050910/HZ) /* maximum udelay argument */
-#define __MAX_NDELAY (4294967295/HZ) /* maximum ndelay argument */
+#define __MAX_NDELAY (2147483647/HZ) /* maximum ndelay argument */
extern __inline__ void __udelay(unsigned int x)
{
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index da0dff483ba7..c40d33d55f80 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -104,6 +104,15 @@
#define SPRN_DBAT2U 0x21C /* Data BAT 2 Upper Register */
#define SPRN_DBAT3L 0x21F /* Data BAT 3 Lower Register */
#define SPRN_DBAT3U 0x21E /* Data BAT 3 Upper Register */
+#define SPRN_DBAT4L 0x239 /* Data BAT 4 Lower Register */
+#define SPRN_DBAT4U 0x238 /* Data BAT 4 Upper Register */
+#define SPRN_DBAT5L 0x23B /* Data BAT 5 Lower Register */
+#define SPRN_DBAT5U 0x23A /* Data BAT 5 Upper Register */
+#define SPRN_DBAT6L 0x23D /* Data BAT 6 Lower Register */
+#define SPRN_DBAT6U 0x23C /* Data BAT 6 Upper Register */
+#define SPRN_DBAT7L 0x23F /* Data BAT 7 Lower Register */
+#define SPRN_DBAT7U 0x23E /* Data BAT 7 Upper Register */
+
#define SPRN_DBCR 0x3F2 /* Debug Control Regsiter */
#define DBCR_EDM 0x80000000
#define DBCR_IDM 0x40000000
@@ -267,6 +276,14 @@
#define SPRN_IBAT2U 0x214 /* Instruction BAT 2 Upper Register */
#define SPRN_IBAT3L 0x217 /* Instruction BAT 3 Lower Register */
#define SPRN_IBAT3U 0x216 /* Instruction BAT 3 Upper Register */
+#define SPRN_IBAT4L 0x231 /* Instruction BAT 4 Lower Register */
+#define SPRN_IBAT4U 0x230 /* Instruction BAT 4 Upper Register */
+#define SPRN_IBAT5L 0x233 /* Instruction BAT 5 Lower Register */
+#define SPRN_IBAT5U 0x232 /* Instruction BAT 5 Upper Register */
+#define SPRN_IBAT6L 0x235 /* Instruction BAT 6 Lower Register */
+#define SPRN_IBAT6U 0x234 /* Instruction BAT 6 Upper Register */
+#define SPRN_IBAT7L 0x237 /* Instruction BAT 7 Lower Register */
+#define SPRN_IBAT7U 0x236 /* Instruction BAT 7 Upper Register */
#define SPRN_ICCR 0x3FB /* Instruction Cache Cacheability Register */
#define ICCR_NOCACHE 0 /* Noncacheable */
#define ICCR_CACHE 1 /* Cacheable */
@@ -448,6 +465,14 @@
#define DBAT2U SPRN_DBAT2U /* Data BAT 2 Upper Register */
#define DBAT3L SPRN_DBAT3L /* Data BAT 3 Lower Register */
#define DBAT3U SPRN_DBAT3U /* Data BAT 3 Upper Register */
+#define DBAT4L SPRN_DBAT4L /* Data BAT 4 Lower Register */
+#define DBAT4U SPRN_DBAT4U /* Data BAT 4 Upper Register */
+#define DBAT5L SPRN_DBAT5L /* Data BAT 5 Lower Register */
+#define DBAT5U SPRN_DBAT5U /* Data BAT 5 Upper Register */
+#define DBAT6L SPRN_DBAT6L /* Data BAT 6 Lower Register */
+#define DBAT6U SPRN_DBAT6U /* Data BAT 6 Upper Register */
+#define DBAT7L SPRN_DBAT7L /* Data BAT 7 Lower Register */
+#define DBAT7U SPRN_DBAT7U /* Data BAT 7 Upper Register */
#define DCMP SPRN_DCMP /* Data TLB Compare Register */
#define DEC SPRN_DEC /* Decrement Register */
#define DMISS SPRN_DMISS /* Data TLB Miss Register */
@@ -466,6 +491,14 @@
#define IBAT2U SPRN_IBAT2U /* Instruction BAT 2 Upper Register */
#define IBAT3L SPRN_IBAT3L /* Instruction BAT 3 Lower Register */
#define IBAT3U SPRN_IBAT3U /* Instruction BAT 3 Upper Register */
+#define IBAT4L SPRN_IBAT4L /* Instruction BAT 4 Lower Register */
+#define IBAT4U SPRN_IBAT4U /* Instruction BAT 4 Upper Register */
+#define IBAT5L SPRN_IBAT5L /* Instruction BAT 5 Lower Register */
+#define IBAT5U SPRN_IBAT5U /* Instruction BAT 5 Upper Register */
+#define IBAT6L SPRN_IBAT6L /* Instruction BAT 6 Lower Register */
+#define IBAT6U SPRN_IBAT6U /* Instruction BAT 6 Upper Register */
+#define IBAT7L SPRN_IBAT7L /* Instruction BAT 7 Lower Register */
+#define IBAT7U SPRN_IBAT7U /* Instruction BAT 7 Upper Register */
#define ICMP SPRN_ICMP /* Instruction TLB Compare Register */
#define IMISS SPRN_IMISS /* Instruction TLB Miss Register */
#define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index baf8f1567836..ab113434de58 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -50,8 +50,6 @@
#endif /* CONFIG_SMP */
#ifdef __KERNEL__
-extern void xmon_irq(int, void *, struct pt_regs *);
-extern void xmon(struct pt_regs *excp);
extern void print_backtrace(unsigned long *);
extern void show_regs(struct pt_regs * regs);
extern void flush_instruction_cache(void);
diff --git a/include/asm-ppc/xmon.h b/include/asm-ppc/xmon.h
new file mode 100644
index 000000000000..042b83e6680d
--- /dev/null
+++ b/include/asm-ppc/xmon.h
@@ -0,0 +1,17 @@
+#ifndef __PPC_XMON_H
+#define __PPC_XMON_H
+#ifdef __KERNEL__
+
+struct pt_regs;
+
+extern void xmon(struct pt_regs *excp);
+extern void xmon_printf(const char *fmt, ...);
+extern void xmon_map_scc(void);
+extern int xmon_bpt(struct pt_regs *regs);
+extern int xmon_sstep(struct pt_regs *regs);
+extern int xmon_iabr_match(struct pt_regs *regs);
+extern int xmon_dabr_match(struct pt_regs *regs);
+extern void (*xmon_fault_handler)(struct pt_regs *regs);
+
+#endif
+#endif
diff --git a/include/asm-sparc/bitext.h b/include/asm-sparc/bitext.h
new file mode 100644
index 000000000000..88b1518834a8
--- /dev/null
+++ b/include/asm-sparc/bitext.h
@@ -0,0 +1,24 @@
+/*
+ * bitext.h: Bit string operations on the sparc, specific to architecture.
+ *
+ * Copyright 2002 Pete Zaitcev <zaitcev@yahoo.com>
+ */
+
+#ifndef _SPARC_BITEXT_H
+#define _SPARC_BITEXT_H
+
+#include <linux/smp_lock.h>
+
+struct bit_map {
+ spinlock_t lock;
+ unsigned long *map;
+ int size;
+ int used;
+ int last_off;
+};
+
+extern int bit_map_string_get(struct bit_map *t, int len, int align);
+extern void bit_map_clear(struct bit_map *t, int offset, int len);
+extern void bit_map_init(struct bit_map *t, unsigned long *map, int size);
+
+#endif /* defined(_SPARC_BITEXT_H) */
diff --git a/include/asm-sparc/iommu.h b/include/asm-sparc/iommu.h
index cf1d5b794833..8171362d56b9 100644
--- a/include/asm-sparc/iommu.h
+++ b/include/asm-sparc/iommu.h
@@ -6,6 +6,7 @@
#define _SPARC_IOMMU_H
#include <asm/page.h>
+#include <asm/bitext.h>
/* The iommu handles all virtual to physical address translations
* that occur between the SBUS and physical memory. Access by
@@ -100,11 +101,11 @@ struct iommu_regs {
struct iommu_struct {
struct iommu_regs *regs;
iopte_t *page_table;
- iopte_t *lowest; /* to speed up searches... */
- unsigned long plow;
/* For convenience */
unsigned long start; /* First managed virtual address */
unsigned long end; /* Last managed virtual address */
+
+ struct bit_map usemap;
};
extern __inline__ void iommu_invalidate(struct iommu_regs *regs)
@@ -112,9 +113,9 @@ extern __inline__ void iommu_invalidate(struct iommu_regs *regs)
regs->tlbflush = 0;
}
-extern __inline__ void iommu_invalidate_page(struct iommu_regs *regs, unsigned long page)
+extern __inline__ void iommu_invalidate_page(struct iommu_regs *regs, unsigned long ba)
{
- regs->pageflush = (page & PAGE_MASK);
+ regs->pageflush = (ba & PAGE_MASK);
}
#endif /* !(_SPARC_IOMMU_H) */
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index c25c0d4f7461..137421b5bdc4 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -27,6 +27,7 @@
#ifndef __ASSEMBLY__
struct vm_area_struct;
+struct page;
extern void load_mmu(void);
extern unsigned long calc_highpages(void);
@@ -51,15 +52,30 @@ BTFIXUPDEF_CALL(void, mmu_release_scsi_sgl, struct scatterlist *, int, struct s
/*
* mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep.
+ *
+ * The mmu_map_dma_area establishes two mappings in one go.
+ * These mappings point to pages normally mapped at 'va' (linear address).
+ * First mapping is for CPU visible address at 'a', uncached.
+ * This is an alias, but it works because it is an uncached mapping.
+ * Second mapping is for device visible address, or "bus" address.
+ * The bus address is returned at '*pba'.
+ *
+ * These functions seem distinct, but are hard to split. On sun4c,
+ * at least for now, 'a' is equal to bus address, and retured in *pba.
+ * On sun4m, page attributes depend on the CPU type, so we have to
+ * know if we are mapping RAM or I/O, so it has to be an additional argument
+ * to a separate mapping function for CPU visible mappings.
*/
-BTFIXUPDEF_CALL(void, mmu_map_dma_area, unsigned long va, __u32 addr, int len)
-BTFIXUPDEF_CALL(unsigned long /*phys*/, mmu_translate_dvma, unsigned long busa)
+BTFIXUPDEF_CALL(int, mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len)
+BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa)
BTFIXUPDEF_CALL(void, mmu_unmap_dma_area, unsigned long busa, int len)
-#define mmu_map_dma_area(va, ba,len) BTFIXUP_CALL(mmu_map_dma_area)(va,ba,len)
+#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len)
#define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len)
#define mmu_translate_dvma(ba) BTFIXUP_CALL(mmu_translate_dvma)(ba)
+/*
+ */
BTFIXUPDEF_SIMM13(pmd_shift)
BTFIXUPDEF_SETHI(pmd_size)
BTFIXUPDEF_SETHI(pmd_mask)
@@ -377,6 +393,12 @@ BTFIXUPDEF_CALL(void, update_mmu_cache, struct vm_area_struct *, unsigned long,
#define update_mmu_cache(vma,addr,pte) BTFIXUP_CALL(update_mmu_cache)(vma,addr,pte)
+BTFIXUPDEF_CALL(void, sparc_mapiorange, unsigned int, unsigned long,
+ unsigned long, unsigned int)
+BTFIXUPDEF_CALL(void, sparc_unmapiorange, unsigned long, unsigned int)
+#define sparc_mapiorange(bus,pa,va,len) BTFIXUP_CALL(sparc_mapiorange)(bus,pa,va,len)
+#define sparc_unmapiorange(va,len) BTFIXUP_CALL(sparc_unmapiorange)(va,len)
+
extern int invalid_segment;
/* Encode and de-code a swap entry */
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index bf09706e88ea..075c98e2bc56 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -10,7 +10,7 @@
#include <linux/ioport.h>
#include <asm/oplib.h>
-#include <asm/iommu.h>
+/* #include <asm/iommu.h> */ /* Unused since we use opaque iommu (|io-unit) */
#include <asm/scatterlist.h>
/* We scan which devices are on the SBus using the PROM node device
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 572b92e6f443..b9b2cf5b69e8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1068,10 +1068,7 @@ extern int chrdev_open(struct inode *, struct file *);
/* fs/block_dev.c */
#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
extern const char *__bdevname(dev_t, char *buffer);
-extern inline const char *bdevname(struct block_device *bdev, char *buffer)
-{
- return __bdevname(bdev->bd_dev, buffer);
-}
+extern const char *bdevname(struct block_device *bdev, char *buffer);
extern struct block_device *lookup_bdev(const char *);
extern struct block_device *open_bdev_excl(const char *, int, int, void *);
extern void close_bdev_excl(struct block_device *, int);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index ade6d9e97475..be82baa340fa 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -31,6 +31,7 @@
#define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */
#define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */
#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */
+#define __GFP_NO_GROW 0x2000 /* Slab internal usage */
#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 082fd9b7687b..f773ff4268a9 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1408,6 +1408,8 @@ typedef struct pkt_task_s {
void *special;
} pkt_task_t;
+extern inline u32 ide_read_24(ide_drive_t *);
+
extern inline void SELECT_DRIVE(ide_drive_t *);
extern inline void SELECT_INTERRUPT(ide_drive_t *);
extern inline void SELECT_MASK(ide_drive_t *, int);
diff --git a/include/linux/initrd.h b/include/linux/initrd.h
index d1978c358b12..32452d53dac3 100644
--- a/include/linux/initrd.h
+++ b/include/linux/initrd.h
@@ -13,4 +13,6 @@ extern int rd_image_start;
/* 1 if it is not an error if initrd_start < memory_start */
extern int initrd_below_start_ok;
+/* free_initrd_mem always gets called with the next two as arguments.. */
extern unsigned long initrd_start, initrd_end;
+extern void free_initrd_mem(unsigned long, unsigned long);
diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h
index 456494591a51..d03489f00793 100644
--- a/include/linux/ioctl32.h
+++ b/include/linux/ioctl32.h
@@ -19,5 +19,12 @@ extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned
extern int unregister_ioctl32_conversion(unsigned int cmd);
+typedef int (*ioctl_trans_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
+
+struct ioctl_trans {
+ unsigned long cmd;
+ ioctl_trans_handler_t handler;
+ struct ioctl_trans *next;
+};
#endif
diff --git a/include/linux/list.h b/include/linux/list.h
index a724f9bcbe4d..11b8674c14ff 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -437,6 +437,10 @@ static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node
for (pos = (head)->first; pos; \
pos = pos->next)
+#define hlist_for_each_safe(pos, n, head) \
+ for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
+ pos = n)
+
#else
#warning "don't include kernel headers in userspace"
#endif /* __KERNEL__ */
diff --git a/include/linux/module.h b/include/linux/module.h
index 657802c8af75..4ddc5edcd22f 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -20,10 +20,7 @@
#include <asm/module.h>
/* Not Yet Implemented */
-#define MODULE_AUTHOR(name)
-#define MODULE_DESCRIPTION(desc)
#define MODULE_SUPPORTED_DEVICE(name)
-#define MODULE_PARM_DESC(var,desc)
#define print_modules()
/* v850 toolchain uses a `_' prefix for all user symbols */
@@ -58,12 +55,11 @@ search_extable(const struct exception_table_entry *first,
unsigned long value);
#ifdef MODULE
-#define ___module_cat(a,b) a ## b
+#define ___module_cat(a,b) __mod_ ## a ## b
#define __module_cat(a,b) ___module_cat(a,b)
-/* For userspace: you can also call me... */
-#define MODULE_ALIAS(alias) \
- static const char __module_cat(__alias_,__LINE__)[] \
- __attribute__((section(".modinfo"),unused)) = "alias=" alias
+#define __MODULE_INFO(tag, name, info) \
+static const char __module_cat(name,__LINE__)[] \
+ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
#define MODULE_GENERIC_TABLE(gtype,name) \
extern const struct gtype##_id __mod_##gtype##_table \
@@ -71,6 +67,19 @@ extern const struct gtype##_id __mod_##gtype##_table \
#define THIS_MODULE (&__this_module)
+#else /* !MODULE */
+
+#define MODULE_GENERIC_TABLE(gtype,name)
+#define __MODULE_INFO(tag, name, info)
+#define THIS_MODULE ((struct module *)0)
+#endif
+
+/* Generic info of form tag = "info" */
+#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
+
+/* For userspace: you can also call me... */
+#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
+
/*
* The following license idents are currently accepted as indicating free
* software modules
@@ -97,17 +106,18 @@ extern const struct gtype##_id __mod_##gtype##_table \
* 2. So the community can ignore bug reports including proprietary modules
* 3. So vendors can do likewise based on their own policies
*/
-#define MODULE_LICENSE(license) \
- static const char __module_license[] \
- __attribute__((section(".init.license"), unused)) = license
+#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
-#else /* !MODULE */
+/* Author, ideally of form NAME <EMAIL>[, NAME <EMAIL>]*[ and NAME <EMAIL>] */
+#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
+
+/* What your module does. */
+#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
-#define MODULE_ALIAS(alias)
-#define MODULE_GENERIC_TABLE(gtype,name)
-#define THIS_MODULE ((struct module *)0)
-#define MODULE_LICENSE(license)
-#endif
+/* One for each parameter, describing how to use it. Some files do
+ multiple of these per line, so can't just use MODULE_INFO. */
+#define MODULE_PARM_DESC(_parm, desc) \
+ __MODULE_INFO(parm, _parm, #_parm ":" desc)
#define MODULE_DEVICE_TABLE(type,name) \
MODULE_GENERIC_TABLE(type##_device,name)
@@ -255,6 +265,7 @@ struct module *module_text_address(unsigned long addr);
#ifdef CONFIG_MODULE_UNLOAD
+unsigned int module_refcount(struct module *mod);
void __symbol_put(const char *symbol);
#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
void symbol_put_addr(void *addr);
@@ -265,6 +276,17 @@ void symbol_put_addr(void *addr);
#define local_dec(x) atomic_dec(x)
#endif
+/* Sometimes we know we already have a refcount, and it's easier not
+ to handle the error case (which only happens with rmmod --wait). */
+static inline void __module_get(struct module *module)
+{
+ if (module) {
+ BUG_ON(module_refcount(module) == 0);
+ local_inc(&module->ref[get_cpu()].count);
+ put_cpu();
+ }
+}
+
static inline int try_module_get(struct module *module)
{
int ret = 1;
@@ -300,6 +322,9 @@ static inline int try_module_get(struct module *module)
static inline void module_put(struct module *module)
{
}
+static inline void __module_get(struct module *module)
+{
+}
#define symbol_put(x) do { } while(0)
#define symbol_put_addr(p) do { } while(0)
@@ -357,6 +382,10 @@ static inline struct module *module_text_address(unsigned long addr)
#define symbol_put(x) do { } while(0)
#define symbol_put_addr(x) do { } while(0)
+static inline void __module_get(struct module *module)
+{
+}
+
static inline int try_module_get(struct module *module)
{
return 1;
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 69d0a66b662e..53c52176c391 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -7,7 +7,7 @@
#include <linux/config.h>
#include <linux/spinlock.h>
#include <linux/smp.h>
-#include <linux/preempt.h>
+#include <linux/threads.h>
#ifdef CONFIG_SMP
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 603748b9b349..49374df2d450 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -22,8 +22,11 @@ typedef struct kmem_cache_s kmem_cache_t;
#define SLAB_KERNEL GFP_KERNEL
#define SLAB_DMA GFP_DMA
-#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY)
-#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */
+#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
+ __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|\
+ __GFP_NOFAIL|__GFP_NORETRY)
+
+#define SLAB_NO_GROW __GFP_NO_GROW /* don't grow a cache */
/* flags to pass to kmem_cache_create().
* The first 3 are only valid when the allocator as been build
diff --git a/include/net/irda/irport.h b/include/net/irda/irport.h
index e5877f66fab8..79b4d8904346 100644
--- a/include/net/irda/irport.h
+++ b/include/net/irda/irport.h
@@ -73,7 +73,7 @@ struct irport_cb {
/* For piggyback drivers */
void *priv;
void (*change_speed)(void *priv, __u32 speed);
- void (*interrupt)(int irq, void *dev_id, struct pt_regs *regs);
+ int (*interrupt)(int irq, void *dev_id, struct pt_regs *regs);
};
struct irport_cb *irport_open(int i, unsigned int iobase, unsigned int irq);
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 87c8e809915b..43732400e3bc 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -141,11 +141,6 @@ typedef struct dev_link_t {
#define DEV_OK(l) \
((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT)))
-int register_pccard_driver(dev_info_t *dev_info,
- dev_link_t *(*attach)(void),
- void (*detach)(dev_link_t *));
-
-int unregister_pccard_driver(dev_info_t *dev_info);
extern struct bus_type pcmcia_bus_type;
@@ -157,9 +152,18 @@ struct pcmcia_driver {
struct device_driver drv;
};
+/* driver registration */
int pcmcia_register_driver(struct pcmcia_driver *driver);
void pcmcia_unregister_driver(struct pcmcia_driver *driver);
-#endif /* __KERNEL__ */
+/* legacy driver registration interface. don't use in new code */
+int register_pccard_driver(dev_info_t *dev_info,
+ dev_link_t *(*attach)(void),
+ void (*detach)(dev_link_t *));
+int unregister_pccard_driver(dev_info_t *dev_info);
+
+/* error reporting */
+void cs_error(client_handle_t handle, int func, int ret);
+#endif /* __KERNEL__ */
#endif /* _LINUX_DS_H */
diff --git a/kernel/fork.c b/kernel/fork.c
index 58111cbdb54e..e34abd2241fb 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -43,7 +43,9 @@ static kmem_cache_t *task_struct_cachep;
extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
extern void exit_semundo(struct task_struct *tsk);
-/* The idle threads do not count.. */
+/* The idle threads do not count..
+ * Protected by write_lock_irq(&tasklist_lock)
+ */
int nr_threads;
int max_threads;
@@ -792,9 +794,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
atomic_inc(&p->user->processes);
/*
- * Counter increases are protected by
- * the kernel lock so nr_threads can't
- * increase under us (but it may decrease).
+ * If multiple threads are within copy_process(), then this check
+ * triggers too late. This doesn't hurt, the check is only there
+ * to stop root fork bombs.
*/
if (nr_threads >= max_threads)
goto bad_fork_cleanup_count;
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index 8c8cff48895d..c8ca8a9fa5e1 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -515,6 +515,7 @@ EXPORT_SYMBOL(vsprintf);
EXPORT_SYMBOL(vsnprintf);
EXPORT_SYMBOL(vsscanf);
EXPORT_SYMBOL(__bdevname);
+EXPORT_SYMBOL(bdevname);
EXPORT_SYMBOL(cdevname);
EXPORT_SYMBOL(simple_strtoull);
EXPORT_SYMBOL(simple_strtoul);
diff --git a/kernel/module.c b/kernel/module.c
index ccba086ce6bc..06ff9328b30b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -431,7 +431,7 @@ static inline void restart_refcounts(void)
}
#endif
-static unsigned int module_refcount(struct module *mod)
+unsigned int module_refcount(struct module *mod)
{
unsigned int i, total = 0;
@@ -439,6 +439,7 @@ static unsigned int module_refcount(struct module *mod)
total += atomic_read(&mod->ref[i].count);
return total;
}
+EXPORT_SYMBOL(module_refcount);
/* This exists whether we can unload or not */
static void free_module(struct module *mod);
@@ -939,12 +940,12 @@ EXPORT_SYMBOL_GPL(__symbol_get);
/* Change all symbols so that sh_value encodes the pointer directly. */
static int simplify_symbols(Elf_Shdr *sechdrs,
unsigned int symindex,
- unsigned int strindex,
+ const char *strtab,
unsigned int versindex,
struct module *mod)
{
Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr;
- const char *strtab = (char *)sechdrs[strindex].sh_addr;
+
unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym);
int ret = 0;
@@ -1063,13 +1064,9 @@ static inline int license_is_gpl_compatible(const char *license)
|| strcmp(license, "Dual MPL/GPL") == 0);
}
-static void set_license(struct module *mod, Elf_Shdr *sechdrs, int licenseidx)
+static void set_license(struct module *mod, const char *license)
{
- char *license;
-
- if (licenseidx)
- license = (char *)sechdrs[licenseidx].sh_addr;
- else
+ if (!license)
license = "unspecified";
mod->license_gplok = license_is_gpl_compatible(license);
@@ -1080,6 +1077,40 @@ static void set_license(struct module *mod, Elf_Shdr *sechdrs, int licenseidx)
}
}
+/* Parse tag=value strings from .modinfo section */
+static char *next_string(char *string, unsigned long *secsize)
+{
+ /* Skip non-zero chars */
+ while (string[0]) {
+ string++;
+ if ((*secsize)-- <= 1)
+ return NULL;
+ }
+
+ /* Skip any zero padding. */
+ while (!string[0]) {
+ string++;
+ if ((*secsize)-- <= 1)
+ return NULL;
+ }
+ return string;
+}
+
+static char *get_modinfo(Elf_Shdr *sechdrs,
+ unsigned int info,
+ const char *tag)
+{
+ char *p;
+ unsigned int taglen = strlen(tag);
+ unsigned long size = sechdrs[info].sh_size;
+
+ for (p = (char *)sechdrs[info].sh_addr; p; p = next_string(p, &size)) {
+ if (strncmp(p, tag, taglen) == 0 && p[taglen] == '=')
+ return p + taglen + 1;
+ }
+ return NULL;
+}
+
/* Allocate and load the module: note that size of section 0 is always
zero, and we rely on this for optional sections. */
static struct module *load_module(void __user *umod,
@@ -1088,9 +1119,9 @@ static struct module *load_module(void __user *umod,
{
Elf_Ehdr *hdr;
Elf_Shdr *sechdrs;
- char *secstrings, *args;
- unsigned int i, symindex, exportindex, strindex, setupindex, exindex,
- modindex, obsparmindex, licenseindex, gplindex, vmagindex,
+ char *secstrings, *args, *modmagic, *strtab = NULL;
+ unsigned int i, symindex = 0, strindex = 0, setupindex, exindex,
+ exportindex, modindex, obsparmindex, infoindex, gplindex,
crcindex, gplcrcindex, versindex;
long arglen;
struct module *mod;
@@ -1124,6 +1155,7 @@ static struct module *load_module(void __user *umod,
/* Convenience variables */
sechdrs = (void *)hdr + hdr->e_shoff;
secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+ sechdrs[0].sh_addr = 0;
/* And these should exist, but gcc whinges if we don't init them */
symindex = strindex = 0;
@@ -1137,6 +1169,7 @@ static struct module *load_module(void __user *umod,
if (sechdrs[i].sh_type == SHT_SYMTAB) {
symindex = i;
strindex = sechdrs[i].sh_link;
+ strtab = (char *)hdr + sechdrs[strindex].sh_offset;
}
#ifndef CONFIG_MODULE_UNLOAD
/* Don't load .exit sections */
@@ -1145,12 +1178,6 @@ static struct module *load_module(void __user *umod,
#endif
}
-#ifdef CONFIG_KALLSYMS
- /* Keep symbol and string tables for decoding later. */
- sechdrs[symindex].sh_flags |= SHF_ALLOC;
- sechdrs[strindex].sh_flags |= SHF_ALLOC;
-#endif
-
modindex = find_sec(hdr, sechdrs, secstrings,
".gnu.linkonce.this_module");
if (!modindex) {
@@ -1168,9 +1195,16 @@ static struct module *load_module(void __user *umod,
setupindex = find_sec(hdr, sechdrs, secstrings, "__param");
exindex = find_sec(hdr, sechdrs, secstrings, "__ex_table");
obsparmindex = find_sec(hdr, sechdrs, secstrings, "__obsparm");
- licenseindex = find_sec(hdr, sechdrs, secstrings, ".init.license");
- vmagindex = find_sec(hdr, sechdrs, secstrings, "__vermagic");
versindex = find_sec(hdr, sechdrs, secstrings, "__versions");
+ infoindex = find_sec(hdr, sechdrs, secstrings, ".modinfo");
+
+ /* Don't keep modinfo section */
+ sechdrs[infoindex].sh_flags &= ~(unsigned long)SHF_ALLOC;
+#ifdef CONFIG_KALLSYMS
+ /* Keep symbol and string tables for decoding later. */
+ sechdrs[symindex].sh_flags |= SHF_ALLOC;
+ sechdrs[strindex].sh_flags |= SHF_ALLOC;
+#endif
/* Check module struct version now, before we try to use module. */
if (!check_modstruct_version(sechdrs, versindex, mod)) {
@@ -1178,14 +1212,15 @@ static struct module *load_module(void __user *umod,
goto free_hdr;
}
+ modmagic = get_modinfo(sechdrs, infoindex, "vermagic");
/* This is allowed: modprobe --force will invalidate it. */
- if (!vmagindex) {
+ if (!modmagic) {
tainted |= TAINT_FORCED_MODULE;
printk(KERN_WARNING "%s: no version magic, tainting kernel.\n",
mod->name);
- } else if (!same_magic((char *)sechdrs[vmagindex].sh_addr, vermagic)) {
+ } else if (!same_magic(modmagic, vermagic)) {
printk(KERN_ERR "%s: version magic '%s' should be '%s'\n",
- mod->name, (char*)sechdrs[vmagindex].sh_addr, vermagic);
+ mod->name, modmagic, vermagic);
err = -ENOEXEC;
goto free_hdr;
}
@@ -1265,11 +1300,11 @@ static struct module *load_module(void __user *umod,
/* Now we've moved module, initialize linked lists, etc. */
module_unload_init(mod);
- /* Set up license info based on contents of section */
- set_license(mod, sechdrs, licenseindex);
+ /* Set up license info based on the info section */
+ set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
/* Fix up syms, so that st_value is a pointer to location. */
- err = simplify_symbols(sechdrs, symindex, strindex, versindex, mod);
+ err = simplify_symbols(sechdrs, symindex, strtab, versindex, mod);
if (err < 0)
goto cleanup;
@@ -1300,8 +1335,7 @@ static struct module *load_module(void __user *umod,
for (i = 1; i < hdr->e_shnum; i++) {
const char *strtab = (char *)sechdrs[strindex].sh_addr;
if (sechdrs[i].sh_type == SHT_REL)
- err = apply_relocate(sechdrs, strtab, symindex, i,
- mod);
+ err = apply_relocate(sechdrs, strtab, symindex, i,mod);
else if (sechdrs[i].sh_type == SHT_RELA)
err = apply_relocate_add(sechdrs, strtab, symindex, i,
mod);
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index 73f99d99f9ac..a9afaec00bdd 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -1,5 +1,6 @@
#include <linux/percpu_counter.h>
+#include <linux/sched.h>
void percpu_counter_mod(struct percpu_counter *fbc, long amount)
{
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index e537462aaf58..db5bce62eebe 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -208,6 +208,11 @@ static void oom_kill(void)
*/
void out_of_memory(void)
{
+ /*
+ * oom_lock protects out_of_memory()'s static variables.
+ * It's a global lock; this is not performance-critical.
+ */
+ static spinlock_t oom_lock = SPIN_LOCK_UNLOCKED;
static unsigned long first, last, count, lastkill;
unsigned long now, since;
@@ -217,6 +222,7 @@ void out_of_memory(void)
if (nr_swap_pages > 0)
return;
+ spin_lock(&oom_lock);
now = jiffies;
since = now - last;
last = now;
@@ -235,14 +241,14 @@ void out_of_memory(void)
*/
since = now - first;
if (since < HZ)
- return;
+ goto out_unlock;
/*
* If we have gotten only a few failures,
* we're not really oom.
*/
if (++count < 10)
- return;
+ goto out_unlock;
/*
* If we just killed a process, wait a while
@@ -251,15 +257,27 @@ void out_of_memory(void)
*/
since = now - lastkill;
if (since < HZ*5)
- return;
+ goto out_unlock;
/*
* Ok, really out of memory. Kill something.
*/
lastkill = now;
+
+ /* oom_kill() sleeps */
+ spin_unlock(&oom_lock);
oom_kill();
+ spin_lock(&oom_lock);
reset:
- first = now;
+ /*
+ * We dropped the lock above, so check to be sure the variable
+ * first only ever increases to prevent false OOM's.
+ */
+ if (time_after(now, first))
+ first = now;
count = 0;
+
+out_unlock:
+ spin_unlock(&oom_lock);
}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index aa24e1d1c693..56b89071bfb9 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -557,6 +557,7 @@ static void
refill_inactive_zone(struct zone *zone, const int nr_pages_in,
struct page_state *ps, int priority)
{
+ int pgmoved;
int pgdeactivate = 0;
int nr_pages = nr_pages_in;
LIST_HEAD(l_hold); /* The pages which were snipped off */
@@ -570,6 +571,7 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
long swap_tendency;
lru_add_drain();
+ pgmoved = 0;
spin_lock_irq(&zone->lru_lock);
while (nr_pages && !list_empty(&zone->active_list)) {
page = list_entry(zone->active_list.prev, struct page, lru);
@@ -584,9 +586,11 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
} else {
page_cache_get(page);
list_add(&page->lru, &l_hold);
+ pgmoved++;
}
nr_pages--;
}
+ zone->nr_active -= pgmoved;
spin_unlock_irq(&zone->lru_lock);
/*
@@ -646,10 +650,10 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
continue;
}
list_add(&page->lru, &l_inactive);
- pgdeactivate++;
}
pagevec_init(&pvec, 1);
+ pgmoved = 0;
spin_lock_irq(&zone->lru_lock);
while (!list_empty(&l_inactive)) {
page = list_entry(l_inactive.prev, struct page, lru);
@@ -659,19 +663,27 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
if (!TestClearPageActive(page))
BUG();
list_move(&page->lru, &zone->inactive_list);
+ pgmoved++;
if (!pagevec_add(&pvec, page)) {
+ zone->nr_inactive += pgmoved;
spin_unlock_irq(&zone->lru_lock);
+ pgdeactivate += pgmoved;
+ pgmoved = 0;
if (buffer_heads_over_limit)
pagevec_strip(&pvec);
__pagevec_release(&pvec);
spin_lock_irq(&zone->lru_lock);
}
}
+ zone->nr_inactive += pgmoved;
+ pgdeactivate += pgmoved;
if (buffer_heads_over_limit) {
spin_unlock_irq(&zone->lru_lock);
pagevec_strip(&pvec);
spin_lock_irq(&zone->lru_lock);
}
+
+ pgmoved = 0;
while (!list_empty(&l_active)) {
page = list_entry(l_active.prev, struct page, lru);
prefetchw_prev_lru_page(page, &l_active, flags);
@@ -679,14 +691,16 @@ refill_inactive_zone(struct zone *zone, const int nr_pages_in,
BUG();
BUG_ON(!PageActive(page));
list_move(&page->lru, &zone->active_list);
+ pgmoved++;
if (!pagevec_add(&pvec, page)) {
+ zone->nr_active += pgmoved;
+ pgmoved = 0;
spin_unlock_irq(&zone->lru_lock);
__pagevec_release(&pvec);
spin_lock_irq(&zone->lru_lock);
}
}
- zone->nr_active -= pgdeactivate;
- zone->nr_inactive += pgdeactivate;
+ zone->nr_active += pgmoved;
spin_unlock_irq(&zone->lru_lock);
pagevec_release(&pvec);
diff --git a/net/802/psnap.c b/net/802/psnap.c
index aa4588c1fab2..c689454484b1 100644
--- a/net/802/psnap.c
+++ b/net/802/psnap.c
@@ -21,9 +21,9 @@
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/init.h>
-#include <linux/brlock.h>
-LIST_HEAD(snap_list);
+static LIST_HEAD(snap_list);
+static spinlock_t snap_lock = SPIN_LOCK_UNLOCKED;
static struct llc_sap *snap_sap;
/*
@@ -34,17 +34,13 @@ static struct datalink_proto *find_snap_client(unsigned char *desc)
struct list_head *entry;
struct datalink_proto *proto = NULL, *p;
- if (list_empty(&snap_list))
- goto out;
-
- list_for_each(entry, &snap_list) {
+ list_for_each_rcu(entry, &snap_list) {
p = list_entry(entry, struct datalink_proto, node);
if (!memcmp(p->type, desc, 5)) {
proto = p;
break;
}
}
-out:
return proto;
}
@@ -55,11 +51,13 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
int rc = 1;
- struct datalink_proto *proto = find_snap_client(skb->h.raw);
+ struct datalink_proto *proto;
static struct packet_type snap_packet_type = {
.type = __constant_htons(ETH_P_SNAP),
};
+ rcu_read_lock();
+ proto = find_snap_client(skb->h.raw);
if (proto) {
/* Pass the frame on. */
skb->h.raw += 5;
@@ -71,6 +69,7 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
rc = 1;
}
+ rcu_read_unlock();
return rc;
}
@@ -124,7 +123,7 @@ struct datalink_proto *register_snap_client(unsigned char *desc,
{
struct datalink_proto *proto = NULL;
- br_write_lock_bh(BR_NETPROTO_LOCK);
+ spin_lock_bh(&snap_lock);
if (find_snap_client(desc))
goto out;
@@ -135,10 +134,12 @@ struct datalink_proto *register_snap_client(unsigned char *desc,
proto->rcvfunc = rcvfunc;
proto->header_length = 5 + 3; /* snap + 802.2 */
proto->request = snap_request;
- list_add(&proto->node, &snap_list);
+ list_add_rcu(&proto->node, &snap_list);
}
out:
- br_write_unlock_bh(BR_NETPROTO_LOCK);
+ spin_unlock_bh(&snap_lock);
+
+ synchronize_net();
return proto;
}
@@ -147,12 +148,13 @@ out:
*/
void unregister_snap_client(struct datalink_proto *proto)
{
- br_write_lock_bh(BR_NETPROTO_LOCK);
+ spin_lock_bh(&snap_lock);
+ list_del_rcu(&proto->node);
+ spin_unlock_bh(&snap_lock);
- list_del(&proto->node);
- kfree(proto);
+ synchronize_net();
- br_write_unlock_bh(BR_NETPROTO_LOCK);
+ kfree(proto);
}
MODULE_LICENSE("GPL");
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 78d587584620..fc26712d2149 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -68,28 +68,6 @@ static __inline__ int br_mac_hash(unsigned char *mac)
return x & (BR_HASH_SIZE - 1);
}
-static __inline__ void __hash_link(struct net_bridge *br,
- struct net_bridge_fdb_entry *ent,
- int hash)
-{
- ent->next_hash = br->hash[hash];
- if (ent->next_hash != NULL)
- ent->next_hash->pprev_hash = &ent->next_hash;
- br->hash[hash] = ent;
- ent->pprev_hash = &br->hash[hash];
-}
-
-static __inline__ void __hash_unlink(struct net_bridge_fdb_entry *ent)
-{
- *(ent->pprev_hash) = ent->next_hash;
- if (ent->next_hash != NULL)
- ent->next_hash->pprev_hash = ent->pprev_hash;
- ent->next_hash = NULL;
- ent->pprev_hash = NULL;
-}
-
-
-
void br_fdb_changeaddr(struct net_bridge_port *p, unsigned char *newaddr)
{
struct net_bridge *br;
@@ -99,22 +77,24 @@ void br_fdb_changeaddr(struct net_bridge_port *p, unsigned char *newaddr)
br = p->br;
write_lock_bh(&br->hash_lock);
for (i=0;i<BR_HASH_SIZE;i++) {
- struct net_bridge_fdb_entry *f;
+ struct hlist_node *h;
+
+ hlist_for_each(h, &br->hash[i]) {
+ struct net_bridge_fdb_entry *f
+ = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
- f = br->hash[i];
- while (f != NULL) {
if (f->dst == p && f->is_local) {
memcpy(f->addr.addr, newaddr, ETH_ALEN);
if (newhash != i) {
- __hash_unlink(f);
- __hash_link(br, f, newhash);
+ hlist_del(&f->hlist);
+ hlist_add_head(&f->hlist,
+ &br->hash[newhash]);
}
- write_unlock_bh(&br->hash_lock);
- return;
+ goto out;
}
- f = f->next_hash;
}
}
+ out:
write_unlock_bh(&br->hash_lock);
}
@@ -127,19 +107,16 @@ void br_fdb_cleanup(struct net_bridge *br)
write_lock_bh(&br->hash_lock);
for (i=0;i<BR_HASH_SIZE;i++) {
- struct net_bridge_fdb_entry *f;
-
- f = br->hash[i];
- while (f != NULL) {
- struct net_bridge_fdb_entry *g;
-
- g = f->next_hash;
+ struct hlist_node *h, *g;
+
+ hlist_for_each_safe(h, g, &br->hash[i]) {
+ struct net_bridge_fdb_entry *f
+ = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
if (!f->is_static &&
time_before_eq(f->ageing_timer, timeout)) {
- __hash_unlink(f);
+ hlist_del(&f->hlist);
br_fdb_put(f);
}
- f = g;
}
}
write_unlock_bh(&br->hash_lock);
@@ -151,18 +128,15 @@ void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
write_lock_bh(&br->hash_lock);
for (i=0;i<BR_HASH_SIZE;i++) {
- struct net_bridge_fdb_entry *f;
-
- f = br->hash[i];
- while (f != NULL) {
- struct net_bridge_fdb_entry *g;
-
- g = f->next_hash;
+ struct hlist_node *h, *g;
+
+ hlist_for_each_safe(h, g, &br->hash[i]) {
+ struct net_bridge_fdb_entry *f
+ = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
if (f->dst == p) {
- __hash_unlink(f);
+ hlist_del(&f->hlist);
br_fdb_put(f);
}
- f = g;
}
}
write_unlock_bh(&br->hash_lock);
@@ -170,25 +144,24 @@ void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br, unsigned char *addr)
{
- struct net_bridge_fdb_entry *fdb;
+ struct hlist_node *h;
read_lock_bh(&br->hash_lock);
- fdb = br->hash[br_mac_hash(addr)];
- while (fdb != NULL) {
+
+ hlist_for_each(h, &br->hash[br_mac_hash(addr)]) {
+ struct net_bridge_fdb_entry *fdb
+ = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
+
if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
- if (!has_expired(br, fdb)) {
- atomic_inc(&fdb->use_count);
- read_unlock_bh(&br->hash_lock);
- return fdb;
- }
+ if (has_expired(br, fdb))
+ goto ret_null;
+ atomic_inc(&fdb->use_count);
read_unlock_bh(&br->hash_lock);
- return NULL;
+ return fdb;
}
-
- fdb = fdb->next_hash;
}
-
+ ret_null:
read_unlock_bh(&br->hash_lock);
return NULL;
}
@@ -213,12 +186,16 @@ int br_fdb_get_entries(struct net_bridge *br,
read_lock_bh(&br->hash_lock);
for (i=0;i<BR_HASH_SIZE;i++) {
- struct net_bridge_fdb_entry *f;
-
- for (f = br->hash[i]; f != NULL && num < maxnum;
- f = f->next_hash) {
+ struct hlist_node *h;
+
+ hlist_for_each(h, &br->hash[i]) {
+ struct net_bridge_fdb_entry *f
+ = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
struct __fdb_entry ent;
+ if (num >= maxnum)
+ goto out;
+
if (has_expired(br, f))
continue;
@@ -277,14 +254,15 @@ void br_fdb_insert(struct net_bridge *br,
unsigned char *addr,
int is_local)
{
+ struct hlist_node *h;
struct net_bridge_fdb_entry *fdb;
int hash;
hash = br_mac_hash(addr);
write_lock_bh(&br->hash_lock);
- fdb = br->hash[hash];
- while (fdb != NULL) {
+ hlist_for_each(h, &br->hash[hash]) {
+ fdb = hlist_entry(h, struct net_bridge_fdb_entry, hlist);
if (!fdb->is_local &&
!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
__fdb_possibly_replace(fdb, source, is_local);
@@ -292,7 +270,6 @@ void br_fdb_insert(struct net_bridge *br,
return;
}
- fdb = fdb->next_hash;
}
fdb = kmalloc(sizeof(*fdb), GFP_ATOMIC);
@@ -308,7 +285,7 @@ void br_fdb_insert(struct net_bridge *br,
fdb->is_static = is_local;
fdb->ageing_timer = jiffies;
- __hash_link(br, fdb, hash);
+ hlist_add_head(&fdb->hlist, &br->hash[hash]);
write_unlock_bh(&br->hash_lock);
}
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index aff11add0268..5ddd034fa0fe 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -43,8 +43,7 @@ struct mac_addr
struct net_bridge_fdb_entry
{
- struct net_bridge_fdb_entry *next_hash;
- struct net_bridge_fdb_entry **pprev_hash;
+ struct hlist_node hlist;
atomic_t use_count;
mac_addr addr;
struct net_bridge_port *dst;
@@ -86,7 +85,7 @@ struct net_bridge
struct net_device dev;
struct net_device_stats statistics;
rwlock_t hash_lock;
- struct net_bridge_fdb_entry *hash[BR_HASH_SIZE];
+ struct hlist_head hash[BR_HASH_SIZE];
struct timer_list tick;
/* STP */
diff --git a/net/core/netfilter.c b/net/core/netfilter.c
index 1ef2cf1b71e3..432157079ff4 100644
--- a/net/core/netfilter.c
+++ b/net/core/netfilter.c
@@ -550,6 +550,7 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
unsigned int verdict)
{
struct list_head *elem = &info->elem->list;
+ struct list_head *i;
rcu_read_lock();
@@ -592,10 +593,6 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
info->indev, info->outdev, info->okfn))
goto next_hook;
break;
-
- case NF_DROP:
- kfree_skb(skb);
- break;
}
rcu_read_unlock();
@@ -611,6 +608,10 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
}
#endif
+
+ if (verdict == NF_DROP)
+ kfree_skb(skb);
+
kfree(info);
return;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index bb68b12b0047..c6d5e32b6a5b 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -20,6 +20,7 @@
* Ray VanTassle : Fixed --skb->lock in free
* Alan Cox : skb_copy copy arp field
* Andi Kleen : slabified it.
+ * Robert Olsson : Removed skb_head_pool
*
* NOTE:
* The __skb_ routines should be called with interrupts
@@ -63,15 +64,8 @@
#include <asm/uaccess.h>
#include <asm/system.h>
-int sysctl_hot_list_len = 128;
-
static kmem_cache_t *skbuff_head_cache;
-static union {
- struct sk_buff_head list;
- char pad[SMP_CACHE_BYTES];
-} skb_head_pool[NR_CPUS];
-
/*
* Keep out-of-line to prevent kernel bloat.
* __builtin_return_address is not used because it is not always
@@ -109,44 +103,6 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here)
BUG();
}
-static __inline__ struct sk_buff *skb_head_from_pool(void)
-{
- struct sk_buff_head *list;
- struct sk_buff *skb = NULL;
- unsigned long flags;
-
- local_irq_save(flags);
-
- list = &skb_head_pool[smp_processor_id()].list;
-
- if (skb_queue_len(list))
- skb = __skb_dequeue(list);
-
- local_irq_restore(flags);
- return skb;
-}
-
-static __inline__ void skb_head_to_pool(struct sk_buff *skb)
-{
- struct sk_buff_head *list;
- unsigned long flags;
-
- local_irq_save(flags);
-
- list = &skb_head_pool[smp_processor_id()].list;
-
- if (skb_queue_len(list) < sysctl_hot_list_len) {
- __skb_queue_head(list, skb);
- local_irq_restore(flags);
-
- return;
- }
-
- local_irq_restore(flags);
- kmem_cache_free(skbuff_head_cache, skb);
-}
-
-
/* Allocate a new skbuff. We do this ourselves so we can fill in a few
* 'private' fields and also do memory statistics to find all the
* [BEEP] leaks.
@@ -174,13 +130,10 @@ struct sk_buff *alloc_skb(unsigned int size, int gfp_mask)
might_sleep();
/* Get the HEAD */
- skb = skb_head_from_pool();
- if (!skb) {
- skb = kmem_cache_alloc(skbuff_head_cache,
- gfp_mask & ~__GFP_DMA);
- if (!skb)
- goto out;
- }
+ skb = kmem_cache_alloc(skbuff_head_cache,
+ gfp_mask & ~__GFP_DMA);
+ if (!skb)
+ goto out;
/* Get the DATA. Size must match skb_add_mtu(). */
size = SKB_DATA_ALIGN(size);
@@ -204,7 +157,7 @@ struct sk_buff *alloc_skb(unsigned int size, int gfp_mask)
out:
return skb;
nodata:
- skb_head_to_pool(skb);
+ kmem_cache_free(skbuff_head_cache, skb);
skb = NULL;
goto out;
}
@@ -254,7 +207,7 @@ static void skb_release_data(struct sk_buff *skb)
void kfree_skbmem(struct sk_buff *skb)
{
skb_release_data(skb);
- skb_head_to_pool(skb);
+ kmem_cache_free(skbuff_head_cache, skb);
}
/**
@@ -309,13 +262,10 @@ void __kfree_skb(struct sk_buff *skb)
struct sk_buff *skb_clone(struct sk_buff *skb, int gfp_mask)
{
- struct sk_buff *n = skb_head_from_pool();
+ struct sk_buff *n = kmem_cache_alloc(skbuff_head_cache, gfp_mask);
- if (!n) {
- n = kmem_cache_alloc(skbuff_head_cache, gfp_mask);
- if (!n)
- return NULL;
- }
+ if (!n)
+ return NULL;
#define C(x) n->x = skb->x
@@ -1204,8 +1154,6 @@ void skb_add_mtu(int mtu)
void __init skb_init(void)
{
- int i;
-
skbuff_head_cache = kmem_cache_create("skbuff_head_cache",
sizeof(struct sk_buff),
0,
@@ -1213,7 +1161,4 @@ void __init skb_init(void)
NULL, NULL);
if (!skbuff_head_cache)
panic("cannot create skbuff cache");
-
- for (i = 0; i < NR_CPUS; i++)
- skb_queue_head_init(&skb_head_pool[i].list);
}
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index bbf8e7d82b62..3e38ed82429b 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -28,7 +28,6 @@ extern __u32 sysctl_rmem_default;
extern int sysctl_core_destroy_delay;
extern int sysctl_optmem_max;
-extern int sysctl_hot_list_len;
#ifdef CONFIG_NET_DIVERT
extern char sysctl_divert_version[];
@@ -150,14 +149,6 @@ ctl_table core_table[] = {
.mode = 0644,
.proc_handler = &proc_dointvec
},
- {
- .ctl_name = NET_CORE_HOT_LIST_LENGTH,
- .procname = "hot_list_length",
- .data = &sysctl_hot_list_len,
- .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = &proc_dointvec
- },
#ifdef CONFIG_NET_DIVERT
{
.ctl_name = NET_CORE_DIVERT_VERSION,
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 98e7caad4b49..302eac537f30 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -263,7 +263,7 @@ int ip_mc_output(struct sk_buff *skb)
newskb->dev, ip_dev_loopback_xmit);
}
- if (skb->len > dev->mtu || skb_shinfo(skb)->frag_list)
+ if (skb->len > dst_pmtu(&rt->u.dst) || skb_shinfo(skb)->frag_list)
return ip_fragment(skb, ip_finish_output);
else
return ip_finish_output(skb);
@@ -273,7 +273,7 @@ int ip_output(struct sk_buff *skb)
{
IP_INC_STATS(IpOutRequests);
- if ((skb->len > skb->dst->dev->mtu || skb_shinfo(skb)->frag_list) &&
+ if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) &&
!skb_shinfo(skb)->tso_size)
return ip_fragment(skb, ip_finish_output);
else
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index be61533ccf93..0571696c7cc6 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -433,7 +433,7 @@ out:
fl.fl4_src = eiph->saddr;
fl.fl4_tos = eiph->tos;
if (ip_route_output_key(&rt, &fl) ||
- rt->u.dst.dev->type != ARPHRD_IPGRE) {
+ rt->u.dst.dev->type != ARPHRD_TUNNEL) {
ip_rt_put(rt);
kfree_skb(skb2);
return;
@@ -441,7 +441,7 @@ out:
} else {
ip_rt_put(rt);
if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, skb2->dev) ||
- skb2->dst->dev->type != ARPHRD_IPGRE) {
+ skb2->dst->dev->type != ARPHRD_TUNNEL) {
kfree_skb(skb2);
return;
}
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 241b7bca8fca..776b4378c75f 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -11,7 +11,7 @@
* connections.
*
* Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
- * 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2002-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -623,7 +623,8 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags)
struct sk_buff *skb;
int rc = -EOPNOTSUPP;
- dprintk("%s: accepting on %02X\n", __FUNCTION__, llc_sk(sk)->addr.sllc_ssap);
+ dprintk("%s: accepting on %02X\n", __FUNCTION__,
+ llc_sk(sk)->addr.sllc_ssap);
lock_sock(sk);
if (sk->type != SOCK_STREAM)
goto out;
@@ -634,7 +635,8 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags)
rc = llc_ui_wait_for_data(sk, sk->rcvtimeo);
if (rc)
goto out;
- dprintk("%s: got a new connection on %02X\n", __FUNCTION__, llc_sk(sk)->addr.sllc_ssap);
+ dprintk("%s: got a new connection on %02X\n", __FUNCTION__,
+ llc_sk(sk)->addr.sllc_ssap);
skb = skb_dequeue(&sk->receive_queue);
rc = -EINVAL;
if (!skb->sk)
@@ -692,8 +694,9 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
timeout = sock_rcvtimeo(sk, noblock);
rc = llc_ui_wait_for_data(sk, timeout);
if (rc) {
- dprintk("%s: llc_ui_wait_for_data failed recv in %02X from %02X\n",
- __FUNCTION__, llc_sk(sk)->laddr.lsap, llc_sk(sk)->daddr.lsap);
+ dprintk("%s: llc_ui_wait_for_data failed recv "
+ "in %02X from %02X\n", __FUNCTION__,
+ llc_sk(sk)->laddr.lsap, llc_sk(sk)->daddr.lsap);
goto out;
}
skb = skb_dequeue(&sk->receive_queue);
@@ -742,7 +745,8 @@ static int llc_ui_sendmsg(struct kiocb *iocb, struct socket *sock,
struct sk_buff *skb;
int rc = -EINVAL, size = 0, copied = 0, hdrlen;
- dprintk("%s: sending from %02X to %02X\n", __FUNCTION__, llc->laddr.lsap, llc->daddr.lsap);
+ dprintk("%s: sending from %02X to %02X\n", __FUNCTION__,
+ llc->laddr.lsap, llc->daddr.lsap);
lock_sock(sk);
if (addr) {
if (msg->msg_namelen < sizeof(*addr))
@@ -906,49 +910,49 @@ static int llc_ui_setsockopt(struct socket *sock, int level, int optname,
goto out;
rc = -EINVAL;
switch (optname) {
- case LLC_OPT_RETRY:
- if (opt > LLC_OPT_MAX_RETRY)
- goto out;
- llc->n2 = opt;
- break;
- case LLC_OPT_SIZE:
- if (opt > LLC_OPT_MAX_SIZE)
- goto out;
- llc->n1 = opt;
- break;
- case LLC_OPT_ACK_TMR_EXP:
- if (opt > LLC_OPT_MAX_ACK_TMR_EXP)
- goto out;
- llc->ack_timer.expire = opt;
- break;
- case LLC_OPT_P_TMR_EXP:
- if (opt > LLC_OPT_MAX_P_TMR_EXP)
- goto out;
- llc->pf_cycle_timer.expire = opt;
- break;
- case LLC_OPT_REJ_TMR_EXP:
- if (opt > LLC_OPT_MAX_REJ_TMR_EXP)
- goto out;
- llc->rej_sent_timer.expire = opt;
- break;
- case LLC_OPT_BUSY_TMR_EXP:
- if (opt > LLC_OPT_MAX_BUSY_TMR_EXP)
- goto out;
- llc->busy_state_timer.expire = opt;
- break;
- case LLC_OPT_TX_WIN:
- if (opt > LLC_OPT_MAX_WIN)
- goto out;
- llc->k = opt;
- break;
- case LLC_OPT_RX_WIN:
- if (opt > LLC_OPT_MAX_WIN)
- goto out;
- llc->rw = opt;
- break;
- default:
- rc = -ENOPROTOOPT;
+ case LLC_OPT_RETRY:
+ if (opt > LLC_OPT_MAX_RETRY)
+ goto out;
+ llc->n2 = opt;
+ break;
+ case LLC_OPT_SIZE:
+ if (opt > LLC_OPT_MAX_SIZE)
+ goto out;
+ llc->n1 = opt;
+ break;
+ case LLC_OPT_ACK_TMR_EXP:
+ if (opt > LLC_OPT_MAX_ACK_TMR_EXP)
+ goto out;
+ llc->ack_timer.expire = opt;
+ break;
+ case LLC_OPT_P_TMR_EXP:
+ if (opt > LLC_OPT_MAX_P_TMR_EXP)
+ goto out;
+ llc->pf_cycle_timer.expire = opt;
+ break;
+ case LLC_OPT_REJ_TMR_EXP:
+ if (opt > LLC_OPT_MAX_REJ_TMR_EXP)
goto out;
+ llc->rej_sent_timer.expire = opt;
+ break;
+ case LLC_OPT_BUSY_TMR_EXP:
+ if (opt > LLC_OPT_MAX_BUSY_TMR_EXP)
+ goto out;
+ llc->busy_state_timer.expire = opt;
+ break;
+ case LLC_OPT_TX_WIN:
+ if (opt > LLC_OPT_MAX_WIN)
+ goto out;
+ llc->k = opt;
+ break;
+ case LLC_OPT_RX_WIN:
+ if (opt > LLC_OPT_MAX_WIN)
+ goto out;
+ llc->rw = opt;
+ break;
+ default:
+ rc = -ENOPROTOOPT;
+ goto out;
}
rc = 0;
out:
@@ -983,25 +987,25 @@ static int llc_ui_getsockopt(struct socket *sock, int level, int optname,
if (len != sizeof(int))
goto out;
switch (optname) {
- case LLC_OPT_RETRY:
- val = llc->n2; break;
- case LLC_OPT_SIZE:
- val = llc->n1; break;
- case LLC_OPT_ACK_TMR_EXP:
- val = llc->ack_timer.expire; break;
- case LLC_OPT_P_TMR_EXP:
- val = llc->pf_cycle_timer.expire; break;
- case LLC_OPT_REJ_TMR_EXP:
- val = llc->rej_sent_timer.expire; break;
- case LLC_OPT_BUSY_TMR_EXP:
- val = llc->busy_state_timer.expire; break;
- case LLC_OPT_TX_WIN:
- val = llc->k; break;
- case LLC_OPT_RX_WIN:
- val = llc->rw; break;
- default:
- rc = -ENOPROTOOPT;
- goto out;
+ case LLC_OPT_RETRY:
+ val = llc->n2; break;
+ case LLC_OPT_SIZE:
+ val = llc->n1; break;
+ case LLC_OPT_ACK_TMR_EXP:
+ val = llc->ack_timer.expire; break;
+ case LLC_OPT_P_TMR_EXP:
+ val = llc->pf_cycle_timer.expire; break;
+ case LLC_OPT_REJ_TMR_EXP:
+ val = llc->rej_sent_timer.expire; break;
+ case LLC_OPT_BUSY_TMR_EXP:
+ val = llc->busy_state_timer.expire; break;
+ case LLC_OPT_TX_WIN:
+ val = llc->k; break;
+ case LLC_OPT_RX_WIN:
+ val = llc->rw; break;
+ default:
+ rc = -ENOPROTOOPT;
+ goto out;
}
rc = 0;
if (put_user(len, optlen) || copy_to_user(optval, &val, len))
@@ -1038,7 +1042,8 @@ static struct proto_ops llc_ui_ops = {
};
static char llc_ui_banner[] __initdata =
- KERN_INFO "NET4.0 IEEE 802.2 BSD sockets, Jay Schulist, 2001, Arnaldo C. Melo, 2002\n";
+ KERN_INFO "NET4.0 IEEE 802.2 BSD sockets, Jay Schulist, 2001, "
+ "Arnaldo C. Melo, 2002-2003\n";
int __init llc_ui_init(void)
{
diff --git a/net/llc/llc_actn.c b/net/llc/llc_actn.c
index 07f144745113..b17943a5c222 100644
--- a/net/llc/llc_actn.c
+++ b/net/llc/llc_actn.c
@@ -8,7 +8,7 @@
* them return 0 On success and 1 otherwise.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c
index 634bf598da72..fb559316cf4a 100644
--- a/net/llc/llc_c_ac.c
+++ b/net/llc/llc_c_ac.c
@@ -8,7 +8,7 @@
* them return 0 On success and 1 otherwise.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -145,33 +145,32 @@ int llc_conn_ac_rst_ind(struct sock *sk, struct sk_buff *skb)
struct llc_opt *llc = llc_sk(sk);
switch (ev->type) {
- case LLC_CONN_EV_TYPE_PDU:
- if (!LLC_PDU_IS_RSP(pdu) &&
- !LLC_PDU_TYPE_IS_U(pdu) &&
- LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_FRMR) {
- reason = LLC_RESET_REASON_LOCAL;
- rc = 0;
- } else if (!LLC_PDU_IS_CMD(pdu) &&
- !LLC_PDU_TYPE_IS_U(pdu) &&
- LLC_U_PDU_CMD(pdu) ==
- LLC_2_PDU_CMD_SABME) {
- reason = LLC_RESET_REASON_REMOTE;
- rc = 0;
- } else {
- reason = 0;
- rc = 1;
- }
- break;
- case LLC_CONN_EV_TYPE_ACK_TMR:
- case LLC_CONN_EV_TYPE_P_TMR:
- case LLC_CONN_EV_TYPE_REJ_TMR:
- case LLC_CONN_EV_TYPE_BUSY_TMR:
- if (llc->retry_count > llc->n2) {
- reason = LLC_RESET_REASON_LOCAL;
- rc = 0;
- } else
- rc = 1;
- break;
+ case LLC_CONN_EV_TYPE_PDU:
+ if (!LLC_PDU_IS_RSP(pdu) &&
+ !LLC_PDU_TYPE_IS_U(pdu) &&
+ LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_FRMR) {
+ reason = LLC_RESET_REASON_LOCAL;
+ rc = 0;
+ } else if (!LLC_PDU_IS_CMD(pdu) &&
+ !LLC_PDU_TYPE_IS_U(pdu) &&
+ LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_SABME) {
+ reason = LLC_RESET_REASON_REMOTE;
+ rc = 0;
+ } else {
+ reason = 0;
+ rc = 1;
+ }
+ break;
+ case LLC_CONN_EV_TYPE_ACK_TMR:
+ case LLC_CONN_EV_TYPE_P_TMR:
+ case LLC_CONN_EV_TYPE_REJ_TMR:
+ case LLC_CONN_EV_TYPE_BUSY_TMR:
+ if (llc->retry_count > llc->n2) {
+ reason = LLC_RESET_REASON_LOCAL;
+ rc = 0;
+ } else
+ rc = 1;
+ break;
}
if (!rc) {
ev->reason = reason;
diff --git a/net/llc/llc_c_ev.c b/net/llc/llc_c_ev.c
index 85c1489b0a66..883e550afe24 100644
--- a/net/llc/llc_c_ev.c
+++ b/net/llc/llc_c_ev.c
@@ -24,7 +24,7 @@
* in their comments, at below.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -485,11 +485,11 @@ int llc_conn_ev_rx_xxx_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb)
rc = 0;
} else if (!LLC_PDU_TYPE_IS_U(pdu))
switch (LLC_U_PDU_CMD(pdu)) {
- case LLC_2_PDU_CMD_SABME:
- case LLC_2_PDU_CMD_DISC:
- if (!LLC_U_PF_IS_0(pdu))
- rc = 0;
- break;
+ case LLC_2_PDU_CMD_SABME:
+ case LLC_2_PDU_CMD_DISC:
+ if (!LLC_U_PF_IS_0(pdu))
+ rc = 0;
+ break;
}
}
return rc;
@@ -505,10 +505,10 @@ int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb)
rc = 0;
else if (!LLC_PDU_TYPE_IS_U(pdu))
switch (LLC_U_PDU_CMD(pdu)) {
- case LLC_2_PDU_CMD_SABME:
- case LLC_2_PDU_CMD_DISC:
- rc = 0;
- break;
+ case LLC_2_PDU_CMD_SABME:
+ case LLC_2_PDU_CMD_DISC:
+ rc = 0;
+ break;
}
}
return rc;
@@ -525,12 +525,12 @@ int llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb)
rc = 0;
} else if (!LLC_PDU_TYPE_IS_U(pdu))
switch (LLC_U_PDU_RSP(pdu)) {
- case LLC_2_PDU_RSP_UA:
- case LLC_2_PDU_RSP_DM:
- case LLC_2_PDU_RSP_FRMR:
- if (!LLC_U_PF_IS_1(pdu))
- rc = 0;
- break;
+ case LLC_2_PDU_RSP_UA:
+ case LLC_2_PDU_RSP_DM:
+ case LLC_2_PDU_RSP_FRMR:
+ if (!LLC_U_PF_IS_1(pdu))
+ rc = 0;
+ break;
}
}
return rc;
@@ -546,11 +546,11 @@ int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb)
rc = 0;
else if (!LLC_PDU_TYPE_IS_U(pdu))
switch (LLC_U_PDU_RSP(pdu)) {
- case LLC_2_PDU_RSP_UA:
- case LLC_2_PDU_RSP_DM:
- case LLC_2_PDU_RSP_FRMR:
- rc = 0;
- break;
+ case LLC_2_PDU_RSP_UA:
+ case LLC_2_PDU_RSP_DM:
+ case LLC_2_PDU_RSP_FRMR:
+ rc = 0;
+ break;
}
}
@@ -566,13 +566,13 @@ int llc_conn_ev_rx_xxx_yyy(struct sock *sk, struct sk_buff *skb)
rc = 0;
else if (!LLC_PDU_TYPE_IS_U(pdu))
switch (LLC_U_PDU_CMD(pdu)) {
- case LLC_2_PDU_CMD_SABME:
- case LLC_2_PDU_CMD_DISC:
- case LLC_2_PDU_RSP_UA:
- case LLC_2_PDU_RSP_DM:
- case LLC_2_PDU_RSP_FRMR:
- rc = 0;
- break;
+ case LLC_2_PDU_CMD_SABME:
+ case LLC_2_PDU_CMD_DISC:
+ case LLC_2_PDU_RSP_UA:
+ case LLC_2_PDU_RSP_DM:
+ case LLC_2_PDU_RSP_FRMR:
+ rc = 0;
+ break;
}
return rc;
}
diff --git a/net/llc/llc_c_st.c b/net/llc/llc_c_st.c
index f058df37981c..818a9428823b 100644
--- a/net/llc/llc_c_st.c
+++ b/net/llc/llc_c_st.c
@@ -5,7 +5,7 @@
* or in "llc_c_ac.c" and "llc_c_ev.c" modules.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
index 9859d2a2a46b..e2fa705c8f58 100644
--- a/net/llc/llc_conn.c
+++ b/net/llc/llc_conn.c
@@ -2,7 +2,7 @@
* llc_conn.c - Driver routines for connection component.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -84,7 +84,8 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb)
goto out_kfree_skb;
}
- if (!ev->ind_prim && !ev->cfm_prim) { /* indicate or confirm not required */
+ if (!ev->ind_prim && !ev->cfm_prim) {
+ /* indicate or confirm not required */
if (!skb->list)
goto out_kfree_skb;
goto out_skb_put;
@@ -625,17 +626,17 @@ static int llc_find_offset(int state, int ev_type)
* init_pf_cycle and I don't know what is it.
*/
switch (ev_type) {
- case LLC_CONN_EV_TYPE_PRIM:
- rc = llc_offset_table[state][0]; break;
- case LLC_CONN_EV_TYPE_PDU:
- rc = llc_offset_table[state][4]; break;
- case LLC_CONN_EV_TYPE_SIMPLE:
- rc = llc_offset_table[state][1]; break;
- case LLC_CONN_EV_TYPE_P_TMR:
- case LLC_CONN_EV_TYPE_ACK_TMR:
- case LLC_CONN_EV_TYPE_REJ_TMR:
- case LLC_CONN_EV_TYPE_BUSY_TMR:
- rc = llc_offset_table[state][3]; break;
+ case LLC_CONN_EV_TYPE_PRIM:
+ rc = llc_offset_table[state][0]; break;
+ case LLC_CONN_EV_TYPE_PDU:
+ rc = llc_offset_table[state][4]; break;
+ case LLC_CONN_EV_TYPE_SIMPLE:
+ rc = llc_offset_table[state][1]; break;
+ case LLC_CONN_EV_TYPE_P_TMR:
+ case LLC_CONN_EV_TYPE_ACK_TMR:
+ case LLC_CONN_EV_TYPE_REJ_TMR:
+ case LLC_CONN_EV_TYPE_BUSY_TMR:
+ rc = llc_offset_table[state][3]; break;
}
return rc;
}
diff --git a/net/llc/llc_evnt.c b/net/llc/llc_evnt.c
index 6cc65d502c44..654650f5a4f5 100644
--- a/net/llc/llc_evnt.c
+++ b/net/llc/llc_evnt.c
@@ -7,7 +7,7 @@
* them return 0 On success and 1 otherwise.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c
index 7806f24a2bf8..7736ea2920e1 100644
--- a/net/llc/llc_if.c
+++ b/net/llc/llc_if.c
@@ -2,7 +2,7 @@
* llc_if.c - Defines LLC interface to upper layer
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_mac.c b/net/llc/llc_mac.c
index 74cadcee49d0..b78696665109 100644
--- a/net/llc/llc_mac.c
+++ b/net/llc/llc_mac.c
@@ -2,7 +2,7 @@
* llc_mac.c - Manages interface between LLC and MAC
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -78,7 +78,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
}
sap = llc_sap_find(pdu->dsap);
if (!sap) {/* unknown SAP */
- dprintk("%s: llc_sap_find(%02X) failed!\n", __FUNCTION__, pdu->dsap);
+ dprintk("%s: llc_sap_find(%02X) failed!\n", __FUNCTION__,
+ pdu->dsap);
goto drop;
}
llc_decode_pdu_type(skb, &dest);
@@ -255,41 +256,41 @@ u16 lan_hdrs_init(struct sk_buff *skb, u8 *sa, u8 *da)
switch (skb->dev->type) {
#ifdef CONFIG_TR
- case ARPHRD_IEEE802_TR: {
- struct trh_hdr *trh;
- struct net_device *dev = skb->dev;
+ case ARPHRD_IEEE802_TR: {
+ struct trh_hdr *trh;
+ struct net_device *dev = skb->dev;
- trh = (struct trh_hdr *)skb_push(skb, sizeof(*trh));
- trh->ac = AC;
- trh->fc = LLC_FRAME;
- if (sa)
- memcpy(trh->saddr, sa, dev->addr_len);
- else
- memset(trh->saddr, 0, dev->addr_len);
- if (da) {
- memcpy(trh->daddr, da, dev->addr_len);
- tr_source_route(skb, trh, dev);
- }
- skb->mac.raw = skb->data;
- break;
+ trh = (struct trh_hdr *)skb_push(skb, sizeof(*trh));
+ trh->ac = AC;
+ trh->fc = LLC_FRAME;
+ if (sa)
+ memcpy(trh->saddr, sa, dev->addr_len);
+ else
+ memset(trh->saddr, 0, dev->addr_len);
+ if (da) {
+ memcpy(trh->daddr, da, dev->addr_len);
+ tr_source_route(skb, trh, dev);
}
+ skb->mac.raw = skb->data;
+ break;
+ }
#endif
- case ARPHRD_ETHER:
- case ARPHRD_LOOPBACK: {
- unsigned short len = skb->len;
- struct ethhdr *eth;
+ case ARPHRD_ETHER:
+ case ARPHRD_LOOPBACK: {
+ unsigned short len = skb->len;
+ struct ethhdr *eth;
- skb->mac.raw = skb_push(skb, sizeof(*eth));
- eth = (struct ethhdr *)skb->mac.raw;
- eth->h_proto = htons(len);
- memcpy(eth->h_dest, da, ETH_ALEN);
- memcpy(eth->h_source, sa, ETH_ALEN);
- break;
- }
- default:
- printk(KERN_WARNING "Unknown DEVICE type : %d\n",
- skb->dev->type);
- rc = 1;
+ skb->mac.raw = skb_push(skb, sizeof(*eth));
+ eth = (struct ethhdr *)skb->mac.raw;
+ eth->h_proto = htons(len);
+ memcpy(eth->h_dest, da, ETH_ALEN);
+ memcpy(eth->h_source, sa, ETH_ALEN);
+ break;
+ }
+ default:
+ printk(KERN_WARNING "Unknown DEVICE type : %d\n",
+ skb->dev->type);
+ rc = 1;
}
return rc;
}
diff --git a/net/llc/llc_main.c b/net/llc/llc_main.c
index 4bd21823a05f..5d8d1602bb9e 100644
--- a/net/llc/llc_main.c
+++ b/net/llc/llc_main.c
@@ -3,7 +3,7 @@
* and connections of the LLC.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -600,5 +600,5 @@ module_init(llc_init);
module_exit(llc_exit);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Procom, 1997, Arnaldo C. Melo, Jay Schullist, 2001, 2002");
+MODULE_AUTHOR("Procom, 1997, Arnaldo C. Melo, Jay Schullist, 2001-2003");
MODULE_DESCRIPTION("LLC 2.0, NET4.0 IEEE 802.2 extended support");
diff --git a/net/llc/llc_pdu.c b/net/llc/llc_pdu.c
index 8da9ddea65be..c99273a5d21b 100644
--- a/net/llc/llc_pdu.c
+++ b/net/llc/llc_pdu.c
@@ -2,7 +2,7 @@
* llc_pdu.c - access to PDU internals
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -63,13 +63,13 @@ void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value)
pdu = llc_pdu_sn_hdr(skb);
switch (pdu_type) {
- case LLC_PDU_TYPE_I:
- case LLC_PDU_TYPE_S:
- pdu->ctrl_2 = (pdu->ctrl_2 & 0xFE) | bit_value;
- break;
- case LLC_PDU_TYPE_U:
- pdu->ctrl_1 |= (pdu->ctrl_1 & 0xEF) | (bit_value << 4);
- break;
+ case LLC_PDU_TYPE_I:
+ case LLC_PDU_TYPE_S:
+ pdu->ctrl_2 = (pdu->ctrl_2 & 0xFE) | bit_value;
+ break;
+ case LLC_PDU_TYPE_U:
+ pdu->ctrl_1 |= (pdu->ctrl_1 & 0xEF) | (bit_value << 4);
+ break;
}
}
@@ -91,13 +91,13 @@ void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit)
pdu = llc_pdu_sn_hdr(skb);
switch (pdu_type) {
- case LLC_PDU_TYPE_I:
- case LLC_PDU_TYPE_S:
- *pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK;
- break;
- case LLC_PDU_TYPE_U:
- *pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4;
- break;
+ case LLC_PDU_TYPE_I:
+ case LLC_PDU_TYPE_S:
+ *pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK;
+ break;
+ case LLC_PDU_TYPE_U:
+ *pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4;
+ break;
}
}
@@ -547,20 +547,20 @@ void llc_decode_pdu_type(struct sk_buff *skb, u8 *dest)
if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) != LLC_PDU_TYPE_U)
goto out;
switch (LLC_U_PDU_CMD(pdu)) {
- case LLC_1_PDU_CMD_XID:
- case LLC_1_PDU_CMD_UI:
- case LLC_1_PDU_CMD_TEST:
- type = LLC_DEST_SAP;
- break;
- case LLC_2_PDU_CMD_SABME:
- case LLC_2_PDU_CMD_DISC:
- case LLC_2_PDU_RSP_UA:
- case LLC_2_PDU_RSP_DM:
- case LLC_2_PDU_RSP_FRMR:
- break;
- default:
- type = LLC_DEST_INVALID;
- break;
+ case LLC_1_PDU_CMD_XID:
+ case LLC_1_PDU_CMD_UI:
+ case LLC_1_PDU_CMD_TEST:
+ type = LLC_DEST_SAP;
+ break;
+ case LLC_2_PDU_CMD_SABME:
+ case LLC_2_PDU_CMD_DISC:
+ case LLC_2_PDU_RSP_UA:
+ case LLC_2_PDU_RSP_DM:
+ case LLC_2_PDU_RSP_FRMR:
+ break;
+ default:
+ type = LLC_DEST_INVALID;
+ break;
}
out:
*dest = type;
@@ -604,13 +604,13 @@ static u8 llc_pdu_get_pf_bit(struct llc_pdu_sn *pdu)
} else
pdu_type = LLC_PDU_TYPE_I;
switch (pdu_type) {
- case LLC_PDU_TYPE_I:
- case LLC_PDU_TYPE_S:
- pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK;
- break;
- case LLC_PDU_TYPE_U:
- pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4;
- break;
+ case LLC_PDU_TYPE_I:
+ case LLC_PDU_TYPE_S:
+ pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK;
+ break;
+ case LLC_PDU_TYPE_U:
+ pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4;
+ break;
}
return pf_bit;
}
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 517834b99e5c..50aaf724bde9 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -2,7 +2,7 @@
* proc_llc.c - proc interface for LLC
*
* Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
- * 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2002-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_s_ac.c b/net/llc/llc_s_ac.c
index 27421a8f284b..1a67f2ef1a56 100644
--- a/net/llc/llc_s_ac.c
+++ b/net/llc/llc_s_ac.c
@@ -8,7 +8,7 @@
* them return 0 On success and 1 otherwise.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_s_ev.c b/net/llc/llc_s_ev.c
index 3b1e02f88dcd..949ade268067 100644
--- a/net/llc/llc_s_ev.c
+++ b/net/llc/llc_s_ev.c
@@ -5,7 +5,7 @@
* in 802.2 LLC protocol standard document.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_s_st.c b/net/llc/llc_s_st.c
index 8fb09a1743e2..6a43201aa32e 100644
--- a/net/llc/llc_s_st.c
+++ b/net/llc/llc_s_st.c
@@ -5,7 +5,7 @@
* which are described in 802.2 LLC protocol standard document.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index 7cd6bb115a8b..bcbab8bfaf8b 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -2,7 +2,7 @@
* llc_sap.c - driver routines for SAP component.
*
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/llc/llc_stat.c b/net/llc/llc_stat.c
index 52fee9e005b9..06f071dc95a7 100644
--- a/net/llc/llc_stat.c
+++ b/net/llc/llc_stat.c
@@ -2,7 +2,7 @@
* llc_stat.c - Implementation of LLC station component state machine
* transitions
* Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index a578156cab91..0958503dcca7 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -65,37 +65,38 @@ struct tcf_proto_ops * tcf_proto_lookup_ops(struct rtattr *kind)
int register_tcf_proto_ops(struct tcf_proto_ops *ops)
{
struct tcf_proto_ops *t, **tp;
+ int rc = -EEXIST;
write_lock(&cls_mod_lock);
- for (tp = &tcf_proto_base; (t=*tp) != NULL; tp = &t->next) {
- if (strcmp(ops->kind, t->kind) == 0) {
- write_unlock(&cls_mod_lock);
- return -EEXIST;
- }
- }
+ for (tp = &tcf_proto_base; (t = *tp) != NULL; tp = &t->next)
+ if (!strcmp(ops->kind, t->kind))
+ goto out;
ops->next = NULL;
*tp = ops;
+ rc = 0;
+out:
write_unlock(&cls_mod_lock);
- return 0;
+ return rc;
}
int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
{
struct tcf_proto_ops *t, **tp;
+ int rc = -ENOENT;
write_lock(&cls_mod_lock);
for (tp = &tcf_proto_base; (t=*tp) != NULL; tp = &t->next)
if (t == ops)
break;
- if (!t) {
- write_unlock(&cls_mod_lock);
- return -ENOENT;
- }
+ if (!t)
+ goto out;
*tp = t->next;
+ rc = 0;
+out:
write_unlock(&cls_mod_lock);
- return 0;
+ return rc;
}
static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n,
@@ -371,11 +372,8 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
q = dev->qdisc_sleeping;
else
q = qdisc_lookup(dev, TC_H_MAJ(tcm->tcm_parent));
- if (q == NULL) {
- read_unlock(&qdisc_tree_lock);
- dev_put(dev);
- return skb->len;
- }
+ if (!q)
+ goto out;
if ((cops = q->ops->cl_ops) == NULL)
goto errout;
if (TC_H_MIN(tcm->tcm_parent)) {
@@ -425,7 +423,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
errout:
if (cl)
cops->put(q, cl);
-
+out:
read_unlock(&qdisc_tree_lock);
dev_put(dev);
return skb->len;
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index a3053c225806..caca242d22a6 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -152,7 +152,7 @@ static int fw_delete(struct tcf_proto *tp, unsigned long arg)
struct fw_filter **fp;
if (head == NULL || f == NULL)
- return -EINVAL;
+ goto out;
for (fp=&head->ht[fw_hash(f->id)]; *fp; fp = &(*fp)->next) {
if (*fp == f) {
@@ -171,6 +171,7 @@ static int fw_delete(struct tcf_proto *tp, unsigned long arg)
return 0;
}
}
+out:
return -EINVAL;
}
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index cf9f3fefa526..96488808098a 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -203,17 +203,17 @@ static __inline__ struct tc_u_knode *
u32_lookup_key(struct tc_u_hnode *ht, u32 handle)
{
unsigned sel;
- struct tc_u_knode *n;
+ struct tc_u_knode *n = NULL;
sel = TC_U32_HASH(handle);
if (sel > ht->divisor)
- return 0;
+ goto out;
for (n = ht->ht[sel]; n; n = n->next)
if (n->handle == handle)
- return n;
-
- return NULL;
+ break;
+out:
+ return n;
}
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 857a2d824222..30c3586ce0b0 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -139,21 +139,19 @@ static rwlock_t qdisc_mod_lock = RW_LOCK_UNLOCKED;
/* The list of all installed queueing disciplines. */
-static struct Qdisc_ops *qdisc_base = NULL;
+static struct Qdisc_ops *qdisc_base;
/* Register/uregister queueing discipline */
int register_qdisc(struct Qdisc_ops *qops)
{
struct Qdisc_ops *q, **qp;
+ int rc = -EEXIST;
write_lock(&qdisc_mod_lock);
- for (qp = &qdisc_base; (q=*qp)!=NULL; qp = &q->next) {
- if (strcmp(qops->id, q->id) == 0) {
- write_unlock(&qdisc_mod_lock);
- return -EEXIST;
- }
- }
+ for (qp = &qdisc_base; (q = *qp) != NULL; qp = &q->next)
+ if (!strcmp(qops->id, q->id))
+ goto out;
if (qops->enqueue == NULL)
qops->enqueue = noop_qdisc_ops.enqueue;
@@ -164,8 +162,10 @@ int register_qdisc(struct Qdisc_ops *qops)
qops->next = NULL;
*qp = qops;
+ rc = 0;
+out:
write_unlock(&qdisc_mod_lock);
- return 0;
+ return rc;
}
int unregister_qdisc(struct Qdisc_ops *qops)
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 48a63bae0124..134b7c870583 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -45,7 +45,7 @@
/* Thanks to Doron Oz for this hack
*/
-static int nf_registered = 0;
+static int nf_registered;
struct ingress_qdisc_data {
struct Qdisc *q;
@@ -237,14 +237,12 @@ used on the egress (might slow things for an iota)
}
/* after ipt_filter */
-static struct nf_hook_ops ing_ops =
-{
- { NULL, NULL},
- ing_hook,
- THIS_MODULE,
- PF_INET,
- NF_IP_PRE_ROUTING,
- NF_IP_PRI_FILTER + 1
+static struct nf_hook_ops ing_ops = {
+ .hook = ing_hook,
+ .owner = THIS_MODULE,
+ .pf = PF_INET,
+ .hooknum = NF_IP_PRE_ROUTING,
+ .priority = NF_IP_PRI_FILTER + 1,
};
int ingress_init(struct Qdisc *sch,struct rtattr *opt)
@@ -255,7 +253,7 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
if (nf_register_hook(&ing_ops) < 0) {
printk("ingress qdisc registration error \n");
goto error;
- }
+ }
nf_registered++;
}
diff --git a/scripts/modpost.c b/scripts/modpost.c
index 1b94b2c73b28..13c33ccca090 100644
--- a/scripts/modpost.c
+++ b/scripts/modpost.c
@@ -404,9 +404,7 @@ add_header(struct buffer *b)
buf_printf(b, "#include <linux/vermagic.h>\n");
buf_printf(b, "#include <linux/compiler.h>\n");
buf_printf(b, "\n");
- buf_printf(b, "const char vermagic[]\n");
- buf_printf(b, "__attribute__((section(\"__vermagic\"))) =\n");
- buf_printf(b, "VERMAGIC_STRING;\n");
+ buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
}
/* Record CRCs for unresolved symbols */